1 2013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
3 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
5 2013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7 * casetab.c (init_casetab_once): Fix last change (bug#14424).
9 2013-05-22 Kenichi Handa <handa@gnu.org>
11 The following changes are to fix the setting of
12 buffer-file-coding-system on, for instance, C-x RET c unix RET
13 _FILE_OF_DOS_EOL_TYPE_ RET.
15 * coding.h (struct coding_system): New member detected_utf8_chars.
17 * coding.c (detect_coding_utf_8): Count characters and check EOL
18 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
20 (setup_coding_system): Do not initialize coding->head_ascii.
21 (check_ascii): Do not set coding->eol_seen but update it. Do not
22 call adjust_coding_eol_type here.
23 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
24 If the eol-type of CODING is already specified, adjust the eol type
25 of the found coding-system.
26 (decode_coding_gap): Cancel previous change. Utilize the
27 character numbers counted by detect_coding_utf_8. Fix detection
30 2013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
32 * search.c (looking_at_1): Only set last_thing_searched if the match
33 changed the match-data (bug#14281).
35 2013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
37 * xdisp.c (reseat_at_previous_visible_line_start):
38 Already declared in dispextern.h, so remove it here.
39 (move_it_vertically_backward): Likewise.
41 2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
43 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
44 (Fx_display_pixel_width, Fx_display_pixel_height)
45 (Fx_display_mm_width, Fx_display_mm_height):
46 Mention `display-monitor-attributes-list' in docstrings.
48 * nsfns.m (ns_get_screen): Remove function. All uses removed.
49 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
50 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
51 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
52 (Fx_display_backing_store, Fx_display_visual_class)
53 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
54 (Fx_display_grayscale_p, Fx_display_pixel_width)
55 (Fx_display_pixel_height, Fx_display_planes)
56 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
57 (Fx_display_screens): Don't confuse X11 screens with NS screens.
58 (Fx_display_mm_width, Fx_display_mm_height)
59 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
60 height for all physical monitors as in X11.
62 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
63 Return pixel width or height for all physical monitors as in X11.
65 2013-05-18 Paul Eggert <eggert@cs.ucla.edu>
67 Port --enable-gcc-warnings to clang.
68 * bytecode.c (exec_byte_code):
70 Redo diagnostic pragmas to pacify clang, too.
71 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
72 * editfns.c (Fencode_time):
73 * fileio.c (file_accessible_directory_p):
74 * font.c (font_unparse_xlfd):
75 Use '&"string"[index]' instead of '"string" + (index)'.
76 * undo.c (user_error): Remove; unused.
78 2013-05-16 Eli Zaretskii <eliz@gnu.org>
80 * insdel.c (insert_1_both): Document the arguments, instead of
81 referring to insert_1, which no longer exists.
83 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
84 some window, increment windows_or_buffers_changed, so that
85 *Messages* display in that window is updated. (Bug#14408)
87 * w32.c: Include epaths.h.
88 (init_environment): Use cmdproxy.exe without leading directories.
89 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
91 (gettimeofday): Adjust signature and return value to Posix
94 * unexw32.c (open_output_file): Delete the existing emacs.exe
95 before creating it, to break the hard link to the versioned
98 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
99 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
100 (FIRSTFILE_OBJ): New variables.
101 (W32_RES): Rename to EMACSRES. All users changed.
102 (base_obj): Use $(CM_OBJ).
103 (ALLOBJS): Use $(FIRSTFILE_OBJ).
104 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
105 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
106 $(W32_RES_LINK) before $(LIBES).
107 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
109 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
111 * makefile.w32-in (DOC): Use just "DOC".
113 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
115 * process.c: Export default filters and sentinels to Elisp.
116 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
118 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
119 (Fset_process_sentinel, Fformat_network_address):
120 Default to them instead of nil.
121 (server_accept_connection): Sentinels can't be nil any more.
122 (read_and_dispose_of_process_output): New function, extracted from
124 (read_process_output): Use it; filters can't be nil.
125 (Finternal_default_process_filter): New function, extracted from
127 (exec_sentinel_unwind): Remove function.
128 (exec_sentinel): Don't zilch sentinel while running.
129 (status_notify): Sentinels can't be nil.
130 (Finternal_default_process_sentinel): New function extracted from
132 (setup_process_coding_systems): Default filter is not nil any more.
133 (syms_of_process): Export new Elisp functions and initialize
135 * lisp.h (make_lisp_proc): New function.
137 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
139 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
141 2013-05-14 Eli Zaretskii <eliz@gnu.org>
143 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
144 unless we know that the window w is a leaf window.
145 Another attempt at solving bug#14062.
147 2013-05-14 Jan Djärv <jan.h.d@swipnet.se>
149 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
152 2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
154 * image.c (gif_load): Check that subimages fit (Bug#14345).
156 2013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
158 * lread.c (skip_dyn_eof): New function.
159 (read1): Use it to skip the end of a file in response to #@00.
161 * doc.c (get_doc_string): Slightly relax the sanity checking.
163 2013-05-09 Jan Djärv <jan.h.d@swipnet.se>
165 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
166 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
167 (MonitorInfo): New struct.
168 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
169 (Fns_display_monitor_attributes_list): New functions.
170 (display-usable-bounds): Remove.
171 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
174 2013-05-09 Paul Eggert <eggert@cs.ucla.edu>
176 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
177 (GTK_CHECK_VERSION): New macro, if not already defined.
178 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
179 replaced by GTK_CHECK_VERSION.
181 2013-05-08 Paul Eggert <eggert@cs.ucla.edu>
183 * xterm.h (GTK_PREREQ): New macro.
184 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
185 to use this macro instead, for consistency and clarity.
187 2013-05-08 Eli Zaretskii <eliz@gnu.org>
189 * xdisp.c (row_for_charpos_p): New function, with code of
190 cursor_row_p, but accepts an additional argument CHARPOS instead
191 of using a hardcoded PT.
192 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
193 (row_containing_pos): Call row_for_charpos_p instead of partially
194 doing the same. Fixes cursor positioning under longlines-mode
195 when longlines-show-effect includes more than one newline, when
196 moving the cursor vertically up.
198 2013-05-08 Juanma Barranquero <lekktu@gmail.com>
200 * makefile.w32-in (ACL_H): New macro.
201 ($(BLD)/fileio.$(O)): Update dependencies.
203 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
205 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
206 * Makefile.in (LIB_ACL): New macro.
207 (LIBACL_LIBS): Remove.
208 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
209 * fileio.c: Include <acl.h>.
210 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
211 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
213 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
216 * unexelf.c: Don't assume ElfW (Half) fits in int.
217 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
218 when dealing with ElfW (Half) values, since they can exceed 2**31
219 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
220 (entry_address): Omit unused NUM arg. All uses changed.
222 2013-05-07 Juri Linkov <juri@jurta.org>
224 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
225 to the string converted from number with `Fnumber_to_string'.
228 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
230 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
231 This fixes a problem introduced by my previous change.
233 2013-05-07 Glenn Morris <rgm@gnu.org>
235 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
237 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
239 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
241 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
243 Static checking by GCC 4.8.0.
244 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
245 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
246 (x_get_monitor_attributes_fallback)
247 (x_get_monitor_attributes_xinerama)
248 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
249 Define only if USE_GTK.
250 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
251 (x_get_monitor_attributes_fallback): Omit unused locals.
252 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
253 Use double, not float, to avoid mixed-mode floating point arithmetic.
255 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
256 Jan Djärv <jan.h.d@swipnet.se>
258 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
259 (XINERAMA_CFLAGS): New macros.
260 (ALL_CFLAGS, LIBES): Use them.
262 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
263 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
264 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
265 (syms_of_xfns): DEFSYM them.
266 (struct MonitorInfo): New struct.
267 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
268 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
269 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
270 (x_get_monitor_attributes_xinerama): New functions.
271 (Fx_display_monitor_attributes_list): New primitive.
272 (syms_of_xfns): Defsubr it.
274 * xterm.h (x_display_info): Add Xatom_net_workarea and
275 Xatom_net_current_desktop.
277 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
278 and dpyinfo->Xatom_net_current_desktop.
280 2013-05-06 Eli Zaretskii <eliz@gnu.org>
282 * xdisp.c (pos_visible_p): Use the special code for finding the
283 beginning of a display property or overlay for any "replacing"
284 display property, not just for display strings. This solves
285 incorrect reporting of position by posn-at-point. (Bug#14241)
287 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
289 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
290 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
291 Verify that ElfW (Half) fits in int.
292 (fatal): Use same signature as lisp.h.
293 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
294 configure and build with -DUNEXELF_DEBUG without worrying about
295 other modules that use DEBUG.
296 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
297 possibly-wide integers now uses it instead of plain fprintf.
298 (entry_address): New function, which avoids problems with 32-bit
299 overflow on 64-bit hosts.
300 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
301 (round_up): Don't assume the remainder fits in int.
302 (find_section): Use bool for boolean. Simplify debug code.
303 (unexec): Don't assume file sizes fit in int or size_t.
304 Omit unnecessary trailing newline in 'fatal' format.
305 Use strerror rather than outputting decimal error number.
306 Remove unused code when emacs is not defined;
307 this file relies on Emacs now.
308 Don't assume e_phnum and e_shnum are positive.
310 * regex.c: Fix problems when DEBUG is defined.
311 (extract_number, extract_number_and_incr): Define regardless of
312 whether DEBUG is defined; that's simpler and makes the code less
313 likely to go stale in the normal case when DEBUG is not defined.
314 Return int rather than taking an int * arg. All callers changed.
315 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
316 Remove, replacing with ...
317 (DEBUG_PRINT): New macro. All callers changed.
318 (DEBUG_COMPILES_ARGUMENTS): New macro.
319 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
320 (print_compiled_pattern, print_double_string) [DEBUG]:
321 Use prototype rather than old-style definition.
322 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
323 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
324 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
325 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
326 Don't assume ptrdiff_t, size_t, and long are the same width as int.
327 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
328 This matters only when DEBUG is defined.
330 2013-05-05 Eli Zaretskii <eliz@gnu.org>
332 * xdisp.c (set_iterator_to_next): Set the
333 ignore_overlay_strings_at_pos_p flag only if we are _really_
334 iterating over an overlay string, as indicated by the
335 current.overlay_string_index member. (Bug#14306)
337 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
339 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
340 to where it is used, to avoid autorelease issues (Bug#14050).
342 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
344 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
345 * fileio.c (syms_of_fileio): Implement this.
346 * filelock.c (create_lock_file): If symbolic links don't work, so
347 we use a regular file as a lock file, do not fsync the lock file;
350 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
352 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
353 (syms_of_minibuf): Adjust accodingly.
355 * callint.c (Fcall_interactively): Adjust calls accordingly.
357 2013-05-04 Eli Zaretskii <eliz@gnu.org>
359 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
360 w->contents is a buffer before computing everything else.
361 Use parentheses to disambiguate last part of the condition.
363 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
364 assertion violations. (Bug#14062)
366 2013-05-01 David Reitter <david.reitter@gmail.com>
368 * nsfns.m (ns_tooltip): Initialize.
370 2013-04-28 Eli Zaretskii <eliz@gnu.org>
372 * coding.c (decode_coding_gap): Don't remove the character before
373 a newline unless it's a CR character. (Bug#14287)
375 2013-04-28 Dan Nicolaescu <dann@gnu.org>
377 * dispextern.h (struct face): Move enum face_underline_type
378 earlier so that bitfields can be in the same word.
380 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
382 * nsfns.m (handlePanelKeys): New function.
383 (EmacsOpenPanel:performKeyEquivalent:)
384 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
385 arrows/function/control and copy/paste keys (Bug#14296).
387 2013-04-27 Juri Linkov <juri@jurta.org>
389 * callint.c (Fcall_interactively): Call `Qread_number' for
390 interactive code letter `n' instead of using duplicate code.
393 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
395 * systime.h (make_timeval): Declare as 'const'.
397 2013-04-27 Kenichi Handa <handa@gnu.org>
399 * font.c (font_open_entity): Always open a font of manageable
402 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
404 Port better to AIX (Bug#14258).
405 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
408 2013-04-24 Kenichi Handa <handa@gnu.org>
410 * coding.c (decode_coding_iso_2022): When an invalid escape
411 sequence is encountered, reset the invocation and designation
412 status to the safest one.
414 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
416 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
417 Without this fix, "make distclean" leaves stamp-h1 behind.
419 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
421 * w32fns.c (w32_fullscreen_rect): New function to compute the
422 window rectangle for the given fullscreen mode.
423 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
424 longer tunes the window size. This keeps the window's edges flush
425 with the screen and allows the taskbar to hide itself in fullboth.
427 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
428 window decorations and uses the entire screen.
430 * w32term.h (w32_fullscreen_rect) Add prototype.
431 (struct w32_output): Replace normal_width, normal_height,
432 normal_top, and normal_left members with a single normal_placement
434 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
436 (FRAME_NORMAL_PLACEMENT): New macro.
438 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
440 * minibuf.c (Ftest_completion): Silence compiler warning.
442 2013-04-15 Eli Zaretskii <eliz@gnu.org>
444 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
447 * frame.h (WINDOW_FRAME): Protect macro and its argument with
450 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
451 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
452 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
453 parentheses where appropriate.
455 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
457 * keyboard.c (timer_start_idle): Remove no-longer-used local.
459 2013-04-14 Eli Zaretskii <eliz@gnu.org>
461 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
462 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
463 Mention in the doc string that setting these variables takes
464 effect only after a call to set-window-buffer. (Bug#14200)
466 2013-04-13 Eli Zaretskii <eliz@gnu.org>
468 * indent.c (Fvertical_motion): Don't consider display strings on
469 overlay strings as display strings on the buffer position we
470 started from. This prevents vertical cursor motion from jumping
471 more than one line when there's an overlay string with a display
472 property at end of line.
473 Reported by Karl Chen <Karl.Chen@quarl.org> in
474 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
476 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
478 * window.c (select_window): `record_buffer' even if window is
479 already selected (bug#14191).
481 2013-04-11 Eli Zaretskii <eliz@gnu.org>
483 * window.c (Fwindow_end): Test more flags, including the buffer's
484 last_overlay_modified flag, to determine whether the window's
485 display is really up-to-date. Prevents the function from
486 returning a stale value. (Bug#14170)
487 (Fwindow_line_height): Fix the test for up-to-date-ness of the
490 2013-04-10 Eli Zaretskii <eliz@gnu.org>
492 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
493 garbaged only if it is not already the top frame on its TTY.
494 This prevents flickering due to constant redrawing of TTY frames when
495 there are GUI frames open in the same session. (Bug#13864)
497 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
499 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
500 of marking the idle timers directly.
502 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
504 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
507 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
509 * window.c (select_window): Don't record_buffer while the invariant is
510 temporarily broken (bug#14161).
512 * fns.c (Fdelq): Don't assume !NILP => CONSP.
514 2013-04-07 Eli Zaretskii <eliz@gnu.org>
516 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
518 2013-04-07 Romain Francoise <romain@orebokech.com>
520 Ignore additional platform-specific ACL errors (Bug#13702).
521 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
522 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
524 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
526 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
529 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
531 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
532 This bug was introduced by my 2013-02-25 change that simplified
533 data_start configuration. Without this change, on GNU/Linux
534 an Emacs configured with --enable-profiling fails immediately
535 due to a profiler signal.
536 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
537 with these flags. On platforms where special flags are needed
538 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
539 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
540 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
542 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
544 Get rid of some platform-specific functions examining window
545 system and its capabilities. This is a partial rework of the
547 * lisp.h (have_menus_p): Remove prototype. This function is
548 replaced with platform-independent window_system_available.
549 (check_window_system): Move to...
550 * frame.h (decode_window_system_frame, window_system_available):
551 ...here, add new prototypes.
552 * frame.c (window_system_available, decode_window_system_frame):
554 (check_window_system): Platform-independent now.
555 * xterm.h (x_in_use): Remove declaration.
557 * w32term.h (check_x_frame):
558 * nsterm.h (check_x_frame): Remove prototypes. This function
559 is replaced with platform-independent decode_window_system_frame.
560 * msdos.c (have_menus_p): Remove.
561 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
562 Remove platform-specific functions. Use check_window_system,
563 decode_window_system_frame and check_ns_display_info where
564 appropriate. Minor style and comment tweaks.
565 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
566 (check_x_frame): Likewise.
567 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
569 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
570 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
571 * xmenu.c, xselect.c: All related users changed.
573 2013-04-03 Kenichi Handa <handa@gnu.org>
575 The following changes is to optimize the code for reading UTF-8
578 * coding.c (check_ascii): Rename from detect_ascii. Return value
579 changed. Check EOL format. Do not call adjust_coding_eol_type
581 (check_utf_8): New function.
582 (adjust_coding_eol_type): Do nothing if already adjusted.
583 (detect_coding): Compare the return value of check_ascii with
584 coding->src_bytes. Call adjust_coding_eol_type if necessary.
585 (decode_coding_gap): Optimize for valid UTF-8.
587 2013-03-21 Kenichi Handa <handa@gnu.org>
589 * coding.c (syms_of_coding): Cancel previous change.
591 * insdel.c (insert_from_gap): Fix previous change.
593 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
595 Consistently use platform-specific function to detect window system.
596 * lisp.h (check_window_system): New prototype. This function is
597 going to replace check_x, check_w32 and check_ns.
598 (have_menus_p): Mention msdos.c in comment.
599 * fontset.c (check_window_system_func): Remove. Adjust all users.
600 * fontset.h (check_window_system_func): Remove prototype.
601 * nsterm.h (check_ns):
603 * w32term.h (check_w32): Likewise.
604 * menu.c (Fx_popup_menu): Use check_window_system.
605 * msdos.c (check_window_system): Define for MS-DOS.
606 * nsfns.m (check_window_system): Define for NS. Adjust all users.
607 * w32fns.c (check_window_system): Likewise for MS-Windows.
608 * xfns.c (check_window_system): Likewise for X.
609 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
610 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
612 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
614 Prefer < to > in range checks such as 0 <= i && i < N.
615 This makes it easier to visualize quantities on a number line.
616 This patch doesn't apply to all such range checks,
617 only to the range checks affected by the 2013-03-24 change.
618 This patch reverts most of the 2013-03-24 change.
619 * alloc.c (xpalloc, Fgarbage_collect):
620 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
621 * character.c (string_escape_byte8):
622 * charset.c (read_hex):
623 * data.c (cons_to_unsigned):
624 * dispnew.c (update_frame_1):
625 * doc.c (Fsubstitute_command_keys):
627 * editfns.c (hi_time, decode_time_components):
628 * fileio.c (file_offset):
629 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
630 * font.c (font_intern_prop):
631 * frame.c (x_set_alpha):
632 * gtkutil.c (get_utf8_string):
633 * indent.c (check_display_width):
634 * keymap.c (Fkey_description):
635 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
637 * minibuf.c (read_minibuf_noninteractive):
638 * process.c (wait_reading_process_output):
639 * search.c (Freplace_match):
640 * window.c (get_phys_cursor_glyph):
641 * xdisp.c (redisplay_internal):
642 * xsmfns.c (smc_save_yourself_CB):
643 Prefer < to > for range checks.
644 * dispnew.c (sit_for): Don't mishandle NaNs.
645 This fixes a bug introduced in the 2013-03-24 change.
646 * editfns.c (decode_time_components): Don't hoist comparison.
647 This fixes another bug introduced in the 2013-03-24 change.
649 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
651 * frame.h (struct frame): Drop scroll_bottom_vpos
652 member becaue all real users are dead long ago.
653 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
654 * xdisp.c (redisplay_internal): Adjust user.
656 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
658 * nsmenu.m (showAtX:Y:for:): setLevel to
659 NSPopUpMenuWindowLevel (Bug#13998).
661 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
663 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
664 (ns_check_pending_open_menu): Declare.
666 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
667 (x_activate_menubar): Update the menu with title that matches
668 ns_get_pending_menu_title, and call
669 ns_check_pending_openmenu (Bug#12698).
670 (menuWillOpen:): New method.
671 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
673 * nsterm.m (menu_will_open_state, menu_mouse_point)
674 (menu_pending_title): New varaibles.
675 (ns_get_pending_menu_title, ns_check_menu_open)
676 (ns_check_pending_open_menu): New functions.
678 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
680 * indent.c (current_column_bol_cache): Remove leftover which is not
681 used in Fmove_to_column any more.
682 (current_column, scan_for_column): Adjust users.
683 * keyboard.c (last_point_position_buffer, last_point_position_window):
684 Remove leftovers which are not used for recording undo any more.
685 (command_loop_1, syms_of_keyboard): Adjust users.
686 * xdisp.c (last_max_ascent): Remove leftover which is not used in
687 redisplay_window any more.
688 (move_it_to): Adjust user.
690 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
692 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
695 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
697 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
698 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
701 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
703 * window.h (struct window): Replace hchild, vchild and buffer slots
704 with the only contents slot. This is possible because each valid
705 window may have either the child window (in vertical or horizontal
706 combination) or buffer to display (for the leaf window). Using that,
707 a lof of operations to traverse and/or change window hierarchies may
708 be simplified. New member horizontal is used to distinguish between
709 horizontal and vertical combinations of internal windows.
710 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
711 (WINDOW_VERTICAL_COMBINATION_P): New macros.
712 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
713 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
714 Use contents slot, not buffer, where appropriate.
715 (wset_combination): New function.
716 (wset_buffer): Add eassert.
717 (Fframe_first_window): Simplify the loop reaching first window.
718 (Fwindow_buffer): Use WINDOW_LEAF_P.
719 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
720 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
721 (unshow_buffer): Convert initial debugging check to eassert.
722 (replace_window, recombine_windows, Fdelete_other_windows_internal)
723 (make_parent_window, window_resize_check, window_resize_apply)
724 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
725 (Fset_window_configuration, delete_all_child_windows, save_window_save):
726 Adjust to match struct window changes.
727 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
728 (mark_window_cursors_off, count_windows, get_leaf_windows)
729 (foreach_window_1): Simplify the loop.
730 * alloc.c (mark_object): Do not check for the leaf window because
731 internal windows has no glyph matrices anyway.
732 * dispnew.c (clear_window_matrices, showing_window_margins_p)
733 (allocate_matrices_for_window_redisplay, fake_current_matrices)
734 (allocate_matrices_for_frame_redisplay, free_window_matrices)
735 (build_frame_matrix_from_window_tree, mirror_make_current)
736 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
737 (update_window_tree, set_window_update_flags): Simplify the loop.
738 (sync_window_with_frame_matrix_rows): Enforce live window.
739 Use contents slot, not buffer, where appropriate.
740 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
741 and WINDOW_HORIZONTAL_COMBINATION_P.
742 (make_frame_visible_1): Simplify the loop.
743 Use contents slot, not buffer, where appropriate.
744 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
745 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
746 (expose_window_tree): Likewise.
747 Use contents slot, not buffer, where appropriate.
748 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
749 to avoid deleted windows. Use contents slot instead of buffer.
750 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
751 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
752 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
753 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
755 2013-03-28 Eli Zaretskii <eliz@gnu.org>
757 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
758 identify the reasons for assertion violations in bug#14062 and
760 (Fx_show_tip): Fix compilation error under
761 "--enable-check-lisp-object-type". (Bug#14073)
763 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
764 Reported by <rzl24ozi@gmail.com>.
766 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
768 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
770 (unwind_with_echo_area_buffer): ...to restore it here.
771 This is needed to ensure that...
772 (redisplay_window): ...both window markers are valid here,
773 which is verified by eassert.
774 * editfns.c (save_excursion_save): Do not assume that
775 selected_window always displays the buffer.
776 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
779 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
781 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
784 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
786 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
788 2013-03-27 Eli Zaretskii <eliz@gnu.org>
790 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
791 since MinGW's w32api headers do. This avoids compiler warnings.
793 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
796 2013-03-26 Eli Zaretskii <eliz@gnu.org>
798 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
800 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
802 * gtkutil.c (style_changed_cb): Check if frame is live and an
805 2013-03-26 Eli Zaretskii <eliz@gnu.org>
807 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
808 Define only for _WIN32_WINNT less than 0x0500.
809 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
811 Move inclusion of time.h before sys/time.h, so that MinGW64 could
812 see its own definitions of 'struct timeval' and 'struct timezone'.
814 Fix incompatibilities between MinGW.org and MinGW64 headers.
815 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
817 * w32.c (REPARSE_DATA_BUFFER): Guard with
818 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
820 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
822 * xterm.c: Include X11/XKBlib.h
823 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
825 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
827 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
829 * blockinput.h (input_blocked_p): Likewise.
830 * bytecode.c (exec_byte_code): Likewise.
831 * callproc.c (call_process_kill, call_process_cleanup)
832 (Fcall_process): Likewise.
833 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
834 (Fccl_execute_on_string): Likewise.
835 * character.c (string_escape_byte8): Likewise.
836 * charset.c (read_hex): Likewise.
837 * cm.c (calccost): Likewise.
838 * data.c (cons_to_unsigned): Likewise.
839 * dired.c (directory_files_internal, file_name_completion):
841 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
843 * doc.c (Fsubstitute_command_keys): Likewise.
844 * doprnt.c (doprnt): Likewise.
845 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
846 * emacsgtkfixed.c: Likewise.
847 * fileio.c (file_offset, Fwrite_region): Likewise.
848 * floatfns.c (Fexpt, fmod_float): Likewise.
849 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
851 * font.c (font_intern_prop): Likewise.
852 * frame.c (x_set_alpha): Likewise.
853 * gtkutil.c (get_utf8_string): Likewise.
854 * indent.c (check_display_width): Likewise.
855 * intervals.c (create_root_interval, rotate_right, rotate_left)
856 (split_interval_right, split_interval_left)
857 (adjust_intervals_for_insertion, delete_node)
858 (interval_deletion_adjustment, adjust_intervals_for_deletion)
859 (merge_interval_right, merge_interval_left, copy_intervals)
860 (set_intervals_multibyte_1): Likewise.
861 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
862 * keymap.c (Fkey_description): Likewise.
863 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
864 * lread.c (openp, read_integer, read1, string_to_number):
866 * menu.c (ensure_menu_items): Likewise.
867 * minibuf.c (read_minibuf_noninteractive): Likewise.
868 * print.c (printchar, strout): Likewise.
869 * process.c (create_process, Faccept_process_output)
870 (wait_reading_process_output, read_process_output, send_process)
871 (wait_reading_process_output): Likewise.
872 * profiler.c (make_log, handle_profiler_signal): Likewise.
873 * regex.c (re_exec): Likewise.
875 * search.c (looking_at_1, Freplace_match): Likewise.
876 * sysdep.c (get_child_status, procfs_ttyname)
877 (procfs_get_total_memory): Likewise.
878 * systime.h (EMACS_TIME_VALID_P): Likewise.
879 * term.c (dissociate_if_controlling_tty): Likewise.
880 * window.c (get_phys_cursor_glyph): Likewise.
881 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
882 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
884 * xfns.c (Fx_window_property): Likewise.
885 * xmenu.c (set_frame_menubar): Likewise.
886 * xselect.c (x_get_window_property, x_handle_dnd_message):
888 * xsmfns.c (smc_save_yourself_CB): Likewise.
889 * xterm.c (x_scroll_bar_set_handle): Likewise.
891 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
893 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
894 to be optional or nil. Adjust comment and convert it to docstring.
895 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
896 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
898 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
900 Static checking by GCC 4.8-20130319.
901 * image.c (gif_load): Assume pass < 3 to pacify GCC.
902 * process.c (Fset_process_datagram_address)
903 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
904 * xdisp.c (get_char_face_and_encoding):
905 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
906 (get_glyph_face_and_encoding): Prepare face before possibly using it.
907 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
909 2013-03-24 Ken Brown <kbrown@cornell.edu>
911 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
912 fix compilation on 64-bit Cygwin, where underscores are not
913 automatically prepended.
915 * w32term.c (w32_initialize): Silence compiler warning.
917 2013-03-23 Eli Zaretskii <eliz@gnu.org>
919 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
920 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
921 variables, to save and restore frame dimensions.
922 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
923 after returning from a 'fullscreen' configuration.
924 use SendMessage instead of PostMessage to send the SC_RESTORE message,
925 to avoid races between the main thread and the input thread.
927 * w32term.h (struct w32_output): New members normal_width,
928 normal_height, normal_top, normal_left, and prev_fsmode.
929 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
930 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
933 * w32term.c (w32fullscreen_hook): Record last value of the frame's
934 'fullscreen' parameter. Always record previous width and height
935 of the frame, except when switching out of maximized modes, so
936 that they could be restored correctly, instead of resetting to the
937 default frame dimensions. Send SC_RESTORE command to the frame,
938 unless we are going to send SC_MAXIMIZE, to restore the frame
939 resize hints in the mouse pointer shown by the window manager.
942 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
944 * lisp.h (get_frame_param): Adjust conditions for prototype
947 2013-03-22 Ken Brown <kbrown@cornell.edu>
949 * unexcw.c: Drop unneeded inclusion of w32common.h.
950 (report_sheap_usage): Declare.
951 (read_exe_header): Add magic numbers for x86_64.
952 (fixup_executable): Fix printf format specifier for unsigned long
955 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
957 * frame.h (struct frame): Put menu_bar_window under #ifdef
958 because this member is not needed when X toolkit is in use.
959 (fset_menu_bar_window):
960 * dispnew.c (clear_current_matrices, clear_desired_matrices)
961 (free_glyphs, update_frame):
962 * xdisp.c (expose_frame): Likewise.
963 (display_menu_bar): Likewise. Remove redundant eassert.
964 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
967 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
969 Use functions and constants to manipulate Lisp_Save_Value objects.
970 This replaces code that used macros and strings and token-pasting.
971 The change makes the C source a bit easier to follow,
972 and shrinks the Emacs executable a bit.
973 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
974 (make_save_value): Change 1st arg from string to enum. All callers
977 (mark_object): Use if, not #if, for GC_MARK_STACK.
978 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
979 (XSAVE_OBJECT): Now functions, not macros.
980 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
981 the constant was never used.
982 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
983 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
984 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
985 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
987 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
988 type3 with a single member save_type. All uses changed.
989 (save_type, set_save_pointer, set_save_integer): New functions.
990 * print.c (PRINTX): Remove.
992 * alloc.c: Remove redundant static declarations.
994 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
996 * window.h (struct window): Convert left_col, top_line, total_lines
997 and total_cols from Lisp_Objects to integers. Adjust comments.
998 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
1000 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
1001 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
1002 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
1003 Adjust users where appropriate.
1005 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1007 * frame.h (struct frame): Drop resx and resy because the same data is
1008 available from window system-specific output context. Adjust users.
1009 (default_pixels_per_inch_x, default_pixels_per_inch_y):
1010 New functions to provide defaults when no window system available.
1011 (FRAME_RES_X, FRAME_RES_Y): New macros.
1012 (NUMVAL): Move from xdisp.c.
1013 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
1014 (Ffont_face_attributes, Fopen_font):
1015 * image.c (gs_load):
1016 * w32font.c (fill_in_logfont):
1017 * xdisp.c (calc_pixel_width_or_height):
1018 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
1019 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
1021 2013-03-20 Kenichi Handa <handa@gnu.org>
1023 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
1024 to 1 (temporary workaround until a bug related to ASCII
1025 optimization is fixed).
1027 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
1029 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
1030 Signal error if window is not internal. Adjust docstring.
1031 (delete_all_child_windows): Use combination_limit to save the buffer.
1032 (Fset_window_configuration): Adjust accordingly.
1033 * print.c (syms_of_print): Initialize debugging output not here...
1034 (init_print_once): ...but in a new function here.
1035 * lisp.h (init_print_once): Add prototype.
1036 * emacs.c (main): Add call to init_print_once. Adjust comments.
1038 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
1040 * window.c (window_resize_check, window_resize_apply)
1041 (window_from_coordinates, recombine_windows, set_window_buffer)
1042 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
1043 (Fsplit_window_internal, Fdelete_window_internal)
1044 (freeze_window_starts): Use bool for booleans.
1045 * window.h (window_frame_coordinates, resize_frame_windows)
1046 (freeze_window_starts, set_window_buffer): Adjust prototypes.
1048 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
1050 * dispnew.c (bitch_at_user): Use `user-error'.
1052 2013-03-17 Ken Brown <kbrown@cornell.edu>
1054 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
1055 as return type of image_background. (Bug#13981)
1056 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
1058 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
1060 * nsterm.m (updateFrameSize:): Change resize increments if needed.
1061 (ns_select): Don't return with result uninitialized.
1063 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
1066 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
1068 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
1069 directories. If filename is nil, get directory name (Bug#13932).
1070 Use getFilename and getDirectory.
1071 (getFilename, getDirectory): New methods for EmacsSavePanel and
1073 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
1075 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
1077 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1079 2013-03-15 Kenichi Handa <handa@gnu.org>
1081 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1082 (adjust_after_replace): Make it back to static. Delete the third
1083 arg text_at_gap_tail. Cancel the code for handling it.
1085 * coding.h (struct coding_system): New member eol_seen.
1087 * coding.c (detect_ascii): New function.
1088 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1089 when the source bytes are actually scanned. On detecting for
1090 coding_category_utf_8_auto, call detect_ascii instead of scanning
1091 source bytes directly.
1092 (produce_chars): Call insert_from_gap with the new arg 0.
1093 (encode_coding): Likewise.
1094 (decode_coding_gap): Control ASCII optimization by the variable
1095 disable_ascii_optimization instead of #ifndef .. #endif.
1096 Deccode EOL format according to coding->eol_seen.
1097 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1100 * lisp.h (adjust_after_replace): Cancel externing it.
1101 (insert_from_gap): Adjust prototype.
1103 2013-03-15 Eli Zaretskii <eliz@gnu.org>
1105 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1106 FULLSCREEN_MAXIMIZED. (Bug#13935)
1108 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1110 * region-cache.c (find_cache_boundary, move_cache_gap)
1111 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1112 Simplify debugging check and convert to eassert. Adjust comment.
1113 (pp_cache): Put under ENABLE_CHECKING.
1115 2013-03-14 Eli Zaretskii <eliz@gnu.org>
1117 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1118 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1120 (w32fullscreen_hook): If the frame is visible, reset
1121 f->want_fullscreen flag after changing the frame size. If the
1122 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1125 2013-03-13 Daniel Colascione <dancol@dancol.org>
1127 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1128 too so that these builds can use Cygwin's file conversion
1129 functions. (We've been building and linking cygw32.o all along
1130 and just not using it.)
1132 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1134 File synchronization fixes (Bug#13944).
1135 * Makefile.in (LIB_FDATASYNC): New macro.
1137 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1138 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1139 Don't worry about HAVE_FSYNC, since a substitute fsync is
1140 available if the system lacks one.
1141 (Fwrite_regin): Retry fsync if interrupted.
1143 2013-03-13 Eli Zaretskii <eliz@gnu.org>
1145 * w32term.c (w32_read_socket): If the Emacs frame is being
1146 activated, call w32fullscreen_hook, to make sure the new frame
1147 dimensions are in effect. (Bug#13937)
1149 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1151 * xdisp.c (init_iterator): Simplify because both character and byte
1152 positions are either specified or -1. Add eassert. Adjust comment.
1153 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1154 character and byte positions can be obtained from marker.
1156 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1158 Static checking by Sun C 5.12.
1159 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1160 * bytecode.c (exec_byte_code):
1161 * dispnew.c (init_display):
1163 * fileio.c (Fsubstitute_in_file_name):
1164 * keyboard.c (Fevent_convert_list):
1165 * keymap.c (Fsingle_key_description):
1166 * term.c (maybe_fatal, fatal):
1167 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1168 * xsmfns.c (Fhandle_save_session):
1169 Omit unreachable code.
1170 * keymap.c (map_keymap_char_table_item): Cast void * to
1171 a function pointer type; the C Standard requires this.
1173 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1174 Include <sys/param.h> unconditionally, as that works elsewhere and
1175 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1176 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1179 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1181 * insdel.c (adjust_after_replace): Use bool for boolean.
1183 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1185 * keyboard.c: Move keyboard decoding to read_key_sequence.
1186 (decode_keyboard_code): Remove.
1187 (tty_read_avail_input): Don't try to decode input.
1188 (read_decoded_char): New function.
1189 (read_key_sequence): Use it.
1191 2013-03-10 Daniel Colascione <dancol@dancol.org>
1193 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1194 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1195 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1198 * w32term.c (construct_drag_n_drop): Use the above macros to make
1199 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1201 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1202 properly display non-ASCII frame titles in cygw32 builds.
1204 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1205 call ShellExecute in cygw32 builds.
1207 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1208 common file dialog code.
1210 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1211 can just use du like other systems.
1213 * coding.c (from_unicode_buffer): Declare.
1214 * coding.c (from_unicode_buffer): Implement.
1216 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1218 * lread.c: Minor cleanup.
1219 (FROM_FILE_P): New macro.
1220 (skip_dyn_bytes, unreadchar, read1): Use it.
1221 (read_list): Consolidate duplicated code.
1223 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1225 2013-03-10 Eli Zaretskii <eliz@gnu.org>
1227 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1228 (redisplay_internal, set_cursor_from_row, try_window)
1229 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1230 (display_line, notice_overwritten_cursor)
1231 (mouse_face_from_buffer_pos, note_mouse_highlight):
1232 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1233 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1234 (mouse_face_from_string_pos, fast_find_string_pos):
1235 Use MATRIX_ROW_VPOS.
1237 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1239 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1241 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1242 MATRIX_MODE_LINE_ROW.
1244 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1246 2013-03-10 handa <handa@gnu.org>
1248 * lisp.h (adjust_after_replace): Extern it.
1250 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1251 case of detection for coding_category_utf_8_auto.
1252 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1253 Skip decoding if all bytes are ASCII.
1255 * insdel.c (adjust_after_replace): Make it public. New arg
1257 (adjust_after_insert): Call adjust_after_replace with the new arg
1260 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1262 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1263 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1264 from Elisp via unread-command-events.
1266 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1267 functions to mean "no change".
1269 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1271 region-cache.c, scroll.c, search.c: Use bool for booleans.
1272 * lisp.h (compile_pattern):
1273 * scroll.c (do_scrolling, do_direct_scrolling):
1274 * search.c (struct regexp_cache, compile_pattern_1)
1275 (compile_pattern, string_match_1, search_command)
1276 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1277 (search_regs_saved, Fregexp_quote):
1278 Use bool for boolean.
1279 * region-cache.c (region_cache_forward, region_cache_backward):
1280 Fix comments to match code: these functions return int, not boolean.
1282 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1284 * search.c (find_newline): Accept start and end byte positions
1285 as arguments and allow -1 if not known.
1286 (find_newline_no_quit): Likewise for start position.
1287 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1288 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1289 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1290 * editfns.c (Fconstrain_to_field): Break long line.
1291 Adjust call to find_newline.
1292 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1293 Use DEC_BOTH to start next search from the previous buffer
1294 position, where appropriate.
1295 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1296 (get_visually_first_element, move_it_vertically_backward): Likewise.
1297 Obtain byte position from the display iterator, where appropriate.
1299 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1301 print.c, process.c: Use bool for booleans.
1302 * lisp.h (wait_reading_process_output):
1303 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1304 (strout, debug_output_compilation_hack, float_to_string, print)
1306 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1307 (decode_status, status_message, create_process, create_pty)
1308 (Fmake_network_process, Fnetwork_interface_info)
1309 (wait_reading_process_output, read_process_output)
1310 (write_queue_push, write_queue_pop, process_send_signal)
1311 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1312 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1313 Use bool for booleans.
1314 * process.c (Fnetwork_interface_list): Remove unused local.
1315 (connect_counter): Now EMACS_INT, not int.
1317 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1319 * bidi.c (bidi_fetch_char): Swap first and second arguments
1320 to match other functions accepting character and byte positions.
1322 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1323 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1324 when you need just to move to the previous buffer position.
1325 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1327 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1329 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1331 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1333 Avoid character to byte conversions in motion subroutines.
1334 * indent.h (compute_motion, vmotion): Add byte position argument.
1335 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1337 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1338 Use list5 for return value.
1339 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1340 Adjust comments, style and calls to compute_motion.
1341 (Fvertical_motion): Adjust call to vmotion.
1342 * window.c (Fdelete_other_windows_internal): Record window start
1343 byte position and adjust call to vmotion.
1344 (window_scroll_line_based): Likewise with call to compute_motion.
1346 (Frecenter): Adjust calls to vmotion.
1348 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1350 * lisp.h (list2i, list3i): New functions.
1351 (list4i): Move from window.c and make LISP_INLINE.
1352 * editfns.c (make_lisp_time):
1353 * fns.c (Flocale_info):
1354 * keyboard.c (parse_modifiers):
1355 * xterm.c (x_ewmh_activate_frame): Use list2i.
1356 * instel.c (signal_after_change):
1357 * nsfns.m (Fx_server_version, Fxw_color_values):
1358 * w32fns.c (Fxw_color_values, Fx_server_version):
1359 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1360 * fileio.c (Fvisited_file_modtime):
1361 * nsfns.m (Fns_display_usable_bounds):
1362 * w32.c (ltime): Use list4i.
1364 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1366 * search.c (find_newline_no_quit): Rename from find_next_newline.
1369 * lisp.h (find_newline_no_quit): Rename prototype.
1371 * xdisp.c (back_to_previous_line_start)
1372 (forward_to_next_line_start, get_visually_first_element)
1373 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1374 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1375 * bidi.c (bidi_find_paragraph_start): Callers of
1376 find_newline_no_quit changed.
1378 * msdos.c: Change encoding to cp850. (Bug#13879)
1379 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1381 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1383 Coding system support cleanup and minor refactoring.
1384 * coding.h (enum coding_result_code): Remove
1385 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1386 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1387 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1388 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1389 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1390 (decode_coding_region, encode_coding_region, decode_coding_string):
1391 Remove unused compatibility macros.
1392 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1393 (record_conversion_result): Adjust user.
1394 (syms_of_coding): Likewise.
1395 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1396 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1397 (decode_coding_object): Simplify since xrealloc never returns NULL.
1400 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1402 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1403 * sysdep.c (list_system_processes)
1404 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1405 Make it a stub in this case; otherwise the build might fail,
1406 and this code hasn't been tested on such hosts anyway.
1407 Problem reported by Nelson H. F. Beebe in
1408 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1409 and analyzed by Jérémie Courrèges-Anglas in
1410 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1412 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1414 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1415 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1416 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1417 * bidi.c (bidi_find_paragraph_start): Likewise.
1418 * indent.c (vmotion): Likewise.
1420 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1422 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1423 * filelock.c: Include <c-ctype.h>.
1424 (MAX_LFINFO): New top-level constant.
1425 (lock_info_type): Remove members pid, boot_time. Add members at,
1426 dot, colon. Change user member to be the entire buffer, not a
1427 pointer. This allows us to handle the case where a foreign
1428 pid or boot time exceeds the local range. All uses changed.
1429 (LINKS_MIGHT_NOT_WORK): New constant.
1430 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1431 (defined_WINDOWSNT): Remove.
1432 (MAKE_LOCK_NAME, file_in_lock_file_name):
1433 Always use .#FILE (not .#-FILE) for the file lock,
1434 even if it is a regular file.
1435 (rename_lock_file): New function.
1436 (create_lock_file): Use it.
1437 (create_lock_file, read_lock_data):
1438 Prefer a symbolic link for the lock file, falling back on a
1439 regular file if symlinks don't work. Do not try to create
1440 symlinks on MS-Windows, due to security hassles. Stick with
1441 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1442 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1443 host may be using a Windowsish file system, and cannot use
1444 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1445 doesn't work. Don't fail merely because of a symlink-contents
1446 length limit in the current file system; fall back on regular
1447 files. Increase the symlink contents length limit to 8 KiB, this
1448 should be big enough for any real use and doesn't crunch the
1450 (create_lock_file, lock_file_1, read_lock_data):
1451 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1452 (lock_file_1): Return error number, not bool. All callers changed.
1453 (ELOOP): New macro, if not already defined.
1454 (read_lock_data): Return size of lock file contents, not Lisp object.
1455 All callers changed. Handle a race condition if some other process
1456 replaces a regular-file lock with a symlink lock or vice versa,
1457 while we're trying to read the lock.
1458 (current_lock_owner): Parse contents more carefully, to help avoid
1459 confusing a regular-file lock with some other application's use
1460 of the file. Check for lock file contents being too long, or
1461 not parsing correctly.
1462 (current_lock_owner, lock_file):
1463 Allow foreign pid and boot times that exceed the local range.
1464 (current_lock_owner, lock_if_free, lock_file):
1465 Simplify allocation of lock file contents.
1466 * w32.c (sys_rename_replace): New function, containing most of
1467 the contents of the old sys_rename.
1468 (sys_rename): Use it.
1469 (fchmod): New dummy function.
1470 * w32.h (sys_rename_replace, fchmod): New decls.
1472 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1474 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1475 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1476 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1477 <dmantipov@yandex.ru>.
1479 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1481 * composite.c (get_composition_id, fill_gstring_header):
1482 Use make_uninit_vector where appropriate.
1483 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1484 * xselect.c (clean_local_selection_data): Likewise.
1486 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1488 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1489 * image.c (imagemagick_load_image): Calculate height and width
1490 after flattening the image, not before.
1492 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1494 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1495 * ftfont.c (ftfont_shape_by_flt): Likewise.
1496 * w32uniscribe.c (uniscribe_shape): Likewise.
1498 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1500 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1501 The old approach, which fell back on DIR/.#FILE.0 through
1502 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1503 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1504 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1505 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1506 because the locking mechanism was never reliable in that case).
1507 This patch fixes this and other bugs discovered by a code
1508 inspection that was prompted by
1509 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1510 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1511 to avoid interoperability problems between the MS-Windows and
1512 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1513 instances of Emacs now ignore each others' locks.
1514 * filelock.c (defined_WINDOWSNT): New constant.
1515 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1516 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1517 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1518 regular files on MS-Windows hosts.
1519 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1520 Use SAFE_ALLOCA to avoid problems with long file names.
1521 (MAX_LFINFO): Now a local constant, not a global macro.
1522 (IS_LOCK_FILE): Remove.
1523 (lock_file_1): Don't inspect errno if symlink call succeeds;
1524 that's not portable.
1525 (lock_file): Document that this function can return if lock
1527 (lock_file): Don't access freed storage.
1529 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1531 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1533 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1535 * textprop.c: Use bool for booleans.
1536 (validate_interval_range, Fadd_text_properties)
1537 (Fremove_text_properties): Prefer bool to int when either works.
1539 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1541 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1542 If the interval tree changes as a side effect of calling
1543 modify_region, re-do processing starting from the call to
1544 validate_interval_range. (Bug#13743)
1546 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1548 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1551 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1553 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1554 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1555 access to the lock file until it is written and closed.
1558 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1560 * callint.c (Qcall_interactively):
1561 * macros.c (Qexecute_kbd_macro):
1564 2013-02-26 Bastien Guerry <bzg@gnu.org>
1566 * window.c (Frecenter): Tiny docstring enhancement.
1568 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1570 Minor textprop integer cleanup.
1571 * intervals.h, textprop.c (add_text_properties_from_list):
1572 Return void, not int, since nobody uses the return value.
1573 * textprop.c (validate_plist, add_properties, remove_properties)
1574 (Fadd_text_properties):
1575 Don't assume list length fits in int.
1576 (interval_has_all_properties, interval_has_some_properties)
1577 (interval_has_some_properties_list, add_properties, remove_properties)
1578 (Fadd_text_properties, Fremove_text_properties)
1579 (Fremove_list_of_text_properties, text_property_stickiness):
1580 Use bool for booleans.
1581 (Fadd_text_properties, Fremove_text_properties):
1582 (Fremove_list_of_text_properties):
1583 Reindent do-while as per GNU style.
1585 2013-02-25 Eli Zaretskii <eliz@gnu.org>
1587 Implement CLASH_DETECTION for MS-Windows.
1589 * filelock.c [WINDOWSNT]: Include w32.h.
1590 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1591 function of that name. Up-case the macro arguments.
1592 (IS_LOCK_FILE): New macro.
1593 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1594 (create_lock_file): New function, with body extracted from
1596 [WINDOWSNT]: Implement lock files by writing a regular file with
1597 the lock information as its contents.
1598 (read_lock_data): New function, on Posix platforms just calls
1600 [WINDOWSNT]: Read the lock info from the file.
1601 (current_lock_owner): Call read_lock_data instead of calling
1602 emacs_readlinkat directly.
1603 (lock_file) [WINDOWSNT]: Run the file name through
1606 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1607 just check if the process by that PID exists.
1609 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1610 also present, as doing so will fail to error out if the file
1613 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1615 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1616 (Fremove_list_of_text_properties): Skip all of the intervals in
1617 the region between START and END that already have resp. don't
1618 have the requested properties, not just the first one.
1619 Add assertions that the loop afterwards always modifies the
1620 properties. (Bug#13743)
1622 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1624 * callint.c (Fcall_interactively): Use the right lexical environment
1625 for `interactive' specs (bug#13811).
1626 * eval.c (Feval): Accept a lexical environment.
1628 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1630 Simplify data_start configuration (Bug#13783).
1631 This is a followon simplification to the fix for Bug#13650.
1632 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1633 (START_FILES): Remove. All uses removed.
1634 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1635 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1636 (buildobj.h): Use it.
1637 ($(ALLOBJS)): Depend on globals.h.
1638 (temacs$(EXEEXT)): Use $(ALLOBJS).
1639 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1640 * deps.mk (vm-limit.o):
1641 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1642 Do not depend on mem-limits.h.
1643 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1644 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1645 [__GNUC__ && !ORDINARY_LINK]: Remove.
1646 * mem-limits.h, pre-crt0.c: Remove.
1647 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1648 * unexcoff.c (etext): New decl.
1649 (make_hdr): Use DATA_START instead of start_of_data.
1650 * vm-limit.c: Move most of mem-limits.h's contents here.
1651 (data_start): New decl. It's OK if this is approximate,
1652 so simplify-away some unnecessary exactness.
1653 (POINTER): Remove; all uses removed.
1654 (data_space_start): Now char *, to avoid casts.
1655 (exceeds_lisp_ptr): New function, replacing the old
1656 EXCEEDS_LISP_PTR macro. All uses changed.
1657 (check_memory_limits): Simplify and remove casts.
1658 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1659 (memory_warnings): Use data_start instead of start_of_data.
1661 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1663 * xdisp.c (set_message): Only check for debug-on-message if STRING
1664 is a string. (Bug#13797)
1666 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1668 Fix regression introduced by July 10 filelock.c patch.
1669 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1670 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1671 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1672 and diagnosed by Andreas Schwab in
1673 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1675 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1677 Assume C89 or better.
1678 * ralloc.c (SIZE, POINTER, NIL):
1679 * vm-limit.c (POINTER):
1680 Remove, replacing all uses with C89 equivalents. These old
1681 symbols were present only for porting to pre-C89 platforms.
1683 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
1685 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1686 This avoids warning messages reported as part of Bug#13546.
1688 2013-02-21 Ken Brown <kbrown@cornell.edu>
1690 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1692 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1694 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1696 * keyboard.c (Qcommand_execute): New var.
1697 (command_loop_1, read_char): Use it.
1698 (Fcommand_execute): Remove, replace by an Elisp implementation.
1699 (syms_of_keyboard): Adjust accordingly.
1701 2013-02-19 Daniel Colascione <dancol@dancol.org>
1703 * sheap.c (report_sheap_usage): Use message, not message1, so
1704 that we don't try to create a buffer while we're in the middle
1705 of dumping Emacs. Explain why.
1707 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
1709 * search.c (find_newline): Return byte position in bytepos.
1711 (find_next_newline_no_quit, find_before_next_newline):
1712 Add bytepos argument.
1713 * lisp.h (find_newline, find_next_newline_no_quit)
1714 (find_before_next_newline): Adjust prototypes.
1715 * bidi.c (bidi_find_paragraph_start):
1716 * editfns.c (Fconstrain_to_field, Fline_end_position):
1717 * indent.c (compute_motion, vmotion):
1718 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1719 (get_visually_first_element, move_it_vertically_backward):
1720 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1722 2013-02-19 Eli Zaretskii <eliz@gnu.org>
1724 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1725 resources were not orderly released.
1727 2013-02-17 Eli Zaretskii <eliz@gnu.org>
1729 * xdisp.c (x_draw_vertical_border): For a window that is neither
1730 the leftmost nor the rightmost, redraw both the left and the right
1731 vertical borders. (Bug#13723)
1733 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1735 * xml.c (init_libxml2_functions):
1736 * sound.c (sound_warning):
1737 * sheap.c (report_sheap_usage):
1738 * process.c (wait_reading_process_output):
1739 * msdos.c (XMenuActivate):
1740 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1741 * keyboard.c (top_level_1):
1742 * editfns.c (Fmessage, Fmessage_box):
1743 * callint.c (Fcall_interactively):
1744 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1746 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1748 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
1749 * frame.c (syms_of_frame): ... to here.
1751 2013-02-16 Eli Zaretskii <eliz@gnu.org>
1753 * w32.c (sys_chown): Remove unused function.
1755 * w32term.c <input_signal_count>: Declare 'volatile'
1756 unconditionally. (Bug#9066)
1758 * w32.c (set_errno): Reset h_errno and don't set it to any other
1759 value. Set errno instead.
1760 (check_errno): Reset h_errno.
1761 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1762 (sys_gethostname, sys_getservbyname, sys_getpeername)
1763 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1764 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1766 (sys_gethostbyname): Set h_errno only errors detected.
1768 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1770 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1772 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1774 * keyboard.c (read_char): Fix calculation of auto-save time out
1775 when auto-save-timeout is less than 4. (Bug#13720)
1777 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
1778 time. Improve diagnostics in DebPrint. (Bug#13546)
1780 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1781 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1782 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1783 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1784 make sure errno is set to an appropriate value. (Bug#13546)
1785 (socket_to_fd): Add assertion against indexing fd_info[] with a
1786 value that is out of bounds.
1787 (sys_accept): If fd is negative, do not set up the child_process
1788 structure for reading.
1790 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1792 * composite.c (fill_gstring_header): Remove useless prototype.
1794 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1795 * print.c (PRINTDECLARE, print_object):
1796 * search.c (compile_pattern, fast_looking_at, search_buffer):
1797 (simple_search, boyer_moore, Freplace_match):
1798 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1799 (get_overlay_arrow_glyph_row, display_mode_element):
1800 (decode_mode_spec_coding, message3):
1801 * xfaces.c (face_at_string_position): Use bool for booleans.
1804 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1806 Fix AIX port (Bug#13650).
1807 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1808 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1809 was #undeffed earlier, so it cannot be used as a macro here.
1810 Use the constant and not the macro.
1812 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1814 * w32proc.c (new_child): If no vacant slots are found in
1815 child_procs[], make another pass looking for slots whose process
1816 has exited or died. (Bug#13546)
1818 * w32.c (sys_pipe): When failing due to file descriptors above
1819 MAXDESC, set errno to EMFILE.
1820 (_sys_read_ahead): Update cp->status when failing to read serial
1821 communications input, so that the status doesn't stay at
1822 STATUS_READ_IN_PROGRESS. (Bug#13546)
1824 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1826 * gtkutil.c (tb_size_cb): New function.
1827 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1829 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1831 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1834 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1836 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1838 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1840 * font.c (font_range): Add pos_byte argument. Adjust comment
1841 and break long line.
1842 * font.h (font_range): Adjust prototype.
1843 * composite.c (autocmp_chars): Pass byte position to font_range.
1844 Break long line. Remove useless prototype and format comment.
1846 2013-02-13 Glenn Morris <rgm@gnu.org>
1848 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1850 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1852 Improve AIX port some more (Bug#13650).
1853 With this, it should be as good as it was in 23.3, though it's
1854 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1855 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1856 * unexaix.c (start_of_text): Remove.
1857 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1858 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1859 (orig_load_scnptr, orig_data_scnptr):
1860 Now off_t, not long, since they are file offsets.
1861 (make_hdr): Use _data, not start_of_data ().
1862 This is the key part of the fix.
1863 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1864 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1866 * pre-crt0.c (data_start): Initialize to 1.
1867 This ports to compilers that optimize the external declaration
1868 'int x = 0;' as if it were 'int x;' to shrink the executable.
1870 Improve AIX port (Bug#13650).
1871 This doesn't fix the bug, but it makes progress: Emacs builds now.
1872 * unexaix.c: Include inttypes.h, stdarg.h.
1873 (report_error, report_error_1): Mark as _Noreturn.
1874 (report_error): Don't report the wrong errno.
1875 (report_error_1): Now varargs. All callers changed.
1876 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1877 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1878 (write_ptr): Use %p to print address rather than %lx and a cast
1879 to unsigned long. Grow buffer a bit, to be safer.
1881 2013-02-13 Eli Zaretskii <eliz@gnu.org>
1883 * bidi.c (bidi_resolve_neutral): After finding the next
1884 non-neutral character, accept NEUTRAL_ON type as well, because
1885 directional control characters, such as LRE and RLE, have their
1886 type converted to that by bidi_resolve_weak. This avoids aborts
1887 when LRE/RLE follows a run of neutrals.
1888 (bidi_move_to_visually_next): Assert that return value of
1889 bidi_peek_at_next_level is non-negative. Negative values will
1892 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1894 Minor getenv-related fixes.
1895 * callproc.c (Fcall_process_region) [!DOS_NT]:
1896 Avoid unnecessary duplicate call to getenv.
1897 * callproc.c (init_callproc):
1898 * dispnew.c (init_display):
1899 * sysdep.c (sys_subshell):
1900 Omit unnecessary cast of getenv or egetenv.
1902 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
1904 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1905 Update dependencies.
1907 2013-02-12 Eli Zaretskii <eliz@gnu.org>
1909 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1911 (display_line): Set w->region_showing to the value of
1912 it->region_beg_charpos, not to -1. This fixes redisplay
1913 optimization when cursor is moved up after M->. (Bug#13623)
1915 (try_scrolling): Scroll text up more if point is too close to ZV
1916 and inside the scroll margin. This makes sure point is moved
1917 outside the scroll margin in these cases.
1919 * window.h (struct window): region_showing can no longer be
1922 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1924 Tune by using memchr and memrchr.
1925 * doc.c (Fsnarf_documentation):
1926 * fileio.c (Fsubstitute_in_file_name):
1927 * search.c (find_newline, scan_newline):
1928 * xdisp.c (pos_visible_p, display_count_lines):
1929 Use memchr and memrchr rather than scanning byte-by-byte.
1930 * search.c (find_newline): Rename from scan_buffer.
1931 Omit first arg TARGET, as it's always '\n'. All callers changed.
1933 Clean up read_key_sequence a tiny bit more.
1934 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1935 (read_key_sequence): Remove unused locals.
1937 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1939 Clean up read_key_sequence a bit; reread active keymaps after first event.
1940 * keyboard.c (read_char, read_char_x_menu_prompt)
1941 (read_char_minibuf_menu_prompt):
1942 Replace nmaps+maps with a single `map' arg.
1943 (follow_key): Operate on a single map.
1944 (active_maps): New function.
1945 (test_undefined): Also return true for nil bindings.
1946 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1947 a single (composed) keymap. Remember `first_event' to choose the right
1948 set of active keymaps. Recompute the set of keymaps after receiving
1949 the first event. Remove GOBBLE_FIRST_EVENT.
1950 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1951 * keyboard.h (read_char): Update declaration.
1952 * lread.c (read_filtered_event): Adjust call to read_char.
1954 2013-02-11 Eli Zaretskii <eliz@gnu.org>
1956 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1957 Don't use the limitation on backwards movement when lines are truncated
1958 in the window. (Bug#13675)
1960 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1962 * marker.c (set_marker_internal): If desired position is passed
1963 as a marker, avoid call to buf_charpos_to_bytepos.
1964 * window.c (Fset_window_point): Omit redundant type checking.
1965 (Fset_window_start): Likewise. Format comment.
1966 (window_scroll_pixel_based): Use set_marker_restricted_both
1967 with character and byte positions obtained from an iterator.
1968 (Fset_window_configuration): Use set_marker_restricted_both.
1969 * xdisp.c (message_dolog): Likewise.
1971 2013-02-10 Eli Zaretskii <eliz@gnu.org>
1973 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1974 When text lines are longer than window's screen lines, don't move back
1975 too far. This speeds up some redisplay operations. (Bug#13675)
1977 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1979 * syntax.c (scan_sexps_forward): Fix byte position calculation
1980 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1982 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1984 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1985 that was not needed.
1987 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1989 Minor hashing refactoring.
1990 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1991 (sxhash_float): Return EMACS_UINT, for consistency with the other
1993 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1994 non-static inline function and therefore can't use static vars.
1995 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1996 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1997 with the other hash functions.
1999 2013-02-09 Eli Zaretskii <eliz@gnu.org>
2001 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2002 XXXXXX part of the temporary file pattern is not downcased even
2003 when w32-downcase-file-names is non-nil. (Bug#13661)
2005 * xdisp.c (decode_mode_spec): Remove handling of %t.
2007 * msdos.c (careadlinkatcwd): Remove.
2009 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2011 * lread.c (skip_dyn_bytes): New function (bug#12598).
2012 (read1): Use it. Use getc instead of READCHAR to read bytes.
2013 (load_each_byte): Remove. Update users.
2015 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2017 * search.c (scan_buffer): Calculate end byte position just once.
2018 (scan_newline): Do not recalculate start_byte.
2019 (search_command): Use eassert.
2020 * syntax.c (struct lisp_parse_state): New member location_byte.
2021 (scan_sexps_forward): Record from_byte and avoid redundant
2022 character to byte position calculation ...
2023 (Fparse_partial_sexp): ... here. Break too long line.
2025 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2027 * lisp.h (make_uninit_vector): New function.
2028 * alloc.c (Fvector, Fmake_byte_code):
2029 * ccl.c (Fregister_ccl_program):
2030 * charset.c (Fdefine_charset_internal, define_charset_internal):
2031 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2032 * composite.c (syms_of_composite):
2033 * font.c (Fquery_font, Ffont_info, syms_of_font):
2034 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2035 * ftfont.c (ftfont_shape_by_flt):
2036 * indent.c (recompute_width_table):
2037 * nsselect.m (clean_local_selection_data):
2038 * syntax.c (init_syntax_once):
2039 * w32unsubscribe.c (uniscribe_shape):
2040 * window.c (Fcurrent_window_configuration):
2041 * xfaces.c (Fx_family_fonts):
2042 * xselect.c (selection_data_to_lisp_data): Use it.
2044 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2046 * coding.c (Fdefine_coding_system_internal): Use AREF where
2047 argument is known to be a vector.
2048 * fns.c (Flocale_info): Likewise for ASET.
2049 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2050 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2052 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2054 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2057 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2058 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2059 updateCollectionBehaviour.
2061 * nsterm.m (NEW_STYLE_FS): Remove.
2062 (ns_last_use_native_fullscreen): New variable.
2063 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2064 (x_set_window_size): Do not take title bar and tool bar into account
2065 if isFullscreen returns YES.
2066 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2067 (check_native_fs): New function.
2068 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2069 (ns_term_init): Remove NEW_STYLE_FS.
2070 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2071 and tool bar if isFullscreen returns NO.
2072 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2073 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2074 with HAVE_NATIVE_FS.
2075 (window:willUseFullScreenPresentationOptions:): New method.
2076 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2077 Hide toolbar if not enabled (Bug#13444).
2078 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2079 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2080 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2081 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2082 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2083 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2084 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2085 (syms_of_nsterm): Add ns-use-native-fullscreen.
2087 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2089 * fileio.c (Qchoose_write_coding_system): Now static.
2091 2013-02-04 Eli Zaretskii <eliz@gnu.org>
2093 * xdisp.c (window_buffer_changed): region_showing can be negative,
2094 which still means region is being displayed.
2095 (redisplay_internal): Resurrect code that forced redisplay of the
2096 whole window when showing region and the mark has changed.
2097 Record the new mark position to allow redisplay optimizations.
2098 (display_line): If it->region_beg_charpos is non-zero, set the
2099 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2101 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2102 not bitfield of 1 bit.
2104 2013-02-03 Daniel Colascione <dancol@dancol.org>
2106 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2107 daemon mode works on cygw32 when Emacs is installed and not just
2110 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2112 Avoid file time stamp bug on MS-Windows (Bug#13149).
2113 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2114 as FAT32 doesn't update time stamps when truncating them.
2115 Also, check that a file time stamp is not a multiple of 100 ns;
2116 this should catch all instances of the problem on MS-Windows,
2117 as its native file system resolution is 100 ns or worse, and
2118 checking for a non-multiple of 100 ns should impose only a small
2119 overhead on systems with ns resolution.
2121 2013-02-02 Eli Zaretskii <eliz@gnu.org>
2123 Avoid encoding file names on MS-Windows when they need to be run
2124 through dostounix_filename.
2125 * w32.c (normalize_filename): Accept an additional argument
2126 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2127 downcase it even if w32-downcase-file-names is non-nil.
2128 (dostounix_filename): Accept an additional argument MULTIBYTE and
2129 pass it to normalize_filename.
2130 (emacs_root_dir): Adjust.
2132 * msdos.h (dostounix_filename): Adjust prototype.
2134 * w32.h (dostounix_filename): Adjust prototype.
2136 * msdos.c (dostounix_filename): Accept an additional argument and
2138 (init_environment): Adjust callers of dostounix_filename.
2140 * fileio.c (Ffile_name_directory, file_name_as_directory)
2141 (directory_file_name, Fexpand_file_name)
2142 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2144 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2146 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2147 variables, as egetenv is case-insensitive for DOS_NT.
2149 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2150 with an encoded file name.
2152 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2153 Adjust calls to dostounix_filename.
2155 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2157 * unexw32.c (unexec): Adjust call to dostounix_filename.
2159 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2161 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2164 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2167 * callproc.c (Fcall_process): Make sure program name in PATH and
2168 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2169 is passed to exec/spawnve, which fails unless the file-name
2172 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2173 even if w32-quote-process-args is nil.
2175 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2177 Fix timestamp bug when write-region appends nothing (Bug#13149).
2178 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2179 the file's time stamp doesn't change if Emacs happens to write nothing
2180 to the file, and on a buggy file system this could cause Emacs to
2181 incorrectly infer that the file system doesn't have the bug.
2182 Avoid this problem by inhibiting the inference in this case.
2184 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2186 * window.h (struct window): Convert base_line_number, base_line_pos
2187 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2188 Convert region_showing member from Lisp_Object to bitfield.
2189 Remove sequence_number member. Adjust comments.
2190 * window.c (sequence_number): Remove.
2191 (make_window): Initialize column_number_displayed.
2192 * print.c (print_object): Follow the printed representation of
2193 frames and print window pointer to distinguish between windows.
2194 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2195 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2196 (wset_column_number_displayed, wset_region_showing): Remove.
2197 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2198 (try_scrolling, try_cursor_movement, redisplay_window)
2199 (try_window_reusing_current_matrix, try_window_id, display_line)
2200 (display_mode_lines, decode_mode_spec): Adjust users.
2201 * .gdbinit (pwinx): Do not print sequence_number.
2203 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2205 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2206 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2207 * dired.c: Include <fcntl.h>.
2208 (open_directory): New function, which uses open and fdopendir
2209 rather than opendir. DOS_NT platforms still use opendir, though.
2210 (directory_files_internal, file_name_completion): Use it.
2211 (file_attributes): New function, with most of the old Ffile_attributes.
2212 (directory_files_internal, Ffile_attributes): Use it.
2213 (file_attributes, file_name_completion_stat): First arg is now fd,
2214 not dir name. All uses changed. Use fstatat rather than lstat +
2216 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2217 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2218 (emacs_readlinkat): New function, with much of the old
2219 Ffile_symlink_p, but with an fd argument for speed.
2220 It uses readlinkat rather than careadlinkatcwd, so that it
2221 need not assume the working directory.
2222 (Ffile_symlink_p): Use it.
2223 * filelock.c (current_lock_owner): Use emacs_readlinkat
2224 rather than emacs_readlink.
2225 * lisp.h (emacs_readlinkat): New decl.
2226 (READLINK_BUFSIZE, emacs_readlink): Remove.
2227 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2228 (emacs_norealloc_allocator, emacs_readlink): Remove.
2229 This stuff is moved to fileio.c.
2230 * w32.c (fstatat, readlinkat): New functions.
2231 (careadlinkat): Don't check that fd == AT_FDCWD.
2232 (careadlinkatcwd): Remove; no longer needed.
2234 2013-01-31 Glenn Morris <rgm@gnu.org>
2236 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2237 (Fwrite_region): Update for new choose_write_coding_system args.
2238 Move the last piece of choose_write_coding_system here. (Bug#13522)
2239 (syms_of_fileio): Add choose-write-coding-system.
2241 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2243 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2244 (sys_close): Zero out the flags for the file descriptor before
2245 closing it. (Bug#13546)
2247 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2248 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2249 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2252 * w32.c (w32_get_long_filename, init_environment, readlink):
2253 Support file names encoded in DBCS codepages.
2254 (readlink): Use the current file-name-coding-system, not the ANSI
2255 codepage, to decode and handle targets of symlinks.
2257 2013-01-28 Eli Zaretskii <eliz@gnu.org>
2259 * w32.c (opendir): Now accepts a 'const char *'.
2261 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2263 Remove obsolete redisplay code. See the discussion at
2264 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2265 * dispnew.c (preemption_period, preemption_next_check): Remove.
2266 (Vredisplay_preemption_period): Likewise.
2267 (update_frame, update_single_window, update_window, update_frame_1):
2268 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2269 used, following the 2012-06-22 change.
2271 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2273 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2275 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2277 * font.c (num_fonts): Remove the leftover from old
2278 debugging code. Adjust comment style here and there.
2279 * insdel.c (insert_1): Remove.
2280 * lisp.h (insert_1): Remove prototype.
2281 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2283 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2285 * w32.c (max_filename_mbslen): New function.
2286 (normalize_filename, readdir): Use it to detect locales where ANSI
2287 encoding of file names uses a double-byte character set (DBCS).
2288 If a DBCS encoding is used, advance by characters using
2289 CharNextExA, instead of incrementing a 'char *' pointer.
2290 Use _mbslwr instead of _strlwr. (Bug#13515)
2292 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2293 request of memory reservation to 1.7GB. (Bug#13065)
2295 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2297 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2298 at check_extra_latin label. (Bug#13505)
2300 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2302 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2303 Avoid redundant calls to strlen.
2305 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2307 Drop async_visible and async_iconified fields of struct frame.
2308 This is possible because async input is gone; for details, see
2309 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2310 * frame.h (struct frame): Remove async_visible and async_iconified
2311 members, convert garbaged to unsigned bitfield. Adjust comments.
2312 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2313 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2314 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2315 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2316 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2318 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2319 properly. Likewise for obscured.
2321 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2324 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2326 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2328 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2329 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2331 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2333 * xdisp.c (message2, message2_nolog): Remove functions.
2334 (message3, message3_nolog): Extract nbytes and multibyteness directly
2335 from the string. Change all callers.
2336 (message3_nolog): Don't set message_enable_multibyte since set_message
2337 will reset it anyway.
2338 (message1, message1_nolog): Use message3.
2339 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2340 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2341 (set_message): Drop all but the second arg, which has to be a string.
2342 (set_message_1): Simplify now that we know that a1 is NULL and the
2343 second arg is a string.
2344 * frame.h (struct frame): Remove `message_buf' field.
2345 Use glyphs_initialized_p instead.
2346 (FRAME_MESSAGE_BUF): Remove macro.
2347 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2348 * lisp.h (message2, message2_nolog): Remove declarations.
2349 (message3, message3_nolog): Update declarations.
2350 * keyboard.c (read_char_minibuf_menu_text)
2351 (read_char_minibuf_menu_width): Remove vars.
2352 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2353 to correctly handle multibyte strings.
2354 * frame.c (delete_frame): Don't free message_buf any more.
2355 * editfns.c (message_text, message_length): Remove vars.
2356 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2357 * fileio.c (auto_save_error): Use message3 instead of message2.
2358 * dispnew.c (adjust_frame_message_buffer): Remove function.
2360 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2362 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2363 real estate used for the tool bar and the menu bar.
2365 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2367 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2368 hidden buffer is prepared to modification (Bug#13164).
2370 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2372 * window.h (struct window): Change window_end_valid member from
2373 Lisp_Object to a bitfield. Adjust comments.
2374 (wset_window_end_valid): Remove.
2375 * window.c (adjust_window_count): Clear window_end_valid.
2376 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2377 (Fwindow_line_height, set_window_buffer, Frecenter)
2378 (Fsplit_window_internal, Fdelete_other_windows_internal)
2379 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2380 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2381 * xdisp.c (check_window_end, reconsider_clip_changes)
2382 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2383 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2384 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2386 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2388 * xdisp.c (mark_window_display_accurate): Simplify the loop
2389 assuming that the only one of vchild, hchild or buffer window
2390 slots is non-nil. Call mark_window_display_accurate_1 for
2391 the leaf windows only.
2392 (mark_window_display_accurate_1): Always assume leaf window.
2395 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2397 * emacs.c (Qkill_emacs_hook): Now static.
2399 * fileio.c (Finsert_file_contents): Simplify.
2400 Remove unnecessary assignments and tests.
2402 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2404 * w32.c (acl_set_file): Don't test for errors unless
2405 set_file_security returns FALSE. Avoids spurious errors when
2408 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2410 * fileio.c (Finsert_file_contents): Revert code introduced at
2411 2013-01-18 in favor of the simpler and generally better fix.
2412 Save stack space by removing 'buffer' and reusing 'read_buf'
2415 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2417 * lisp.h (eabs): Define unconditionally (Bug#13419).
2418 The old "#if !defined (eabs)" was an unnecessary revenant of back
2419 when this macro was called "abs". Document 'eabs' better.
2421 2013-01-19 Glenn Morris <rgm@gnu.org>
2423 * fns.c (Frandom): Doc fix.
2425 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2427 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2428 segfault when there are lots of overlays.
2430 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2431 when there are lots of overlays.
2432 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2433 for the details and a way to reproduce.
2435 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2437 * fileio.c: Use O_APPEND to append.
2438 This corresponds better to the natural interpretation of "append",
2439 and avoids the need to open the output file twice, or to invoke
2440 lseek when APPEND is neither nil nor a number.
2441 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2442 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2443 file possibly twice, and lseeking to its end; this avoids the
2444 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2445 at the same time: the combination is never needed and apparently
2446 it doesn't work with DOS_NT.
2448 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2449 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2451 Allow floating-point file offsets.
2452 Problem reported by Vitalie Spinu in
2453 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2454 * fileio.c (emacs_lseek): Remove.
2455 (file_offset): New function.
2456 (Finsert_file_contents, Fwrite_region): Use it.
2458 2013-01-19 Chong Yidong <cyd@gnu.org>
2460 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2461 aborting on Fsignal (Bug#13289).
2463 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2465 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2466 set_file_security as failure due to insufficient privileges.
2467 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2468 (fstat): Return owner and group like 'stat' and 'lstat' do.
2470 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2472 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2473 The bug was observed on Ubuntu operating inside a virtual machine,
2474 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2475 The workaround introduces a race condition on non-buggy hosts,
2476 but it's an unlikely race and anyway there's a nearly identical
2477 nearby race that can't be fixed.
2478 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2480 (Fwrite_region): Test for file system time stamp bug.
2481 (init_fileio): New function.
2482 * lisp.h (init_fileio): Declare it.
2483 * emacs.c (main): Call it.
2485 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2486 and make it more consistent with other stat-failure diagnostics.
2488 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2490 Fix crash when inserting data from non-regular files.
2491 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2492 for the error description produced by valgrind.
2493 * fileio.c (read_non_regular): Rename to read_contents.
2494 Free Lisp_Save_Value object used to pass parameters.
2495 (read_non_regular_quit): Rename to read_contents_quit.
2496 (Finsert_file_contents): Redesign internal file reading loop to adjust
2497 gap and end positions after each read and so help make_gap to work
2498 properly. Do not signal an I/O error too early and so do not leave
2499 not yet decoded characters in a buffer, which was the reason of
2500 redisplay crash. Use list2 to build return value. Adjust comments.
2502 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2504 Close a race when statting and reading files (Bug#13149).
2505 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2506 This avoids a race if the file is renamed between stat and open.
2507 This race is not the problem originally noted in Bug#13149;
2508 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2510 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2512 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2513 objects, related functions and macros.
2514 (make_save_value): Adjust prototype.
2515 (make_save_pointer): New prototype.
2516 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2517 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2518 * alloc.c (format_save_value): Rename to make_save_value.
2519 (make_save_pointer): New function.
2520 (record_xmalloc): Use make_save_pointer.
2521 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2522 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2523 Change users of make_save_value to make_save_pointer.
2524 Likewise for format_save_value and make_save_value.
2526 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2528 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2529 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2530 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2533 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2535 * alloc.c (free_save_value): Now static.
2537 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2539 * keymap.c (map_keymap_internal): Use format_save_value.
2540 (map_keymap_char_table_item): Adjust accordingly.
2541 * fileio.c (non_regular_fd, non_regular_inserted)
2542 (non_regular_nbytes): Remove.
2543 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2544 Use format_save_value to pass parameters to read_non_regular.
2545 (read_non_regular): Use XSAVE_ macros to extract parameters.
2547 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2549 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2551 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2553 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2554 extraction from any Lisp_Save_Value slot. Add type checking.
2555 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2556 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2557 * xselect.c: All users changed.
2559 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2561 Some convenient bits to deal with Lisp_Save_Values.
2562 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2563 (allocate_misc): Remove prototype.
2564 (format_save_value): New prototype.
2565 * alloc.c (allocate_misc): Revert back to static.
2566 (format_save_value): New function to build Lisp_Save_Value
2567 object with the specified internal structure.
2568 (make_save_value): Reimplement using format_save_value.
2569 * editfns.c (save_excursion_save): Use format_save_value.
2570 (save_excursion_restore): Use XSAVE_OBJECT.
2572 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2574 Avoid needless casts with XSAVE_POINTER.
2575 * alloc.c (mark_object) [GC_MARK_STACK]:
2576 * dired.c (directory_files_internal_unwind):
2577 * fileio.c (do_auto_save_unwind):
2578 * gtkutil.c (pop_down_dialog):
2579 * keymap.c (map_keymap_char_table_item):
2580 * lread.c (load_unwind):
2581 * nsmenu.m (pop_down_menu):
2582 * print.c (print_object) [GC_MARK_STACK]:
2583 * xfns.c (clean_up_file_dialog):
2584 * xmenu.c (cleanup_widget_value_tree):
2585 Omit casts between XSAVE_POINTER and a pointer type.
2587 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2589 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2590 * eval.c (eval_sub): Protect `form' from being GCed before its
2591 car and cdr becomes protected with the backtrace entry.
2593 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2595 Make Lisp_Save_Value more versatile storage for up to four objects.
2596 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2597 (struct Lisp_Save_Value): New layout. Adjust comments.
2598 (XSAVE_POINTER): New macro.
2599 (XSAVE_INTEGER): Likewise.
2600 (allocate_misc): Add prototype.
2601 (free_misc): Likewise.
2602 * alloc.c (allocate_misc): Now global.
2603 (free_misc): Likewise. Adjust comment.
2604 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2605 (free_save_value): Likewise.
2606 (mark_object): Likewise.
2607 * editfns.c (save_excursion_save): Pack everything within
2608 Lisp_Save_Value and so avoid xmalloc.
2609 (save_excursion_restore): Adjust to match new layout. Use free_misc
2610 because we do not allocate extra memory any more. Add eassert.
2611 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2612 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2613 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2614 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2615 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2617 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2619 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2620 (nsfont_draw): Remove disabling of LCD smoothing.
2621 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2622 Bug#11484 with LCD smoothing on.
2624 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
2626 Fix SIGDANGER handlers, for AIX (Bug#13408).
2627 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2628 Move handlers here from emacs.c; they were out of place.
2630 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2632 * xterm.c (syms_of_xterm): Adjust documentation for
2633 scroll-bar-adjust-thumb-portion.
2635 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2637 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2638 determine whether scroll bar thumb size should be adjusted or
2639 not. Use variable for MOTIF.
2641 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2644 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2646 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2648 (doCommandBySelector:): Set processingCompose to NO.
2650 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2651 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2652 (nsfont_list_family): Add block/unblock_input calls.
2653 (nsfont_open): Move block_input earlier. Add unblock_input before early
2655 (nsfont_draw): Add block/unblock_input calls.
2657 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2659 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2660 for old_charpos and old_bytepos.
2662 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2664 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2665 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2666 Clear tzvalbuf_in_environ if this workaround is in effect.
2667 Problem and fix reported by Kazuhiro Ito.
2669 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2671 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2672 Fix ambiguous doc string cross-reference(s).
2674 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2675 doc string cross-reference(s).
2677 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2678 string cross-reference(s).
2680 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2682 Avoid unnecessary byte position calculation for the gap movement.
2683 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2684 anyway, all of them should use move_gap_both instead.
2685 * lisp.h (move_gap): Remove prototype.
2686 * insdel.c (move_gap): Remove.
2687 (move_gap_both): Add eassert.
2688 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2689 * xml.c (parse_region): Likewise.
2691 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2693 emacsclient -t should not suspend Emacs server (Bug#13387)
2694 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2696 * term.c (init_tty): Use them instead of rolling our own code.
2697 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2698 switches from 'signal' to 'pthread_sigmask', which is safer in
2699 multithreaded applications.
2700 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2701 which has already arranged for that.
2702 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2703 This is the main part of the bug fix.
2705 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
2707 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2708 x_last_font_name (Bug#13403).
2710 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2712 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2713 the type of per-buffer values where appropriate.
2714 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2715 predicate, which is how it's really used now. Adjust comment.
2716 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2717 * buffer.c (buffer_slot_type_mismatch): Remove.
2718 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2719 predicate. Adjust comment.
2720 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2721 fill-column, left-margin, tab-width, buffer-saved-size,
2722 left-margin-width, right-margin-width, left-fringe-width,
2723 right-fringe-width, scroll-bar-width and buffer-display-count.
2724 Use Qstringp for default-directory, buffer-file-name,
2725 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2726 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2728 * data.c (store_symval_forwarding): Adjust to call the predicate.
2730 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
2732 * w32.c (get_name_and_id, acl_set_file):
2733 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2735 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2737 * lisp.h (make_gap_1): New prototype.
2738 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2740 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2742 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2743 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
2744 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2745 (make_gap_1): New function to adjust the gap of any buffer.
2746 * coding.c (coding_alloc_by_making_gap): Use it.
2747 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2748 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2750 2013-01-08 Juri Linkov <juri@jurta.org>
2752 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2753 of (supports :underline (:style wave)). (Bug#13000)
2755 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2757 * undo.c (Fprimitive_undo): Move to simple.el.
2758 (syms_of_undo): Remove declarations for Sprimitive_undo.
2760 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2762 * keyboard.c (echo_add_key): Rename from echo_add_char.
2764 2013-01-06 Chong Yidong <cyd@gnu.org>
2766 * keyboard.c (echo_add_char): New function, factored out from
2767 echo_char. Don't add a space if the previous echo string was
2769 (echo_char): Use it.
2770 (read_key_sequence): When echoing mock input, ensure that the
2771 trailing dash is properly added.
2773 2013-01-05 Eli Zaretskii <eliz@gnu.org>
2775 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2776 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
2777 digits for buffer positions, before misalignment starts.
2778 Display "0" for integer "object" field.
2779 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2780 Display the newline glyph more unambiguously.
2782 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2784 * nsterm.m (ns_draw_underwave):
2785 * w32term.c (w32_draw_underwave):
2786 * xterm.c (x_draw_underwave): Make underwave look more triangular
2787 and also degrade gracefully for small fonts. (Bug#13000)
2789 * nsterm.m (ns_draw_text_decoration):
2790 * w32term.c (x_draw_glyph_string):
2791 * xterm.c (x_draw_glyph_string): Don't use previous underline
2792 thickness and position if previous underline type is underwave.
2794 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2796 * fileio.c (Ffile_acl): Undocument return format.
2798 2013-01-02 Glenn Morris <rgm@gnu.org>
2800 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2802 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2805 * dired.c (file_name_completion):
2806 * doc.c (get_doc_string):
2807 * floatfns.c (round2):
2808 * font.c (font_score, font_delete_unmatched):
2809 * fringe.c (compute_fringe_widths):
2810 * lread.c (read_list):
2811 * minibuf.c (Ftry_completion):
2812 * term.c (tty_ins_del_lines):
2813 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2814 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2816 2012-12-31 Eli Zaretskii <eliz@gnu.org>
2818 * w32.c (unsetenv): Set up the string passed to _putenv
2820 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
2821 for the bug this caused.
2823 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2825 * coding.c (Qmac): Now static.
2827 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2829 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2830 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2831 handlebox_widget. Set toolbar_in_hbox to false/true, set
2832 toolbar_is_packed to true.
2833 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2834 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2835 Show all on TOOLBAR_TOP_WIDGET.
2836 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2837 by TOOLBAR_TOP_WIDGET.
2838 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2839 Check toolbar_is_packed.
2840 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2841 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2842 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2844 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2845 (xg_update_menubar): Update title only if
2846 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2847 (xg_update_submenu): Skip tearoff only if
2848 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2849 (xg_initialize): Initialize xg_detached_menus only if
2850 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2852 * xterm.h (struct x_output): Surround handlebox_widget with
2853 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2854 toolbar_in_hbox is bool.
2856 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2858 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2859 (LIBS_GNUSTEP): Define.
2860 (LIBES): Add $(LIBS_GNUSTEP).
2861 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2863 2012-12-30 Eli Zaretskii <eliz@gnu.org>
2865 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2866 continuation glyph on a TTY with an indication of an empty line.
2869 2012-12-29 Eli Zaretskii <eliz@gnu.org>
2871 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2872 file's SELinux context or ACLs successfully set, nil otherwise.
2874 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
2876 * w32proc.c (reader_thread): Avoid passing NULL handles to
2877 SetEvent and WaitForSingleObject.
2879 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2881 Port EXTERNALLY_VISIBLE to Clang 3.2.
2882 * conf_post.h (__has_attribute): New macro.
2883 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2885 2012-12-27 Glenn Morris <rgm@gnu.org>
2887 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2888 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2890 2012-12-27 Eli Zaretskii <eliz@gnu.org>
2892 * fileio.c (file_name_as_directory, directory_file_name):
2893 Accept an additional argument MULTIBYTE to indicate whether the input C
2894 came from a multibyte or a unibyte Lisp string; all callers
2895 adjusted. Don't assume the input string is always multibyte.
2897 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2898 don't ENCODE_FILE them, and return a unibyte string if the input
2900 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2901 don't assume the input strings will always be multibyte. If the
2902 input strings are multibyte, decode strings obtained from C
2905 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2907 * lisp.h (toplevel): Add two notices to the comment about
2908 defining a new Lisp data type.
2909 * print.c (print_object): If Lisp_Save_Value object's pointer
2910 is the address of a memory area containing Lisp_Objects, try
2912 * alloc.c (valid_lisp_object_p): Adjust comment.
2914 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2916 * keyboard.c (record_asynch_buffer_change): Initialize an event
2917 only if it's really needed.
2918 * frame.h (enum output_method): Remove output_mac member since
2919 it's a leftover from the deleted code.
2920 * frame.c (Fframep): Adjust user here ...
2921 * terminal.c (Fterminal_live_p): ... and here.
2922 * coding.c (Qmac): Now here because it's only used to denote
2923 end-of-line encoding type.
2924 (syms_of_coding): DEFSYM it.
2925 * frame.h (Qmac): Remove duplicated declaration.
2927 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2929 * window.c (select_window_1): Now static, since it's used only here.
2931 2012-12-25 Eli Zaretskii <eliz@gnu.org>
2933 * window.c (window_body_cols): Subtract display margins from the
2934 window body width on TTYs as well. See
2935 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2936 for the original report.
2938 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2940 * xdisp.c (redisplay_window): Remove inner local variable
2941 because the outer shadowed one has the same meaning.
2942 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2944 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2945 (xg_create_tool_bar): Adjust users.
2947 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2949 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2950 * buffer.c (Fget_buffer_create): Use it to set compact field of
2951 struct buffer_text to avoid accessing an uninitialized value
2952 when compact_buffer is called for the first time.
2953 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2954 (Fset_buffer_modified_p): Use buffer_window_count to check
2955 whether the buffer is displayed in some window.
2956 * xdisp.c (message_dolog): Likewise.
2958 2012-12-23 Eli Zaretskii <eliz@gnu.org>
2960 * w32.c (acl_set_file): If setting the file security descriptor
2961 fails, and the new DACL is identical to the existing one, silently
2962 return success. This fixes problems for users backing up their
2963 own files without having the necessary privileges for setting
2964 security descriptors.
2966 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2968 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2969 after WaitForSingleObject returns normally. This expedites reader
2970 thread shutdown when delete_child triggers it.
2971 (reap_subprocess): More accurate commentary for why we call
2972 delete_child only when cp->fd is negative.
2974 * w32.c (sys_close): Do not call delete_child on a subprocess
2975 whose handle is not yet closed. Instead, set its file descriptor
2976 to a negative value, so that reap_subprocess will call
2977 delete_child on that subprocess when its SIGCHLD arrives.
2978 This avoids closing handles used for communications between sys_select
2979 and reader_thread, which doesn't give sys_select a chance to
2980 notice that the process exited and invoke the SIGCHLD handler for
2983 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2985 * nsfns.m (Fns_do_applescript): Run event loop until script has
2986 been executed (Bug#12969).
2987 (ns_run_ascript): Chech as_script for nil, set to nil after
2990 2012-12-22 Martin Rudalics <rudalics@gmx.at>
2992 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2994 2012-12-22 Eli Zaretskii <eliz@gnu.org>
2996 * w32term.c (w32fullscreen_hook): New function.
2997 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2999 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3001 * fileio.c (Finsert_file_contents): Doc fix.
3003 * w32proc.c (new_child, delete_child, find_child_pid): For a
3004 subprocess, consider its slot being in use as long as its process
3005 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3006 slot when a new process is started immediately after killing
3007 another one, without waiting enough time for the first process to
3008 be reaped and resources allocated for it be orderly freed.
3010 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3012 2012-12-21 Chong Yidong <cyd@gnu.org>
3014 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3016 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3018 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3020 * w32.c (get_name_and_id): Always pass NULL as the first argument
3021 of lookup_account_sid. Avoids crashes with UNC file names that
3022 refer to DFS domains, not to specific machine names. (Bug#12621)
3023 Remove now unused argument FNAME; all callers changed.
3024 (get_file_owner_and_group): Remove now unused argument FNAME; all
3027 2012-12-21 Chong Yidong <cyd@gnu.org>
3029 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3030 error for invalid chars, don't check for a nil return value.
3032 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3034 Avoid calls to CHAR_TO_BYTE if byte position is known.
3035 * editfns.c (make_buffer_string_both): Use move_gap_both.
3036 (Fbuffer_string): Use make_buffer_string_both.
3037 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3039 (buf_bytepos_to_charpos): Likewise.
3040 (charpos_to_bytepos): Remove.
3041 * fileio.c (Finsert_file_contents): Use move_gap_both.
3042 * search.c (Freplace_match): Likewise.
3043 * process.c (process_send_region): Likewise. Use convenient
3044 names for byte positions.
3045 * lisp.h (charpos_to_bytepos): Remove prototype.
3046 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3047 * insdel.c (move_gap): Likewise.
3049 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3051 * xdisp.c (redisplay_internal): Remove now-unused local.
3053 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3055 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3056 (redisplay_internal): Don't bother selecting the frame to get the
3057 proper value of frame-local variables (bug#13225).
3059 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3061 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3062 Rename 4th argument since it may be buffer or string. Adjust comment.
3063 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3065 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3067 * coding.c (Fdetect_coding_region): Do not check start and end with
3068 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3069 (code_convert_region): Likewise.
3071 2012-12-18 Eli Zaretskii <eliz@gnu.org>
3073 * w32.c (acl_get_file, acl_set_file): Run the file name through
3074 map_w32_filename, and resolve any symlinks in the file name, like
3076 (acl_set_file): Call revert_to_self, if any privileges were
3079 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
3081 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3082 ($(BLD)/w32.$(O)): Update dependencies.
3084 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3086 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3087 propagate redisplay's scrolling (if any) to the right window.
3088 (redisplay_internal): Use ensure_selected_frame.
3089 (display_mode_lines): Complete last fix.
3090 * window.c (select_window_1): New func, extracted from select_window.
3091 (select_window): Use it.
3092 * window.h (select_window_1): Declare.
3094 2012-12-17 Eli Zaretskii <eliz@gnu.org>
3096 Emulate Posix ACL APIs on MS-Windows.
3097 * w32.c: Include sddl.h and sys/acl.h.
3098 (SDDL_REVISION_1): Define if not already defined.
3099 (g_b_init_get_security_descriptor_dacl)
3100 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3101 (g_b_init_is_valid_security_descriptor)
3102 (g_b_init_set_file_security): New static flags.
3103 (globals_of_w32): Initialize them to zero.
3104 (SetFileSecurity_Name): New string constant.
3105 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3106 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3107 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3108 (IsValidSecurityDescriptor_Proc): New typedefs.
3109 (get_file_security, get_security_descriptor_owner)
3110 (get_security_descriptor_group): Set errno to ENOTSUP.
3111 (set_file_security, get_security_descriptor_dacl)
3112 (is_valid_security_descriptor, convert_sd_to_sddl)
3113 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3114 (acl_free, acl_get_file, acl_set_file): New functions.
3116 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3118 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3120 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3121 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3122 for some of that bug's symptoms can now cause Emacs to abort.
3123 Remove the workaround.
3124 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3125 The bug that caused SIGCHLD to get lost has been fixed, and the
3126 workaround for it can now cause Emacs to abort.
3128 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3130 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3131 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3132 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3134 2012-12-16 Romain Francoise <romain@orebokech.com>
3136 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3137 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3138 and copy ACL entries of file in addition to SELinux context if set.
3139 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3141 * Makefile.in (LIBACL_LIBS): New macro.
3144 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3146 * fileio.c (internal_delete_file): Use bool for boolean.
3148 2012-12-15 Eli Zaretskii <eliz@gnu.org>
3150 Fix bug #13079 on MS-Windows with temp files not being deleted.
3151 * w32.h (_child_process): New members input_file and
3153 (register_child): First argument is now pid_t.
3154 (record_infile, record_pending_deletion): New prototypes.
3156 * w32proc.c (new_child): Initialize input_file and
3157 pending_deletion members of the child.
3158 (delete_child): Delete the child's temporary input file, if any,
3159 that is pending deletion.
3160 (register_child): First argument is now pid_t.
3161 (record_infile, record_pending_deletion): New functions.
3162 (reap_subprocess): Fix a typo in DebPrint string.
3163 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3165 * fileio.c (internal_delete_file): Return an int again: non-zero
3166 if delete-file succeeds, zero otherwise.
3168 * lisp.h (internal_delete_file): Adjust prototype.
3170 * callproc.c (Fcall_process): Don't overwrite infile with result
3172 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3173 asynchronous subprocess, record the name of the input file name,
3175 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3176 delete the file, record it as pending deletion when the subprocess
3179 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3181 * editfns.c [HAVE_PWD_H]: Include grp.h.
3183 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3185 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3187 Fix permissions bugs with setgid directories etc. (Bug#13125)
3188 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3189 to mark it as a placeholder. The old value was often wrong.
3190 The only user of this attribute has been changed to use
3191 file-ownership-preserved-p instead, with its new group arg.
3192 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3194 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3196 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3197 Keep selected_window and selected_frame in sync.
3199 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3201 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3202 try to get accurate owner and group information from NT file
3203 security APIs. This is to make most callers of 'stat' and
3204 'lstat', which don't need that information, much faster.
3206 * dired.c (Ffile_attributes) [WINDOWSNT]:
3207 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3208 owner and group information from 'lstat'.
3210 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3212 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3213 as that confuses set-auto-coding, so insist on the head-read
3214 returning the full 1024 bytes. Let lseek compute the tail offset;
3215 less work for us. Do not ignore I/O errors when reading the tail.
3217 * xdisp.c: Minor style fixes.
3218 (init_iterator): Hoist assignment out of if-expression.
3219 (markpos_of_region): Callers now test for sign, not for -1.
3221 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3223 Minor redisplay optimization when the region length is zero.
3224 * xdisp.c (markpos_of_region): New function.
3225 (init_iterator): Do not highlight the region of zero length.
3226 (redisplay_window): Check whether the region is of non-zero length.
3227 (try_cursor_movement): Allow if the region length is zero.
3228 (try_window_reusing_current_matrix, try_window_id): Likewise.
3230 2012-12-13 Eli Zaretskii <eliz@gnu.org>
3232 * search.c (search_buffer): Check the inverse translations of each
3233 character in pattern when the buffer being searched is unibyte.
3236 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3238 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3239 files, fixing a regression from 24.2.
3240 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3242 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3244 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3245 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3246 Remove unnecessary S_ISLNK test, as (contra the comments) this
3247 function can't copy symlinks. Improve quality of error message
3248 when attempting to copy files that are neither regular files nor
3251 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3253 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3254 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3255 * window.c (Frecenter):
3256 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3257 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3259 2012-12-12 Daniel Colascione <dancol@dancol.org>
3261 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3262 the dumped Emacs is not a sparse file, greatly improving Cygwin
3263 "make bootstrap" performance.
3265 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
3267 * inotify.c (inotify_callback): Generate an Emacs event for every
3268 incoming inotify event.
3270 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3272 * xdisp.c (handle_face_prop): Fix logic of computing
3273 it->start_of_box_run_p.
3274 (append_space_for_newline): If the glyph row is R2L, reset the
3275 iterator's end_of_box_run_p flag before prepending the space glyph.
3276 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3277 iterator's start_of_box_run_p flag before prepending the stretch.
3278 (append_glyph, produce_image_glyph, append_composite_glyph)
3279 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3280 left_box_line_p and right_box_line_p flags of the glyph for R2L
3281 glyph rows. (Bug#13011)
3283 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3285 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3286 if changed buffer is not shown in a window.
3287 * insdel.c (prepare_to_modify_buffer): Likewise.
3288 * window.c (replace_buffer_in_windows_safely): Do nothing
3289 if buffer is not shown in a window.
3290 (Fforce_window_update): Likewise if string or buffer argument
3293 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3295 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3296 encoded_file_name, which is what it is.
3298 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3300 Consistently use marker_position and marker_byte_position.
3301 * fringe.c (Ffringe_bitmaps_at_pos):
3302 * indent.c (Fvertical_motion):
3303 * insdel.c (prepare_to_modify_buffer):
3304 * keyboard.c (make_lispy_position):
3305 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3306 (window_scroll_pixel_based, displayed_window_lines)
3307 (Fset_window_configuration):
3308 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3309 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3310 Replace direct access to marker fields with calls
3311 to marker_position and/or marker_byte_position.
3313 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3315 * makefile.w32-in (SIG2STR_H): New macro.
3316 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3317 ($(BLD)/w32notify.$(O)): Update dependencies.
3319 2012-12-10 Daniel Colascione <dancol@dancol.org>
3321 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3322 Windows file notification functionality unless WINDOWSNT.
3324 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3327 * w32fns.c (cache_system_info): Initialize the global hinst
3328 variable here so various initialization calls DTRT.
3330 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3331 (hinst): Remove unneeded extern declaration.
3332 (_start): Remove initialization of above variables; remove
3333 initialization of hinst, as cache_system_info now does that.
3335 * emacs.c (main): Call cache_system_info early in startup; we
3336 previously weren't calling it in Cygwin builds.
3338 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3339 Teach the autoconf build system how to compile a Windows resource file
3340 and link it to Emacs.
3342 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3344 Per-buffer window counters.
3345 * buffer.h (struct buffer): New member window_count.
3346 (buffer_window_count): New function.
3347 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3348 Initialize window_count.
3349 (Fkill_buffer): Verify window_count for the buffer being killed.
3350 (modify_overlay): Do not force redisplay if buffer is not shown
3352 (init_buffer_once): Initialize window_count for buffer_defaults
3353 and buffer_local_symbols.
3354 * window.h (buffer_shared): Remove declaration.
3355 (wset_buffer): Convert from inline ...
3356 * window.c (wset_buffer): ... to an ordinary function.
3357 (adjust_window_count): New function.
3358 (make_parent_window): Use it.
3359 * xdisp.c (buffer_shared): Remove.
3360 (redisplay_internal, redisplay_window): Adjust users.
3361 (buffer_shared_and_changed): Use per-buffer window counter.
3363 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3365 Support for filesystem notifications on MS-Windows.
3366 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3367 and this is a TTY frame, signal the caller that keyboard input is
3370 * w32xfns.c (drain_message_queue): Now returns an int: an
3371 indication whether any WM_EMACS_FILENOTIFY messages were found in
3374 * w32inevt.c (handle_file_notifications): New function.
3375 (w32_console_read_socket): Call it to process file notifications.
3377 * w32console.c (initialize_w32_display): Record the main thread ID
3380 * deps.mk (inotify.o): New dependency list.
3382 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3384 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3385 (WM_EMACS_END): Bump value by 1.
3386 (notification_buffer_in_use, file_notifications)
3387 (notifications_size, notifications_desc): Declare.
3388 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3391 * w32term.c (lispy_file_action, queue_notifications): New functions.
3392 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3393 <Qrenamed_to>: New symbols.
3394 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3396 * w32notify.c: New file, implements file event notifications for
3399 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3400 by posting it to the w32_read_socket queue.
3402 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3404 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3405 (GLOBAL_SOURCES): Add w32notify.c
3406 ($(BLD)/w32notify.$(O)): New set of dependencies.
3408 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3410 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3411 Handle FILE_NOTIFY_EVENT.
3412 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3413 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3414 w32notify-handle-event by default.
3416 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3419 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3421 Support for filesystem notifications on GNU/Linux via inotify.
3422 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3424 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3426 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3427 (syms_of_keyboard): DEFSYM it.
3428 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3429 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3430 Qfile_inotify events.
3431 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3432 special-event-map to inotify-handle-event.
3434 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3436 * Makefile.in (base_obj): Add inotify.o.
3438 * inotify.c: New file.
3440 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3442 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3444 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3446 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3447 DWORD_PTR, for compatibility with 64-bit builds.
3449 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3450 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3451 (system_process_attributes): Use SIZE_T rather than DWORD, for
3452 compatibility with 64-bit builds.
3454 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3456 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3458 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3460 * indent.c (Fvertical_motion): If a display string will be
3461 displayed on the left or the right margin, don't consider it as a
3462 factor in cursor positioning. (Bug#13108)
3464 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3466 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3468 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3470 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3473 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3475 * w32.c (unsetenv): Return 0 if the input string is too long.
3477 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3479 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3480 * alloc.c (xputenv): New function.
3481 * dbusbind.c (Fdbus_init_bus):
3483 * xterm.c (x_term_init):
3484 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3485 * editfns.c (initial_tz): Move static var decl up.
3486 (tzvalbuf_in_environ): New static var.
3487 (init_editfns): Initialize these two static vars.
3488 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3489 Save old TZ value on stack, if it's small.
3490 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3491 instead, use xputenv+unsetenv to set and restore TZ.
3492 (environbuf): Remove static var. All uses removed.
3493 (Fset_time_zone_rule): Do not save TZ and environ;
3494 no longer needed here.
3495 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3496 Move to inside set_time_zone_rule; they don't need file scope any more.
3497 (set_time_zone_rule): Maintain the TZ=value string separately.
3498 (syms_of_editfns): Don't initialize initial_tz;
3499 init_editfns now does it.
3500 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3501 * lisp.h (xputenv): New decl.
3503 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3505 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3507 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3509 * w32.c (unsetenv, sys_putenv): New functions.
3511 2012-12-08 Chong Yidong <cyd@gnu.org>
3513 * editfns.c (Finsert_char): Make the error message more
3514 informative (Bug#12992).
3516 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3518 Simplify get_lim_data.
3519 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3520 Remove USG and vlimit methods; no longer used these days.
3521 Add #error catchall just in case.
3523 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3524 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3525 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3526 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3527 (deleted_pid_list, Fdelete_process, create_process)
3528 (record_child_status_change, handle_child_signal, deliver_child_signal)
3529 (init_process_emacs, syms_of_process):
3530 Assume SIGCHLD is defined.
3531 (parse_signal): Remove. All uses removed.
3532 (abbr_to_signal): New static function.
3533 (Fsignal_process): Use it to convert signal names to ints.
3534 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3535 kill (getpgrp (), ...).
3536 (emacs_sigaction_init): Assume SIGCHLD is defined.
3537 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3538 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3539 * syssignal.h (EMACS_KILLPG): Remove.
3540 All uses replaced by 'kill' with a negative pid.
3541 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3542 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3544 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3546 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3547 This will cause a production Emacs to dump core instead of
3550 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3552 * frame.c (make_frame): Do not set window's buffer to t.
3553 * window.c (Fsplit_window_internal): Likewise. Previously it was
3554 used to indicate that the window is being set up. Now we use
3555 set_window_buffer for all new windows, so the condition in ...
3556 (Fset_window_buffer): ... is always true and can be removed.
3558 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3560 Convenient macro to check whether the buffer is hidden.
3561 * buffer.h (BUFFER_HIDDEN_P): New macro.
3562 * frame.c (make_frame): Use it. Adjust comment.
3563 * buffer.c (candidate_buffer): New function.
3564 (Fother_buffer, other_buffer_safely): Use it.
3566 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3568 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3569 if the child process is still running. Instead, exit the wait
3570 loop and return zero. (Bug#13086)
3572 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3574 * frame.h (x_char_width, x_char_height): Remove prototypes.
3575 * w32term.h (x_char_width, x_char_height): Likewise.
3576 * xfns.c (x_char_width, x_char_height): Remove.
3577 * w32fns.c (x_char_width, x_char_height): Likewise.
3578 * nsfns.c (x_char_width, x_char_height): Likewise.
3579 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3581 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3582 * keyboard.c (command_loop_1): Remove prototype.
3583 (command_loop_2, top_level_1): Add static to match prototype.
3585 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3587 Fix a recently-introduced delete-process race condition.
3588 * callproc.c, process.h (record_kill_process):
3589 New function, containing part of the old call_process_kill.
3590 (call_process_kill): Use it.
3591 This does not change call_process_kill's behavior.
3592 * process.c (Fdelete_process): Use record_kill_process to fix a
3593 race condition that could cause Emacs to lose track of a child.
3595 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3597 Avoid code duplication between prev_frame and next_frame.
3598 * frame.c (candidate_frame): New function. Add comment.
3599 (prev_frame, next_frame): Use it. Adjust comment.
3601 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3603 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3604 fails, signal an error instead of continuing with an empty
3606 Encode expanded temp file pattern before passing it to mkstemp or
3609 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3610 Encode the file name before passing it to dostounix_filename, in
3611 case it will downcase it (under w32-downcase-file-names).
3614 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3616 Minor call-process cleanups.
3617 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3618 at the same time as other platforms, to simplify analysis.
3619 No need for fd0_volatile since we have synch_process_fd.
3620 Avoid needless emacs_close; arg is always negative.
3622 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3624 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3627 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3629 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3630 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3631 and mouse_face_hidden members to a bitfields.
3632 * frame.h (struct frame): Remove set-but-not-used space_width member.
3633 (FRAME_SPACE_WIDTH): Remove.
3634 * nsterm.m, w32term.c, xterm.c: Adjust users.
3635 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3636 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3637 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3638 members to a bitfields.
3640 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3642 Don't let call-process be a zombie factory (Bug#12980).
3643 Fixing this bug required some cleanup of the signal-handling code.
3644 As a side effect, this change also fixes a longstanding rare race
3645 condition whereby Emacs could mistakenly kill unrelated processes,
3646 and it fixes a bug where a second C-g does not kill a recalcitrant
3647 synchronous process in GNU/Linux and similar platforms.
3648 The patch should also fix the last vestiges of Bug#9488,
3649 a bug which has mostly been fixed on the trunk by other changes.
3650 * callproc.c, process.h (synch_process_alive, synch_process_death)
3651 (synch_process_termsig, sync_process_retcode):
3652 Remove. All uses removed, to simplify analysis and so that
3653 less consing is done inside critical sections.
3654 * callproc.c (call_process_exited): Remove. All uses replaced
3655 with !synch_process_pid.
3656 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3657 These take the role of what used to be in unwind-protect arg.
3659 (block_child_signal, unblock_child_signal):
3660 New functions, to avoid races that could kill innocent-victim processes.
3661 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3662 (call_process_kill): Record killed processes as deleted, so that
3663 zombies do not clutter up the system. Do this inside a critical
3664 section, to avoid a race that would allow the clutter.
3665 (call_process_cleanup): Fix code so that the second C-g works again
3666 on common platforms such as GNU/Linux.
3667 (Fcall_process): Create the child process in a critical section,
3668 to fix a race condition. If creating an asynchronous process,
3669 record it as deleted so that zombies do not clutter up the system.
3670 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3671 light of these changes. Omit unnecessary call to emacs_close
3672 before failure, as the unwind-protect code does that.
3673 * callproc.c (call_process_cleanup):
3674 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3675 * process.c (record_deleted_pid): New function, containing
3676 code refactored out of Fdelete_process.
3677 (Fdelete_process): Use it.
3678 (process_status_retrieved): Remove. All callers changed to use
3679 child_status_change.
3680 (record_child_status_change): Remove, folding its contents into ...
3681 (handle_child_signal): ... this signal handler. Now, this
3682 function is purely a handler for SIGCHLD, and is not called after
3683 a synchronous waitpid returns; the synchronous code is moved to
3684 wait_for_termination. There is no need to worry about reaping
3685 more than one child now.
3686 * sysdep.c (get_child_status, child_status_changed): New functions.
3687 (wait_for_termination): Now takes int * status and bool
3688 interruptible arguments, too. Do not record child status change;
3689 that's now the caller's responsibility. All callers changed.
3690 Reimplement in terms of get_child_status.
3691 (wait_for_termination_1, interruptible_wait_for_termination):
3692 Remove. All callers changed to use wait_for_termination.
3693 * syswait.h: Include <stdbool.h>, for bool.
3694 (record_child_status_change, interruptible_wait_for_termination):
3696 (record_deleted_pid, child_status_changed): New decls.
3697 (wait_for_termination): Adjust to API changes noted above.
3699 * bytecode.c, lisp.h (Qbytecode): Remove.
3700 No longer needed after 2012-11-20 interactive-p changes.
3702 2012-12-03 Eli Zaretskii <eliz@gnu.org>
3704 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3705 the scroll margin, move point outside the margin. (Bug#13055)
3707 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3709 * gtkutil.c (my_log_handler): New function.
3710 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3712 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3714 * lisp.h (modify_region): Rename to...
3715 (modify_region_1): ...new prototype.
3716 * textprop.c (modify_region): Now static. Adjust users.
3717 * insdel.c (modify_region): Rename to...
3718 (modify_region_1): ...new function to work with current buffer.
3719 Adjust comment and users. Use true and false for booleans.
3721 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3723 * alloc.c (free_save_value): New function.
3724 (safe_alloca_unwind): Use it.
3725 * lisp.h (free_save_value): New prototype.
3726 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3728 (save_excursion_restore): Adjust to match saved data structure.
3729 Use free_save_value to offload some work from GC. Drop obsolete
3732 2012-12-03 Chong Yidong <cyd@gnu.org>
3734 * fileio.c (Vauto_save_list_file_name): Doc fix.
3736 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
3738 * w32fns.c: Remove prototype of atof.
3739 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
3741 (file_dialog_callback): Make it UINT_PTR.
3743 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3746 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3747 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3750 2012-12-03 Glenn Morris <rgm@gnu.org>
3752 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
3754 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3756 Fix xpalloc confusion after memory is exhausted.
3757 * alloc.c (xpalloc): Comment fix.
3758 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3759 and signals an error, do not clear charset_table_size, as
3760 charset_table is still valid.
3761 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3763 Use execve to avoid need to munge environ (Bug#13054).
3764 * callproc.c (Fcall_process):
3765 * process.c (create_process):
3766 Don't save and restore environ; no longer needed.
3767 * callproc.c (child_setup):
3768 Use execve, not execvp, to preserve environ.
3770 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3772 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3774 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3776 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3777 display for sliced images (Bug#10500).
3779 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3781 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
3783 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3784 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3786 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3788 * xdisp.c (window_outdated): Remove eassert since it hits
3789 some suspicious corner cases (see Bug#13007 and Bug#13012).
3790 (mode_line_update_needed): New function.
3791 (redisplay_internal, redisplay_window): Use it.
3792 (ensure_selected_frame): New function.
3793 (redisplay_internal, unwind_redisplay): Use it.
3794 (redisplay_internal): Move comment about buffer_shared...
3795 (buffer_shared_and_changed): ...near to its real use.
3797 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3799 * callproc.c (Fcall_process): Don't misreport vfork failure.
3801 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3803 * callproc.c (Fcall_process): Fix vfork portability problems.
3804 Do not assume that fd[0], count, filefd, and save_environ survive
3805 vfork. Fix bug whereby wrong errno value could be reported for
3806 pipe failure. Some minor cleanups, too, as follows. Move buf and
3807 bufsize to the context where they're needed. Change new_argv to
3808 be of type char **, as this is more convenient and avoids casts.
3809 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3810 Now local constants, not macros.
3812 2012-11-18 Kenichi Handa <handa@gnu.org>
3814 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3815 for the variable "f".
3817 2012-11-13 Kenichi Handa <handa@gnu.org>
3819 * font.c (font_unparse_xlfd): Exclude special characters from the
3820 generating XLFD name.
3822 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3824 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3825 * dired.c (stat_uname, stat_gname):
3826 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3828 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3829 * dired.c (directory_files_internal, file_name_completion):
3830 Assume EAGAIN and EINTR are defined.
3832 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3833 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3834 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3835 * lread.c (readbyte_from_file): Assume EINTR is defined.
3836 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3837 Assume EIO and EAGAIN are defined.
3838 * unexcoff.c (write_segment): Assume EFAULT is defined.
3840 2012-11-27 Eli Zaretskii <eliz@gnu.org>
3842 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3845 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3846 highlighting on the frame was cleared. Prevents assertion
3847 violations when repeatedly clicking on the "Top" link of the
3848 "bread-crumbs" in Info buffers.
3850 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3852 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3854 2012-11-24 Ken Brown <kbrown@cornell.edu>
3856 * keyboard.c (HAVE_MOUSE):
3857 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3858 were always defined.
3860 2012-11-24 Eli Zaretskii <eliz@gnu.org>
3862 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3863 between bpos_covered and bpos_max. This fixes cursor display when
3864 several display strings follow each other.
3866 * .gdbinit (pgx): If the glyph's object is a string, display the
3867 pointer to string data, rather than the value of the string object
3868 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3870 * indent.c (Fvertical_motion): If the starting position is covered
3871 by a display string, return to one position before that, to avoid
3872 overshooting it inside move_it_to. (Bug#12930)
3874 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3876 * frame.h (struct frame): Remove display_preempted member
3877 since all users are dead long ago.
3878 * nsterm.h (struct x_output): Use the only dummy member.
3879 * w32menu.c (pending_menu_activation): Remove since not
3881 (set_frame_menubar): Adjust user.
3882 * w32term.h (struct x_output): Drop outdated #if 0 code.
3883 (struct w32_output): Use bitfields for explicit_parent,
3884 asked_for_visible and menubar_active members.
3885 Drop unused pending_menu_activation member.
3886 * xterm.h (struct x_output): Drop outdated #if 0 code.
3887 Use bitfields for explicit_parent, asked_for_visible,
3888 has_been_visible and net_wm_state_hidden_seen members.
3890 2012-11-23 Eli Zaretskii <eliz@gnu.org>
3892 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3893 of a literal "/". (Bug#12955)
3894 (gl-stamp): Invoke fc.exe directly, not through cmd.
3896 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3898 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3899 * dired.c: Assume HAVE_DIRENT_H.
3900 (NAMLEN): Remove, replacing with ...
3901 (dirent_namelen): New function. All uses changed. Use the GNU macro
3902 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3903 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3904 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3905 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3907 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3908 * ndir.h: Rename to ../nt/inc/dirent.h.
3909 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3910 Do not include <dirent.h>; no longer needed.
3911 * w32.c: Include <dirent.h> rather than "ndir.h".
3913 2012-11-23 Chong Yidong <cyd@gnu.org>
3915 * xftfont.c (xftfont_open): Remove duplicate assignment.
3917 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3919 * alloc.c (Fgarbage_collect): Unblock input after clearing
3920 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3921 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3922 * msdos.c (IT_frame_up_to_date): Use it here...
3923 * w32term.c (w32_frame_up_to_date): ...here...
3924 * xterm.c (XTframe_up_to_date): ...and here...
3925 * nsterm.m (ns_frame_up_to_date): ...but not here.
3926 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3928 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3929 Do not check whether GC is in progress.
3931 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3933 * xdisp.c (window_buffer_changed): New function.
3934 (update_menu_bar, update_tool_bar): Use it to
3935 simplify large 'if' statements.
3936 (redisplay_internal): Generalize commonly used
3937 'tail' and 'frame' local variables.
3939 2012-11-22 Eli Zaretskii <eliz@gnu.org>
3941 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3942 with Windows system header.
3944 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3946 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3947 * alloc.c: Assume unistd.h exists.
3948 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3949 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3950 (getwd) [USG]: Remove; no longer needed.
3951 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3952 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3953 * w32.h (getcwd): Remove decl.
3955 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3957 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3958 Make it set selected_window as well.
3959 (update_tool_bar): Use it.
3961 2012-11-21 Ken Brown <kbrown@cornell.edu>
3963 * emacs.c (main): Set the G_SLICE environment variable for all
3964 Cygwin builds, not just GTK builds. See
3965 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3967 2012-11-21 Eli Zaretskii <eliz@gnu.org>
3969 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3970 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3971 Define for the MSVC compiler.
3973 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
3975 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3976 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3977 dostounix_filename. Prevents crashes down the road, because
3978 dostounix_filename assumes it gets a unibyte string.
3979 Reported by Michel de Ruiter <michel@sentient.nl>, see
3980 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3982 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3984 Conflate Qnil and Qunbound for `symbol-function'.
3985 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3986 * lread.c (init_obarray): Set `function' fields to Qnil.
3987 * eval.c (Fcommandp): Ignore Qunbound.
3988 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3989 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3990 Test NILP rather than Qunbound.
3991 (Ffmakunbound): Set to Qnil.
3992 (Fsymbol_function): Never signal an error.
3993 (Finteractive_form): Ignore Qunbound.
3995 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3997 * eval.c (interactive_p): Remove no-longer-used decl.
3999 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4001 * xdisp.c (buffer_shared): Adjust comment.
4002 (buffer_shared_and_changed): New function.
4003 (prepare_menu_bars, redisplay_internal): Use it to
4004 decide whether all windows or frames should be updated.
4005 (window_outdated): New function.
4006 (text_outside_line_unchanged_p, redisplay_window): Use it.
4007 (redisplay_internal): Likewise. Fix indentation.
4009 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4011 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4012 (syms_of_eval): Remove corresponding defsubr.
4013 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4015 2012-11-19 Daniel Colascione <dancol@dancol.org>
4017 * w32fns.c (Fx_file_dialog):
4018 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4019 cygwin_convert_file_name*.
4021 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4022 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4024 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4026 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4028 2012-11-18 Eli Zaretskii <eliz@gnu.org>
4030 * w32select.c: Include w32common.h before w32term.h, so that
4031 windows.h gets included before w32term.h uses some of its
4032 features, see below.
4034 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4036 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4038 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4040 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
4042 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4043 (ns_select): Return at once if events are held (Bug#12834).
4045 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
4047 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4048 Needed following 2012-10-20 change. (Bug#12902)
4050 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
4052 * w32proc.c (waitpid): Remove unused label get_result.
4054 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
4056 * makefile.w32-in (SYSWAIT_H): New macro.
4057 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4058 ($(BLD)/sysdep.$(O)): Update dependencies.
4060 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4062 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4063 * callproc.c (relocate_fd): Assume F_DUPFD.
4064 * emacs.c, term.c (O_RDWR): Remove.
4065 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4066 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4067 * nsterm.m: Assume <fcntl.h> exists.
4068 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4069 (create_pty, Fmake_network_process, server_accept_connection)
4070 (wait_reading_process_output, init_process_emacs):
4072 (wait_reading_process_output): Put in a special case for WINDOWSNT
4073 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4074 It's not clear this is needed, but it's a more-conservative change.
4075 (create_process): Assume FD_CLOEXEC.
4076 (create_process, create_pty): Assume O_NOCTTY.
4077 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4078 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4079 Omit if not DOS_NT, since F_GETFL is not defined there.
4080 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4081 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4083 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4084 lack it, since gnulib guarantees this.
4085 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4087 2012-11-17 Eli Zaretskii <eliz@gnu.org>
4089 * w32.c (faccessat): Pretend that directories have the execute bit
4090 set. Emacs expects that, e.g., in files.el:cd-absolute.
4092 * w32proc.c (create_child): Don't clip the PID of the child
4093 process to fit into an Emacs integer, as this is no longer a
4095 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4096 reaping only the process specified by PID argument, if that is
4097 positive. Use PID instead of dead_child to know which process to
4098 reap. Wait for the child to die only if WNOHANG is not in
4100 (sys_select): Don't set dead_child.
4102 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4103 as it is no longer needed.
4105 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4107 (record_child_status_change): Remove the setting of
4108 record_at_most_one_child for the !WNOHANG case.
4110 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4112 Fix problems in ns port found by static checking.
4113 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4114 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4115 not to process group.
4116 (ns_select): Use emacs_write, not write, as that's more robust
4117 in the presence of signals.
4118 (fd_handler:): Check for read errors.
4120 2012-11-16 Glenn Morris <rgm@gnu.org>
4122 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4124 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4126 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4128 2012-11-16 Eli Zaretskii <eliz@gnu.org>
4130 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4131 use the same value of thread handle.
4132 (start_timer_thread): If the timer thread exited (due to error),
4133 clean up by closing the two handles it used. Duplicate the caller
4134 thread's handle here, so it gets duplicated only once, when
4135 launching the timer thread. Set priority of the timer thread, not
4137 (getitimer): Don't duplicate the caller thread's handle here.
4140 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4142 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4145 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4147 Remove no-longer-used pty_max_bytes variable.
4148 * process.c (pty_max_bytes): Remove; unused.
4149 (send_process): Do not set it.
4151 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
4153 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4154 Update dependencies.
4156 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4158 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4159 This follows up on the 2012-09-29 patch that removed indirection
4160 for the 'function' field. Reported by Sergey Vinokurov in
4161 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4163 2012-11-14 Eli Zaretskii <eliz@gnu.org>
4165 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4166 different name, as the MS runtime does not have such a function,
4167 and probably never will.) All callers changed. Ignore DIRFD
4168 value if PATH is an absolute file name, to match Posix spec
4169 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4172 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4174 * xdisp.c (echo_area_display, redisplay_internal):
4175 Omit redundant check whether frame_garbaged is set.
4177 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4179 Use faccessat, not access, when checking file permissions (Bug#12632).
4180 This fixes a bug that has been present in Emacs since its creation.
4181 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4182 which must set some sort of record. (Torek's bug report was against
4183 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4184 same common flaw.) See Torek's Usenet posting
4185 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4186 Posted: Fri Apr 8 14:18:56 1983.
4187 * Makefile.in (LIB_EACCESS): New macro.
4189 * callproc.c (init_callproc):
4190 * charset.c (init_charset):
4191 * fileio.c (check_existing, check_executable, check_writable)
4193 * lread.c (openp, load_path_check):
4194 * process.c (allocate_pty):
4196 Use effective UID when checking permissions, not real UID.
4197 * callproc.c (init_callproc):
4198 * charset.c (init_charset):
4199 * lread.c (load_path_check, init_lread):
4200 Test whether directories are accessible, not merely whether they exist.
4201 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4202 * fileio.c (check_existing, check_executable, check_writable)
4204 Use symbolic names instead of integers for the flags, as they're
4206 (check_writable): New arg AMODE. All uses changed.
4207 Set errno on failure.
4208 (Ffile_readable_p): Use faccessat, not stat + open + close.
4209 (Ffile_writable_p): No need to call check_existing + check_writable.
4210 Just call check_writable and then look at errno. This saves a syscall.
4211 dir should never be nil; replace an unnecessary runtime check
4212 with an eassert. When checking the parent directory of a nonexistent
4213 file, check that the directory is searchable as well as writable, as
4214 we can't create files in unsearchable directories.
4215 (file_directory_p): New function, which uses 'stat' on most platforms
4216 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4217 (Ffile_directory_p, Fset_file_times): Use it.
4218 (file_accessible_directory_p): New function, which uses a single
4219 syscall for efficiency.
4220 (Ffile_accessible_directory_p): Use it.
4221 * xrdb.c (file_p): Use file_directory_p.
4222 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4223 * lread.c (openp): When opening a file, use fstat rather than
4224 stat, as that avoids a permissions race. When not opening a file,
4225 use file_directory_p rather than stat.
4226 (dir_warning): First arg is now a usage string, not a format.
4227 Use errno. All uses changed.
4228 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4229 that merely introduced a race.
4230 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4231 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4232 and similarly for the other O_* flags.
4233 * w32.c (sys_faccessat): Rename from sys_access and switch to
4234 faccessat's API. All uses changed.
4235 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4236 (magic_db): Rename from magic_file_p.
4237 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4238 char *, so that we don't have to test for file existence
4239 separately from opening the file for reading. This removes a race
4240 fixes a permission-checking problem, and simplifies the code.
4242 (file_p): Remove; no longer needed.
4244 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4246 Omit glyphs initialization at startup.
4247 * dispnew.c (glyphs_initialized_initially_p): Remove.
4248 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4249 (Fredraw_frame): Move actual code from here...
4250 (redraw_frame): ...to here. Add eassert. Adjust comment.
4251 (Fredraw_display): Use redraw_frame.
4252 * xdisp.c (clear_garbaged_frames): Likewise.
4254 2012-11-13 Eli Zaretskii <eliz@gnu.org>
4256 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4257 passed to pint2str and pint2hrstr to be at most the size of the
4258 frame's decode_mode_spec_buffer. This avoids crashes with very
4259 large values of FIELD_WIDTH argument to decode_mode_spec.
4262 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4264 Fix a race with verify-visited-file-modtime (Bug#12863).
4265 Since at least 1991 Emacs has ignored an mtime difference of no
4266 more than one second, but my guess is that this was to work around
4267 file system bugs that were fixed long ago. Since the race is
4268 causing problems now, let's remove that code.
4269 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4270 whose time stamp is off by no more than a second. Insist that the
4271 file time stamps match exactly.
4273 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4275 * frame.h (struct frame): Convert external_tool_bar member to
4276 1-bit unsigned bitfield.
4277 * termhooks.h (struct terminal): Remove mouse_moved member since
4278 all users are long dead. Adjust comment on mouse_position_hook.
4280 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4282 Simplify by using FOR_EACH_FRAME here and there.
4283 * frame.c (next_frame, prev_frame, other_visible_frames)
4284 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4285 * w32term.c (x_window_to_scroll_bar): Likewise.
4286 * window.c (window_list): Likewise.
4287 * xdisp.c (x_consider_frame_title): Likewise.
4288 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4289 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4290 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4291 * xmenu.c (menubar_id_to_frame): Likewise.
4292 * xselect.c (frame_for_x_selection): Likewise.
4293 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4294 (x_window_to_menu_bar): Likewise.
4295 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4297 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4299 * data.c (Qdefalias_fset_function): Now static.
4301 Another tweak to vectorlike_header change.
4302 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4303 Remove, and replace all uses with ...
4304 (next_in_free_list, set_next_in_free_list):
4305 New functions, which respect C's aliasing rules better.
4307 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4309 * window.c (list4i): Rename from 'quad'. All uses changed.
4310 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4312 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4314 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4315 warning about mixing declarations and code in ISO C90.
4317 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4319 * window.c (Fsplit_window_internal): Set combination limit of
4320 new parent window to t iff Vwindow_combination_limit is t;
4321 fixing a regression introduced with the change from 2012-09-22.
4322 (Fset_window_combination_limit): Fix doc-string.
4324 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4326 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4327 amount when the scroll margins are too large. When scrolling
4328 backwards in the buffer, give up if cannot reach point or the
4329 scroll margin within a reasonable number of screen lines.
4330 Fixes point position in window under scroll-up/down-aggressively when
4331 point is positioned many lines beyond the window top/bottom.
4334 * ralloc.c (relinquish): If real_morecore fails to return memory
4335 to the system, don't crash; instead, leave the last heap
4336 unchanged and return. (Bug#12774)
4338 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4340 * lisp.h (AUTOLOADP): New macro.
4341 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4342 * data.c (Ffset): Remove special ad-advice-info handling.
4343 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4345 (Finteractive_form): Simplify.
4346 (Fquo): Don't insist on having at least 2 arguments.
4347 (Qdefalias_fset_function): New var.
4349 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4351 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4353 * nsfont.m (Qcondensed, Qexpanded): New variables.
4354 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4355 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4357 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4359 Fix recently introduced crash on MS-Windows (Bug#12839).
4360 * w32term.h (struct scroll_bar): Use convenient header.
4361 (SCROLL_BAR_VEC_SIZE): Remove.
4362 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4364 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4366 Tweak last vectorlike_header change.
4367 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4368 vectorlike object on the free list. This is introduced to avoid
4369 some (but not all) pointer casting and aliasing problems, see
4370 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4371 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4373 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4375 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4377 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4378 been removed, so remove them here also.
4380 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4382 * doc.c (Fdocumentation): Handle new property
4383 dynamic-docstring-function to replace the old ad-advice-info.
4385 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4387 * fns.c (Qeql, hashtest_eq): Now static.
4389 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4391 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4392 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4393 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4394 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4396 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4398 Use same hash function for hashfn_profiler as for hash_string etc.
4399 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4400 * lisp.h (sxhash_combine): New inline function, with the contents
4401 of the old SXHASH_COMBINE.
4402 * profiler.c (hashfn_profiler): Use it, instead of having a
4403 special hash function containing a comparison that always yields 1.
4405 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4407 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4408 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4409 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4412 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4414 * image.c (xpm_make_color_table_h): Fix compiler error because
4415 make_hash_table changed.
4417 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4419 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4421 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4423 Use ad-hoc comparison function for the profiler's hash-tables.
4424 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4425 (make_log): Use them.
4426 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4427 call Fequal any more.
4428 (Ffunction_equal): New function.
4429 (cmpfn_profiler, hashfn_profiler): New functions.
4430 (syms_of_profiler): Initialize them.
4431 * lisp.h (struct hash_table_test): New struct.
4432 (struct Lisp_Hash_Table): Use it.
4433 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4434 * fns.c (make_hash_table): Take a struct to describe the test.
4435 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4436 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4437 (hash_lookup, hash_remove_from_table): Move assertion checking of
4438 hashfn result here. Check hash-equality before calling cmpfn.
4439 (Fmake_hash_table): Adjust call to make_hash_table.
4440 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4441 (syms_of_fns): Initialize them.
4442 * emacs.c (main): Move syms_of_fns earlier.
4443 * xterm.c (syms_of_xterm):
4444 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4445 * print.c (print_object): Adjust to new hash-table struct.
4446 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4448 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4450 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4451 value of w32-scroll-lock-modifier is neither nil nor one of the
4452 known key modifiers. (Bug#12806)
4454 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4456 Shrink struct vectorlike_header to the only size field.
4457 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4459 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4460 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4461 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4462 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4463 information from the vector header. Adjust comment.
4464 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4465 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4467 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4468 (struct vectorlike_header): Remove next member. Adjust comment.
4469 (struct Lisp_Subr): Add convenient header. Adjust comment.
4470 (allocate_pseudovector): Adjust prototype.
4471 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4472 (sweep_string, lisp_malloc): Remove useless prototypes.
4473 (enum mem_type): Adjust comment.
4474 (NEXT_IN_FREE_LIST): New macro.
4475 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4476 (Fmake_bool_vector): Likewise.
4477 (struct large_vector): New type to represent allocation unit for
4478 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4479 (large_vectors): Change type to struct large_vector.
4480 (allocate_vector_from_block): Simplify.
4481 (PSEUDOVECTOR_NBYTES): Replace with...
4482 (vector_nbytes): ...new function. Adjust users.
4483 (sweep_vectors): Adjust processing of large vectors.
4484 (allocate_vectorlike): Likewise.
4485 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4486 Add easserts. Adjust XSETPVECTYPESIZE usage.
4487 (allocate_buffer): Use BUFFER_PVEC_INIT.
4488 (live_vector_p): Adjust to match large vector.
4489 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4490 * buffer.h (struct buffer): Add next member.
4491 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4493 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4494 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4495 (copy_hash_table): Adjust to match vector header change.
4496 * lread.c (defsubr): Use XSETPVECTYPE.
4497 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4498 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4499 (xvecsize): New command.
4501 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4503 * keyboard.c (event_to_kboard): Do not dereference
4504 frame_or_window field of SELECTION_REQUEST_EVENT
4505 and SELECTION_CLEAR_EVENT events (Bug#12814).
4506 * xterm.h (struct selection_input_event): Adjust comment.
4508 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4510 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4511 such as Scroll Lock, if the respective keys are treated as
4512 function keys, not as modifiers. This avoids destroying non-ASCII
4513 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4515 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4517 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4519 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4521 Restore some duplicate definitions (Bug#12814).
4522 This undoes part of the 2012-11-03 changes. Some people build
4523 with plain -g rather than with -g3, and they need the duplicate
4524 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4525 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4526 Define as macros, as well as as enums or as constants.
4528 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4530 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4531 to keypad keys (Bug#12816).
4533 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4535 Minor adjustments of recently-changed frame functions.
4536 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4537 known to be a frame (we're in the FRAMEP branch).
4538 * lisp.h (Qframep): Remove decl. frame.h declares this.
4539 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4540 since they're meant for Lisp fixnum values.
4542 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4544 * window.c (Fwindow_combination_limit): Revert to the only
4545 required argument and adjust docstring as suggested in
4546 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4547 by Martin Rudalics <rudalics@gmx.at>.
4549 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4551 Widely used frame validity and checking functions.
4552 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4553 * frame.c (decode_live_frame, decode_any_frame): New functions.
4554 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4555 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4556 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4557 (Fframe_pointer_visible_p): Use decode_any_frame.
4558 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4559 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4560 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4561 (Fframe_focus): Likewise. Allow zero number of arguments.
4563 (frame_buffer_list, frame_buffer_predicate): Remove.
4564 * lisp.h (frame_buffer_predicate): Remove prototype.
4565 * buffer.c (Fother_buffer): Use decode_any_frame.
4566 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4567 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4568 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4569 (Fclose_font, Ffont_info): Use decode_live_frame.
4570 * fontset.c (check_fontset_name): Likewise.
4571 * terminal.c (Fframe_terminal): Likewise.
4572 * w32fns.c (check_x_frame): Likewise.
4573 * window.c (Fminibuffer_window, Fwindow_at)
4574 (Fcurrent_window_configuration): Likewise.
4575 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4576 Likewise. Allow zero number of arguments. Adjust docstring.
4577 * dispnew.c (Fredraw_frame): Likewise.
4578 * xfaces.c (frame_or_selected_frame): Remove.
4579 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4580 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4581 (Fframe_face_alist): Use decode_live_frame.
4582 * xfns.c (check_x_frame): Likewise.
4584 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4586 * window.c (quad): New function.
4587 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4588 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4589 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4590 (Fwindow_line_height): Use it.
4591 (Fwindow_fringes): Use list3.
4592 (Fwindow_scroll_bars): Use list4.
4593 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4594 (Fwindow_combination_limit): Allow zero number of arguments.
4596 2012-11-05 Eli Zaretskii <eliz@gnu.org>
4598 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4600 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
4601 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
4602 file descriptor 2 for standard error. (Bug#12805)
4604 2012-11-05 Chong Yidong <cyd@gnu.org>
4606 * process.c (wait_reading_process_output): Revert previous change.
4608 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4610 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4611 This removes code that has been obsolete since around 1990.
4612 * callproc.c (Fcall_process):
4614 * process.c (create_process):
4615 * term.c (dissociate_if_controlling_tty):
4616 Assume setsid exists.
4617 * callproc.c (child_setup): Assume setpgid exists and behaves as
4618 per POSIX.1-1988 or later.
4619 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4620 * emacs.c (shut_down_emacs):
4621 * sysdep.c (sys_suspend, init_foreground_group):
4622 Assume getpgrp behaves as per POSIX.1-1998 or later.
4623 * msdos.c (setpgrp): Remove.
4624 (tcgetpgrp, setpgid, setsid): New functions.
4625 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4626 * term.c (no_controlling_tty): Remove; unused.
4627 * w32proc.c (setpgrp): Remove.
4628 (setsid, tcgetpgrp): New functions.
4630 Simplify by assuming __fpending.
4631 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4632 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4633 Do not assume that __fpending's result fits in int.
4635 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4637 Remove EMACS_OUTQSIZE+sleep hack.
4638 * dispnew.c (update_frame_1): Remove hack for terminals slower
4639 than 2400 bps, which throttled Emacs by having it sleep.
4640 This code hasn't worked since at least 2007, when the multi-tty stuff
4641 was added, and anyway those old terminals are long dead.
4642 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4643 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4645 Fix data-loss with --version (Bug#9574).
4646 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4647 as we can't assume that emacs_strerror is initialized, and strerror
4648 is good enough here.
4649 (main): Invoke atexit earlier, to catch earlier instances of
4650 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4652 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4654 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4655 (keyDown): Remap keypad keys to X11 virtual key codes.
4657 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4659 Fix data-loss with --batch (Bug#9574).
4660 * emacs.c: Include <close-stream.h>.
4661 (close_output_streams): New function.
4662 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4663 and handles errors appropriately.
4664 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4667 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4668 The symptom is a diagnostic "GLib-WARNING **: In call to
4669 g_spawn_sync(), exit status of a child process was requested but
4670 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4671 waitpid(), so exit status can't be returned." The diagnostic
4672 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4673 The real bug is a race condition between Emacs and glib: Emacs
4674 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4675 so that glib can't find it. Work around the bug by invoking
4676 waitpid only on subprocesses that Emacs itself creates.
4677 * process.c (create_process, record_child_status_change):
4678 Don't use special value -1 in pid field, as the caller now must
4679 know the pid rather than having the callee infer it.
4680 The inference was sometimes incorrect anyway, due to another race.
4681 (create_process): Set new 'alive' member if child is created.
4682 (process_status_retrieved): New function.
4683 (record_child_status_change): Use it.
4684 Accept negative 1st argument, which means to wait for the
4685 processes that Emacs already knows about. Move special-case code
4686 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4687 processes that have already been waited for, by testing and
4688 clearing new 'alive' member.
4689 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4690 now does this internally.
4691 (handle_child_signal): Let record_child_status_change do all
4692 the work, since we do not want to reap all exited child processes,
4693 only the child processes that Emacs itself created.
4694 * process.h (Lisp_Process): New boolean member 'alive'.
4696 Omit duplicate definitions no longer needed with gcc -g3.
4697 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4698 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4699 Define only as macros. There's no longer any need to also define
4700 these symbols as enums or as constants, since we now assume
4701 gcc -g3 when debugging.
4703 2012-11-03 Eli Zaretskii <eliz@gnu.org>
4705 * lisp.mk: Adjust comments to the fact that term/internal is now
4706 loaded from loadup.el.
4708 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4709 (msdos_fatal_signal): New function.
4710 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4713 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4714 for GCC versions before 4.
4715 (emacs_raise): Define to call msdos_fatal_signal.
4717 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4718 iterator when starting in the middle of a display or overlay
4721 2012-11-03 Chong Yidong <cyd@gnu.org>
4723 * process.c (wait_reading_process_output): Clean up the last
4726 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4728 * process.c (wait_reading_process_output): Avoid a race condition
4729 with SIGIO delivery (Bug#11536).
4731 2012-11-03 Chong Yidong <cyd@gnu.org>
4733 * buffer.c (cursor_type): Untabify docstring.
4735 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4737 * frame.h (struct frame): Drop can_have_scroll_bars member
4738 which is meaningless for a long time. Adjust comments.
4739 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4740 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4742 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4744 * window.c (decode_next_window_args): Update window arg after
4745 calling decode_live_window and so fix crash reported at
4746 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4747 by Juanma Barranquero <lekktu@gmail.com>.
4748 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4749 * font.c (Ffont_at): Likewise.
4751 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4753 * widget.c (resize_cb): New function.
4754 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4755 (EmacsFrameResize): Check if all is up to date before changing frame
4758 2012-11-02 Eli Zaretskii <eliz@gnu.org>
4760 Implement backtrace output for fatal errors on MS-Windows.
4761 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4762 (BACKTRACE_LIMIT_MAX): New macro.
4763 (w32_backtrace): New function.
4764 (emacs_abort): Use w32_backtrace when the user chooses not to
4765 attach a debugger. Update the text of the abort dialog.
4767 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4769 Window-related stuff cleanup here and there.
4770 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4771 Use decode_any_window.
4772 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4773 * xdisp.c (Fformat_mode_line): Likewise.
4774 * font.c (Ffont_at): Use decode_live_window.
4775 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4776 * window.c (decode_next_window_args): Likewise.
4777 (decode_any_window): Remove static.
4778 * window.h (decode_any_window): Add prototype.
4779 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4780 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4783 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4785 Remove pad from struct input_event.
4786 * termhooks.h (struct input_event): Remove padding field.
4788 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4789 member is never cons for a long time. Adjust comment.
4790 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4791 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4792 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4793 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4795 2012-11-01 Eli Zaretskii <eliz@gnu.org>
4797 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4799 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4801 Fix crash when using Emacs as commit editor for git (Bug#12697).
4802 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4803 and it is configured in conf_post.h.
4804 (Fcall_process): Don't invoke both setsid and setpgid; the former
4805 is enough, if it exists.
4806 * callproc.c (Fcall_process, child_setup):
4807 * process.c (create_process): Use setpgid.
4808 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4810 * dispnew.c (init_display): Initialize the foreground group
4811 if we are running a tty display.
4812 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4813 * lisp.h (init_foreground_group): New decl.
4814 * sysdep.c (inherited_pgroup): New static var.
4815 (init_foreground_group, tcsetpgrp_without_stopping)
4816 (narrow_foreground_group, widen_foreground_group): New functions.
4817 (init_sys_modes): Narrow foreground group.
4818 (reset_sys_modes): Widen foreground group.
4820 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
4822 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4824 2012-10-31 Martin Rudalics <rudalics@gmx.at>
4826 * minibuf.c (read_minibuf): Restore current buffer since
4827 choose_minibuf_frame calling Fset_frame_selected_window may
4828 change it (Bug#12766).
4830 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4832 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4834 2012-10-30 Kenichi Handa <handa@gnu.org>
4836 * font.c (Ffont_at): If WINDOW is specified and it is not
4837 displaying the current buffer, signal an error.
4839 2012-10-29 Daniel Colascione <dancol@dancol.org>
4841 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4842 In preparation for fixing bug#12739, move these functions from
4845 * coding.h, coding.c: ... to here, and compile them only when
4846 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4847 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
4849 2012-10-28 Eli Zaretskii <eliz@gnu.org>
4851 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4852 (timer_loop, getitimer, setitimer): Use it instead of
4853 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4855 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4858 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4860 * nsterm.m (NO_APPDEFINED_DATA): New define.
4861 (last_appdefined_event_data): New variable
4862 (last_appdefined_event): Remove.
4863 (ns_select): Initialize t from last_appdefined_event_data instead
4864 of [last_appdefined_event data1].
4865 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4866 remove last_appdefined_event (Bug#12698).
4868 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4870 * frame.c (x_set_font): Catch internal error.
4872 2012-10-27 Eli Zaretskii <eliz@gnu.org>
4874 Avoid overflow in w32 implementation of interval timers.
4875 When possible, for ITIMER_PROF count only times the main thread
4877 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
4878 'volatile ULONGLONG' types. All the other data which was
4879 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
4880 (GetThreadTimes_Proc): New typedef.
4881 (w32_get_timer_time): New function, returns a suitable time value
4883 (timer_loop): Enter critical section when accessing ULONGLONG
4884 values of the itimer_data struct, as these accesses are no longer
4885 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4886 Remove unused variable.
4887 (init_timers): Initialize s_pfn_Get_Thread_Times.
4888 (start_timer_thread): Don't assign itimer->caller_thread here.
4889 (getitimer): Assign itimer->caller_thread here.
4890 (setitimer): Always call getitimer to get the value of ticks_now.
4891 (sys_spawnve): Avoid compiler warning about format mismatch.
4893 2012-10-26 Eli Zaretskii <eliz@gnu.org>
4895 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4896 mouse movement events if the menu bar is active. This avoids
4897 producing a busy "hour-glass" cursor by Windows if the mouse
4898 pointer is positioned over a tooltip shown for some menu item.
4900 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4902 Don't assume process IDs fit in int.
4903 * emacs.c (shut_down_emacs) [!DOS_NT]:
4904 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4905 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4906 Use pid_t, not int, to store process IDs, as 'int'
4907 is not wide enough on a few platforms (e.g., AIX and IRIX).
4909 2012-10-23 Kenichi Handa <handa@gnu.org>
4911 The following change is to make face-font-rescale-alist work
4912 correctly for non-ASCII fonts.
4914 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4915 (font_open_for_lface): Handle Vface_font_rescale_alist.
4917 2012-10-23 Chong Yidong <cyd@gnu.org>
4919 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4921 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4923 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4925 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4927 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4930 2012-10-21 Glenn Morris <rgm@gnu.org>
4932 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4934 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4936 Port to OpenBSD 5.1.
4937 * frame.c (Fmouse_position, Fmouse_pixel_position):
4938 * xdisp.c (produce_stretch_glyph):
4939 Declare local vars only when they're needed.
4940 This is clearer and avoids a warning on OpenBSD about unused vars.
4941 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4942 This is safer, and avoids OpenBSD warnings about unused vars.
4943 * keyboard.c (record_menu_key): Remove unnecessary decl.
4944 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4945 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4946 as our definition clashes with OpenBSD's.
4947 * xfaces.c (load_face_colors, check_lface_attrs)
4948 (get_lface_attributes_no_remap, get_lface_attributes)
4949 (lface_fully_specified_p, x_supports_face_attributes_p)
4950 (tty_supports_face_attributes_p, face_fontset, realize_face)
4951 (realize_x_face, realize_tty_face):
4952 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4953 merely Lisp_Object *. This is more informative and avoids
4954 a warning on OpenBSD about accessing beyond an object's size.
4956 2012-10-20 Chong Yidong <cyd@gnu.org>
4958 * lread.c (Fload): Doc fix (Bug#12592).
4960 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4962 * font.c (Ffont_at): Fix previous change.
4964 2012-10-19 Eli Zaretskii <eliz@gnu.org>
4966 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4967 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
4970 * alloc.c (NSTATICS): Decrease to 0x800.
4972 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4974 * fns.c (Fnreverse): Include the problem element when signaling an
4977 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4979 * nsterm.m (ns_select): Check writefds before call to
4980 FD_ISSET (Bug#12668).
4982 2012-10-18 Daniel Colascione <dancol@dancol.org>
4984 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4985 (staticpro): If we run out of staticpro slots, die with an
4986 informative error instead of just calling emacs_abort.
4988 2012-10-18 Martin Rudalics <rudalics@gmx.at>
4990 Fix two flaws reported by Dmitry Antipov.
4991 * window.c (Ftemp_output_buffer_show): Remove.
4992 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4993 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4995 2012-10-17 Eli Zaretskii <eliz@gnu.org>
4997 * makefile.w32-in ($(BLD)/w32.$(O)):
4998 ($(BLD)/vm-limit.$(O)):
5000 ($(BLD)/unexw32.$(O)):
5001 ($(BLD)/fileio.$(O)):
5002 ($(BLD)/dispnew.$(O)): Update dependencies.
5004 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5007 * w32proc.c: Include ctype.h.
5009 * w32.h (init_environment, check_windows_init_file)
5010 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5011 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5012 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5013 (sys_link): Add prototypes.
5015 * w32.c: Include w32select.h.
5016 (sys_access, e_malloc, sys_select): Add prototypes.
5017 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5019 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5021 * unexw32.c: Include lisp.h and w32.h.
5023 * term.c [WINDOWSNT]: Include w32term.h.
5025 * process.c [WINDOWSNT]: Add prototype of sys_select.
5027 * fileio.c [WINDOWSNT]: Include w32.h.
5029 * dispnew.c [WINDOWSNT]: Include w32.h.
5031 * cygw32.c (Fcygwin_convert_path_to_windows)
5032 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5033 Lisp_Object values. (Bug#12661)
5035 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5036 to Lisp_Object. (Bug#12661)
5038 2012-10-17 Kenichi Handa <handa@gnu.org>
5040 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5043 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5045 * buffer.c (Fkill_buffer): When unchaining the marker,
5046 reset its buffer pointer to NULL (Bug#12652).
5048 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5050 Do not verify indirection counters of killed buffers (Bug#12579).
5051 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5052 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5054 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5056 * alloc.c (Fmake_byte_code): Fix typo in comment.
5057 * print.c (print_interval): Define as static to match prototype.
5058 * indent.c (disptab_matches_widthtab, recompute_width_table):
5061 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5063 * editfns.c (get_system_name): Remove.
5064 * lisp.h (get_system_name): Remove prototype.
5065 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5066 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5068 2012-10-15 Daniel Colascione <dancol@dancol.org>
5070 * dbusbind.c: Add comment explaining reason for previous change.
5072 2012-10-15 Martin Rudalics <rudalics@gmx.at>
5074 * window.c (Fwindow_end): Rewrite check whether cached position
5075 can be used (Bug#12600).
5076 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5077 Set windows_or_buffers_changed.
5079 2012-10-15 Daniel Colascione <dancol@dancol.org>
5081 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5082 enabled by undefining the symbol "interface", which the platform
5083 headers define to something incompatible.
5085 2012-10-14 Daniel Colascione <dancol@dancol.org>
5087 * image.c (init_tiff_functions, init_imagemagick_functions)
5088 (init_svg_functions): Fix cygw32 build break by using these
5089 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5091 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5093 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5095 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5097 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5099 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5101 * coding.c (detect_coding): Set coding->id before calling
5104 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5106 * fileio.c: Formatting fixes.
5108 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5110 Fix some stat-related races.
5111 * fileio.c (Fwrite_region): Avoid race condition if a file is
5112 removed or renamed by some other process immediately after Emacs
5113 writes it but before Emacs stats it. Do not assume that stat (or
5115 * image.c (slurp_file): Resolve the file name with fopen + fstat
5116 rather than stat + fopen.
5117 (pbm_read_file) [0]: Remove unused code with stat race.
5118 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5119 Remove ineffective code with stat race.
5121 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5123 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5125 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5127 * nsterm.m (hold_event_q): New static variable.
5128 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5130 (hold_event): New function.
5131 (ns_read_socket): If hold_event_q have events, store them and
5133 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5134 is zero (Bug#12384).
5136 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
5138 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5140 2012-10-12 Eli Zaretskii <eliz@gnu.org>
5142 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5144 * fileio.c (check_existing): New function.
5145 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5146 instead of calling 'stat', when what's needed is to check whether
5147 a file exists. This avoids expensive system calls on MS-Windows.
5150 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5152 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5153 determine whether a file exists and is not a directory.
5155 * lisp.h (check_existing): Add prototype.
5157 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5159 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5161 2012-10-12 Glenn Morris <rgm@gnu.org>
5163 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5165 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5167 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5169 * eval.c (Fautoload): Remember previous autoload status in load-history.
5171 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5173 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5174 * lread.c (load_each_byte, new_backquote_flag, readchar)
5175 (read_filtered_event, lisp_file_lexically_bound_p)
5176 (safe_to_load_version, Fload, complete_filename_p, openp)
5177 (build_load_history, readevalloop, read_escape, read1)
5178 (string_to_number, read_vector, read_list):
5179 * macros.c (Fstart_kbd_macro):
5180 * marker.c (CONSIDER):
5181 * menu.c (parse_single_submenu, digest_single_submenu)
5182 (find_and_return_menu_selection, Fx_popup_menu):
5183 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5185 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5187 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5188 (xmenu_show, xdialog_show):
5189 Use bool for booleans.
5190 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5191 as it's not a predicate. All uses changed. Omit unnecessary
5194 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5196 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5197 (save_excursion_restore): Do not restore mark if it was not saved.
5199 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5201 * marker.c (cached_modiff): EMACS_INT, not int.
5203 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5204 instead of having a wrong decl.
5205 * nsmenu.m (waiting_for_input): Remove wrong decl.
5207 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5209 keyboard.c, keymap.c: Use bool for booleans.
5210 * dispnew.c (sit_for): Distinguish between 3-way display_option
5211 and boolean do_display.
5212 * keyboard.c (single_kboard, this_command_key_count_reset)
5213 (waiting_for_input, echoing, immediate_quit, input_pending)
5214 (interrupt_input, interrupts_deferred, pop_kboard)
5215 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5216 (command_loop_1, adjust_point_for_property)
5217 (safe_run_hooks_error, input_polling_used, read_char):
5218 (help_char_p, readable_events, kbd_buffer_events_waiting)
5219 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5220 (lucid_event_type_list_p, get_input_pending):
5221 (gobble_input, menu_separator_name_p, menu_bar_item)
5222 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5223 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5224 (keyremap_step, test_undefined, read_key_sequence)
5225 (detect_input_pending, detect_input_pending_ignore_squeezables)
5226 (detect_input_pending_run_timers, requeued_events_pending_p)
5227 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5228 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5229 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5230 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5231 (accessible_keymaps_1, Fkey_description, push_key_description):
5232 (shadow_lookup, struct where_is_internal_data)
5233 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5234 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5235 (describe_map, describe_vector):
5236 * menu.c (single_menu_item):
5237 * nsmenu.m (ns_update_menubar):
5238 * process.c (wait_reading_process_output):
5239 * search.c (scan_buffer, scan_newline):
5240 Use bool for boolean.
5241 * keyboard.c (timers_run, swallow_events)
5242 (detect_input_pending_run_timers):
5243 * process.c (wait_reading_process_output):
5244 Use unsigned for counter where wraparound-on-overflow is desired,
5245 since unsigned is guaranteed to have that behavior and signed is not.
5246 (read_char): Use ptrdiff_t for string length.
5247 (get_input_pending): Remove first argument, since it was always
5248 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5249 and behave as if it had that value. Return new value of
5250 input_pending. All callers changed.
5251 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5252 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5254 * keymap.c (push_key_description): Omit last arg, which was always 1.
5255 All callers changed.
5257 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5259 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
5261 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5262 ($(BLD)/term.$(O)): Update dependencies.
5264 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5266 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5267 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5268 initializer for PVEC_NORMAL_VECTOR.
5270 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5272 Clean out old termopts cruft.
5273 * termopts.h (flow_control, meta_key): Remove unused decls.
5274 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5275 Don't include termopts.h.
5277 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5279 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5281 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5283 * commands.h (immediate_quit): Remove duplicate decl.
5285 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5287 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5289 (nsfont_open): Remove setting of Vfonts_in_cache.
5290 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5292 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5294 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5295 match what GetLastError returns. Explain why the function is
5298 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5299 'is_tooltip_frame', to avoid confusion with its global namesake.
5301 2012-10-08 Daniel Colascione <dancol@dancol.org>
5303 * xdisp.c (start_hourglass): Call w32_note_current_window when
5304 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5305 build that caused Emacs to display the hourglass cursor forever.
5307 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5308 which is broken under remote desktop, calculate the number of
5309 colors available for a display based on the display's number of
5310 planes and number of bits per pixel per plane. (bug#10397).
5312 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5314 * nsfont.m (Vfonts_in_cache): New variable.
5315 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5316 are used. Add cached fonts to Vfonts_in_cache.
5317 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5319 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5321 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5323 (FONT_H): Define after FRAME_H.
5324 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5325 Update dependencies.
5327 * w32term.c: Remove leftover declaration of keyboard_codepage.
5329 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5331 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5332 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5333 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5334 (GLOBAL_SOURCES): Add cygw32.c.
5335 ($(BLD)/unexw32.$(O)):
5337 ($(BLD)/w32console.$(O)):
5338 ($(BLD)/w32fns.$(O)):
5339 ($(BLD)/w32heap.$(O)):
5340 ($(BLD)/w32menu.$(O)):
5341 ($(BLD)/w32proc.$(O)): Add w32common.h.
5343 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5345 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5347 2012-10-08 Daniel Colascione <dancol@dancol.org>
5349 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5350 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5351 accidental message numbering hole. Change other messages to
5354 * w32select.h (HAVE_W32SELECT): Remove.
5356 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5357 w32common.h instead of w32heap.h.
5359 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5360 (get_allocation_unit, get_processor_type, get_w32_major_version)
5361 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5362 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5363 (OS_NT, os_subtype, cache_system_info): Move declarations to
5366 * w32heap.c: Include w32common.h.
5367 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5368 (w32_minor_version, w32_build_number, w32_subtype):
5369 Remove duplicate definitions.
5371 * w32fns.c: Include w32common.h; include w32heap.h only in
5374 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5375 Use `report_file_error' instead of `error' in order to better
5376 inform users of what went wrong. Increase NTGUI_UNICODE file
5377 dialog box file name length to 32k, the maximum allowed by the NT
5380 * w32common.h: New file.
5381 (ROUND_UP, ROUND_DOWN, get_page_size)
5382 (get_allocation_unit, get_processor_type, get_w32_major_version)
5383 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5384 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5385 (OS_NT, os_subtype, cache_system_info): Move here.
5387 * unexw32.c, unexcw.c: Include w32common.h.
5389 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5390 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5391 to call syms_of_w32select.
5393 * cygw32.h: Remove obsolete EXFUN declarations.
5395 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5397 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5398 of w32inevt.o from SOME_MACHINE_OBJECTS.
5400 2012-10-08 Daniel Colascione <dancol@dancol.org>
5402 * image.c: Permanent fix for JPEG compilation issue --- limit
5403 jpeglib `boolean' redefinition to Cygwin builds.
5405 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5407 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5409 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5412 2012-10-08 Daniel Colascione <dancol@dancol.org>
5414 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5415 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5416 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5417 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5418 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5419 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5420 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5421 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5422 now a supported configuration.
5424 * Makefile.in: consolidate image variables into LIBIMAGE; add
5425 W32_OBJ and W32_LIBS. Compile new files.
5428 (_DebPrint) declare tracing facility for W32 debugging. We need
5429 to unify tracing later.
5431 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5432 unconditional use of W32 Unicode functions. Cygwin runs only on
5433 100% Unicode operating systems.
5435 * cygw32.c: New file. Define Cygwin-specific facilities.
5436 (Fcygwin_convert_path_to_windows)
5437 (Fcygwin_convert_path_from_windows): New user functions for
5438 accessing Cygwin path-munging routines.
5440 * cygw32.h: New file.
5441 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5442 UTF-16LE strings temporarily inside non-Lisp-visible string
5445 (w32_strerror): Just what it says on the tin.
5447 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5448 also run for Cygwin; both systems have the same problem with using
5449 GUI facilities in a forked child. Also call syms_of_cygw32,
5450 syms_of_w32select in correct places.
5452 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5453 needs fork-then-exec for daemon launching.
5455 * font.h: Include frame.h.
5457 * image.c: Use the image library cache machinery only when we're
5458 compiling for native WINDOWSNT; Cygwin can use shared libraries
5459 like any other Unixlike system.
5461 * keyboard.c: Clarify a comment regarding the input loop.
5463 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5464 functions directly instead of trying to detect at runtime that our
5465 host operating system supports them. We make this change for two
5466 reasons: Cygwin lacks support for the multibyte character
5467 conversion functions used by the legacy menu code, and Cygwin
5468 never needs to rely on non-Unicode APIs.
5470 * unexw32.c (hinst): Declare extern.
5472 * w32.c: Change header order;
5473 (w32_strerror): Move to w32fns.c because we need it for
5474 non-WINDOWSNT builds.
5476 * w32.h: Add #error macro to make sure we don't include w32.h for
5477 Cygwin builds. Remove w32select declarations.
5479 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5480 w32fns.c. w32console.c is WINDOWSNT-only.
5482 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5483 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5485 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5486 (w32_major_version, w32_minor_version, w32_build_number)
5487 (os_subtype, sound_type): Define here
5488 (w32_defined_color): Make color parameter const for consistency
5489 with other _defined_color functions.
5490 (w32_createwindow): Unconditionally call w32_init_class instead of
5491 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5492 through the code is complex and unnecessary because class
5493 registration is practically free.
5494 (w32_name_of_message): New EMACSDEBUG-only function.
5495 (Fset_message_beep): Move here
5496 (Fx_open_connection): Require that the display name for Windows be
5497 "w32" for consistency, emacsclient disambiguation, and maybe, one
5498 day, multi-window-system support.
5499 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5500 Cygwin files for W32 GUI facilities, since these clearly don't
5501 expect Cygwin names.
5502 (_DebPrint): Define.
5503 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5504 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5505 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5506 (w32_last_error): Remove.
5508 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5510 * w32heap.c (syspage_mask): Declare here.
5511 (cache_system_info): Remove.
5513 * w32inevt.c (faked_key): Define globally, not statically.
5514 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5515 (w32_console_toggle_lock_key): Move to w32fns.c.
5517 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5519 * w32proc.c (_DebPrint): Move to w32fns.c.
5520 * w32select.c: Include string.h, stdio.h for Cygwin.
5521 * w32select.h: New File.
5523 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5525 (w32_message_fd): New variable. Under Cygwin, holds the file
5526 descriptor the system used to tell us about pending thread
5529 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5530 that prevented compilation under non-WINDOWSNT systems.
5532 (w32_initialize): Open /dev/windows and assign it to
5533 w32_message_fd. Provide w32 feature.
5535 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5536 (WM_EMACS_INPUT_READY): add.
5537 (prepend_msg, w32_message_fd): Declare globally.
5540 (keyboard_handle): Use only when WINDOWSNT.
5541 (notify_msg_ready): New function. Posts a message to the main
5542 thread's message queue under CYGWIN, which wakes up the main
5543 thread from select(2) by making the /dev/windows file descriptor
5544 ready. Under WINDOWSNT, it sets an event the same way the old
5547 (post, prepend_msg): Actually call notify_msg_ready instead of
5548 setting the input event directly.
5550 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5552 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5553 but it still has blocs in it, don't return it to the system,
5554 instead of aborting. (Bug#12402)
5556 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5558 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
5560 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5561 MAC_OS_X_VERSION_10_6.
5562 (syms_of_nsterm): Remove comment about Panther and above for
5564 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5565 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5566 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5568 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5569 MAC_OS_X_VERSION_10_4.
5571 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5572 MAC_OS_X_VERSION_10_2.
5574 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5576 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5577 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5579 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5580 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
5581 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5582 Remove ns_in_resize check.
5583 (ns_clear_frame_area): Remove resize handle code.
5585 * nsfns.m (ns_in_resize): Remove.
5586 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5587 Remove ns_in_resize check.
5589 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5591 Improve sys_siglist detection.
5592 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5593 defined as a macro, as is done in Solaris.
5594 (sys_siglist_entries): New macro.
5595 (save_strsignal): Use it.
5596 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5597 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5599 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5601 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5602 fullscreen/Fullscreen.
5604 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5605 tobar_height is new.
5607 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5608 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5609 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5610 (windowDidResize:): Check for correct window if old style fullscreen.
5611 Capitalize word in comment. Remove incorrect comment.
5612 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5613 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5614 error in drawing background.
5615 (toggleFullScreen:): Remove comment. Rearrange calls.
5616 Set toolbar values to zero, save old height in tobar_height.
5617 Restore tool bar height when leaving fullscreen.
5618 (canBecomeMainWindow): New function.
5620 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5622 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5624 2012-10-05 Eli Zaretskii <eliz@gnu.org>
5626 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5628 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
5629 that time stamps of directories could also be changed.
5630 Don't request the too broad GENERIC_WRITE, only the more restrictive
5631 FILE_WRITE_ATTRIBUTES access rights.
5633 * fileio.c (Fset_file_times): Special-case ignoring errors for
5634 directories only on MSDOS, not on MS-Windows.
5636 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
5638 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5640 2012-10-04 Eli Zaretskii <eliz@gnu.org>
5642 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5643 see whether CreateFile failed.
5645 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5647 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5648 to avoid similar races.
5649 * keyboard.c (pending_signals): Now bool, not int.
5651 Port timers to OpenBSD, plus check for timer failures.
5652 OpenBSD problem reported by Han Boetes.
5653 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5655 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5656 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5657 like OpenBSD, which has timer_settime but does not declare it.
5658 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5659 whether to use itimerspec-related primitives. All uses of
5660 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5662 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5664 * profiler.c (handle_profiler_signal): Fix a malloc race
5665 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5667 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5669 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5671 2012-10-02 Eli Zaretskii <eliz@gnu.org>
5673 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5674 consistent with the change in return value of 'safe_strsignal'.
5676 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5678 Prefer plain 'static' to 'static inline' (Bug#12541).
5679 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5680 (bidi_set_sor_type, bidi_push_embedding_level)
5681 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5682 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5683 (bidi_cache_search, bidi_cache_ensure_space)
5684 (bidi_cache_iterator_state, bidi_cache_find)
5685 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5686 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5687 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5688 Now 'static', not 'static inline'.
5690 Count overruns when profiling; change units to ns.
5691 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5692 Give extra weight to samples after overruns, to attempt to count
5693 the time more accurately.
5694 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5695 the underlying primitives nominally do ns.
5696 (Fprofiler_cpu_start): Document the change. Mention that
5697 the sampling intervals are only approximate.
5699 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5701 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5703 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5704 case for the special 0 coding-system.
5706 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5707 (Fmake_overlay): Remove redundant tests.
5708 (fix_start_end_in_overlays): Remove redundant recentering.
5710 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
5712 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5713 Update dependencies.
5715 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5717 Fix a malloc race condition involving strsignal.
5718 A signal can arrive in the middle of a malloc, and Emacs's signal
5719 handler can invoke strsignal, which can invoke malloc, which is
5720 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5721 Fix it by altering the signal handler so that it does not invoke
5723 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5724 * process.c (status_message): Use const pointer, in case strsignal
5725 is #defined to safe_strsignal.
5726 * sysdep.c (sys_siglist, init_signals): Always define and
5727 initialize a substitute sys_siglist if the system does not define
5728 one, even if HAVE_STRSIGNAL.
5729 (safe_strsignal): Rename from strsignal. Always define,
5730 using sys_siglist. Return a const pointer.
5731 * syssignal.h (safe_strsignal): New decl.
5732 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5734 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5736 * w32proc.c (timer_loop): Fix code that waits for timer
5737 expiration, to avoid high CPU usage.
5739 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5741 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5742 (sweep_weak_table): Remove redundant prototypes.
5744 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5746 * emacs.c: Move the inclusion of TERM_HEADER after including
5747 windows.h on WINDOWSNT. This avoids compilation problems with
5750 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5752 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5753 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5754 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5755 as the previous version used 'void *'.
5757 * ralloc.c (ROUNDUP): Fix last change.
5758 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5761 * w32proc.c <disable_itimers>: New static flag.
5762 (init_timers): Initialize it to zero, after creating the critical
5763 sections used by the timer threads.
5764 (term_timers): Set to 1 before deleting the critical sections.
5765 (getitimer, setitimer): If disable_itimers is non-zero, return an
5766 error indication without doing anything. Reported by Fabrice
5767 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
5768 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5770 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5773 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5774 term_ntproc after all the other bookkeeping, to get timers working
5775 as long as possible.
5777 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5779 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5780 Suggested by Juri Linkov in
5781 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5783 Prefer plain 'static' to 'static inline' (Bug#12541).
5784 With static functions, modern compilers inline pretty well by
5785 themselves; advice from programmers often hurts as much as it helps.
5786 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5787 this change shrinks the text size of the Emacs executable by 1.1%
5788 without affecting CPU significantly in my benchmark.
5789 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5790 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5791 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5792 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5793 (bset_auto_fill_function, bset_auto_save_file_format)
5794 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5795 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5796 (bset_cache_long_line_scans, bset_case_fold_search)
5797 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5798 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5799 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5800 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5801 (bset_header_line_format, bset_indicate_buffer_boundaries)
5802 (bset_indicate_empty_lines, bset_invisibility_spec)
5803 (bset_left_fringe_width, bset_major_mode, bset_mark)
5804 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5805 (bset_name, bset_overwrite_mode, bset_pt_marker)
5806 (bset_right_fringe_width, bset_save_length)
5807 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5808 (bset_scroll_up_aggressively, bset_selective_display)
5809 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5810 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5811 (set_buffer_overlays_after):
5812 * category.c (bset_category_table):
5813 * charset.c (read_hex):
5814 * coding.c (produce_composition, produce_charset)
5815 (handle_composition_annotation, handle_charset_annotation)
5817 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5818 (assign_row, set_frame_matrix_frame, make_current)
5820 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5821 * fns.c (maybe_resize_hash_table):
5822 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5823 * gmalloc.c (register_heapinfo):
5824 * image.c (lookup_image_type):
5825 * intervals.c (set_interval_object, set_interval_left)
5826 (set_interval_right, copy_interval_parent, rotate_right)
5827 (rotate_left, balance_possible_root_interval):
5828 * keyboard.c (kset_echo_string, kset_kbd_queue)
5829 (kset_keyboard_translate_table, kset_last_prefix_arg)
5830 (kset_last_repeatable_command, kset_local_function_key_map)
5831 (kset_overriding_terminal_local_map, kset_real_last_command)
5832 (kset_system_key_syms, clear_event, set_prop):
5833 * lread.c (digit_to_number):
5834 * marker.c (attach_marker, live_buffer, set_marker_internal):
5835 * nsterm.m (ns_compute_glyph_string_overhangs):
5836 * process.c (pset_buffer, pset_command)
5837 (pset_decode_coding_system, pset_decoding_buf)
5838 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5839 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5840 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5841 * syntax.c (bset_syntax_table, dec_bytepos):
5842 * terminal.c (tset_param_alist):
5843 * textprop.c (interval_has_some_properties)
5844 (interval_has_some_properties_list):
5845 * window.c (wset_combination_limit, wset_dedicated)
5846 (wset_display_table, wset_hchild, wset_left_fringe_width)
5847 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5848 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5849 (wset_right_fringe_width, wset_right_margin_cols)
5850 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5851 (wset_vertical_scroll_bar_type, wset_window_parameters):
5852 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5853 (wset_column_number_displayed, wset_region_showing)
5854 (window_box_edges, run_window_scroll_functions)
5855 (append_glyph_string_lists, prepend_glyph_string_lists)
5856 (append_glyph_string, set_glyph_string_background_width)
5857 (append_glyph, append_composite_glyph)
5858 (take_vertical_position_into_account):
5859 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5860 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5861 (lface_hash, lface_same_font_attributes_p, lookup_face):
5862 * xml.c (libxml2_loaded_p):
5863 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5864 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5865 Now 'static', not 'static inline'.
5868 (bidi_copy_it): Do the whole copy with a single memcpy.
5869 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5871 Revert the FOLLOW-SYMLINKS change for file-attributes.
5872 Doing it right would require several changes to Tramp, and there's
5873 not enough time to get that tested before the freeze today.
5874 * dired.c (directory_files_internal, Ffile_attributes):
5877 * frame.c (x_report_frame_params): Port better to wider ints.
5878 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5879 or that pointers can be printed in 15 decimal digits.
5880 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5882 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5884 Support x64 build on MS-Windows.
5885 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5886 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5887 compatibility with x64.
5888 (x_get_focus_frame): Add prototype.
5890 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5891 defining an XRectangle structure.
5893 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5894 arithmetics for compatibility with x64.
5896 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5897 compatibility with x64.
5899 * w32heap.h: Adjust prototypes and declarations.
5901 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5902 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5903 DWORD, long, and unsigned long, for compatibility with x64.
5904 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5905 (sbrk): Argument is now of type ptrdiff_t.
5907 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5909 (w32_msg_pump): Use WPARAM type for 'result'.
5911 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5913 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5914 compatibility with x64.
5916 * vm-limit.c (lim_data): Now size_t.
5917 (check_memory_limits): Adjust prototypes of real_morecore and
5918 __morecore to receive argument of type ptrdiff_t. Use size_t for
5919 five_percent and data_size.
5921 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5922 variables, for compatibility with x64.
5923 (rva_to_section, offset_to_section, relocate_offset)
5924 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5925 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5926 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5927 for compatibility with x64.
5929 * sysdep.c (STDERR_FILENO): Define if not already defined.
5931 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5932 (__morecore): Argument type is now ptrdiff_t.
5933 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5934 (relinquish): Use ptrdiff_t type for 'excess'.
5935 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5937 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5938 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5939 instead of a literal number.
5941 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5942 (min): Define only if not already defined.
5944 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5945 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5948 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5949 'bitmaps' is a pointer.
5951 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5953 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5955 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5957 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5958 * dired.c (directory_files_internal, Ffile_attributes):
5959 New arg follow_symlinks. All uses changed.
5961 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5963 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5965 2012-09-30 Eli Zaretskii <eliz@gnu.org>
5967 Support atimers and CPU profiler via profile.c on MS-Windows.
5968 * w32proc.c (sig_mask, crit_sig): New static variables.
5969 (sys_signal): Support SIGALRM and SIGPROF.
5970 (sigemptyset, sigaddset, sigfillset, sigprocmask)
5971 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
5972 sigfillset, and sigprocmask are no longer no-ops.
5973 (sigismember): New function.
5974 (struct itimer_data): New definition.
5975 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5976 (crit_prof): New static variables.
5977 (MAX_SINGLE_SLEEP): New definition.
5978 (timer_loop, stop_timer_thread, term_timers, init_timers)
5979 (start_timer_thread, getitimer, setitimer): New functions.
5980 (alarm): No longer a no-op, calls setitimer.
5982 * w32.c (term_ntproc): Call term_timers.
5983 (init_ntproc): Make sure all signals are unblocked at startup, to
5984 erase any traces of dumping. Call init_timers.
5986 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5987 Windows-specific code to display the hourglass mouse pointer is no
5989 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5990 to hourglass timer expiration.
5991 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5992 Remove, no longer used.
5993 (w32_note_current_window, show_hourglass, hide_hourglass):
5994 New functions, in support of hourglass cursor display similar to other
5996 (syms_of_w32fns): Don't initialize hourglass_timer.
5998 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6000 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6002 * w32.h (init_timers, term_timers): Add prototypes.
6004 2012-09-30 Kenichi Handa <handa@gnu.org>
6006 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6007 to the buffer relocation which may be caused by ccl_driver.
6009 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6011 * xfns.c (Fx_file_dialog): Update comment.
6013 * w32fns.c (Fx_file_dialog): Update comment.
6015 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6016 Initialize panel name field if OSX >= 10.6.
6018 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6020 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6022 * nsterm.m (NEW_STYLE_FS): New define.
6023 (ns_fullscreen_hook, windowWillEnterFullScreen)
6024 (windowDidEnterFullScreen, windowWillExitFullScreen)
6025 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6026 (setFSValue): New functions.
6027 (EmacsFSWindow): New implementation.
6028 (canBecomeKeyWindow): New function for EmacsFSWindow.
6029 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6030 (dealloc): Release nonfs_window if in fullscreen.
6031 (updateFrameSize:): Call windowDidMove to update top/left.
6032 (windowWillResize:toSize:): Check if frame is still maximized.
6033 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6034 next_maximized, maximized_width, maximized_height and nonfs_window.
6035 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6037 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
6038 fullscreen. Set maximized_width/height. Act on next_maximized.
6040 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6041 (EmacsView): Add variables for fullscreen.
6042 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6043 (EmacsFSWindow): New interface for fullscreen.
6045 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
6047 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6049 2012-09-30 Chong Yidong <cyd@gnu.org>
6051 * fns.c (Frandom): Doc fix.
6053 2012-09-30 Martin Rudalics <rudalics@gmx.at>
6055 * window.c (Vwindow_combination_limit): New default value.
6056 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6058 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6060 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6061 Suggested by Eli Zaretskii in
6062 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6064 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6066 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6067 HAVE_TIMER_SETTIME is defined.
6069 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6071 Profiler improvements: more-accurate timers, overflow checks.
6072 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6073 signal.h, setjmp.h. Include systime.h instead.
6074 (saturated_add): New function.
6075 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6076 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6077 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6079 (enum profiler_cpu_running): New enum.
6080 (profiler_cpu_running): Now of that enum type, not bool.
6081 All uses changed to store the new value.
6082 (handle_profiler_signal): Rename from sigprof_handler_1,
6083 for consistency with other handlers. Do not check whether
6084 cpu_log is a hash-table if garbage collecting, since it
6085 doesn't matter in that case.
6086 (deliver_profiler_signal): Rename from sigprof_handler,
6087 for consistency with other handlers.
6088 (setup_cpu_timer): New function, with much of what used to be in
6089 Fprofiler_cpu_start. Check for out-of-range argument.
6090 Prefer timer_settime if available, and prefer
6091 thread cputime clocks, then process cputime clocks, then
6092 monotonic clocks, to the old realtime clock. Use make_timeval
6093 to round more-correctly when falling back to setitimer.
6094 (Fprofiler_cpu_start): Use it.
6095 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6096 Don't assume that passing NULL as the 2nd argument of setitimer
6097 is the same as passing a pointer to all-zero storage.
6098 Ignore SIGPROF afterwards.
6099 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6100 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6101 non-fatal signal handlers. Ignore SIGPROF on startup.
6102 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6103 in profiler.c, since sysdep.c now uses it.
6105 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6106 Suggested by Eli Zaretskii in
6107 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6109 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
6111 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6113 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6115 * lisp.h (struct backtrace): Remove indirection for `function' field.
6116 * xdisp.c (redisplay_internal):
6117 * profiler.c (record_backtrace, sigprof_handler_1):
6118 * alloc.c (Fgarbage_collect):
6119 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6120 (Fbacktrace_frame): Adjust accordingly.
6122 2012-09-28 Glenn Morris <rgm@gnu.org>
6124 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6125 (Frun_hook_with_args_until_failure): Doc fixes.
6127 2012-09-28 Eli Zaretskii <eliz@gnu.org>
6129 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6130 Qautomatic_redisplay and change the symbol name. All users changed.
6132 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6134 * profiler.c (sigprof_handler): Fix race condition.
6136 2012-09-28 Glenn Morris <rgm@gnu.org>
6138 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6140 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6142 Check more robustly for timer_settime.
6143 * Makefile.in (LIB_TIMER_TIME): New macro.
6145 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6146 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6149 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6151 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6153 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
6155 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6157 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6159 * character.h (MAYBE_UNIFY_CHAR): Remove.
6160 * charset.c, charset.h (maybe_unify_char): Now static.
6161 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6162 Since this stuff is now private to charset.c, there's no need for
6163 a public macro and no need to inline by hand.
6165 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6166 Stefan Monnier <monnier@iro.umontreal.ca>
6167 Juanma Barranquero <lekktu@gmail.com>
6169 * profiler.c: New file.
6170 * Makefile.in (base_obj): Add profiler.o.
6171 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6172 ($(BLD)/profiler.$(O)): New target.
6173 * emacs.c (main): Call syms_of_profiler.
6174 * alloc.c (Qautomatic_gc): New constant.
6175 (MALLOC_PROBE): New macro.
6176 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6177 (total_bytes_of_live_objects): New function.
6178 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6179 Call malloc_probe for the memory profiler.
6180 (syms_of_alloc): Define Qautomatic_gc.
6181 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6183 (struct backtrace): Move definition...
6184 * lisp.h (struct backtrace): ..here.
6185 (Qautomatic_gc, profiler_memory_running): Declare vars.
6186 (malloc_probe, syms_of_profiler): Declare functions.
6187 * xdisp.c (Qautomatic_redisplay): New constant.
6188 (redisplay_internal): Record itself in backtrace_list.
6189 (syms_of_xdisp): Define Qautomatic_redisplay.
6191 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6192 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6194 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6196 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6198 Prefer POSIX timers if available.
6199 They avoid a race if the timer is too close to the current time.
6200 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6201 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6202 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6204 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6206 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6207 CHAR_STRING_ADVANCE.
6208 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6209 STRING_CHAR_ADVANCE.
6211 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6213 Move Vlibrary_cache to emacs.c and reset before dumping.
6215 * lisp.h (reset_image_types): Declare.
6216 [WINDOWSNT] (Vlibrary_cache): Declare.
6218 * image.c (reset_image_types): New function.
6220 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6221 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6222 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6224 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6225 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6227 * w32.h (Vlibrary_cache): Do not declare.
6229 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6231 * w32proc.c (sys_signal): Handle all signals defined by the
6232 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6233 handlers for signals supported by Windows. Don't override
6234 term_ntproc as the handler for SIGABRT.
6235 (sigaction): Rewrite to call sys_signal instead of duplicating its
6237 (sys_kill): Improve commentary.
6239 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6240 consistency with a signature of a signal handler. All callers
6242 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6243 install term_ntproc as a signal handler for SIGABRT, as that
6244 should be done by the dumped Emacs.
6246 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6248 * w32select.c (term_w32select): Protect against repeated
6249 invocation by setting clipboard_owner to NULL after calling
6252 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6253 and term_ntproc to their modified signatures.
6255 * character.c (char_string, string_char): Remove calls to
6256 MAYBE_UNIFY_CHAR. See the discussion starting at
6257 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6260 2012-09-25 Chong Yidong <cyd@gnu.org>
6262 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6264 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6266 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6267 when encountering an unknown bytecode.
6269 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6271 image.c, indent.c: Use bool for booleans.
6272 * dispextern.h (struct image_type): Members valid_p, load, init
6273 now return bool, not int. All uses changed.
6274 * image.c: Omit unnecessary static decls.
6275 (x_create_bitmap_mask, x_build_heuristic_mask):
6276 Return void, not int, since callers don't care about the return value.
6277 (x_create_bitmap_mask, define_image_type, valid_image_p)
6278 (struct image_keyword, parse_image_spec, image_spec_value)
6279 (check_image_size, image_background)
6280 (image_background_transparent, x_clear_image_1)
6281 (postprocess_image, lookup_image, x_check_image_size)
6282 (x_create_x_image_and_pixmap, xbm_image_p)
6283 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6284 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6285 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6286 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6287 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6288 (png_image_p, init_png_functions, png_load_body, png_load)
6289 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6290 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6291 (init_gif_functions, gif_load, imagemagick_image_p)
6292 (imagemagick_load_image, imagemagick_load, svg_image_p)
6293 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6295 * nsimage.m (ns_load_image):
6296 * nsterm.m (ns_defined_color):
6297 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6298 * xfns.c (x_defined_color):
6299 * xterm.c (x_alloc_lighter_color_for_widget)
6300 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6301 (x_alloc_lighter_color):
6302 * indent.c (disptab_matches_widthtab, current_column)
6303 (scan_for_column, string_display_width, indented_beyond_p)
6304 (compute_motion, vmotion, Fvertical_motion):
6305 Use bool for booleans.
6307 2012-09-24 Chong Yidong <cyd@gnu.org>
6309 * chartab.c (Fset_char_table_default): Obsolete function removed.
6311 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6313 Move pid_t related decls out of lisp.h.
6314 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6315 (interruptible_wait_for_termination):
6316 Move these decls from lisp.h to syswait.h, since they use pid_t.
6317 Needed on FreeBSD; see Herbert J. Skuhra in
6318 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6319 * callproc.c: Include syswait.h.
6321 gnutls.c, gtkutil.c: Use bool for boolean.
6322 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6323 (emacs_gnutls_handle_error):
6324 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6325 (xg_hide_tooltip, xg_create_frame_widgets)
6326 (create_dialog, xg_uses_old_file_dialog)
6327 (xg_get_file_with_chooser, xg_get_file_with_selection)
6328 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6329 (xg_item_label_same_p, xg_update_menubar)
6330 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6331 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6332 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6333 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6334 (update_frame_tool_bar, free_frame_tool_bar):
6335 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6336 * nsmenu.m (ns_update_menubar):
6337 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6338 * xfns.c (Fx_show_tip) [USE_GTK]:
6339 Use bool for boolean.
6340 * gtkutil.c (xg_update_frame_menubar):
6341 * xmenu.c (update_frame_menubar):
6342 Return void, not int, since caller ignores return value.
6343 * gtkutil.c (xg_change_toolbar_position):
6346 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6348 * makefile.w32-in (BLOCKINPUT_H): Remove.
6349 (SYSSIGNAL_H): New macro.
6350 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6351 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6352 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6353 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6354 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6355 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6356 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6357 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6358 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6359 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6360 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6361 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6362 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6363 ($(BLD)/w32xfns.$(O)): Update dependencies.
6365 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6367 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6368 fatal_error_backtrace.
6370 * w32proc.c (sys_kill): Undo last change: don't do anything when
6371 invoked to deliver SIGABRT to our own process. This is now
6372 handled by emacs_raise.
6374 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6376 * w32term.c (w32_read_socket): Remove leftover reference to
6377 interrupt_input_pending.
6379 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6381 Do not use SA_NODEFER.
6382 Problem reported by Dani Moncayo in
6383 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6385 * sysdep.c (emacs_abort): Do not reset signal handler.
6386 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6387 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6388 wanted even on POSIXish hosts, and it doesn't work on Windows.
6390 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6392 * xterm.c (x_term_init): Call fixup_locale before and after calling
6393 gtk_init (Bug#12392).
6395 2012-09-23 Chong Yidong <cyd@gnu.org>
6397 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6398 Vdynamic_library_alist.
6400 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6401 (Fgnutls_available_p): Caller changed.
6403 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6404 (Flibxml_parse_xml_region): Likewise.
6406 * dispextern.h (struct image_type): Remove arg from init function.
6408 * image.c (Finit_image_library, lookup_image_type)
6409 (define_image_type): Remove now-unneeded second arg.
6410 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6411 (init_tiff_functions, init_gif_functions, init_svg_functions):
6412 Arglist and w32_delayed_load calling convention changed.
6413 (gs_type): Remove init_gs_functions; there is no such function.
6414 (valid_image_p, make_image): Fix caller to lookup_image_type.
6416 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6418 Simplify and avoid signal-handling races (Bug#12471).
6420 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6421 Avoid recursive loop if there's a fatal error in the function itself.
6422 * atimer.c (pending_atimers):
6423 * blockinput.h: Don't include "atimer.h"; no longer needed.
6424 (interrupt_input_pending): Remove. All uses removed.
6425 pending_signals now counts both atimers and ordinary interrupts.
6426 This is less racy than having three separate pending-signal flags.
6427 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6429 Rename from their upper-case counterparts BLOCK_INPUT,
6430 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6431 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6432 This makes it easier to access volatile variables more accurately.
6433 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6434 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6435 that's more reliable if the code is buggy and sets
6436 interrupt_input_blocked to a negative value. All uses changed.
6437 * atimer.c (deliver_alarm_signal):
6438 Remove. No need to deliver this to the parent; any thread can
6439 handle this signal now. All uses replaced by underlying handler.
6440 * atimer.c (turn_on_atimers):
6441 * dispnew.c (handle_window_change_signal):
6442 * emacs.c (handle_danger_signal):
6443 * keyboard.c (kbd_buffer_get_event):
6444 Don't reestablish signal handler; not needed with sigaction.
6445 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6447 Rework to avoid unnecessary accesses to volatile variables.
6448 (UNBLOCK_INPUT_TO): Now a function.
6449 (totally_unblock_input, unblock_input): New decls.
6450 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6451 (init_data): Remove. Necessary stuff now done in init_signal.
6452 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6453 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6454 (fatal_error_code): Remove; no longer needed.
6455 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6456 it doesn't always backtrace. All uses changed. No need to reset
6457 signal to default, since sigaction and/or die does that for us now.
6458 Use emacs_raise (FOO), not kill (getpid (), FOO).
6459 (main): Check more-accurately whether we're dumping.
6460 Move fatal-error setup to sysdep.c
6461 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6462 * gtkutil.c (xg_get_file_name, xg_get_font):
6463 Remove no-longer-needed signal-mask manipulation.
6464 * keyboard.c, process.c (POLL_FOR_INPUT):
6465 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6466 * keyboard.c (read_avail_input): Remove.
6467 All uses replaced by gobble_input.
6468 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6469 (kbd_buffer_store_event_hold, gobble_input):
6470 (record_asynch_buffer_change) [USABLE_SIGIO]:
6471 (store_user_signal_events):
6472 No need to mess with signal mask.
6473 (gobble_input): If blocking input and there are terminals, simply
6474 set pending_signals to 1 and return. All hooks changed to not
6475 worry about whether input is blocked.
6476 (process_pending_signals): Clear pending_signals before processing
6477 them, in case a signal comes in while we're processing.
6478 By convention callers now test pending_signals before calling us.
6479 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6480 New functions, to support changes to blockinput.h.
6481 (handle_input_available_signal): Now extern.
6482 (reinvoke_input_signal): Remove. All uses replaced by
6484 (quit_count): Now volatile, since a signal handler uses it.
6485 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6486 All callers changed. Block SIGINT only if not already blocked.
6487 Clear sigmask reliably, even if Fsignal returns, which it can.
6488 Omit unnecessary accesses to volatile var.
6489 (quit_throw_to_read_char): No need to restore sigmask.
6490 * keyboard.c (gobble_input, handle_user_signal):
6491 * process.c (wait_reading_process_output):
6492 Call signal-handling code rather than killing ourselves.
6493 * lisp.h: Include <float.h>, for...
6494 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6495 (pending_signals): Now volatile.
6496 (syms_of_data): Now const if IEEE floating point.
6497 (handle_input_available_signal) [USABLE_SIGIO]:
6498 (terminate_due_to_signal, record_child_status_change): New decls.
6499 * process.c (create_process): Avoid disaster if memory is exhausted
6500 while we're processing a vfork, by tightening the critical section
6502 (send_process_frame, process_sent_to, handle_pipe_signal)
6503 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6505 (send_process): No need for setjmp/longjmp any more, since the
6506 SIGPIPE stuff is now gone. Instead, report an error if errno
6508 (record_child_status_change): Now extern. PID and W are now args.
6509 Return void, not bool. All callers changed.
6510 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6511 Remove. All uses removed. This bug should be fixed now in a
6513 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6514 and record the child status change directly. This avoids the
6515 need to futz with the signal mask.
6516 (process_fatal_action): Move here from emacs.c.
6517 (emacs_sigaction_flags): New function, containing
6518 much of what used to be in emacs_sigaction_init.
6519 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6520 caught by emacs, to make races less likely.
6521 (deliver_process_signal): Rename from handle_on_main_thread.
6523 (BACKTRACE_LIMIT_MAX): Now at top level.
6524 (thread_backtrace_buffer, threadback_backtrace_pointers):
6526 (deliver_thread_signal, deliver_fatal_thread_signal):
6527 New functions, for more-accurate delivery of thread-specific signals.
6528 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6529 (deliver_arith_signal): Handle in this thread, not
6530 in the main thread, since it's triggered by this thread.
6531 (maybe_fatal_sig): New function.
6532 (init_signals): New arg DUMPING so that we can be more accurate
6533 about whether we're dumping. Caller changed.
6534 Treat thread-specific signals differently from process-general signals.
6535 Block all signals while handling fatal error; that's safer.
6536 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6538 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6539 Ignore SIGPIPE unless batch.
6540 (emacs_backtrace): Output backtrace for the appropriate thread,
6541 which is not necessarily the main thread.
6542 * syssignal.h: Include <stdbool.h>.
6543 (emacs_raise): New macro.
6544 * xterm.c (x_connection_signal): Remove; no longer needed
6545 now that we use sigaction.
6546 (x_connection_closed): No need to mess with sigmask now.
6547 (x_initialize): No need to reset SIGPIPE handler here, since
6548 init_signals does this for us now.
6550 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6552 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6553 background rect may be larger (Bug#12245).
6555 2012-09-23 Chong Yidong <cyd@gnu.org>
6557 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6559 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6561 * .gdbinit: Just stop at fatal_error_backtrace.
6562 See Stefan Monnier's request in
6563 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6564 Remove no-longer-used query of system type.
6566 2012-09-22 Chong Yidong <cyd@gnu.org>
6568 * search.c (Freplace_match): Doc fix (Bug#12325).
6570 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6572 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6573 (Fline_end_position): Doc fix.
6575 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6577 2012-09-22 Chong Yidong <cyd@gnu.org>
6579 * dispextern.h (struct image_type): Add new slot, storing a type
6580 initialization function.
6582 * image.c (define_image_type): Call the image initializer function
6583 if it is defined. Arguments and return value changed.
6584 (valid_image_p, make_image): Callers changed.
6585 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
6586 (gif_type, imagemagick_type, svg_type, gs_type):
6587 Add initialization functions.
6588 (Finit_image_library): Call lookup_image_type.
6589 (CHECK_LIB_AVAILABLE): Macro deleted.
6590 (lookup_image_type): Call define_image_type here, rather than via
6591 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6592 (syms_of_image): Move define_image_type calls for xbm_type and
6593 pbm_type to lookup_image_type.
6595 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6597 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6598 'idle_timers' from here ...
6599 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6600 lists, to avoid infloops when the timer does something stupid,
6601 like reinvoke itself with the same or smaller time-out.
6604 2012-09-22 Martin Rudalics <rudalics@gmx.at>
6606 * window.c (Fsplit_window_internal): Handle only Qt value of
6607 Vwindow_combination_limit separately.
6608 (Qtemp_buffer_resize): New symbol.
6609 (Vwindow_combination_limit): New default value.
6612 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6614 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6615 the new overlay string. (Bug#10159)
6617 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6619 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6620 or that fprintf is async-signal-safe. POSIX doesn't require
6623 2012-09-22 Chong Yidong <cyd@gnu.org>
6625 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6628 2012-09-22 Kenichi Handa <handa@gnu.org>
6630 * composite.c (composition_reseat_it): Handle the case that a
6631 grapheme cluster is not covered by a single font (Bug#12352).
6633 2012-09-21 Chong Yidong <cyd@gnu.org>
6635 * image.c (define_image_type): Avoid adding duplicate types to
6636 image_types (Bug#12463). Suggested by Jörg Walter.
6638 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6640 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6641 (print_load_command_name): Add case LC_DATA_IN_CODE.
6642 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6644 2012-09-21 Glenn Morris <rgm@gnu.org>
6646 * eval.c (Frun_hook_with_args_until_success)
6647 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6649 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
6651 * fileio.c (Ffile_selinux_context): Only call freecon when
6652 lgetfilecon succeeded.
6653 (Fset_file_selinux_context): Likewise. (Bug#12444)
6655 2012-09-21 Eli Zaretskii <eliz@gnu.org>
6657 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6658 reordering, locate the cursor by calling set_cursor_from_row; if
6659 that fails, clear the desired glyph matrix before returning a
6660 failure indication to the caller. Fixes leaving garbled display
6661 when fast scrolling with a down-key. (Bug#12403)
6662 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6663 scrolling through multibyte text.
6665 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6667 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6668 calling mark_vectorlike since that's the one that marks the window.
6669 (mark_discard_killed_buffers): Mark the final cdr.
6670 * window.h (struct window): Move prev/next_buffers to the
6671 non-standard fields.
6672 * window.c (make_window): Initialize prev/next_buffers manually.
6674 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6676 Omit unused arg EXPECTED from socket hooks.
6677 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6678 * nsterm.m (ns_term_init):
6679 * termhooks.h (struct terminal.read_socket_hook):
6680 * w32inevt.c (w32_console_read_socket):
6681 * w32term.c (w32_read_socket):
6682 * xterm.c (XTread_socket):
6683 Omit unused arg EXPECTED. All callers changed.
6684 (store_user_signal_events): Return void, not int, since callers no
6685 longer care about the return value. All uses changed.
6687 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
6689 * w32gui.h (XParseGeometry): Do not declare.
6691 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6693 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
6694 Ignore 'expected'. See Eli Zaretskii in
6695 <http://bugs.gnu.org/12471#8> (last line).
6697 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6698 (XParseGeometry): Now static. Substitute extremal values for
6699 values that are out of range.
6701 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6703 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6705 * nsfns.m (XParseGeometry): Remove.
6706 (Fx_create_frame): Call x_set_offset to correctly interpret
6707 top_pos in geometry.
6709 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
6710 (Fx_parse_geometry): If there is a space in string, call
6711 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6713 2012-09-17 Eli Zaretskii <eliz@gnu.org>
6715 * search.c (scan_buffer): Use character positions in calls to
6716 region_cache_forward and region_cache_backward, not byte
6717 positions. (Bug#12196)
6719 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6720 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6722 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6723 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6724 emacs_blocked_malloc, now deleted.
6726 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6728 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6729 The workaround was for improving performance on Solaris 2.4, but
6730 is getting in the way now. Emacs will still work if someone is
6731 still running Solaris 2.4 in a museum somewhere; Sun dropped
6732 support for Solaris 2.4 in 2003.
6733 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6734 * process.c (create_process) [HAVE_WORKING_VFORK]:
6735 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6736 since Emacs no longer uses vfork on that platform.
6738 2012-09-17 Glenn Morris <rgm@gnu.org>
6740 * emacs.c: Use COPYRIGHT.
6742 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6744 Remove configure's --without-sync-input option (Bug#12450).
6745 When auditing signal-handling in preparation for cleaning it up,
6746 I found that SYNC_INPUT has race conditions and would be a real
6747 pain to fix. Since it's an undocumented and deprecated
6748 configure-time option, now seems like a good time to remove it.
6749 Also see <http://bugs.gnu.org/11080#16>.
6750 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6751 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6752 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6753 (malloc_hysteresis):
6754 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6755 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6756 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6757 (dont_register_blocks, bytes_used_when_reconsidered)
6758 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6759 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6760 [!SYSTEM_MALLOC && !SYNC_INPUT]:
6761 Remove. All uses removed.
6762 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6763 implementation, one that depends on whether the new macro
6764 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6766 * atimer.c (run_timers, handle_alarm_signal):
6767 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6768 (handle_async_input, process_pending_signals)
6769 (handle_input_available_signal, init_keyboard):
6770 * nsterm.m (ns_read_socket):
6771 * process.c (wait_reading_process_output):
6772 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6773 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6775 * xterm.c (XTread_socket):
6777 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6778 * eval.c (handling_signal): Remove. All uses removed.
6779 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6780 All uses replaced with the SYNC_INPUT version.
6781 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6783 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6786 * font.c (Ffont_shape_gstring): Remove unused local.
6788 2012-09-16 Glenn Morris <rgm@gnu.org>
6790 * Makefile.in (clean): No longer run nextstep's clean.
6792 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6794 (ns-app): Move here from ns.mk, and simplify.
6795 (clean): Simplify nextstep entry.
6796 * ns.mk: Remove file.
6798 2012-09-17 Kenichi Handa <handa@gnu.org>
6800 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6801 not covert the last few charactes.
6803 2012-09-16 Kenichi Handa <handa@gnu.org>
6805 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6806 here, but just check the validity of glyphs in the glyph-string.
6808 2012-09-16 Martin Rudalics <rudalics@gmx.at>
6810 * window.c (Fwindow_parameter, Fset_window_parameter):
6811 Accept any window as argument (Bug#12452).
6813 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6815 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6816 to ns_term_init to avoid memory leak.
6818 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6819 explicit retain/release.
6820 (ns_term_init): Only allow one display. Initialize outerpool and
6823 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6825 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6826 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6827 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6828 the Microsoft problem in a different way, by altering ../nt/config.nt.
6830 2012-09-15 Eli Zaretskii <eliz@gnu.org>
6845 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6846 by lisp.h. This completes removal of setjmp.h inclusion
6847 erroneously announced in the previous commit. (Bug#12446)
6849 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6852 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6853 not defined as a macro. The latter happens on MS-Windows.
6856 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6858 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6859 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
6860 Some instances of '#include <setjmp.h>' removed, if the
6861 only reason for the instance was because "lisp.h" was included.
6862 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6863 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6864 and _longjmp with the new symbols. Emacs already uses _setjmp if
6865 available, so this change affects only POSIXish hosts that have
6866 sigsetjmp but not _setjmp, such as some versions of Solaris and
6867 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6868 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6869 (png_load_body) [HAVE_PNG]:
6870 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6871 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6872 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6873 since PNG requires jmp_buf. This is the only exception to the
6874 general rule that we now use sys_setjmp and sys_longjmp.
6875 This exception is OK since this code does not change the signal
6876 mask or longjmp out of a signal handler.
6878 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6880 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6881 Include "syssignal.h", for 'main_thread'.
6883 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6885 Avoid out-of-range marker position (Bug#12426).
6886 * insdel.c (replace_range, replace_range_2):
6887 Adjust markers before overlays, as suggested by comments.
6888 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6889 Remove redundant check before calling offset_intervals.
6891 2012-09-14 Martin Rudalics <rudalics@gmx.at>
6893 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6894 current buffer (Bug#12387).
6896 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
6898 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6900 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6902 Use a more backwards-compatible timer format (Bug#12430).
6903 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6904 vector element, not from the 4th, since PSECS is now at the end.
6905 (Fcurrent_idle_time): Doc fix.
6907 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6909 Function to mark objects and remove killed buffers at once.
6910 * alloc.c (discard_killed_buffers): Rename to ...
6911 (mark_discard_killed buffers) ... new name. Add marking
6912 of remaining objects. Fix comment. Adjust users.
6913 (mark_object): Do not touch frame buffer lists here.
6914 * frame.c (delete_frame): Reset frame buffer lists here.
6916 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6918 Better workaround for GNOME bug when --enable-gcc-warnings.
6919 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6920 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6921 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6923 Simplify SIGIO usage (Bug#12408).
6924 The code that dealt with SIGIO was crufty and confusing, e.g., it
6925 played tricks like "#undef SIGIO" but these tricks were not used
6926 consistently. Simplify mostly by not #undeffing standard symbols,
6927 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6928 or not as we please) rather than "defined SIGIO" (standard symbol
6929 that we probably shouldn't #undef).
6930 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6931 Modules that need it can include it.
6932 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6933 * dispextern.h (ignore_sigio): New decl.
6934 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6935 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6936 * emacs.c (shut_down_emacs):
6937 * keyboard.c (kbd_buffer_store_event_hold):
6938 Use ignore_sigio rather than invoking 'signal' directly.
6939 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6941 (FIONREAD, SIGIO): Do not #undef.
6942 (tty_read_avail_input): Use #error rather than a syntax error.
6943 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6944 for I_PIPE, used by SETUP_SLAVE_PTY.
6945 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6946 * sysdep.c (croak): Remove; no longer needed. This bit of
6947 temporary code, with Fred N. Fish's comment that it's temporary,
6948 has been in Emacs since at least 1992!
6949 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6950 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6951 * syssignal.h (croak): Remove decl.
6952 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6953 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6954 now that we're termios-only.
6955 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6956 * term.c (dissociate_if_controlling_tty): Use #error rather than
6959 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6960 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6961 to work around GNOME bug 683906.
6962 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6963 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6964 This works around GCC bug 54561.
6966 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6968 More fixes for 'volatile' and setjmp/longjmp.
6969 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6970 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6971 (png_load_body) [HAVE_PNG]:
6972 (jpeg_load_body) [HAVE_JPEG]:
6973 New function, with most of the old parent function's body.
6974 (png_load) [HAVE_PNG]:
6975 (jpeg_load) [HAVE_JPEG]:
6976 Invoke the new function, to avoid longjmp munging our locals.
6977 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6978 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6979 longjmp is passed 2, as the C standard doesn't guarantee this.
6980 Instead, store the failure code into mgr->failure_code.
6982 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6984 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6985 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6986 (syms_of_keyboard): Remove support for unread-command-char.
6988 2012-09-12 Eli Zaretskii <eliz@gnu.org>
6990 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6991 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6992 violation. (Bug#12426)
6994 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6996 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6998 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7000 * eval.c: Add `inhibit-debugger'.
7001 (Qinhibit_debugger): New symbol.
7002 (call_debugger): Bind it instead of Qdebug_on_error.
7003 (maybe_call_debugger): Test Vinhibit_debugger.
7004 (syms_of_eval): Define inhibit-debugger.
7005 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7006 (syms_of_xdisp): Remove inhibit-debug-on-message.
7008 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7010 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7011 If a nonvolatile local variable is written before a _longjmp to
7012 the frame containing the variable, and is read after the _longjmp,
7013 the value read is indeterminate. Some local variables of type
7014 'struct handler' and 'struct catchtag' are used in this way, so
7015 mark each of their slots as volatile if the slot can be set before
7016 _longjmp and read afterwards.
7017 * lisp.h (struct handler): var and chosen_clause are now volatile.
7018 (struct catchtag): val, next, and pdlcount are now volatile.
7020 * bidi.c (bidi_push_it, bidi_pop_it):
7021 * fns.c (copy_hash_table):
7022 * image.c (define_image_type):
7023 * keyboard.c (kbd_buffer_store_event_hold):
7024 * process.c (Fprocess_send_eof):
7025 * xfaces.c (x_create_gc) [HAVE_NS]:
7026 * xgselect.c (xg_select):
7027 Prefer assignment to memcpy when either will do.
7029 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7030 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7031 time an item is removed. No need to mark this function 'inline';
7032 the compiler knows better than we do.
7034 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7036 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7037 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7038 to change_frame_size (Bug#12388).
7039 (windowDidResize:): Pass YES to updateFrameSize.
7041 * nsterm.h: Add delay parameter to updateFrameSize.
7043 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7045 Discard killed buffers from deleted window and frame objects.
7046 This reduces an amount of references to killed buffers and
7047 helps GC to reclaim them faster.
7048 * alloc.c (discard_killed_buffers): New function.
7049 (mark_object): Use it for deleted windows and frames.
7050 (mark_object): If symbol's value is set up for a killed buffer
7051 or deleted frame, restore its global binding.
7052 * data.c (swap_in_global_binding): Add GC notice.
7053 (swap_in_symval_forwarding): Use convenient set_blv_where.
7054 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7055 * window.h: ... to here.
7057 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7059 Convenient macro to check whether the buffer is live.
7060 * buffer.h (BUFFER_LIVE_P): New macro.
7061 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7062 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7064 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7066 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7067 composition cases (Bug#12364).
7069 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7070 overhang of succeeding glyphs overlapping box cursor.
7072 * w32term.c (x_draw_glyph_string): Likewise.
7074 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7076 Simplify, document, and port floating-point (Bug#12381).
7077 The porting part of this patch fixes bugs on non-IEEE platforms
7078 with frexp, ldexp, logb.
7079 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7081 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7082 support, by removing commented-out code and briefly listing the
7083 C89 functions excluded. The commented-out stuff was confusing
7084 maintenance, e.g., we thought we needed cbrt but it was commented out.
7085 (logb): Remove decl; no longer needed.
7086 (isfinite): New macro, if not already supplied.
7087 (isnan): Don't replace any existing macro.
7088 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7089 are present on all C89 platforms.
7090 (Ffrexp): Do not special-case zero, as frexp does the right thing
7092 (Flogb): Do not use logb, as it doesn't have the desired meaning
7093 on hosts that use non-base-2 floating point. Instead, stick with
7094 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7095 frexp, to avoid getting an unspecified result.
7097 * xdisp.c (Qinhibit_debug_on_message): Now static.
7099 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7101 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7102 NSBezierPath (Bug#12131).
7104 2012-09-10 Chong Yidong <cyd@gnu.org>
7106 * fns.c (Fdelq, Fdelete): Doc fix.
7108 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7110 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7111 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7113 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7115 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7116 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7119 2012-09-09 Eli Zaretskii <eliz@gnu.org>
7121 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7122 left fringe if the window has a left margin. This avoids leaving
7123 traces of the cursor because its leftmost pixel is not drawn over.
7125 * dispnew.c (update_window_line): When the left margin area of a
7126 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7127 that screen line. (Bug#12277)
7129 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7131 Assume C89 or later for math functions (Bug#12381).
7132 This simplifies the code, and makes it a bit smaller and faster,
7133 and (most important) makes it easier to clean up signal handling
7134 since we can stop worring about floating-point exceptions in
7135 library code. That was a problem before C89, but the problem
7136 went away many years ago on all practical Emacs targets.
7137 * data.c, image.c, lread.c, print.c:
7138 Don't include <math.h>; no longer needed.
7139 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7140 might be autoconfigured, as that never happens.
7142 * doprnt.c (DBL_MAX_10_EXP):
7143 * print.c (DBL_DIG):
7144 Remove. C89 or later always defines these.
7145 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7146 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7147 (arith_error, domain_error, domain_error2):
7148 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7149 no longer needed -- we simply return what C returns. All uses removed.
7150 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7152 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7153 Remove. All uses expanded, as these macros are no longer used
7154 more than once and are now more trouble than they're worth.
7155 (Ftan): Use tan, not sin / cos.
7156 (Flogb): Assume C89 frexp.
7157 (fmod_float): Assume C89 fmod.
7158 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7159 (init_floatfns): Remove. All uses removed.
7161 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7163 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7164 compositeToPoint for OSX < 10.6 (Bug#12390).
7166 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7168 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7169 This produces more-accurate results.
7171 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7173 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7174 changes (Bug#12088).
7176 2012-09-08 Chong Yidong <cyd@gnu.org>
7178 * syntax.c (Fstring_to_syntax): Doc fix.
7180 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7182 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7183 in the internal border.
7184 (x_set_window_size): Remove static variables and their usage.
7185 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7186 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7187 Remove fringe/internal border adjustment (Bug#11052).
7188 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7189 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7190 (ns_fix_rect_ibw): Remove.
7191 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7192 (ns_dumpglyphs_box_or_relief): Ditto.
7193 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7195 (ns_dumpglyphs_image): Ditto.
7196 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7198 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7199 their usage. Add fringe_extended_p and its use as in other terms.
7200 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7201 scroll bar was removed.
7202 (updateFrameSize): New function.
7203 (windowDidResize): Move code to updateFrameSize and call it.
7205 * nsterm.h (EmacsView): Add updateFrameSize.
7207 2012-09-07 Chong Yidong <cyd@gnu.org>
7209 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7211 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7213 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7215 More signal-handler cleanup (Bug#12327).
7216 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7217 Problem introduced when merging patches. Noted by Eli Zaretskii in
7218 <http://bugs.gnu.org/12327#67>.
7219 * floatfns.c: Comment fix.
7220 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7221 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7222 and anyway the declaration is harmless even if SIGDANGER is not defined.
7223 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7224 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7225 source files not surprisingly expected syssignal.h to define, or
7226 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7227 Include <sys/ioctl.h>, for FIONREAD.
7228 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7229 This eliminates a problem whereby other files mysteriously had
7230 to include "syssignal.h" before including "systty.h" if they
7231 wanted to use "#ifdef SIGIO".
7233 2012-09-07 Eli Zaretskii <eliz@gnu.org>
7235 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7237 * w32.c (sigemptyset): Empty the set.
7238 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7240 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7242 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7244 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7245 (mark_object): Likewise for frame objects.
7247 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7249 * syssignal.h (handle_on_main_thread): Always declare,
7250 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7251 This ports to platforms without HAVE_PTHREAD.
7253 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7255 Signal-handler cleanup (Bug#12327).
7256 Emacs's signal handlers were written in the old 4.2BSD style with
7257 sigblock and sigmask and so forth, and this led to some
7258 inefficiencies and confusion. Rewrite these to use
7259 pthread_sigmask etc. without copying signal sets around. Also,
7260 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7261 'signal', and instead use functions that do not attempt to take
7262 over the system name space. This patch causes Emacs's text
7263 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7264 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7265 Do not include <signal.h> or "syssignal.h", as these
7266 modules do not use signals.
7267 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7268 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7269 Do not include <signal.h>, as "syssignal.h" does that for us now.
7270 * atimer.c (sigmask_atimers): New function.
7271 (block_atimers, unblock_atimers): New functions,
7272 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7274 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7275 no longer needed here.
7276 * emacs.c (main): Inspect existing signal handler with sigaction,
7277 so that there's no need to block and unblock SIGHUP.
7278 * sysdep.c (struct save_signal): New member 'action', replacing
7279 old member 'handler'.
7280 (save_signal_handlers, restore_signal_handlers):
7281 Use sigaction instead of 'signal' to save and restore.
7282 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7283 New function. All users of 'signal' modified to use set_sighandler
7284 if they're writeonly, and to use sys_signal if they're read+write.
7285 (emacs_sigaction_init, forwarded_signal): New functions.
7286 (sys_signal): Remove. All uses replaced by calls to sigaction
7287 and emacs_sigaction_init, or by direct calls to 'signal'.
7288 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7289 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7290 all uses replaced by pthread_sigmask etc. calls.
7291 * syssignal.h: Include <signal.h>.
7292 (emacs_sigaction_init, forwarded_signal): New decls.
7293 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7294 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7295 (sigmask, sys_sigmask): Remove; no longer needed.
7296 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7297 (sigblock, sigunblock, sigfree):
7298 (sigsetmask) [!defined sigsetmask]:
7299 Remove. All uses replaced by pthread_sigmask.
7300 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7301 no longer need to be replaced, and its typical old uses
7302 are now done via emacs_sigaction_init and sigaction.
7303 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7304 (sys_sigdel): Remove; unused.
7305 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7307 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7309 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7310 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7312 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7314 Explicitly mark buffer_defaults and buffer_local_symbols.
7315 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7316 mark_local_symbols here.
7317 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7318 since special buffers aren't marked here any more.
7319 (allocate_buffer): Chain new buffer with all_buffers here...
7320 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7322 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7323 (syms_of_buffer): Remove staticpro of the above.
7324 (init_buffer_once): Set names for buffer_defaults and
7325 buffer_local_symbols.
7327 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7329 Use bool for booleans in font-related modules.
7330 * font.c (font_intern_prop, font_style_to_value)
7331 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7332 (generate_otf_features, font_check_otf_features, font_check_otf)
7333 (font_match_p, font_list_entities, font_at):
7334 * fontset.c (fontset_id_valid_p, reorder_font_vector
7335 (fontset_find_font, Fset_fontset_font)
7336 (face_suitable_for_char_p) [0]:
7337 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7338 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7339 (m17n_flt_initialized, ftfont_shape_by_flt):
7340 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7341 * nsfont.m (nsfont_draw):
7342 * w32font.c (w32font_draw):
7343 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7344 Use bool for booleans.
7345 * font.h: Adjust to above API changes.
7346 (struct font, struct font_driver, struct font_driver_list):
7347 Use bool for booleans.
7348 (struct font): Remove useless member encoding_type.
7350 * fontset.c, xftfont.c: Omit unnecessary static decls.
7352 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7354 * alloc.c (mark_object): Revert window marking code
7355 since it's unsafe for the Fset_window_configuration.
7357 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7359 Fix race conditions with signal handlers and errno (Bug#12327).
7360 Be more systematic about preserving errno whenever a signal
7361 handler returns, even if it's not in the main thread. Do this by
7362 renaming signal handlers to distinguish between signal delivery
7363 and signal handling. All uses changed.
7364 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7365 * data.c (deliver_arith_signal): Rename from arith_error.
7366 * dispnew.c (deliver_window_change_signal): Rename from
7367 window_change_signal.
7368 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7369 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7370 * keyboard.c (deliver_input_available_signal): Rename from
7371 input_available_signal.
7372 (deliver_user_signal): Rename from handle_user_signal.
7373 (deliver_interrupt_signal): Rename from interrupt_signal.
7374 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7375 (deliver_child_signal): Rename from sigchld_handler.
7376 * atimer.c (handle_alarm_signal):
7377 * data.c (handle_arith_signal):
7378 * dispnew.c (handle_window_change_signal):
7379 * emacs.c (handle_fatal_signal, handle_danger_signal):
7380 * keyboard.c (handle_input_available_signal):
7381 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7382 * process.c (handle_pipe_signal, handle_child_signal):
7383 New functions, with the actual signal-handling code taken from the
7384 original respective signal handlers, sans the sporadic attempts to
7385 preserve errno, since that's now done by handle_on_main_thread.
7386 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7387 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7388 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7390 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7391 Move initialization of main_thread to sysdep.c's init_signals.
7392 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7393 our usage, and simplifies the mainline code.
7394 (record_child_status_change): New static function, as a helper
7395 for handle_child_signal, and with most of the old child handler's
7397 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7398 (handle_child_signal): Use the above.
7399 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7400 Moved here from emacs.c.
7401 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7402 code moved here from emacs.c's main function.
7403 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7404 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7405 This lets callers save and restore errno properly.
7407 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7409 Remove redundant or unused things here and there.
7410 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7411 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7412 * editfns.c (Fcompare_buffer_substrings): Likewise.
7413 * frame.h (struct terminal, struct font_driver_list):
7414 Remove redundant declarations.
7415 * window.h (Qleft, Qright): Likewise.
7417 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7419 Do not mark objects from deleted buffers, windows and frames.
7420 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7421 (mark_object): Likewise for windows and frames.
7423 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7425 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7426 buffer_defaults and buffer_local_symbols as valid objects.
7427 Return special value to denote them.
7429 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7431 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7432 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7433 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7434 (file_name_absolute_p, Fsubstitute_in_file_name):
7435 (check_executable, check_writable, Ffile_accessible_directory_p)
7436 (Fset_file_selinux_context, Fdefault_file_modes)
7437 (Finsert_file_contents, choose_write_coding_system)
7438 (Fwrite_region, build_annotations, a_write, e_write)
7440 * filelock.c (boot_time_initialized, get_boot_time)
7441 (get_boot_time_1, lock_file_1, within_one_second):
7442 * floatfns.c (in_float):
7443 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7444 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7445 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7446 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7447 * window.c (compare_window_configurations):
7448 Use bool for booleans.
7449 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7450 (Fdefault_file_modes): Now mode_t, not int, for modes.
7451 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7452 (internal_delete_file): Now returns void, not a (boolean) int,
7453 since nobody was looking at the return value.
7454 * lisp.h, window.h: Adjust to above API changes.
7456 * xdisp.c (set_message): Simplify and reindent last change.
7458 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7460 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7462 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7464 * eval.c (call_debugger): Make the function non-static so that we
7465 can call it from set_message.
7467 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7468 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7470 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7472 Give more-useful info on a fatal error (Bug#12328).
7473 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7474 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7475 of doing the work ourselves.
7476 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7477 do most of the work.
7478 (fatal_error_backtrace): New function, taken from the guts
7479 of the old fatal_error_signal, but with a new option to output
7481 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7482 info about the signal than just its number.
7483 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7484 * sysdep.c: Include <execinfo.h>
7485 (emacs_backtrace): New function, taken partly from the previous
7486 code of the 'die' function.
7487 (emacs_abort): Call fatal_error_backtrace rather than abort.
7489 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7491 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7492 eager (load-time) macro-expansion.
7493 * lisp.mk (lisp): Add macroexp.
7495 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7497 Simplify redefinition of 'abort' (Bug#12316).
7498 Do not try to redefine the 'abort' function. Instead, redo
7499 the code so that it calls 'emacs_abort' rather than 'abort'.
7500 This removes the need for the NO_ABORT configure-time macro
7501 and makes it easier to change the abort code to do a backtrace.
7502 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7503 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7504 Remove; sysdep.c's emacs_abort now takes its place.
7505 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7506 'abort' changed to use 'emacs_abort'.
7507 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7508 (abort) [!defined abort]: Rename to ...
7509 (emacs_abort): ... new name.
7510 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7511 the place of the old 'abort' in emacs.c.
7512 * w32.c, w32fns.c (abort): Do not #undef.
7513 * w32.c (emacs_abort): Rename from w32_abort.
7515 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7517 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7518 offsets[j].dv, since the y axis of the screen coordinates points
7519 down, while the y axis of the font definition coordinates points
7520 up. This fixes display of Arabic diacritics such as KASRA and
7521 KASRATAN. (Bug#11860)
7523 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7525 Be more systematic about _setjmp vs setjmp.
7526 * alloc.c (test_setjmp, mark_stack):
7527 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7528 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7529 (png_load, my_error_exit, jpeg_load):
7530 * process.c (send_process_trap, send_process):
7531 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7532 The underscored versions are up to 30x faster on some hosts.
7533 Formerly, the code used setjmp+longjmp sometimes and
7534 _setjmp+_longjmp at other times, with no particular reason to
7535 prefer setjmp+longjmp.
7537 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7539 Fix minor problem found by static checking.
7540 * buffer.c (Fdelete_all_overlays): Return nil.
7542 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7544 * buffer.c (Fdelete_all_overlays): New function.
7546 2012-09-03 Chong Yidong <cyd@gnu.org>
7548 * gtkutil.c: Add extern decl for Qxft.
7550 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7552 * emacs.c, eval.c: Use bool for boolean.
7553 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7554 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7555 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7556 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7557 (main, decode_env_path, Fdaemon_initialized):
7558 * eval.c (call_debugger, Finteractive_p, interactive_p):
7559 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7560 (maybe_call_debugger, Fbacktrace):
7561 * process.c (read_process_output, exec_sentinel):
7562 Use bool for booleans.
7563 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7564 All callers changed.
7565 * eval.c (interactive_p): Omit always-true boolean argument
7566 EXCLUDE_SUBRS_P. All callers changed.
7567 * dispextern.h, lisp.h: Reflect above API changes.
7568 * firstfile.c (dummy): Use the address of 'main', whose signature
7569 won't change, instead of the address of 'initialize', whose
7570 signature just changed from int to bool.
7571 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7572 * msdos.c (fatal_error_in_progress): ... from here.
7573 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7575 (redisplay_internal, unwind_redisplay): Simply clear
7576 REDISPLAYING_P when unwinding, instead of saving its previous,
7577 always-false value and then restoring it.
7579 Clean up some extern decls.
7580 Mostly, this hoists extern decls out of .c files and into .h files.
7581 That way, we're more likely to catch errors if the interfaces change.
7582 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7583 declare xg_mark_data.
7584 * dispextern.h (x_frame_parm_handlers):
7586 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7587 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7588 (Qultra_bold, Qoblique, Qitalic):
7589 Move extern decl here from .c file.
7590 * alloc.c (xg_mark_data) [USE_GTK]:
7592 * eval.c (Qlexical_binding):
7593 * fns.c (time) [!HAVE_UNISTD_H]:
7594 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7595 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7596 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7597 * lread.c (Qinternal_interpreter_environment):
7598 * minibuf.c (Qbuffer):
7599 * process.c (QCfamily, QCfilter):
7600 * widget.c (free_frame_faces):
7601 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7602 * xfont.c (x_clear_errors):
7603 * xterm.c (x_frame_parm_handlers):
7604 Remove now-redundant extern decls.
7605 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7606 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7608 * xfaces.c: Remove unnecessary static decls.
7609 * xterm.c (updating_frame): Remove decl of nonexistent object.
7611 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7612 when building globals.h, as the objects that are not built on
7613 this host are not needed to compile C files on this host.
7615 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7617 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7619 * frame.h: Add missing prototype for x_wm_set_size_hint.
7621 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7623 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7624 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7625 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7626 (Fsubstitute_command_keys):
7627 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7628 (save_excursion_save, save_excursion_restore)
7629 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7630 (format_time_string, general_insert_function)
7631 (make_buffer_string, make_buffer_string_both)
7632 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7633 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7634 (copy_text, insert_1, insert_1_both, insert_from_string)
7635 (insert_from_string_before_markers, insert_from_string_1)
7636 (insert_from_buffer, insert_from_buffer_1, replace_range)
7637 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7638 (del_range_2, modify_region):
7639 * intervals.c (intervals_equal, balance_possible_root_interval)
7640 (adjust_intervals_for_insertion, merge_properties_sticky)
7641 (graft_intervals_into_buffer, lookup_char_property)
7642 (adjust_for_invis_intang, set_point_both)
7643 (get_property_and_range, compare_string_intervals)
7644 (set_intervals_multibyte_1, set_intervals_multibyte):
7645 * keyboard.c (decode_timer):
7646 Use bool for boolean.
7647 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7648 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7650 2012-09-02 Chong Yidong <cyd@gnu.org>
7652 * keymap.c (push_key_description): Print M-TAB as C-M-i
7655 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
7657 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7658 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7659 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7660 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7661 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7662 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7663 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7665 2012-09-01 Eli Zaretskii <eliz@gnu.org>
7667 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7668 more than one grapheme cluster passed to the shaper: compute the
7669 offset adjustment values separately for each cluster. (Bug#11860)
7671 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7672 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7673 about implicit conversions from integer to pointer.
7675 2012-09-01 Daniel Colascione <dancol@dancol.org>
7677 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7678 system used too early.
7680 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7682 Better seed support for (random).
7683 * emacs.c (main): Call init_random.
7684 * fns.c (Frandom): Set the seed from a string argument, if given.
7685 Remove long-obsolete Gentzel cruft.
7686 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7687 (init_random): New function.
7689 2012-09-01 Daniel Colascione <dancol@dancol.org>
7691 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7692 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7693 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7694 x_wm_set_size_hint, x_query_colors, x_real_positions,
7695 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7696 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7697 all of which have been moved to common code.
7699 * xfaces.c: Include TERM_HEADER instead of listing all possible
7700 window-system headers.
7702 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7705 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7706 directly accessing frame internals.
7708 * w32font.h: Include font.h. Define syms_of_w32font and
7711 * process.c: Include TERM_HEADER instead of listing all possible
7712 window-system headers.
7714 * nsterm.h: Remove declarations now in frame.h.
7715 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
7717 * menu.c: Include TERM_HEADER instead of listing all possible
7718 window-system headers.
7720 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7723 * keyboard.c: Include TERM_HEADER instead of listing all possible
7724 window-system headers.
7726 * image.c: Include TERM_HEADER instead of listing all possible
7727 window-system headers. Declare Vlibrary_cache when compiling for
7730 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7731 window system declarations.
7733 * frame.h: Move common functions here: set_frame_menubar,
7734 x_set_window_size, x_sync, x_get_focus_frame,
7735 x_set_mouse_position, x_set_mouse_pixel_position,
7736 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7737 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7738 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7739 x_activate_menubar, x_real_positions, x_bitmap_icon,
7740 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7743 * frame.c: Include TERM_HEADER instead of listing all possible
7744 window-system headers.
7746 * font.c: Include TERM_HEADER instead of listing all possible
7747 window-system headers.
7749 * emacs.c: Include TERM_HEADER.
7751 * dispnew.c: Include TERM_HEADER instead of listing all possible
7752 window-system headers.
7754 * ccl.h: Include character.h.
7756 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7757 the current window system; include in list of objects to link into
7760 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7762 Remove mark_ttys function and fix tty_display_info initialization.
7763 * lisp.h (mark_ttys): Remove prototype.
7764 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7765 to mark_ttys because all possible values of 'top_frame' slot are
7766 the frames which are reachable from Vframe_list.
7767 * term.c (mark_ttys): Remove.
7768 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7770 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7772 Change struct frame bitfields from unsigned char to unsigned.
7773 * frame.h (struct frame): Change type of 'display_preempted',
7774 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7775 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7776 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7777 bitfields from unsigned char to unsigned.
7779 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7781 Remove unused member of struct x_output and struct w32_output.
7782 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7783 * w32term.h (struct w32_output): Likewise.
7785 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7787 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7788 does not become zero (Bug#12234).
7790 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7792 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7793 for GCC 4.7.1 x86-64.
7795 2012-08-30 Glenn Morris <rgm@gnu.org>
7797 * lread.c (init_lread): For out-of-tree builds, only add the
7798 source directory's site-lisp dir to the load-path if it exists,
7799 consistent with in-tree builds. (Bug#12302)
7801 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7803 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
7804 button_values to NULL. Call setStykeMask so dialogs get a close button.
7805 (windowShouldClose:): Set window_closed.
7806 (dealloc): New member, free button_values.
7807 (process_dialog:): Make member function. Remove window argument,
7808 replace window with self. Count buttons and allocate and store values
7810 (addButton:value:row:): value is int with the name tag. Call setTag
7811 with tag. Remove return self, declare return value as void.
7812 (addString:row:): Remove return self, declare return value as void.
7813 (addSplit): Remove return self, declare return value as void.
7814 (clicked:): Remove return self, declare return value as void.
7815 Set dialog_return to button_values[seltag]. Code formatting change.
7816 (initFromContents:isQuestion:): Adjust call to process_dialog.
7817 Code formatting change.
7818 (timeout_handler:): Set timer_fired to YES.
7819 (runDialogAt:): Set timer_fired to NO.
7820 Handle click on close button as quit.
7822 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7823 Add window_closed and button_values. Add void as return value for
7824 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7825 Add process_dialog as new member.
7827 2012-08-28 Eli Zaretskii <eliz@gnu.org>
7829 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7830 is not one of the heaps we manage. (Bug#12242)
7832 2012-08-28 Glenn Morris <rgm@gnu.org>
7834 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7836 2012-08-28 Martin Rudalics <rudalics@gmx.at>
7838 * window.c (Fset_window_configuration): Remove handling of
7839 auto-buffer-name window parameter. Install revision of reverted
7842 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7844 Do not allow to set major mode for a dead buffer.
7845 * buffer.c (Fset_buffer_major_mode): Signal an error
7846 if the buffer is dead.
7847 (Fother_buffer, other_buffer_safely): Remove redundant
7850 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7852 Always use set_buffer_if_live to restore original buffer at unwind.
7853 * buffer.h (record_unwind_current_buffer): New function.
7854 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7855 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7856 * undo.c, window.c: Adjust users.
7857 * buffer.c (set_buffer_if_live): Fix comment.
7859 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7861 Fix usage of set_buffer_internal.
7862 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7863 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7864 * coding.c (decode_coding): Omit redundant test.
7865 * fileio.c (decide_coding_unwind): Likewise.
7866 * fns.c (secure_hash): Likewise.
7867 * insdel.c (modify_region): Likewise.
7868 * keyboard.c (command_loop_1): Likewise.
7869 * print.c (PRINTFINISH): Likewise.
7870 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7872 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7874 * dispnew.c: Use bool for boolean.
7875 (frame_garbaged, display_completed, delayed_size_change)
7876 (fonts_changed_p, add_window_display_history)
7877 (add_frame_display_history, verify_row_hash)
7878 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7879 (row_equal_p, realloc_glyph_pool)
7880 (allocate_matrices_for_frame_redisplay)
7881 (showing_window_margins_p)
7882 (adjust_frame_glyphs_for_frame_redisplay)
7883 (build_frame_matrix_from_leaf_window, make_current)
7884 (mirrored_line_dance, mirror_line_dance, update_frame)
7885 (update_window_tree, update_single_window)
7886 (check_current_matrix_flags, update_window, update_text_area)
7887 (update_window_line, set_window_update_flags, scrolling_window)
7888 (update_frame_1, scrolling, buffer_posn_from_coords)
7889 (do_pending_window_change, change_frame_size)
7890 (change_frame_size_1, sit_for):
7891 Use bool for boolean.
7892 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7893 and remove last int (actually boolean) argument, which was always 0.
7894 All callers changed.
7895 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7896 * dispextern.h (struct composition_it): Use bool for boolean.
7897 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7898 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7899 * dired.c (file_name_completion):
7900 Use bool for boolean. (This was missed in an earlier change.)
7902 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7904 * window.c (Fset_window_configuration): Revert first part of
7907 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7909 * nsterm.h (NSPanel): New class variable dialog_return.
7911 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7912 Initialize dialog_return.
7913 (windowShouldClose:): Use stop instead of stopModalWithCode.
7914 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7915 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7917 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7920 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7922 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7923 * composite.c (find_composition, composition_gstring_p)
7924 (composition_reseat_it, find_automatic_composition):
7925 * data.c (let_shadows_buffer_binding_p)
7926 (let_shadows_global_binding_p, set_internal, make_blv)
7927 (Fmake_variable_buffer_local, Fmake_local_variable)
7928 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7929 (cons_to_signed, arith_driver):
7930 * dbusbind.c (xd_in_read_queued_messages):
7931 * dired.c (directory_files_internal, file_name_completion):
7932 Use bool for booleans.
7933 * dired.c (file_name_completion):
7934 * process.h (fd_callback):
7935 Omit int (actually boolean) argument. It wasn't being used.
7937 * composite.h, lisp.h: Reflect above API changes.
7939 * cmds.c, coding.c: Use bool for booleans.
7940 * cmds.c (move_point, Fself_insert_command):
7941 * coding.h (struct composition status, struct coding_system):
7942 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7943 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7944 (emacs_mule_char, decode_coding_emacs_mule)
7945 (encode_coding_emacs_mule, detect_coding_iso_2022)
7946 (decode_coding_iso_2022, encode_invocation_designation)
7947 (encode_designation_at_bol, encode_coding_iso_2022)
7948 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7949 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7950 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7951 (encode_coding_raw_text, detect_coding_charset)
7952 (decode_coding_charset, encode_coding_charset, detect_eol)
7953 (detect_coding, get_translation_table, produce_chars)
7954 (consume_chars, reused_workbuf_in_use)
7955 (make_conversion_work_buffer, code_conversion_save)
7956 (decode_coding_object, encode_coding_object)
7957 (detect_coding_system, char_encodable_p)
7958 (Funencodable_char_position, code_convert_region)
7959 (code_convert_string, code_convert_string_norecord)
7960 (Fset_coding_system_priority):
7961 * fileio.c (Finsert_file_contents):
7962 Use bool for booleans.
7963 * coding.h, lisp.h: Reflect above API changes.
7964 * coding.c: Remove unnecessary static function decls.
7965 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7966 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7967 not a boolean 'int', since callers never look at the return value.
7968 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7969 * coding.h (decoding_buffer_size, encoding_buffer_size)
7970 (emacs_mule_string_char): Remove unused extern decls.
7971 (struct iso_2022_spec, struct coding_system):
7972 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7973 (struct emacs_mule_spec): Remove unused field 'full_support'.
7974 All initializations removed.
7975 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7977 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7979 Fix spare memory change (Bug#12286).
7980 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7981 (valid_lisp_object_p): Likewise.
7983 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7985 * window.c (Fset_window_configuration): Record any window's old
7986 buffer if it's replaced (see Bug#8789). If the new current
7987 buffer doesn't appear in the selected window, go to its old
7990 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7992 Special MEM_TYPE_SPARE to denote reserved memory.
7993 * alloc.c (enum mem_type): New memory type.
7994 (refill_memory_reserve): Use new type for spare memory.
7995 This prevents live_cons_p and live_string_p from incorrect
7996 detection of uninitialized objects from spare memory as live.
7998 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8001 * Makefile.in (.PHONY): versioclean -> versionclean.
8003 Remove unused external symbols.
8004 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8005 * window.c (Qwindow_valid_p, decode_valid_window):
8006 Now static, not extern.
8007 * data.c (Qinterval): Remove; unused.
8008 (syms_of_data): Do not define 'interval'.
8009 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8010 * window.h (decode_valid_window):
8013 * character.c, charset.c, chartab.c: Use bool for booleans.
8014 * character.c (lisp_string_width, string_count_byte8)
8015 (string_escape_byte8):
8016 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8017 (load_charset_map_from_file, map_charset_chars)
8018 (Fdefine_charset_internal, define_charset_internal)
8019 (Fdeclare_equiv_charset, find_charsets_in_text)
8020 (Ffind_charset_region, char_charset, Fiso_charset):
8021 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8022 (sub_char_table_set, sub_char_table_set_range)
8023 (char_table_set_range, optimize_sub_char_table)
8024 (map_sub_char_table):
8025 Use bool for boolean.
8026 * character.c (str_to_unibyte): Omit last boolean argument; it was
8027 always 0. All callers changed.
8028 * character.h, charset.h: Adjust to match previous changes.
8029 * character.h (char_printable_p): Remove decl of nonexistent function.
8030 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8031 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8032 are all boolean, so make them single-bit bitfields.
8034 * lisp.h (ASET): Remove attempt to detect side effects.
8035 It was meant to be temporary and it often doesn't work,
8036 because when IDX has side effects the behavior of IDX==IDX
8037 is undefined. See Stefan Monnier in
8038 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8040 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8042 * lisp.h (functionp): New function (extracted from Ffunctionp).
8043 (FUNCTIONP): Use it.
8044 * eval.c (Ffunctionp): Use it.
8046 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8048 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8049 as that's faster and simpler than static storage. Don't bother
8050 with the g_main_context_query overhead if g_main_context_pending
8051 says no events are pending.
8052 (gfds, gfds_size): Remove these static vars.
8053 (xgselect_initialize): Remove; no longer needed.
8054 All uses and decls removed.
8056 * emacs.c (fatal_error_signal_hook): Remove.
8057 All uses removed. This leftover from old code was always 0.
8059 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8060 * casefiddle.c (casify_object, casify_region):
8061 * casetab.c (set_case_table):
8062 * category.c, category.h (word_boundary_p):
8063 * category.h (CHAR_HAS_CATEGORY):
8064 Use bool for booleans, instead of int.
8066 2012-08-25 Eli Zaretskii <eliz@gnu.org>
8068 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8070 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8072 On assertion failure, print backtrace if available.
8073 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8074 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8075 * Makefile.in (LIB_EXECINFO): New macro.
8078 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8079 * bytecode.c (exec_byte_code):
8080 * callint.c (check_mark, Fcall_interactively):
8081 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8082 (getenv_internal, sync_process_alive, call_process_exited):
8083 * lisp.h (USE_SAFE_ALLOCA):
8084 Use bool for booleans, instead of int.
8085 * lisp.h, process.h: Adjust prototypes to match above changes.
8086 * callint.c (Fcall_interactively): Don't assume the mark's
8087 offset fits in 'int'.
8089 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8091 * buffer.c, buffer.h: Use bool for boolean.
8092 * buffer.c (reset_buffer_local_variables)
8093 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8094 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8095 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8096 (overlay_touches_p, overlay_strings, Foverlay_put)
8097 (report_overlay_modification, call_overlay_mod_hooks):
8098 (mmap_enlarge, mmap_set_vars):
8099 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8100 Use bool for booleans, instead of int.
8101 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8102 since the 1-or-0 return value is always ignored anyway.
8103 (mmap_initialized_p):
8104 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8105 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8107 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8109 * bidi.c: Use bool for boolean.
8110 This is a bit more readable, and makes the text segment of bidi.o
8111 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8112 Presumably it's faster too.
8113 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8115 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8116 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8117 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8118 (bidi_explicit_dir_char, bidi_level_of_next_char)
8119 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8120 Use bool for booleans, instead of int.
8121 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8122 (bidi_unshelve_cache): Adjust decls to match code.
8124 2012-08-23 Martin Rudalics <rudalics@gmx.at>
8126 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8129 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8131 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8132 * atimer.h: Include <stdbool.h>.
8134 2012-08-22 Dan Nicolaescu <dann@gnu.org>
8136 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8137 compile time tests instead of run time tests on systems that do
8139 (FRAME_MAC_P): Remove leftover from deleted code.
8140 * frame.c (syms_of_frame): Remove leftover from deleted code.
8142 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8144 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8146 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8148 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8149 Otherwise, the compiler complains about (A?B:C) where B is void
8150 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8151 (fontset_add): Return void, for FONTSET_ADD.
8153 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8155 * alloc.c: Use bool for booleans.
8156 (gc_in_progress, abort_on_gc)
8157 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8158 (dont_register_blocks) [GC_MALLOC_CHECK]:
8159 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8160 (check_string_bytes, make_specified_string, memory_full)
8161 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8162 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8163 (mark_stack, valid_pointer_p, make_pure_string)
8164 (Fgarbage_collect, survives_gc_p, gc_sweep):
8165 Use bool for booleans, instead of int.
8166 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8167 Remove unused local.
8168 * alloc.c (PURE_POINTER_P):
8169 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8170 * editfns.c (Fformat):
8171 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8173 * fns.c (sweep_weak_table):
8174 * lisp.h (suppress_checking, push_message, survives_gc_p)
8175 (make_pure_string, gc_in_progress, abort_on_gc):
8176 * lread.c (readchar, read1):
8177 * print.c (Fprin1_to_string):
8178 * xdisp.c (push_message):
8179 Use bool for booleans affected directly or indirectly by
8182 Make recently-introduced setters macros.
8183 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8184 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8185 (set_fontset_default, set_fontset_fallback): Rename from their
8186 upper-case counterparts, and make them functions rather than macros.
8187 This is more consistent with the other recently-introduced setters.
8188 These don't need to be inline, since they're local.
8190 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8192 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8193 the loop (Bug#12247).
8195 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8197 * lisp.h (vcopy): Use memcpy rather than our own loop.
8198 This fixes a performance regression introduced by the recent
8199 addition of vcopy. This means 'vcopy' will need to be modified
8200 for a copying collector, but that's OK. Also, tighten the
8201 checking in the assertion.
8203 2012-08-21 Eli Zaretskii <eliz@gnu.org>
8205 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8206 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8207 non-base glyph for the width of the base character, according to
8208 what x_draw_composite_glyph_string_foreground expects.
8209 Generate WADJUST value according to composition_gstring_width's
8210 expectations, to produce correct width of the composed character.
8211 Reverse the sign of the DU offset produced by ScriptPlace.
8213 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8215 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8217 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8219 Avoid direct writes to contents member of struct Lisp_Vector.
8220 * lisp.h (vcopy): New function to copy data into vector.
8221 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8222 * fns.c (Ffillarray): Use ASET.
8223 * keyboard.c (timer_check_2): Use AREF and ASET.
8224 (append_tool_bar_item, Frecent_keys): Use vcopy.
8225 * lread.c (read_vector): Use ASET.
8226 * msdos.c (Frecent_doskeys): Use vcopy.
8227 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8228 (Finternal_merge_in_global_face): Use ASET and vcopy.
8229 * xfont.c (xfont_list_pattern): Likewise.
8231 2012-08-21 Martin Rudalics <rudalics@gmx.at>
8233 * window.c (Fwindow_point): For the selected window always return
8234 the position of its buffer's point.
8235 (Fset_window_point): For the selected window always go in its
8236 buffer to the specified position.
8238 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8240 Setter macros for fontsets.
8241 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8242 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8243 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8246 2012-08-20 Glenn Morris <rgm@gnu.org>
8248 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8249 Don't assume that `ln -f' works.
8251 2012-08-20 Eli Zaretskii <eliz@gnu.org>
8253 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8254 and later about non-assignments with no effect. See discussion at
8255 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8258 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8260 Inline setter functions for Lisp_Objects slots of struct specbinding.
8261 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8264 2012-08-20 Martin Rudalics <rudalics@gmx.at>
8266 * window.c (select_window): Always make selected window's buffer
8269 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8271 Use AREF and ASET for docstrings of category tables.
8272 * category.h (CATEGORY_DOCSTRING): Use AREF.
8273 (SET_CATEGORY_DOCSTRING): Use ASET.
8274 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8276 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8278 Inline setter functions for hash table members.
8279 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8280 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8281 (set_hash_key_and_value, set_hash_index, set_hash_next)
8282 (set_hash_hash): New functions.
8283 * charset.c, fns.c: Adjust users.
8285 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8287 Inline getter and setter functions for per-buffer values.
8288 * buffer.h (per_buffer_default, set_per_buffer_default)
8289 (per_buffer_value, set_per_buffer_value): New functions.
8290 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8291 * buffer.c, data.c: Adjust users.
8293 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8295 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8297 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8299 Rely on <config.h> + <unistd.h> to declare 'environ',
8300 as gnulib does this if the system doesn't.
8301 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8302 Remove declaration. MS-Windows declares it on stdlib.h which is
8303 included by conf_post.h.
8304 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8305 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8306 * vm-limit.c: Include <unistd.h>, for 'environ'.
8308 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8309 (start_of_data): Remove decl; mem-limits.h provides it.
8311 * xdisp.c (handle_invisible_prop): Make it a bit faster
8312 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8314 2012-08-19 Chong Yidong <cyd@gnu.org>
8316 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8319 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8321 * .gdbinit: Use call instead of set when calling a function in the
8324 * data.c (set_internal): Don't use set_blv_found.
8325 (Fkill_local_variable): Likewise.
8327 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8329 * nsfont.m (ns_ascii_average_width): Ensure the string
8330 ascii_printable is initialized with a null-terminated character
8331 array. Otherwise, it can contain undesired extra characters.
8333 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8335 port new setting code to Sun C 5.8 2005/10/13
8336 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8337 Return void, not Lisp_Object. Otherwise, the compiler
8338 complains about (A?B:C) where B is void and C is Lisp_Object
8339 when compiling CHAR_TABLE_SET, due to the recent change to
8340 the API of sub_char_table_set_contents.
8342 2012-08-18 Chong Yidong <cyd@gnu.org>
8344 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8345 for the string case (Bug#3874).
8347 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8349 * buffer.h (BSET): Remove (Bug#12215).
8350 Replace all uses with calls to new setter functions.
8351 (bset_bidi_paragraph_direction, bset_case_canon_table)
8352 (bset_case_eqv_table, bset_directory, bset_display_count)
8353 (bset_display_time, bset_downcase_table)
8354 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8355 (bset_last_selected_window, bset_local_var_alist)
8356 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8357 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8359 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8360 (bset_auto_fill_function, bset_auto_save_file_format)
8361 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8362 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8363 (bset_cache_long_line_scans, bset_case_fold_search)
8364 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8365 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8366 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8367 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8368 (bset_header_line_format, bset_indicate_buffer_boundaries)
8369 (bset_indicate_empty_lines, bset_invisibility_spec)
8370 (bset_left_fringe_width, bset_major_mode, bset_mark)
8371 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8372 (bset_name, bset_overwrite_mode, bset_pt_marker)
8373 (bset_right_fringe_width, bset_save_length)
8374 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8375 (bset_scroll_up_aggressively, bset_selective_display)
8376 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8377 (bset_word_wrap, bset_zv_marker):
8378 * category.c (bset_category_table):
8379 * syntax.c (bset_syntax_table):
8380 New setter functions.
8382 * process.h (PSET): Remove (Bug#12215).
8383 Replace all uses with calls to new setter functions.
8384 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8385 (PROCESS_INLINE): New macro.
8386 (pset_childp): New setter function.
8387 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8388 * process.c (PROCESS_INLINE):
8389 Define to EXTERN_INLINE, so that the corresponding functions
8390 are compiled into code.
8391 (pset_buffer, pset_command, pset_decode_coding_system)
8392 (pset_decoding_buf, pset_encode_coding_system)
8393 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8394 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8395 (pset_type, pset_write_queue): New setter functions.
8397 * window.h (WSET): Remove (Bug#12215).
8398 Replace all uses with calls to new setter functions.
8399 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8400 (WINDOW_INLINE): New macro.
8401 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8402 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8403 (wset_total_lines, wset_vertical_scroll_bar)
8404 (wset_window_end_pos, wset_window_end_valid)
8405 (wset_window_end_vpos): New setter functions.
8406 * window.c (WINDOW_INLINE):
8407 Define to EXTERN_INLINE, so that the corresponding functions
8408 are compiled into code.
8409 (wset_combination_limit, wset_dedicated, wset_display_table)
8410 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8411 (wset_new_normal, wset_new_total, wset_next_buffers)
8412 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8413 (wset_prev_buffers, wset_right_fringe_width)
8414 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8415 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8416 (wset_window_parameters):
8417 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8418 (wset_column_number_displayed, wset_region_showing):
8419 New setter functions.
8421 * termhooks.h (TSET): Remove (Bug#12215).
8422 Replace all uses with calls to new setter functions.
8423 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8424 (TERMHOOKS_INLINE): New macro.
8425 (tset_charset_list, tset_selection_alist): New setter functions.
8426 * terminal.c (TERMHOOKS_INLINE):
8427 Define to EXTERN_INLINE, so that the corresponding functions
8428 are compiled into code.
8429 (tset_param_alist): New setter function.
8431 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8433 * keyboard.h (KSET): Remove (Bug#12215).
8434 Replace all uses with calls to new setter functions.
8435 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8436 (KEYBOARD_INLINE): New macro.
8437 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8438 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8439 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8440 New setter functions.
8441 * keyboard.c (KEYBOARD_INLINE):
8442 Define to EXTERN_INLINE, so that the corresponding functions
8443 are compiled into code.
8444 (kset_echo_string, kset_kbd_queue)
8445 (kset_keyboard_translate_table, kset_last_prefix_arg)
8446 (kset_last_repeatable_command, kset_local_function_key_map)
8447 (kset_overriding_terminal_local_map, kset_real_last_command)
8448 (kset_system_key_syms): New setter functions.
8450 * frame.h (FSET): Remove (Bug#12215).
8451 Replace all uses with calls to new setter functions.
8452 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8453 (FRAME_INLINE): New macro.
8454 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8455 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8456 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8457 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8458 (fset_param_alist, fset_root_window, fset_scroll_bars)
8459 (fset_selected_window, fset_title, fset_tool_bar_items)
8460 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8461 * frame.c (FRAME_INLINE):
8462 Define to EXTERN_INLINE, so that the corresponding functions
8463 are compiled into code.
8464 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8466 A few more naming-convention fixes for getters and setters.
8467 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8468 and rename from buffer_overlays_set_before.
8469 (set_buffer_overlays_after): Move here from buffer.h, and rename
8470 from buffer_overlays_set_after.
8471 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8473 (set_buffer_intervals): Rename from buffer_set_intervals.
8474 * intervals.c (set_interval_object): Move here from intervals.h,
8475 and rename from interval_set_object.
8476 (set_interval_left): Move here from intervals.h, and rename from
8478 (set_interval_right): Move here from intervals.h, and rename from
8480 (copy_interval_parent): Move here from intervals.h, and rename from
8481 interval_copy_parent.
8482 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8483 (set_interval_plist): Rename from interval_set_plist.
8484 Return void, not Lisp_Object, since no caller uses the result.
8485 * lisp.h (string_intervals): Rename from string_get_intervals.
8486 (set_string_intervals): Rename from string_set_intervals.
8488 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8489 (set_char_table_contents): Rename from char_table_set_contents.
8490 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8491 All uses changed. See the end of
8492 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8494 * lisp.h (CSET): Remove (Bug#12215).
8495 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8496 (set_char_table_purpose): New functions,
8497 replacing CSET. All uses changed. For example, replace
8498 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8499 "set_char_table_parent (char_table, parent);".
8500 The old version was confusing because it used the same name
8501 'parent' for two different things.
8503 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8505 Functions to get and set Lisp_Object fields of buffer-local variables.
8506 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8507 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8508 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8509 * data.c, eval.c, frame.c: Adjust users.
8511 2012-08-17 Chong Yidong <cyd@gnu.org>
8513 * xfaces.c (merge_face_vectors): If the target font specfies a
8514 font spec, make the font's attributes take precedence over
8515 directly-specified attributes.
8516 (merge_face_ref): Recognize :font.
8518 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8520 Do not use memcpy for copying intervals.
8521 * intervals.c (reproduce_interval): New function.
8522 (reproduce_tree, reproduce_tree_obj): Use it.
8523 (reproduce_tree_obj): Remove prototype.
8525 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8527 * lisp.h (duration_to_sec_usec): Remove unused decl.
8529 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8531 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8532 to an allocated instance of NSString, not to the class itself.
8534 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8536 * makefile.w32-in (C_CTYPE_H): New macro.
8537 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8538 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8539 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8541 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8543 Use ASCII tests for character types.
8544 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8546 Don't include <ctype.h>; was not needed.
8547 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8548 * sysdep.c, xfaces.c:
8549 Include <c-ctype.h> instead of <ctype.h>.
8550 * nsterm.m: Include <c-ctype.h>.
8551 * charset.c (read_hex):
8552 * doc.c (Fsnarf_documentation):
8553 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8554 (DRIVE_LETTER) [DOS_NT]:
8555 (Ffile_name_directory, Fexpand_file_name)
8556 (Fsubstitute_in_file_name):
8557 * font.c (font_parse_xlfd, font_parse_fcname):
8558 * frame.c (x_set_font_backend):
8559 * gtkutil.c (xg_get_font):
8560 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8561 * nsimage.m (hexchar):
8562 * nsterm.m (ns_xlfd_to_fontname):
8563 * sysdep.c (system_process_attributes):
8564 * xfaces.c (hash_string_case_insensitive):
8565 Use C-locale tests instead of locale-specific tests for character
8566 types, since we want the ASCII interpretation here, not the
8567 interpretation suitable for whatever happens to be the current locale.
8569 2012-08-16 Martin Rudalics <rudalics@gmx.at>
8571 Consistently check windows for validity/liveness
8572 (Bug#11984, Bug#12025, Bug#12026).
8573 * lisp.h (CHECK_VALID_WINDOW): New macro.
8574 * window.c (decode_window): Rename to decode_live_window.
8575 (decode_valid_window, Fwindow_valid_p): New functions.
8576 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8577 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8578 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8579 (Fwindow_prev_sibling, Fwindow_combination_limit)
8580 (Fset_window_combination_limit, Fwindow_use_time)
8581 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8582 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8583 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8584 (Fwindow_hscroll, Fset_window_hscroll)
8585 (Fwindow_redisplay_end_trigger)
8586 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8587 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8588 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8589 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8590 (Fwindow_end, Fset_window_point, Fset_window_start)
8591 (Fpos_visible_in_window_p, Fwindow_line_height)
8592 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8593 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8594 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8595 (Fset_window_parameter, Fwindow_display_table)
8596 (Fset_window_display_table, Fdelete_other_windows_internal)
8597 (Fset_window_buffer, Fset_window_new_total)
8598 (Fset_window_new_normal, Fdelete_window_internal)
8599 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8600 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8601 (Fwindow_scroll_bars): Check whether argument window is a valid or
8602 live window. Update doc-strings.
8603 (syms_of_window): New symbol Qwindow_valid_p.
8604 * keyboard.c (Fposn_at_x_y): Check whether argument
8605 frame_or_window denotes a valid window.
8607 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8609 Fix previous char table change.
8610 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8611 * chartab.c (optimize_sub_char_table): Likewise.
8613 2012-08-16 Chong Yidong <cyd@gnu.org>
8615 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8617 * xfont.c (xfont_open):
8618 * xftfont.c (xftfont_open): Set the font's max_width field.
8620 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8621 min_width to space_width and average_width to the average over
8622 printable ASCII characters.
8623 (ns_char_width): Code cleanup.
8624 (ns_ascii_average_width): New utility function.
8626 * font.h (struct font): Update comments.
8628 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8630 Simple interface to set Lisp_Object fields of character tables.
8631 * lisp.h (CSET): New macro.
8632 (char_table_set_extras, char_table_set_contents)
8633 (sub_char_table_set_contents): New function.
8634 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8635 * syntax.c: Adjust users.
8637 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8639 * eval.c (eval_sub): Bind lexical-binding.
8640 * lread.c (Qlexical_binding): Make non-static.
8642 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8644 * nsmenu.m (popupSession): Remove.
8645 (pop_down_menu): Remove endModalSession.
8646 (timeout_handler:): New method.
8647 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8648 Call runModalForWindow. Check timer_fired when it returns.
8649 If not set, cancel timer and break out of loop.
8650 Otherwise loop again, with a new timeout.
8652 * nsterm.m: Include fcntl.h if present.
8653 (fd_entry, t_readfds, inNsSelect): Remove.
8654 (select_writefds, select_valid, select_timeout, selfds)
8655 (select_mutex, apploopnr): Add.
8656 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8657 Otherwise call kbd_buffer_store_event.
8658 (ns_send_appdefined): Remove release of fd_entry.
8659 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8660 Increment and decrement apploopnr.
8661 (ns_select): If no file descriptors, just do a NSTimer.
8662 Otherwise copy read/write masks and start select thread (fd_handler).
8663 Start main loop and wait for application defined event.
8664 Inform select thread to stop selecting after main loop is exited.
8665 (ns_term_init): Create selfds pipe and set non-blocking.
8666 Initialize select_mutex. Start the select thread (fd_handler).
8667 (fd_handler:): Loop forever, wait for info from the main thread
8668 to either start or stop selecting. When select returns, send
8669 and appdefined event.
8670 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8671 If not call kbd_buffer_store_event.
8673 * nsterm.h (EmacsApp): fd_handler takes id argument.
8674 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8676 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8678 2012-08-15 Eli Zaretskii <eliz@gnu.org>
8680 * region-cache.c (move_cache_gap): Update gap_len using the actual
8681 growth of the boundaries array. Do not change cache_len.
8684 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8686 Generalize and cleanup font subsystem checks.
8687 * font.h (FONT_DEBUG, font_assert): Remove.
8688 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8689 Change font_assert to eassert. Use eassert where appropriate.
8691 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8693 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8695 2012-08-15 Chong Yidong <cyd@gnu.org>
8697 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8698 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8699 extract the font descriptor instead of just the font name.
8700 In that case, return a font spec instead of a string.
8701 (x_last_font_name): Move to this file from xfns.c.
8703 * xfns.c (Fx_select_font): The return value can also be a font
8704 spec. Move x_last_font_name management to gtkutil.c.
8706 * xfaces.c: Make font weight and style symbols non-static.
8708 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8710 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8713 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8715 * alloc.c (Fgarbage_collect): Use plural form consistently.
8717 2012-08-14 Eli Zaretskii <eliz@gnu.org>
8719 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8720 iteration through the command loop. Fixes a problem whereby mouse
8721 movements are ignored until the first mouse click.
8723 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8725 Use bool, not int, for Lisp booleans.
8726 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8727 makes Emacs a bit smaller and presumably a bit faster.
8728 * lisp.h: Include <stdbool.h>.
8729 (struct Lisp_Boolfwd, defvar_bool):
8730 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8731 * regex.c [!emacs]: Include <stdbool.h>.
8732 (false, true): Remove; <stdbool.h> does this for us now.
8734 2012-08-14 Chong Yidong <cyd@gnu.org>
8736 * character.c (Fcharacterp): Doc fix (Bug#12076).
8738 * data.c (Findirect_variable): Doc fix (Bug#11040).
8740 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8742 * editfns.c (Fformat): Doc fix (Bug#12059).
8743 (Fsave_current_buffer): Doc fix (Bug#11542).
8745 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8747 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8750 2012-08-14 Martin Rudalics <rudalics@gmx.at>
8752 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8753 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8754 * minibuf.c (choose_minibuf_frame, read_minibuf):
8755 * w32fns.c (x_create_tip_frame):
8756 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8757 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8759 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8761 * intervals.c (offset_intervals): Remove obsolete comment.
8763 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8765 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8767 2012-08-14 Gergely Risko <gergely@risko.hu>
8769 * coding.c (decode_coding): Record buffer modification before
8770 disabling undo_list (Bug#11773).
8772 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8774 Revert and cleanup some recent overlay changes.
8775 * buffer.h (enum overlay_type): Remove.
8776 (buffer_get_overlays, buffer_set_overlays): Likewise.
8777 (buffer_set_overlays_before, buffer_set_overlays_after):
8778 New function. Adjust users.
8779 (unchain_both): Add eassert.
8781 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8783 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8785 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8787 * gtkutil.c (xg_mark_data): Don't assume C99.
8789 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8791 * gtkutil.c (xg_frame_tb_info): New struct.
8792 (TB_INFO_KEY): New define.
8793 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8794 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8795 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8797 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
8798 is up to date. Otherwise store new data.
8799 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8801 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8803 Use KSET for write access to Lisp_Object members of struct kboard.
8804 * keyboard.h (KSET): New macro.
8805 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8806 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8807 * xterm.c: Adjust users.
8809 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8811 Use BSET for write access to Lisp_Object members of struct buffer.
8812 * buffer.h (BSET): New macro.
8813 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8814 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8815 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8816 * window.c, xdisp.c, xfns.c: Adjust users.
8818 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8820 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8822 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8824 * nsterm.m (not_in_argv): New function.
8825 (application:openFile, application:openTempFile:):
8826 (application:openFileWithoutUI:, application:openFiles:): Open file
8827 if not_in_argv returns non-zero (bug#12171).
8829 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
8830 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8831 Define for Gtk+ versions less than 3.2.
8832 (xg_get_font_name): Use those functions/macros here.
8833 Reported by Frans Oilinki <moilinki@gmail.com>.
8835 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8837 * unexmacosx.c (copy_data_segment): Copy initialized data in
8838 statically linked libraries from input file rather than memory.
8840 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8841 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8842 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8844 2012-08-10 Glenn Morris <rgm@gnu.org>
8846 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8847 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8849 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8851 Fix last change to allow compilation with low optimization levels.
8852 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8853 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8855 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8857 Use common inline syntax in intervals.h.
8858 * intervals.h (INTERVALS_INLINE): New macro.
8859 Change all users from LISP_INLINE.
8861 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8863 Define Qnone once for all platforms.
8864 * frame.c (Qnone): Define here.
8865 (syms_of_frame): DEFSYM it.
8866 * lisp.h (Qnone): New declaration.
8867 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8868 * xfns.c: Remove duplication. Adjust users.
8870 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8872 Remove unused macros from intervals.h.
8873 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8874 * intervals.c: Adjust comment.
8876 2012-08-10 Eli Zaretskii <eliz@gnu.org>
8878 * w32fns.c <w32_unicode_gui>: New static variable.
8879 (globals_of_w32fns): Initialize it according to os_subtype.
8880 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8883 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
8884 Eli Zaretskii <eliz@gnu.org>
8886 Fix bug #10299 with Unicode characters sent by customized
8887 keyboards created by MSKLC.
8888 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8889 (w32_init_class): Use it to initialize the Emacs class with either
8890 ANSI or Unicode API calls.
8891 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8893 (w32_wnd_proc): If the character code sent by WM_CHAR or
8894 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8895 original message. Call DefWindowProcW on NT and later.
8897 2012-08-10 Glenn Morris <rgm@gnu.org>
8899 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8901 * lisp.h (DIRECTORY_SEP): Let configure set it.
8903 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8905 Use TSET for write access to Lisp_Object slots of struct terminal.
8906 * termhooks.h (TSET): New macro.
8907 * coding.c, terminal.c, xselect.c: Adjust users.
8909 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8911 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8912 the failing expression, include them in the error message.
8913 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8914 * lisp.h (internal_condition_case_n): Update declaration.
8916 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8918 Inline functions to examine and change buffer overlays.
8919 * buffer.c (unchain_both): New function.
8920 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8921 (buffer_has_overlays): New function.
8922 (enum overlay_type): New enum.
8923 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8924 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8926 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8928 Inline functions to examine and change buffer intervals.
8929 * alloc.c (mark_interval_tree): Remove.
8930 (MARK_INTERVAL_TREE): Simplify.
8931 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8932 * intervals.c (buffer_balance_intervals): New function.
8933 (graft_intervals_into_buffer): Adjust indentation.
8934 (set_intervals_multibyte): Simplify.
8935 * buffer.h (BUF_INTERVALS): Remove.
8936 (buffer_get_intervals, buffer_set_intervals): New function.
8937 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8938 * intervals.c, textprop.c: Adjust users.
8940 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8942 Inline functions to examine and change string intervals.
8943 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8944 (string_get_intervals, string_set_intervals): New function.
8945 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8946 * lread.c, print.c, textprop.c: Adjust users.
8948 2012-08-08 Glenn Morris <rgm@gnu.org>
8950 * lisp.mk (lisp): Remove language/persian.elc.
8952 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8955 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8956 (NULL_INTERVAL_P): Likewise. Adjust users.
8957 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8958 Adjust comment. Move under #if 0.
8959 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8960 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8962 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8964 Check total length of intervals with eassert.
8965 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8966 * intervals.c: Change all users to eassert.
8968 2012-08-07 Eli Zaretskii <eliz@gnu.org>
8970 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8971 Rename fields to match removal of FGET and WGET and disuse of
8972 INTERNAL_FIELD in Lisp_Cons.
8974 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8976 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8977 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8978 name since all xname users are fixed long time ago. Do not
8980 (set_symbol_name, set_symbol_function, set_symbol_plist):
8981 (set_symbol_next, set_overlay_plist): New function.
8982 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8983 (struct Lisp_Overlay): Likewise.
8984 (CVAR, MVAR, SVAR): Remove.
8985 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8986 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8987 * xterm.c: Adjust users.
8988 * .gdbinit: Change to use name field of struct Lisp_Symbol
8991 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8993 Basic functions to set Lisp_Object and pointer slots of intervals.
8994 * intervals.h (interval_set_parent, interval_set_object):
8995 (interval_set_left, interval_set_right, interval_set_plist):
8996 (interval_copy_parent): New function.
8997 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
8998 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9000 (INTERVAL_SIZE): Remove. Adjust users.
9001 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9003 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9005 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9006 * process.h (PGET): Remove.
9007 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9008 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9010 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9012 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9013 * window.h (WGET): Remove.
9014 (struct window): Do not use INTERNAL_FIELD.
9015 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9016 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9017 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9018 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9019 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9022 2012-08-07 Chong Yidong <cyd@gnu.org>
9024 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9025 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9026 (Fdelete_window_internal): Signal an error if the window is not on
9027 a live frame (Bug#12025).
9029 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9031 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9032 * frame.h (FGET): Remove.
9033 (struct frame): Do not use INTERNAL_FIELD.
9034 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9035 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9036 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9037 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9039 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
9041 * w32.c: Silence compiler warnings.
9042 (map_w32_filename): Remove unused variable `is_fat'.
9043 (chase_symlinks): Add parentheses around expression.
9045 2012-08-06 Glenn Morris <rgm@gnu.org>
9047 * sysdep.c: Respect BROKEN_GETWD.
9049 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9050 Let configure handle it.
9051 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9053 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9055 Use GCALIGNMENT where appropriate.
9056 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9057 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9058 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9060 2012-08-06 Eli Zaretskii <eliz@gnu.org>
9062 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9063 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9065 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9067 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9068 that should be sufficient for everyone.
9070 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9072 * keyboard.c (timer_check_2): Add break so timer_check returns next
9075 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9077 Fix Windows build errors introduced after converting to WGET and WSET.
9078 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9079 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9081 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9083 * nsterm.m (ns_frame_rehighlight): Use FSET.
9085 * nsmenu.m (ns_update_menubar): Use FSET.
9087 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9089 Separate read and write access to Lisp_Object slots of Lisp_Process.
9090 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9091 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9093 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9095 Separate read and write access to Lisp_Object slots of struct window.
9096 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9097 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9098 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9099 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9100 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9101 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9104 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9106 Fix Windows build errors introduced after converting to FGET and FSET.
9107 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9108 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9109 (w32_judge_scroll_bars): Change to use FSET.
9110 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9112 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9114 Fix replacement typo.
9115 * window.c (replace_window): Set root_window instead of
9116 selected_window. This fixes a total window subsystem
9117 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9119 2012-08-06 Glenn Morris <rgm@gnu.org>
9121 * lisp.mk (lisp): Add language/persian.elc.
9123 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9125 Separate read and write access to Lisp_Object slots of struct frame.
9126 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9127 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9128 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9129 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9130 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9132 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9134 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9136 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9138 Generalize common compile-time constants.
9139 * lisp.h (header_size, bool_header_size, word_size): Now here.
9140 (struct Lisp_Vector): Add comment.
9141 (struct Lisp_Bool_Vector): Move up to define handy constants.
9142 (VECSIZE, PSEUDOVECSIZE): Simplify.
9143 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9144 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9145 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9146 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9147 * xfont.c, xmenu.c: Use word_size where appropriate.
9149 2012-08-05 Lawrence Mitchell <wence@gmx.li>
9151 * search.c (Freplace_match): Treat \? in the replacement text
9152 literally (Bug#8161).
9154 2012-08-05 Chong Yidong <cyd@gnu.org>
9156 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9157 * frame.c (Vdelete_frame_functions):
9158 * emacs.c (Vkill_emacs_hook): Doc fix.
9160 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9162 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9163 --with-x-toolkit=no builds.
9164 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9166 2012-08-04 Chong Yidong <cyd@gnu.org>
9168 * syntax.c (Fmodify_syntax_entry): Doc fix.
9170 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9172 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9173 * w32.c (init_environment): Change the default values of many
9174 environment variables in dflt_envvars[] to NULL, to avoid pushing
9175 them into environment when they were not already defined.
9176 Remove the code that deletes site-lisp subdirectories from the default
9177 value of EMACSLOADPATH, as it is no longer needed.
9178 (check_windows_init_file): Now external, not static.
9179 Use Vload_path as is, without adding anything, as this function is now
9180 called when Vload_path is already set up.
9182 * w32.h (check_windows_init_file): Add prototype.
9184 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9185 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9186 compatibility with Posix platforms.
9187 (main): Move the call to check_windows_init_file to here from
9189 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9190 any, in the DEFALT argument into the root of the Emacs build or
9191 installation tree, as appropriate.
9193 * callproc.c (init_callproc_1): Call decode_env_path instead of
9194 doing its equivalent by hand.
9195 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9196 the code that sets Vexec_path run on MS-Windows.
9198 * lread.c (init_lread): Add comments to #ifdef's.
9200 * msdos.c (dos_set_window_size, IT_update_begin)
9201 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9202 instead of direct references.
9204 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9206 Export DEFAULT_REHASH_* to GDB.
9207 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9208 Now constants, not macros.
9210 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9212 Remove unnecessary casts involving pointers.
9213 These casts are no longer needed now that we assume C89 or later,
9214 since they involve casting to or from void *.
9215 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9216 (make_pure_float, make_pure_vector):
9217 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9218 * macros.c (Fstart_kbd_macro):
9219 * menu.c (find_and_return_menu_selection):
9220 * minibuf.c (read_minibuf_noninteractive):
9221 * sysdep.c (closedir):
9222 * xdisp.c (x_produce_glyphs):
9223 * xfaces.c (compare_fonts_by_sort_order):
9224 * xfns.c (x_real_positions, select_visual):
9225 * xselect.c (x_stop_queuing_selection_requests)
9226 (x_get_window_property, x_get_window_property_as_lisp_data):
9227 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9228 Remove unnecessary pointer casts.
9229 * alloc.c (record_xmalloc): New function.
9230 * lisp.h (record_xmalloc): New decl.
9231 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9232 more like a function. This is because the pointer cast is not
9233 needed. All uses changed.
9234 * print.c (print_string, print_error_message): Avoid length recalc.
9236 Improve fix for macroexp crash with debugging (Bug#12118).
9237 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9238 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9239 not supposed to be invoked from the garbage collector.
9240 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9241 (gc_aset): New function, which is like ASET but can be
9242 used in the garbage collector.
9243 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9244 (set_hash_index): Use it instead of ASET.
9246 2012-08-03 Eli Zaretskii <eliz@gnu.org>
9248 Support symlinks on latest versions of MS-Windows.
9249 * w32.c: Include winioctl.h and aclapi.h.
9250 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9251 (revert_to_self): Forward declarations of static functions.
9252 <static BOOL g_b_init_get_security_info>:
9253 <g_b_init_create_symbolic_link>: New static flags.
9254 (globals_of_w32): Initialize them to zero.
9255 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9256 (map_w32_filename): Improve commentary. Simplify switch.
9257 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9258 headers (most versions of MinGW w32api don't).
9259 (get_security_info, create_symbolic_link)
9260 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9262 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9263 in the argument file name.
9264 (sys_access): Call unc_volume_file_attributes only if
9265 GetFileAttributes fails with network-related error codes.
9266 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9267 have the required privileges.
9268 (get_file_security_desc_by_name): Rename from
9269 get_file_security_desc.
9270 (stat_worker): New function, with most of the guts of 'stat', and
9271 with addition of handling of symlinks and support for 'lstat'.
9272 If possible, get file's attributes and security information by
9273 handle, not by name. Produce S_IFLNK bit for symlinks, when
9274 called from 'lstat'.
9275 (stat, lstat): New functions, call 'stat_worker'.
9276 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9277 symlinks when the underlying filesystem supports them.
9279 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9281 Fix macroexp crash on Windows with debugging (Bug#12118).
9282 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9283 checking subscripts; problem introduced with the recent
9284 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9285 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9286 since it's used in non-static inline functions now.
9288 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9289 Don't assume buffer size fits in 'int'. Remove unused local.
9291 Use C99-style 'extern inline' if available.
9292 * buffer.h (BUFFER_INLINE):
9293 * category.h (CATEGORY_INLINE):
9294 * character.h (CHARACTER_INLINE):
9295 * charset.h (CHARSET_INLINE):
9296 * composite.h (COMPOSITE_INLINE):
9297 * dispextern.h (DISPEXTERN_INLINE):
9298 * lisp.h (LISP_INLINE):
9299 * systime.h (SYSTIME_INLINE):
9300 New macro, replacing 'static inline' in this header.
9301 * buffer.h, category.h, character.h, charset.h, composite.h:
9302 * dispextern.h, lisp.h, systime.h:
9303 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9304 * alloc.c (LISP_INLINE):
9305 * buffer.c (BUFFER_INLINE):
9306 * category.c (CATEGORY_INLINE):
9307 * character.c (CHARACTER_INLINE):
9308 * charset.c (CHARSET_INLINE):
9309 * composite.c (COMPOSITE_INLINE):
9310 * dispnew.c (DISPEXTERN_INLINE):
9311 * sysdep.c (SYSTIME_INLINE):
9312 Define to EXTERN_INLINE, so that the corresponding functions
9313 are compiled into code.
9314 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9315 (INLINE_HEADER_END): New macros.
9316 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9317 since it's used in non-static inline functions now.
9318 (VALMASK) [!USE_LSB_TAG]: Likewise.
9320 2012-08-02 Glenn Morris <rgm@gnu.org>
9322 * s/: Remove empty directory.
9324 * s/ms-w32.h: Move to ../nt/inc.
9325 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9326 Update for new ms-w32.h location.
9328 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9331 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9333 2012-08-02 Glenn Morris <rgm@gnu.org>
9335 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9336 hard-coding the path separator.
9338 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9340 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9341 This how ASET and AREF are supposed to work, and makes
9342 it easier to think about future improvements. See
9343 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9344 * charset.h (set_charset_attr): New function.
9345 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9346 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9347 (aref_addr): New function. All uses of &AREF(...) changed.
9348 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9349 (set_hash_index): New functions. All lvalue-style uses of
9350 HASH_KEY etc. changed.
9351 * keyboard.c (set_prop): New function. All lvalue-style uses
9354 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9356 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9357 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9358 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9359 * nsfns.m (ns_set_name_as_filename): Likewise.
9360 * nsmenu.m (ns_update_menubar): Likewise.
9361 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9363 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9365 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9366 Adapt to latest changes in field names of the corresponding Lisp
9369 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9371 2012-08-01 Glenn Morris <rgm@gnu.org>
9373 * s/msdos.h: Remove file.
9374 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9375 * Makefile.in (S_FILE): Remove.
9376 (config_h): Remove S_FILE.
9378 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9380 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9381 Remove; moved to nt/config.nt.
9383 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9385 Use INTERNAL_FIELD for conses and overlays.
9386 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9387 Remove obsolete comment.
9389 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9390 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9392 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9394 Use INTERNAL_FIELD for symbols.
9395 * lisp.h (SVAR): New macro. Adjust users.
9396 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9397 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9399 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9401 Use INTERNAL_FIELD for processes.
9402 * process.h (PVAR): New macro. Adjust style.
9403 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9404 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9406 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9408 Use INTERNAL_FIELD for windows.
9409 * window.h (WVAR): New macro.
9410 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9411 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9412 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9413 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9414 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9415 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9417 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9419 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9421 2012-08-01 Glenn Morris <rgm@gnu.org>
9423 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9424 Move to configure.ac.
9426 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9428 * makefile.w32-in (CONFIG_H): Update dependencies.
9429 (CONF_POST_H): New macro.
9431 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9433 2012-07-31 Glenn Morris <rgm@gnu.org>
9435 * Makefile.in (S_FILE): No longer set by configure.
9437 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9439 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9441 * process.h (NULL_DEVICE):
9442 * emacs.c (SEPCHAR):
9443 * editfns.c (USER_FULL_NAME): Let configure set them.
9445 * s/README, s/template.h: Remove files.
9447 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9449 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9450 Move to configure.ac.
9452 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9454 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9455 resulting renaming of 'struct frame' members.
9457 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9459 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9460 after introduction of FVAR.
9462 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9464 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9466 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9467 instead of compositeToPoint.
9468 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9470 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9472 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9474 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9475 * lisp.h (INTERNAL_FIELD): New macro.
9476 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9477 (BVAR): Change to use INTERNAL_FIELD.
9478 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9479 (KVAR): Change to use INTERNAL_FIELD.
9480 * frame.h (FVAR): New macro.
9481 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9482 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9483 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9484 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9485 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9487 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9489 Miscellaneous fixes for non-default X toolkits.
9490 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9491 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9492 Move under #ifdef USE_LUCID.
9493 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9494 definition and usage to avoid warnings.
9496 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9498 * nsterm.m (openFiles): Fix previous checkin.
9500 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9502 * indent.c (compute_motion): Remove unused local.
9504 2012-07-31 Glenn Morris <rgm@gnu.org>
9506 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9508 * conf_post.h [USG5_4]:
9509 Move remaining contents of s/usg5-4-common.h here.
9510 * s/usg5-4-common.h: Remove file.
9512 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9513 * s/irix6-5.h: Remove file.
9515 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9516 * s/darwin.h: Remove file.
9518 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9519 * s/hpux10-20.h: Remove file, which is now empty.
9521 2012-07-30 Glenn Morris <rgm@gnu.org>
9523 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9524 * Makefile.in (config_h): Add conf_post.h.
9525 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9527 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9529 * nsterm.m (ns_do_open_file): New variable.
9530 (ns_term_init): Set ns_do_open_file to YES after run returns.
9531 (openFile, openTempFile, openFileWithoutUI, openFiles):
9532 Open files only if ns_do_open_file.
9534 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9536 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9537 This no-op macro hasn't been needed for many years.
9538 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9540 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9541 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9542 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9543 gdb_make_enums_visible.
9544 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9545 (DIRECTORY_SEP): Now a constant, not a macro.
9547 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9549 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9550 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9552 * w32term.c <w32_keyboard_codepage>: Renamed from
9553 keyboard_codepage and now external. All users changed.
9555 * w32term.h: Add declaration of w32_keyboard_codepage.
9557 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9558 the codepage to translate keys to Unicode. If this argument is
9559 -1, use the value returned by GetConsoleCP. All callers changed.
9561 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9563 Update .PHONY listings in makefiles.
9564 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9565 bootstrap-clean, distclean, maintainer-clean, versioclean,
9568 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9569 This is a bit clearer. Fix some commentary typos.
9571 2012-07-30 Glenn Morris <rgm@gnu.org>
9573 * s/netbsd.h: Let configure include signal.h if needed.
9574 Remove file, which is now empty.
9576 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9577 Let configure set them.
9578 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9579 No more need to undefine.
9581 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9583 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9584 non-single-byte char when adding meta modifier. (Bug#12090)
9586 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9588 Convert safe_call to use variable number of arguments.
9589 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9590 (safe_call2): Fix comment.
9591 * lisp.h (safe_call): Adjust prototype.
9592 * coding.c (encode_coding_object): Change to use safe_call2.
9593 * xfaces.c (merge_face_heights): Change to use safe_call1.
9595 2012-07-30 Glenn Morris <rgm@gnu.org>
9597 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
9598 does that unconditionally. Remove file, which is now empty.
9600 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9603 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9605 Export to GDB most of lisp.h's remaining object-like macros.
9606 * lisp.h (min, max): Move earlier, because they're used earlier now.
9607 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9608 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9609 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9610 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9611 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9612 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9613 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9614 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9615 Now constants, for GDB. They need not be macros.
9616 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9617 Now constants, for GDB, as well as macros, for static initializers.
9618 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9619 Move to after the definition of struct Lisp_Char_Table,
9620 since the former now needs that type defined.
9621 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9622 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9623 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9624 New enums, for gdb_make_enums_visible.
9625 (GLYPH_MODE_LINE_FACE): Remove; unused.
9626 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
9627 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9628 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9629 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9630 enum maxargs, enum MAX_ALLOCA.
9631 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9632 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9633 no longer needed, now that they are done in lisp.h.
9635 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9637 Cleanup string bytes checking.
9638 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9639 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9640 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9641 (check_sblock, compact_small_strings): Simplify.
9643 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9645 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9646 These macros are confusing and no longer need to be defined, as
9647 the enum values now suffice. All uses replaced with definiens.
9648 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9650 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
9652 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9653 ($(BLD)/w32console.$(O)): Update dependencies.
9655 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9657 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9658 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9660 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9662 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9664 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9665 setting sitelisp (Bug#12010).
9667 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9669 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
9671 * w32heap.c (cache_system_info):
9672 * w32.c (sys_rename):
9673 * w32proc.c (find_child_console, sys_kill): All users changed.
9675 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9677 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9679 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9681 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9683 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9685 Cleanup statistics calculation in Fgarbage_collect.
9686 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9687 Fix zombies percentage calculation. Simplify elapsed time calculation.
9689 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9691 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9692 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9693 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9694 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9695 (replace_range, replace_range_2, del_range_2): Change to eassert.
9696 * marker.c (byte_char_debug_check): Adjust style.
9698 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9700 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9701 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9702 long-ago-commented-out code that talks about "WIN32".
9703 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9706 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9708 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9709 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9710 Simplify by using alignof.
9711 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9712 * lisp.h: Include <stdalign.h>.
9713 (GCALIGNMENT): New macro and constant.
9714 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9715 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9716 (stdalign): New macro, if not already defined.
9718 2012-07-28 Eli Zaretskii <eliz@gnu.org>
9720 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9721 * w32inevt.c: Include w32inevt.h.
9722 (w32_read_console_input): New inline function, calls either
9723 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9724 w32_console_unicode_input.
9725 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9726 (w32_kbd_patch_key, key_event): Use the codepage returned by
9727 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9728 (key_event): use uChar.UnicodeChar only if
9729 w32_console_unicode_input is non-zero.
9731 * w32console.c: Include w32heap.h.
9732 <w32_console_unicode_input>: New global variable.
9733 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9734 family of Windows, zero otherwise.
9736 * w32inevt.h: Declare w32_console_unicode_input.
9738 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9739 --without-x. (Bug#11742)
9741 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9743 Adjust GDB to reflect pvec_type changes (Bug#12036).
9744 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
9745 2012-07-04 changes to pseudovector representation.
9746 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
9748 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
9750 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9752 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9754 2012-07-27 Eli Zaretskii <eliz@gnu.org>
9756 * alloc.c (listn): Fix the order the arguments are consed onto the
9759 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9760 enumeration constants, as PURE and HEAP are too general, and clash
9761 with other headers and sources, such as gmalloc.c and the
9762 MS-Windows system headers. All users changed.
9764 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9766 Revert last save_excursion_save and save_excursion_restore changes.
9767 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9768 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9770 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9772 Fix recently-introduced typos in Windows port.
9773 Reported by Martin Rudalics <rudalics@gmx.at>.
9774 * w32.c (init_environment): Replace comma with semicolon.
9775 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
9777 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9779 Improve GDB symbol export (Bug#12036).
9780 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9781 arms of an 'if', not using conditional expressions; otherwise GDB
9782 complains about the types in the unevaluated arm when the argument
9783 is an integer literal.
9784 (xgetint): Simplify expression.
9785 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9786 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9787 Zaretskii in <http://bugs.gnu.org/12036#13>.
9788 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9789 needed now that we have gdb_make_enums_visible.
9790 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9791 (enum enum_USE_LSB_TAG):
9792 New enum types, packaging up enums that need to be exported to GDB.
9794 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9796 Utility function to make a list from specified amount of objects.
9797 * lisp.h (enum constype): New datatype.
9798 (listn): New prototype.
9799 * alloc.c (listn): New function.
9800 (Fmemory_use_count, syms_of_alloc): Use it.
9801 * buffer.c (syms_of_buffer): Likewise.
9802 * callint.c (syms_of_callint): Likewise.
9803 * charset.c (define_charset_internal): Likewise.
9804 * coding.c (syms_of_coding): Likewise.
9805 * keymap.c (syms_of_keymap): Likewise.
9806 * search.c (syms_of_search): Likewise.
9807 * syntax.c (syms_of_syntax): Likewise.
9808 * w32.c (init_environment): Likewise.
9809 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9810 * xdisp.c (syms_of_xdisp): Likewise.
9811 * xfns.c (syms_of_xfns): Likewise.
9813 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9815 Fast save_excursion_save and save_excursion_restore.
9816 * lisp.h (struct Lisp_Excursion): New data type.
9817 (PVEC_EXCURSION): New pseudovector type.
9818 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9819 to deal with it. Adjust comments.
9820 (init_marker, attach_marker): New prototype.
9821 (unchain_marker): Adjust prototype.
9822 * marker.c (attach_marker): Change to global.
9823 (init_marker): New function.
9824 * alloc.c (Fmake_marker, build_marker): Use it.
9825 (build_marker): More easserts.
9826 (mark_object): Handle struct Lisp_Excursion.
9827 * editfns.c (save_excursion_save, save_excursion_restore):
9828 Reimplement to use struct Lisp_Excursion. Add comments.
9830 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9832 Fix export of symbols to GDB (Bug#12036).
9833 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9834 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9835 emacs.c, as this is a more-suitable home. Had this been done earlier
9836 the fix for 12036 would have avoided some of the problems noted in
9837 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9838 would have been more obvious.
9839 * emacs.c: Do not include <verify.h>; no longer needed.
9840 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
9841 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9842 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9843 Remove; now done in lisp.h.
9844 * lisp.h (PUBLISH_TO_GDB): New macro.
9845 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9846 (DATA_SEG_BITS): Use it.
9847 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9848 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9849 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9850 not be usable in #if. This simplifies things.
9852 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
9854 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9856 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9858 Simplify export of symbols to GDB (Bug#12036).
9859 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9860 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9861 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9862 Adjust to changes in lisp.h and emacs.c, by using
9863 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9864 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9865 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9866 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9867 instead of gdb_valbits.
9868 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9869 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9870 instead of gdb_array_mark_flag.
9871 (xboolvector): Get size from $->size, not $->header.size.
9872 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9873 (xreload, hook-run, hookpost-run): Remove.
9874 * emacs.c: Include <verify.h>.
9875 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9876 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9878 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9879 (gdb_USE_LSB_TAG): New enum constants.
9880 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9881 Also define these as enum constants, so they're visible to GDB.
9882 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9883 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9884 as constants, so they're visible to GDB.
9885 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9886 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9887 Now enum constants, not macros, so they're visible to GDB.
9888 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9889 more convenient now. All uses changed.
9890 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9891 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9893 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9895 Explicitly free restriction data that are not needed anymore.
9896 * editfns.c (save_restriction_restore): Free restriction data.
9898 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9900 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9901 add argument, tune behavior, and adjust all callers.
9903 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9905 Use typedef for EMACS_INT, EMACS_UINT.
9906 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9907 than macros. This simplifies debugging in the usual case, since
9908 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9909 and it allows expressions involving EMACS_INT casts.
9910 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9912 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9914 * nsterm.m (ns_read_socket): Return early if there is a modal
9917 2012-07-25 Martin Rudalics <rudalics@gmx.at>
9919 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9920 that FOCUS-FRAME can be omitted.
9922 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9924 Adjust buffer text indirection counters at the end of Fkill_buffer.
9925 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9926 buffer is definitely dead. This should really fix an issue reported
9927 by Christoph Scholtes again. (Bug#12007).
9928 (init_buffer_once): Initialize indirection counters of
9929 buffer_defaults and buffer_local_symbols (for sanity and safety).
9931 2012-07-24 Eli Zaretskii <eliz@gnu.org>
9933 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9934 and continuation glyphs on tooltip frames, leave them at zero.
9935 Avoids continued lines in tooltips. (Bug#11832)
9937 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9939 Simplify copy_overlay.
9940 * buffer.c (copy_overlay): Simplify. Use build_marker.
9941 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9943 2012-07-23 Eli Zaretskii <eliz@gnu.org>
9945 * print.c (print_object): Don't crash when a frame's name is nil
9946 or invalid. (Bug#12025)
9948 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9949 it signals an error when a tooltip frame is being created.
9951 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9953 Cleanup miscellaneous objects allocation and initialization.
9954 * alloc.c (allocate_misc): Change to static. Add argument to
9955 specify the subtype. Adjust comment and users.
9956 (build_overlay): New function.
9957 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9958 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9959 (allocate_misc): Remove prototype.
9960 (build_overlay): Add prototype.
9962 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9964 Swap buffer text indirection counters in Fbuffer_swap_text.
9965 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9966 This avoids crash reported by Christoph Scholtes at
9967 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9969 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9971 * nsmenu.m (Popdown_data): New struct.
9972 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9974 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9975 (initWithContentRect): Make imgView and contentView non-static
9976 and autorelease them. Also autorelease img and matrix (Bug#12005).
9977 (dealloc): Remove (Bug#12005).
9979 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9981 Adjust consing_since_gc when objects are explicitly freed.
9982 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9983 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9984 (free_cons, free_misc): Subtract object size from consing_since_gc.
9986 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9988 Simplify and cleanup markers positioning code.
9989 * marker.c (attach_marker): More useful eassert.
9990 (live_buffer, set_marker_internal): New function.
9991 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9992 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9994 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9996 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9997 as it's limited by the amount of memory, not by INT_MAX.
9999 2012-07-21 Eli Zaretskii <eliz@gnu.org>
10001 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10002 in special-event-map. See the discussion at
10003 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10006 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
10007 info.dwItemData. Fixes crashes on 64-bit Windows.
10008 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
10010 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10012 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
10013 (conversationIdentifier): Return value is NSInteger.
10014 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
10016 2012-07-21 Chong Yidong <cyd@gnu.org>
10018 * window.c (decode_any_window): Signal an error if the window is
10019 on a dead frame (Bug#11984).
10021 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10023 Add indirection counting to speed up Fkill_buffer.
10024 * buffer.h (struct buffer): New member.
10025 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10026 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10027 base buffer indirection counter.
10028 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10029 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10030 through buffer list if indirection counter is 0.
10032 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10034 Extend the value returned by Fgarbage_collect with heap statistics.
10035 * alloc.c (Qheap): New symbol.
10036 (syms_of_alloc): DEFSYM it.
10037 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10038 (Fmemory_free): Remove.
10039 (syms_of_alloc): Don't defsubr it.
10040 * buffer.c (Fcompact_buffer): Remove.
10041 (syms_of_buffer): Don't defsubr it.
10043 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10045 Make maybe_gc inline.
10046 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10047 * lisp.h (consing_since_gc, gc_relative_threshold)
10048 (memory_full_cons_threshold): Revert declaration.
10049 (maybe_gc): Remove prototype, define as inline.
10050 * alloc.c: Remove old commented-out code.
10051 (consing_since_gc, gc_relative_threshold)
10052 (memory_full_cons_threshold): Revert to global.
10053 (maybe_gc): Remove.
10055 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10057 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10058 * lisp.h (build_unibyte_string): New function.
10059 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10060 * sysdep.c, w32fns.c, xfns.c: Use it.
10061 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10062 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10063 Adjust users accordingly.
10064 * font.h (font_open_by_name): Adjust prototype.
10066 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10068 Cleanup calls to Fgarbage_collect.
10069 * lisp.h (maybe_gc): New prototype.
10070 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10071 Remove declarations.
10072 * alloc.c (maybe_gc): New function.
10073 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10075 * bytecode.c (MAYBE_GC): Use maybe_gc.
10076 * eval.c (eval_sub, Ffuncall): Likewise.
10077 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10078 to avoid dependency from auto-save feature.
10080 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10082 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10083 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10084 'for_each_per_buffer_object_at'.
10085 All uses changed. It's better to use upper-case for macros that
10086 cannot be implemented as functions, to give the reader a clue
10087 that they're special.
10089 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10091 * alloc.c (Fgarbage_collect): Tweak docstring.
10093 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10095 Tweak the value returned from Fgarbage_collect again.
10096 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10097 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10098 Adjust documentation.
10099 (total_vector_bytes): Rename to total_vector_slots, adjust
10101 (total_free_vector_bytes): Rename to total_free_vector_slots,
10103 (Qstring_bytes, Qvector_slots): New symbols.
10104 (syms_of_alloc): DEFSYM them.
10106 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10108 Buffer compaction primitive which may be used from Lisp.
10109 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10110 (syms_of_buffer): Register Fcompact_buffer.
10111 * alloc.c (Fgarbage_collect): Use compact_buffer.
10112 * buffer.h (compact_buffer): New prototype.
10113 (struct buffer_text): New member.
10115 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10117 New macro to iterate over all buffers, miscellaneous cleanups.
10118 * lisp.h (all_buffers): Remove declaration.
10119 * buffer.h (all_buffers): Add declaration, with comment.
10120 (for_each_buffer): New macro.
10121 * alloc.c (Fgarbage_collect, mark_object): Use it.
10122 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10123 (init_buffer): Likewise.
10124 * data.c (Fset_default): Likewise.
10125 * coding.c (code_conversion_restore): Remove redundant check
10127 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10129 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10131 Fix bug that created negative-length intervals.
10132 * intervals.c (merge_interval_right, merge_interval_left):
10133 Do not zero out this interval if it is absorbed by its children,
10134 as this interval's total length doesn't change in that case. See
10135 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10137 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10139 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10140 when invoking (make-bool-vector N t) and N is a positive
10141 multiple of 8 -- the last 8 bits were mistakenly cleared.
10143 Remove some struct layout assumptions in bool vectors.
10144 * alloc.c (bool_header_size): New constant.
10145 (header_size, word_size): Move earlier, as they're now used earlier.
10146 Use 'word_size' in a few more places, where it's appropriate.
10147 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10148 padding before the data member of a bool vector.
10149 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10150 than doing the check by hand with an abort ().
10152 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10154 * eval.c (Fdefvar): Don't check constants since we only set the var if
10155 it's not yet defined anyway (bug#11904).
10157 * lisp.h (last_undo_boundary): Declare new var.
10158 * keyboard.c (command_loop_1): Set it.
10159 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10160 were auto-added by the command loop (bug#11774).
10162 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10164 * w32font.c (Qsymbol): Remove local definition.
10165 (syms_of_w32font): Don't DEFSYM it.
10167 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10169 Fix sweep_vectors to handle large bool vectors correctly.
10170 * alloc.c (sweep_vectors): Account total_vector_bytes for
10171 bool vectors larger than VBLOCK_BYTES_MAX.
10173 2012-07-18 Chong Yidong <cyd@gnu.org>
10175 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10176 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10178 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10180 Return more descriptive data from Fgarbage_collect.
10181 Suggested by Stefan Monnier in
10182 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10183 * alloc.c (bounded_number): New function.
10184 (total_buffers, total_vectors): New variable.
10185 (total_string_size): Rename to total_string_bytes, adjust users.
10186 (total_vector_size): Rename to total_vector_bytes, adjust users.
10187 (sweep_vectors): Account total_vectors and total_vector_bytes.
10188 (Fgarbage_collect): New return value. Adjust documentation.
10189 (gc_sweep): Account total_buffers.
10190 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10191 (VECTOR_SIZE): Remove.
10192 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10193 (Qinterval, Qmisc): New symbols.
10194 (syms_of_data): Initialize them.
10195 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10196 (Qcons, Qbuffer): New declarations.
10198 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10200 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10201 Round up, not down. Improve doc.
10203 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10205 Restore old code in allocate_string_data to avoid Faset breakage.
10206 Reported by Julien Danjou <julien@danjou.info> in
10207 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10208 * alloc.c (allocate_string_data): Restore old code with minor
10209 adjustments, fix comment to explain this subtle issue.
10211 2012-07-17 Eli Zaretskii <eliz@gnu.org>
10213 Remove FILE_SYSTEM_CASE.
10214 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10216 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10217 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10218 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10219 call-process-region passes it through expand-file-name.
10221 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10223 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10225 Fix crash when creating indirect buffer (Bug#11917)
10226 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10227 Don't handle unbound variables specially if non-zero.
10228 (Fbuffer_local_variables): Pass zero.
10229 (clone_per_buffer_values): Pass non-zero.
10231 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10233 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10234 to make the loop interruptible.
10236 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10238 * gnutls.c (emacs_gnutls_handshake): Only retry if
10239 GNUTLS_E_INTERRUPTED.
10241 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10243 Cleanup and convert miscellaneous checks to eassert.
10244 * alloc.c (mark_interval): Fix comment, partially rephrase
10245 old comment from intervals.h (see below).
10246 * intervals.c (find_interval, adjust_intervals_for_insertion)
10247 (delete_interval, adjust_intervals_for_deletion)
10248 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10249 Convert to eassert.
10250 (adjust_intervals_for_insertion, make_new_interval):
10251 Remove obsolete and unused code.
10252 * intervals.h (struct interval): Remove obsolete comment.
10253 * textprotp.c (erase_properties): Remove unused code.
10254 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10255 (Fremove_list_of_text_properties): Convert to eassert.
10257 2012-07-17 Chong Yidong <cyd@gnu.org>
10259 * editfns.c (Finsert_char): Doc fix.
10261 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10263 Fix previous change to make Fmemory_free always accurate.
10264 * alloc.c (make_interval): Update total_free_intervals.
10265 (make_float): Likewise for total_free_floats.
10266 (free_cons, Fcons): Likewise for total_free_conses.
10267 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10268 Likewise for total_free_vector_bytes.
10269 (Fmake_symbol): Likewise for total_free_symbols.
10270 (bytes_free): Remove.
10272 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10274 Simple free memory accounting feature.
10275 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10276 (sweep_vectors): Accumulate size of free vectors.
10277 (Fgarbage_collect): Setup bytes_free.
10278 (Fmemory_free): New function.
10279 (syms_of_alloc): Register it.
10281 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10283 Cleanup overlays checking.
10284 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10285 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10286 eassert and OVERLAYP.
10287 (sort_overlays): Change to use OVERLAYP.
10289 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10291 * editfns.c (Finsert_char): Make it interactive, and make the
10292 second arg optional. Copy interactive spec and docstring from
10295 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10297 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10298 Unlike the other wrapped functions, fabs has an unspecified
10301 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10303 * nsterm.m (keyDown): Interpret flags without left/right bits
10304 as the left key (Bug#11670).
10306 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10308 Remove empty and useless init functions.
10309 * lisp.h (init_character_once, init_fns, init_image)
10310 (init_filelock, init_sound): Remove prototype.
10311 * character.c (init_character_once): Remove.
10312 * filelock.c (init_filelock): Likewise.
10313 * fns.c (init_fns): Likewise.
10314 * image.c (init_image): Likewise.
10315 * sound.c (init_sound): Likewise.
10316 * emacs.c (main): Adjust accordingly.
10318 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10320 * gtkutil.h: Tiny cleanups.
10321 (use_old_gtk_file_dialog): Remove useless declaration.
10322 (xg_uses_old_file_dialog): Add suggested const attribute.
10324 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10326 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10327 (bidi_paragraph_init): Use it to limit search forward for a strong
10328 directional character in abnormally large paragraphs full of
10329 neutral or weak characters. (Bug#11943)
10331 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10333 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10334 the toolbar (Bug#9451).
10335 (xg_make_tool_item): Give the widget event box a transparent
10338 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10340 Cleanup basic allocation variables and functions.
10341 * alloc.c (ignore_warnings, init_intervals, init_float)
10342 (init_cons, init_symbol, init_marker): Remove.
10343 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10344 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10345 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10346 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10347 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10348 (staticidx, init_alloc_once, init_strings, free_ablock):
10349 Remove redundant initialization.
10350 * fns.c (init_weak_hash_tables): Remove.
10351 * lisp.h (init_weak_hash_tables): Remove prototype.
10353 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10355 Use zero_vector where appropriate.
10356 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10358 * lisp.h (zero_vector): New declaration.
10359 * font.c (null_vector): Remove.
10360 (syms_of_font): Remove initialization and staticpro.
10361 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10362 * keymap.c (Faccessible_keymaps): Likewise.
10364 2012-07-15 Leo Liu <sdl.web@gmail.com>
10366 * fringe.c: Fix typo in comments.
10368 2012-07-14 Leo Liu <sdl.web@gmail.com>
10370 * fringe.c: Add a new bitmap exclamation-mark.
10372 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10374 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10376 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10377 (HAVE_MENUS): Don't define, defined by editing config.in with
10379 (GMALLOC_INHIBIT_VALLOC): Don't define.
10380 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10382 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10384 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10386 2012-07-14 Glenn Morris <rgm@gnu.org>
10388 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10389 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10390 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10392 2012-07-13 Glenn Morris <rgm@gnu.org>
10394 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10396 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10397 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10399 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10401 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10402 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10403 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10404 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10406 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10407 as boolean expression.
10408 (x_set_window_size): Remove unused variable toolbar.
10409 (ns_get_color_default, ns_mod_to_lisp): Remove.
10410 (ns_mouse_position): Remove unused variables xchar and ychar.
10411 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10412 (ns_set_vertical_scroll_bar): Remove unused variable count.
10413 (ns_delete_terminal): Remove unused variable i.
10414 (ns_term_init): Remove unused variables r, g and b.
10415 (mouseDown): Remove unused variable window.
10416 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10417 (initFrameFromEmacs): Remove unused variable vbextra.
10418 (mouseEntered): Remove unused variables p and dpyinfo.
10419 (mouseExited): Remove unused variables p and r.
10420 (ns_define_frame_cursor, ns_clear_frame_area)
10421 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10422 (menuDown): Assign [sender tag] to variable and cast the variable.
10424 * nsterm.h (menuDown): Add id as type to argument sender.
10425 (ns_display_info_for_name): Add Lisp_Object argument.
10426 (ns_term_init): Add Lisp_Object argument.
10427 (ns_map_event_to_object): Add void argument.
10428 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10429 prototype with arguments and only declare if __OBJC__.
10430 (nxatoms_of_nsselect): Add void argument.
10431 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10432 (ns_alloc_autorelease_pool): Add void argument.
10433 (ns_release_autorelease_pool): Add void* argument.
10434 (ns_get_defaults_value): Add const char* argument.
10436 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10437 (initFromContents): Use SSDATA where appropriate.
10438 (ns_update_menubar): Add braces to ambigous if-else.
10439 (initWithTitle): Put () around assignment in if statement.
10440 (ns_menu_show): Remove unused variables window and keymap.
10441 (update_frame_tool_bar): Remove unused variable selected_p.
10442 (initWithContentRect): Remove unused variable this_cmd_name.
10444 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10446 (setXBMColor): Remove unused variable len.
10447 (setPixmapData): Put () around assignment in loop statement.
10449 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10450 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10452 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10453 around assignment in loop statement.
10454 (nsfont_open): Remove unused variable i.
10455 (nsfont_open): Remove unused variable len.
10456 (nsfont_draw): Remove unused variable cs.
10458 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10459 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10460 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10461 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10462 (Fns_font_name, Fns_perform_service)
10463 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10464 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10465 (ns_set_name): Remove unused variable view.
10466 (x_set_menu_bar_lines): Remove unused variable olines.
10467 (x_set_tool_bar_lines): Remove unused variable root_window.
10468 (Fns_list_colors): Put () around assignment in while statement.
10469 (Fns_perform_service): Remove unused variable len.
10470 (Fns_display_usable_bounds): Remove unused variable top.
10471 (syms_of_nsfns): Remove unused variable i.
10473 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10474 memcpy (Bug#11907).
10476 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10478 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10479 and free it with DestroyExceptionInfo (Bug#11558).
10481 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10483 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10484 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10485 Set here, not in nt/config.nt.
10487 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10489 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10490 cursor overflow into the last glyph on display line when the right
10491 fringe is off. (Bug#11832)
10493 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10495 * xdisp.c (produce_special_glyphs): Now static.
10496 * dispextern.h (produce_special_glyphs): Remove decl.
10498 2012-07-13 Glenn Morris <rgm@gnu.org>
10500 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10501 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10503 * s/usg5-4-common.h (USG, USG5):
10504 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10505 * s/sol2-6.h (SOLARIS2):
10506 * s/irix6-5.h (IRIX6_5):
10507 * s/hpux10-20.h (USG, USG5, HPUX):
10508 * s/gnu-linux.h (USG, GNU_LINUX):
10509 * s/freebsd.h (BSD_SYSTEM):
10510 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10511 * s/cygwin.h (CYGWIN):
10512 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10513 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10515 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10517 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10519 2012-07-13 Glenn Morris <rgm@gnu.org>
10521 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10523 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10525 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10526 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10528 2012-07-12 Glenn Morris <rgm@gnu.org>
10530 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10532 * process.c (init_process_emacs): Rename from init_process.
10533 The old name is also the name of a Mach system call.
10534 * lisp.h, emacs.c: Update for this name change.
10535 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10538 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10540 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10541 memmove call that removes glyphs covered by the left truncation
10542 glyph. Improve commentary.
10543 (display_line): Fix display of continuation glyphs on GUI frames
10544 when the right fringe is turned off and variable-size fonts are
10545 used in the window. Move the code that appends a stretch glyph to
10546 produce_special_glyphs, so that it could be used for truncation
10547 and continuation glyphs alike.
10548 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10549 glyph of a suitably computed width, to align the special glyphs at
10550 the window margin. Code moved from display_line. (Bug#11832)
10552 2012-07-12 Glenn Morris <rgm@gnu.org>
10554 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10556 * s/gnu-linux.h, s/hpux10-20.h:
10557 Do not unconditionally define HAVE_XRMSETDATABASE.
10559 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10561 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10563 Fix typos that broke OS X build.
10564 Reported by Randal L. Schwartz in
10565 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10566 * nsterm.m (ns_timeout): Add missing local decl.
10567 (ns_get_color): snprintf -> sprintf, to fix typo.
10569 2012-07-12 Glenn Morris <rgm@gnu.org>
10571 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10572 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10573 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10574 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10576 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10577 Move PTY_OPEN to configure.
10579 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10580 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10581 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10583 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10585 Use empty_unibyte_string where applicable.
10586 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10587 * lread.c (read1): Likewise.
10588 * xsettings.c (syms_of_xsettings): Likewise.
10590 2012-07-12 Glenn Morris <rgm@gnu.org>
10592 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10593 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
10594 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10595 * s/hpux10-20.h (RUN_TIME_REMAP):
10596 * s/bsd-common.h (TABDLY): Move to configure.
10598 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10600 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10602 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10603 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
10605 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
10607 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10608 * s/template.h: Move NARROWPROTO to configure.
10610 2012-07-11 Glenn Morris <rgm@gnu.org>
10612 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10613 unused since 2011-01-17 change to systty.h.
10615 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10616 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10617 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10619 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10621 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10623 2012-07-11 Glenn Morris <rgm@gnu.org>
10625 * s/darwin.h, s/gnu-linux.h, s/template.h:
10626 Move INTERRUPT_INPUT to configure.
10628 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10630 Minor adjustments to interning code.
10631 * lisp.h (intern, intern_c_string): Redefine as static inline
10632 wrappers for intern_1 and intern_c_string_1, respectively.
10633 (intern_1, intern_c_string_1): Rename prototypes.
10634 * lread.c (intern_1, intern_c_string_1, oblookup):
10635 Simplify Vobarray checking.
10636 * font.c (font_intern_prop): Likewise. Adjust comment.
10637 * w32font.c (intern_font_name): Likewise.
10639 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10641 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10643 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10644 of Fcar/Fcdr if possible.
10645 * font.c (check_otf_features): Likewise.
10646 * fontset.c (Fnew_fontset): Likewise.
10647 * gnutls.c (Fgnutls_boot): Likewise.
10648 * minibuf.c (read_minibuf): Likewise.
10649 * msdos.c (IT_set_frame_parameters): Likewise.
10650 * xmenu.c (Fx_popup_dialog): Likewise.
10651 * w32menu.c (Fx_popup_dialog): Likewise.
10653 2012-07-11 Glenn Morris <rgm@gnu.org>
10655 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10656 since nothing has defined it on these platforms.
10658 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10659 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10661 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10662 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10663 Move CLASH_DETECTION to configure.
10665 * s/gnu.h: Remove file, which is now empty.
10667 * s/gnu.h, s/gnu-linux.h:
10668 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10670 2012-07-11 John Wiegley <johnw@newartisans.com>
10672 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10673 function attribute, so we only use it if it exists in the
10676 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10678 Avoid call to strlen in fast_c_string_match_ignore_case.
10679 * search.c (fast_c_string_match_ignore_case): Change to use
10680 length argument. Adjust users accordingly.
10681 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10683 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10685 Assume mkdir, rmdir.
10686 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10687 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10690 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10693 * s/hpux10-20.h (HAVE_PERROR): Remove.
10694 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10695 Remove dummy definition, as this problem was obsolete long ago.
10698 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10700 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10702 Avoid calls to strlen in font processing functions.
10703 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
10704 (font_open_by_name): Change to use length argument.
10705 Adjust users accordingly.
10706 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10708 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10709 Change to return ptrdiff_t.
10710 (xfont_list_pattern, xfont_match): Use length returned by
10711 xfont_decode_coding_xlfd.
10712 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10714 2012-07-11 Glenn Morris <rgm@gnu.org>
10716 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10717 Move DONT_REOPEN_PTY to configure.
10719 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10720 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10722 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10724 Remove "#define unix" that is no longer needed (Bug#11905).
10725 * s/aix4-2.h (unix): Remove; no longer needed.
10727 EMACS_TIME simplification (Bug#11875).
10728 This replaces macros (which typically do not work in GDB)
10729 with functions, typedefs and enums, making the code easier to debug.
10730 The functional style also makes code easier to read and maintain.
10731 * systime.h: Include <sys/time.h> on all hosts, not just if
10732 WINDOWSNT, since 'struct timeval' is needed in general.
10733 (EMACS_TIME): Now a typedef, not a macro.
10734 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10736 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10737 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10738 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10739 (EMACS_TIME_LE): Now functions, not macros.
10740 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10741 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10742 which are not functions. All uses rewritten to use:
10743 (make_emacs_time): New function.
10744 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10745 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10746 not functions. All uses rewritten to use the following, respectively:
10747 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10748 (add_emacs_time, sub_emacs_time): New functions.
10749 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
10750 * fileio.c (Fcopy_file):
10751 * xterm.c (XTflash): Get the current time closer to when it's used.
10752 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10754 * bytecode.c (targets): Suppress -Woverride-init warnings.
10756 Simplify by avoiding confusing use of strncpy etc.
10757 * doc.c (Fsnarf_documentation):
10758 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10759 * frame.c (Fmake_terminal_frame):
10760 * gtkutil.c (get_utf8_string):
10762 * nsmenu.m (ns_update_menubar):
10763 * regex.c (regerror):
10764 Prefer memcpy to strncpy and strncat when either will do.
10765 * fileio.c (Fsubstitute_in_file_name):
10766 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10767 (menu_separator_name_p):
10768 * nsmenu.m (ns_update_menubar):
10769 Prefer memcmp to strncmp when either will do.
10770 * nsterm.m: Include <ftoastr.h>.
10772 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10773 Prefer snprintf to strncpy.
10774 * nsterm.m (ns_term_init):
10775 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10776 * nsterm.m (ns_term_init):
10777 Avoid the need for strncpy, by using build_string or
10778 make_unibyte_string directly. Use dtoastr, not snprintf.
10779 * process.c (Fmake_network_process): Diagnose service names that
10780 are too long, rather than silently truncating them or creating
10781 non-null-terminated names.
10782 (Fnetwork_interface_info): Likewise, for interface names.
10783 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10784 Prefer sprintf to strncat.
10785 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10786 Prefer vsnprintf to vsprintf + strncpy.
10788 2012-07-10 Glenn Morris <rgm@gnu.org>
10790 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10791 Clarify fallback case.
10793 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10795 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10796 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10797 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
10798 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
10799 where argument type is known to be a Lisp_Cons.
10801 2012-07-10 Tom Tromey <tromey@redhat.com>
10803 * bytecode.c (BYTE_CODE_THREADED): New macro.
10804 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10805 (enum byte_code_op): New type.
10806 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10807 (exec_byte_code): Use them. Use token threading when applicable.
10809 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10811 Optimize pure C strings initialization.
10812 * lisp.h (make_pure_string): Fix prototype.
10813 (build_pure_c_string): New function, defined as static inline. This
10814 provides a better opportunity to optimize away calls to strlen when
10815 the function is called with compile-time constant argument.
10816 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10817 argument, adjust users accordingly. Use build_pure_c_string where
10819 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10820 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10821 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10823 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10825 Avoid calls to strlen in miscellaneous functions.
10826 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10827 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10828 * lread.c (openp): Likewise.
10830 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10832 Avoid calls to strlen in path processing functions.
10833 * fileio.c (file_name_as_directory): Add comment. Change to add
10834 srclen argument and return the length of result. Adjust users
10836 (directory_file_name): Fix comment. Change to add srclen argument,
10837 swap 1st and 2nd arguments to obey the common convention.
10838 Adjust users accordingly.
10839 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10841 2012-07-10 Glenn Morris <rgm@gnu.org>
10843 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10844 Move PENDING_OUTPUT_COUNT definition to configure.
10846 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10847 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10848 * s/gnu.h (DATA_START): Move definitions to configure.
10850 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10851 We include usg5-4-common.h, which defines them both.
10853 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10854 O_RDONLY already includes it).
10856 Stop ns builds setting the EMACSLOADPATH environment variable.
10857 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10858 Now it does not set EMACSLOADPATH, just returns the load-path string.
10859 * nsterm.h: Update accordingly.
10860 * lread.c [HAVE_NS]: Include nsterm.h.
10861 (init_lread) [HAVE_NS]: Use ns_load_path.
10862 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10864 2012-07-09 Glenn Morris <rgm@gnu.org>
10866 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10867 since the included bsd-common.h does so.
10869 Stop ns builds setting the EMACSPATH environment variable.
10870 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10871 (ns_init_paths): Do not set EMACSPATH.
10872 * nsterm.h (ns_exec_path): Add it.
10873 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10876 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10878 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10880 * process.c (wait_reading_process_output): 'waitchannels' was unset
10881 when read_kbd || !NILP (wait_for_cell); fix this.
10883 Add GCC-style 'const' attribute to functions that can use it.
10884 * character.h (char_resolve_modifier_mask):
10885 * keyboard.h (make_ctrl_char):
10886 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10887 (init_character_once, next_almost_prime, init_fns, init_image)
10888 (flush_pending_output, init_sound):
10889 * mem-limits.h (start_of_data):
10890 * menu.h (finish_menu_items):
10891 Add ATTRIBUTE_CONST.
10892 * emacs.c (DEFINE_DUMMY_FUNCTION):
10893 Declare the dummy function with ATTRIBUTE_CONST.
10894 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10895 Add decls with ATTRIBUTE_CONST.
10897 Minor improvements to make_formatted_string.
10898 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10899 where int is good enough, as vsprintf returns an int.
10900 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10902 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10904 Use make_formatted_string to avoid double length calculation.
10905 * lisp.h (make_formatted_string): New prototype.
10906 * alloc.c (make_formatted_string): New function.
10907 * buffer.c (Fgenerate_new_buffer_name): Use it.
10908 * dbusbind.c (syms_of_dbusbind): Likewise.
10909 * editfns.c (Fcurrent_time_zone): Likewise.
10910 * filelock.c (get_boot_time): Likewise.
10911 * frame.c (make_terminal_frame, set_term_frame_name)
10912 (x_report_frame_params): Likewise.
10913 * image.c (gs_load): Likewise.
10914 * minibuf.c (get_minibuffer): Likewise.
10915 * msdos.c (dos_set_window_size): Likewise.
10916 * process.c (make_process): Likewise.
10917 * xdisp.c (ensure_echo_area_buffers): Likewise.
10918 * xsettings.c (apply_xft_settings): Likewise.
10920 2012-07-09 Glenn Morris <rgm@gnu.org>
10922 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10923 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10924 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10925 * nsterm.h (ns_etc_directory): Add it.
10926 * callproc.c [HAVE_NS]: Include nsterm.h.
10927 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10929 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10931 Move marker debugging code under MARKER_DEBUG.
10932 * marker.c (MARKER_DEBUG): Move marker debugging code under
10933 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10934 for bootstrap with --enable-checking (~3x slowdown reported
10935 by Juanma Barranquero <lekktu@gmail.com>).
10936 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10938 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10940 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10941 See <http://bugs.gnu.org/11825#29>.
10943 2012-07-08 Eli Zaretskii <eliz@gnu.org>
10945 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10946 has no font, use the frame's font. (Bug#11813)
10947 (display_line): Add commentary about displaying truncation glyphs
10949 (produce_special_glyphs): Move here from term.c.
10951 * term.c (produce_special_glyphs): Move to xdisp.c.
10953 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10956 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10958 * xdisp.c (display_line): Avoid warning about implicit declaration
10961 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10963 * lisp.h: Remove empty conditional.
10965 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10967 * lread.c (load_path_check): Now static.
10969 Fix some minor --with-ns problems found by static checking.
10970 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10971 (x_set_font) [!HAVE_X_WINDOWS]:
10972 * image.c (xpm_load_image) [HAVE_NS]:
10973 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10974 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10975 Remove unused local.
10976 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10977 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10978 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10979 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10980 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10981 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10982 Fix pointer signedness problem.
10983 * xfaces.c (FRAME_X_FONT_TABLE):
10984 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10986 2012-07-07 Glenn Morris <rgm@gnu.org>
10988 * lread.c (load_path_check): New function, split from init_lread.
10989 (init_lread): Reorganize. Motivation:
10990 If EMACSLOADPATH is set, check/warn about that rather than the
10991 defaults, which we are not going to use. Hence we can remove
10992 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10993 Don't warn if site-lisp directories are missing.
10994 If not installed, start from a blank load-path, since
10995 PATH_LOADSEARCH refers to the eventual installation directories.
10997 2012-07-07 Eli Zaretskii <eliz@gnu.org>
10999 Support truncation and continuation glyphs on GUI frames, when
11000 fringes are disabled. (Bug#11832)
11001 * xdisp.c (init_iterator): Get dimensions of truncation and
11002 continuation glyphs even if on GUI frames.
11003 Adjust it->last_visible_x on GUI frames when the left or right fringes,
11004 or both, are absent.
11005 (start_display, move_it_in_display_line_to): Handle the case of a
11006 GUI frame without a fringe to display continuation or truncation
11008 (insert_left_trunc_glyphs): Support GUI frames: make sure
11009 truncation glyphs overwrite enough glyphs from the current line to
11010 have sufficient space in pixels.
11011 (display_line): Support truncation and continuation glyphs on GUI
11012 frames. If some spare pixels are left on the line after inserting
11013 the truncation glyphs, fill that space with a stretch glyph of a
11014 suitably computed width.
11016 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11017 produce_glyphs, to support GUI sessions.
11019 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11021 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11023 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11025 Do not require float-time's arg to fit in time_t (Bug#11825).
11026 This works better on hosts where time_t is unsigned, and where
11027 float-time is applied to the (negative) difference between two times.
11028 * editfns.c (decode_time_components): Last arg is now double *,
11029 not int *, and means to store all the result as a double, without
11030 worrying about whether the seconds part fits in time_t.
11031 All callers changed.
11032 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11033 All callers changed.
11034 (Ffloat_time): Do not fail merely because the specified time falls
11035 outside of time_t range.
11037 2012-07-07 Glenn Morris <rgm@gnu.org>
11039 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11040 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11041 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11043 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
11045 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11046 Update dependencies.
11048 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11050 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11052 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11053 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11054 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11055 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11056 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11057 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11059 * xfont.c (compare_font_names): Redo to omit the need for casts.
11061 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11063 * xfns.c (Fx_change_window_property): Doc fix.
11064 * w32fns.c (Fx_change_window_property): Doc fix.
11066 * w32fns.c (Fx_window_property): Accept the same arguments as the
11067 X Windows version. Doc fix.
11068 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11070 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
11071 Eli Zaretskii <eliz@gnu.org>
11073 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11074 Windows-specific code from nt/config.nt moved here.
11075 Obsolete settings removed.
11077 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11079 * process.c: Avoid unnecessary calls to gettime.
11080 (wait_reading_process_output): Don't get the time of day
11081 when gobbling data immediately and not waiting, as there's no need
11082 for it in that case. This removes a FIXME.
11084 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11086 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11087 is defined (Bug#11768).
11089 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11091 Fix marker debugging code.
11092 * marker.c (byte_char_debug_check): Do not perform the check
11093 if buffer is not multibyte.
11094 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11095 Call byte_char_debug_check with correct arguments.
11097 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11099 Compile marker debugging code only if ENABLE_CHECKING is defined.
11100 * marker.c (byte_char_debug_check, count_markers):
11101 Use only if ENABLE_CHECKING is defined.
11102 (byte_debug_flag): Remove.
11103 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11104 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11106 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11108 Avoid code repetition in marker-related functions.
11109 * marker.c (attach_marker): New function.
11110 (Fset_marker, set_marker_restricted, set_marker_both)
11111 (set_marker_restricted_both): Use it.
11112 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11113 Consistently rename charno to charpos.
11114 (marker_position): Add eassert.
11115 (marker_byte_position): Convert to eassert.
11117 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11119 Simplify list operations in unchain_overlay and unchain_marker.
11120 * buffer.c (unchain_overlay): Simplify. Add comment.
11121 * marker.c (unchain_marker): Simplify. Fix comments.
11123 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11125 Introduce fast path for the widely used marker operation.
11126 * alloc.c (build_marker): New function.
11127 * lisp.h (build_marker): New prototype.
11128 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11129 * composite.c (autocmp_chars): Likewise.
11130 * editfns.c (buildmark): Remove.
11131 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11132 (save_restriction_save): Use build_marker.
11133 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11134 * window.c (save_window_save): Likewise.
11136 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11138 Do not use Fdelete_overlay in delete_all_overlays
11139 to avoid redundant calls to unchain_overlay.
11140 * buffer.c (drop_overlay): New function.
11141 (delete_all_overlays, Fdelete_overlay): Use it.
11142 * minibuf.c (get_minibuffer): Fix comment.
11144 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11146 Port to OpenBSD 5.1 amd64.
11147 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11148 This is needed for OpenBSD, and should be harmless on all BSD systems.
11149 Also, include <sys/sysctl.h>, as it should be available on all
11150 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11151 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11152 use p_pid member, not kp_proc.pid.
11154 2012-07-06 Glenn Morris <rgm@gnu.org>
11156 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11158 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11160 More xmalloc and related cleanup.
11161 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11162 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11163 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11164 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11165 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11166 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11167 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11168 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11169 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11171 Omit needless casts involving void * pointers and allocation.
11172 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11173 as the former is more robust if P's type is changed.
11174 Prefer xzalloc to xmalloc + memset 0.
11175 Simplify malloc-or-realloc to realloc.
11176 Don't worry about xmalloc returning a null pointer.
11177 Prefer xstrdup to xmalloc + strcpy.
11178 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11180 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11181 alloca of a constant.
11183 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11185 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11186 hscroll is larger than the line width. Fixes long and futile
11187 looping inside extend_face_to_end_of_line (on a TTY) producing
11188 glyphs that are not needed and thrown away.
11190 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11192 * marker.c (set_marker_restricted_both): Simplify by using
11195 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11197 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11199 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11201 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11202 not defined (Bug#11768).
11203 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11204 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11205 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11206 followed by gtk_box_set_homogeneous (Bug#11768).
11207 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11208 (update_theme_scrollbar_width, xg_create_scroll_bar):
11209 Use gtk_scrollbar_new (Bug#11768).
11210 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11211 (is_box_type): New function (Bug#11768).
11212 (xg_tool_item_stale_p): Call is_box_type.
11213 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11214 with default display (Bug#11768).
11216 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11218 * xdisp.c (window_hscroll_limited): New function.
11219 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11220 coordinates when window's hscroll is set to insanely large
11221 values. (Bug#11857)
11223 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
11225 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11226 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11228 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11231 * lisp.h (xzalloc): New prototype. Omit needless casts.
11232 * alloc.c (xzalloc): New function. Omit needless casts.
11233 * charset.c: Omit needless casts. Convert all calls to
11234 xmalloc with following memset to xzalloc.
11235 * dispnew.c: Likewise.
11236 * fringe.c: Likewise.
11237 * image.c: Likewise.
11238 * sound.c: Likewise.
11239 * term.c: Likewise.
11240 * w32fns.c: Likewise.
11241 * w32font.c: Likewise.
11242 * w32term.c: Likewise.
11243 * xfaces.c: Likewise.
11244 * xfns.c: Likewise.
11245 * xterm.c: Likewise.
11246 * atimer.c: Omit needless casts.
11247 * buffer.c: Likewise.
11248 * callproc.c: Likewise.
11250 * coding.c: Likewise.
11251 * composite.c: Likewise.
11253 * doprnt.c: Likewise.
11254 * editfns.c: Likewise.
11255 * emacs.c: Likewise.
11256 * eval.c: Likewise.
11257 * filelock.c: Likewise.
11259 * gtkutil.c: Likewise.
11260 * keyboard.c: Likewise.
11261 * lisp.h: Likewise.
11262 * lread.c: Likewise.
11263 * minibuf.c: Likewise.
11264 * msdos.c: Likewise.
11265 * print.c: Likewise.
11266 * process.c: Likewise.
11267 * region-cache.c: Likewise.
11268 * search.c: Likewise.
11269 * sysdep.c: Likewise.
11270 * termcap.c: Likewise.
11271 * terminal.c: Likewise.
11272 * tparam.c: Likewise.
11273 * w16select.c: Likewise.
11275 * w32reg.c: Likewise.
11276 * w32select.c: Likewise.
11277 * w32uniscribe.c: Likewise.
11278 * widget.c: Likewise.
11279 * xdisp.c: Likewise.
11280 * xmenu.c: Likewise.
11281 * xrdb.c: Likewise.
11282 * xselect.c: Likewise.
11284 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11286 * fileio.c (time_error_value): Check the right error number.
11287 Problem reported by Troels Nielsen in
11288 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11290 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11292 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11293 This should be fixed in a better way; see Eli Zaretskii in
11294 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11295 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11297 * fileio.c (time_error_value): Rename from special_mtime.
11298 The old name's problems were noted by Eli Zaretskii in
11299 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11301 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11302 This variable's comment says Emacs needs at least one GDB-visible
11303 symbol of type enum pvec_type, to work around GDB problems.
11304 The symbol's value doesn't matter.
11306 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11307 that causes compilation to fail on pre-C99 compilers.
11309 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11311 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11312 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11314 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11316 * buffer.c (init_buffer_once): Fix initialization of
11317 headers for buffer_defaults and buffer_local_symbols.
11318 Reported by Juanma Barranquero <lekktu@gmail.com>.
11320 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11322 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11323 * lisp.h (enum pvec_type): Use fewer bits.
11324 (PSEUDOVECTOR_SIZE_BITS): New constant.
11325 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11326 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11327 change in pvec_type.
11328 (PSEUDOVECTOR_TYPEP): New macro.
11329 (TYPED_PSEUDOVECTORP): Use it.
11330 * fns.c (internal_equal): Adapt code to extract pvectype.
11331 * emacs.c (gdb_pvec_type): Update type.
11332 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11333 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11334 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11335 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11336 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11337 abusing vector->header.next.nbytes.
11338 (live_vector_p): Use PVEC_TYPE.
11339 (mark_object): Adapt code to extract pvectype. Use switch.
11341 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11343 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11344 Tighten new eassert a bit.
11346 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11348 Fix compilation with --enable-gcc-warnings and -O1
11349 optimization level.
11350 * doprnt.c (doprnt): Change type of tem to int, initialize
11351 to avoid compiler warning. Add eassert.
11352 * search.c (simple_search): Initialize match_byte to avoid
11353 compiler warning. Add eassert.
11355 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11357 Avoid weird behavior with large horizontal scrolls.
11358 Without this change, for example, large hscroll values would
11359 mess up Emacs's display on Fedora 15 x86, presumably due to
11360 overflows in int calculations in the display code.
11361 Also, if buffers had long lines, Emacs would freeze.
11362 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11363 (set_window_hscroll): New function, containing the old guts of
11364 Fset_window_hscroll. Return the clipped value.
11365 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11366 This avoids the need to check against PTRDIFF_MAX.
11368 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11370 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11372 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11374 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11376 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11377 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11378 since GCC 4.4.6 issues a bogus warning for them.
11380 Fix bugs in file timestamp newness comparisons.
11381 * fileio.c (Ffile_newer_than_file_p):
11382 * lread.c (Fload): Use full timestamp resolution of files,
11383 not just the 1-second resolution, so that files that are only
11384 slightly newer still count as newer.
11385 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11386 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11388 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11390 * fileio.c: Improve handling of file time marker. (Bug#11852)
11391 (special_mtime): New function.
11392 (Finsert_file_contents, Fverify_visited_file_modtime):
11393 Use it to set special mtime values consistently.
11395 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11397 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11398 marker for non-existing file. (Bug#11852)
11400 2012-07-03 Glenn Morris <rgm@gnu.org>
11402 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11403 and did not make it into globals.h).
11405 2012-07-03 Tom Tromey <tromey@redhat.com>
11407 * window.c (Fset_window_margins, Fset_window_fringes)
11408 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11409 * textprop.c (Fprevious_property_change): No longer static.
11410 * syntax.c (Fsyntax_table_p): No longer static.
11411 * process.c (Fget_process, Fprocess_datagram_address): No longer
11413 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11414 * keyboard.c (Fcommand_execute): No longer static.
11416 * insdel.c (Fcombine_after_change_execute): No longer static.
11417 * image.c (Finit_image_library): No longer static.
11418 * fileio.c (Fmake_symbolic_link): No longer static.
11419 * eval.c (Ffetch_bytecode): No longer static.
11420 * editfns.c (Fuser_full_name): No longer static.
11421 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11423 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11425 * dired.c (Ffile_attributes): No longer static.
11426 * composite.c (Fcomposition_get_gstring): No longer static.
11427 * callproc.c (Fgetenv_internal): No longer static.
11429 * ccl.h: Remove EXFUNs.
11430 * buffer.h: Remove EXFUNs.
11431 * dispextern.h: Remove EXFUNs.
11432 * intervals.h: Remove EXFUNs.
11433 * fontset.h: Remove EXFUN.
11434 * font.h: Remove EXFUNs.
11435 * dosfns.c (system_process_attributes): Remove EXFUN.
11436 * keymap.h: Remove EXFUNs.
11437 * lisp.h: Remove EXFUNs.
11438 * w32term.h: Remove EXFUNs.
11439 * window.h: Remove EXFUNs.
11440 * xsettings.h: Remove EXFUN.
11441 * xterm.h: Remove EXFUN.
11443 2012-07-03 Glenn Morris <rgm@gnu.org>
11445 * lisp.h (Frandom): Make it visible to C.
11446 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11447 buffer for invisible buffers. (Bug#1229)
11449 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11451 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11452 values which aren't power of 2.
11453 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11454 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11457 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11459 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11461 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11463 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11465 * alloc.c (allocate_vector_block): Remove redundant
11466 calls to mallopt if DOUG_LEA_MALLOC is defined.
11467 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11468 avoid calls to mallopt if zero_vector is returned.
11470 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11472 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11473 is enabled, avoid dereferencing NULL current_sblock if
11476 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11478 Cleanup basic buffer management.
11479 * buffer.h (struct buffer): Change layout to use generic vector
11480 marking code. Fix some comments. Change type of 'clip_changed'
11481 to bitfield. Remove unused #ifndef old.
11482 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11483 (GET_OVERLAYS_AT): Fix indentation.
11484 (for_each_per_buffer_object_at): New macro.
11485 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11486 (Fbuffer_local_variables): Use it.
11487 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11488 * alloc.c (allocate_buffer): Adjust to match new layout of
11489 struct buffer. Fix comment.
11490 (mark_overlay): New function.
11491 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11492 Lisp area of struct buffer.
11493 (mark_object): Use it. Adjust marking of misc objects
11494 and related comments.
11496 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11498 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11499 wrapper that is not needed because the wrapped code is a no-op (zero
11500 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11501 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11503 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11505 * alloc.c (mark_buffer): Simplify. Remove prototype.
11506 (mark_object): Add comment. Reorganize marking of vector-like
11507 objects. Use CHECK_LIVE for all vector-like objects except buffers
11508 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11509 Avoid redundant calls to mark_vectorlike for bool vectors.
11511 2012-06-30 Glenn Morris <rgm@gnu.org>
11513 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11515 * epaths.in (PATH_SITELOADSEARCH): New.
11516 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11517 This is rather than relying on --enable-locallisppath elements
11518 having "site-lisp" in their names. (Bug#10208#25, 11658)
11520 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11522 * w32proc.c (sys_select): Accept and ignore one more argument.
11524 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11526 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11527 (pselect) [!MS_DOS]: Redirect to sys_select.
11529 * sysdep.c: Don't include dos.h and dosfns.h.
11531 * process.c (sys_select):
11532 * msdos.c (sys_select): Accept one more argument and ignore it.
11534 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11535 adapt data types and code to that.
11538 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11539 which clashes with the gnulib function of the same name.
11541 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11543 * font.c (font_style_to_value, font_style_symbolic)
11544 (font_prop_validate_style): Add type checks for values in
11547 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11549 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11552 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11554 * xdisp.c (try_window_id): Undo last change.
11556 * w32.c (getwd): Adjust commentary about startup_dir.
11557 (init_environment): Always call sys_access, even in non-MSVC
11558 builds. Don't chdir to the directory of the Emacs executable.
11559 This undoes code from 1997 which was justified by the need to
11560 "avoid conflicts when removing and renaming directories". But its
11561 downside was that every relative file name was being interpreted
11562 relative to the directory of the Emacs executable, which can never
11563 be TRT. In particular, it broke sys_access when called with
11564 relative file names.
11565 (sys_access): Map GetLastError to errno.
11567 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11569 * window.h (struct window): Change type of 'fringes_outside_margins'
11570 to bitfield. Fix comment. Adjust users accordingly.
11571 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
11573 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11576 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
11578 * gnutls.c (emacs_gnutls_handshake):
11579 Add QUIT to make the loop interruptible.
11581 2012-06-29 Glenn Morris <rgm@gnu.org>
11583 * charset.c (init_charset): Make lack of etc/charsets fatal.
11585 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11587 * editfns.c (region_limit): Fix type mismatch.
11589 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11591 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11592 undefined. Convert from xassert to eassert.
11593 * nsmenu.m: Convert from xassert to eassert.
11594 * nsterm.m: Likewise.
11596 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11598 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11600 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11602 Avoid integer overflow on scroll-left and scroll-right.
11603 * window.c (HSCROLL_MAX): New macro.
11604 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11605 overflow when requested scroll falls outside ptrdiff_t range.
11607 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11609 * window.h (struct window): Change type of 'hscroll',
11610 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11611 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11612 Adjust users accordingly.
11613 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11614 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11615 from EMACS_INT to ptrdiff_t.
11616 (make_window): Omit redundant initialization.
11618 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
11620 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11622 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11624 * window.h (struct window): Change type of 'use_time' and
11625 'sequence_number' from Lisp_Object to int.
11626 * frame.c (make_frame): Adjust users accordingly.
11627 * print.c (print_object): Likewise.
11628 * window.c (select_window, Fwindow_use_time, make_parent_window)
11629 (make_window): Likewise.
11631 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11633 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11634 enabled with --enable-checking=[all,glyphs] configure option.
11635 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11636 adjust comments accordingly.
11637 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11638 undefined, adjust comments accordingly.
11639 * image.c: Likewise.
11640 * scroll.c: Likewise.
11641 * w32fns.c: Likewise.
11642 * w32term.c: Likewise.
11643 * xdisp.c: Likewise.
11644 * xfaces.c: Likewise.
11645 * xfns.c: Likewise.
11646 * xterm.c: Likewise.
11648 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11650 Generalize run-time debugging checks.
11651 * dispextern.h (XASSERTS): Remove.
11652 * fontset.c (xassert): Remove.
11653 Convert from xassert to eassert.
11654 * alloc.c: Convert from xassert to eassert.
11655 * bidi.c: Likewise.
11656 * dispnew.c: Likewise.
11658 * fringe.c: Likewise.
11659 * ftfont.c: Likewise.
11660 * gtkutil.c: Likewise.
11661 * image.c: Likewise.
11662 * keyboard.c: Likewise.
11663 * menu.c: Likewise.
11664 * process.c: Likewise.
11665 * scroll.c: Likewise.
11666 * sound.c: Likewise.
11667 * term.c: Likewise.
11668 * w32console.c: Likewise.
11669 * w32fns.c: Likewise.
11670 * w32term.c: Likewise.
11671 * window.c: Likewise.
11672 * xdisp.c: Likewise.
11673 * xfaces.c: Likewise.
11674 * xfns.c: Likewise.
11675 * xselect.c: Likewise.
11676 * xterm.c: Likewise.
11678 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11680 * fns.c (maybe_resize_hash_table): Output message when growing the
11683 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11685 * alloc.c (allocate_string_data): Remove dead code.
11686 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11687 avoid GCC warning about unused macro.
11689 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11691 * alloc.c (allocate_string): Omit intervals initialization.
11692 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11693 as in make_pure_string and make_pure_c_string.
11695 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11697 * alloc.c (allocate_string): Fix last change.
11699 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11701 * alloc.c (allocate_string): Remove two redundant calls
11702 to memset, add explicit initialization where appropriate.
11704 2012-06-27 Glenn Morris <rgm@gnu.org>
11706 * lisp.mk (lisp): Remove paths.elc.
11708 2012-06-27 Chong Yidong <cyd@gnu.org>
11710 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11712 2012-06-26 John Wiegley <johnw@newartisans.com>
11714 * unexmacosx.c (copy_data_segment): Add two section names used
11715 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11717 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11718 when building with Clang.
11720 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11722 * eval.c (Fapply): Allow calling it with a single argument.
11724 2012-06-26 Eli Zaretskii <eliz@gnu.org>
11726 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11727 _stricmp and _strnicmp.
11728 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11730 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11732 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11734 (allocate_process): Likewise for new process.
11735 (allocate_terminal): Change to use offsetof.
11736 (allocate_frame): Likewise.
11737 * frame.c (make_frame): Omit redundant initialization.
11738 * window.c (make_parent_window): Use memset.
11739 (make_window): Omit redundant initialization.
11740 * process.c (make_process): Omit redundant initialization.
11741 * terminal.c (create_terminal): Likewise.
11743 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11745 * term.c (delete_tty): Remove redundant call to memset.
11747 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11749 * alloc.c: Remove build_string.
11750 * lisp.h: Define build_string as static inline. This provides
11751 a better opportunity to optimize away calls to strlen when the
11752 function is called with compile-time constant argument.
11753 * image.c (imagemagick_error): Convert to build_string.
11754 * w32proc.c (sys_spawnve): Likewise.
11755 * xterm.c (x_term_init): Likewise.
11757 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11759 Use sprintf return value instead of invoking strlen on result.
11760 In the old days this wasn't portable, since some sprintf
11761 implementations returned char *. But they died out years ago and
11762 Emacs already assumes sprintf returns int.
11763 Similarly for float_to_string.
11764 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11765 * ccl.c (ccl_driver):
11766 * character.c (string_escape_byte8):
11767 * data.c (Fnumber_to_string):
11768 * doprnt.c (doprnt):
11769 * print.c (print_object):
11770 * xdisp.c (message_dolog):
11771 * xfns.c (syms_of_xfns):
11772 Use sprintf or float_to_string result to avoid need to call strlen.
11773 * data.c (Fnumber_to_string):
11774 Use make_unibyte_string, since the string must be ASCII.
11775 * lisp.h, print.c (float_to_string): Now returns int length.
11776 * term.c (produce_glyphless_glyph):
11777 Use sprintf result rather than recomputing it.
11779 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11780 * Makefile.in (ALL_CFLAGS):
11781 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11782 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11784 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11786 * dispextern.h (xstrcasecmp): Define to library function
11787 strcasecmp if available.
11788 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11790 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11792 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11793 Avoid comma operator.
11794 * menu.c (push_submenu_start, push_submenu_end)
11795 (push_left_right_boundary, push_menu_pane): Likewise.
11796 * msdos.c (dos_rawgetc): Likewise.
11798 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11800 * xfns.c (xic_create_fontsetname): Remove redundant calls
11803 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11805 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11806 sprintf already null-terminates its output.
11808 * xfns.c (x_window): Remove redundant cast.
11810 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11812 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11813 `const char *' to `char *' to avoid compiler warning.
11815 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11817 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11818 instead of truncating it to 63 (admittedly a generous limit).
11820 * process.c: Fix spelling and caps in comments.
11822 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11824 * emacs.c (setpgrp): Remove definition, unused.
11825 * sysdep.c (setpgrp): Remove definition, not used in this file.
11827 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
11829 * makefile.w32-in: Update dependencies.
11831 2012-06-24 Eli Zaretskii <eliz@gnu.org>
11833 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11834 (SYSTIME_H): Add nt/inc/sys/time.h.
11836 * systime.h [WINDOWSNT]: Include sys/time.h.
11838 * s/ms-w32.h (struct timespec): Definition moved from
11839 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11841 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11843 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11844 * buffer.h (buffer_slot_type_mismatch):
11845 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11846 * eval.c (unwind_to_catch):
11847 * image.c (my_png_error, my_error_exit):
11848 * keyboard.c (quit_throw_to_read_char, user_error)
11849 (Fexit_recursive_edit, Fabort_recursive_edit):
11850 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11851 (wrong_type_argument, buffer_overflow, __executable_start)
11852 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11853 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11854 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11856 (child_setup) [!DOS_NT]:
11857 * lread.c (end_of_file_error, invalid_syntax):
11858 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11859 * puresize.h (pure_write_error):
11860 * search.c (matcher_overflow):
11861 * sound.c (sound_perror, alsa_sound_perror):
11862 * sysdep.c, syssignal.h (croak):
11863 * term.c (maybe_fatal, vfatal):
11864 * textprop.c (text_read_only):
11865 * undo.c (user_error):
11866 * unexmacosx.c (unexec_error):
11867 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11868 Use _Noreturn rather than NO_RETURN.
11869 No need for separate decl merely because of _Noreturn.
11870 * sound.c (sound_warning, parse_sound):
11871 Remove unnecessary forward decls.
11873 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11875 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11876 * lisp.h (WAIT_READING_MAX): New macro.
11877 * dispnew.c (Fsleep_for, sit_for):
11878 * keyboard.c (kbd_buffer_get_event):
11879 * process.c (Faccept_process_output):
11880 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11881 This improves on the previous patch, which introduced a bug
11882 when time_t is unsigned and as wide as intmax_t.
11883 See <http://bugs.gnu.org/9000#51>.
11885 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11887 * dispnew.c (sit_for, Fsleep_for):
11888 * keyboard.c (kbd_buffer_get_event):
11889 * process.c (Faccept_process_output): Avoid compiler warnings when
11890 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11892 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
11894 * makefile.w32-in: Update dependencies.
11896 * w32.c (ltime): Add return type and declare static.
11897 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11899 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11901 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11902 Privately reported by Herbert J. Skuhra.
11903 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11905 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11906 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11908 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11910 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11911 last argument of make_unibyte_string.
11913 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11914 language ID in the event parameters.
11916 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11917 event.code, not the obscure "character set ID".
11919 2012-06-23 Chong Yidong <cyd@gnu.org>
11921 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11923 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11925 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11926 * w32.c (fdutimens): New function.
11928 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11930 * s/ms-w32.h (pselect): Redirect to sys_select.
11932 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11934 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11935 in the logic of incrementing and decrementing the value of
11936 use_relocatable_buffers.
11938 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11940 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11941 Privately reported by Herbert J. Skuhra.
11942 [__FreeBSD__]: Remove "*/" typo after "#include".
11943 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11944 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11945 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11946 Don't assume EMACS_TIME and struct timeval are the same type.
11948 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11950 Support higher-resolution time stamps (Bug#9000).
11951 The time stamps are only nanosecond-resolution at the C level,
11952 since that's the best that any real-world system supports now.
11953 But they are picosecond-resolution at the Lisp level, as that's
11954 easy, and leaves room for future OS improvements.
11956 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11959 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11960 Don't get current time unless it's needed.
11962 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11963 now provides it if it's absent.
11964 (start_atimer): Port to higher-res time stamps.
11965 Check for time stamp overflow. Don't get current time more
11966 often than is needed.
11968 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11969 Include systime.h, not time.h.
11970 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11972 * dired.c: Include stat-time.h.
11973 (Ffile-attributes): File times now have higher resolution.
11975 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11976 (struct image): Timestamp now has higher resolution.
11978 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11979 has at least microseconds now. All uses removed.
11980 (update_frame, update_single_window, update_window, update_frame_1)
11981 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
11982 (duration_to_sec_usec): Remove; no longer needed.
11984 * editfns.c (time_overflow): Now extern.
11985 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11986 (float-time, Fformat_time_string, Fcurrent_time_string)
11987 (Fcurrent_time_zone): Accept and generate higher-resolution
11989 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11990 (decode_time_components, lisp_seconds_argument): New functions.
11991 (make_time): Now static.
11992 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11993 Report an error if the time is invalid, rather than having the caller
11996 * fileio.c: Include <stat-time.h>
11997 (Fcopy_file): Copy higher-resolution time stamps.
11998 Prefer to set the time stamp via a file descriptor if that works.
11999 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12000 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12001 (Fvisited_file_modtime, Fset_visited_file_modtime):
12002 Support higher-resolution time stamps.
12004 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12006 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12008 * image.c (prepare_image_for_display, clear_image_cache)
12009 (lookup_image): Port to higer-resolution time stamps.
12011 * keyboard.c (start_polling, bind_polling_period):
12012 Check for time stamp overflow.
12013 (read_char, kbd_buffer_get_event, timer_start_idle)
12014 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12015 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12016 Port to higher-resolution time stamps. Do not assume time_t is signed.
12017 (decode_timer): New function. Timers are now vectors of length 9,
12018 not 8, to accommodate the picosecond component.
12019 (timer_check_2): Use it.
12021 * nsterm.m (select_timeout, timeval_subtract): Remove.
12022 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12023 as they're a bit more accurate and handle overflow better.
12024 (ns_select): Change prototype to be compatible with pselect.
12025 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12026 * nsterm.h (ns_select): Adjust prototype.
12028 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12029 us-resolution time stamps.
12030 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12032 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12034 * lisp.h (time_overflow): New decl.
12035 (wait_reading_process_output): First arg is now intmax_t, not int,
12036 to accommodate larger waits.
12038 * process.h (struct Lisp_Process.read_output_delay):
12039 Now counts nanoseconds, not microseconds.
12040 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12042 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12043 (wait_reading_process_output):
12044 Port to ns-resolution time stamps.
12045 (Faccept_process_output, wait_reading_process_output):
12046 Check for time stamp overflow. Do not assume time_t is signed.
12047 (select_wrapper): Remove; we now use pselect.
12048 (Fprocess_attributes): Now generates ns-resolution time stamps.
12050 * sysdep.c: Include utimens.h. Don't include utime.h
12051 or worry about struct utimbuf; gnulib does that for us now.
12052 (gettimeofday): Remove; gnulib provides a substitute.
12053 (make_timeval): New function.
12054 (set_file_times): Now sets ns-resolution time stamps.
12055 New arg FD; all uses changed.
12056 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12057 (system_process_attributes):
12058 Now returns ns-resolution time stamp. All uses changed.
12059 Check for time stamp overflow.
12061 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12062 provides a substitute now.
12064 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12065 since it guarantees struct timespec.
12066 (EMACS_TIME): Now struct timespec, so that we can support
12067 ns-resolution time stamps.
12068 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12069 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12070 (EMACS_USECS): Remove.
12071 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12072 so multiply the arg by 1000 before storing it.
12073 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12075 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12076 Port to ns-resolution time stamps.
12077 (EMACS_TIME_NEG_P): Remove; replaced by....
12078 (EMACS_TIME_SIGN): New macro.
12079 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12080 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12081 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12082 (make_timeval, make_lisp_time, decode_time_components): New decls.
12083 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12084 that it mishandled time_t overflow. You can't compare by subtracting!
12085 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12086 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12088 * term.c: Include <sys/time.h>.
12089 (timeval_to_Time): New function, for proper overflow wraparound.
12090 (term_mouse_position, term_mouse_click): Use it.
12092 * undo.c (record_first_change): Support higher-resolution time stamps
12093 in the undo buffer.
12094 (Fprimitive_undo): Use them when restoring time stamps.
12096 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12097 (w32_get_internal_run_time):
12098 Port to higher-resolution Emacs time stamps.
12099 (ltime): Now accepts single 64-bit integer, as that's more convenient
12102 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12104 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12105 for compatibility with pselect. Support ns-resolution time stamps.
12107 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12109 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12110 Check for time stamp overflow, and support ns-resolution time stamps.
12112 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12113 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12114 (timeval_subtract): Remove; no longer needed.
12115 (XTflash, XTring_bell, x_wait_for_event):
12116 Port to ns-resolution time stamps. Don't assume time_t is signed.
12118 2012-06-22 Chong Yidong <cyd@gnu.org>
12120 * xdisp.c (x_consider_frame_title): Revert last change.
12122 2012-06-22 Eli Zaretskii <eliz@gnu.org>
12124 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12125 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12126 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12127 staticidx goes up to 1597 out of 1600 = 0x640.)
12129 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12131 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12132 Otherwise, the umask might be mistakenly 0 while handling input signals.
12134 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12136 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12138 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12140 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12141 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12142 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12143 access to `contents' member of Lisp_Vector objects with AREF and ASET
12146 2012-06-19 Chong Yidong <cyd@gnu.org>
12148 * frame.c (delete_frame): When selecting a frame on a different
12149 text terminal, do not alter the terminal's top-frame.
12151 * xdisp.c (format_mode_line_unwind_data): Record the target
12152 frame's selected window and its terminal's top-frame.
12153 (unwind_format_mode_line): Restore them.
12154 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12156 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12157 since tty frames can be explicitly named.
12158 (prepare_menu_bars): Likewise.
12160 * term.c (Ftty_top_frame): New function.
12162 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12164 Port byte-code-meter to modern targets.
12165 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12166 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12167 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12168 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12169 (METER_1, METER_2): Simplify.
12171 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12173 * data.c (Fdefalias): Return `symbol' (bug#11686).
12175 2012-06-18 Martin Rudalics <rudalics@gmx.at>
12177 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12178 gets killed during executing of this function (Bug#11665).
12179 Try to always return Qt when the buffer has been actually killed.
12180 (Vkill_buffer_query_functions): In doc-string say that functions
12181 run by this hook should not change the current buffer.
12183 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12185 Fix recently-introduced process.c problems found by static checking.
12186 * process.c (write_queue_push, write_queue_pop, send_process):
12187 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12188 (write_queue_pop): Fix pointer signedness problem.
12189 (send_process): Remove unused local.
12191 2012-06-17 Chong Yidong <cyd@gnu.org>
12193 * xdisp.c (redisplay_internal): No need to redisplay terminal
12194 frames that are not on top.
12196 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
12198 * process.c (make_process): Initialize write_queue.
12199 (write_queue_push, write_queue_pop): New functions.
12200 (send_process): Use them to maintain correct ordering of process
12201 writes (Bug#10815).
12203 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12205 * lisp.h (eassert): Assume C89 or later.
12206 This removes the need for CHECK.
12207 (CHECK): Remove. Its comments about always evaluating its
12208 argument were confusing, as 'eassert' typically does not evaluate
12211 * coding.c (produce_chars): Use ptrdiff_t, not int.
12213 * xterm.c (x_draw_underwave): Check for integer overflow.
12214 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12216 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12218 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12219 referenced (Bug#11583).
12221 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12223 Implement wave-style variant of underlining.
12224 * dispextern.h (face_underline_type): New enum.
12225 (face): Add field for underline type.
12226 * nsterm.m (ns_draw_underwave): New function.
12227 (ns_draw_text_decoration): Use it.
12228 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12230 (x_draw_glyph_string): Use them.
12231 * xfaces.c (Qline, Qwave): New Lisp objects.
12232 (check_lface_attrs, merge_face_ref)
12233 (Finternal_set_lisp_face_attribute, realize_x_face):
12234 Handle wave-style underline face attributes.
12235 * xterm.c (x_draw_underwave): New function.
12236 (x_draw_glyph_string): Use it.
12238 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
12240 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12241 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12242 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12243 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12244 ($(BLD)/w32select.$(O)): Update dependencies.
12246 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12248 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12249 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12250 * character.c (_fetch_multibyte_char_p): Remove.
12251 * alloc.c: Include "character.h" before "buffer.h".
12252 * bidi.c: Likewise.
12253 * buffer.c: Likewise.
12254 * bytecode.c: Likewise.
12255 * callint.c: Likewise.
12256 * callproc.c: Likewise.
12257 * casefiddle.c: Likewise.
12258 * casetab.c: Likewise.
12259 * category.c: Likewise.
12260 * cmds.c: Likewise.
12261 * coding.c: Likewise.
12262 * composite.c: Likewise.
12263 * dired.c: Likewise.
12264 * dispnew.c: Likewise.
12266 * dosfns.c: Likewise.
12267 * editfns.c: Likewise.
12268 * emacs.c: Likewise.
12269 * fileio.c: Likewise.
12270 * filelock.c: Likewise.
12271 * font.c: Likewise.
12272 * fontset.c: Likewise.
12273 * fringe.c: Likewise.
12274 * indent.c: Likewise.
12275 * insdel.c: Likewise.
12276 * intervals.c: Likewise.
12277 * keyboard.c: Likewise.
12278 * keymap.c: Likewise.
12279 * lread.c: Likewise.
12280 * macros.c: Likewise.
12281 * marker.c: Likewise.
12282 * minibuf.c: Likewise.
12283 * nsfns.m: Likewise.
12284 * nsmenu.m: Likewise.
12285 * print.c: Likewise.
12286 * process.c: Likewise.
12287 * regex.c: Likewise.
12288 * region-cache.c: Likewise.
12289 * search.c: Likewise.
12290 * syntax.c: Likewise.
12291 * term.c: Likewise.
12292 * textprop.c: Likewise.
12293 * undo.c: Likewise.
12294 * unexsol.c: Likewise.
12295 * w16select.c: Likewise.
12296 * w32fns.c: Likewise.
12297 * w32menu.c: Likewise.
12298 * window.c: Likewise.
12299 * xdisp.c: Likewise.
12300 * xfns.c: Likewise.
12301 * xmenu.c: Likewise.
12303 * xselect.c: Likewise.
12305 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12307 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12308 If all the glyphs of the glyph row came from strings, and we have no
12309 cursor positioning clues, put the cursor on the first glyph of the
12311 (handle_face_prop): Use chunk-relative overlay string index when
12312 indexing into it->string_overlays array. (Bug#11653)
12313 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12314 the rightmost. (Bug#11720)
12316 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12318 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12319 (CATEGORY_MEMBER): Enforce 1/0 value.
12320 * category.c (_temp_category_set): Remove.
12322 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12324 * window.c (Fdelete_other_windows_internal)
12325 (Fdelete_window_internal): Don't access frame's mouse highlight
12326 info of the initial frame. (Bug#11677)
12328 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12330 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12331 Assume USE_2_TAGS_FOR_INTS.
12332 (xreload): Adjust $tagmask width to match recent lisp.h change.
12334 Simplify lisp.h in minor ways that should not affect code.
12335 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12336 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12337 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12338 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12339 (INTTYPEBITS): New macro, for clarity.
12340 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12341 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12342 Simplify now that USE_LSB_TAG is always defined.
12343 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12344 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12346 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12348 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12350 2012-06-13 Glenn Morris <rgm@gnu.org>
12352 * s/bsd-common.h (BSD4_3):
12353 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12355 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12357 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12359 (XLI, XIL): Define.
12360 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12362 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12363 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12364 * alloc.c (widen_to_Lisp_Object): Remove.
12365 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12366 * frame.c (delete_frame): Remove outdated comment.
12367 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12368 USE_LISP_UNION_TYPE.
12369 (Fw32_unregister_hot_key): Likewise.
12370 (Fw32_toggle_lock_key): Likewise.
12371 * w32menu.c (add_menu_item): Likewise.
12372 (w32_menu_display_help): Use XIL instead of checking
12373 USE_LISP_UNION_TYPE.
12374 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12375 (init_heap): Likewise.
12376 * w32term.c (w32_read_socket): Update comment.
12378 2012-06-13 Glenn Morris <rgm@gnu.org>
12380 * s/usg5-4-common.h, src/s/unixware.h:
12381 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12383 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12385 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12387 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12388 * alloc.c (make_number) [!defined make_number]:
12389 Remove, as lisp.h always defines this now.
12390 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12391 (roundup_size): Verify that it is a power of 2.
12392 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12393 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12394 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12395 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12396 USE_LSB_TAG now is always defined to be either 0 or 1.
12398 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12399 code works fine either way, and efficiency is not a concern here,
12400 as the union type is for debugging, not for production.
12401 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12402 Use an inline function on all platforms when using the union type,
12403 since this is simpler and 'static inline' can be used portably
12405 (LISP_INITIALLY_ZERO): New macro.
12406 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12407 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12409 2012-06-12 Glenn Morris <rgm@gnu.org>
12411 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12413 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12415 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12416 Move BROKEN_SIGIO to configure.
12418 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12419 Move NO_TERMIO to configure.
12421 2012-06-12 Chong Yidong <cyd@gnu.org>
12423 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12424 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12425 MagickExportImagePixels is undefined.
12427 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12429 * image.c (imagemagick_load_image): Remove unused label.
12431 2012-06-11 Glenn Morris <rgm@gnu.org>
12433 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12434 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12435 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12436 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12438 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12440 * alloc.c (make_byte_code): New function.
12441 (Fmake_byte_code): Use it. Don't purify here.
12442 * lread.c (read1): Use it as well to avoid extra allocation.
12444 2012-06-11 Chong Yidong <cyd@gnu.org>
12446 * image.c (imagemagick_load_image): Implement transparency.
12448 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12450 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12451 account for preceding backslashes. (Bug#11663)
12453 2012-06-09 Chong Yidong <cyd@gnu.org>
12455 * term.c: Support italics in capable terminals (Bug#9652).
12456 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12457 (turn_on_face): Output using TS_enter_italic_mode if available.
12458 Don't handle unused blinking and alt-charset cases.
12459 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12460 and tty_alt_charset_p cases.
12461 (tty_capable_p, init_tty): Support italics.
12463 * termchar.h (struct tty_display_info): Add field for italics.
12464 Remove unused blink field.
12466 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12469 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12470 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12471 tty_alt_charset_p. Add tty_italic_p.
12473 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12475 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12476 dbus_type_is_basic if available.
12477 (xd_extract_signed, xd_extract_unsigned): Rename from
12478 extract_signed and extract_unsigned, respectively. Adapt callers.
12480 2012-06-09 Chong Yidong <cyd@gnu.org>
12482 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12484 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12487 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12489 * xdisp.c (vmessage): Treat frame message as multibyte.
12490 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12491 would generate the diagnostic "Making \302\247 buffer-local while
12494 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12496 * dispnew.c (showing_window_margins_p): Undo last change, which
12497 was done due to an inadvertent commit.
12498 (adjust_frame_glyphs_for_frame_redisplay): Do call
12499 showing_window_margins_p.
12501 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12503 * eval.c (Fmake_var_non_special): New primitive.
12504 (syms_of_eval): Defsubr it.
12505 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12507 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12509 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12510 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12512 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12514 * alloc.c (allocate_vectorlike): Fix last change.
12516 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12518 Block-based vector allocation of small vectors.
12519 * lisp.h (struct vectorlike_header): New field `nbytes',
12520 adjust comment accordingly.
12521 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12522 to denote vector blocks. Adjust users (live_vector_p,
12523 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12524 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12525 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12526 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12527 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12528 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12529 (roundup_size): New constant.
12530 (struct vector_block): New data type.
12531 (vector_blocks, vector_free_lists, zero_vector): New variables.
12532 (all_vectors): Rename to `large_vectors'.
12533 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12534 (sweep_vectors): New functions.
12535 (allocate_vectorlike): Return `zero_vector' as the only vector of
12536 0 items. Allocate new vector from block if vector size is less than
12537 or equal to VBLOCK_BYTES_MAX.
12538 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12539 (init_alloc_once): Add call to init_vectors.
12541 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12543 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12545 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12547 * doprnt.c (doprnt): Truncate multibyte char correctly.
12548 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12549 would mishandle a string argument "Xc" if X was a multibyte
12550 character of length 2: it would truncate after X's first byte
12551 rather than including all of X.
12553 2012-06-06 Chong Yidong <cyd@gnu.org>
12555 * buffer.c (word_wrap): Doc fix.
12557 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12559 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12561 2012-06-03 Glenn Morris <rgm@gnu.org>
12563 * xdisp.c (tool-bar-style): Doc fix.
12565 2012-06-03 Ulrich Müller <ulm@gentoo.org>
12567 * Makefile.in (PAXCTL): Define.
12568 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12569 binary via PaX flags if the paxctl utility is available.
12570 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12571 Restore PaX flags to their default. (Bug#11398)
12573 2012-06-03 Chong Yidong <cyd@gnu.org>
12575 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12576 buffer (Bug#11226).
12578 2012-06-03 Chong Yidong <cyd@gnu.org>
12580 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12581 (note_mode_line_or_margin_highlight): If there is no help echo,
12582 use mode-line-default-help-echo. Handle the case where the mouse
12583 position is past the end of the mode line string.
12585 * buffer.c (buffer_local_value_1): New function, split from
12586 Fbuffer_local_value; can return Qunbound.
12587 (Fbuffer_local_value): Use it.
12588 (Vmode_line_format): Docstring tweaks.
12590 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12592 * sysdep.c (system_process_attributes): Improve comment.
12594 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12596 * keyboard.c: Export real-this-command to Elisp.
12597 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12598 and DEFVAR it. Update all users.
12600 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12602 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12604 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12605 Convert pctcpu and pctmem to Lisp float properly.
12606 Let the compiler fold better, as 100.0/0x8000 is exact.
12608 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12610 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12613 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12615 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12617 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12619 For a 'struct window', replace some Lisp_Object fields to
12620 bitfields where appropriate, remove unused fields.
12621 * window.h (struct window): Remove unused 'last_mark_x' and
12622 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
12623 change its type from Lisp_Object to bitfield.
12624 Change type of 'force_start', 'optional_new_start',
12625 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
12626 fields from Lisp_Object to bitfield. Adjust users accordingly.
12628 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12630 Pacify gcc -Wdouble-precision when using Xaw.
12631 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12632 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12633 Use 'float' consistently, rather than 'float' in most places
12634 and 'double' in a couple of places.
12636 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12638 * xdisp.c (handle_stop): Detect whether we have overlay strings
12639 loaded by testing it->current.overlay_string_index to be
12640 non-negative, instead of checking whether n_overlay_strings is
12641 positive. (Bug#11587)
12643 2012-05-31 Chong Yidong <cyd@gnu.org>
12645 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12647 * doc.c (Fsubstitute_command_keys): Doc fix.
12649 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12651 * search.c (search_buffer): Remove calls to
12652 r_alloc_inhibit_buffer_relocation, as it is now called by
12653 maybe_unify_char, which was the cause of relocation of buffer text
12656 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12658 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12659 for the duration of call to load_charset, to avoid problems with
12660 callers of maybe_unify_char that access buffer text through C
12663 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12664 decrement the inhibition flag, instead of just setting or
12667 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12669 Remove obsolete '#define static' cruft.
12670 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12671 This #undef was "temporary" in 2000; it is no longer needed
12672 now that '#define static' has gone away.
12673 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12674 (gray_bitmap_bits): Remove; no longer needed.
12675 All uses replaced with definiens.
12676 * xterm.c: Include "bitmaps/gray.xbm".
12678 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12680 Clean up __executable_start, monstartup when --enable-profiling.
12681 The following changes affect the code only when profiling.
12682 * dispnew.c (__executable_start): Rename from safe_bcopy.
12683 Define only on platforms that need it.
12684 * emacs.c: Include <sys/gmon.h> when profiling.
12685 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12686 (__executable_start): Remove decl, since lisp.h does it now.
12687 (safe_bcopy): Remove decl; no longer has that name.
12688 (main): Coalesce #if into single bit of code, for simplicity.
12689 Cast pointers to uintptr_t, since standard libraries want integers
12691 * lisp.h (__executable_start): New decl.
12693 2012-05-31 Glenn Morris <rgm@gnu.org>
12695 * image.c (Fimagemagick_types): Doc fix.
12697 2012-05-30 Jim Meyering <meyering@redhat.com>
12699 * callproc.c (Fcall_process_region): Include directory component
12700 in mkstemp error message (Bug#11586).
12702 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12704 * alloc.c, lisp.h (make_pure_vector): Now static.
12706 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12708 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12709 Move to byte-run.el.
12710 (Fautoload): Do the hash-doc more carefully.
12711 * data.c (Fdefalias): Purify definition, except for keymaps.
12712 (Qdefun): Move from eval.c.
12713 * lisp.h (Qdefun): Remove.
12714 * lread.c (read1): Tiny simplification.
12716 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
12718 Do not create empty overlays with the evaporate property (Bug#9642).
12719 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12720 Bug#9642, but explicitly check that the buffer the overlay would
12721 be moved to is live and rearrange lines to make sure that errors
12722 will not put the overlay in an inconsistent state.
12723 (Fdelete_overlay): Cosmetics.
12725 2012-05-28 Eli Zaretskii <eliz@gnu.org>
12727 * w32term.c (my_bring_window_to_top): New function.
12728 (x_raise_frame): Use handle returned by DeferWindowPos, which
12729 could be different from the original one.
12730 Call my_bring_window_to_top instead of my_set_foreground_window.
12733 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12734 by calling BringWindowToTop.
12736 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12737 (WM_EMACS_END): Increase by one.
12739 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12741 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12742 This avoids undefined behavior that might cause the eassert
12743 to not catch an out-of-range value.
12745 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
12747 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12748 Update dependencies.
12750 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12752 * bidi.c (bidi_mirror_char): Fix last change.
12754 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12756 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12757 when referring to sectname field in printf format.
12759 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12761 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12762 Only r_alloc_inhibit_buffer_relocation needed to be added;
12763 the others were already declared.
12765 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12766 before checking whether it's out of range. Put the check inside
12768 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12770 2012-05-27 Ken Brown <kbrown@cornell.edu>
12772 * callproc.c (Fcall_process): Restore a line that was accidentally
12773 commented out in the 2011-02-13 change (bug#11547).
12775 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12777 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12778 defined on ralloc.c.
12780 * buffer.c [REL_ALLOC]: Remove prototypes of
12781 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12782 they are now on lisp.h.
12784 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12786 * search.c (search_buffer): Use it to inhibit relocation of buffer
12787 text while re_search_2 is doing its job, because re_search_2 is
12788 passed C pointers to buffer text. (Bug#11519)
12790 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12791 Update value to 24.
12793 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12794 state after an additional call to move_it_in_display_line_to, keep
12795 the values of it->max_ascent and it->max_descent found for the
12797 (pos_visible_p): Revert the comparison against bottom_y to what it
12798 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12801 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12803 Fix coding-related core dumps with gcc -ftrapv.
12804 The code was computing A - B, where A and B are pointers, and B is
12805 random garbage. This can lead to core dumps on platforms that
12806 have special pointer registers, and it also leads to core dumps on
12807 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12808 A - B only when B is initialized properly.
12809 * coding.c (coding_set_source, coding_set_destination): Return void.
12810 (coding_change_source, coding_change_destinations): New functions,
12811 with the old behaviors of coding_set_source and coding_set_destination.
12812 All callers that need an offset changed to use these new functions.
12814 2012-05-26 Glenn Morris <rgm@gnu.org>
12816 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12818 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12820 Extend mouse support on W32 text-mode console.
12821 * xdisp.c (draw_row_with_mouse_face):
12822 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
12824 * w32console.c: Include window.h.
12825 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12827 (initialize_w32_display): Initialize mouse-highlight data.
12829 * w32inevt.c: Include termchar.h and window.h.
12830 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12831 moves, call note_mouse_highlight. If help_echo changed, call
12832 gen_help_event to produce help-echo message in the echo area.
12833 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12836 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12838 * lread.c (read1): Simplify slightly to avoid an overflow warning
12839 with GCC 4.7.0 on x86-64.
12841 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12843 * bidi.c (bidi_mirror_char): Revert last change: an int is
12844 definitely wide enough here.
12846 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
12848 Fix integer width and related bugs (Bug#9874).
12849 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
12850 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12851 (string_bytes, check_sblock, allocate_string_data):
12852 (compact_small_strings, Fmake_bool_vector, make_string)
12853 (make_unibyte_string, make_multibyte_string)
12854 (make_string_from_bytes, make_specified_string)
12855 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12856 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12858 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12859 (allocate_pseudovector):
12860 Use int, not EMACS_INT, where int is wide enough.
12861 (inhibit_garbage_collection, Fgarbage_collect):
12862 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12863 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12864 int might not be wide enough.
12865 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12866 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12867 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12868 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12869 (bidi_level_of_next_char, bidi_move_to_visually_next):
12870 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12871 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12872 (Fkill_buffer, Fset_buffer_major_mode)
12873 (advance_to_char_boundary, Fbuffer_swap_text)
12874 (Fset_buffer_multibyte, overlays_at, overlays_in)
12875 (overlay_touches_p, struct sortvec, record_overlay_string)
12876 (overlay_strings, recenter_overlay_lists)
12877 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12878 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12879 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12880 (Foverlay_recenter, last_overlay_modification_hooks_used)
12881 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12882 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12883 (validate_region): Omit unnecessary test for b <= e,
12884 since that's guaranteed by the previous test.
12885 (adjust_overlays_for_delete): Avoid pos + length overflow.
12886 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12887 (report_overlay_modification):
12888 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12889 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12890 Omit pointer cast, which isn't needed anyway, and doesn't work
12891 after the EMACS_INT -> ptrdiff_t change.
12892 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
12893 * buffer.h: Adjust decls to match defn changes elsewhere.
12894 (struct buffer_text, struct buffer):
12895 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12896 Use EMACS_INT, not int, where int might not be wide enough.
12897 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12898 not int, to avoid needless 32-bit limit on 64-bit hosts.
12899 (exec_byte_code): Use tighter memory-full test, one that checks
12900 for alloca overflow. Don't compute the address of the object just
12901 before an array, as that's not portable. Use EMACS_INT, not
12902 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
12903 * callint.c (Fcall_interactively):
12904 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12905 * callproc.c (call_process_kill, Fcall_process):
12906 Don't assume pid_t fits into an Emacs fixnum.
12907 (call_process_cleanup, Fcall_process, child_setup):
12908 Don't assume pid_t fits into int.
12909 (call_process_cleanup, Fcall_process, delete_temp_file)
12910 (Fcall_process_region):
12911 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12912 (Fcall_process): Simplify handling of volatile integers.
12913 Use int, not EMACS_INT, where int will do.
12914 * casefiddle.c (casify_object, casify_region, operate_on_word)
12915 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12916 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12917 (casify_object): Avoid integer overflow when overallocating buffer.
12918 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
12919 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
12920 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12921 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12922 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12923 integers are now checked earlier. All uses replaced with XINT.
12925 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12926 For CCL_MapSingle, check that content and value are in int range.
12927 (ccl_driver, Fregister_code_conversion_map):
12928 Check that Vcode_version_map_vector is a vector.
12929 (resolve_symbol_ccl_program): Check that vector header is in range.
12930 Always copy the vector, so that we can check its contents reliably
12931 now rather than having to recheck each instruction as it's being
12932 executed. Check that vector words fit in 'int'.
12933 (ccl_get_compiled_code, Fregister_ccl_program)
12934 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12935 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12936 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12937 contents are in range.
12938 (Fccl_execute_on_string): Check that status is in range.
12939 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12940 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12941 Accept and return EMACS_INT, not int, because callers can pass values
12942 out of 'int' range.
12943 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12944 (multibyte_chars_in_text, parse_str_as_multibyte)
12945 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12946 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12947 (string_escape_byte8, Fget_byte):
12948 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12949 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
12950 avoid mishandling large integers.
12951 * character.h: Adjust decls to match defn changes elsewhere.
12952 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12953 (Ffind_charset_region):
12954 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12955 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12956 (load_charset_map_from_vector, Fdefine_charset_internal):
12957 Don't assume fixnum fits in int.
12958 (load_charset_map_from_vector, Fmap_charset_chars):
12959 Remove now-unnecessary CHECK_NATNUMs.
12960 (Fdefine_charset_internal): Check ranges here, more carefully.
12961 Don't rely on undefined behavior with signed left shift overflow.
12962 Don't assume unsigned int fits into fixnum, or that fixnum fits
12963 into unsigned int. Don't require max_code to be a valid fixnum;
12964 that's not true for gb10830 4-byte on a 32-bit host. Allow
12965 invalid_code to be a cons, for the same reason. Require code_offset
12966 to be a character. Avoid int overflow if max_char is close
12968 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12969 this is intended anyway and avoids some undefined behavior.
12970 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12971 INDEX_TO_CODE_POINT, as that's what it expects.
12972 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
12973 * charset.h (DECODE_CHAR): Return int, not unsigned;
12974 this is what was intended anyway, and it avoids undefined behavior.
12975 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12976 integer-overflow issues.
12977 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12978 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12979 where the argument is EMACS_INT, and this behavior is not intended.
12980 * chartab.c (Fmake_char_table, Fset_char_table_range)
12981 (uniprop_get_decoder, uniprop_get_encoder):
12982 Don't assume fixnum fits in int.
12983 * cmds.c (move_point): New function, that does the gist of
12984 Fforward_char and Fbackward_char, but does so while checking
12985 for integer overflow more accurately.
12986 (Fforward_char, Fbackward_char): Use it.
12987 (Fforward_line, Fend_of_line, internal_self_insert)
12988 (internal_self_insert):
12989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12990 Fix a FIXME, by checking for integer overflow when calculating
12991 target_clm and actual_clm.
12992 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
12993 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
12994 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12995 (coding_alloc_by_making_gap, alloc_destination)
12996 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12997 (encode_coding_utf_16, detect_coding_emacs_mule)
12998 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12999 (detect_coding_iso_2022, decode_coding_iso_2022)
13000 (encode_invocation_designation, encode_designation_at_bol)
13001 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13002 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13003 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13004 (encode_coding_ccl, encode_coding_raw_text)
13005 (detect_coding_charset, decode_coding_charset)
13006 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13007 (produce_composition, produce_charset, produce_annotation)
13008 (decode_coding, handle_composition_annotation)
13009 (handle_charset_annotation, consume_chars, decode_coding_gap)
13010 (decode_coding_object, encode_coding_object, detect_coding_system)
13011 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13012 (code_convert_region, code_convert_string)
13013 (Fdefine_coding_system_internal)
13014 (coding_set_source, coding_set_destination):
13015 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13016 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13017 (Fdefine_coding_system_internal):
13018 Don't assume fixnums fit in int.
13019 (decode_coding_gap, decode_coding_object, encode_coding_object)
13020 (Fread_coding_system, Fdetect_coding_region)
13021 (Funencodable_char_position, Fcheck_coding_systems_region)
13022 (get_translation, handle_composition_annotation, consume_chars):
13023 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13024 (consume_chars): Rewrite to not calculate an address outside buffer.
13025 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
13026 Don't access memory outside of the args array.
13027 (Fdefine_coding_system_internal): Check for charset-id overflow.
13028 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13029 result of ENCODE_CHAR.
13030 * coding.h: Adjust decls to match defn changes elsewhere.
13031 (struct coding_system):
13032 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13033 * composite.c (get_composition_id, find_composition)
13034 (run_composition_function, update_compositions)
13035 (compose_text, composition_gstring_put_cache)
13036 (composition_gstring_p, composition_gstring_width)
13037 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13038 (composition_compute_stop_pos, composition_reseat_it)
13039 (composition_update_it, struct position_record)
13040 (find_automatic_composition, composition_adjust_point)
13041 (Fcomposition_get_gstring, Ffind_composition_internal):
13042 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13043 (update_compositions):
13044 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13045 * composite.h: Adjust decls to match defn changes elsewhere.
13046 (struct composition):
13047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13048 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13049 Do not attempt to compute the address of the object just before a
13050 buffer; this is not portable.
13052 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13053 (Faset): Use int, not EMACS_INT, where int is wide enough.
13054 (Fstring_to_number): Don't assume fixnums fit in int.
13055 (Frem): Don't assume arg is nonnegative.
13056 * dbusbind.c (xd_append_arg): Check for integers out of range.
13057 (Fdbus_call_method): Don't overflow the timeout int.
13058 (extract_signed, extract_unsigned): New functions.
13059 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13060 (xd_get_connection_references): Return ptrdiff_t, not int.
13062 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13063 (xd_read_message_1):
13064 Use int, not unsigned, where the dbus API uses int.
13065 (Fdbus_message_internal): Don't overflow mtype.
13066 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13067 * dired.c (directory_files_internal, file_name_completion, scmp)
13068 (file_name_completion_stat):
13069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13070 (file_name_completion): Don't overflow matchcount.
13071 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13072 * dispextern.h: Adjust decls to match defn changes elsewhere.
13073 (struct text_pos, struct glyph, struct bidi_saved_info)
13074 (struct bidi_string_data, struct bidi_it, struct composition_it)
13076 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13077 (struct display_pos, struct composition_it, struct it):
13078 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13079 * dispnew.c (increment_matrix_positions)
13080 (increment_row_positions, mode_line_string)
13081 (marginal_area_string):
13082 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13083 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13084 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13085 (duration_to_sec_usec): New function, to check for overflow better.
13086 (Fsleep_for, sit_for): Use it.
13087 * doc.c (get_doc_string, store_function_docstring):
13088 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13089 (get_doc_string, Fsnarf_documentation):
13090 Use int, not EMACS_INT, where int is wide enough.
13092 Use SAFE_ALLOCA, not alloca.
13093 Check for overflow when converting EMACS_INT to off_t.
13094 * doprnt.c (doprnt):
13095 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13096 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13097 Don't assume uid_t fits into fixnum.
13098 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13099 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13100 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13101 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13102 (general_insert_function)
13103 (Finsert_char, make_buffer_string, make_buffer_string_both)
13104 (update_buffer_properties, Fbuffer_substring)
13105 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13106 (Fsubst_char_in_region, check_translation)
13107 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13108 (transpose_markers, Ftranspose_regions):
13109 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13110 (clip_to_bounds): Move to lisp.h as an inline function).
13111 (Fconstrain_to_field): Don't assume integers are nonnegative.
13112 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13113 (Fsubst_char_in_region, Fsave_restriction):
13114 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13115 (Femacs_pid): Don't assume pid_t fits into fixnum.
13116 (lo_time): Use int, not EMACS_INT, when int suffices.
13117 (lisp_time_argument): Check for usec out of range.
13118 (Fencode_time): Don't assume fixnum fits in int.
13119 (Fuser_login_name, Fuser_full_name): Signal an error
13120 if a uid argument is out of range, rather than relying on
13121 undefined behavior.
13122 (Fformat_time_string): Remove now-unnecessary check.
13123 lisp_time_argument checks for out-of-range usec now.
13124 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13125 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13126 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13127 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13128 (init_cmdargs, Fdump_emacs):
13129 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13130 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13131 the bottom (typically) 32 bits of the fixnum.
13132 * eval.c (specpdl_size, call_debugger):
13133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13134 (when_entered_debugger, Fbacktrace_debug):
13135 Don't assume fixnum can fit in int.
13136 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13137 the object just before a buffer; this is not portable.
13138 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13139 (grow_specpdl, unbind_to):
13140 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13141 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13142 (grow_specpdl): Simplify allocation by using xpalloc.
13143 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13144 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13145 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13146 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13147 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13148 (a_write, e_write):
13149 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13150 (Fcopy_file, non_regular_nbytes, read_non_regular)
13151 (Finsert_file_contents):
13152 Use int, not EMACS_INT, where int is wide enough.
13153 (READ_BUF_SIZE): Verify that it fits in int.
13154 (Finsert_file_contents): Check that counts are in proper range,
13155 rather than assuming fixnums fit into ptrdiff_t etc.
13156 Don't assume fixnums fit into int.
13157 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13158 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13159 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13160 (string_char_to_byte, string_byte_to_char)
13161 (string_make_multibyte, string_to_multibyte)
13162 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13163 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13164 (substring_both, Fdelete, internal_equal, Ffillarray)
13165 (Fclear_string, mapcar1)
13166 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13167 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13168 (larger_vector, make_hash_table, maybe_resize_hash_table)
13169 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13170 (Fmaphash, secure_hash):
13171 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13172 (concat): Check for string index and length overflow.
13173 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13175 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13176 (larger_vector): New API (vec, incr_min, size_max) replaces old
13177 one (vec, new_size, init). This catches size overflow.
13178 INIT was removed because it was always Qnil.
13179 All callers changed.
13180 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13181 the upper bound on a hash table index size.
13182 (make_hash_table, maybe_resize_hash_table): Use it.
13183 (secure_hash): Computer start_byte and end_byte only after
13184 they're known to be in ptrdiff_t range.
13185 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13186 (Ffont_get_glyphs, Ffont_at):
13187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13188 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13189 (Flist_fonts, Fopen_font):
13190 Don't assume fixnum can fit in int.
13191 (check_gstring): Don't assume index can fit in int.
13192 (font_match_p): Check that fixnum is a character, not a nonnegative
13193 fixnum, since the later code needs to stuff it into an int.
13194 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13195 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13196 conversion overflow issues.
13197 (Fopen_font): Check for integer out of range.
13198 (Ffont_get_glyphs): Don't assume index can fit in int.
13199 * font.h: Adjust decls to match defn changes elsewhere.
13200 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13202 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13203 printmax_t, where ptrdiff_t is wide enough.
13204 (Finternal_char_font):
13205 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13206 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13207 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13208 (Fset_frame_position, x_set_frame_parameters)
13209 (x_set_line_spacing, x_set_border_width)
13210 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13211 Check that fixnums are in proper range for system types.
13212 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13214 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13215 Use SAFE_ALLOCA_LISP, not alloca.
13216 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13217 intptr_t is wide enough.
13218 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13219 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13220 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13221 Check for fixnum out of range.
13222 * ftfont.c (ftfont_list): Don't assume index fits in int.
13223 Check that fixnums are in proper range for system types.
13224 (ftfont_shape_by_flt):
13225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13226 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13227 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13228 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13229 Check that fixnums are in proper range for system types.
13230 * gnutls.h: Adjust decls to match defn changes elsewhere.
13231 * gtkutil.c (xg_dialog_run):
13232 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13233 (update_frame_tool_bar):
13234 Check that fixnums are in proper range for system types.
13235 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13236 (lookup_image): Check that fixnums are in range for system types.
13237 * indent.c (last_known_column, last_known_column_point):
13238 (current_column_bol_cache):
13239 (skip_invisible, current_column, check_display_width):
13240 (check_display_width, scan_for_column, current_column_1)
13241 (Findent_to, Fcurrent_indentation, position_indentation)
13242 (indented_beyond_p, Fmove_to_column, compute_motion):
13243 (Fcompute_motion, Fvertical_motion):
13244 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13245 (last_known_column_modified): Use EMACS_INT, not int.
13246 (check_display_width):
13248 Check that fixnums and floats are in proper range for system types.
13249 (compute_motion): Don't assume index or fixnum fits in int.
13250 (compute_motion, Fcompute_motion):
13251 Use int, not EMACS_INT, when it is wide enough.
13252 (vmotion): Omit local var start_hpos that is always 0; that way
13253 we don't need to worry about overflow in expressions involving it.
13254 * indent.h: Adjust decls to match defn changes elsewhere.
13256 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13257 Use int, not EMACS_INT, where int is wide enough.
13258 Remove unused members ovstring_chars_done and tab_offset;
13260 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13261 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13262 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13263 (make_gap, copy_text, insert, insert_and_inherit)
13264 (insert_before_markers, insert_before_markers_and_inherit)
13265 (insert_1, count_combining_before, count_combining_after)
13266 (insert_1_both, insert_from_string)
13267 (insert_from_string_before_markers, insert_from_string_1)
13268 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13269 (adjust_after_replace, adjust_after_insert, replace_range)
13270 (replace_range_2, del_range, del_range_1, del_range_byte)
13271 (del_range_both, del_range_2, modify_region)
13272 (prepare_to_modify_buffer, signal_before_change)
13273 (signal_after_change, Fcombine_after_change_execute):
13274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13275 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13276 (balance_an_interval, split_interval_right, split_interval_left)
13277 (find_interval, next_interval, update_interval)
13278 (adjust_intervals_for_insertion, delete_node, delete_interval)
13279 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13280 (static_offset_intervals, offset_intervals)
13281 (merge_interval_right, merge_interval_left, make_new_interval)
13282 (graft_intervals_into_buffer, temp_set_point_both)
13283 (temp_set_point, set_point, adjust_for_invis_intang)
13284 (set_point_both, move_if_not_intangible, get_property_and_range)
13285 (get_local_map, copy_intervals, copy_intervals_to_string)
13286 (compare_string_intervals, set_intervals_multibyte_1):
13287 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13288 * intervals.h: Adjust decls to match defn changes elsewhere.
13290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13291 * keyboard.c (this_command_key_count, this_single_command_key_start)
13292 (before_command_key_count, before_command_echo_length, echo_now)
13293 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13294 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13295 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13296 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13297 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13298 (last_non_minibuf_size, last_point_position, echo_truncate)
13299 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13300 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13301 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13302 (stuff_buffered_input):
13303 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13304 (last_auto_save, command_loop_1, read_char):
13305 Use EMACS_INT, not int, to avoid integer overflow.
13306 (record_char): Avoid overflow in total_keys computation.
13307 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13308 * keyboard.h: Adjust decls to match defn changes elsewhere.
13309 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13310 (Fkey_description, Fdescribe_vector, Flookup_key):
13311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13312 (click_position): New function, to check that positions are in range.
13313 (Fcurrent_active_maps):
13314 (describe_command):
13315 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13316 (Faccessible_keymaps, Fkey_description):
13317 (preferred_sequence_p):
13318 Don't assume fixnum can fit into int.
13319 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13320 Check for integer overflow in size calculations.
13321 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13322 avoid mishandling large integers.
13323 * lisp.h: Adjust decls to match defn changes elsewhere.
13324 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13325 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13326 (struct Lisp_Marker):
13327 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13328 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13329 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13330 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13331 All callers changed.
13332 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13333 Assume the arg has valid form, since it always does.
13334 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13335 unsigned integer system type.
13336 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13337 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13338 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13339 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13340 (duration_to_sec_usec): New decl.
13341 * lread.c (read_from_string_index, read_from_string_index_byte)
13342 (read_from_string_limit, readchar, unreadchar, openp)
13343 (read_internal_start, read1, oblookup):
13344 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13345 (Fload, readevalloop, Feval_buffer, Feval_region):
13346 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13347 (openp): Check for out-of-range argument to 'access'.
13348 (read1): Use int, not EMACS_INT, where int is wide enough.
13349 Don't assume fixnum fits into int.
13350 Fix off-by-one error that can read outside a buffer.
13351 (read_filtered_event): Use duration_to_sec_usec
13352 to do proper overflow checking on durations.
13353 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13354 in size calculation.
13355 (Fexecute_kbd_macro):
13356 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13357 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13358 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13359 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13360 (set_marker_both, set_marker_restricted_both, marker_position)
13361 (marker_byte_position, Fbuffer_has_markers_at):
13362 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13363 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13364 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13365 It now merely ensures that the menu is large enough, without
13366 necessarily growing it, as this avoids some integer overflow issues.
13367 All callers changed.
13368 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13369 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13370 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13371 Use SAFE_ALLOCA_LISP, not alloca.
13372 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13373 to EMACS_INT. Check that fixnums are in proper range for system types.
13374 * minibuf.c (minibuf_prompt_width, string_to_object)
13375 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13376 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13377 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13378 (get_minibuffer, read_minibuf_unwind):
13379 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13380 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13381 this simplifies overflow checking. All callers changed.
13382 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13383 (Ftest_completion):
13384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13385 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13386 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13387 Check that fixnums are in proper range for system types.
13388 (Fx_create_frame, Fx_show_tip):
13389 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13390 * nsfont.m (ns_findfonts, nsfont_list_family):
13391 Don't assume fixnum fits in long.
13392 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13393 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13394 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13396 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13397 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13398 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13399 (PRINTDECLARE, PRINTPREPARE):
13400 (strout, print_string):
13401 (print, print_preprocess, print_check_string_charset_prop)
13403 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13405 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13406 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13407 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13408 (printchar, strout): Use xpalloc to catch size calculation overflow.
13409 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13410 (print_error_message): Use SAFE_ALLOCA, not alloca.
13411 (print_object): Use int, not EMACS_INT, where int is wide enough.
13412 (print_depth, new_backquote_output, print_number_index):
13413 Use ptrdiff_t, not int, where int might not be wide enough.
13414 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13415 (Fset_process_window_size, Fformat_network_address)
13416 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13418 Check that fixnums are in proper range for system types.
13419 (Fsignal_process): Simplify by avoiding a goto.
13420 Check for process-ids out of pid_t range rather than relying on
13421 undefined behavior.
13422 (process_tick, update_tick): Use EMACS_INT, not int.
13423 (Fformat_network_address, read_process_output, send_process)
13424 (Fprocess_send_region, status_notify):
13425 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13426 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13427 (wait_reading_process_output, read_process_output, exec_sentinel):
13428 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13429 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13430 (Faccept_process_output): Use duration_to_sec_usec to do proper
13431 overflow checking on durations.
13432 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13433 Don't assume pid_t fits in int.
13434 * process.h (struct Lisp_Process): Members tick and update_tick
13435 are now of type EMACS_INT, not int.
13436 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13437 configured --with-wide-int.
13438 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13439 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13440 * search.c (looking_at_1, string_match_1):
13441 (fast_string_match, fast_c_string_match_ignore_case)
13442 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13443 (scan_newline, find_before_next_newline, search_command)
13444 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13445 (set_search_regs, wordify):
13448 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13449 (string_match_1, search_buffer, set_search_regs):
13451 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13452 (wordify): Check for overflow in size calculation.
13453 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13454 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13455 Check that fixnums are in proper range for system types.
13456 * sound.c (struct sound_device)
13457 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13458 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13459 (Fplay_sound_internal):
13460 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13461 * syntax.c (struct lisp_parse_state, find_start_modiff)
13462 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13463 (Fparse_partial_sexp):
13464 Don't assume fixnums can fit in int.
13465 (struct lisp_parse_state, find_start_pos, find_start_value)
13466 (find_start_value_byte, find_start_begv)
13467 (update_syntax_table, char_quoted, dec_bytepos)
13468 (find_defun_start, prev_char_comend_first, back_comment):
13469 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13470 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13471 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13472 (Finternal_describe_syntax_value): Check that match_lisp is a
13473 character, not an integer, since the code stuffs it into int.
13474 (scan_words, scan_sexps_forward):
13475 Check that fixnums are in proper range for system types.
13477 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13478 (scan_sexps_forward):
13479 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13480 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13481 * syntax.h: Adjust decls to match defn changes elsewhere.
13482 (struct gl_state_s):
13483 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13484 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13485 MOST_POSITIVE_FIXNUM.
13486 * sysdep.c (wait_for_termination_1, wait_for_termination)
13487 (interruptible_wait_for_termination, mkdir):
13488 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13489 (emacs_read, emacs_write):
13490 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13491 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13492 and double all fit in int.
13493 * term.c (set_tty_color_mode):
13494 Check that fixnums are in proper range for system types.
13495 * termhooks.h (struct input_event):
13496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13497 * textprop.c (validate_interval_range, interval_of)
13498 (Fadd_text_properties, set_text_properties_1)
13499 (Fremove_text_properties, Fremove_list_of_text_properties)
13500 (Ftext_property_any, Ftext_property_not_all)
13501 (copy_text_properties, text_property_list, extend_property_ranges)
13502 (verify_interval_modification):
13503 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13504 (Fnext_single_char_property_change)
13505 (Fprevious_single_char_property_change):
13506 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13507 (copy_text_properties):
13508 Check for integer overflow in index calculation.
13509 * undo.c (last_boundary_position, record_point, record_insert)
13510 (record_delete, record_marker_adjustment, record_change)
13511 (record_property_change):
13512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13513 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13514 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13515 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13516 (Fx_hide_tip, Fx_file_dialog):
13517 * w32menu.c (set_frame_menubar):
13518 Use ptrdiff_t, not int, for consistency with rest of code.
13519 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13520 (select_window, Fdelete_other_windows_internal)
13521 (window_scroll_pixel_based, window_scroll_line_based)
13522 (Frecenter, Fset_window_configuration):
13523 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13524 (Fset_window_hscroll, run_window_configuration_change_hook)
13525 (set_window_buffer, temp_output_buffer_show, scroll_command)
13526 (Fscroll_other_window, Frecenter):
13527 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13528 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13529 Don't assume fixnum fits in int.
13530 (Fset_window_scroll_bars):
13531 Check that fixnums are in proper range for system types.
13532 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13533 (string_pos, c_string_pos, number_of_chars, init_iterator)
13534 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13535 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13536 (compute_display_string_end, handle_face_prop)
13537 (face_before_or_after_it_pos, handle_invisible_prop)
13538 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13539 (display_prop_intangible_p, string_buffer_position_lim)
13540 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13541 (get_overlay_strings_1, get_overlay_strings)
13542 (iterate_out_of_display_property, forward_to_next_line_start)
13543 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13544 (get_next_display_element, set_iterator_to_next)
13545 (get_visually_first_element, compute_stop_pos_backwards)
13546 (handle_stop_backwards, next_element_from_buffer)
13547 (move_it_in_display_line_to, move_it_in_display_line)
13548 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13549 (add_to_log, message_dolog, message_log_check_duplicate)
13550 (message2, message2_nolog, message3, message3_nolog
13551 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13552 (current_message_1, truncate_echo_area, truncate_message_1)
13553 (set_message, set_message_1, store_mode_line_noprop)
13554 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13555 (text_outside_line_unchanged_p, check_point_in_composition)
13556 (reconsider_clip_changes)
13557 (redisplay_internal, set_cursor_from_row, try_scrolling)
13558 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13559 (redisplay_window, find_last_unchanged_at_beg_row)
13560 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13561 (trailing_whitespace_p, find_row_edges, display_line)
13562 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13563 (display_mode_element, store_mode_line_string)
13564 (pint2str, pint2hrstr, decode_mode_spec)
13565 (display_count_lines, display_string, draw_glyphs)
13566 (x_produce_glyphs, x_insert_glyphs)
13567 (rows_from_pos_range, mouse_face_from_buffer_pos)
13568 (fast_find_string_pos, mouse_face_from_string_pos)
13569 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13571 (safe_call, init_from_display_pos, handle_fontified_prop)
13572 (handle_single_display_spec, load_overlay_strings)
13573 (with_echo_area_buffer, setup_echo_area_for_printing)
13574 (display_echo_area, echo_area_display)
13575 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13576 (update_tool_bar, hscroll_window_tree, redisplay_internal)
13577 (redisplay_window, dump_glyph_row, display_mode_line)
13578 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
13579 (handle_display_spec, display_prop_string_p):
13580 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13581 (handle_single_display_spec, build_desired_tool_bar_string)
13582 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13583 (get_specified_cursor_type):
13584 Check that fixnums are in proper range for system types.
13585 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13586 (Flookup_image_map):
13587 Don't assume fixnums fit in int.
13588 (compare_overlay_entries):
13589 Avoid mishandling comparisons due to subtraction overflow.
13590 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13591 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13592 (handle_tool_bar_click):
13593 Use int, not unsigned, since we prefer signed and the signedness
13594 doesn't matter here.
13595 (get_next_display_element, next_element_from_display_vector):
13596 Use int, not EMACS_INT, when int is wide enough.
13597 (start_hourglass): Use duration_to_sec_usec to do proper
13598 overflow checking on durations.
13599 * xfaces.c (Fbitmap_spec_p):
13600 Check that fixnums are in proper range for system types.
13601 (compare_fonts_by_sort_order):
13602 Avoid mishandling comparisons due to subtraction overflow.
13603 (Fx_family_fonts, realize_basic_faces):
13604 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13606 Don't assume fixnum fits in int.
13607 Use SAFE_ALLOCA_LISP, not alloca.
13608 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13609 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13610 (face_at_buffer_position, face_for_overlay_string)
13611 (face_at_string_position):
13612 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13613 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13614 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13616 Check that fixnums are in proper range for system types.
13617 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13618 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13619 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13620 (Fx_change_window_property): Don't assume fixnums fit in int.
13621 * xfont.c (xfont_chars_supported):
13622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13623 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13624 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13625 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13626 * xml.c (parse_region):
13627 * xrdb.c (magic_file_p):
13628 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13629 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13630 (x_get_local_selection, x_reply_selection_request)
13631 (x_handle_selection_request, wait_for_property_change):
13632 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13633 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13634 short is wide enough.
13635 (x_send_client_event): Don't assume fixnum fits in int.
13636 * xterm.c (x_x_to_emacs_modifiers):
13637 Don't assume EMACS_INT overflows nicely into int.
13638 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13639 may come from Lisp.
13640 (handle_one_xevent): NATNUMP can eval its arg twice.
13641 (x_connection_closed):
13642 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13643 * xterm.h: Adjust decls to match defn changes elsewhere.
13644 (struct scroll_bar): Use struct vectorlike_header
13645 rather than rolling our own approximation.
13646 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13648 2012-05-25 Glenn Morris <rgm@gnu.org>
13650 * lisp.mk (lisp): Update for more files being compiled now.
13652 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13654 * lread.c: Remove `read_pure' which makes no difference.
13655 (read_pure): Remove var.
13656 (unreadpure): Remove function.
13657 (readevalloop): Don't call read_list with -1 flag.
13658 (read1, read_vector): Don't test read_pure any more.
13659 (read_list): Simplify.
13661 * fileio.c, character.h: Minor style tweaks.
13663 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13665 * window.h (clip_changed): Remove useless declaration.
13667 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
13669 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13670 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13672 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13675 This directory predates autoconf and is no longer needed nowadays.
13676 Move its few remaining bits of functionality to where they're needed.
13677 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13678 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13679 * m/template.h: Remove.
13680 * Makefile.in (M_FILE): Remove. All uses removed.
13681 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13682 * lisp.h (USE_LSB_TAG):
13683 * mem-limits.h (EXCEEDS_LISP_PTR):
13684 Use VAL_MAX, not VALBITS, in #if.
13685 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13686 (EMACS_UINT): Define unconditionally now.
13687 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13688 (BITS_PER_EMACS_INT): New constants, replacing
13689 what used to be in config.h, but not useful in #if.
13690 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13691 define them any more.
13692 (VAL_MAX): New macro.
13694 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13695 BITS_PER_EMACS_INT, in #if.
13696 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13697 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13698 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13699 * s/ms-w32.h (DATA_START):
13700 Move here from removed file m/intel386.h.
13701 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13702 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13704 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13706 Assume C89 or later.
13707 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13708 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13710 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13711 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13712 * textprop.c, tparam.c (NULL): Remove.
13713 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13714 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13715 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13716 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13717 * xterm.c (input_signal_count): Assume volatile works.
13719 2012-05-21 Ken Brown <kbrown@cornell.edu>
13721 * xgselect.c (xg_select): Fix first argument in call to 'select'
13724 2012-05-20 Ken Brown <kbrown@cornell.edu>
13726 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
13727 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
13729 2012-05-19 Ken Brown <kbrown@cornell.edu>
13731 * xfns.c (x_in_use): Remove `static' qualifier.
13732 * xterm.h (x_in_use): Declare.
13733 * xgselect.c: Include xterm.h.
13734 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13735 and `display_arg' (bug#9754).
13737 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13739 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13741 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13742 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13744 2012-05-18 Eli Zaretskii <eliz@gnu.org>
13746 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13748 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
13749 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
13751 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13752 reference to image_cache->refcount.
13753 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13755 2012-05-17 Juri Linkov <juri@jurta.org>
13757 * search.c (Fword_search_regexp, Fword_search_backward)
13758 (Fword_search_forward, Fword_search_backward_lax)
13759 (Fword_search_forward_lax): Move functions to isearch.el
13760 (bug#10145, bug#11381).
13762 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13764 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13766 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13768 * lread.c (init_obarray): Declare Qt and Qnil as special.
13770 2012-05-14 Glenn Morris <rgm@gnu.org>
13772 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
13773 Put "libexec" before "bin", for the sake of init_callproc_1.
13775 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13777 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13779 * unexaix.c: Port to more-recent AIX compilers.
13780 (report_error, report_error_1, make_hdr, copy_sym)
13781 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13782 Make arguments const char *, not char *, to avoid violations of C
13783 standard and to fix some AIX warnings reported by Gilles Pion.
13785 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13787 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13788 already have overlays loaded.
13789 (handle_single_display_spec): Before returning without displaying
13790 fringe bitmap, synchronize the bidi iterator with the main display
13791 iterator, by calling iterate_out_of_display_property.
13792 (iterate_out_of_display_property): Detect buffer iteration by
13793 testing that it->string is a Lisp string.
13794 (get_next_display_element): When the current object is exhausted,
13795 and there's something on it->stack, call set_iterator_to_next to
13796 proceed with what's on the stack, instead of returning zero.
13797 (set_iterator_to_next): If called at the end of a Lisp string,
13798 proceed to consider_string_end without incrementing string
13799 position. Don't increment display vector index past the end of
13800 the display vector. (Bug#11417)
13801 (pos_visible_p): Don't report a position visible when move_it_to
13802 stopped at the last line of window, which happens to be scanned
13803 backwards by the bidi iteration. (Bug#11464)
13805 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13807 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13808 and right-margin display specs even if the spec is invalid or we
13809 are on a TTY, and thus unable to display on the fringes.
13810 That's because the text with the property will not be displayed anyway,
13811 so we need to signal to the caller that this is a "replacing"
13812 display spec. This fixes display when the spec is invalid or we
13815 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13817 * unexaix.c (make_hdr): Fix typo in prototype.
13818 This bug broke the build on AIX. Problem reported by Gilles Pion.
13820 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
13822 * keyboard.c (kbd_buffer_get_event): Read special events also in
13823 batch mode. (Bug#11415)
13825 2012-05-12 Glenn Morris <rgm@gnu.org>
13827 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13829 2012-05-12 Eli Zaretskii <eliz@gnu.org>
13831 * lisp.mk (lisp): Add newcomment.elc.
13833 2012-05-12 Glenn Morris <rgm@gnu.org>
13835 * Makefile.in (MKDIR_P): New, set by configure.
13836 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13838 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13840 Remove unused function hourglass_started.
13841 * dispextern.h (hourglass_started):
13842 * w32fns.c (hourglass_started):
13843 * xdisp.c (hourglass_started): Remove.
13845 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
13847 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13848 Update dependencies.
13850 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13852 * xgselect.c (xg_select): Put maxfds+1 into a var.
13853 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13855 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13857 2012-05-10 Dave Abrahams <dave@boostpro.com>
13859 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13860 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13862 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
13864 * dbusbind.c (xd_registered_buses): New internal Lisp object.
13865 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
13866 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13867 Initialize xd_registered_buses.
13869 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13871 Untag more efficiently if USE_LSB_TAG.
13872 This is based on a proposal by YAMAMOTO Mitsuharu in
13873 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13874 For an admittedly artificial (nth 8000 longlist) benchmark on
13875 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13876 Emacs's overall text size by 1%.
13877 * lisp.h (XUNTAG): New macro.
13878 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13879 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13880 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13881 * eval.c (Fautoload):
13882 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13883 * frame.h (XFRAME): Use XUNTAG.
13885 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13886 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13887 Remove unportable assumptions about print widths of types like
13889 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13890 intptr_t when converting between pointer and integer, to avoid GCC
13891 warnings about wrong width.
13893 2012-05-09 Eli Zaretskii <eliz@gnu.org>
13895 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13896 stack for each reader_thread, instead of defaulting to 8MB
13897 determined by the linker. This avoids failures in creating
13898 subprocesses on Windows 7, see the discussion in this thread:
13899 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13901 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13903 Fix up display of the *Minibuf-0* buffer in the mini window.
13904 * keyboard.c (read_char): Don't clear the echo area if there's no
13906 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
13907 contents of *Minibuf-0*) if there's no message displayed in its stead.
13909 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
13911 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13914 2012-05-06 Chong Yidong <cyd@gnu.org>
13916 * lisp.mk (lisp): Update.
13918 2012-05-05 Jim Meyering <meyering@redhat.com>
13920 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13922 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13924 * data.c (PUT_ERROR): New macro.
13925 (syms_of_data): Use it. Add new error type `user-error'.
13926 * undo.c (user_error): New function.
13927 (Fprimitive_undo): Use it.
13928 * print.c (print_error_message): Adjust print style for `user-error'.
13929 * keyboard.c (user_error): New function.
13930 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13932 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13934 Do not limit current-time-string to years 1000..9999.
13935 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13936 (Fcurrent_time_string): Support any year that is supported by the
13937 underlying localtime representation. Don't use asctime, as it
13938 has undefined behavior for years outside the range -999..9999.
13940 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13942 Fix race conditions involving setenv, gmtime, localtime, asctime.
13943 Without this fix, interrupts could mess up code that uses these
13944 nonreentrant functions, since setting TZ invalidates existing
13945 tm_zone or tzname values, and since most of these functions return
13946 pointers to static storage.
13947 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13948 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13949 Grow the critical sections to include not just invoking
13950 localtime/gmtime, but also accessing these functions' results
13951 including their tm_zone values if any, and any related TZ setting.
13952 (format_time_string): Last arg is now struct tm *, not struct tm **,
13953 so that the struct tm is saved in the critical section.
13954 All callers changed. Simplify allocation of initial buffer, partly
13955 motivated by the fact that memory allocation needs to be outside
13956 the critical section.
13958 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13960 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13961 with RESET_INTERVAL.
13963 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13964 Remove duplicated buffer name initialization.
13966 2012-05-02 Jim Meyering <jim@meyering.net>
13968 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13970 * xfns.c (x_window): Use xstrdup (Bug#11375).
13972 2012-05-02 Eli Zaretskii <eliz@gnu.org>
13974 * xdisp.c (pos_visible_p): If already at a newline from the
13975 display string before the 'while' loop, don't walk back the glyphs
13976 from it3.glyph_row. Solves assertion violation when the display
13977 string begins with a newline (egg.el). (Bug#11367)
13979 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13981 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13984 2012-05-01 Glenn Morris <rgm@gnu.org>
13986 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13987 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13988 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13989 All were removed before 23.1.
13991 * dispnew.c: Remove HAVE_LIBNCURSES test;
13992 it is always true on relevant platforms.
13994 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13995 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13997 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13999 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14001 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14002 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14005 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14007 Do not avoid creating empty evaporating overlays (Bug#9642).
14008 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14009 That is, do not delete an evaporating overlay if it becomes
14010 empty after its bounds are adjusted to fit within its buffer.
14011 This fix caused other problems, and I'm reverting it until we get
14012 to the bottom of them.
14014 2012-04-27 Chong Yidong <cyd@gnu.org>
14016 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14018 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14020 * xdisp.c (pos_visible_p): If the window start position is beyond
14021 ZV, start the display from buffer beginning. Prevents assertion
14022 violation in init_iterator when the minibuffer window is scrolled
14023 via the scroll bar.
14025 * window.c (window_scroll_pixel_based): Likewise.
14027 2012-04-27 Chong Yidong <cyd@gnu.org>
14029 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14031 2012-04-27 Glenn Morris <rgm@gnu.org>
14033 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14034 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14036 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14038 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14039 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
14041 2012-04-26 Eli Zaretskii <eliz@gnu.org>
14043 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14044 display element, check also the underlying string or buffer
14045 character. (Bug#11341)
14047 * w32menu.c: Include w32heap.h.
14048 (add_menu_item): If the call to AppendMenuW (via
14049 unicode_append_menu) fails, disable Unicode menus only if we are
14050 running on Windows 9X/Me.
14052 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14054 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14055 (xgetint): Add missing shift for LSB tags.
14057 2012-04-24 Martin Rudalics <rudalics@gmx.at>
14059 * keyboard.c (read_char): Don't wipe echo area for select window
14060 events: These might get delayed via `mouse-autoselect-window'
14063 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
14065 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14066 manipulation of :loaded-from data.
14068 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
14070 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14071 now a cons (bug#11311).
14073 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14075 Do not create empty overlays with the evaporate property (Bug#9642).
14076 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14077 if it becomes empty after its bounds are adjusted to fit within
14078 its buffer. Without this fix, in a nonempty buffer (let ((o
14079 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14080 yields an empty overlay that has the evaporate property, which is
14081 not supposed to happen.
14083 Fix minor GTK3 problems found by static checking.
14084 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14085 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14086 (struct _EmacsFixedClass, emacs_fixed_get_type):
14087 Move decls here from emacsgtkfixed.h, since they needn't be public.
14088 (emacs_fixed_get_type): Now static.
14089 (emacs_fixed_class_init): Omit unused local.
14090 (emacs_fixed_child_type): Remove; unused.
14091 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14092 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14093 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14094 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14095 (EMACS_FIXED_GET_CLASS): Remove; unused.
14096 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14098 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14099 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14101 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14103 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14104 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14105 (__malloc_size_t, __malloc_ptrdiff_t):
14106 Remove. All uses removed, replaced by the definiens if needed,
14107 since we can assume C89 or better now.
14108 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14109 (protect_malloc_state, align, get_contiguous_space)
14110 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14111 (malloc_atfork_handler_child, malloc_enable_thread)
14112 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14113 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14114 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14115 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14116 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14117 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14118 Define using prototypes, not old style.
14119 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14120 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14121 (align): Don't assume that signed integer overflow wraps around.
14122 Omit unused local var.
14123 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14124 (_free_internal_nolock, memalign, mallochook, reallochook):
14125 Omit no-longer-needed casts.
14126 (valloc): Use getpagesize, not __getpagesize.
14127 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14128 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14130 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14132 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
14134 Move functions from C to Lisp. Make non-blocking method calls
14135 the default. Implement further D-Bus standard interfaces.
14137 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14138 (QCdbus_request_name_allow_replacement)
14139 (QCdbus_request_name_replace_existing)
14140 (QCdbus_request_name_do_not_queue)
14141 (QCdbus_request_name_reply_primary_owner)
14142 (QCdbus_request_name_reply_in_queue)
14143 (QCdbus_request_name_reply_exists)
14144 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14145 (QCdbus_registered_serial, QCdbus_registered_method)
14146 (QCdbus_registered_signal): New Lisp objects.
14147 (XD_DEBUG_MESSAGE): Use sizeof.
14148 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14149 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14150 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14151 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14152 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14153 (xd_signature, xd_append_arg): Allow float for integer types.
14154 (xd_get_connection_references): New function.
14155 (xd_get_connection_address): Rename from xd_initialize.
14156 Return cached address.
14157 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14158 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14160 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14161 Return number of refcounts.
14162 (Fdbus_get_unique_name): Make stronger parameter check.
14163 (Fdbus_message_internal): New defun.
14164 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14165 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14166 (Fdbus_send_signal, Fdbus_register_service)
14167 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14168 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14169 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14170 (Vdbus_compiled_version, Vdbus_runtime_version)
14171 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14172 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14173 (Vdbus_message_type_signal): New defvars.
14174 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14177 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14179 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14180 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14181 Do not assume ptrdiff_t is the same width as 'int'.
14183 * alloc.c: Handle unusual debugging option combinations.
14184 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14185 since the two debugging options are incompatible.
14186 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14188 (mem_init, mem_insert, mem_insert_fixup):
14189 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14190 (NEED_MEM_INSERT): Remove; no longer needed.
14192 2012-04-22 Leo Liu <sdl.web@gmail.com>
14194 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14196 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14198 * sysdep.c [__FreeBSD__]: Minor cleanups.
14199 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14200 Use Emacs indenting style more consistently. Avoid some casts.
14201 Use 'double' consistently rather than mixing 'float' and 'double'.
14203 2012-04-21 Eduard Wiebe <usenet@pusto.de>
14205 * sysdep.c (list_system_processes, system_process_attributes):
14206 Add implementation for FreeBSD (Bug#5243).
14208 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14210 * lisp.mk (lisp): Update.
14212 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14214 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14215 It is never used otherwise.
14217 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14219 * print.c (print_preprocess): Only check print_depth if print-circle
14221 (print_object): Check for cycles even when print-circle is nil and
14222 print-gensym is t, but only check print_depth if print-circle is nil.
14224 2012-04-20 Chong Yidong <cyd@gnu.org>
14226 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14227 set the status to "failed" and ensure that sentinel is run.
14229 2012-04-20 Glenn Morris <rgm@gnu.org>
14231 * process.c (Fset_process_inherit_coding_system_flag)
14232 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14233 (Fmake_network_process, Fmake_serial_process): Doc fix.
14235 2012-04-20 Eli Zaretskii <eliz@gnu.org>
14237 * xdisp.c (string_buffer_position_lim): Limit starting position to
14239 (set_cursor_from_row): If called for a mode-line or header-line
14240 row, return zero immediately.
14241 (try_cursor_movement): If inside continuation line, don't back up
14242 farther than the first row after the header line, if any.
14243 Don't consider the header-line row as "partially visible", even if
14244 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14246 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14248 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14251 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
14252 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14254 configure: new option --enable-gcc-warnings (Bug#11207)
14255 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14256 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14257 (ALL_CFLAGS): Use new macros rather than old.
14258 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14259 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14260 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14261 -Wunused-result, -Wunused-variable. This should go away once
14262 the Emacs and Gnulib regex code is merged.
14263 (xmalloc, xrealloc): Now static.
14265 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14267 * dired.c (Fsystem_groups): Remove unused local.
14269 2012-04-17 Glenn Morris <rgm@gnu.org>
14271 * dired.c (Fsystem_users): Doc fix.
14273 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14275 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14276 (syms_of_dired): Add them.
14278 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14280 Fix minor alloc.c problems found by static checking.
14281 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14282 New extern decls, to avoid calling undeclared functions.
14283 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14284 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14285 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14286 (NEED_MEM_INSERT): New macro.
14287 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14288 Remove one incorrect comment and fix another.
14290 Fix minor ralloc.c problems found by static checking.
14291 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14292 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14293 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14294 (r_alloc_sbrk): Now static.
14296 Improve ralloc.c interface checking.
14297 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14298 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14299 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14300 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14301 [REL_ALLOC]: ... to here, to check interface.
14302 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14303 Remove decls. This fixes an "It stinks!".
14305 * alloc.c (which_symbols): Fix alignment issue / type clash.
14307 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14309 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14310 (struct Lisp_Misc_Any): Likewise.
14311 (struct Lisp_Free): Likewise.
14312 * alloc.c (union aligned_Lisp_Symbol): Define.
14313 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14314 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14315 (union aligned_Lisp_Misc): Define.
14316 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14317 aligned_Lisp_Misc instead of union Lisp_Misc.
14318 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14320 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14322 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14323 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14324 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14325 * s/netbsd.h, s/sol2-6.h:
14326 Remove definition of GC_MARK_STACK, since the default now works.
14327 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14328 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14329 no longer the default.
14330 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14332 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14334 * lread.c (lisp_file_lexically_bound_p):
14335 Fix hang at ";-*-\n" (bug#11238).
14337 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14339 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14340 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14342 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14344 * nsterm.m (constrainFrameRect): Always constrain when there is only
14345 one screen (Bug#10962).
14347 2012-04-13 Ken Brown <kbrown@cornell.edu>
14349 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14351 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14353 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14355 2012-04-11 Daniel Colascione <dancol@dancol.org>
14357 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14358 against is gone. It's better to use vfork now so that when Cygwin
14359 gains a new, working vfork, we use it automatically (bug#10398).
14361 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14363 * window.c (save_window_save): Obey window-point-insertion-type.
14365 2012-04-11 Glenn Morris <rgm@gnu.org>
14367 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14369 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14371 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14373 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14375 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14376 (force_quit_count): New var.
14377 (handle_interrupt): Use it.
14379 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14381 * w32.c (w32_delayed_load): Record the full path of the library
14382 being loaded (bug#10424).
14384 2012-04-09 Glenn Morris <rgm@gnu.org>
14386 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14387 not just in the obarray, before snarfing them. (Bug#11036)
14389 * Makefile.in ($(leimdir)/leim-list.el):
14390 Pass EMACS rather than BUILT_EMACS.
14392 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14394 * process.c (make_process):
14395 * process.h: Add integer `gnutls_handshakes_tried' member to
14398 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14399 Add convenience `GNUTLS_LOG2i' macro.
14401 * gnutls.c (gnutls_log_function2i): Convenience log function.
14402 (emacs_gnutls_read): Use new log functions,
14403 `gnutls_handshakes_tried' process member, and
14404 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14405 attempts per process (connection).
14407 2012-04-09 Chong Yidong <cyd@gnu.org>
14409 * eval.c (Fuser_variable_p, user_variable_p_eh)
14410 (lisp_indirect_variable): Functions deleted.
14411 (Fdefvar): Caller changed.
14413 * callint.c (Finteractive, Fcall_interactively):
14414 * minibuf.c (Fread_variable): Callers changed.
14416 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14418 * xdisp.c (set_cursor_from_row): If the display string appears in
14419 the buffer at position that is closer to point than the position
14420 after the display string, display the cursor on the first glyph of
14421 the display string. Fixes cursor display when a 'display' text
14422 property immediately follows invisible text. (Bug#11094)
14424 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14426 composite.c: use 'double' consistently
14427 * composite.c (get_composition_id): Use 'double' consistently
14428 instead of converting 'float' to 'double' and vice versa; this is
14429 easier to understand and avoids a GCC warning.
14431 2012-04-09 Glenn Morris <rgm@gnu.org>
14433 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14434 preparation for dumping it with emacs. (Bug#4789)
14435 (leimdir): New variable.
14436 ($(leimdir)/leim-list.el): New rule.
14437 (emacs$(EXEEXT)): Depend on leim-list.el.
14439 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14440 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14441 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14443 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14445 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14448 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14450 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14451 Remove unused local variable.
14453 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14455 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14456 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14457 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14458 objects, as mark_maybe_pointer will catch them otherwise.
14459 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14460 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14462 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14464 Fix typo that broke non-Windows builds.
14465 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14467 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14469 Support building on MS-Windows with libxml2.
14471 * makefile.w32-in (OBJ2): Add xml.$(O).
14472 (GLOBAL_SOURCES): Add xml.c.
14473 ($(BLD)/xml.$(O)): New dependency list.
14475 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14476 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14477 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14478 [!WINDOWSNT]: New macros.
14479 (init_libxml2_functions, libxml2_loaded_p): New functions.
14480 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14481 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14482 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14483 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14485 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14486 Call init_libxml2_functions before calling libxml2 functions.
14487 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14489 * emacs.c: Don't include libxml/parser.h.
14490 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14491 xmlCleanupParser directly.
14493 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14495 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14497 * indent.c (Fvertical_motion): If there is a display string at
14498 point, use it.vpos to compute how many lines to backtrack after
14499 move_it_to point. (Bug#11133)
14501 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14503 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14504 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14505 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14506 macros related to unification of CJK characters. For the details,
14507 see the discussion following the message here:
14508 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14510 2012-04-04 Chong Yidong <cyd@gnu.org>
14512 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14514 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14516 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14517 instead of alloca. (Bug#11138)
14519 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14521 * w32menu.c (is_simple_dialog): Properly check lisp types.
14524 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14526 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14527 position we get to after a call to move_it_to fails the
14528 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14529 only if we wind up in a string from display property. (Bug#11063)
14531 * window.c (Fdelete_other_windows_internal): Invalidate the row
14532 and column information about mouse highlight, so that redisplay
14533 restores it after reallocating the glyph matrices. (Bug#7464)
14535 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14536 string comes from a `display' text property, use the buffer
14537 position of that property as if we actually saw that position in
14539 (move_it_by_lines): Remove the assertion that
14540 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14541 violated when there's a before-string at the beginning of a line.
14544 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14546 * xdisp.c (append_space_for_newline): If the default face was
14547 remapped, use the remapped face for the appended newline.
14548 (extend_face_to_end_of_line): Use the remapped default face for
14549 extending the face to the end of the line.
14550 (display_line): Call extend_face_to_end_of_line when the default
14551 face was remapped. (Bug#11068)
14553 2012-03-29 Eli Zaretskii <eliz@gnu.org>
14555 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14557 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14559 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14561 2012-03-27 Glenn Morris <rgm@gnu.org>
14563 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14566 2012-03-26 Kenichi Handa <handa@m17n.org>
14568 * dispextern.h (struct glyph): Fix previous change. Change the
14569 bit length of glyphless.ch to 25 (Bug#11082).
14571 2012-03-26 Chong Yidong <cyd@gnu.org>
14573 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14574 (command_loop_1): Use it; inhibit selection update for
14575 handle-select-window too (Bug#8996).
14577 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14579 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
14581 2012-03-25 Kenichi Handa <handa@m17n.org>
14583 * dispextern.h (struct glyph): Change the bit length of
14584 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14586 2012-03-24 Eli Zaretskii <eliz@gnu.org>
14588 * s/ms-w32.h (tzname): Include time.h before redirecting to
14589 _tzname. Fixes the MSVC build. (Bug#9960)
14591 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14593 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14596 * xterm.c (XTread_socket): Only modify handling_signal if
14597 !SYNC_INPUT. (Bug#11080)
14599 2012-03-23 Eli Zaretskii <eliz@gnu.org>
14601 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14602 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14603 when fetching a multibyte character consumes more bytes than
14604 CHAR_BYTES returns, due to unification of CJK characters in
14605 string_char. (Bug#11073)
14607 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14609 * process.c (wait_reading_process_output): Handle pty disconnect
14610 by refraining from sending oneself a SIGCHLD (bug#10933).
14612 2012-03-22 Chong Yidong <cyd@gnu.org>
14614 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14616 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
14617 Mark string as coming from a prefix property.
14618 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14619 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14621 2012-03-21 Chong Yidong <cyd@gnu.org>
14623 * xfaces.c (Vface_remapping_alist): Doc fix.
14625 2012-03-20 Eli Zaretskii <eliz@gnu.org>
14627 * w32proc.c (Fw32_set_console_codepage)
14628 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14631 2012-03-20 Chong Yidong <cyd@gnu.org>
14633 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14634 to reflect default non-nil value of redisplay-dont-pause.
14636 2012-03-19 Kenichi Handa <handa@m17n.org>
14638 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14639 it fit in a valid range (Bug#11003).
14641 2012-03-18 Eli Zaretskii <eliz@gnu.org>
14643 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14644 that is not from display property, accept the row as a "cursor
14645 row" if one of the string's character has a non-nil `cursor'
14646 property. Fixes cursor positioning when there are newlines in
14647 overlay strings, e.g. in icomplete.el. (Bug#11035)
14649 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14651 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14653 2012-03-12 Chong Yidong <cyd@gnu.org>
14655 * eval.c (inhibit_lisp_code): Rename from
14656 inhibit_window_configuration_change_hook; move from window.c.
14658 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14659 * window.c (run_window_configuration_change_hook)
14660 (syms_of_window): Callers changed.
14662 2012-03-11 Chong Yidong <cyd@gnu.org>
14664 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14666 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14668 2012-03-10 Chong Yidong <cyd@gnu.org>
14670 * frame.c (other_visible_frames): Don't assume the selected frame
14671 is visible (Bug#10955).
14673 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14675 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14677 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14679 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14680 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14683 2012-03-03 Glenn Morris <rgm@gnu.org>
14685 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
14687 2012-03-02 Eli Zaretskii <eliz@gnu.org>
14689 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14690 position past the first glyph_row that ends at ZV. (Bug#10902)
14691 (redisplay_window, next_element_from_string): Fix typos in
14693 (redisplay_window): Pass to move_it_vertically the margin in
14694 pixels, not in screen lines.
14696 2012-03-02 Glenn Morris <rgm@gnu.org>
14698 * buffer.c (buffer-list-update-hook): Doc fix.
14700 2012-02-29 Eli Zaretskii <eliz@gnu.org>
14702 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14703 push_it before setting up the iterator for the first overlay
14704 string, even if we have an empty string loaded.
14705 (next_overlay_string): If there's an empty string on the iterator
14706 stack, pop the stack. (Bug#10903)
14708 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14710 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14711 Suggested by Stefan Monnier in
14712 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14713 * alloc.c (widen_to_Lisp_Object): New static function.
14714 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14715 and widening them to Lisp_Objects. This would work even if
14716 USE_LSB_TAG is defined and wide integers are used, which might
14717 happen in a future version of Emacs.
14719 2012-02-25 Chong Yidong <cyd@gnu.org>
14721 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14724 * xselect.c (Fx_selection_exists_p): Doc fix.
14725 (x_clipboard_manager_save_all): Print an informative message
14726 before saving to clipboard manager.
14728 2012-02-24 Chong Yidong <cyd@gnu.org>
14730 * keyboard.c (process_special_events): Handle all X selection
14731 requests in kbd_buffer, not just the next one (Bug#8869).
14733 2012-02-23 Chong Yidong <cyd@gnu.org>
14735 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14736 call when setting menu-bar-lines and tool-bar-lines parameters.
14737 (unwind_create_frame_1): New helper function.
14739 * window.c (inhibit_window_configuration_change_hook): New var.
14740 (run_window_configuration_change_hook): Obey it.
14741 (syms_of_window): Initialize it.
14743 2012-02-22 Chong Yidong <cyd@gnu.org>
14745 * xterm.c (x_draw_image_relief): Add missing type check for
14746 Vtool_bar_button_margin (Bug#10743).
14748 2012-02-21 Chong Yidong <cyd@gnu.org>
14750 * fileio.c (Vfile_name_handler_alist): Doc fix.
14752 * buffer.c (Fget_file_buffer): Protect against invalid file
14753 handler return value.
14755 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14757 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14758 when computing $valmask.
14760 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14761 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14762 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14763 It's useless in that case, and it can cause problems on hosts
14764 that allocate halves of EMACS_INT values separately.
14765 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14766 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14767 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14768 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14769 it avoids undefined behavior on hosts where shifting right by more
14770 than the word width has undefined behavior.
14772 2012-02-19 Chong Yidong <cyd@gnu.org>
14774 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14775 (Funhandled_file_name_directory, Ffile_name_as_directory)
14776 (Fdirectory_file_name, Fexpand_file_name)
14777 (Fsubstitute_in_file_name): Protect against invalid file handler
14778 return values (Bug#10845).
14780 2012-02-18 Eli Zaretskii <eliz@gnu.org>
14782 * .gdbinit (pitx): Fix incorrect references to fields of the
14785 2012-02-17 Chong Yidong <cyd@gnu.org>
14787 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14789 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14791 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14792 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14794 2012-02-15 Chong Yidong <cyd@gnu.org>
14796 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14797 marked as special. Also, starting docstrings with * is obsolete.
14799 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14801 * gnutls.c (emacs_gnutls_write): Fix last change.
14803 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14805 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14808 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14810 * keymap.c (Fsingle_key_description): Handle char ranges.
14812 2012-02-12 Chong Yidong <cyd@gnu.org>
14814 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14815 as that creates a dangerous corner case.
14817 * window.c (Fdelete_window_internal): Invalidate the mouse
14818 highlight (Bug#9904).
14820 2012-02-12 Glenn Morris <rgm@gnu.org>
14822 * xselect.c (Fx_own_selection_internal)
14823 (Fx_get_selection_internal, Fx_disown_selection_internal)
14824 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14825 * nsselect.m (Fx_own_selection_internal)
14826 (Fx_disown_selection_internal, Fx_selection_exists_p)
14827 (Fx_selection_owner_p, Fx_get_selection_internal):
14828 Sync docs and argument specs with the xselect.c versions.
14830 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14832 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14834 2012-02-11 Eli Zaretskii <eliz@gnu.org>
14836 * w32select.c (Fx_selection_exists_p): Sync doc string and
14837 argument list with xselect.c. (Bug#10783)
14839 * w16select.c (Fx_selection_exists_p): Sync doc string and
14840 argument list with xselect.c. (Bug#10783)
14842 2012-02-10 Glenn Morris <rgm@gnu.org>
14844 * fns.c (Fsecure_hash): Doc fix.
14846 2012-02-09 Kenichi Handa <handa@m17n.org>
14848 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14850 2012-02-07 Chong Yidong <cyd@gnu.org>
14852 * buffer.c (Fbuffer_local_variables)
14853 (buffer_lisp_local_variables): Handle unbound vars correctly;
14854 don't let Qunbound leak into Lisp.
14856 2012-02-07 Glenn Morris <rgm@gnu.org>
14858 * image.c (Fimagemagick_types): Doc fix.
14860 * image.c (imagemagick-render-type): Change it from a lisp object
14861 to an integer. Move the doc here from the lisp manual.
14862 Treat all values not equal to 0 the same.
14864 2012-02-06 Chong Yidong <cyd@gnu.org>
14866 * doc.c (store_function_docstring): Avoid applying docstring of
14867 alias to base function (Bug#2603).
14869 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14871 * .gdbinit (pp1, pv1): Remove redundant defines.
14874 2012-02-04 Chong Yidong <cyd@gnu.org>
14876 * nsterm.m: Declare a global (Bug#10694).
14878 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14880 * w32.c (get_emacs_configuration_options):
14881 Include --enable-checking, if specified, in the return value.
14883 2012-02-04 Martin Rudalics <rudalics@gmx.at>
14885 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14886 after rounding frame sizes. (Bug#9723)
14888 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14890 * keyboard.c (adjust_point_for_property): Don't position point
14891 before BEGV. (Bug#10696)
14893 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14895 Handle overflow when computing char display width (Bug#9496).
14896 * character.c (char_width): Return EMACS_INT, not int.
14897 (char_width, c_string_width): Check for overflow when
14898 computing the width; this is possible now that individual
14899 characters can have unbounded width. Problem introduced
14900 by merge from Emacs 23 on 2012-01-19.
14902 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
14904 * dbusbind.c (Fdbus_register_method): Mention the return value
14905 :ignore in the docstring.
14907 2012-02-02 Glenn Morris <rgm@gnu.org>
14909 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14911 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14912 Unconditionally set to t. (Bug#10673)
14913 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14914 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14915 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14917 2012-02-02 Kenichi Handa <handa@m17n.org>
14919 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14920 0, do not call append_composite_glyph.
14922 2012-02-02 Kenichi Handa <handa@m17n.org>
14924 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14926 (x_produce_glyphs): If the component of a composition is a null
14927 string, set it->pixel_width to 1 to avoid zero-width glyph.
14929 2012-02-01 Eli Zaretskii <eliz@gnu.org>
14931 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14932 first 2 arguments are identical. This makes inserting large
14933 output from a subprocess an order of magnitude faster on
14934 MS-Windows, where all sbrk'ed memory is always contiguous.
14936 2012-01-31 Glenn Morris <rgm@gnu.org>
14938 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14939 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14940 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14942 2012-01-29 Glenn Morris <rgm@gnu.org>
14944 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14946 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14948 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14950 2012-01-28 Chong Yidong <cyd@gnu.org>
14952 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14954 2012-01-26 Chong Yidong <cyd@gnu.org>
14956 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14958 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14959 repeat counts (Bug#10507).
14961 2012-01-26 Glenn Morris <rgm@gnu.org>
14963 * lread.c (syms_of_lread): Doc fix.
14965 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14967 * coding.c (encode_designation_at_bol): Change return value to
14970 2012-01-25 Chong Yidong <cyd@gnu.org>
14972 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14974 2012-01-21 Chong Yidong <cyd@gnu.org>
14976 * floatfns.c (Fcopysign): Make the second argument non-optional,
14977 since nil is not allowed anyway.
14979 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14981 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14982 (send_process): Likewise.
14984 2012-01-19 Martin Rudalics <rudalics@gmx.at>
14986 * window.c (save_window_save, Fcurrent_window_configuration)
14987 (Vwindow_persistent_parameters): Do not use Qstate.
14988 Rewrite doc-strings.
14990 2012-01-19 Kenichi Handa <handa@m17n.org>
14992 * character.c (char_width): New function.
14993 (Fchar_width, c_string_width, lisp_string_width):
14994 Use char_width (Bug#9496).
14996 2012-01-16 Martin Rudalics <rudalics@gmx.at>
14998 * window.c (Vwindow_persistent_parameters): New variable.
14999 (Fset_window_configuration, save_window_save): Handle persistent
15002 2012-01-14 Eli Zaretskii <eliz@gnu.org>
15004 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15005 thrashing the stack of the thread. (Bug#9087)
15007 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15009 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15011 2012-01-11 Eli Zaretskii <eliz@gnu.org>
15013 * xdisp.c (rows_from_pos_range): Handle the case where the
15014 highlight ends on a newline. (Bug#10464)
15015 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15016 he end column for display of highlight that ends on a newline
15019 2012-01-11 Glenn Morris <rgm@gnu.org>
15021 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15022 from load-path also when installation-directory is nil. (Bug#10208)
15024 2012-01-10 Glenn Morris <rgm@gnu.org>
15026 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15028 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15029 Update template values to be closer to their typical values these days.
15031 2012-01-09 Eli Zaretskii <eliz@gnu.org>
15033 * xdisp.c (rows_from_pos_range): Accept additional argument
15034 DISP_STRING, and accept any glyph in a row whose object is that
15035 string as eligible for mouse highlight. Fixes mouse highlight of
15036 display strings from overlays. (Bug#10464)
15038 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
15040 emacs: fix an auto-save permissions race condition (Bug#10400)
15041 * fileio.c (auto_saving_dir_umask): New static var.
15042 (Fmake_directory_internal): Use it.
15043 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15044 creating the directory. The old code temporarily assigns
15045 too-generous permissions to the directory.
15046 (do_auto_save_eh): Clear it.
15047 (Fdo_auto_save): Catch all errors, not just file errors, so
15048 that the var is always cleared.
15050 2012-01-07 Eli Zaretskii <eliz@gnu.org>
15052 * search.c (scan_buffer): Pass character positions to
15053 know_region_cache, not byte positions. (Bug#6540)
15055 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
15057 * w32.c (sys_rename): Report EXDEV when rename of a directory
15058 fails because the target is on another logical disk. (Bug#10284)
15060 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15062 * xterm.c (x_embed_request_focus): New function.
15064 * xterm.h: Add prototype.
15066 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15068 2012-01-05 Glenn Morris <rgm@gnu.org>
15070 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15072 2012-01-01 Eli Zaretskii <eliz@gnu.org>
15074 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15075 Load gnutls_transport_set_lowat only if GnuTLS version is below
15077 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15078 GnuTLS versions below 2.11.1.
15080 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15082 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15083 to the doc string advising against its use for altering the way
15084 windows are scrolled.
15086 2011-12-28 Kenichi Handa <handa@m17n.org>
15088 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15089 coding-system ASCII compatible only when it does not produce BOM
15090 on encoding (Bug#10383).
15092 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15094 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15096 (create_and_show_popup_menu): Always use menu_position_func for
15099 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15101 * callint.c (Fcall_interactively): Don't truncate prompt string.
15103 2011-12-23 Eli Zaretskii <eliz@gnu.org>
15105 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15106 property that ends at ZV, so that the bidi iteration could be
15107 resumed from there (after widening). (Bug#10360)
15109 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15111 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15113 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15115 * nsterm.m (x_free_frame_resources):
15116 Release f->output_data.ns->miniimage.
15117 (ns_index_color): Fix indentation. Do not retain
15118 color_table->colors[i].
15120 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15123 * nsfns.m (x_set_background_color): Assign return value from
15124 ns_index_color to face-background instead of NSColor*.
15125 (ns_implicitly_set_icon_type): Fix indentation.
15126 Change assignment in for loop to comparison.
15128 * emacs.c (ns_pool): New variable.
15129 (main): Assign ns_pool.
15130 (Fkill_emacs): Call ns_release_autorelease_pool.
15132 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15133 autorelease fdesc, release fdAttrs and tdict.
15134 (ns_get_covering_families): Release charset.
15135 (ns_findfonts): Release NSFontDescriptor created with new.
15136 (ns_uni_to_glyphs): Fix indentation.
15137 (setString): Release attrStr before assigning new value.
15139 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15141 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15143 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15144 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15146 2011-12-18 David Reitter <reitter@cmu.edu>
15148 * nsterm.m (ns_term_init): Subscribe for notifications
15149 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15150 to method trackingNotification in EmacsMenu.
15152 * nsmenu.m (trackingMenu): New variable.
15153 (trackingNotification): New method (from Aquamacs).
15154 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15155 from Aquamacs (Bug#7030).
15157 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15159 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15160 (symbol_to_nsstring): Fix indentation.
15161 (ns_symbol_to_pb): New function.
15162 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15163 (Fns_rotate_cut_buffers_internal): Remove.
15164 (Fns_store_selection_internal): Rename from
15165 Fns_store_cut_buffer_internal.
15166 (ns_get_foreign_selection, Fx_own_selection_internal)
15167 (Fx_disown_selection_internal, Fx_selection_exists_p)
15168 (Fns_get_selection_internal, Fns_store_selection_internal):
15169 Use ns_symbol_to_pb and check if return value is nil.
15170 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15171 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15172 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15173 renamed to Sns_store_selection_internal.
15174 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15175 and remove this function.
15176 (ns_handle_selection_clear): Remove, never used.
15177 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15180 2011-12-17 Ken Brown <kbrown@cornell.edu>
15182 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15183 GID is unknown (Bug#10257).
15185 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15187 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15188 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15189 which caused a build failure on GNU/Linux IA-64. This problem was
15190 introduced by my 2011-10-07 patch.
15192 2011-12-15 Juri Linkov <juri@jurta.org>
15194 * image.c (imagemagick_error): New function. (Bug#10112)
15195 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15196 Use `imagemagick_error' where ImageMagick functions return
15198 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15201 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15203 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15204 fill background (Bug#8992).
15206 2011-12-13 Martin Rudalics <rudalics@gmx.at>
15208 * window.c (Vwindow_combination_resize)
15209 (Vwindow_combination_limit): Use t instead of non-nil in
15211 (Vrecenter_redisplay): Add first sentence of doc-string on
15213 (Frecenter): Fix doc-string typo.
15215 2011-12-11 Kenichi Handa <handa@m17n.org>
15217 * coding.c (Funencodable_char_position): Pay attention to the
15218 buffer text relocation (Bug#9389).
15220 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15222 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15223 gtk_init (Bug#10100).
15225 2011-12-10 Eli Zaretskii <eliz@gnu.org>
15227 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15228 IT->string is nil. (Bug#10263)
15230 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15232 * nsterm.h (x_free_frame_resources): Declare.
15234 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15235 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15237 * nsterm.h (ns_get_defaults_value): Declare.
15239 * nsterm.m (ns_default): Call ns_get_defaults_value.
15241 2011-12-09 Eli Zaretskii <eliz@gnu.org>
15243 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15246 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15248 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15249 that where the value of an _OBJC_* symbol points to is in the .bss
15250 section (Bug#10240).
15252 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15254 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15255 after the loop to call ccl_driver at least once (Bug#8619).
15257 2011-12-08 Kenichi Handa <handa@m17n.org>
15259 * ftfont.c (get_adstyle_property): Fix previous change
15262 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
15264 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15265 dirs from the default value of EMACSLOADPATH (bug#10208).
15267 2011-12-07 Glenn Morris <rgm@gnu.org>
15269 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15270 installation and source directories as well. (Bug#10208)
15272 2011-12-06 Chong Yidong <cyd@gnu.org>
15274 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15276 2011-12-06 Glenn Morris <rgm@gnu.org>
15278 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15279 as an error, not just -1. (Bug#10217)
15281 2011-12-05 Chong Yidong <cyd@gnu.org>
15283 * keyboard.c (process_special_events): New function.
15284 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15286 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15288 * coding.c (encode_designation_at_bol): Don't use uninitialized
15289 local variable (Bug#9318).
15291 2011-12-05 Kenichi Handa <handa@m17n.org>
15293 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15294 return Qnil (Bug#8046, Bug#10193).
15296 2011-12-05 Kenichi Handa <handa@m17n.org>
15298 * coding.c (encode_designation_at_bol): New args charbuf_end and
15299 dst. Return the number of produced bytes. Callers changed.
15300 (coding_set_source): Return how many bytes coding->source was
15302 (coding_set_destination): Return how many bytes
15303 coding->destination was relocated.
15304 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15305 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15307 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15309 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15310 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15313 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15315 The following changes are to fix Bug#9318.
15317 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15318 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15319 (encode_coding_iso_2022, encode_coding_sjis)
15320 (encode_coding_big5, encode_coding_charset): Use the above macros.
15322 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15324 * lisp.h (process_quit_flag): Fix external declaration.
15326 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15328 Don't macro-inline non-performance-critical code.
15329 * eval.c (process_quit_flag): New function.
15330 * lisp.h (QUIT): Use it.
15332 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15334 * nsfns.m (get_geometry_from_preferences): New function.
15335 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15337 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15339 * emacs.c (Qkill_emacs): Define.
15340 (syms_of_emacs): Initialize it.
15341 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15342 Qquit_flag to `kill-emacs' instead.
15343 (quit_throw_to_read_char): Add parameter `from_signal'.
15344 All callers changed. Call Fkill_emacs if requested and safe.
15345 * lisp.h (QUIT): Call Fkill_emacs if requested.
15347 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15349 * widget.c (update_wm_hints): Return if wmshell is null.
15350 (widget_update_wm_size_hints): New function.
15352 * widget.h (widget_update_wm_size_hints): Declare.
15354 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15355 widget_update_wm_size_hints (Bug#10104).
15357 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15359 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15360 before a newline, prepare the bidi iterator for consuming the
15361 newline, and keep the current paragraph direction. (Bug#10183)
15362 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15364 2011-12-02 Juri Linkov <juri@jurta.org>
15366 * search.c (Fword_search_regexp): New Lisp function created from
15367 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15368 (Fword_search_backward, Fword_search_forward)
15369 (Fword_search_backward_lax, Fword_search_forward_lax):
15370 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15371 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15373 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15375 * fileio.c (Finsert_file_contents): Move after-change-function call
15376 to before the "handled:" label, since all "goto handled" appear in
15377 cases where the *-change-functions have already been properly called
15380 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15382 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15383 waiting for input. (Bug#10169)
15385 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15387 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15388 verifies glyph row's hash code--we have just reallocated the
15389 glyphs, so their contents can be complete garbage. (Bug#10164)
15391 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15393 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15395 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15397 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15398 attributes are tested _before_ calling verify_row_hash, to protect
15399 against GCC re-ordering of the tests. (Bug#10164)
15401 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15403 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15405 * xterm.c (handle_one_xevent): Only set async_visible and friends
15406 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15407 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15408 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15410 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15412 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15413 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15414 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15415 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15416 All uses changed to use GCPRO1 etc.
15417 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15418 Revert to old implementation (i.e., before 2011-03-11).
15420 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15422 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15423 of scroll runs so as to avoid assigning disabled bogus rows and
15424 unnecessary graphics copy operations.
15426 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15428 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15429 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15430 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15431 (malloc, free, realloc, calloc): Redirect to e_* only when
15434 * lisp.h (GCTYPEBITS): Move before first use.
15435 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15436 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15437 this macro definition.
15439 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15442 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15444 * gtkutil.c (xg_create_frame_widgets):
15445 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15446 present with Gtk+ 2.0.
15448 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15450 * fileio.c (Finsert_file_contents): Undo previous change; see
15451 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15453 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15455 Rename locals to avoid shadowing.
15456 * fileio.c (Finsert_file_contents):
15457 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15458 * process.c (wait_reading_process_output):
15459 Rename inner 'proc' to 'p' to avoid shadowing.
15460 Indent for consistency with usual Emacs style.
15462 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15464 * xdisp.c (redisplay_window): If cursor row is not fully visible
15465 after recentering, and scroll-conservatively is set to a large
15466 number, scroll window by a few more lines to make the cursor fully
15467 visible and out of scroll-margin. (Bug#10105)
15468 (start_display): Don't move to the next line if the display should
15469 start at a newline that is part of a display vector or an overlay
15470 string. (Bug#10119)
15472 2011-11-24 Juri Linkov <juri@jurta.org>
15474 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15475 after the `MagickPingImage' call. (Bug#10112)
15477 2011-11-23 Chong Yidong <cyd@gnu.org>
15479 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15481 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15483 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15484 making another buffer current. (Bug#10114)
15486 2011-11-23 Glenn Morris <rgm@gnu.org>
15488 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15490 2011-11-23 Chong Yidong <cyd@gnu.org>
15492 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15493 using it (Bug#5984).
15495 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15497 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15498 and header-lines, as they don't have one computed for them.
15501 * .gdbinit (prow): Make displayed values more self-explaining.
15502 Add row's hash code.
15504 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15506 * process.c (wait_reading_process_output): Fix asynchrounous
15507 GnuTLS socket handling on some versions of the GnuTLS library.
15508 (wait_reading_process_output): Add comment and URL.
15510 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15512 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15514 2011-11-21 Chong Yidong <cyd@gnu.org>
15516 * window.c (Fnext_window, Fprevious_window): Doc fix.
15518 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15520 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15522 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15524 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15526 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15528 * window.c (Fset_window_combination_limit): Rename argument
15530 (Vwindow_combination_limit): Remove "status" from doc-string.
15532 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15534 * m/ibms390.h: Remove.
15535 * m/ibms390x.h: Don't include "ibms390.h".
15537 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15539 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15540 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15542 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15544 * casetab.c (Fset_case_table):
15545 * charset.c (Fcharset_after): Fix typos.
15547 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15549 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15550 Otherwise, valgrind does not work on some platforms.
15551 Problem reported by Andreas Schwab in
15552 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15553 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15554 is set, removing the need for VIRT_ADDRESS_VARIES.
15555 (PURE_P): Use a more-efficient implementation that needs just one
15556 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15557 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15558 to 4 (xorl, subq, cmpq, setbe).
15559 * alloc.c (pure): Always extern now, since that's the
15560 VIRT_ADDR_VARIES behavior.
15561 (PURE_POINTER_P): Use a single comparison, not two, for
15562 consistency with the new puresize.h.
15563 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15564 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15565 Remove VIRT_ADDR_VARIES no longer needed.
15567 2011-11-19 Eli Zaretskii <eliz@gnu.org>
15569 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15570 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15571 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15572 behave as if the cursor position were at the window margin.
15574 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15575 and the cursor position is out of bounds, behave as if the cursor
15576 position were at the window margin. (Bug#10075)
15578 2011-11-18 Chong Yidong <cyd@gnu.org>
15580 * window.c (Fwindow_combination_limit): Make first argument
15581 non-optional, since it is meaningless for live windows like the
15584 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15586 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15588 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15590 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15591 (graft_intervals_into_buffer): Simplify.
15593 2011-11-18 Eli Zaretskii <eliz@gnu.org>
15595 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15596 hash values of the two rows.
15597 (copy_row_except_pointers): Preserve the used[] arrays and the
15598 hash values of the two rows. (Bug#10035)
15599 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
15601 * xdisp.c (row_hash): New function, body extracted from
15602 compute_line_metrics.
15603 (compute_line_metrics): Call row_hash, instead of computing the
15606 * dispnew.c (verify_row_hash): Call row_hash for computing the
15607 hash code of a row, instead of duplicating code from xdisp.c.
15609 * dispextern.h (row_hash): Add prototype.
15611 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15613 * frame.c (delete_frame): Don't delete the terminal when the last
15614 X frame is closed if emacs is built with GTK toolkit.
15616 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
15618 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15620 2011-11-17 Martin Rudalics <rudalics@gmx.at>
15622 * window.c (Vwindow_splits): Rename to
15623 Vwindow_combination_resize. Suggested by Juri Linkov.
15624 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15627 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
15629 * nsfns.m (Fns_font_name):
15630 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
15632 2011-11-16 Martin Rudalics <rudalics@gmx.at>
15634 * window.h (window): Rename slot "nest" to "combination_limit".
15635 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15636 (Fset_window_nest): Rename to Fset_window_combination_limit.
15637 (Vwindow_nest): Rename to Vwindow_combination_limit.
15638 (recombine_windows, make_parent_window, make_window)
15639 (Fsplit_window_internal, saved_window)
15640 (Fset_window_configuration, save_window_save): Rename all
15641 occurrences of window_nest to window_combination_limit.
15643 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
15645 * image.c (imagemagick_load_image): Fix typo.
15647 2011-11-14 Eli Zaretskii <eliz@gnu.org>
15649 * xdisp.c (display_line): Move the call to
15650 highlight_trailing_whitespace before the call to
15651 compute_line_metrics, since the latter needs to see the final
15652 faces of all the glyphs to compute ROW's hash value.
15653 Fixes assertion violations in row_equal_p. (Bug#10035)
15655 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
15657 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15658 just return (bug#10044).
15660 2011-11-12 Eli Zaretskii <eliz@gnu.org>
15662 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15663 with user-defined heap size. Bump the default size of the temacs
15664 heap to 27MB, to avoid memory warning when running temacs.
15665 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15667 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15668 current_matrix and desired_matrix. (Bug#9990)
15669 (verify_row_hash) [XASSERTS]: New function.
15670 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15671 that the hash value of glyph rows is correct.
15673 2011-11-12 Martin Rudalics <rudalics@gmx.at>
15675 * window.h (window): Remove splits slot.
15676 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15677 (Fdelete_other_windows_internal, make_parent_window)
15678 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15679 (Fset_window_configuration, save_window_save): Don't deal with
15680 split status of windows.
15681 (saved_window): Remove splits slot.
15682 (Vwindow_splits): Rewrite doc-string.
15684 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15686 * xfns.c (unwind_create_frame):
15687 * nsfns.m (unwind_create_frame):
15688 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15689 Vframe_list (Bug#9999).
15691 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15693 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
15695 2011-11-11 Kenichi Handa <handa@m17n.org>
15697 * callproc.c (Fcall_process): Set the member dst_multibyte of
15700 2011-11-11 Johan Bockgård <bojohan@gnu.org>
15702 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15703 avoid a crash (bug#9496).
15705 2011-11-09 Chong Yidong <cyd@gnu.org>
15707 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15708 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15710 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15712 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15714 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15716 Avoid some portability problems by eschewing 'extern inline' functions.
15717 The trivial performance wins aren't worth the portability hassles; see
15718 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15720 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15721 (window_box_width, window_box_left, window_box_left_offset)
15722 (window_box_right, window_box_right_offset): Undo previous change,
15723 by removing the "extern"s.
15724 * intervals.c (adjust_intervals_for_insertion)
15725 (adjust_intervals_for_deletion): Undo previous change,
15726 making these static again.
15727 (offset_intervals, temp_set_point_both, temp_set_point)
15728 (copy_intervals_to_string): No longer inline.
15729 * xdisp.c (window_text_bottom_y, window_box_width)
15730 (window_box_height, window_box_left_offset)
15731 (window_box_right_offset, window_box_left, window_box_right)
15732 (window_box): No longer inline.
15734 2011-11-08 Chong Yidong <cyd@gnu.org>
15736 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
15737 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15738 Signal an error if not a live window.
15739 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15740 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15742 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
15744 * lisp.h (syms_of_abbrev): Remove declaration.
15745 Reported by CHENG Gao <chenggao@royau.me>.
15747 2011-11-07 Eli Zaretskii <eliz@gnu.org>
15749 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15750 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15751 of temacs in GUI mode.
15753 2011-11-07 Martin Rudalics <rudalics@gmx.at>
15755 * window.h: Declare delete_all_child_windows instead of
15756 delete_all_subwindows.
15757 * window.c (Fwindow_nest, Fset_window_nest)
15758 (Fset_window_new_total, Fset_window_new_normal)
15759 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15760 (delete_all_subwindows): Rename to delete_all_child_windows.
15761 (Fdelete_other_windows_internal, Fset_window_configuration):
15762 Call delete_all_child_windows instead of delete_all_subwindows.
15763 * frame.c (delete_frame): Call delete_all_child_windows instead
15764 of delete_all_subwindows.
15766 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15768 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15769 This is also needed for porting to any host where GC_MARK_STACK is
15770 not GC_MAKE_GCPROS_NOOPS.
15771 (which_symbols): Use it.
15773 2011-11-07 Kenichi Handa <handa@m17n.org>
15775 * coding.c (coding_set_destination): Check coding->src_pos only
15776 when coding->src_object is a buffer (bug#9910).
15778 * process.c (send_process): Set the member src_multibyte of coding
15779 to 0 (bug#9911) when sending a unibyte text.
15781 * callproc.c (Fcall_process): Set the member src_multibyte of
15782 process_coding to 0 (bug#9912).
15784 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15786 * xmenu.c (cleanup_widget_value_tree): New function.
15787 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15788 calling free_menubar_widget_value_tree directly (Bug#9830).
15790 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15792 Fix some portability problems with 'inline'.
15793 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15794 (window_box_width, window_box_left, window_box_left_offset)
15795 (window_box_right, window_box_right_offset): Declare extern.
15796 Otherwise, these inline functions do not conform to C99 and
15797 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15798 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15799 * intervals.c (adjust_intervals_for_insertion)
15800 (adjust_intervals_for_deletion): Now extern, because otherwise the
15801 extern inline functions 'offset_intervals' couldn't refer to it.
15802 (static_offset_intervals): Remove.
15803 (offset_intervals): Rewrite using the old contents of
15804 static_offset_intervals. The old version didn't conform to C99
15805 because an extern inline function contained a reference to an
15806 identifier with static linkage.
15808 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15810 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15813 2011-11-06 Eli Zaretskii <eliz@gnu.org>
15815 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15816 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15817 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15818 return Qleft_to_right.
15820 2011-11-06 Chong Yidong <cyd@gnu.org>
15822 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15823 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15824 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15825 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15826 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15827 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15828 (Fwindow_vscroll): Doc fix.
15829 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15830 argument, since it makes no sense to pass a live window and for
15831 consistency with window-child.
15833 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15835 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15838 2011-11-05 Jason Rumney <jasonr@gnu.org>
15840 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15841 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15843 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15844 bitwise arithmetic preventing use of unicode-sip and non-truetype
15847 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15849 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15852 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15853 initialization code to keep similarity to xfns.c after changes
15856 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15858 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15859 (unwind_create_frame): New function (Bug#9943).
15860 (Fx_create_frame): Restructure code to be more similar to the one in
15861 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15862 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15863 Move terminal->reference_count++ just before making the frame official
15866 * nsterm.m (x_free_frame_resources): New function.
15867 (x_destroy_window): Move code to x_free_frame_resources.
15869 * xfns.c (unwind_create_frame): Fix comment.
15870 (Fx_create_frame, x_create_tip_frame):
15871 Move terminal->reference_count++ just before making the frame
15872 official. Move initialization of image_cache_refcount and
15873 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15875 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15877 Support MSVC build with newer versions of Visual Studio.
15878 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15879 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15882 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15883 which are not supported by MSVC.
15884 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15885 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15887 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15888 types in bitfields.
15889 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15891 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15893 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
15895 Support MSVC build with newer versions of Visual Studio.
15896 * w32.c: Don't include w32api.h for MSVC.
15897 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15899 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15900 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15901 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15902 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15904 (alloca) [_MSC_VER]: Define to _alloca.
15906 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15908 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15910 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15912 * xdisp.c (note_mouse_highlight): If either of
15913 previous/next-single-property-change returns nil, treat that as
15914 the beginning or the end of the buffer. (Bug#9955)
15916 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15918 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
15919 label is not null (Bug#9951).
15920 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15923 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15925 * window.c (Fwindow_body_size): Mention in the doc string that the
15926 return value is in frame's canonical units. (Bug#9949)
15928 2011-11-03 Eli Zaretskii <eliz@gnu.org>
15930 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15932 * w32fns.c (unwind_create_frame): If needed, free the glyph
15933 matrices of the partially constructed frame. (Bug#9943)
15934 * xfns.c (unwind_create_frame): Likewise.
15936 2011-11-01 Eli Zaretskii <eliz@gnu.org>
15938 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15939 Don't stop backward scan on the continuation glyph, even though
15940 its CHARPOS is positive.
15941 (mouse_face_from_buffer_pos, note_mouse_highlight):
15942 Rename cover_string to disp_string.
15944 2011-11-01 Martin Rudalics <rudalics@gmx.at>
15946 * window.c (temp_output_buffer_show): Don't use
15947 Vtemp_buffer_show_specifiers.
15948 (Vtemp_buffer_show_specifiers): Remove unused variable.
15950 2011-10-30 Eli Zaretskii <eliz@gnu.org>
15952 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15953 past the beginning of the current glyph matrix.
15955 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
15957 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15958 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15959 HAVE_GTK3 (Bug#9869).
15961 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15962 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15964 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15966 * xterm.c: Declare x_handle_net_wm_state to return int.
15967 (handle_one_xevent): Check if we are iconified but don't have
15968 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15969 (get_current_wm_state): Return non-zero if not hidden,
15970 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15971 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15972 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15973 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15975 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15977 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15978 so that this new function doesn't get optimized away by a
15979 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15981 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15983 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15985 2011-10-29 Eli Zaretskii <eliz@gnu.org>
15987 Fix the `xbytecode' command.
15988 * .gdbinit (xprintbytestr): New command.
15989 (xwhichsymbols): Rename from `which'; all callers changed.
15990 (xbytecode): Print the byte-code string as well.
15992 2011-10-29 Kim Storm <storm@cua.dk>
15994 * alloc.c (which_symbols): New function.
15996 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15998 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16001 2011-10-29 Glenn Morris <rgm@gnu.org>
16003 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16004 Not clear what it was for, and it causes various bugs. (Bug#9839)
16006 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16008 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16009 possible random value that matches one of those tested as
16010 condition to clear the mouse face.
16012 2011-10-28 Chong Yidong <cyd@gnu.org>
16014 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16016 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16018 * window.c (make_window): Initialize phys_cursor_on_p.
16020 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16022 * lisp.h (struct Lisp_Symbol): Update comments.
16024 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
16026 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16028 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16030 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16031 <oslsachem@gmail.com> for helping to debug this.
16033 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16034 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16035 (g_b_init_get_glyph_outline_w): New static variables.
16036 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16037 (GetGlyphOutlineW_Proc): New typedefs.
16038 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
16039 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16041 (w32font_open_internal, compute_metrics):
16042 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
16043 instead of calling the "wide" APIs directly.
16045 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16047 * w32.h (syms_of_w32font): Add prototype.
16049 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16051 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16052 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16053 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16054 (Fmove_to_window_line): Doc fix.
16056 2011-10-27 Chong Yidong <cyd@gnu.org>
16058 * process.c (make_process): Set gnutls_state to NULL.
16060 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16061 non-NULL, regardless of GNUTLS_INITSTAGE.
16062 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16063 an error. Set process slots as soon as we allocate them.
16065 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16067 2011-10-27 Chong Yidong <cyd@gnu.org>
16069 * gnutls.c (emacs_gnutls_deinit): New function.
16070 Deallocate credentials structures as well as calling gnutls_deinit.
16071 (Fgnutls_deinit, Fgnutls_boot): Use it.
16073 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16074 (deactivate_process): Call emacs_gnutls_deinit.
16076 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16078 * image.c (x_create_x_image_and_pixmap):
16079 * w32.c (sys_rename, w32_delayed_load):
16080 * w32font.c (fill_in_logfont):
16081 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16083 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
16085 * w32fns.c (w32_default_color_map): New function,
16086 extracted from Fw32_default_color_map.
16087 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16089 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16091 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16093 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16095 * keyboard.c (test_undefined): New function (bug#9751).
16096 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16098 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16100 * sysdep.c (init_sys_modes): Fix the check for the controlling
16101 terminal (Bug#6649).
16103 2011-10-20 Eli Zaretskii <eliz@gnu.org>
16105 * dispextern.h (struct bidi_it): New member next_en_type.
16107 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16108 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16109 current character, check also for next_en_type being WEAK_EN.
16110 (bidi_resolve_weak): Don't enter the expensive loop if the current
16111 position is before next_en_pos. Record the bidi type of the first
16112 non-ET, non-BN character we find, in addition to its position.
16113 (bidi_level_of_next_char): Invalidate next_en_type when
16114 next_en_pos is over-stepped.
16116 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16118 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16119 * editfns.c: Rewrite current-time-zone so that it invokes
16120 the equivalent of (format-time-string "%Z") to get the time zone name.
16121 This fixes a bug when the time zone name contains characters that
16122 need converting from the system time locale to Emacs internal format.
16123 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16124 that patch fixed format-time-string to do the conversion, but
16125 I forgot to fix current-time-zone.
16126 (format_time_string): New function, containing most of
16127 what Fformat_time_string used to contain.
16128 (Fformat_time_string): Rewrite in terms of format_time_string.
16129 This doesn't change this function's behavior.
16130 (current-time-zone): Rewrite to use format_time_string.
16131 This fixes the bug reported by Michael Schierl in
16132 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16133 Jason Rumney's 2007-06-07 change worked around this bug, but
16135 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16137 2011-10-19 Eli Zaretskii <eliz@gnu.org>
16139 * xdisp.c (start_display): If the character at POS is displayed
16140 via a display vector, reset IT->current.dpvec_index to zero.
16141 (try_window_reusing_current_matrix): If a line ends in a display
16142 vector or the next line starts in a display vector, continue
16143 redrawing the window even though the character position of
16144 start_row was reached.
16147 2011-10-18 Chong Yidong <cyd@gnu.org>
16149 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16150 with nobreak-char-display too.
16152 2011-10-18 Eli Zaretskii <eliz@gnu.org>
16154 Fix part 3 of bug#9771.
16155 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16156 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16157 non-neutral characters if the current character is a paragraph
16158 separator (a.k.a. Newline). This avoids running the same
16159 expensive loop twice, once when we consume the preceding newline
16160 and the other time when the line actually needs to be displayed.
16161 Avoid the loop when we see neutrals on the base embedding level
16162 following a character whose directionality is the same as the
16163 paragraph's. This avoids running the expensive loop when a line
16164 ends in a long sequence of neutrals, like control characters.
16165 Add assertion against STRONG_AL type. Slightly rearrange code
16166 that determines the type of a neutral given the first non-neutral
16168 (bidi_level_of_next_char): Set next_en_pos to zero when
16169 invalidating its info.
16171 2011-10-17 Eli Zaretskii <eliz@gnu.org>
16173 * xdisp.c (push_display_prop): Determine whether to record string
16174 or buffer position by IT->string, not by IT->method. Allow
16175 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16176 (move_it_vertically_backward): Don't look for character position
16177 immediately after the newline when in a continuation line.
16180 2011-10-15 Martin Rudalics <rudalics@gmx.at>
16182 * window.c (coordinates_in_window): Rewrite and delabelize
16183 vertical border check. (Bug#5357) (Bug#9618)
16185 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16187 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16188 errors in XSetWindowBorder (bug#9310).
16190 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16192 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16193 avoid crash when xmalloc overrun checking is enabled.
16195 2011-10-13 Eli Zaretskii <eliz@gnu.org>
16197 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16198 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16199 cursor motion with <left> and <right> arrow keys.
16201 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16202 some callers set that themselves.
16204 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16206 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16207 display string and the previous row comes from the same string and
16208 is empty. (Bug#9739) (Bug#9738)
16210 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16212 * doc.c (get_doc_string): Encode file name (bug#9735).
16214 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16216 * bidi.c (bidi_level_of_next_char):
16217 * xdisp.c (get_visually_first_element): Remove old incorrect
16218 comments regarding the Unicode Line Separator character.
16220 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16222 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16224 * alloc.c (Fgc_status): Do not access beyond zombies array
16225 boundary if nzombies > MAX_ZOMBIES.
16226 * alloc.c (dump_zombies): Add missing format specifier.
16228 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16230 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16231 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16233 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16234 Some packages use them to denote characters with modifiers.
16236 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16238 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16239 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16240 matching a pp-number. Rename parameter var to var1.
16242 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16244 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16246 2011-10-08 Glenn Morris <rgm@gnu.org>
16248 * callint.c (Fcall_interactively): Give a more explicit error for the
16249 'c' case with a non-character input. (Bug#8479)
16251 2011-10-08 Eli Zaretskii <eliz@gnu.org>
16253 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16255 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16256 lines that are hscrolled on the left.
16258 * dispnew.c (buffer_posn_from_coords): Account for a possible
16259 presence of header-line. (Bug#4426)
16261 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16263 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16264 Don't advertise functionality which we discourage or doesn't work.
16266 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16268 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16269 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16270 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16271 this makes Emacs dump core during garbage collection on rare
16272 occasions. sizeof is obviously inferior to offsetof here, so
16273 stick with offsetof.
16274 (GC_POINTER_ALIGNMENT): New macro.
16275 (mark_memory): Omit 3rd (offset) arg; caller changed.
16276 Don't assume EMACS_INT alignment is the same as pointer alignment.
16278 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16280 * keyboard.c (read_key_sequence_remapped): New var.
16281 (read_key_sequence): Compute remapping in the right buffer.
16282 (command_loop_1): Use read_key_sequence's remapping directly.
16284 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16286 * dired.c (file_name_completion): Don't expand file name.
16287 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16288 before checking file name handler.
16290 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16291 they've been requested explicitly (bug#9591).
16293 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16295 * keymap.c (Fsingle_key_description): Use make_specified_string
16296 instead of build_string to build string from push_key_description.
16299 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16301 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16302 This fixes a Y2038 bug on 64-bit hosts.
16303 * buffer.c (reset_buffer):
16304 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16305 (Fclear_buffer_auto_save_failure):
16306 Use 0, not -1, to represent an unset failure time, since time_t
16307 might not be signed.
16309 Remove dependency on glibc malloc internals.
16310 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16311 Move back here from lisp.h, but with their new implementations.
16312 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16313 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16314 * charset.c (charset_table_init): New static var.
16315 (syms_of_charset): Use it instead of xmalloc. This removes a
16316 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16317 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16318 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16319 Move back to alloc.c.
16320 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16321 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16323 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16325 * nsterm.m (windowDidResize): Call x_set_window_size only when
16326 ns_in_resize is true. Otherwise set pixelwidth/height and
16327 call change_frame_size (Bug#9628).
16329 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16331 Port --enable-checking=all to Fedora 14 x86-64.
16332 * charset.c (syms_of_charset): Also account for glibc malloc's
16333 internal overhead when calculating the initial malloc maximum.
16335 Port --enable-checking=all to Fedora 14 x86.
16336 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16338 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16339 (overrun_check_realloc, overrun_check_free):
16340 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16341 That way, xmalloc returns a properly-aligned pointer even if
16342 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16343 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16344 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16345 into account when calculating the initial malloc maximum.
16346 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16347 Move here from alloc.c, so that charset.c can use it too.
16348 Properly align; the old code wasn't right for common 32-bit hosts
16349 when configured with --enable-checking=all.
16350 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16351 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16353 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16355 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16358 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16360 * xdisp.c (compute_display_string_end): If there's no display
16361 string at CHARPOS, return -1.
16363 * bidi.c (bidi_fetch_char): When compute_display_string_end
16364 returns a negative value, treat the character as a normal
16365 character not covered by a display string. (Bug#9624)
16367 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16369 * lread.c (Fread_from_string): Fix typo in docstring.
16371 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16373 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16374 newline, reseat the iterator instead of bidi-iterating there one
16375 character at a time. (Bug#9610)
16376 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16377 TO_CHARPOS if the bidi iterator is at base embedding level.
16379 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16381 * lread.c (readevalloop): Use correct code for NBSP.
16382 (read1): Likewise. (Bug#9608)
16384 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16386 * dbusbind.c (Fdbus_register_signal): When service is not
16387 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16389 2011-09-25 Glenn Morris <rgm@gnu.org>
16391 * buffer.c (truncate-lines): Doc fix.
16393 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16395 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16396 (Fset_window_next_buffers): Doc fix.
16398 2011-09-24 Glenn Morris <rgm@gnu.org>
16400 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16402 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16404 Fix minor problems found by static checking.
16405 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16406 * indent.c (Fvertical_motion): Fix == vs = typo.
16408 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16410 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16411 Default value is now t. Doc fix.
16413 * indent.c (Fvertical_motion): Compute and apply the overshoot
16414 logic when moving up, not only when moving down. Fix the
16415 confusing name and values of the it_overshoot_expected variable;
16416 logic changes accordingly. (Bug#9254) (Bug#9549)
16418 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16419 CHARPOS is covered by a display string which includes newlines.
16420 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16421 is covered by a display string with embedded newlines.
16423 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16425 * dbusbind.c (Fdbus_register_signal): Add match rule to
16426 Vdbus_registered_objects_table. (Bug#9581)
16427 (Fdbus_register_method, Vdbus_registered_objects_table):
16430 2011-09-24 Jim Meyering <meyering@redhat.com>
16432 do not ignore write error for any output size
16433 The previous change was incomplete.
16434 While it makes emacs --batch detect the vast majority of stdout
16435 write failures, errors were still ignored whenever the output size is
16436 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16437 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16438 && echo FAIL: ignored write error
16439 FAIL: ignored write error
16440 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16441 && echo FAIL: ignored write error
16442 FAIL: ignored write error
16443 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16445 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16447 * emacs.c (Fkill_emacs): In noninteractive mode exit
16448 non-successfully if a write error occurred on stdout. (Bug#9574)
16450 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16452 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16455 * dispextern.h (struct it): Update the comment documenting what
16458 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16460 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16461 a display string, extend search for cursor position to end of row.
16462 (find_row_edges): If the row ends in a newline from a display
16463 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16464 Handle the case of a display string with multiple newlines.
16465 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16466 non-empty line. Fixes confusing cursor motion with arrow keys at
16467 the beginning of a line that starts with whitespace.
16469 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16471 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16474 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16476 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16477 boolean (Bug#9154).
16479 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16481 * xdisp.c (display_line): Record maximum and minimum buffer
16482 positions even if no glyphs were produced (e.g., by a zero-width
16483 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16484 buffer positions that will be removed from the glyph row because
16486 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16487 column is beyond frame width: don't subtract 1 "pixel" when
16488 computing width of the stretch.
16489 (reseat_at_next_visible_line_start): Undo the change made on
16490 2011-09-17 that saved paragraph information and restored it after
16491 the call to `reseat'. (Bug#9545)
16493 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16495 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16496 and turn window cursor on if cleared (Bug#9415).
16498 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16500 * search.c (boyer_moore): Take unibyte characters from pattern
16501 literally. (Bug#9458)
16503 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16505 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16507 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16509 Fix minor problem found by static checking.
16510 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16511 initialized, to pacify gcc -Wuninitialized.
16513 * fileio.c: Report proper errno when syscall falls.
16514 (Finsert_file_contents): Save and restore errno,
16515 so that report_file_error outputs the correct diagnostic.
16516 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16518 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16520 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16522 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16524 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16525 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16527 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16529 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16530 about the current paragraph and restore it after the call to reseat.
16532 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16533 (bidi_find_paragraph_start): Search back for paragraph beginning
16534 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16535 (bidi_move_to_visually_next): Only trigger paragraph-related
16536 computations when the last character is a newline or at EOB, not
16537 just any NEUTRAL_B. (Bug#9470)
16539 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16540 truncated lines if point is covered by a display string. (Bug#9524)
16542 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16544 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16545 (cons_to_x_long): New function.
16546 (lisp_data_to_selection_data): Use it. Correct the test for
16547 short-versus-long data; it was negated. Break out of vector
16548 loop, for efficiency, when a long datum is discovered.
16550 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16552 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16554 2011-09-16 Eli Zaretskii <eliz@gnu.org>
16556 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16557 GCC PR/17406) by declaring this function with external scope.
16559 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16561 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16562 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16564 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16566 * editfns.c (Fformat): Correctly handle text properties on "%%".
16568 2011-09-15 Eli Zaretskii <eliz@gnu.org>
16570 * xterm.c (x_draw_composite_glyph_string_foreground):
16571 * w32term.c (x_draw_composite_glyph_string_foreground):
16572 * term.c (encode_terminal_code):
16573 * composite.c (composition_update_it, get_composition_id):
16574 * xdisp.c (get_next_display_element)
16575 (fill_composite_glyph_string): Add comments about special meaning
16576 of TAB characters in a composition.
16578 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16580 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
16581 This occurs when processing a multibyte format.
16582 Problem reported by Wolfgang Jenker.
16584 2011-09-15 Johan Bockgård <bojohan@gnu.org>
16586 * xdisp.c (try_cursor_movement): Only check for exact match if
16587 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16589 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16591 Remove unused external symbols.
16592 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16593 * xdisp.c (calc_pixel_width_or_height): Now static.
16594 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16595 * indent.c (check_display_width):
16596 * w32term.c: Fix comment to match code.
16597 * xterm.c, xterm.h (x_catching_errors): Remove.
16599 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16601 * xselect.c: Use signed conversions more consistently (Bug#9498).
16602 (selection_data_to_lisp_data): Assume incoming selection data are
16603 signed integers, not unsigned. This is to be consistent with
16604 outgoing selection data, which was modified to use signed integers
16605 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16606 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16607 expects long, not unsigned long.
16609 2011-09-14 Eli Zaretskii <eliz@gnu.org>
16611 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16612 computation of loop end. Reported by Johan Bockgård
16615 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
16617 * frame.c (Fother_visible_frames_p): Function deleted.
16619 2011-09-12 Eli Zaretskii <eliz@gnu.org>
16621 * indent.c (compute_motion): Process display vector front to back
16622 rather than the other way around. (Bug#2496)
16624 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16626 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16628 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
16630 * minibuf.c (Fread_from_minibuffer): Doc fix.
16632 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16634 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16635 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16637 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16639 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16640 value for non-existent files.
16642 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16644 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16645 set its "size" to -1. This will set the modtime_size field of
16646 the corresponding buffer to -1, which is what
16647 verify-visited-file-modtime expects for files that do not exist.
16650 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16652 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16654 * lisp.h: ... from here. push_key_description is no longer
16655 defined in keyboard.c, so its declaration should not be in
16656 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16657 logically belongs with push_key_description.
16659 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16661 * buffer.h: Include <sys/types.h> instead of <time.h>.
16662 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16663 Problem reported by Herbert J. Skuhra.
16665 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16667 * xml.c (parse_region): Make the parsing work for
16668 non-comment-starting XML files again (bug#9144).
16670 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16672 * image.c (gif_load): Fix calculation of bottom and right corner.
16675 2011-09-10 Eli Zaretskii <eliz@gnu.org>
16677 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16678 redisplay in small windows.
16680 2011-09-09 Eli Zaretskii <eliz@gnu.org>
16682 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16684 2011-09-08 Martin Rudalics <rudalics@gmx.at>
16686 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16687 Operate on live windows only.
16689 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
16691 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16693 2011-09-07 Eli Zaretskii <eliz@gnu.org>
16695 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16696 only under bidi iteration.
16698 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16700 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16702 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16704 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16705 Without this fix, the command to link temacs failed due to an
16706 undefined symbol __builtin_isnan. This is because
16707 /usr/include/iso/math_c99.h #defines isnan(x) to
16708 __builtin_isnan(x), but the bundled gcc, which identifies itself
16709 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16711 * floatfns.c (isnan): #undef, and then #define to a clone of
16713 (Fisnan): Always define, since it's always available now.
16714 (syms_of_floatfns): Always define isnan at the Lisp level.
16716 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16718 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16720 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16722 * fileio.c: Fix bugs with large file offsets (Bug#9428).
16723 The previous code assumed that file offsets (off_t values) fit in
16724 EMACS_INT variables, which is not true on typical 32-bit hosts.
16725 The code messed up by falsely reporting buffer overflow in cases
16726 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16727 when "big" contains more than 2**29 bytes, even though this
16728 inserts just one byte and does not overflow the buffer.
16729 (Finsert_file_contents): Store file offsets as off_t
16730 values, not as EMACS_INT values. Check for overflow when
16731 converting between EMACS_INT and off_t. When checking for
16732 buffer overflow or for overlap, take the offsets into account.
16733 Don't use EMACS_INT for small values where int suffices.
16734 When checking for overlap, fix a typo: ZV was used where
16735 ZV_BYTE was intended.
16736 (Fwrite_region): Don't assume off_t fits into 'long'.
16737 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16739 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
16741 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16743 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16745 sprintf-related integer and memory overflow issues (Bug#9412).
16747 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
16748 (esprintf, exprintf, evxprintf): New functions.
16749 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
16750 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
16751 (modify_event_symbol): Do not assume that the length of
16752 name_alist_or_stem is safe to alloca and fits in int.
16753 (Fexecute_extended_command): Likewise for function name and binding.
16754 (Frecursion_depth): Wrap around reliably on integer overflow.
16755 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16756 since some callers pass EMACS_INT values.
16757 (Fsingle_key_description): Don't crash if symbol name contains more
16758 than MAX_ALLOCA bytes.
16759 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16760 (get_minibuffer): Arg is now EMACS_INT, not int.
16761 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
16762 (esprintf, exprintf, evxprintf): New decls.
16763 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16765 * dbusbind.c (signature_cat): New function.
16766 (xd_signature, Fdbus_register_signal):
16767 Do not overrun buffer; instead, report string overflow.
16769 * dispnew.c (add_window_display_history): Don't overrun buffer.
16770 Truncate instead; this is OK since it's just a log.
16772 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16773 even if the time zone offset is outlandishly large.
16774 Don't mishandle offset == INT_MIN.
16776 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16777 when creating daemon; the previous buffer-overflow check was incorrect.
16779 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16780 which has the guts of the old verror function.
16782 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16783 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16785 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16786 (font_unparse_xlfd): Don't blindly alloca long strings.
16787 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
16788 fits in int, when using sprintf. Use single snprintf to count
16789 length of string rather than counting it via multiple sprintfs;
16790 that's simpler and more reliable.
16791 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16792 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16793 sprintf, in case result does not fit in int.
16795 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16796 (fontset_from_font): Print it.
16798 * frame.c (tty_frame_count): Now printmax_t, not int.
16799 (make_terminal_frame, set_term_frame_name): Print it.
16800 (x_report_frame_params): In X, window IDs are unsigned long,
16801 not signed long, so print them as unsigned.
16802 (validate_x_resource_name): Check for implausibly long names,
16803 and don't assume name length fits in 'int'.
16804 (x_get_resource_string): Don't blindly alloca invocation name;
16805 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16808 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16809 (xg_check_special_colors, xg_set_geometry):
16810 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16812 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16813 Use esprintf, not sprintf, in case result does not fit in int.
16815 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16816 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16817 it as a large positive number.
16818 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16819 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16821 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16822 in case result does not fit in int.
16824 * print.c (float_to_string): Detect width overflow more reliably.
16825 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16826 buffer overrun. Don't assume list length fits in 'int'. Treat
16827 print length of 0 as 0, not as infinity; to be consistent with other
16828 uses of print length in this function. Don't overflow print length
16829 index. Don't assume hash table size fits in 'long', or that
16830 vectorlike size fits in 'unsigned long'.
16832 * process.c (make_process): Use printmax_t, not int, to format
16833 process-name gensyms.
16835 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16837 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16838 to avoid potential buffer overrun.
16840 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16841 if X resource line is longer than 512 bytes.
16843 * xfns.c (x_window): Make sprintf buffer a bit bigger
16844 to avoid potential buffer overrun.
16846 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16848 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16850 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16852 Integer overflow fixes for scrolling, etc.
16853 Without these, Emacs silently mishandles large integers sometimes.
16854 For example, "C-u 4294967297 M-x recenter" was treated as if
16855 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16857 * xdisp.c (try_window_id): Check Emacs fixnum range before
16858 converting to 'int'.
16860 * window.c (window_scroll_line_based, Frecenter):
16861 Check that an Emacs fixnum is in range before assigning it to 'int'.
16862 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16863 values converted from Emacs fixnums.
16864 (Frecenter): Don't wrap around a line count if it is out of 'int'
16865 range; instead, treat it as an extreme value.
16866 (Fset_window_configuration, compare_window_configurations):
16867 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16869 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16870 that can exceed INT_MAX. Check that EMACS_INT value is in range
16871 before assigning it to the (possibly-narrower) index.
16872 (match_limit): Don't assume that a fixnum can fit in 'int'.
16874 * print.c (print_object): Use ptrdiff_t, not int, for index that can
16877 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
16878 (Fvertical_motion): Don't wrap around LINES values that don't fit
16879 in 'int'. Instead, treat them as extreme values. This is good
16880 enough for windows, which can't have more than INT_MAX lines anyway.
16882 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16884 * Require libxml/parser.h to avoid compilation warning.
16886 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16888 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16889 since this reportedly can destroy thread storage.
16891 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
16893 * syntax.c (find_defun_start): Update all cache variables if
16894 exiting early (Bug#9401).
16896 2011-08-30 Eli Zaretskii <eliz@gnu.org>
16898 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16900 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16901 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16902 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16904 * term.c (tty_append_glyph): New function.
16905 (produce_stretch_glyph): Static function and its prototype deleted.
16907 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16910 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16912 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16913 when checking :margin (Bug#9390).
16914 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
16915 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
16916 so that the name doesn't mislead. All uses changed.
16918 2011-08-28 Johan Bockgård <bojohan@gnu.org>
16920 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16923 2011-08-27 Eli Zaretskii <eliz@gnu.org>
16925 * xdisp.c (move_it_to): Don't bail out early when reaching
16926 position beyond to_charpos, if we are scanning backwards.
16927 (move_it_vertically_backward): When DY == 0, make sure we get to
16928 the first character in the line after the newline.
16930 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16932 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16933 (ccl_driver): Do not generate an out-of-range pointer.
16934 (Fccl_execute_on_string): Remove unnecessary check for
16935 integer overflow, noted by Stefan Monnier in
16936 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16937 Remove a FIXME that didn't need fixing.
16938 Simplify the newly-introduced buffer reallocation code.
16940 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
16942 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16944 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
16946 Integer and memory overflow issues (Bug#9196).
16948 * doc.c (get_doc_string): Rework so that
16949 get_doc_string_buffer_size is the actual buffer size, rather than
16950 being 1 less than the actual buffer size; this makes xpalloc more
16953 * image.c (x_allocate_bitmap_record, cache_image):
16954 * xselect.c (Fx_register_dnd_atom):
16955 Simplify previous changes by using xpalloc.
16957 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16958 since either will do and ptrdiff_t is convenient with xpalloc.
16960 * charset.c (charset_table_size)
16961 (struct charset_sort_data.priority): Now ptrdiff_t.
16962 (charset_compare): Don't overflow if priorities differ greatly.
16963 (Fsort_charsets): Don't assume list length fits in int.
16964 Check for size-calculation overflow when allocating sort data.
16965 (syms_of_charset): Allocate an initial charset table that is
16966 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16968 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16970 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16971 The actual value is always <= INT_MAX, and leaving it unsigned made
16972 overflow checking harder.
16974 * dispextern.h (struct glyph_matrix.rows_allocated)
16975 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16976 with xpalloc. The values are still always <= INT_MAX.
16978 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16980 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16981 (SAFE_NALLOCA): New macro.
16983 * region-cache.c (struct boundary.pos, find_cache_boundary)
16984 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16985 (set_cache_region, invalidate_region_cache)
16986 (revalidate_region_cache, know_region_cache, region_cache_forward)
16987 (region_cache_backward, pp_cache):
16988 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16989 so that ptrdiff_t * can be passed to xpalloc.
16990 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16991 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16992 (pp_cache): Don't assume cache_len fits in int.
16993 * region-cache.h: Adjust extern decls to match.
16995 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16996 EMACS_INT, since either will do, for xpalloc.
16998 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16999 (xnmalloc, xnrealloc, xpalloc): New functions.
17001 * bidi.c (bidi_shelve_header_size): New constant.
17002 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17003 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17005 * bidi.c (bidi_cache_shrink):
17006 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17008 Don't update size of array until after memory allocation succeeds,
17009 because xmalloc/xrealloc may not return.
17010 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17011 now that we have proper integer overflow checking.
17012 (record_overlay_string, overlay_strings): Catch overflows when
17013 calculating size of overlay_str_buf.
17015 * callproc.c (Fcall_process): Check for size overflow when
17016 calculating size of args2.
17017 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17018 Normally we prefer signed values, but sticking with ptrdiff_t would
17019 require adding more-complicated checks.
17021 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17022 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17023 Redo buffer-overflow calculations to avoid integer overflow.
17024 Add a FIXME comment where memory seems to be over-allocated.
17026 * character.c (Fstring): Check for size-calculation overflow.
17028 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17029 unnecessary integer overflow. Check for size overflow.
17030 (encode_coding_object): Don't update size until xmalloc succeeds.
17032 * composite.c (get_composition_id): Check for overflow in glyph
17033 length calculations.
17035 Integer and memory overflow fixes for display code.
17036 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17037 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17038 (scrolling_window): Check for overflow in size calculations.
17039 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17040 Don't assume glyph table len fits in int.
17041 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17042 (row_table_size): Now ptrdiff_t, not int.
17043 (scrolling_window): Avoid overflow in size calculations.
17044 Don't update size until allocation succeeds.
17045 * fns.c (concat): Check for overflow in size calculations.
17046 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17047 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17048 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17050 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17051 (get_doc_string): Check for size calculation overflow.
17052 Don't update size until allocation succeeds.
17053 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17054 EMACS_INT, where ptrdiff_t will do.
17055 (Fsubstitute_command_keys): Check for string overflow.
17057 * editfns.c (set_time_zone_rule): Don't assume environment length
17059 (message_length): Now ptrdiff_t, not int.
17060 (Fmessage_box): Don't update size until allocation succeeds.
17061 Don't assume message length fits in int.
17062 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17064 * emacs.c (main): Do not reallocate argv, since there is a null at
17065 the end that can be overwritten, and this way there's no need to
17066 worry about size-calculation overflow.
17067 (sort_args): Check for size-calculation overflow.
17069 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17071 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17073 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17074 (x_set_scroll_bar_width, x_figure_window_size):
17075 Check for integer overflow.
17076 (x_set_alpha): Do not assume XINT fits in int.
17078 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17079 This is for the members text_lines, text_cols, total_lines, total_cols,
17080 where the system imposes an 'int' limit.
17082 * fringe.c (Fdefine_fringe_bitmap):
17083 Don't update size until alloc works.
17085 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17086 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17088 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17089 Check for size-calculation overflow.
17090 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17091 do, as we prefer signed integers.
17092 (id_to_widget.max_size, id_to_widget.used)
17093 (xg_store_widget_in_map, xg_remove_widget_from_map)
17094 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17095 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17096 Use and return ptrdiff_t, not int.
17097 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17098 * gtkutil.h: Change prototypes to match the above.
17100 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17101 are duplicate now that they've been promoted to lisp.h.
17102 (x_allocate_bitmap_record, x_alloc_image_color)
17103 (make_image_cache, cache_image, xpm_load):
17104 Don't update size until alloc is done.
17105 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17107 Check for size calculation overflow.
17108 (ct_colors_allocated_max): New constant.
17109 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17112 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17113 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17114 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17115 Use ptrdiff_t, not int, to count maps.
17116 (read_char_minibuf_menu_prompt): Check for overflow in size
17117 calculations. Don't update size until allocation succeeds.
17118 Redo calculations to avoid overflow.
17119 * keyboard.h: Change prototypes to match the above.
17121 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17123 (current_minor_maps): Check for size calculation overflow.
17124 * keymap.h: Change prototypes to match the above.
17126 * lread.c (read1, init_obarray): Don't update size until alloc done.
17128 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17129 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17131 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17132 Now ptrdiff_t, not int.
17133 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17134 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17136 * process.c (Fnetwork_interface_list): Check for overflow
17137 in size calculation.
17139 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17141 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17142 overflow. Don't bother calling xmalloc when xrealloc will do.
17144 * search.c (Freplace_match): Check for size calculation overflow.
17145 (Fset_match_data): Don't assume list lengths fit in 'int'.
17147 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17148 for command line length. Do not attempt to address one before the
17149 beginning of an array, as that's not portable.
17151 * term.c (max_frame_lines): Remove; unused.
17152 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17154 (encode_terminal_code, calculate_costs): Check for size
17155 calculation overflow.
17156 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17157 table lengths and related sizes. Don't update size until alloc
17158 done. Redo calculations to avoid overflow.
17159 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17161 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17162 subtracting pointers.
17163 (gobble_line): Check for overflow more carefully. Don't update size
17166 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17167 Don't update size until alloc done.
17168 Redo size calculations to avoid overflow.
17169 Check for size calculation overflow.
17170 (main) [DEBUG]: Fix typo in invoking tparam1.
17172 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17173 Use ptrdiff_t, not int, for sizes.
17174 (store_mode_line_noprop_char): Don't update size until alloc done.
17176 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17177 Use ptrdiff_t, not int, for sizes.
17178 (Finternal_make_lisp_face, cache_face):
17179 Check for size calculation overflow.
17180 (cache_face): Treat size calculation overflows as if they were
17181 memory exhaustion (the usual treatment), rather than aborting.
17183 * xfns.c (x_encode_text, x_set_name_internal)
17184 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17185 sizes, since they can exceed INT_MAX in size. Check for size
17186 calculation overflow.
17188 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17189 (xg_select): Check for size calculation overflow.
17190 Don't update size until alloc done.
17192 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17193 as sprintf is limited to int lengths.
17195 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17196 (X_LONG_MIN): New macros.
17197 Use them to make the following changes clearer.
17198 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17199 This change doesn't affect the value now, but it may help remind
17200 future maintainers not to raise the value too much later.
17201 (SELECTION_QUANTUM): Remove, replacing with ...
17202 (selection_quantum): ... new function, which avoids overflow.
17204 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17205 assumption that selection length fits in 'int'.
17206 (x_reply_selection_request, x_handle_selection_request)
17207 (x_get_window_property, receive_incremental_selection)
17208 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17209 (lisp_data_to_selection_data, clean_local_selection_data):
17210 Use ptrdiff_t, not int, to record length of selection.
17211 (x_reply_selection_request, x_get_window_property)
17212 (receive_incremental_selection, x_property_data_to_lisp):
17213 Redo calculations to avoid overflow.
17214 (x_reply_selection_request): When sending hint, ceiling it at
17215 X_LONG_MAX rather than relying on wraparound overflow to send
17217 (x_get_window_property, receive_incremental_selection)
17218 (lisp_data_to_selection_data, x_property_data_to_lisp):
17219 Check for size-calculation overflow.
17220 (x_get_window_property, receive_incremental_selection)
17221 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17222 Don't store size until memory allocation succeeds.
17223 (x_get_window_property): Plug memory leak on memory exhaustion.
17224 Don't double-block input; malloc is safe here. Don't assume 2**34
17225 - 4 fits in unsigned long. Add an xassert to check
17226 XGetWindowProperty overflow. Be more careful about overflow
17227 calculations, and distinguish size from memory overflow better.
17228 (receive_incremental_selection): When tracing, don't assume
17229 unsigned int is less than INT_MAX.
17230 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17231 harmful) conversions of unsigned short to int.
17232 (lisp_data_to_selection_data): Don't assume that integers
17233 in the range -65535 through -1 fit in an X unsigned short.
17234 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17235 result parameters unless successful. Rely on cons_to_unsigned
17236 to report problems with elements; the old code wasn't right anyway.
17237 (x_check_property_data): Check for int overflow; we cannot use
17238 a wider type due to X limits.
17239 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17241 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17243 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17244 (x_term_init): Check for size calculation overflow.
17245 (x_color_cells): Don't store size until memory allocation succeeds.
17246 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17247 Don't assume alloca size is less than MAX_ALLOCA.
17248 (x_term_init): Don't assume length fits in int (sprintf is limited
17251 Use ptrdiff_t for composition IDs.
17252 * character.c (lisp_string_width):
17253 * composite.c (composition_table_size, n_compositions)
17254 (get_composition_id, composition_gstring_from_id):
17255 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17256 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17257 * window.c (Frecenter):
17258 Use ptrdiff_t, not int, for composition IDs.
17259 * composite.c (get_composition_id): Check for integer overflow.
17260 * composite.h: Adjust prototypes to match the above changes.
17262 Use ptrdiff_t for hash table indexes.
17263 * category.c (hash_get_category_set):
17264 * ccl.c (ccl_driver):
17265 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17266 * coding.c (coding_system_charset_list, detect_coding_system):
17267 * coding.h (struct coding_system.id):
17268 * composite.c (get_composition_id, gstring_lookup_cache):
17269 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17270 * image.c (xpm_get_color_table_h):
17271 * lisp.h (hash_lookup, hash_put):
17272 * minibuf.c (Ftest_completion):
17273 Use ptrdiff_t for hash table indexes, not int (which is too
17274 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17275 32-bit --with-wide-int hosts).
17277 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17278 Add a FIXME comment about memory leaks.
17279 (syms_of_charset): Don't assume xmalloc returns.
17281 Don't assume that stated character widths fit in int.
17282 * character.c (Fchar_width, c_string_width, lisp_string_width):
17283 * character.h (CHAR_WIDTH):
17284 * indent.c (MULTIBYTE_BYTES_WIDTH):
17285 Use sanitize_char_width to avoid undefined and/or bad behavior
17286 with outlandish widths.
17287 * character.h (sanitize_tab_width): Rename from sanitize_width,
17288 now that we have two such functions. All uses changed.
17289 (sanitize_char_width): New inline function.
17291 Don't assume that tab-width fits in int.
17292 * character.h (sanitize_width): New inline function.
17293 (SANE_TAB_WIDTH): New macro.
17294 (ASCII_CHAR_WIDTH): Use it.
17295 * indent.c (sane_tab_width): Remove. All uses replaced by
17296 SANE_TAB_WIDTH (current_buffer).
17297 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17299 * fileio.c: Integer overflow issues with file modes.
17300 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17302 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17303 Remove unreachable code.
17304 (read_hex, load_charset_map_from_file): Check for integer overflow.
17306 * xterm.c: Don't go over XClientMessageEvent limit.
17307 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17308 (x_send_scroll_bar_event): Likewise. Check that the size does not
17309 exceed limits imposed by XClientMessageEvent, as well as the usual
17310 ptrdiff_t and size_t limits.
17312 * keyboard.c: Overflow, signedness and related fixes.
17313 (make_lispy_movement): Use same integer type in forward decl
17314 that is used in the definition.
17315 (read_key_sequence, keyremap_step):
17316 Change bufsize argument back to int, undoing my 2011-03-30 change.
17317 We prefer signed types, and int is wide enough here.
17318 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17319 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17320 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17321 length, not size_t. Use ptrdiff_t for index, not int.
17322 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17323 possibility of integer overflow.
17325 Overflow, signedness and related fixes for images.
17327 * dispextern.h (struct it.stack[0].u.image.image_id)
17328 (struct_it.image_id, struct image.id, struct image_cache.size)
17329 (struct image_cache.used, struct image_cache.ref_count):
17330 * gtkutil.c (update_frame_tool_bar):
17331 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17332 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17333 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17334 * nsmenu.m (update_frame_tool_bar):
17335 * xdisp.c (calc_pixel_width_or_height):
17336 * xfns.c (image_cache_refcount):
17337 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17338 on typical 64-bit hosts.
17340 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17341 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17342 Omit unnecessary casts to int.
17343 (parse_image_spec): Check that integers fall into 'int' range
17344 when the callers expect that.
17345 (image_ascent): Redo ascent calculation to avoid int overflow.
17346 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17347 (lookup_image): Remove unnecessary tests.
17348 (xbm_image_p): Locals are now of int, not EMACS_INT,
17349 since parse_image_check makes sure they fit into int.
17350 (png_load, gif_load, svg_load_image):
17351 Prefer int to unsigned where either will do.
17352 (tiff_handler): New function, combining the cores of the
17353 old tiff_error_handler and tiff_warning_handler.
17354 This function is rewritten to use vsnprintf and thereby avoid
17355 stack buffer overflows. It uses only the features of vsnprintf
17356 that are common to both POSIX and native Microsoft.
17357 (tiff_error_handler, tiff_warning_handler): Use it.
17358 (tiff_load, gif_load, imagemagick_load_image):
17359 Don't assume :index value fits in 'int'.
17360 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17361 (imagemagick_load_image): Check that crop parameters fit into
17362 the integer types that MagickCropImage accepts. Don't assume
17363 Vimagemagick_render_type has a nonnegative value. Don't assume
17364 size_t fits in 'long'.
17365 (gs_load): Use printmax_t to print the widest integers possible.
17366 Check for integer overflow when computing image height and width.
17368 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17370 * xdisp.c (redisplay_window): Don't force window start if point
17371 will be invisible in the resulting window. (Bug#9324)
17373 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17375 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17376 the display spec is of the form `(space ...)'.
17377 (handle_display_spec): Return the value returned by
17378 handle_single_display_spec, not just 1 or zero.
17379 (handle_single_display_spec): If the display spec is of the form
17380 `(space ...)', and specifies display in the text area, return 2
17382 (try_cursor_movement): Check for the need to scroll more
17383 accurately, and prefer exact match for point under bidi.
17384 Don't advance `row' beyond the last row of the window.
17386 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17387 into disp_prop; all users changed.
17389 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17390 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17391 for the text covered by the display property.
17393 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17395 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17396 Change return value to nil.
17397 (Frecord_buffer): Delete unused function.
17399 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17401 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17402 buffers, return left-to-right.
17403 (set_cursor_from_row): Consider candidate row a win if its glyph
17404 represents a newline and point is on that newline. Fixes cursor
17405 positioning on the newline at EOL of R2L text within L2R
17406 paragraph, and vice versa.
17407 (try_cursor_movement): Check continued rows, in addition to
17408 continuation rows. Fixes unwarranted scroll when point enters a
17409 continued line of R2L text within an L2R paragraph, or vice versa.
17410 (cursor_row_p): Consider the case of point being equal to
17411 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17412 from the end of a short line to the beginning of a continued line
17413 of R2L text within L2R paragraph.
17414 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17415 composed characters.
17417 * bidi.c (bidi_check_type): Use xassert.
17418 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17421 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17423 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17426 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17428 * nsfont.m (ns_otf_to_script): Fix typo.
17430 2011-08-22 Kenichi Handa <handa@m17n.org>
17432 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17433 extra slot even if the purpose is char-code-property-table.
17435 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17437 * xdisp.c (redisplay_window): When computing centering_position,
17438 account for the height of the header line. (Bug#8874)
17440 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17441 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17442 candidate is selected by the mouse, and that candidate has a
17443 composed character under the mouse.
17445 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17446 coordinates reported by pos-visible-in-window-p for a composed
17447 character in column zero.
17449 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17451 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17453 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17455 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17456 consider it a hit if to_charpos is anywhere in the range of the
17457 composed buffer positions.
17459 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17461 * image.c (gif_load): Don't assume that each subimage has the same
17462 dimensions as the base image. Handle disposal method that is
17463 "undefined" by the gif spec (Bug#9335).
17465 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17467 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17468 (Fcondition_case): Document `debug' symbol in error handler.
17470 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17472 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17473 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17474 from an Org mode buffer to a Speedbar frame.
17476 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17477 a composition, take its buffer position from IT->cmp_it.charpos.
17478 Fixes cursor positioning at the beginning of a line that begins
17479 with a composed character.
17481 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17483 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17484 character bidirectional type, use STRONG_L instead. Fixes crashes
17485 in a buffer produced by `describe-categories'.
17487 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17488 members before the level stack, so they would be saved and
17489 restored when copying iterator state. Fixes incorrect reordering
17490 around TABs covered by display properties.
17492 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17494 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17496 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17498 * eval.c (internal_condition_case, internal_condition_case_1)
17499 (internal_condition_case_2, internal_condition_case_n):
17500 Remove unnecessary aborts (Bug#9081).
17502 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17504 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17505 has no `load' handler, try opening the file locally. (Bug#9311)
17507 2011-08-16 Ken Brown <kbrown@cornell.edu>
17509 * gmalloc.c: Expand comment.
17511 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17513 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17514 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17516 2011-08-16 Ken Brown <kbrown@cornell.edu>
17518 Fix memory allocation problems in Cygwin build (Bug#9273).
17520 * unexcw.c ( __malloc_initialized): Declare external variable.
17521 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17523 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17525 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17527 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17528 in the static heap.
17529 [CYGWIN] (special_realloc): New function.
17530 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17531 requests to realloc storage in the static heap.
17533 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17535 * bidi.c (bidi_initialize): Remove unused local.
17537 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17540 * biditype.h: Remove file.
17541 * makefile.w32-in ($(BLD)/bidi.$(O)):
17542 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17544 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17546 * chartab.c: Improve commentary for the uniprop_table API.
17548 * bidi.c (bidi_paragraph_init): Support zero value of
17549 bidi_ignore_explicit_marks_for_paragraph_level.
17550 (bidi_initialize): Use uniprop_table instead of including
17551 biditype.h and bidimirror.h.
17553 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17554 coordinates of the iterator when restoring from ppos_it.
17557 2011-08-14 Kenichi Handa <handa@m17n.org>
17559 * process.c (create_process): Call setup_process_coding_systems
17560 after the pid of the process is set to -1 (Bug#8162).
17562 2011-08-14 Eli Zaretskii <eliz@gnu.org>
17564 * xdisp.c (move_it_in_display_line_to): Don't invoke
17565 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17566 ppos_it. Fixes vertical cursor motion when line beginning is
17567 covered by an image. (Bug#9296)
17569 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17571 * nsterm.h (ns_run_ascript): Declare.
17572 (NSAPP_DATA2_RUNASSCRIPT): Define.
17574 * nsfns.m (as_script, as_result, as_status): New static variables.
17575 (ns_run_ascript): New function.
17576 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
17577 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17578 the event loop. Get status from as_status (Bug#7276).
17580 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17581 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17582 the event loop (Bug#7276).
17584 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17586 * gnutls.c (QCgnutls_bootprop_priority)
17587 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17588 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17589 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17590 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17591 (QCgnutls_bootprop_verify_hostname_error)
17592 (QCgnutls_bootprop_callbacks_verify): Rename from
17593 Qgnutls_bootprop_..., all uses changed.
17595 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17598 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17600 * xfaces.c (Qframe_set_background_mode): Now static.
17601 * dispextern.h (Qframe_set_background_mode): Remove decl.
17603 * process.c (Fnetwork_interface_info): Declare local only if needed.
17605 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17607 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17608 (Fnetwork_interface_list): Allocate in increments of bytes instead
17609 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17610 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17612 (struct ifflag_def): notrailers is smart on OSX.
17613 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17614 Get hardware address with getifaddrs if available.
17616 2011-08-12 Eli Zaretskii <eliz@gnu.org>
17618 * xdisp.c (iterate_out_of_display_property): xassert that
17619 IT->position is set to within IT->object's boundaries. Break from
17620 the loop as soon as EOB is reached; avoids infloops in redisplay
17621 when IT->position is set up wrongly due to some bug.
17622 Set IT->current to match the bidi iterator unconditionally.
17623 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17624 entry. Force push_it to save on the stack the current
17625 buffer/string position, to be restored by pop_it. Fix flags in
17626 the iterator structure wrt the object coming from a display
17627 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17628 properties. (Bug#9284)
17630 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
17632 * fontset.c (fontset_get_font_group): Add proper type checks.
17635 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17637 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17638 and LC_VERSION_MIN_MACOSX.
17639 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17640 (dump_it) [LC_FUNCTION_STARTS]: Use it.
17642 2011-08-08 Eli Zaretskii <eliz@gnu.org>
17644 * xdisp.c (forward_to_next_line_start): Allow to use the
17645 no-display-properties-and-no-overlays under bidi display.
17646 Set disp_pos in the bidi iterator to avoid searches for display
17647 properties and overlays.
17649 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
17651 * editfns.c (Fset_time_zone_rule): Document relationship with the
17654 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17655 the font entity extracted from the cache (Bug#8109).
17657 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
17659 * composite.c (autocmp_chars): Don't reset point. That is done by
17660 restore_point_unwind (Bug#5984).
17662 2011-08-07 Juri Linkov <juri@jurta.org>
17664 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17665 to show the arg `TIME' instead of `TIMEVAL'.
17667 2011-08-06 Eli Zaretskii <eliz@gnu.org>
17669 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17670 display property strides EOL and includes a newline, as in
17671 longlines-mode. (Bug#9254)
17672 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17673 word-wrap under bidirectional display. (Bug#9224)
17675 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17676 is non-zero, even if the data buffer is NULL. Fixes a crash in
17677 vertical-motion with longlines-mode. (Bug#9254)
17679 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17681 * bidi.c <bidi_cache_total_alloc>: Now static.
17682 (bidi_initialize): Initialize bidi_cache_total_alloc.
17684 * xdisp.c (display_line): Release buffer allocated for shelved bidi
17687 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17688 amount allocated this far in `bidi_cache_total_alloc'.
17689 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17690 non-zero, only free the data buffer without restoring the cache
17691 contents. All callers changed.
17693 * dispextern.h (bidi_unshelve_cache): Update prototype.
17695 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17696 (move_it_in_display_line, move_it_to)
17697 (move_it_vertically_backward, move_it_by_lines): Replace the call
17698 to xfree to an equivalent call to bidi_unshelve_cache.
17699 (move_it_in_display_line_to): Fix logic of returning
17700 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
17702 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17704 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17705 came from a string character with a `cursor' property. (Bug#9229)
17707 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17709 * Makefile.in (LIB_PTHREAD): New variable.
17710 (LIBES): Add LIB_PTHREAD (Bug#9216).
17712 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17713 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17715 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17717 * regex.c (re_iswctype): Remove some redundant boolean conversions.
17719 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17721 * xterm.c (x_find_topmost_parent): New function.
17722 (x_set_frame_alpha): Find topmost parent window with
17723 x_find_topmost_parent and set the property there also (bug#9181).
17724 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17726 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17728 * callproc.c (Fcall_process): Avoid vfork clobbering
17729 the local vars buffer, coding_systems, current_dir.
17731 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17733 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17735 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17737 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17738 so that it is not optimized away.
17740 * xdisp.c (compute_display_string_pos): Remove unused local.
17742 2011-08-02 Eli Zaretskii <eliz@gnu.org>
17744 Fix slow cursor motion and scrolling in large buffers with
17745 selective display, like Org Mode buffers. (Bug#9218)
17747 * dispextern.h (struct bidi_it): New member disp_prop_p.
17749 * xdisp.c: Remove one-slot cache of display string positions.
17750 (compute_display_string_pos): Accept an additional argument
17751 DISP_PROP_P; callers changed. Scan at most 5K characters forward
17752 for a display string or property. If found, set DISP_PROP_P
17755 * bidi.c (bidi_fetch_char): Accept an additional argument
17756 DISP_PROP_P, and pass it to compute_display_string_pos.
17757 Only handle text covered by a display string if DISP_PROP_P is returned
17758 non-zero. All callers of bidi_fetch_char changed.
17760 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17762 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17764 2010-12-03 Don March <don@ohspite.net>
17766 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17767 last character M-[char] is translated to ESC [char] (bug#7541).
17769 2011-08-02 Kenichi Handa <handa@m17n.org>
17771 * lisp.h (uniprop_table): Extern it.
17773 * chartab.c (uniprop_table): Make it non-static.
17775 2011-08-01 Eli Zaretskii <eliz@gnu.org>
17777 * xdisp.c (forward_to_next_line_start): Accept additional argument
17778 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17780 (reseat_at_next_visible_line_start): Use the bidi iterator state
17781 returned by forward_to_next_line_start to restore the state of
17782 it->bidi_it after backing up to previous newline. (Bug#9212)
17784 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17786 * regex.c (re_comp): Protoize.
17787 (re_exec): Fix return type.
17788 (regexec): Fix type of `ret'. (Bug#9203)
17790 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17792 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17793 This is needed if max-image-size is a floating-point number.
17795 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17797 * print.c (print_object): Print empty symbol as ##.
17799 * lread.c (read1): Read ## as empty symbol.
17801 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17803 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17804 setting frame foreground color (Bug#9175).
17805 (x_set_background_color): Likewise.
17807 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17808 contents (Bug#9176).
17809 (EmacsTooltip -init): Remove bezels and add shadows to
17812 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17813 or scroll bar (Bug#8470).
17815 * nsfont.m (nsfont_open): Remove assignment to voffset and
17816 unnecessary vars hshink, expand, hd, full_height, min_height.
17817 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17819 * nsterm.h (nsfont_info): Remove voffset field.
17821 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17823 Implement strike-through and overline on NextStep (Bug#8863).
17825 * nsfont.m (nsfont_open): Use underline position provided by font,
17826 instead of hard-coded value of 2.
17827 (nsfont_draw): Call ns_draw_text_decoration instead.
17829 * nsterm.h: Add declaration for ns_draw_text_decoration.
17831 * nsterm.m (ns_draw_text_decoration): New function for drawing
17832 underline, overline, and strike-through.
17833 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17834 ns_draw_text_decoration. Change treatment of cursor drawing to
17835 accommodate underlining, etc.
17837 2011-07-28 Eli Zaretskii <eliz@gnu.org>
17839 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17842 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17844 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17845 Without this fix, if a signal arrives just after memory fills up,
17846 'malloc' might be invoked reentrantly.
17848 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17849 In other words, assume that every image size is allowed, on non-X
17850 hosts. This assumption is probably wrong, but it lets Emacs compile.
17852 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17854 * regex.c (re_iswctype): Convert return values to boolean.
17856 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17858 * xdisp.c (compute_display_string_pos): Don't use cached display
17859 string position if the buffer had its restriction changed.
17862 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17864 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17866 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17868 Integer signedness and overflow and related fixes. (Bug#9079)
17870 * bidi.c: Integer size and overflow fixes.
17871 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17872 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17873 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17874 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17875 (bidi_find_other_level_edge):
17876 Use ptrdiff_t instead of EMACS_INT where either will do.
17877 This works better on 32-bit hosts configured --with-wide-int.
17878 (bidi_cache_ensure_space): Check for size-calculation overflow.
17879 Use % rather than repeated addition, for better worst-case speed.
17880 Don't set bidi_cache_size until after xrealloc returns, because it
17882 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
17883 (bidi_cache_ensure_space): Also check that the bidi cache size
17884 does not exceed that of the largest Lisp string or buffer. See Eli
17885 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
17887 * alloc.c (__malloc_size_t): Remove.
17888 All uses replaced by size_t. See Andreas Schwab's note
17889 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17891 * image.c: Improve checking for integer overflow.
17892 (check_image_size): Assume that f is nonnull, since
17893 it is always nonnull in practice. This is one less thing to
17894 worry about when checking for integer overflow later.
17895 (x_check_image_size): New function, which checks for integer
17896 overflow issues inside X.
17897 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17898 This removes the need for a memory_full check.
17899 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17900 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17901 (xbm_read_bitmap_data): Change locals back to 'int', since
17902 their values must fit in 'int'.
17903 (xpm_load_image, png_load, tiff_load):
17904 Invoke x_create_x_image_and_pixmap earlier,
17905 to avoid much needless work if the image is too large.
17906 (tiff_load): Treat overly large images as if
17907 x_create_x_image_and_pixmap failed, not as malloc failures.
17908 (gs_load): Use x_check_image_size.
17910 * gtkutil.c: Omit integer casts.
17911 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17912 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17914 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17916 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17917 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17918 would wrongly return t on a 64-bit host.
17920 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17921 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17922 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17923 and therefore cause GCC to emit a bogus diagnostic in some cases.
17925 * image.c: Integer signedness and overflow and related fixes.
17926 This is not an exhaustive set of fixes, but it's time to
17927 record what I've got.
17928 (lookup_pixel_color, check_image_size): Remove redundant decls.
17929 (check_image_size): Don't assume that arbitrary EMACS_INT values
17930 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17931 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17932 (tiff_load, imagemagick_load_image):
17933 Check for overflow in size calculations.
17934 (x_create_x_image_and_pixmap): Remove unnecessary test for
17935 xmalloc returning NULL; that can't happen.
17936 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17937 (xpm_color_bucket): Use better integer hashing function.
17938 (xpm_cache_color): Don't possibly over-allocate memory.
17939 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17940 (gif_memory_source):
17941 Use ptrdiff_t, not int or size_t, to record sizes.
17942 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17943 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17944 either works, as we prefer signed integers.
17945 (tiff_read_from_memory, tiff_write_from_memory):
17946 Return tsize_t, not size_t, since that's what the TIFF API wants.
17947 (tiff_read_from_memory): Don't fail simply because the read would
17948 go past EOF; instead, return a short read.
17949 (tiff_load): Omit no-longer-needed casts.
17950 (Fimagemagick_types): Don't assume size fits into 'int'.
17952 Improve hashing quality when configured --with-wide-int.
17953 * fns.c (hash_string): New function, taken from sxhash_string.
17954 Do not discard information about ASCII character case; this
17955 discarding is no longer needed.
17956 (sxhash-string): Use it. Change sig to match it. Caller changed.
17957 * lisp.h: Declare it.
17958 * lread.c (hash_string): Remove, since we now use fns.c's version.
17959 The fns.c version returns a wider integer if --with-wide-int is
17960 specified, so this should help the quality of the hashing a bit.
17962 * emacs.c: Integer overflow minor fix.
17963 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17964 Define only if GNU_LINUX.
17965 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17967 * dispnew.c: Integer signedness and overflow fixes.
17968 Remove unnecessary forward decls, that were a maintenance hassle.
17969 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17971 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17972 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17973 (prepare_desired_row, line_draw_cost):
17974 Use int, not unsigned, where either works.
17975 (save_current_matrix, restore_current_matrix):
17976 Use ptrdiff_t, not size_t, where either works.
17977 (init_display): Check for overflow more accurately, and without
17978 relying on undefined behavior.
17980 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17981 Remove, replacing with the new symbols in lisp.h. All uses changed.
17982 * fileio.c (make_temp_name):
17983 * filelock.c (lock_file_1, lock_file):
17984 * xdisp.c (message_dolog):
17985 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17986 Use pMd etc. instead.
17987 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17988 replacing the pWIDE etc. symbols removed from editfns.c.
17990 * keyboard.h (num_input_events): Now uintmax_t.
17991 This is (very slightly) less likely to mess up due to wraparound.
17994 * buffer.c: Integer signedness fixes.
17995 (alloc_buffer_text, enlarge_buffer_text):
17996 Use ptrdiff_t rather than size_t when either will do, as we prefer
17999 * alloc.c: Integer signedness and overflow fixes.
18000 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18001 (__malloc_size_t): Default to size_t, not to int.
18002 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18003 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18004 Prefer ptrdiff_t to size_t when either would do, as we prefer
18006 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18007 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18008 Now const. Initialize with values that are in range even if char
18010 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18011 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18012 These functions do the right thing with sizes > 2**32.
18013 (check_depth): Now ptrdiff_t, not int.
18014 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18015 Adjust to new way of storing sizes. Check for size overflow bugs
18017 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18018 slightly wrong anyway, as it missed one instance of
18019 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18020 (refill_memory_reserve): Omit needless cast to size_t.
18021 (mark_object_loop_halt): Mark as externally visible.
18023 * xselect.c: Integer signedness and overflow fixes.
18024 (Fx_register_dnd_atom, x_handle_dnd_message):
18025 Use ptrdiff_t, not size_t, since we prefer signed.
18026 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18027 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18028 x_dnd_atoms_size and x_dnd_atoms_length.
18030 * doprnt.c: Prefer signed to unsigned when either works.
18032 * doprnt.c (doprnt):
18034 * xdisp.c (vmessage):
18035 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18036 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18037 prefer signed arithmetic to avoid comparison confusion.
18038 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18039 but is a bit tricky.
18041 Assume freestanding C89 headers, string.h, stdlib.h.
18042 * data.c, doprnt.c, floatfns.c, print.c:
18043 Include float.h unconditionally.
18044 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18045 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18046 * regex.c: Likewise for stddef.h, string.h.
18047 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18048 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18049 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18050 (STDC_HEADERS): Remove obsolete defines.
18051 * sysdep.c: Include limits.h unconditionally.
18053 Assume support for memcmp, memcpy, memmove, memset.
18054 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18055 * regex.c (memcmp, memcpy):
18056 Remove; we assume C89 now.
18058 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18059 (__malloc_safe_bcopy): Remove; no longer needed.
18061 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18062 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18063 well either way, and we prefer signed to unsigned.
18065 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18067 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18068 closes the connection while we're reading (bug#9182).
18070 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18072 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18073 are specified (Bug#9168).
18075 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18077 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18078 Found by GCC static checking and --with-wide-int on a 32-bit host.
18080 2011-07-25 Eli Zaretskii <eliz@gnu.org>
18082 * xdisp.c (compute_display_string_pos): Fix logic of caching
18083 previous display string position. Initialize cached_prev_pos to
18084 -1. Fixes slow-down at the beginning of a buffer.
18086 2011-07-24 Eli Zaretskii <eliz@gnu.org>
18088 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18089 for attrs[LFACE_FONTSET_INDEX].
18091 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18093 * xml.c (parse_region): Remove unused local
18094 that was recently introduced.
18096 2011-07-23 Eli Zaretskii <eliz@gnu.org>
18098 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18099 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18101 * xdisp.c (move_it_in_display_line_to): Record the best matching
18102 position for TO_CHARPOS while scanning the line, and restore it on
18103 exit if none of the characters scanned was an exact match.
18104 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18105 when exact match is impossible due to invisible text, and the
18106 lines are truncated.
18108 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18110 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18113 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18115 Fix a significant slow-down of cursor motion with C-n, C-p,
18116 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18117 auto-repeat under bidi redisplay in fontified buffers.
18118 * xdisp.c (compute_stop_pos_backwards): New function.
18119 (next_element_from_buffer): Call compute_stop_pos_backwards to
18120 find a suitable prev_stop when we find ourselves before
18122 (reseat): Don't look for prev_stop, as that could mean a very long
18124 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18125 <cached_disp_overlay_modiff>: Cache for last found display string
18127 (compute_display_string_pos): Return the cached position if asked
18128 about the same buffer in the same area of character positions, and
18129 the buffer wasn't changed since the time the display string
18130 position was cached.
18132 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18134 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18135 is an integer, which is important for empty lines. (Bug#9149)
18137 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
18139 * frame.c (Fmodify_frame_parameters): In tty case, update the
18140 default face if necessary (Bug#4238).
18142 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
18144 * editfns.c (Fstring_to_char): No need to explain what a character
18145 is in the docstring (Bug#6576).
18147 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18149 * xml.c (parse_region): Make sure we always return a tree.
18151 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18153 * xml.c (parse_region): If a document contains only comments,
18156 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18158 * xml.c (make_dom): Return comments, too.
18160 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18163 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18164 and the surrounding thread.
18165 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18166 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18167 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18169 * s/openbsd.h (BROKEN_SIGIO): Define.
18170 * unexelf.c (unexec) [__OpenBSD__]:
18171 Don't update the .mdebug section of the Alpha COFF symbol table.
18173 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18175 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18178 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18180 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18181 This fixes some race conditions on the permissions of any newly
18184 * alloc.c (valid_pointer_p): Use pipe, not open.
18185 This fixes some permissions issues when debugging.
18187 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18188 If fchown fails to set both uid and gid, try to set just gid,
18189 as that is sometimes allowed. Adjust the file's mode to eliminate
18190 setuid or setgid bits that are inappropriate if fchown fails.
18192 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18194 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18195 to compare Lisp_Objects.
18196 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18197 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18198 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18200 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18202 * lread.c (read_integer): Unread even EOF character.
18203 (read1): Likewise. Properly record start position of symbol.
18205 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18206 symbol character follows.
18208 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18210 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18211 This works around a problem with the previous change to Fcopy_file.
18212 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18213 and without this change, GCC might complain about discarding
18214 fchown's return value.
18216 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
18218 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18220 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18222 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18224 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18226 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18227 it's used from the C level.
18229 * process.c: Use the same condition for POLL_FOR_INPUT in both
18230 keyboard.c and process.c (bug#1858).
18232 2011-07-09 Lawrence Mitchell <wence@gmx.li>
18234 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18235 (Fgnutls_boot): Use it.
18237 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18239 * doc.c (Fsubstitute_command_keys): Revert last change.
18241 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18243 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18244 quotes the next character, and doesn't affect other longer
18245 sequences (bug#8935).
18247 * lread.c (syms_of_lread): Clarify that is isn't only
18248 `eval-buffer' and `eval-defun' that's affected by
18249 `lexical-binding' (bug#8460).
18251 2011-07-15 Eli Zaretskii <eliz@gnu.org>
18253 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18254 bidi redisplay when a line includes both an image and is truncated.
18256 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18258 Fix minor problems found by static checking.
18259 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18260 (elsz): Now a signed constant, not a size_t var. We prefer signed
18261 types to unsigned, to avoid integer comparison confusion. Without
18262 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18263 "cannot optimize loop, the loop counter may overflow", a symptom
18265 * indent.c (Fvertical_motion): Mark locals as initialized.
18266 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18268 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18270 * search.c (Fre_search_backward): Mention `case-fold-search' in
18271 all the re_search_* functions (bug#8138).
18273 * keyboard.c (Fopen_dribble_file): Document when the file is
18276 2011-07-14 Eli Zaretskii <eliz@gnu.org>
18278 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18281 Support bidi reordering of display and overlay strings.
18282 * xdisp.c (compute_display_string_pos)
18283 (compute_display_string_end): Accept additional argument STRING.
18284 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18285 (reseat_to_string): Initialize bidi_it->string.s and
18286 bidi_it->string.schars.
18287 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18288 NULL (avoids a crash in bidi_paragraph_init).
18289 Initialize itb.string.lstring.
18290 (init_iterator): Call bidi_init_it only of a valid
18291 buffer position was specified. Initialize paragraph_embedding to
18293 (reseat_to_string): Initialize the bidi iterator.
18294 (display_string): If we need to ignore text properties of
18295 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18296 original value of -1 will not work with bidi.)
18297 (compute_display_string_pos): First arg is now struct
18298 `text_pos *'; all callers changed. Support display properties on
18300 (compute_display_string_end): Support display properties on Lisp
18302 (init_iterator, reseat_1, reseat_to_string): Initialize the
18303 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18304 when iterating on a string not from display properties).
18305 (compute_display_string_pos, compute_display_string_end):
18306 Fix calculation of the object to scan. Fixes an error when using
18308 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18309 base_level_stop; instead, set base_level_stop to BEGV.
18310 Fixes crashes in vertical-motion.
18311 (next_element_from_buffer): Improve commentary for when
18312 the iterator is before prev_stop.
18313 (init_iterator): Initialize bidi_p from the default value of
18314 bidi-display-reordering, not from buffer-local value. Use the
18315 buffer-local value only if initializing for buffer iteration.
18316 (handle_invisible_prop): Support invisible properties on strings
18317 that are being bidi-reordered.
18318 (set_iterator_to_next): Support bidi reordering of C strings and
18320 (next_element_from_string): Support bidi reordering of Lisp
18322 (handle_stop_backwards): Support Lisp strings as well.
18323 (display_string): Support display of R2L glyph rows.
18324 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18325 (init_iterator): Don't initialize it->bidi_p for strings
18327 (reseat_to_string): Initialize it->bidi_p for strings here.
18328 (next_element_from_string, next_element_from_c_string)
18329 (next_element_from_buffer): Add xassert's for correspondence
18330 between IT's object being iterated and it->bidi_it.string
18332 (face_before_or_after_it_pos): Support bidi iteration.
18333 (next_element_from_c_string): Handle the case of the first string
18334 character that is not the first one in the visual order.
18335 (get_visually_first_element): New function, refactored from common
18336 parts of next_element_from_buffer, next_element_from_string, and
18337 next_element_from_c_string.
18338 (tool_bar_lines_needed, redisplay_tool_bar)
18339 (display_menu_bar): Force left-to-right direction. Add a FIXME
18340 comment for making that be controlled by a user option.
18341 (push_it, pop_it): Save and restore the state of the
18342 bidi iterator. Save and restore the bidi_p flag.
18343 (pop_it): Iterate out of display property for string iteration as
18345 (iterate_out_of_display_property): Support iteration over strings.
18346 (handle_single_display_spec): Set up it->bidi_it for iteration
18347 over a display string, and call bidi_init_it.
18348 (handle_single_display_spec, next_overlay_string)
18349 (get_overlay_strings_1, push_display_prop): Set up the bidi
18350 iterator for displaying display or overlay strings.
18351 (forward_to_next_line_start): Don't use the shortcut if
18353 (back_to_previous_visible_line_start): If handle_display_prop
18354 pushed the iterator stack, restore the internal state of the bidi
18355 iterator by calling bidi_pop_it same number of times.
18356 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18357 and we are bidi-iterating, don't decrement the iterator position;
18358 instead, set the first_elt flag in the bidi iterator, to produce
18360 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18361 (push_display_prop): xassert that we are iterating a buffer.
18362 (push_it, pop_it): Save and restore paragraph_embedding member.
18363 (handle_single_display_spec, next_overlay_string)
18364 (get_overlay_strings_1, reseat_1, reseat_to_string)
18365 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18366 correctly. Don't assume unibyte strings are not bidi-reordered.
18367 (compute_display_string_pos)
18368 (compute_display_string_end): Fix handling the case of C string.
18369 (push_it, pop_it): Save and restore from_disp_prop_p.
18370 (handle_single_display_spec, push_display_prop): Set the
18371 from_disp_prop_p flag.
18372 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18373 (pop_it): Call iterate_out_of_display_property only if we are
18374 popping after iteration over a string that came from a display
18375 property. Fix a typo in popping stretch info. Add an assertion
18376 for verifying that the iterator position is in sync with the bidi
18378 (handle_single_display_spec, get_overlay_strings_1)
18379 (push_display_prop): Fix initialization of paragraph direction for
18380 string when that of the parent object is not yet determined.
18381 (reseat_1): Call bidi_init_it to resync the bidi
18382 iterator with IT's position. (Bug#7616)
18383 (find_row_edges): If ROW->start.pos gives position
18384 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18385 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18386 Reset the from_disp_prop_p flag.
18387 (SAVE_IT, RESTORE_IT): New macros.
18388 (pos_visible_p, face_before_or_after_it_pos)
18389 (back_to_previous_visible_line_start)
18390 (move_it_in_display_line_to, move_it_in_display_line)
18391 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18392 (try_scrolling, redisplay_window, display_line): Use them when
18393 saving a temporary copy of the iterator and restoring it back.
18394 (back_to_previous_visible_line_start, reseat_1)
18395 (init_iterator): Empty the bidi cache "stack".
18396 (move_it_in_display_line_to): If iterator ended up at
18397 EOL, but we never saw any buffer positions smaller than
18398 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18399 motion in bidi-reordered lines.
18400 (move_it_in_display_line_to): Record prev_method and prev_pos
18401 immediately before the call to set_iterator_to_next. Fixes cursor
18402 motion in bidi-reordered lines with stretch glyphs and strings
18403 displayed in margins. (Bug#8133) (Bug#8867)
18404 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18406 (pos_visible_p): Support positions in bidi-reordered lines.
18407 Save and restore bidi cache.
18409 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18410 (bidi_paragraph_info): Delete unused struct.
18411 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18412 (bidi_cache_start): New variable.
18413 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18415 (bidi_cache_fetch_state, bidi_cache_search)
18416 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18417 (bidi_cache_find, bidi_peek_at_next_level)
18418 (bidi_level_of_next_char, bidi_find_other_level_edge)
18419 (bidi_move_to_visually_next): Compare cache index with
18420 bidi_cache_start rather than with zero.
18421 (bidi_fetch_char): Accept new argument STRING; all callers
18422 changed. Support iteration over a string. Support strings with
18423 display properties. Support unibyte strings. Fix the type of
18424 `len' according to what STRING_CHAR_AND_LENGTH expects.
18425 (bidi_paragraph_init, bidi_resolve_explicit_1)
18426 (bidi_resolve_explicit, bidi_resolve_weak)
18427 (bidi_level_of_next_char, bidi_move_to_visually_next):
18428 Support iteration over a string.
18429 (bidi_set_sor_type, bidi_resolve_explicit_1)
18430 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18431 can now be zero (for strings); special values 0 and -1 were
18432 changed to -1 and -2, respectively.
18433 (bidi_char_at_pos): New function.
18434 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18435 Call it instead of FETCH_MULTIBYTE_CHAR.
18436 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18437 initialized to valid values.
18438 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18440 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18441 the test for valid cached positions. Fix the logic for looking up
18442 the sentinel state in the cache. GCPRO the Lisp string we are
18444 (bidi_push_it, bidi_pop_it): New functions.
18445 (bidi_initialize): Initialize the bidi cache start stack pointer.
18446 (bidi_cache_ensure_space): New function, refactored from part of
18447 bidi_cache_iterator_state. Don't assume the required size is just
18448 one BIDI_CACHE_CHUNK away.
18449 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18450 (bidi_count_bytes, bidi_char_at_pos): New functions.
18451 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18452 always valid if bidi_cache_idx is valid.
18453 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18454 is valid if it's going to be used.
18455 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18456 (bidi_cache_fetch_state, bidi_cache_search)
18457 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18458 (bidi_cache_iterator_state, bidi_cache_find)
18459 (bidi_find_other_level_edge, bidi_cache_start_stack):
18460 All variables related to cache indices are now EMACS_INT.
18462 * dispextern.h (struct bidi_string_data): New structure.
18463 (struct bidi_it): New member `string'. Make flag members be 1-bit
18464 fields, and put them last in the struct.
18465 (compute_display_string_pos, compute_display_string_end):
18467 (bidi_push_it, bidi_pop_it): Add prototypes.
18468 (struct iterator_stack_entry): New members bidi_p,
18469 paragraph_embedding, and from_disp_prop_p.
18470 (struct it): Member bidi_p is now a bit field 1 bit wide.
18471 (bidi_shelve_cache, bidi_unshelve_cache):
18472 Declare prototypes.
18474 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18475 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18476 and vector-like objects.
18478 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18479 cache around display iteration.
18481 * window.c (Fwindow_end, window_scroll_pixel_based)
18482 (displayed_window_lines, Frecenter): Save and restore the bidi
18483 cache around display iteration.
18485 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18487 * editfns.c (Fdelete_region): Clarify the use of the named
18488 parameters (bug#6788).
18490 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18492 * indent.c (Fvertical_motion): Set and restore w->pointm when
18493 saving and restoring the window's buffer (Bug#9006).
18495 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18497 * editfns.c (Fstring_to_char): Clarify just what is returned
18498 (bug#6576). Text by Eli Zaretskii.
18500 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18502 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18504 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18506 * buffer.c (mmap_find): Fix a typo.
18508 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18510 Fix execution of x selection hooks.
18511 * xselect.c (Qx_lost_selection_functions)
18512 (Qx_sent_selection_functions): New vars.
18513 (syms_of_xselect): DEFSYM them.
18514 (x_handle_selection_request): Pass Qx_sent_selection_functions
18515 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18516 (x_handle_selection_clear,x_clear_frame_selections):
18517 Pass Qx_lost_selection_functions rather than
18518 Vx_lost_selection_functions to Frun_hook_with_args.
18520 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18522 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18523 The old code sometimes used this field without initializing it.
18525 * alloc.c (gc_sweep): Don't read past end of array.
18526 In theory, the old code could also have corrupted Emacs internals,
18527 though it'd be very unlikely.
18529 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18531 * character.c (Fcharacterp): Don't advertise optional ignored
18532 argument. (Bug#4026)
18534 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18536 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18539 * window.c (Fset_window_start): Doc fix (bug#4199).
18540 (Fset_window_hscroll): Ditto.
18542 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18544 Fix minor new problems caught by GCC 4.6.1.
18545 * term.c (init_tty): Remove unused local.
18546 * xsettings.c (store_monospaced_changed): Define this function only
18547 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18548 not used otherwise.
18550 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18552 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18554 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18556 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18557 are the mini-buffer and the echo area (bug#3320).
18559 * term.c (init_tty): Remove support for supdup, c10 and perq
18560 terminals, which are no longer supported (bug#1482).
18562 2011-07-10 Johan Bockgård <bojohan@gnu.org>
18564 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18566 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18568 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18569 for non-popups (Bug#3642).
18571 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18573 * alloc.c (reset_malloc_hooks): Protoize.
18574 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
18575 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18576 * cm.c (losecursor): Likewise.
18577 * data.c (fmod): Likewise.
18578 * dispnew.c (swap_glyphs_in_rows): Likewise.
18579 * emacs.c (memory_warning_signal): Likewise.
18580 * floatfns.c (float_error): Likewise.
18581 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18582 (otf_open, font_otf_capability, generate_otf_features)
18583 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18585 * image.c (pbm_read_file): Likewise.
18586 * indent.c (string_display_width): Likewise.
18587 * intervals.c (check_for_interval, search_for_interval)
18588 (inc_interval_count, count_intervals, root_interval)
18589 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18590 * lread.c (defalias): Likewise.
18591 * ralloc.c (r_alloc_check): Likewise.
18592 * regex.c (set_image_of_range_1, set_image_of_range)
18593 (regex_grow_registers): Likewise.
18594 * sysdep.c (strerror): Likewise.
18595 * termcap.c (valid_filename_p, tprint, main): Likewise.
18596 * tparam.c (main): Likewise.
18597 * unexhp9k800.c (run_time_remap, save_data_space)
18598 (update_file_ptrs, read_header, write_header, calculate_checksum)
18599 (copy_file, copy_rest, display_header): Likewise.
18600 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18602 * xdisp.c (check_it): Likewise.
18603 * xfaces.c (register_color, unregister_color, unregister_colors):
18605 * xfns.c (print_fontset_result): Likewise.
18606 * xrdb.c (member, fatal, main): Likewise.
18608 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18610 Fix minor problems found by static checking (Bug#9031).
18611 * chartab.c (char_table_set_range, map_sub_char_table):
18612 Remove unused locals.
18613 (uniprop_table): Now static.
18614 * composite.c (_work_char): Remove unused static var.
18616 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
18618 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18620 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18622 * gtkutil.c (qttip_cb): Remove code without function.
18624 2011-07-09 Eli Zaretskii <eliz@gnu.org>
18626 * w32.c (pthread_sigmask): New stub.
18628 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
18630 Use pthread_sigmask, not sigprocmask (Bug#9010).
18631 sigprocmask is portable only for single-threaded applications, and
18632 Emacs can be multi-threaded when it uses GTK.
18633 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18635 * callproc.c (Fcall_process):
18636 * process.c (create_process):
18637 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18638 Use pthread_sigmask, not sigprocmask.
18640 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18642 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18643 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18646 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18648 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18649 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18650 (xg_hide_tooltip): Fix comment.
18652 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18653 in registerServicesMenuSendTypes.
18654 (validRequestorForSendType): Don't check ns_return_types.
18656 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18659 2011-07-08 Jason Rumney <jasonr@gnu.org>
18661 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18662 SH_SHOW for hidden windows (Bug#5482).
18664 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18665 frame struct members of non-existent frames (Bug#6284).
18667 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18669 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18670 variable firstTime not needed on OSX >= 10.6.
18671 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18672 >= 10.5. Use setKnobProportion, setDoubleValue.
18674 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18675 (MAC_OS_X_VERSION_10_5): Define if not defined.
18676 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18677 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18678 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18680 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
18681 cString and lossyCString on OSX >= 10.4.
18683 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
18684 sizeToFit on OSX >= 10.2.
18686 * nsimage.m (allocInitFromFile): Don't use deprecated method
18687 bestRepresentationForDevice on OSX >= 10.6.
18689 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18692 * emacs.c: Declare unexec_init_emacs_zone.
18694 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18696 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18698 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18699 on svcsMenu (Bug#8842).
18701 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18703 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18705 * nsterm.m (QUTF8_STRING): Declare.
18706 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18707 (validRequestorForSendType): Return type is (id).
18708 Change indexOfObjectIdenticalTo to indexOfObject.
18709 Check if we have local selection before returning self (Bug#8842).
18710 (writeSelectionToPasteboard): Put local selection into paste board
18711 if we have a local selection (Bug#8842).
18712 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18714 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18715 (ns_get_local_selection): Declare.
18717 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18719 * keymap.c (describe_map_tree): Don't insert a double newline at
18720 the end of the buffer (bug#1169) and return whether we inserted
18723 * callint.c (Fcall_interactively): Change "reading args" to
18724 "providing args" to try to clarify what it does (bug#1010).
18726 2011-07-07 Kenichi Handa <handa@m17n.org>
18728 * composite.c (composition_compute_stop_pos): Ignore a static
18729 composition starting before CHARPOS (Bug#8915).
18731 * xdisp.c (handle_composition_prop): Likewise.
18733 2011-07-07 Eli Zaretskii <eliz@gnu.org>
18735 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18738 2011-07-07 Kenichi Handa <handa@m17n.org>
18740 * character.h (unicode_category_t): New enum type.
18742 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18743 (Qchar_code_property_table): New variable.
18744 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18745 (UNIPROP_COMPRESSED_FORM_P): New macros.
18746 (char_table_ascii): Uncompress the compressed values.
18747 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18748 Uncompress the compressed values.
18749 (sub_char_table_ref_and_range): Likewise.
18750 (char_table_ref_and_range): Uncompress the compressed values.
18751 (sub_char_table_set): New arg is_uniprop. Callers changed.
18752 Uncompress the compressed values.
18753 (sub_char_table_set_range): Args changed. Callers changed.
18754 (char_table_set_range): Adjuted for the above change.
18755 (map_sub_char_table): Delete args default_val and parent. Add arg
18756 top. Give decoded values to a Lisp function.
18757 (map_char_table): Adjust for the above change. Give decoded
18758 values to a Lisp function. Gcpro more variables.
18759 (uniprop_table_uncompress)
18760 (uniprop_decode_value_run_length): New functions.
18761 (uniprop_decoder, uniprop_decoder_count): New variables.
18762 (uniprop_get_decoder, uniprop_encode_value_character)
18763 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18765 (uniprop_encoder, uniprop_encoder_count): New variables.
18766 (uniprop_get_encoder, uniprop_table)
18767 (Funicode_property_table_internal, Fget_unicode_property_internal)
18768 (Fput_unicode_property_internal): New functions.
18769 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18770 Sunicode_property_table_internal, Sget_unicode_property_internal,
18771 and Sput_unicode_property_internal. Defvar_lisp
18772 char-code-property-alist.
18774 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
18775 Vunicode_category_table.
18777 * font.c (font_range): Adjust for the change of
18778 Vunicode_category_table.
18780 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18782 * m/iris4d.h: Remove file, move contents ...
18783 * s/irix6-5.h: ... here.
18785 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18787 Remove unportable assumption about struct layout (Bug#8884).
18788 * alloc.c (mark_buffer):
18789 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18790 (clone_per_buffer_values): Don't assume that
18791 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18792 This isn't true in general, and it's particularly not true
18793 if Emacs is configured with --with-wide-int.
18794 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18795 New macros, used in the buffer.c change.
18797 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18799 * xsettings.c: Use both GConf and GSettings if both are available.
18800 (store_config_changed_event): Add comment.
18801 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18802 (store_tool_bar_style_changed): New functions.
18803 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
18804 (struct xsettings): Move font inside HAVE_XFT.
18805 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
18806 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
18807 Move inside HAVE_XFT.
18808 (something_changed_gsettingsCB): Rename from something_changedCB.
18809 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18811 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
18812 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
18813 (something_changed_gconfCB): Rename from something_changedCB.
18814 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18815 (parse_settings): Move check for font inside HAVE_XFT.
18816 (read_settings, apply_xft_settings): Add comment.
18817 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18818 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18819 call store_font_name_changed.
18820 (xft_settings_event): Add comment.
18821 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18822 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18823 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18824 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18825 (xsettings_initialize): Call init_gsettings last.
18826 (xsettings_get_system_font, xsettings_get_system_normal_font):
18829 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18831 Random fixes. E.g., (random) never returned negative values.
18832 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18833 subseconds part to the entropy, as that's a bit more random.
18834 Prefer signed to unsigned, since the signedness doesn't matter and
18835 in general we prefer signed. When given a limit, use a
18836 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18837 latter isn't right if USE_2_TAGS_FOR_INTS.
18838 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18839 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18841 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18843 * textprop.c (text_property_stickiness):
18844 Obey Vtext_property_default_nonsticky.
18845 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18846 * w32fns.c (syms_of_w32fns):
18847 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18849 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18851 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18852 This is more efficient than Ffile_directory_p and avoids a minor race.
18854 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18856 * buffer.c (Foverlay_put): Say what the return value is
18859 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18860 is a directory before asking whether to use the file name
18862 (barf_or_query_if_file_exists): Make the "File is a directory"
18863 error be more correct.
18865 * fns.c (Frequire): Remove the mention of the .gz files, since
18866 that's installation-specific, but keep the mention of
18867 `get-load-suffixes'.
18869 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18871 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18872 Report string overflow if the output is too long.
18874 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
18876 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18877 (syms_of_gnutls): Remove duplicate DEFSYM for
18878 Qgnutls_bootprop_verify_hostname_error, an error for
18879 Qgnutls_bootprop_verify_error (which is no longer used).
18881 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18882 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18883 Also (re)move comments that are misplaced or no longer relevant.
18885 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18887 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18889 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
18891 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18892 and background color parameters if they have been changed.
18894 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18896 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18898 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18900 * xsettings.c (SYSTEM_FONT): Define only when used.
18901 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18903 * keymap.c (access_keymap_1): Now static.
18905 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
18907 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18908 leave any prefix arg for the up event (Bug#1586).
18910 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18912 * lread.c (syms_of_lread): Mention single symbols defined by
18913 `defvar' or `defconst' (bug#7154).
18915 * fns.c (Frequire): Mention .el.gz files (bug#7314).
18916 (Frequire): Mention get-load-suffixes.
18918 2011-07-02 Martin Rudalics <rudalics@gmx.at>
18920 * window.h (window): Remove clone_number slot.
18921 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18923 (make_parent_window, make_window, saved_window)
18924 (Fset_window_configuration, save_window_save): Don't deal with
18926 * buffer.c (Qclone_number): Remove declaration.
18927 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18929 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18931 Add multiple inheritance to keymaps.
18932 * keymap.c (Fmake_composed_keymap): New function.
18933 (Fset_keymap_parent): Simplify.
18934 (fix_submap_inheritance): Remove.
18935 (access_keymap_1): New function extracted from access_keymap to handle
18936 embedded parents and handle lists of maps.
18937 (access_keymap): Use it.
18938 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18939 (Fcopy_keymap): Handle embedded parents.
18940 (Fcommand_remapping, define_as_prefix): Simplify.
18941 (Fkey_binding): Simplify.
18942 (syms_of_keymap): Move minibuffer-local-completion-map,
18943 minibuffer-local-filename-completion-map,
18944 minibuffer-local-must-match-map, and
18945 minibuffer-local-filename-must-match-map to Elisp.
18946 (syms_of_keymap): Defsubr make-composed-keymap.
18947 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18948 (parse_menu_item): Trivial simplification.
18950 2011-07-01 Glenn Morris <rgm@gnu.org>
18952 * Makefile.in (SETTINGS_LIBS): Fix typo.
18954 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
18956 * coding.c (Fencode_coding_string): Record the last coding system
18957 used, as the function doc string says (bug#8738).
18959 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18961 * xsettings.c (store_monospaced_changed): Take new font as arg and
18962 check for change against current_mono_font.
18963 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18964 (emacs_settings_constructor, emacs_settings_get_property)
18965 (emacs_settings_set_property, emacs_settings_class_init)
18966 (emacs_settings_init, gsettings_obj): Remove.
18967 (something_changedCB): New function for HAVE_GSETTINGS.
18968 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18969 with value as argument.
18970 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18971 g_settings_new (Bug#8967). Do not create gsettings_obj.
18972 Remove calls to g_settings_bind. Connect something_changedCB to
18975 * xgselect.c: Add defined (HAVE_GSETTINGS).
18976 (xgselect_initialize): Ditto.
18978 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18979 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18982 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18984 * eval.c (struct backtrace): Simplify and port the data structure.
18985 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18986 signed bit field, as this assumption is not portable and it makes
18987 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18988 "char debug_on_exit : 1" as this is not portable either; instead,
18989 use the portable "unsigned int debug_on_exit : 1". Remove unused
18990 member evalargs. Remove obsolete comments about cc bombing out.
18992 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18994 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
18995 Let HAVE_GSETTINGS override HAVE_GCONF.
18996 (store_monospaced_changed): New function.
18997 (EMACS_SETTINGS): A new type derived from GObject to handle
18998 GSettings notifications.
18999 (emacs_settings_constructor, emacs_settings_get_property)
19000 (emacs_settings_set_property, emacs_settings_class_init):
19002 (gsettings_client, gsettings_obj): New variables.
19003 (GSETTINGS_SCHEMA): New define.
19004 (something_changedCB): Call store_monospaced_changed.
19005 (init_gsettings): New function.
19006 (xsettings_initialize): Call init_gsettings.
19007 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19010 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
19013 2011-06-29 Martin Rudalics <rudalics@gmx.at>
19015 * window.c (resize_root_window, grow_mini_window)
19016 (shrink_mini_window): Rename Qresize_root_window to
19017 Qwindow_resize_root_window and Qresize_root_window_vertically to
19018 Qwindow_resize_root_window_vertically.
19020 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19022 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19024 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
19026 * makefile.w32-in: Redesign dependencies so they reflect more
19027 clearly which files are directly included by each source file,
19028 and not through other includes.
19030 2011-06-27 Martin Rudalics <rudalics@gmx.at>
19032 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19033 (sort_overlays, overlay_strings): When an overlay's clone number
19034 matches the window's clone number process the overlay even if
19035 the overlay's window property doesn't match the current window.
19037 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19038 (Fwindow_hchild): Rename to Fwindow_left_child.
19039 (Fwindow_next): Rename to Fwindow_next_sibling.
19040 (Fwindow_prev): Rename to Fwindow_prev_sibling.
19041 (resize_window_check): Rename to window_resize_check.
19042 (resize_window_apply): Rename to window_resize_apply.
19043 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19044 (Fdelete_other_windows_internal, resize_frame_windows)
19045 (Fsplit_window_internal, Fdelete_window_internal)
19046 (grow_mini_window, shrink_mini_window)
19047 (Fresize_mini_window_internal): Fix callers accordingly.
19049 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19051 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19052 (emacs_fixed_set_min_size): Remove.
19053 (emacs_fixed_new): Take frame as argument.
19055 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19056 (_EmacsFixedPrivate): Remove minwidth/height.
19057 Add struct frame *f.
19058 (emacs_fixed_init): Initialize priv->f.
19059 (get_parent_class, emacs_fixed_set_min_size): Remove.
19060 (emacs_fixed_new): Set priv->f to argument.
19061 (emacs_fixed_get_preferred_width)
19062 (emacs_fixed_get_preferred_height): Use min_width/height from
19063 frames size_hint to set minimum and natural (Bug#8919).
19064 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19065 and use min_width/height from frames size_hint to set
19066 min_width/height (Bug#8919).
19068 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19069 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19072 2011-06-26 Eli Zaretskii <eliz@gnu.org>
19074 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19075 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19078 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
19080 * process.c (wait_reading_process_output): Bypass select if
19081 waiting for a cell while ignoring keyboard input, and input is
19082 pending. Suggested by Jan Djärv (Bug#8869).
19084 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19086 Use gnulib's dup2 module instead of rolling our own.
19087 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19089 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19091 * dispnew.c (scrolling_window): Before scrolling, turn off a
19092 mouse-highlight in the window being scrolled.
19094 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
19096 Move DEFSYM to lisp.h and use everywhere.
19098 * character.h (DEFSYM): Move declaration...
19099 * lisp.h (DEFSYM): ...here.
19105 * w32select.c: Don't include character.h.
19107 * alloc.c (syms_of_alloc):
19108 * buffer.c (syms_of_buffer):
19109 * bytecode.c (syms_of_bytecode):
19110 * callint.c (syms_of_callint):
19111 * casefiddle.c (syms_of_casefiddle):
19112 * casetab.c (init_casetab_once):
19113 * category.c (init_category_once, syms_of_category):
19114 * ccl.c (syms_of_ccl):
19115 * cmds.c (syms_of_cmds):
19116 * composite.c (syms_of_composite):
19117 * dbusbind.c (syms_of_dbusbind):
19118 * dired.c (syms_of_dired):
19119 * dispnew.c (syms_of_display):
19120 * doc.c (syms_of_doc):
19121 * editfns.c (syms_of_editfns):
19122 * emacs.c (syms_of_emacs):
19123 * eval.c (syms_of_eval):
19124 * fileio.c (syms_of_fileio):
19125 * fns.c (syms_of_fns):
19126 * frame.c (syms_of_frame):
19127 * fringe.c (syms_of_fringe):
19128 * insdel.c (syms_of_insdel):
19129 * keymap.c (syms_of_keymap):
19130 * lread.c (init_obarray, syms_of_lread):
19131 * macros.c (syms_of_macros):
19132 * msdos.c (syms_of_msdos):
19133 * print.c (syms_of_print):
19134 * process.c (syms_of_process):
19135 * search.c (syms_of_search):
19136 * sound.c (syms_of_sound):
19137 * syntax.c (init_syntax_once, syms_of_syntax):
19138 * terminal.c (syms_of_terminal):
19139 * textprop.c (syms_of_textprop):
19140 * undo.c (syms_of_undo):
19141 * w32.c (globals_of_w32):
19142 * window.c (syms_of_window):
19143 * xdisp.c (syms_of_xdisp):
19144 * xfaces.c (syms_of_xfaces):
19145 * xfns.c (syms_of_xfns):
19146 * xmenu.c (syms_of_xmenu):
19147 * xsettings.c (syms_of_xsettings):
19148 * xterm.c (syms_of_xterm): Use DEFSYM.
19150 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19152 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19154 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19156 Integer and buffer overflow fixes (Bug#8873).
19158 * print.c (printchar, strout): Check for string overflow.
19159 (PRINTPREPARE, printchar, strout):
19160 Don't set size unless allocation succeeds.
19162 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19163 for sizes. Check for string overflow more accurately.
19164 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19166 * macros.c: Integer and buffer overflow fixes.
19167 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19168 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19169 Use ptrdiff_t, not int, for sizes.
19170 Don't increment bufsize until after realloc succeeds.
19171 Check for size-calculation overflow.
19172 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19174 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19176 * lread.c: Integer overflow fixes.
19177 (read_integer): Radix is now EMACS_INT, not int,
19178 to improve quality of diagnostics for out-of-range radices.
19179 Calculate buffer size correctly for out-of-range radices.
19180 (read1): Check for integer overflow in radices, and in
19181 read-circle numbers.
19182 (read_escape): Avoid int overflow.
19183 (Fload, openp, read_buffer_size, read1)
19184 (substitute_object_recurse, read_vector, read_list, map_obarray):
19185 Use ptrdiff_t, not int, for sizes.
19186 (read1): Use EMACS_INT, not int, for sizes.
19187 Check for size overflow.
19189 * image.c (cache_image): Check for size arithmetic overflow.
19191 * lread.c: Integer overflow issues.
19192 (saved_doc_string_size, saved_doc_string_length)
19193 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19194 Now ptrdiff_t, not int.
19195 (read1): Don't assume doc string length fits in int. Check for
19196 out-of-range doc string lengths.
19197 (read_list): Don't assume file position fits in int.
19198 (read_escape): Check for hex character overflow.
19200 2011-06-22 Leo Liu <sdl.web@gmail.com>
19202 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19203 Move to minibuffer.el.
19205 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19207 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19208 The following patches are for when GLYPH_DEBUG && !XASSERT.
19209 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19210 * dispnew.c (flush_stdout):
19211 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19212 Mark as externally visible.
19213 * dispnew.c (check_window_matrix_pointers): Now static.
19214 * dispnew.c (window_to_frame_vpos):
19215 * xfns.c (unwind_create_frame):
19216 * xterm.c (x_check_font): Remove unused local.
19217 * scroll.c (CHECK_BOUNDS):
19218 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19219 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19220 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19221 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19222 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19224 (debug_method_add): Use va_list and vsprintf rather than relying
19225 on undefined behavior with wrong number of arguments.
19226 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19227 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19228 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19229 since we're not interested in debugging glyphs with old libraries.
19230 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19231 GCC 4.6.0's static checking.
19233 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19235 Integer overflow and signedness fixes (Bug#8873).
19236 A few related buffer overrun fixes, too.
19238 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19240 * dispextern.h (struct face.stipple):
19241 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19242 (x_bitmap_mask, x_allocate_bitmap_record)
19243 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19244 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19245 (x_create_bitmap_from_xpm_data):
19246 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19247 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19249 * xfaces.c (load_pixmap):
19250 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19251 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19252 (.bitmaps_last, struct x_output.icon_bitmap):
19253 Use ptrdiff_t, not int, for bitmap indexes.
19254 (x_allocate_bitmap_record): Check for size overflow.
19255 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19257 Use ptrdiff_t, not int, for overlay counts.
19258 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19259 * editfns.c (overlays_around, get_pos_property):
19260 * textprop.c (get_char_property_and_overlay):
19261 * xdisp.c (next_overlay_change, note_mouse_highlight):
19262 * xfaces.c (face_at_buffer_position):
19263 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19264 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19265 (Fnext_overlay_change, Fprevious_overlay_change)
19266 (mouse_face_overlay_overlaps, Foverlays_in):
19267 Use ptrdiff_t, not int, for sizes.
19268 (overlays_at, overlays_in): Check for size-calculation overflow.
19270 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19272 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19273 (x_session_initialize): Do not assume string length fits in int.
19275 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19276 This is unlikely, but can occur if DPI is outlandish.
19278 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19279 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19281 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19282 * xrdb.c (magic_file_p, search_magic_path):
19283 Omit last arg SUFFIX; it was always 0. All callers changed.
19284 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19286 * xfont.c (xfont_match): Avoid need for strlen.
19288 * xfns.c: Don't assume strlen fits in int.
19289 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19291 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19292 not unsigned long, as we prefer signed integers. All callers changed.
19293 Detect integer overflow in repeat count.
19294 (message_dolog): Don't assume print length fits in 39 bytes.
19295 (display_mode_element): Don't assume strlen fits in int.
19297 * termcap.c: Don't assume sizes fit in int and never overflow.
19298 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19299 (gobble_line): Check for size-calculation overflow.
19301 * minibuf.c (Fread_buffer):
19302 * lread.c (intern, intern_c_string):
19303 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19304 Don't assume string length fits in int.
19306 * keyboard.c (parse_tool_bar_item):
19307 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19309 * font.c: Don't assume string length fits in int.
19310 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19311 Use ptrdiff_t, not int.
19312 (font_intern_prop): Don't assume string length fits in int.
19313 Don't assume integer property fits in fixnum.
19314 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19316 * filelock.c: Fix some buffer overrun and integer overflow issues.
19317 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19318 Reformulate so as not to need the command string.
19319 Invoke gzip -cd rather than gunzip, as it's more portable.
19320 (lock_info_type, lock_file_1, lock_file):
19321 Don't assume pid_t and time_t fit in unsigned long.
19322 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19323 (current_lock_owner): Prefer signed type for sizes.
19324 Use memcpy, not strncpy, where memcpy is what is really wanted.
19325 Don't assume (via atoi) that time_t and pid_t fit in int.
19326 Check for time_t and/or pid_t out of range, e.g., via a network share.
19327 Don't alloca where an auto var works fine.
19329 * fileio.c: Fix some integer overflow issues.
19330 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19331 Don't assume string length fits in int.
19332 (directory_file_name): Don't assume string length fits in long.
19333 (make_temp_name): Don't assume pid fits in int, or that its print
19334 length is less than 20.
19336 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19338 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19340 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19342 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19343 We prefer signed integers, even for size calculations.
19345 * emacs.c: Don't assume string length fits in 'int'.
19346 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19347 (main): Don't invoke strlen when not needed.
19349 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19350 (XD_DEBUG_MESSAGE): Don't waste a byte.
19352 * callproc.c (getenv_internal_1, getenv_internal)
19353 (Fgetenv_internal):
19354 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19356 * lread.c (invalid_syntax): Omit length argument.
19357 All uses changed. This doesn't fix a bug, but it simplifies the
19358 code away from its former Hollerith-constant appearance, and it's
19359 one less 'int' to worry about when looking at integer-overflow issues.
19360 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19362 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19363 This didn't break anything, but it didn't help either.
19364 It's confusing to put a bogus integer in a place where the actual
19365 value does not matter.
19366 (LIST_END_P): Remove unused macro and its bogus comment.
19367 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19369 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19370 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19372 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19373 We prefer signed types, and the value cannot exceed the EMACS_INT
19374 range anyway (because otherwise the length would not be representable).
19375 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19376 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19377 This avoids a GCC warning when WIDE_EMACS_INT.
19379 * indent.c (sane_tab_width): New function.
19380 (current_column, scan_for_column, Findent_to, position_indentation)
19381 (compute_motion): Use it. This is just for clarity.
19382 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19384 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19386 * lisp.h (lint_assume): New macro.
19387 * composite.c (composition_gstring_put_cache):
19388 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19390 * editfns.c, insdel.c:
19391 Omit unnecessary forward decls, to simplify future changes.
19393 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19395 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19397 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19398 Use much-faster test for byte-length change.
19399 Don't assume string byte-length fits in 'int'.
19400 Check that character arg fits in 'int'.
19401 (mapcar1): Declare byte as byte, for clarity.
19403 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19405 * fns.c (concat): Catch string overflow earlier.
19406 Do not rely on integer wraparound.
19408 * dispextern.h (struct it.overlay_strings_charpos)
19409 (struct it.selective): Now EMACS_INT, not int.
19410 * xdisp.c (forward_to_next_line_start)
19411 (back_to_previous_visible_line_start)
19412 (reseat_at_next_visible_line_start, next_element_from_buffer):
19413 Don't arbitrarily truncate the value of 'selective' to int.
19415 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19417 * composite.c: Don't truncate sizes to 'int'.
19418 (composition_gstring_p, composition_reseat_it)
19419 (composition_adjust_point): Use EMACS_INT, not int.
19420 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19421 not EMACS_UINT, for indexes.
19423 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19425 * buffer.c: Include <verify.h>.
19426 (struct sortvec.priority, struct sortstr.priority):
19427 Now EMACS_INT, not int.
19428 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19429 (struct sortstr.size, record_overlay_string)
19430 (struct sortstrlist.size, struct sortlist.used):
19431 Don't truncate size to int.
19432 (record_overlay_string): Check for size-calculation overflow.
19433 (init_buffer_once): Check at compile-time, not run-time.
19435 2011-06-22 Jim Meyering <meyering@redhat.com>
19437 Don't leak an XBM-image-sized buffer
19438 * image.c (xbm_load): Free the image buffer after using it.
19440 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19443 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19444 that Sun C diagnosed.
19445 * fns.c (secure_hash): Fix pointer signedness issue.
19446 * intervals.c (static_offset_intervals): New function.
19447 (offset_intervals): Use it.
19449 2011-06-21 Leo Liu <sdl.web@gmail.com>
19452 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19455 * fns.c (secure_hash): Rename from crypto_hash_function and change
19456 the first arg to accept symbols.
19457 (Fsecure_hash): New primitive.
19458 (syms_of_fns): New symbols.
19460 2011-06-20 Deniz Dogan <deniz@dogan.se>
19462 * process.c (Fset_process_buffer): Clarify return value in
19465 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19467 * dispnew.c (add_window_display_history): Use BVAR.
19469 * xdisp.c (debug_method_add): Use BVAR.
19470 (check_window_end, dump_glyph_matrix, dump_glyph)
19471 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19473 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19476 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19477 check till after the cache is created in init_frame_faces.
19479 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19481 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19483 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19485 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19486 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19487 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19489 Improve buffer-overflow checking (Bug#8873).
19490 * fileio.c (Finsert_file_contents):
19491 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19492 Remove the old (too-loose) buffer overflow checks.
19493 They weren't needed, since make_gap checks for buffer overflow.
19494 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19495 The old code merely checked for Emacs fixnum overflow, and relied
19496 on undefined (wraparound) behavior. The new code avoids undefined
19497 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19499 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19500 Tune. Don't use wider integers than needed. Don't use alloca.
19501 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19503 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19505 * insdel.c, lisp.h (buffer_overflow): New function.
19506 (insert_from_buffer_1, replace_range, replace_range_2):
19507 * insdel.c (make_gap_larger):
19508 * editfns.c (Finsert_char):
19509 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19511 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19513 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19515 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19517 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19518 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19520 * fileio.c: Don't assume EMACS_INT fits in off_t.
19521 (emacs_lseek): New static function.
19522 (Finsert_file_contents, Fwrite_region): Use it.
19523 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19525 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19527 * fns.c: Don't overflow int when computing a list length.
19528 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19529 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19530 truncation on 64-bit hosts. Check for QUIT every
19531 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19532 faster and is responsive enough.
19533 (Flength): Report an error instead of overflowing an integer.
19534 (Fsafe_length): Return a float if the value is not representable
19535 as a fixnum. This shouldn't happen except in contrived situations.
19536 (Fnthcdr, Fsort): Don't assume list length fits in int.
19537 (Fcopy_sequence): Don't assume vector length fits in int.
19539 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19540 (header_size, word_size): New constants.
19541 (allocate_vectorlike): Don't check size overflow here.
19542 (allocate_vector): Check it here instead, since this is the only
19543 caller of allocate_vectorlike that could cause overflow.
19544 Check that the new vector's length is representable as a fixnum.
19546 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19547 The previous code was bogus. For example, next_almost_prime (32)
19548 returned 39, which is undesirable as it is a multiple of 3; and
19549 next_almost_prime (24) returned 25, which is a multiple of 5 so
19550 why was the code bothering to check for multiples of 7?
19552 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19554 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19556 Variadic C functions now count arguments with ptrdiff_t.
19557 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19558 Back then I didn't know that the Emacs coding style prefers signed int.
19559 Also, in the meantime I found a few more instances where arguments
19560 were being counted with int, which may truncate counts on 64-bit
19561 machines, or EMACS_INT, which may be unnecessarily wide.
19562 * lisp.h (struct Lisp_Subr.function.aMANY)
19563 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19564 Arg counts are now ptrdiff_t, not size_t.
19565 All variadic functions and their callers changed accordingly.
19566 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19567 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19568 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19569 * callint.c (Fcall_interactively): Check arg count for overflow,
19570 to avoid potential buffer overrun. Use signed char, not 'int',
19571 for 'varies' array, so that we needn't bother to check its size
19572 calculation for overflow.
19573 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19574 * eval.c (apply_lambda):
19575 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19576 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19577 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19579 * callint.c (Fcall_interactively): Don't use index var as event count.
19581 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19582 * mem-limits.h (SIZE): Remove; no longer used.
19584 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
19586 Remove unnecessary casts.
19587 * xterm.c (x_term_init):
19588 * xfns.c (x_set_border_pixel):
19589 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19590 These aren't needed now that we assume ANSI C.
19592 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19593 It's more likely to cause problems (due to unsigned overflow)
19596 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19598 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19600 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19602 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19604 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19606 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19608 GLYPH_CODE_FACE returns EMACS_INT, not int.
19609 * dispextern.h (merge_faces):
19610 * xfaces.c (merge_faces):
19611 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19612 Don't assume EMACS_INT fits in int.
19614 * character.h (CHAR_VALID_P): Remove unused parameter.
19615 * fontset.c, lisp.h, xdisp.c: All uses changed.
19617 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19619 * fns.c (concat): Minor tuning based on overflow analysis.
19620 This doesn't fix any bugs. Use int to hold character, instead
19621 of constantly refetching from Emacs object. Use XFASTINT, not
19622 XINT, for value known to be a character. Don't bother comparing
19623 a single byte to 0400, as it's always less.
19625 * floatfns.c (Fexpt):
19626 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19628 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19631 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19633 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19634 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19635 incorrectly succeed when S was a string, because 4294967386 was
19636 truncated before it was used.
19638 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19639 Otherwise, an out-of-range integer could cause undefined behavior
19642 * composite.c: Use int, not EMACS_INT, for characters.
19643 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19644 EMACS_INT, for values that are known to be in character range.
19645 This doesn't fix any bugs but is the usual style inside Emacs and
19646 may generate better code on 32-bit machines.
19648 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19649 This is for reasons similar to the recent CHAR_STRING fix.
19650 * charset.c (Fencode_char): Check that character arg is actually
19651 a character. Pass an int to ENCODE_CHAR.
19652 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19653 wider than 'int', as a compile-time check to prevent future regressions
19656 * character.c (char_string): Remove unnecessary casts.
19658 Make sure a 64-bit char is never passed to CHAR_STRING.
19659 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19660 by silently ignoring the top 32 bits, allowing some values
19661 that were far too large to be valid characters.
19662 * character.h: Include <verify.h>.
19663 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19664 arguments are no wider than unsigned, as a compile-time check
19665 to prevent future regressions in this area.
19667 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
19668 (Fsubst_char_in_region):
19670 * xdisp.c (decode_mode_spec_coding):
19671 Adjust to CHAR_STRING's new requirement.
19672 * editfns.c (Finsert_char, Fsubst_char_in_region):
19673 * fns.c (concat): Check that character args are actually
19674 characters. Without this test, these functions did the wrong
19675 thing with wildly out-of-range values on 64-bit hosts.
19677 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19678 These casts should not be needed on 32-bit hosts, either.
19679 * keyboard.c (read_char):
19680 * lread.c (Fload): Remove casts to unsigned.
19682 * lisp.h (UNSIGNED_CMP): New macro.
19683 This fixes comparison bugs on 64-bit hosts.
19684 (ASCII_CHAR_P): Use it.
19685 * casefiddle.c (casify_object):
19686 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
19687 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19688 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19689 * dispextern.h (FACE_FROM_ID):
19690 * keyboard.c (read_char): Use UNSIGNED_CMP.
19692 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19693 not to EMACS_INT, to avoid GCC warning.
19695 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19697 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19698 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19699 isn't needed on 32-bit machines.
19701 * buffer.c (Fgenerate_new_buffer_name):
19702 Use EMACS_INT for count, not int.
19703 (advance_to_char_boundary): Return EMACS_INT, not int.
19705 * data.c (Qcompiled_function): Now static.
19707 * window.c (window_body_lines): Now static.
19709 * image.c (gif_load): Rename local to avoid shadowing.
19711 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19712 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19713 * alloc.c (make_save_value): Integer argument is now of type
19714 ptrdiff_t, not int.
19715 (mark_object): Use ptrdiff_t, not int.
19716 * lisp.h (pD): New macro.
19717 * print.c (print_object): Use it.
19719 * alloc.c: Use EMACS_INT, not int, to count objects.
19720 (total_conses, total_markers, total_symbols, total_vector_size)
19721 (total_free_conses, total_free_markers, total_free_symbols)
19722 (total_free_floats, total_floats, total_free_intervals)
19723 (total_intervals, total_strings, total_free_strings):
19724 Now EMACS_INT, not int. All uses changed.
19725 (Fgarbage_collect): Compute overall total using a double, so that
19726 integer overflow is less likely to be a problem. Check for overflow
19727 when converting back to an integer.
19728 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19729 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19730 These were 'int' variables that could overflow on 64-bit hosts;
19731 they were never used, so remove them instead of repairing them.
19732 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
19733 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19734 Previously, this ceilinged at INT_MAX, but that doesn't work on
19736 (allocate_pseudovector): Don't use EMACS_INT when int would do.
19738 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
19739 (allocate_vectorlike): Check for ptrdiff_t overflow.
19740 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19741 when a (possibly-narrower) signed value would do just as well.
19742 We prefer using signed arithmetic, to avoid comparison confusion.
19744 * alloc.c: Catch some string size overflows that we were missing.
19745 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19746 for convenience in STRING_BYTES_MAX.
19747 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19748 The definition here is exact; the one in lisp.h was approximate.
19749 (allocate_string_data): Check for string overflow. This catches
19750 some instances we weren't catching before. Also, it catches
19751 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19752 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19753 and ptrdiff_t and EMACS_INT are both 64 bits.
19755 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19756 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
19757 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
19759 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19761 * alloc.c (Fmake_string): Check for out-of-range init.
19763 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19765 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19767 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19769 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19770 xg_get_default_scrollbar_width.
19772 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19773 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19774 (style_changed_cb): Call update_theme_scrollbar_width and call
19775 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19776 all frames (Bug#8505).
19777 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19778 Call gtk_window_set_resizable if HAVE_GTK3.
19779 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19780 and height if HAVE_GTK3 (Bug#8505).
19781 (scroll_bar_width_for_theme): New variable.
19782 (update_theme_scrollbar_width): New function.
19783 (xg_get_default_scrollbar_width): Move code to
19784 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19785 (xg_initialize): Call update_theme_scrollbar_width.
19787 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19789 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19791 2011-06-12 Martin Rudalics <rudalics@gmx.at>
19793 * frame.c (make_frame): Call other_buffer_safely instead of
19796 * window.c (temp_output_buffer_show): Call display_buffer with
19797 second argument Vtemp_buffer_show_specifiers and reset latter
19798 immediately after the call.
19799 (Vtemp_buffer_show_specifiers): New variable.
19800 (auto_window_vscroll_p, next_screen_context_lines)
19801 (Vscroll_preserve_screen_position): Remove leading asterisks from
19804 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
19806 Fix minor problems found by GCC 4.6.0 static checking.
19807 * buffer.c (Qclone_number): Remove for now, as it's unused.
19808 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19809 (record_buffer): Remove unused local.
19810 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19811 (set_frame_buffer_list): Remove; unused.
19812 * frame.h (other_visible_frames): Remove decl.
19813 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19814 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19815 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19817 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19818 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19819 Define only if HAVE_GPM.
19820 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19821 (update_hints_inhibit): Remove; never set. All uses removed.
19822 * widgetprv.h (emacsFrameClassRec): Remove decl.
19823 * window.c (delete_deletable_window): Now returns void, since it
19824 wasn't returning anything.
19825 (compare_window_configurations): Remove unused locals.
19826 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19827 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
19828 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19829 the same widths as pointers. This follows up on the 2011-05-06 patch.
19830 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19831 * xterm.h: Likewise.
19832 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19834 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
19836 * makefile.w32-in: Update dependencies.
19837 (LISP_H): Add lib/intprops.h.
19839 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19841 * image.c (gif_load): Add animation frame delay to the metadata.
19842 (syms_of_image): Use DEFSYM. New symbol `delay'.
19844 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19846 * window.c (delete_deletable_window): Re-add.
19847 (Fset_window_configuration): Rewrite to handle dead buffers and
19848 consequently deletable windows.
19849 (window_tree, Fwindow_tree): Remove. Supply functionality in
19851 (compare_window_configurations): Simplify code.
19853 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19855 * image.c (imagemagick_load_image): Fix type mismatch.
19856 (Fimagemagick_types): Likewise.
19858 * window.h (replace_buffer_in_windows): Declare.
19860 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19862 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19863 Qclone_number. Remove external declaration of Qdelete_window.
19864 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19866 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19867 Run Qbuffer_list_update_hook if allowed.
19868 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19869 buffer list implementation.
19870 (other_buffer_safely): New function.
19871 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19872 calls to replace_buffer_in_windows and
19873 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19875 (record_buffer): Inhibit quitting and rewrite using quittable
19876 functions. Run Qbuffer_list_update_hook if allowed.
19877 (Frecord_buffer, Funrecord_buffer): New functions.
19878 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19879 Move switch-to-buffer to window.el.
19880 (bury-buffer): Move to window.el.
19881 (Vbuffer_list_update_hook): New variable.
19883 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19886 * window.h (resize_frame_windows): Move up in code.
19887 (Fwindow_frame): Remove EXFUN.
19888 (replace_buffer_in_all_windows): Remove prototype.
19889 (replace_buffer_in_windows_safely): Add prototype.
19891 * window.c: Declare Qdelete_window static again. Move down
19892 declaration of select_count.
19893 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19894 (Fother_window): Move to window.el.
19895 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19896 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19897 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19899 (replace_buffer_in_windows): Implement by calling
19900 Qreplace_buffer_in_windows.
19901 (replace_buffer_in_all_windows): Remove with some functionality
19902 moved into replace_buffer_in_windows_safely.
19903 (replace_buffer_in_windows_safely): New function.
19904 (select_window_norecord, select_frame_norecord): Move in front
19905 of run_window_configuration_change_hook. Remove now obsolete
19907 (Fset_window_buffer): Rewrite doc-string.
19908 Call Qrecord_window_buffer.
19909 (keys_of_window): Move binding for other-window to window.el.
19911 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19913 * dispextern.h (struct image): Replace data member, whose int_val
19914 and ptr_val fields were not used by anything, with a single
19917 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19918 (gif_clear_image, gif_load, imagemagick_load_image)
19919 (gs_clear_image, gs_load): Callers changed.
19921 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19923 * buffer.h: Include <time.h>, for time_t.
19924 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19926 Fix minor problems found by static checking.
19928 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19930 Make identifiers static if they are not used in other modules.
19931 * data.c (Qcompiled_function, Qframe, Qvector):
19932 * image.c (QimageMagick, Qsvg):
19933 * minibuf.c (Qmetadata):
19934 * window.c (resize_window_check, resize_root_window): Now static.
19935 * window.h (resize_window_check, resize_root_window): Remove decls.
19937 * window.c (window_deletion_count, delete_deletable_window):
19939 (window_body_lines): Now static.
19940 (Fdelete_other_windows_internal): Mark vars as initialized.
19941 Make sure 'resize_failed' is initialized.
19942 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19943 (resize_window_apply): Remove unused local.
19944 * window.h (delete_deletable_window): Remove decl.
19946 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
19947 (imagemagick_load_image): Fix pointer signedness problem by changing
19948 last arg from unsigned char * to char *. All uses changed.
19949 Also, fix a local for similar reasons.
19950 Remove unused locals. Remove locals to avoid shadowing.
19951 (fn_rsvg_handle_free): Remove; unused.
19952 (svg_load, svg_load_image): Fix pointer signedness problem.
19953 (imagemagick_load_image): Don't use garbage pointer image_wand.
19955 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19957 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
19959 * image.c (gif_load): Fix omitted cast error introduced by
19962 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19964 * window.h (resize_proportionally, orig_total_lines)
19965 (orig_top_line): Remove from window structure.
19966 (set_window_height, set_window_width, change_window_heights)
19967 (Fdelete_window): Remove prototypes.
19968 (resize_frame_windows): Remove duplicate declaration.
19970 2011-06-10 Eli Zaretskii <eliz@gnu.org>
19972 * window.h (resize_frame_windows, resize_window_check)
19973 (delete_deletable_window, resize_root_window)
19974 (resize_frame_windows): Declare prototypes.
19976 * window.c (resize_window_apply): Make definition be "static" to
19977 match the prototype.
19979 2011-06-10 Martin Rudalics <rudalics@gmx.at>
19981 * window.c: Remove declarations of Qwindow_size_fixed,
19982 window_min_size_1, window_min_size_2, window_min_size,
19983 size_window, window_fixed_size_p, enlarge_window, delete_window.
19984 Remove static from declaration of Qdelete_window, it's
19985 temporarily needed by Fbury_buffer.
19986 (replace_window): Don't assign orig_top_line and
19988 (Fdelete_window, delete_window): Remove. Window deletion is
19989 handled by window.el.
19990 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19991 Replace Fdelete_window calls with calls to Qdelete_window.
19992 (Fdelete_other_windows): Remove. Deleting other windows is
19993 handled by window.el.
19994 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19995 handled in window.el.
19996 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19997 Window minimum sizes are handled in window.el.
19998 (shrink_windows, size_window, set_window_height)
19999 (set_window_width, change_window_heights, window_height)
20000 (window_width, CURBEG, CURSIZE, enlarge_window)
20001 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20002 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20003 handled in window.el.
20004 (make_dummy_parent): Rename to make_parent_window and give it a
20005 second argument horflag.
20006 (make_window): Don't set resize_proportionally any more.
20007 (Fsplit_window): Remove. Windows are split in window.el.
20008 (save_restore_action, save_restore_orig_size)
20009 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20010 Resize mini windows in window.el.
20011 (grow_mini_window, shrink_mini_window): Implement by calling
20012 Qresize_root_window_vertically, resize_window_check and
20013 resize_window_apply.
20014 (saved_window, Fset_window_configuration, save_window_save):
20015 Do not handle orig_top_line, orig_total_lines, and
20016 resize_proportionally.
20017 (window_min_height, window_min_width): Move to window.el.
20018 (keys_of_window): Move bindings for delete-other-windows,
20019 split-window, delete-window and enlarge-window to window.el.
20021 * buffer.c: Temporarily extern Qdelete_window.
20022 (Fbury_buffer): Temporarily call Qdelete_window instead of
20023 Fdelete_window (Fbury_buffer will move to window.el soon).
20025 * frame.c (set_menu_bar_lines_1): Remove code handling
20026 orig_top_line and orig_total_lines.
20028 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20029 set_window_height but set heights directly.
20030 (change_frame_size_1): Use resize_frame_windows.
20032 * xdisp.c (init_xdisp): Don't use set_window_height but set
20035 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20036 Use resize_frame_windows instead of change_window_heights and run
20037 run_window_configuration_change_hook.
20039 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20040 instead of change_window_heights and run
20041 run_window_configuration_change_hook.
20043 2011-06-09 Martin Rudalics <rudalics@gmx.at>
20045 * window.c (replace_window): Rename second argument REPLACEMENT to
20046 NEW. New third argument SETFLAG. Rewrite.
20047 (delete_window, make_dummy_parent): Call replace_window with
20049 (window_list_1): Move down in code.
20050 (run_window_configuration_change_hook): Move set_buffer part
20051 before select_frame_norecord part in order to unwind correctly.
20052 Rename count1 to count.
20053 (recombine_windows, delete_deletable_window, resize_root_window)
20054 (Fdelete_other_windows_internal)
20055 (Frun_window_configuration_change_hook, make_parent_window)
20056 (resize_window_check, resize_window_apply, Fresize_window_apply)
20057 (resize_frame_windows, Fsplit_window_internal)
20058 (Fdelete_window_internal, Fresize_mini_window_internal):
20060 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20062 2011-06-08 Martin Rudalics <rudalics@gmx.at>
20064 * window.h (window): Add some new members to window structure -
20065 normal_lines, normal_cols, new_total, new_normal, clone_number,
20066 splits, nest, prev_buffers, next_buffers.
20067 (WINDOW_TOTAL_SIZE): Move here from window.c.
20068 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20070 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20072 (make_dummy_parent): Set new members of windows structure.
20073 (make_window): Move down in code. Handle new members of window
20075 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20076 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20077 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20078 (Fset_window_prev_buffers, Fwindow_next_buffers)
20079 (Fset_window_next_buffers, Fset_window_clone_number):
20081 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20082 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20084 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20085 Argument WINDOW can be now internal window too.
20086 (Fwindow_use_time): Move up in code.
20087 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20088 Rewrite doc-string.
20089 (Fset_window_configuration, saved_window)
20090 (Fcurrent_window_configuration, save_window_save): Handle new
20091 members of window structure.
20092 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20093 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20094 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20095 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20096 Qget_mru_window, Qresize_root_window,
20097 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20098 Qauto_buffer_name; staticpro them.
20100 2011-06-07 Martin Rudalics <rudalics@gmx.at>
20102 * window.c (Fwindow_total_size, Fwindow_left_column)
20103 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20104 (Fwindow_list_1): New functions.
20105 (window_box_text_cols): Replace with window_body_cols.
20106 (Fwindow_width, Fscroll_left, Fscroll_right):
20107 Use window_body_cols instead of window_box_text_cols.
20108 (delete_window, Fset_window_configuration):
20109 Call delete_all_subwindows with window as argument.
20110 (delete_all_subwindows): Take a window as argument and not a
20111 structure. Rewrite.
20112 (window_loop): Remove handling of GET_LRU_WINDOW and
20113 GET_LARGEST_WINDOW.
20114 (Fget_lru_window, Fget_largest_window): Move to window.el.
20116 * window.h: Extern window_body_cols instead of
20117 window_box_text_cols. delete_all_subwindows now takes a
20118 Lisp_Object as argument.
20120 * indent.c (compute_motion, Fcompute_motion):
20121 Use window_body_cols instead of window_box_text_cols.
20123 * frame.c (delete_frame): Call delete_all_subwindows with root
20124 window as argument.
20126 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20128 * fns.c (Fputhash): Document return value.
20130 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
20132 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20134 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20136 Cons<->int and similar integer overflow fixes (Bug#8794).
20138 Check for overflow when converting integer to cons and back.
20139 * charset.c (Fdefine_charset_internal, Fdecode_char):
20140 Use cons_to_unsigned to catch overflow.
20141 (Fencode_char): Use INTEGER_TO_CONS.
20142 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20143 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20144 * data.c (long_to_cons, cons_to_long): Remove.
20145 (cons_to_unsigned, cons_to_signed): New functions.
20146 These signal an error for invalid or out-of-range values.
20147 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20148 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20149 * font.c (Ffont_variation_glyphs):
20150 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20151 * lisp.h: Include <intprops.h>.
20152 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20153 (cons_to_signed, cons_to_unsigned): New decls.
20154 (long_to_cons, cons_to_long): Remove decls.
20155 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20156 (Fprimitive_undo): Use CONS_TO_INTEGER.
20157 * xfns.c (Fx_window_property): Likewise.
20158 * xselect.c: Include <limits.h>.
20159 (x_own_selection, selection_data_to_lisp_data):
20160 Use INTEGER_TO_CONS.
20161 (x_handle_selection_request, x_handle_selection_clear)
20162 (x_get_foreign_selection, Fx_disown_selection_internal)
20163 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20164 (lisp_data_to_selection_data): Use cons_to_unsigned.
20165 (x_fill_property_data): Use cons_to_signed.
20166 Report values out of range.
20168 Check for buffer and string overflow more precisely.
20169 * buffer.h (BUF_BYTES_MAX): New macro.
20170 * lisp.h (STRING_BYTES_MAX): New macro.
20171 * alloc.c (Fmake_string):
20172 * character.c (string_escape_byte8):
20173 * coding.c (coding_alloc_by_realloc):
20174 * doprnt.c (doprnt):
20175 * editfns.c (Fformat):
20177 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20178 since they may not be the same number.
20179 * editfns.c (Finsert_char):
20180 * fileio.c (Finsert_file_contents):
20181 Likewise for BUF_BYTES_MAX.
20183 * image.c: Use ptrdiff_t, not int, for sizes.
20184 (slurp_file): Switch from int to ptrdiff_t.
20186 (slurp_file): Check that file size fits in both size_t (for
20187 malloc) and ptrdiff_t (for sanity and safety).
20189 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20190 if b->modtime has its maximal value.
20192 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20194 Don't assume time_t can fit into int.
20195 * buffer.h (struct buffer.modtime): Now time_t, not int.
20196 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20197 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20199 Minor fixes for signed vs unsigned integers.
20200 * character.h (MAYBE_UNIFY_CHAR):
20201 * charset.c (maybe_unify_char):
20202 * keyboard.c (read_char, reorder_modifiers):
20203 XINT -> XFASTINT, since the integer must be nonnegative.
20204 * ftfont.c (ftfont_spec_pattern):
20205 * keymap.c (access_keymap, silly_event_symbol_error):
20206 XUINT -> XFASTINT, since the integer must be nonnegative.
20207 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20208 since it makes no difference and we prefer signed.
20209 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20210 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20213 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20215 * window.h (Fwindow_frame): Declare.
20217 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20219 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20220 (SPARE_MEMORY): Always define.
20221 (LARGE_REQUEST): Remove.
20222 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20224 2011-06-06 Martin Rudalics <rudalics@gmx.at>
20226 * lisp.h: Move EXFUNS for Fframe_root_window,
20227 Fframe_first_window and Fset_frame_selected_window to window.h.
20229 * window.h: Move EXFUNS for Fframe_root_window,
20230 Fframe_first_window and Fset_frame_selected_window here from
20233 * frame.c (Fwindow_frame, Fframe_first_window)
20234 (Fframe_root_window, Fframe_selected_window)
20235 (Fset_frame_selected_window): Move to window.c.
20236 (Factive_minibuffer_window): Move to minibuf.c.
20237 (Fother_visible_frames_p): New function.
20239 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20241 * window.c (decode_window, decode_any_window): Move up in code.
20242 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20243 (inhibit_frame_unsplittable): Remove unused variable.
20244 (Fwindow_buffer): Move up and rewrite doc-string.
20245 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20246 (Fwindow_prev): New functions.
20247 (Fwindow_frame): Move here from frame.c. Accept any window as
20249 (Fframe_root_window, Fframe_first_window)
20250 (Fframe_selected_window): Move here from frame.c. Accept frame
20251 or arbitrary window as argument. Update doc-strings.
20252 (Fminibuffer_window): Move up in code.
20253 (Fwindow_minibuffer_p): Move up in code and simplify.
20254 (Fset_frame_selected_window): Move here from frame.c.
20256 (Fselected_window, select_window, Fselect_window): Move up in
20257 code. Minor doc-string fixes.
20259 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20261 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20262 Do not assume that spare memory exists; that assumption is valid
20263 only if SYSTEM_MALLOC.
20264 (LARGE_REQUEST): New macro, so that the issue of large requests
20265 is separated from the issue of spare memory.
20267 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20269 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20272 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20274 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20277 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20279 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20281 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20283 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20284 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20286 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20288 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20290 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20292 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20293 (x_clipboard_manager_save): Add return value.
20294 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20295 New error handlers.
20296 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20297 Obey Vx_select_enable_clipboard_manager. Catch errors in
20298 x_clipboard_manager_save (Bug#8779).
20299 (Vx_select_enable_clipboard_manager): New variable.
20300 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20302 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20304 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20306 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20308 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20309 in the current matrix if keep_current_p is non-zero.
20311 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20313 * bidi.c (bidi_level_of_next_char): Fix last change.
20315 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20317 Support bidi reordering of text covered by display properties.
20319 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20320 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20321 (bidi_cache_search, bidi_cache_iterator_state)
20322 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20323 (bidi_level_of_next_char, bidi_move_to_visually_next):
20324 Support character positions inside a run of characters covered by a
20326 (bidi_paragraph_init, bidi_resolve_explicit_1)
20327 (bidi_level_of_next_char): Call bidi_fetch_char and
20328 bidi_fetch_char_advance instead of FETCH_CHAR and
20329 FETCH_CHAR_ADVANCE.
20330 (bidi_init_it): Initialize new members.
20331 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20333 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20334 instead of using explicit *_CHAR codes.
20335 (bidi_resolve_explicit, bidi_resolve_weak):
20336 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20337 bidirectional text is supported only in multibyte buffers.
20338 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20339 it to initialize the frame_window_p member of struct bidi_it.
20340 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20341 (bidi_resolve_explicit, bidi_resolve_weak)
20342 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20343 bidi_it->nchars is non-positive.
20344 (bidi_level_of_next_char): Don't try to lookup the cache for the
20345 next/previous character if nothing is cached there yet, or if we
20346 were just reseat()'ed to a new position.
20348 * xdisp.c (set_cursor_from_row): Set start and stop points
20349 according to the row's direction when priming the loop that looks
20350 for the glyph on which to display cursor.
20351 (single_display_spec_intangible_p): Function deleted.
20352 (display_prop_intangible_p): Reimplement to call
20353 handle_display_spec instead of single_display_spec_intangible_p.
20354 Accept 3 additional arguments needed by handle_display_spec.
20355 This fixes incorrect cursor motion across display property with complex
20356 values: lists, `(when COND...)' forms, etc.
20357 (single_display_spec_string_p): Support property values that are
20358 lists with the argument STRING its top-level element.
20359 (display_prop_string_p): Fix the condition for processing a
20360 property that is a list to be consistent with handle_display_spec.
20361 (handle_display_spec): New function, refactored from the
20362 last portion of handle_display_prop.
20363 (compute_display_string_pos): Accept additional argument
20364 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20365 value of a `display' property is a "replacing spec".
20366 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20367 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20368 the display property, but just return a value indicating whether
20369 the display property will replace the characters it covers.
20370 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20371 frame_window_p members of struct bidi_it.
20372 (compute_display_string_pos, compute_display_string_end):
20374 (push_it): Accept second argument POSITION, where pop_it should
20375 jump to continue iteration.
20376 (reseat_1): Initialize bidi_it.disp_pos.
20378 * keyboard.c (adjust_point_for_property): Adjust the call to
20379 display_prop_intangible_p to its new signature.
20381 * dispextern.h (struct bidi_it): New member frame_window_p.
20382 (bidi_init_it): Update prototypes.
20383 (display_prop_intangible_p): Update prototype.
20384 (compute_display_string_pos, compute_display_string_end):
20385 Declare prototypes.
20386 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20389 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20391 Malloc failure behavior now depends on size of allocation.
20392 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20393 * lisp.h: Change signatures accordingly.
20394 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20395 All callers changed. (Bug#8762)
20397 * gnutls.c: Use Emacs's memory allocators.
20398 Without this change, the gnutls library would invoke malloc etc.
20399 directly, which causes problems on non-SYNC_INPUT hosts, and which
20400 runs afoul of improving memory_full behavior. (Bug#8761)
20401 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20402 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20403 xfree instead of the default malloc, realloc, free.
20404 (Fgnutls_boot): No need to check for memory allocation failure,
20405 since xmalloc does that for us.
20407 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20408 * category.c (hash_get_category_set):
20409 * ccl.c (ccl_driver):
20410 * charset.c (Fdefine_charset_internal):
20411 * charset.h (struct charset.hash_index):
20412 * composite.c (get_composition_id, gstring_lookup_cache)
20413 (composition_gstring_put_cache):
20414 * composite.h (struct composition.hash_index):
20415 * dispextern.h (struct image.hash):
20416 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20417 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20418 (hashfn_equal, hashfn_user_defined, make_hash_table)
20419 (maybe_resize_hash_table, hash_lookup, hash_put)
20420 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20421 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20422 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20423 * image.c (make_image, search_image_cache, lookup_image)
20424 (xpm_put_color_table_h):
20425 * lisp.h (struct Lisp_Hash_Table):
20426 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20427 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20428 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20429 * alloc.c (allocate_vectorlike):
20430 Check for overflow in vector size calculations.
20431 * ccl.c (ccl_driver):
20432 Check for overflow when converting EMACS_INT to int.
20433 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20434 need to be updated by these changes.
20435 * fns.c (make_hash_table, maybe_resize_hash_table):
20436 Check for integer overflow with large hash tables.
20437 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20438 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20439 (SXHASH_REDUCE): New macro.
20440 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20441 Use it instead of discarding useful hash info with large hash values.
20442 (sxhash_float): New function.
20443 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20444 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20445 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20446 Rewrite to use FIXNUM_BITS, as this simplifies things.
20447 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20448 Adjust signatures to match updated version of code.
20449 (consing_since_gc): Now EMACS_INT, since a single hash table can
20450 use more than INT_MAX bytes.
20452 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20454 Make it possible to build with GCC-4.6+ -O2 -flto.
20456 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20458 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20460 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20461 Call minibuffer-inactive-mode.
20463 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20465 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20466 Update dependencies.
20468 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20470 * data.c (init_data): Remove code for UTS, this system is not
20473 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20475 Don't force ./temacs to start in terminal mode.
20477 * frame.c (make_initial_frame): Initialize faces in all cases, not
20478 only when CANNOT_DUMP is defined.
20479 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20481 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20483 * dispnew.c (add_window_display_history): Use const for the string
20484 pointer. Remove declaration, not needed.
20486 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20488 Use 'inline', not 'INLINE'.
20489 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20490 * alloc.c, fontset.c (INLINE): Remove.
20491 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20492 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20493 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20494 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20495 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20497 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20499 Make it possible to run ./temacs.
20501 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20502 syms_of_callproc does the same thing. Remove test for
20503 "initialized", do it in the caller.
20504 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20506 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20508 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20509 (read_minibuf): Use get_minibuffer.
20510 (syms_of_minibuf): Use DEFSYM.
20511 (Qmetadata): New var.
20512 * data.c (Qbuffer): Don't make it static.
20513 (syms_of_data): Use DEFSYM.
20515 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20517 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20518 (CCL_CODE_MIN): New macro.
20520 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20522 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20524 * eval.c (Qdebug): Now static.
20525 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20526 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20527 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20529 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20531 * image.c: Various fixes to ImageMagick code comments.
20532 (Fimagemagick_types): Doc fix.
20534 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20536 Minor fixes prompted by GCC 4.6.0 warnings.
20538 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20540 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20541 (x_clipboard_manager_save_all): Move extern decl to ...
20542 * xterm.h: ... here, so that it can be checked for consistency.
20544 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20546 * xselect.c (x_clipboard_manager_save_frame)
20547 (x_clipboard_manager_save_all): New functions.
20548 (Fx_clipboard_manager_save): Lisp function deleted.
20550 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20551 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20553 * xterm.h: Update prototype.
20555 2011-05-28 William Xu <william.xwl@gmail.com>
20557 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20558 exiting (Bug#8239).
20560 2011-05-28 Jim Meyering <meyering@redhat.com>
20562 Avoid a sign-extension bug in crypto_hash_function.
20563 * fns.c (to_uchar): Define.
20564 (crypto_hash_function): Use it to convert some newly-signed
20565 variables to unsigned, to avoid sign-extension bugs. For example,
20566 without this change, (md5 "truc") would evaluate to
20567 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20568 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
20569 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
20571 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20573 Integer overflow fixes.
20575 * dbusbind.c: Serial number integer overflow fixes.
20576 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
20577 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20578 to hold a serial number that is too large for a fixnum.
20579 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20580 Check for serial numbers out of range. Decode any serial number
20581 that was so large that it became a float. (Bug#8722)
20583 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20584 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20585 Use XFASTINT rather than XUINT when numbers are nonnegative.
20586 (xd_append_arg, Fdbus_method_return_internal):
20587 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20588 arguments, check that Lisp number is nonnegative, rather than
20589 silently wrapping negative numbers around. (Bug#8722)
20590 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
20593 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20595 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20597 ccl: Add integer overflow checks.
20598 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20599 (IN_INT_RANGE): New macros.
20600 (ccl_driver): Use them to check for integer overflow when
20601 decoding a CCL program. Many of the new checks are whether XINT (x)
20602 fits in int; it doesn't always, on 64-bit hosts. The new version
20603 doesn't catch all possible integer overflows, but it's an
20604 improvement. (Bug#8719)
20606 * alloc.c (make_event_array): Use XINT, not XUINT.
20607 There's no need for unsigned here.
20609 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20610 This follows up to the 2011-05-06 change that substituted uintptr_t
20611 for EMACS_INT. This case wasn't caught back then.
20613 Rework Fformat to avoid integer overflow issues.
20614 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20615 now (part of C89). Include <verify.h>.
20616 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20617 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20618 (Fformat): Avoid the prepass trying to compute sizes; it was only
20619 approximate and thus did not catch overflow reliably. Instead, walk
20620 through the format just once, formatting and computing sizes as we go,
20621 checking for integer overflow at every step, and allocating a larger
20622 buffer as needed. Keep track separately whether the format is
20623 multibyte. Keep only the most-recently calculated precision, rather
20624 than them all. Record whether each argument has been converted to
20625 string. Use EMACS_INT, not int, for byte and char and arg counts.
20626 Support field widths and precisions larger than INT_MAX. Avoid
20627 sprintf's undefined behavior with conversion specifications such as %#d
20628 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20629 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20630 formatting out-of-range floating point numbers with int
20631 formats. (Bug#8668)
20633 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20635 * data.c: Avoid integer truncation in expressions involving floats.
20636 * data.c: Include <intprops.h>.
20637 (arith_driver): When there's an integer overflow in an expression
20638 involving floating point, convert the integers to floating point
20639 so that the resulting value does not suffer from catastrophic
20640 integer truncation. For example, on a 64-bit host (* 4
20641 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20642 Do not rely on undefined behavior after integer overflow.
20644 merge count_size_as_multibyte, parse_str_to_multibyte
20645 * character.c, character.h (count_size_as_multibyte):
20646 Rename from parse_str_to_multibyte; all uses changed.
20647 Check for integer overflow.
20648 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20649 since it's now a duplicate of the other. This is more of
20650 a character than a buffer op, so better that it's in character.c.
20651 * fns.c, print.c: Adjust to above changes.
20653 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20655 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20657 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20659 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20660 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20661 (x_clipboard_manager_save): Now static.
20662 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20664 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20665 (crypto_hash_function): Now static.
20666 Fix pointer signedness problems. Avoid unnecessary initializations.
20668 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
20670 * termhooks.h (Vselection_alist): Make it terminal-local.
20672 * terminal.c (create_terminal): Initialize it.
20674 * xselect.c: Support for clipboard managers.
20675 (Vselection_alist): Move to termhooks.h as terminal-local var.
20676 (LOCAL_SELECTION): New macro.
20677 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20678 (symbol_to_x_atom): Remove gratuitous arg.
20679 (x_handle_selection_request, lisp_data_to_selection_data)
20680 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
20681 (x_own_selection, x_get_local_selection, x_convert_selection):
20682 New arg, specifying work frame. Use terminal-local Vselection_alist.
20683 (some_frame_on_display): Delete unused function.
20684 (Fx_own_selection_internal, Fx_get_selection_internal)
20685 (Fx_disown_selection_internal, Fx_selection_owner_p)
20686 (Fx_selection_exists_p): New optional frame arg.
20687 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20688 (x_handle_selection_clear): Don't treat other terminals with the
20689 same keyboard specially. Use the terminal-local Vselection_alist.
20690 (x_clear_frame_selections): Use Frun_hook_with_args.
20692 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20694 * xterm.h: Add support for those atoms.
20696 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
20698 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20699 (converted_selections, conversion_fail_tag): New global variables.
20700 (x_selection_request_lisp_error): Free the above.
20701 (x_get_local_selection): Remove unnecessary code.
20702 (x_reply_selection_request): Args changed; handle arbitrary array
20703 of converted selections stored in converted_selections.
20704 Separate the XChangeProperty and SelectionNotify steps.
20705 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20706 (x_convert_selection): New function.
20707 (x_handle_selection_event): Simplify.
20708 (x_get_foreign_selection): Don't ignore incoming requests while
20709 waiting for an answer; this will fail when we implement
20710 SAVE_TARGETS, and seems unnecessary anyway.
20711 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20712 (Vx_sent_selection_functions): Doc fix.
20714 2011-05-26 Leo Liu <sdl.web@gmail.com>
20716 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20718 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20720 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20722 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20723 for fringe update if it has periodic bitmap.
20724 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
20725 and fringe_bitmap_periodic_p.
20727 * fringe.c (get_fringe_bitmap_data): New function.
20728 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20729 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20730 row. Mark glyph row for fringe update if periodicity changed.
20732 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20733 for fringe update unless it has periodic bitmap.
20735 2011-05-25 Kenichi Handa <handa@m17n.org>
20737 * xdisp.c (get_next_display_element): Set correct it->face_id for
20738 a static composition.
20740 2011-05-24 Leo Liu <sdl.web@gmail.com>
20743 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20745 * fns.c (crypto_hash_function, Fsha1): New function.
20746 (Fmd5): Use crypto_hash_function.
20747 (syms_of_fns): Add Ssha1.
20749 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20751 * gnutls.c: Remove unused macros.
20752 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20753 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20754 Remove macros that are defined and never used.
20755 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20757 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20759 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20760 (Fx_get_selection_internal): Minor cleanup.
20761 (Fx_own_selection_internal): Rename arguments for consistency with
20764 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20766 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20768 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20770 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20772 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20774 * dispnew.c (scrolling_window): Don't exclude the case that the
20775 last enabled row in the desired matrix touches the bottom boundary.
20777 2011-05-21 Glenn Morris <rgm@gnu.org>
20779 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
20780 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20781 and add some more files.
20783 2011-05-20 Eli Zaretskii <eliz@gnu.org>
20785 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20786 report_file_error introduced by the change from 2011-05-07.
20788 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20790 * systime.h (Time): Define only if emacs is defined.
20791 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20792 where the include path doesn't have X11/X.h by default. See
20793 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20795 2011-05-20 Kenichi Handa <handa@m17n.org>
20797 * composite.c (find_automatic_composition): Fix previous change.
20799 2011-05-20 Glenn Morris <rgm@gnu.org>
20801 * lisp.mk: New file, split from Makefile.in.
20802 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20803 (shortlisp): Remove.
20804 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20806 2011-05-19 Glenn Morris <rgm@gnu.org>
20808 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20809 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20810 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20811 (lisp): Set the order to that of loadup.el.
20812 (shortlisp): Make it a copy of $lisp.
20813 (SOME_MACHINE_LISP): Remove.
20814 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20815 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20817 2011-05-18 Kenichi Handa <handa@m17n.org>
20819 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20820 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20821 (find_automatic_composition): Mostly rewrite for efficiency.
20823 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
20825 * makefile.w32-in: Update dependencies.
20827 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20829 * menu.c: Include limits.h (fixes the MS-Windows build broken by
20830 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
20832 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
20834 Fix some integer overflow issues, such as string length overflow.
20836 * insdel.c (count_size_as_multibyte): Check for string overflow.
20838 * character.c (lisp_string_width): Check for string overflow.
20839 Use EMACS_INT, not int, for string indexes and lengths; in
20840 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20841 the resulting string length overflows an EMACS_INT; instead,
20842 report a string overflow if no precision given. When checking for
20843 precision exhaustion, use a check that cannot possibly have
20844 integer overflow. (Bug#8675)
20845 * character.h (lisp_string_width): Adjust to new signature.
20847 * alloc.c (string_overflow): New function.
20848 (Fmake_string): Use it. This doesn't change behavior, but saves
20849 a few bytes and will simplify future changes.
20850 * character.c (string_escape_byte8): Likewise.
20851 * lisp.h (string_overflow): New decl.
20853 Fixups, following up to the user-interface timestamp change.
20854 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20855 for UI timestamps, instead of unsigned long.
20856 * msdos.c (mouse_get_pos): Likewise.
20857 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
20858 * w32gui.h (Time): Define by including "systime.h" rather than by
20859 declaring it ourselves. (Bug#8664)
20861 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20862 * image.c (clear_image_cache): Likewise.
20864 * term.c (term_mouse_position): Don't assume time_t wraparound.
20866 Be more systematic about user-interface timestamps.
20867 Before, the code sometimes used 'Time', sometimes 'unsigned long',
20868 and sometimes 'EMACS_UINT', to represent these timestamps.
20869 This change causes it to use 'Time' uniformly, as that's what X uses.
20870 This makes the code easier to follow, and makes it easier to catch
20871 integer overflow bugs such as Bug#8664.
20872 * frame.c (Fmouse_position, Fmouse_pixel_position):
20873 Use Time, not unsigned long, for user-interface timestamps.
20874 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20875 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20876 * keyboard.h (last_event_timestamp): Likewise.
20877 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20878 * menu.h (xmenu_show): Likewise.
20879 * term.c (term_mouse_position): Likewise.
20880 * termhooks.h (struct input_event.timestamp): Likewise.
20881 (struct terminal.mouse_position_hook): Likewise.
20882 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20883 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20884 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20885 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20886 what it was before.
20887 * menu.h, termhooks.h: Include "systime.h", for Time.
20889 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20890 Don't assume that the difference between two unsigned long values
20891 can fit into an integer. At this point, we know button_down_time
20892 <= event->timestamp, so the difference must be nonnegative, so
20893 there's no need to cast the result if double-click-time is
20894 nonnegative, as it should be; check that it's nonnegative, just in
20895 case. This bug is triggered when events are more than 2**31 ms
20896 apart (about 25 days). (Bug#8664)
20898 * xselect.c (last_event_timestamp): Remove duplicate decl.
20899 (x_own_selection): Remove needless cast to unsigned long.
20901 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20902 that always fit in int. Use a sentinel instead of a counter, to
20903 avoid a temp and to allay GCC's concerns about possible int overflow.
20904 * frame.h (struct frame): Use int for menu_bar_items_used
20905 instead of EMACS_INT, since it always fits in int.
20907 * menu.c (grow_menu_items): Check for int overflow.
20909 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20911 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20912 Before, the code was not consistent. These values cannot exceed
20913 2**31 - 1 so there's no need to make them unsigned.
20914 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20915 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20916 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20918 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20920 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20921 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20922 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20923 presumably because the widths might not match.
20925 * window.c (size_window): Avoid needless test at loop start.
20927 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20929 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20931 2011-05-12 Drew Adams <drew.adams@oracle.com>
20933 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20935 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20937 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20938 `width' to `bar_area_x' and `bar_area_width', respectively.
20939 (x_scroll_run): Take account of fringe background extension.
20941 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20942 Rename local vars `left' and `width' to `bar_area_x' and
20943 `bar_area_width', respectively.
20944 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20945 background extension.
20947 2011-05-10 Jim Meyering <meyering@redhat.com>
20949 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20951 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
20953 * image.c (Finit_image_library): Return t for built-in image types,
20954 like pbm and xbm. (Bug#8640)
20956 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20958 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20960 2011-05-07 Eli Zaretskii <eliz@gnu.org>
20962 * w32console.c (Fset_screen_color): Doc fix.
20963 (Fget_screen_color): New function.
20964 (syms_of_ntterm): Defsubr it.
20966 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20967 unlink the temporary file if Fcall_process didn't create it in the
20969 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20970 child process will be redirected to a file specified with `:file'.
20971 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20972 cue to call_process_cleanup not to close that handle.
20974 2011-05-07 Ben Key <bkey76@gmail.com>
20976 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20977 one of two shell specific rules, either bootstrap-temacs-CMD or
20978 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20979 to the previous implementation of the bootstrap-temacs rule.
20980 The bootstrap-temacs-CMD rule is similar to the previous
20981 implementation of the bootstrap-temacs rule except that it
20982 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20985 These changes, along with some changes to nt/configure.bat,
20986 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20987 earlier fix to add support for --cflags and --ldflags options
20988 that include quotes so that it works whether make uses cmd or
20991 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
20993 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20994 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20996 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20997 a string. Handle both cases.
20998 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20999 (Fdbus_register_method): Use Qinvalid_function.
21001 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21003 * makefile.w32-in: Update dependencies.
21004 (LISP_H): Add inttypes.h and stdin.h.
21005 (PROCESS_H): Add unistd.h.
21007 2011-05-06 Eli Zaretskii <eliz@gnu.org>
21009 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21010 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21012 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
21014 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21016 * term.c (vfatal): Remove stray call to va_end.
21017 It's not needed and the C Standard doesn't allow it here anyway.
21019 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21020 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21022 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21025 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21027 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21029 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21031 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21033 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21035 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21036 * charset.c (Fdefine_charset_internal): Don't initialize
21037 charset.code_space[15]. The value was garbage, on hosts with
21038 32-bit int (Bug#8600).
21040 * lread.c (read_integer): Be more consistent with string-to-number.
21041 Use string_to_number to do the actual conversion; this avoids
21042 rounding errors and fixes some other screwups. Without this fix,
21043 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21044 (digit_to_number): Move earlier, for benefit of read_integer.
21045 Return -1 if the digit is out of range for the base, -2 if it is
21046 not a digit in any supported base. (Bug#8602)
21048 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21050 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21051 to match comment at start of function. This also removes a
21052 GCC warning about overflow in a 32+64-bit port.
21054 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21056 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21057 Reported by Stefan Monnier in
21058 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
21059 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21060 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21062 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21063 (EMACS_UINTPTR): Likewise, with uintptr_t.
21065 * lisp.h: Prefer 64-bit EMACS_INT if available.
21066 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21067 on 32-bit hosts that have 64-bit int, so that they can access
21069 However, temporarily disable this change unless the temporary
21070 symbol WIDE_EMACS_INT is defined.
21072 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21074 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21075 This removes an assumption that EMACS_INT and long are the same
21076 width as pointers. The assumption is true for Emacs porting targets
21077 now, but we want to make other targets possible.
21078 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21079 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21080 In the rest of the code, change types of integers that hold casted
21081 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21082 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21083 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21084 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21085 No need to cast type when ORing.
21086 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21087 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21088 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21089 assume EMACS_INT is the same width as char *.
21090 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21091 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21092 Remove no-longer-needed casts.
21093 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21094 (xg_tool_bar_help_callback, xg_make_tool_item):
21095 Use EMACS_INTPTR to hold an integer
21096 that will be cast to void *; this can avoid a GCC warning
21097 if EMACS_INT is not the same width as void *.
21098 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21099 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21100 (current_message_1, set_message_1):
21101 Use a local to convert to proper width without a cast.
21102 * xmenu.c (dialog_selection_callback): Likewise.
21104 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21105 Also, don't assume VALBITS / RAND_BITS is less than 5,
21106 and don't rely on undefined behavior when shifting a 1 left into
21108 * lisp.h (get_random): Change signature to match.
21110 * lread.c (hash_string): Use size_t, not int, for hash computation.
21111 Normally we prefer signed values; but hashing is special, because
21112 it's better to use unsigned division on hash table sizes so that
21113 the remainder is nonnegative. Also, size_t is the natural width
21114 for hashing into memory. The previous code used 'int', which doesn't
21115 retain enough info to hash well into very large tables.
21116 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21118 * dbusbind.c: Don't possibly lose pointer info when converting.
21119 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21120 Use XPNTR rather than XHASH, so that the high-order bits of
21121 the pointer aren't lost when converting through void *.
21123 * eval.c (Fautoload): Don't double-shift a pointer.
21125 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21127 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21129 * gnutls.c (DEF_GNUTLS_FN):
21130 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21132 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21134 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21137 2011-05-05 Eli Zaretskii <eliz@gnu.org>
21139 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21140 New version that can reserve upto 2GB of heap space.
21142 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
21144 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21146 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21148 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21149 `gnutls_certificate_set_x509_key_file'.
21151 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
21153 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21154 Update dependencies.
21156 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21158 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21159 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21160 Remove unused parameter `fildes'.
21161 * process.c (read_process_output, send_process): Don't pass it.
21163 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21165 Fix previous change: the library cache is defined in w32.c.
21166 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21167 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21169 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21171 Implement dynamic loading of GnuTLS on Windows.
21173 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21174 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21175 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21178 * gnutls.c (Qgnutls_dll): Define.
21179 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21180 (gnutls_*): Declare function pointers.
21181 (init_gnutls_functions): New function to initialize function pointers.
21182 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21183 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21184 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21185 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21186 (emacs_gnutls_write, emacs_gnutls_read)
21187 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21188 (Fgnutls_available_p): New function.
21189 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21190 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21191 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21193 * image.c: Include w32.h.
21194 (Vimage_type_cache): Delete.
21195 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21196 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21197 (w32_delayed_load): Move to w32.c.
21199 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21201 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21202 (w32_delayed_load): Move from image.c. When loading a library, record
21203 its filename in the :loaded-from property of the library id.
21204 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21205 Initialize and staticpro them.
21206 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21208 * process.c: Include lisp.h before w32.h, not after.
21209 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21210 instead of gnutls_record_check_pending.
21212 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21214 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21216 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21217 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21220 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21222 * xterm.c (x_set_frame_alpha): Do not set property on anything
21223 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21225 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21227 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21229 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21231 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21232 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21233 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21234 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21235 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21236 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21237 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21238 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21239 (Qgnutls_bootprop_callbacks_verify): Make static.
21241 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21243 * callproc.c: Indentation fixup.
21245 * sysdep.c (wait_for_termination_1): Make static.
21246 (wait_for_termination, interruptible_wait_for_termination):
21247 Move after wait_for_termination_1.
21249 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21251 * sysdep.c (interruptible_wait_for_termination): New function
21252 which is like wait_for_termination, but allows keyboard
21255 * callproc.c (Fcall_process): Add (:file "file") as an option for
21257 (Fcall_process_region): Ditto.
21259 2011-04-30 Eli Zaretskii <eliz@gnu.org>
21261 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21262 rather than `XVECTOR (FOO)->size'.
21264 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21265 inttypes.h, as a gnulib replacement is used if it not available in
21268 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21270 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21271 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21272 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21274 * coding.c (coding_alloc_by_realloc): Error out if destination
21275 will grow beyond MOST_POSITIVE_FIXNUM.
21276 (decode_coding_emacs_mule): Abort if there isn't enough place in
21277 charbuf for the composition carryover bytes. Reserve an extra
21278 space for up to 2 characters produced in a loop.
21279 (decode_coding_iso_2022): Abort if there isn't enough place in
21280 charbuf for the composition carryover bytes.
21282 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21284 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21285 aborting when %lld or %lll format is passed.
21286 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21287 %llo or %llx format is passed. (Bug#8545)
21289 * window.c (window_scroll_line_based): Use a marker instead of
21290 simple variables to record original value of point. (Bug#7952)
21292 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21293 produced by %s or %c overflows available buffer space. (Bug#8545)
21295 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21297 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21298 (SIZE_MAX): Move defn after all includes, as they might #define it.
21300 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21302 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21304 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21306 * keyboard.c (Qdelayed_warnings_hook): Define.
21307 (command_loop_1): Run `delayed-warnings-hook'
21308 if Vdelayed_warnings_list is non-nil.
21309 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21310 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21312 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21314 * doprnt.c (doprnt): Don't return value smaller than the buffer
21315 size if the message was truncated. (Bug#8545).
21317 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21319 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21320 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21322 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21324 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21326 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21328 * makefile.w32-in: Update dependencies.
21330 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21332 Improve `doprnt' and its usage. (Bug#8545)
21333 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21334 `format_end'. Remove support for %l as a conversion specifier.
21335 Don't use xrealloc. Improve diagnostics when the %l size modifier
21336 is used. Update the commentary.
21338 * eval.c (verror): Simplify calculation of size_t.
21340 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21343 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21345 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21348 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21350 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21351 This makes this file independent of the recent pseudovector change.
21353 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21355 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21357 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21358 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21359 Remove unused local.
21360 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21362 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21363 GCC 4.6.0 optimizes based on type-based alias analysis.
21364 For example, if b is of type struct buffer * and v of type struct
21365 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21366 != &v->size, and therefore "v->size = 1; b->size = 2; return
21367 v->size;" must therefore return 1. This assumption is incorrect
21368 for Emacs, since it type-puns struct Lisp_Vector * with many other
21369 types. To fix this problem, this patch adds a new type struct
21370 vectorlike_header that documents the constraints on layout of vectors
21371 and pseudovectors, and helps optimizing compilers not get fooled
21372 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21373 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21374 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21376 (XSETPVECTYPE): Rewrite in terms of new macro.
21377 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21378 This is a bit clearer, and further avoids the possibility of
21379 undesirable aliasing.
21380 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21381 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21382 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21383 since Lisp_Subr is a special case (no "next" field).
21384 (ASIZE): Now uses header.size rather than size.
21385 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21386 to avoid the hassle of writing XVECTOR (foo)->header.size.
21387 (struct vectorlike_header): New type.
21388 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21389 object, to help avoid aliasing.
21390 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21391 (SUBRP): Likewise, since Lisp_Subr is a special case.
21392 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21393 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21394 (struct Lisp_Hash_Table): Combine first two members into a single
21395 struct vectorlike_header member. All uses of "size" and "next" members
21396 changed to be "header.size" and "header.next".
21397 * buffer.h (struct buffer): Likewise.
21398 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21399 * frame.h (struct frame): Likewise.
21400 * process.h (struct Lisp_Process): Likewise.
21401 * termhooks.h (struct terminal): Likewise.
21402 * window.c (struct save_window_data, struct saved_window): Likewise.
21403 * window.h (struct window): Likewise.
21404 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21405 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21406 * buffer.c (init_buffer_once): Likewise.
21407 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21409 * process.c (Fformat_network_address): Use local var for size,
21412 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21414 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21415 * data.c (atof): Remove decl; no longer used or needed.
21416 (digit_to_number): Move to lread.c.
21417 (Fstring_to_number): Use new string_to_number function, to be
21418 consistent with how the Lisp reader treats infinities and NaNs.
21419 Do not assume that floating-point numbers represent EMACS_INT
21420 without losing information; this is not true on most 64-bit hosts.
21421 Avoid double-rounding errors, by insisting on integers when
21422 parsing non-base-10 numbers, as the documentation specifies.
21423 * lisp.h (string_to_number): New decl, replacing ...
21424 (isfloat_string): Remove.
21425 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21426 (read1): Do not accept +. and -. as integers; this
21427 appears to have been a coding error. Similarly, do not accept
21428 strings like +-1e0 as floating point numbers. Do not report
21429 overflow for integer overflows unless the base is not 10 which
21430 means we have no simple and reliable way to continue.
21431 Break out the floating-point parsing into a new
21432 function string_to_number, so that Fstring_to_number parses
21433 floating point numbers consistently with the Lisp reader.
21434 (digit_to_number): Move here from data.c. Make it static inline.
21435 (E_CHAR, EXP_INT): Remove, replacing with ...
21436 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21437 (string_to_number): New function, replacing isfloat_string.
21438 This function checks for valid syntax and produces the resulting
21439 Lisp float number too. Rework it so that string-to-number
21440 no longer mishandles examples like "1.0e+". Use strtoumax,
21441 so that overflow for non-base-10 numbers is reported only when
21442 there's no portable and simple way to convert to floating point.
21444 * textprop.c (set_text_properties_1): Rewrite for clarity,
21445 and to avoid GCC warning about integer overflow.
21447 * intervals.h (struct interval): Use EMACS_INT for members
21448 where EMACS_UINT might cause problems. See
21449 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21450 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21451 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21453 (offset_intervals): Tell GCC not to worry about length overflow
21454 when negating a negative length.
21456 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21457 (overrun_check_free): Likewise.
21459 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21460 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21463 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21464 (gnutls_make_error): Rename local to avoid shadowing.
21465 (gnutls_emacs_global_deinit): ifdef out; not used.
21466 (Fgnutls_boot): Use const for pointer to readonly storage.
21467 Comment out unused local. Fix pointer signedness problems.
21469 * lread.c (openp): Don't stuff size_t into an 'int'.
21470 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21471 about possible signed overflow.
21473 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21474 (GDK_KEY_g): Don't define if already defined.
21475 (xg_prepare_tooltip): Avoid pointer signedness problem.
21476 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21478 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21479 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21481 * xfns.c (Fx_window_property): Simplify a bit,
21482 to make a bit faster and to avoid GCC 4.6.0 warning.
21483 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21485 * fns.c (internal_equal): Don't assume size_t fits in int.
21487 * alloc.c (compact_small_strings): Tighten assertion a little.
21489 Replace pEd with more-general pI, and fix some printf arg casts.
21490 * lisp.h (pI): New macro, generalizing old pEd macro to other
21491 conversion specifiers. For example, use "...%"pI"d..." rather
21492 than "...%"pEd"...".
21493 (pEd): Remove. All uses replaced with similar uses of pI.
21494 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21495 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21496 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21497 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21498 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21499 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21500 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21502 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21503 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21504 * print.c (safe_debug_print, print_object): Likewise.
21505 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21507 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21508 avoiding the 0 flag, which is not portable.
21509 * process.c (Fmake_network_process): Use pI to avoid cast.
21510 * region-cache.c (pp_cache): Likewise.
21511 * xdisp.c (decode_mode_spec): Likewise.
21512 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21513 behavior on 64-bit hosts with printf arg.
21514 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21515 (x_stop_queuing_selection_requests): Likewise.
21516 (x_get_window_property): Don't truncate byte count to an 'int'
21519 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21520 here, since it parses constructs like leading '-' and spaces,
21521 which are not wanted; and it overflows with large numbers.
21522 Instead, simply match F[0-9]+, which is what is wanted anyway.
21524 * alloc.c: Remove unportable assumptions about struct layout.
21525 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21526 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21527 (allocate_vectorlike, make_pure_vector): Use the new macros,
21528 plus offsetof, to remove unportable assumptions about struct layout.
21529 These assumptions hold on all porting targets that I know of, but
21530 they are not guaranteed, they're easy to remove, and removing them
21531 makes further changes easier.
21533 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21534 This doesn't fix a bug but makes the code clearer.
21535 (string_overrun_cookie): Now const. Use initializers that
21536 don't formally overflow signed char, to avoid warnings.
21537 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21538 can cause Emacs to crash when string overrun checking is enabled.
21539 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21540 multiple of sizeof (EMACS_INT); it need not be, if
21541 alignof(EMACS_INT) < sizeof (EMACS_INT).
21542 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21544 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21546 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21548 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21550 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21551 supposed to be handshaking. (Bug#8556)
21552 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21554 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
21556 * lisp.h (Qdebug): List symbol.
21557 * eval.c (Qdebug): Restore global linkage.
21558 * keyboard.c (debug-on-event): New variable.
21559 (handle_user_signal): Break into debugger when debug-on-event
21560 matches the current signal symbol.
21562 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21564 * alloc.c (check_sblock, check_string_bytes)
21565 (check_string_free_list): Convert to standard C.
21567 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21569 * w32.c (emacs_gnutls_push): Fix typo.
21571 2011-04-25 Eli Zaretskii <eliz@gnu.org>
21573 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21574 "cast to pointer from integer of different size".
21576 Improve doprnt and its use in verror. (Bug#8545)
21577 * doprnt.c (doprnt): Document the set of format control sequences
21578 supported by the function. Use SAFE_ALLOCA instead of always
21581 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21582 is one byte too soon. Don't use xrealloc; instead xfree and
21585 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21587 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21590 * gnutls.c: Renamed global_initialized to
21591 gnutls_global_initialized. Added internals for the
21592 :verify-hostname-error, :verify-error, and :verify-flags
21593 parameters of `gnutls-boot' and documented those parameters in the
21594 docstring. Start callback support.
21595 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21596 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21597 on error. Return error code.
21598 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21599 (emacs_gnutls_read): Likewise.
21600 (Fgnutls_boot): Return handshake error code.
21601 (emacs_gnutls_handle_error): New function.
21602 (wsaerror_to_errno): Likewise.
21604 * w32.h (emacs_gnutls_pull): Add prototype.
21605 (emacs_gnutls_push): Likewise.
21607 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21608 (emacs_gnutls_push): Likewise.
21610 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21612 * process.c (wait_reading_process_output): Check if GnuTLS
21613 buffered some data internally if no FDs are set for TLS
21616 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21617 (LIBS): Link to USER_LIBS.
21618 ($(BLD)/gnutls.$(0)): New target.
21620 2011-04-24 Eli Zaretskii <eliz@gnu.org>
21622 * xdisp.c (handle_single_display_spec): Rename the
21623 display_replaced_before_p argument into display_replaced_p, to
21624 make it consistent with the commentary. Fix typos in the
21627 * textprop.c (syms_of_textprop): Remove dead code.
21628 (copy_text_properties): Delete obsolete commentary about an
21629 interface that was deleted long ago. Fix typos in the description
21632 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21633 to changes in oldXMenu/XMenu.h from 2011-04-16.
21634 <menu_help_message, prev_menu_help_message>: Constify.
21635 (IT_menu_make_room): menu->help_text is now `const char **';
21638 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21639 to changes in oldXMenu/XMenu.h from 2011-04-16.
21640 (struct XMenu): Declare `help_text' `const char **'.
21642 * xfaces.c <Qunspecified>: Make extern again.
21644 * syntax.c: Include sys/types.h before including regex.h, as
21647 * doc.c (get_doc_string): Improve the format passed to `error'.
21649 * doprnt.c (doprnt): Improve commentary.
21651 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21653 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21656 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21657 changes in globals.h immediately force recompilation.
21658 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21659 $(CURDIR)/s/ms-w32.h.
21660 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
21662 * character.c (Fchar_direction): Function deleted.
21663 (syms_of_character): Don't defsubr it.
21664 <char-direction-table>: Deleted.
21666 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21668 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21669 * doprnt.c: Include limits.h.
21670 (SIZE_MAX): New macro.
21671 (doprnt): Return a size_t value. 2nd arg is now size_t.
21672 Many local variables are now size_t instead of int or unsigned.
21673 Improve overflow protection. Support `l' modifier for integer
21674 conversions. Support %l conversion. Don't assume an EMACS_INT
21675 argument for integer conversions and for %c.
21677 * lisp.h (doprnt): Restore prototype.
21679 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21680 $(SRC)/character.h.
21682 * Makefile.in (base_obj): Add back doprnt.o.
21684 * deps.mk (doprnt.o): Add back prerequisites.
21685 (callint.o): Depend on character.h.
21687 * eval.c (internal_lisp_condition_case): Include the handler
21688 representation in the error message.
21689 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21690 when breaking from the loop.
21692 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21694 * callint.c (Fcall_interactively): When displaying error message
21695 about invalid control letter, pass the character's codepoint, not
21696 a pointer to its multibyte form. Improve display of the character
21697 in octal and display also its hex code.
21699 * character.c (char_string): Use %x to display the (unsigned)
21700 codepoint of an invalid character, to avoid displaying a bogus
21703 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21704 `error', not SYMBOL_NAME itself.
21706 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21707 character arguments to `error'.
21709 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21710 to `error' in error message about FINAL_CHAR argument. Make sure
21711 FINAL_CHAR is a character, and use %c when it is passed as
21712 argument to `error'.
21714 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21716 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21718 * w32.c: Include <time.h>.
21719 (sys_localtime): New function.
21721 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
21723 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21725 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
21727 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
21729 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21730 zombies (Bug#8467).
21732 2011-04-19 Eli Zaretskii <eliz@gnu.org>
21734 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21735 gl_state.e_property when gl_state.object is Qt.
21737 * insdel.c (make_gap_larger): Remove limitation of buffer size
21740 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
21742 * xdisp.c (lookup_glyphless_char_display)
21743 (produce_glyphless_glyph): Handle cons cell entry in
21744 glyphless-char-display.
21745 (Vglyphless_char_display): Document it.
21747 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21748 glyphless-char-display.
21750 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
21752 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21754 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21756 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21757 definition for no-X builds.
21759 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
21761 Static checks with GCC 4.6.0 and non-default toolkits.
21763 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21765 * process.c (keyboard_bit_set): Define only if SIGIO.
21766 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21767 (send_process): Repair possible setjmp clobbering.
21769 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21771 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21773 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21775 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21776 Define only if needed.
21778 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21779 by pacifying GCC about it. Maybe it's time to retire it?
21780 * xfaces.c (USG, __TIMEVAL__): Likewise.
21782 * dispextern.h (struct redisplay_interface): Rename param
21783 to avoid shadowing.
21784 * termhooks.h (struct terminal): Likewise.
21785 * xterm.c (xembed_send_message): Likewise.
21787 * insdel.c (make_gap_smaller): Define only if
21788 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21790 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21793 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21794 so that we aren't warned about unused symbols.
21796 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21798 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
21800 * xfns.c (x_real_positions): Mark locals as initialized.
21802 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21804 * xterm.c: Fix problems found by static analysis with other toolkits.
21805 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
21806 (x_dispatch_event): Declare static if USE_GTK, and
21807 define if USE_GTK || USE_X_TOOLKIT.
21808 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
21809 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
21810 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21811 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
21813 * xmenu.c (menu_help_callback): Pointer type fixes.
21814 Use const pointers when pointing at readonly data. Avoid pointer
21815 signedness clashes.
21816 (FALSE): Remove unused macro.
21817 (update_frame_menubar): Remove unused decl.
21819 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21821 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21822 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21823 (single_menu_item): Rename local to avoid shadowing.
21825 * keyboard.c (make_lispy_event): Remove unused local var.
21827 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21828 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21830 * bitmaps: Change bitmaps from unsigned char back to the X11
21831 compatible char. Avoid the old compiler warnings about
21832 out-of-range initializers by using, for example, '\xab' rather
21835 * xgselect.c (xgselect_initialize): Check vs interface
21836 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21838 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21840 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21841 to read-only memory.
21843 * fns.c (vector): Remove; this old hack is no longer needed.
21845 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
21847 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
21849 * xrdb.c (x_load_resources): Omit unused local.
21851 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
21852 (x_window): Rename locals to avoid shadowing.
21853 (USG): Use the kludged USG macro, to pacify gcc.
21855 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
21856 (x_term_init): Remove local to avoid shadowing.
21858 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
21860 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21861 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21863 2011-04-16 Eli Zaretskii <eliz@gnu.org>
21865 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21867 Fix regex.c, syntax.c and friends for buffers > 2GB.
21868 * syntax.h (struct gl_state_s): Declare character position members
21871 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21873 * textprop.c (verify_interval_modification, interval_of):
21874 Declare arguments EMACS_INT.
21876 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21879 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21881 * indent.c (Fvertical_motion): Local variable it_start is now
21884 * regex.c (re_match, re_match_2, re_match_2_internal)
21885 (bcmp_translate, regcomp, regexec, print_double_string)
21886 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21887 (re_compile_pattern, re_exec): Declare arguments and local
21888 variables `size_t' and `ssize_t' and return values `regoff_t', as
21890 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21891 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21892 <compile_stack_type>: `size' and `avail' are now `size_t'.
21894 * regex.h <regoff_t>: Use ssize_t, not int.
21895 (re_search, re_search_2, re_match, re_match_2): Arguments that
21896 specify buffer/string position and length are now ssize_t and
21897 size_t. Return type is regoff_t.
21899 2011-04-16 Ben Key <bkey76@gmail.com>
21901 * nsfont.m: Fixed bugs in ns_get_family and
21902 ns_descriptor_to_entity that were caused by using free to
21903 deallocate memory blocks that were allocated by xmalloc (via
21904 xstrdup). This caused Emacs to crash when compiled with
21905 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21906 --enable-checking=xmallocoverrun). xfree is now used to
21907 deallocate these memory blocks.
21909 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
21911 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21913 emacs_write: Accept and return EMACS_INT for sizes.
21914 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21916 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21917 Accept and return EMACS_INT.
21918 (emacs_gnutls_write): Return the number of bytes written on
21920 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
21921 (emacs_read, emacs_write): Remove check for negative size, as the
21922 Emacs source code has been audited now.
21923 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21924 (emacs_read, emacs_write): Use it.
21925 * process.c (send_process): Adjust to the new signatures of
21926 emacs_write and emacs_gnutls_write. Do not attempt to store
21927 a byte offset into an 'int'; it might overflow.
21928 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
21930 * sound.c: Don't assume sizes fit in 'int'.
21931 (struct sound_device.period_size, alsa_period_size):
21932 Return EMACS_INT, not int.
21933 (struct sound_device.write, vox_write, alsa_write):
21934 Accept EMACS_INT, not int.
21935 (wav_play, au_play): Use EMACS_INT to store sizes and to
21936 record read return values.
21938 2011-04-15 Ben Key <bkey76@gmail.com>
21940 * keyboard.c (Qundefined): Don't declare static since it is used
21942 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21943 static since they are used in nsfont.m.
21945 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21947 * process.c (Qprocessp): Don't declare static.
21948 * lisp.h (Qprocessp): Declare again.
21950 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
21952 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21954 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21956 Improve C-level modularity by making more things 'static'.
21958 Don't publish debugger-only interfaces to other modules.
21959 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21960 (verify_bytepos, count_markers): Move decls to the only modules
21962 * region-cache.h (pp_cache): Likewise.
21963 * window.h (check_all_windows): Likewise.
21964 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21966 * sysdep.c (croak): Now static, if
21967 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21968 * syssignal.h (croak): Declare only if not static.
21970 * alloc.c (refill_memory_reserve): Now static if
21971 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21972 * lisp.h (refill_memory_reserve): Declare only if not static.
21974 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21975 Define only if USE_LUCID.
21977 * xrdb.c (x_customization_string, x_rm_string): Now static.
21979 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21980 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21982 * xdisp.c (draw_row_with_mouse_face): Now static.
21983 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21985 * window.h (check_all_windows): Mark externally visible.
21987 * window.c (window_deletion_count): Now static.
21989 * undo.c: Make symbols static if they're not exported.
21990 (last_undo_buffer, last_boundary_position, pending_boundary):
21993 * textprop.c (interval_insert_behind_hooks): Now static.
21994 (interval_insert_in_front_hooks): Likewise.
21996 * term.c: Make symbols static if they're not exported.
21997 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21998 (max_frame_lines, tty_set_terminal_modes):
21999 (tty_reset_terminal_modes, tty_turn_off_highlight):
22000 (get_tty_terminal): Now static.
22001 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22002 * termhooks.h (term_mouse_moveto): Do not declare if
22003 HAVE_WINDOW_SYSTEM.
22004 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22005 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22007 * sysdep.c: Make symbols static if they're not exported.
22008 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22010 (sigprocmask_set, full_mask): Remove; unused.
22011 (wait_debugging): Mark as visible.
22012 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22013 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22015 * syntax.c (syntax_temp): Define only if !__GNUC__.
22017 * sound.c (current_sound_device, current_sound): Now static.
22019 * search.c (searchbufs, searchbuf_head): Now static.
22021 * scroll.c (scroll_cost): Remove; unused.
22022 * dispextern.h (scroll_cost): Remove decl.
22024 * region-cache.h (pp_cache): Mark as externally visible.
22026 * process.c: Make symbols static if they're not exported.
22027 (process_tick, update_tick, create_process, chan_process):
22028 (Vprocess_alist, proc_buffered_char, datagram_access):
22029 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22030 (deactivate_process): Mark defn as static, as well as decl.
22031 * lisp.h (create_process): Remove decl.
22032 * process.h (chan_process, Vprocess_alist): Remove decls.
22034 * print.c: Make symbols static if they're not exported.
22035 (print_depth, new_backquote_output, being_printed, print_buffer):
22036 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22037 (print_interval, print_number_index, initial_stderr_stream):
22039 * lisp.h (Fprinc): Remove decl.
22040 (debug_output_compilation_hack): Mark as externally visible.
22042 * sysdep.c (croak): Move decl from here to syssignal.h.
22043 * syssignal.h (croak): Put it here, so the API can be checked when
22044 'croak' is called from dissociate_if_controlling_tty.
22046 * minibuf.c: Make symbols static if they're not exported.
22047 (minibuf_save_list, choose_minibuf_frame): Now static.
22048 * lisp.h (choose_minibuf_frame): Remove decl.
22050 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22052 * lread.c: Make symbols static if they're not exported.
22053 (read_objects, initial_obarray, oblookup_last_bucket_number):
22055 (make_symbol): Remove; unused.
22056 * lisp.h (initial_obarray, make_symbol): Remove decls.
22058 * keyboard.c: Make symbols static if they're not exported.
22059 (single_kboard, recent_keys_index, total_keys, recent_keys):
22060 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22061 (this_single_command_key_start, echoing, last_auto_save):
22062 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22063 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22064 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22065 (Vlispy_mouse_stem, double_click_count):
22067 (force_auto_save_soon): Define only if SIGDANGER.
22068 (ignore_mouse_drag_p): Now static if
22069 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22070 (print_help): Remove; unused.
22071 (stop_character, last_timer_event): Mark as externally visible.
22072 * keyboard.h (ignore_mouse_drag_p): Declare only if
22073 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22074 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22075 * lisp.h (echoing): Remove decl.
22076 (force_auto_save_soon): Declare only if SIGDANGER.
22077 * xdisp.c (redisplay_window): Simplify code, to make it more
22078 obvious that ignore_mouse_drag_p is not accessed if !defined
22079 USE_GTK && !defined HAVE_NS.
22081 * intervals.c: Make symbols static if they're not exported.
22082 (merge_properties_sticky, merge_interval_right, delete_interval):
22084 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22086 * insdel.c: Make symbols static if they're not exported.
22087 However, leave prepare_to_modify_buffer alone. It's never
22088 called from outside this function, but that appears to be a bug.
22089 (combine_after_change_list, combine_after_change_buffer):
22090 (adjust_after_replace, signal_before_change): Now static.
22091 (adjust_after_replace_noundo): Remove; unused.
22092 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22093 (signal_before_change): Remove decls.
22095 * indent.c (val_compute_motion, val_vmotion): Now static.
22097 * image.c: Make symbols static if they're not exported.
22098 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22100 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22101 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22103 * fringe.c (standard_bitmaps): Now static.
22104 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22106 * frame.c: Make symbols static if they're not exported.
22107 (x_report_frame_params, make_terminal_frame): Now static.
22108 (get_frame_param): Now static, unless HAVE_NS.
22109 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22110 (x_get_resource_string): Remove; not used.
22111 * frame.h (make_terminal_frame, x_report_frame_params):
22112 (x_get_resource_string); Remove decls.
22113 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22114 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22116 * font.c, fontset.c: Make symbols static if they're not exported.
22117 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22118 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22119 * font.c (font_close_object): Now static.
22120 * font.h (font_close_object): Remove.
22121 * fontset.c (FONTSET_OBJLIST): Remove.
22122 (free_realized_fontset) #if-0 the body, which does nothing.
22123 (face_suitable_for_char_p): #if-0, as it's never called.
22124 * fontset.h (face_suitable_for_char_p): Remove decl.
22125 * xfaces.c (face_at_string_position):
22126 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22127 since 0 is always ASCII.
22129 * fns.c (weak_hash_tables): Now static.
22131 * fileio.c: Make symbols static if they're not exported.
22132 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22133 (Vwrite_region_annotation_buffers): Now static.
22135 * eval.c: Make symbols static if they're not exported.
22136 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22137 * lisp.h (backtrace_list): Remove decl.
22139 * emacs.c: Make symbols static if they're not exported.
22140 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22141 (fatal_error_code, fatal_error_signal_hook, standard_args):
22143 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22144 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22145 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22146 * lisp.h (fatal_error_signal_hook): Remove decl.
22147 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22149 * editfns.c: Move a (normally-unused) function to its only use.
22150 * editfns.c, lisp.h (get_operating_system_release): Remove.
22151 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22152 worth the hassle of breaking this out.
22154 * xterm.c: Make symbols static if they're not exported.
22155 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22156 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22157 (x_destroy_window, x_delete_display):
22159 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22160 (x_mouse_leave): Remove; unused.
22161 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22162 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22163 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22165 (x_mouse_leave): Declare only if WINDOWSNT.
22166 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22167 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22170 * ftxfont.c: Make symbols static if they're not exported.
22171 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22173 * font.h (ftxfont_driver): Likewise.
22175 * xfns.c: Make symbols static if they're not exported.
22176 (x_last_font_name, x_display_info_for_name):
22177 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22178 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22179 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22180 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22181 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22182 (last_show_tip_args): Now static.
22183 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22184 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22185 (x_screen_planes): Remove; unused.
22186 * dispextern.h (x_screen_planes): Remove decl.
22188 * dispnew.c: Make symbols static if they're not exported.
22189 * dispextern.h (redraw_garbaged_frames, scrolling):
22190 (increment_row_positions): Remove.
22191 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22192 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22194 (redraw_garbaged_frames): Remove; unused.
22196 * xfaces.c: Make symbols static if they're not exported.
22197 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22199 * xterm.h (defined_color): Remove decls.
22200 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22201 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22202 (menu_face_changed_default, defined_color, free_realized_face):
22203 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22204 (ascii_face_of_lisp_face): Remove; unused.
22206 * xdisp.c: Make symbols static if they're not exported.
22207 * dispextern.h (scratch_glyph_row, window_box_edges):
22208 (glyph_to_pixel_coords, set_cursor_from_row):
22209 (get_next_display_element, set_iterator_to_next):
22210 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22211 (show_mouse_face): Remove decls
22212 * frame.h (message_buf_print): Likewise.
22213 * lisp.h (pop_message, set_message, check_point_in_composition):
22215 * xterm.h (set_vertical_scroll_bar): Likewise.
22216 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22217 (message_buf_print, scratch_glyph_row, displayed_buffer):
22218 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22219 (get_next_display_element, show_mouse_face, window_box_edges):
22220 (frame_to_window_pixel_xy, check_point_in_composition):
22221 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22222 (glyph_to_pixel_coords): Remove; unused.
22224 * dired.c (file_name_completion): Now static.
22226 * dbusbind.c (xd_in_read_queued_messages): Now static.
22228 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22229 * data.c (circular_list_error): Remove.
22231 * commands.h (last_point_position, last_point_position_buffer):
22232 (last_point_position_window): Remove decls.
22233 * keyboard.c: Make these variables static.
22235 * coding.h (coding, code_convert_region, encode_coding_gap):
22237 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22238 (iso_code_class, detect_coding, code_convert_region): Now static.
22239 (encode_coding_gap): Remove; unused.
22241 * chartab.c (chartab_chars, chartab_bits): Now static.
22243 * charset.h (charset_iso_8859_1): Remove decl.
22244 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22247 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22248 * ccl.c (Vccl_program_table): Now static.
22249 (check_ccl_update): Remove; unused.
22251 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22252 * category.h: ... from here.
22253 * category.c (check_category_table, set_category_set): Now static.
22255 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22256 * lisp.h: Remove these decls.
22258 * buffer.c (buffer_count): Remove unused var.
22260 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22261 so that it's not optimized away.
22262 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22263 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22264 exported only to the debugger.
22266 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22267 * atimer.h (run_all_atimers): Remove; not exported.
22269 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22270 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22271 was inaccessible from Lisp.
22272 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22273 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22275 alloc.c: Import and export fewer symbols, and remove unused items.
22276 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22278 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22279 it's not optimized away by whole-program optimization.
22280 (message_enable_multibyte, free_misc): Remove.
22281 (catchlist, handlerlist, mark_backtrace):
22282 Declare only if BYTE_MARK_STACK.
22283 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22284 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22285 (message_enable_multibyte): Remove decl.
22286 (free_misc, interval_free_list, float_block, float_block_index):
22287 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22288 (cons_free_list, last_marked_index):
22290 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22291 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22292 (mark_backtrace): Define only if BYTE_MARK_STACK.
22293 * xdisp.c (message_enable_multibyte): Now static.
22295 Declare Lisp_Object Q* variables to be 'static' if not exported.
22296 This makes it easier for human readers (and static analyzers)
22297 to see whether these variables are used from other modules.
22298 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22299 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22300 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22301 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22302 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22303 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22304 * xmenu.c, xselect.c:
22305 Declare Q* vars static if they are not used in other modules.
22306 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22307 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22308 Remove decls of unexported vars.
22309 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22311 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22313 Make Emacs functions such as Fatom 'static' by default.
22314 This makes it easier for human readers (and static analyzers)
22315 to see whether these functions can be called from other modules.
22316 DEFUN now defines a static function. To make the function external
22317 so that it can be used in other C modules, use the new macro DEFUE.
22318 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22319 (Finit_image_library):
22320 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22321 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22322 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22323 Remove decls, since these functions are now static.
22324 (Funintern, Fget_internal_run_time): New decls, since these functions
22325 were already external.
22327 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22328 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22329 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22330 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22331 * keyboard.c, keymap.c, lread.c:
22332 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22333 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22334 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22335 Mark functions with DEFUE instead of DEFUN,
22336 if they are used in other modules.
22337 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22338 decls for now-static functions.
22339 * buffer.h (Fdelete_overlay): Remove decl.
22340 * callproc.c (Fgetenv_internal): Mark as internal.
22341 * composite.c (Fremove_list_of_text_properties): Remove decl.
22342 (Fcomposition_get_gstring): New forward static decl.
22343 * composite.h (Fcomposite_get_gstring): Remove decl.
22344 * dired.c (Ffile_attributes): New forward static decl.
22345 * doc.c (Fdocumntation_property): New forward static decl.
22346 * eval.c (Ffetch_bytecode): New forward static decl.
22347 (Funintern): Remove extern decl; now in .h file where it belongs.
22348 * fileio.c (Fmake_symbolic_link): New forward static decl.
22349 * image.c (Finit_image_library): New forward static decl.
22350 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22351 * intervals.h (Fprevious_property_change):
22352 (Fremove_list_of_text_properties): Remove decls.
22353 * keyboard.c (Fthis_command_keys): Remove decl.
22354 (Fcommand_execute): New forward static decl.
22355 * keymap.c (Flookup_key): New forward static decl.
22356 (Fcopy_keymap): Now static.
22357 * keymap.h (Flookup_key): Remove decl.
22358 * process.c (Fget_process): New forward static decl.
22359 (Fprocess_datagram_address): Mark as internal.
22360 * syntax.c (Fsyntax_table_p): New forward static decl.
22361 (skip_chars): Remove duplicate decl.
22362 * textprop.c (Fprevious_property_change): New forward static decl.
22363 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22365 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22366 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22368 * editfns.c (Fformat): Remove unreachable code.
22370 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22372 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22375 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22377 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22378 when at ZV. (Bug#8487)
22380 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22382 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22384 * keyboard.c (parse_tool_bar_item): Likewise.
22385 * sound.c (sound_cleanup, alsa_close): Likewise.
22386 * termcap.c (tgetent): Likewise.
22387 * xfns.c (x_default_font_parameter): Likewise.
22388 * xsettings.c (read_and_apply_settings): Likewise.
22390 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22391 (overrun_check_free): Protoize.
22393 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22395 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22396 since callers should never pass a negative size.
22397 Change the signature to match that of plain 'read' and 'write'; see
22398 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22399 * lisp.h: Update prototypes of emacs_write and emacs_read.
22401 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22403 * xdisp.c (redisplay_window): Don't try to determine the character
22404 position of the scroll margin if the window start point w->startp
22405 is outside the buffer's accessible region. (Bug#8468)
22407 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22409 Fix write-region and its subroutines for buffers > 2GB.
22410 * fileio.c (a_write, e_write): Modify declaration of arguments and
22411 local variables to support buffers larger than 2GB.
22412 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22414 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22415 argument, local variables, and return value.
22417 * lisp.h: Update prototypes of emacs_write and emacs_read.
22419 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22421 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22423 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22425 Fix more problems found by GCC 4.6.0's static checks.
22427 * xdisp.c (vmessage): Use a better test for character truncation.
22429 * charset.c (load_charset_map): <, not <=, for optimization,
22430 and to avoid potential problems with integer overflow.
22431 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22432 * casetab.c (set_identity, shuffle): Likewise.
22433 * editfns.c (Fformat): Likewise.
22434 * syntax.c (skip_chars): Likewise.
22436 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22437 This also lets GCC 4.6.0 generate slightly better loop code.
22439 * callint.c (Fcall_interactively): <, not <=, for optimization.
22440 (Fcall_interactively): Count the number of arguments produced,
22441 not the number of arguments given. This is simpler and lets GCC
22442 4.6.0 generate slightly better code.
22444 * ftfont.c: Distingish more carefully between FcChar8 and char.
22445 The previous code passed unsigned char * to a functions like
22446 strlen and xstrcasecmp that expect char *, which does not
22447 conform to the C standard.
22448 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22449 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22450 char * when the C standard requires it.
22452 * keyboard.c (read_char): Remove unused var.
22454 * eval.c: Port to Windows vsnprintf (Bug#8435).
22455 Include <limits.h>.
22456 (SIZE_MAX): Define if the headers do not.
22457 (verror): Do not give up if vsnprintf returns a negative count.
22458 Instead, grow the buffer. This ports to Windows vsnprintf, which
22459 does not conform to C99. Problem reported by Eli Zaretskii.
22460 Also, simplify the allocation scheme, by avoiding the need for
22461 calling realloc, and removing the ALLOCATED variable.
22463 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22465 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22466 But keep the doprint source code for now, as we might revamp it
22467 and use it again (Bug#8435).
22468 * lisp.h (doprnt): Remove.
22469 * Makefile.in (base_obj): Remove doprnt.o.
22470 * deps.mk (doprnt.o): Remove.
22472 error: Print 32- and 64-bit integers portably (Bug#8435).
22473 Without this change, on typical 64-bit hosts error ("...%d...", N)
22474 was used to print both 32- and 64-bit integers N, which relied on
22475 undefined behavior.
22476 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22477 * lisp.h (error, verror): Mark as printf-like functions.
22478 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22479 Report overflow in size calculations when allocating printf buffer.
22480 Do not truncate output string at its first null byte.
22481 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22482 Truncate the output at a character boundary, since vsnprintf does not
22484 * charset.c (check_iso_charset_parameter): Convert internal
22485 character to string before calling 'error', since %c now has the
22487 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22488 overflow when computing char to be passed to 'error'. Do not
22489 pass Lisp_Object to 'error'; pass the integer instead.
22490 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22491 formatted with plain %d.
22493 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22495 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22497 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22499 * xterm.c (x_catch_errors): Remove duplicate declaration.
22501 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22503 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22505 2011-04-10 Jim Meyering <meyering@redhat.com>
22507 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22508 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22509 return ssize_t not "int", and use size_t as the buffer length.
22510 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22511 * gnutls.h: Update declarations.
22512 * process.c (read_process_output): Use ssize_t, to match.
22513 (send_process): Likewise.
22515 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22517 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22519 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22521 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22522 Use unsigned char, to match FcChar8 type definition.
22524 * xterm.c (handle_one_xevent):
22525 * xmenu.c (create_and_show_popup_menu):
22526 * xselect.c (x_decline_selection_request)
22527 (x_reply_selection_request): Avoid type-punned deref of X events.
22529 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22531 Fix some uses of `int' instead of EMACS_INT.
22532 * search.c (string_match_1, fast_string_match)
22533 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22534 (scan_buffer, find_next_newline_no_quit)
22535 (find_before_next_newline, search_command, Freplace_match)
22536 (Fmatch_data): Make some `int' variables be EMACS_INT.
22538 * xdisp.c (display_count_lines): 3rd argument and return value now
22539 EMACS_INT. All callers changed.
22540 (pint2hrstr): Last argument is now EMACS_INT.
22542 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22543 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22544 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22545 (decode_coding_utf_16, decode_coding_emacs_mule)
22546 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22547 (decode_coding_ccl, decode_coding_charset)
22548 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22549 (decode_coding_iso_2022, decode_coding_emacs_mule)
22550 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22551 <char_offset, last_offset>: Declare EMACS_INT.
22552 (encode_coding_utf_8, encode_coding_utf_16)
22553 (encode_coding_emacs_mule, encode_invocation_designation)
22554 (encode_designation_at_bol, encode_coding_iso_2022)
22555 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22556 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22558 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22559 (encode_invocation_designation): Last argument P_NCHARS is now
22561 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22562 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22564 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22567 * ccl.c (Fccl_execute_on_string): Declare some variables
22570 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
22572 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22574 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22576 * process.c (Fformat_network_address): Doc fix.
22578 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22580 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
22582 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
22584 * keyboard.c (read_char): Call Lisp function help-form-show,
22585 instead of using internal_with_output_to_temp_buffer.
22586 (Qhelp_form_show): New var.
22587 (syms_of_keyboard): Use DEFSYM macro.
22589 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22591 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22593 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
22595 * process.c (Flist_processes): Remove to Lisp.
22596 (list_processes_1): Delete.
22598 2011-04-06 Eli Zaretskii <eliz@gnu.org>
22600 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22602 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22604 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
22606 Fix more problems found by GCC 4.6.0's static checks.
22608 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22610 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22612 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
22614 * xdisp.c (vmessage): Mark as a printf-like function.
22616 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22618 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22620 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22621 printf-like functions.
22622 (tiff_load): Add casts to remove these marks before passing them
22623 to system-supplied API.
22625 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22627 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22628 This avoids several warnings with gcc -Wstrict-overflow.
22629 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22630 directly, rather than having caller test rule sign. This avoids
22631 some unnecessary tests.
22632 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22633 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22634 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
22636 * xfont.c (xfont_text_extents): Remove var that was set but not used.
22637 (xfont_open): Avoid unnecessary tests.
22639 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22641 * composite.h, composite.c (composition_gstring_put_cache):
22642 Use EMACS_INT, not int, for length.
22644 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22645 breaking out part of COMPOSITION_DECODE_RULE.
22646 (COMPOSITION_DECODE_RULE): Use it.
22647 * composite.c (get_composition_id): Remove unused local vars,
22648 by using the new macro.
22650 * textprop.c (set_text_properties_1): Change while to do-while,
22651 since the condition is always true at first.
22653 * intervals.c (graft_intervals_into_buffer): Mark var as used.
22654 (interval_deletion_adjustment): Return unsigned value.
22657 * process.c (list_processes_1, create_pty, read_process_output):
22658 (exec_sentinel): Remove vars that were set but not used.
22659 (create_pty): Remove unnecessary "volatile"s.
22660 (Fnetwork_interface_info): Avoid possibility of int overflow.
22661 (read_process_output): Do adaptive read buffering even if carryover.
22662 (read_process_output): Simplify nbytes computation if buffered.
22664 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22666 * syntax.c (scan_words): Remove var that was set but not used.
22667 (update_syntax_table): Use unsigned instead of int.
22669 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
22670 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
22671 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
22673 * print.c (print_error_message): Avoid int overflow.
22675 * font.c (font_list_entities): Redo for clarity,
22676 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22678 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
22679 (font_score): Avoid potential overflow in diff calculation.
22681 * fns.c (substring_both): Remove var that is set but not used.
22682 (sxhash): Redo loop for clarity and to avoid wraparound warning.
22684 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22686 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22687 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22688 can always succeed if overflow has undefined behavior.
22690 * search.c (boyer_moore, wordify): Remove vars set but not used.
22691 (wordify): Omit three unnecessary tests.
22693 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22694 All callers changed. This avoids the need for an unused var.
22696 * casefiddle.c (casify_region): Remove var that is set but not used.
22698 * dired.c (file_name_completion): Remove var that is set but not used.
22700 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22702 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
22703 (Finsert_file_contents): Remove unnecessary code checking fd.
22705 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22706 Check for integer overflow on size calculations.
22708 * buffer.c (Fprevious_overlay_change): Remove var that is set
22711 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22712 Remove vars that are set but not used.
22713 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
22714 (timer_check_2): Mark vars as initialized.
22716 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22718 * image.c (lookup_image): Remove var that is set but not used.
22719 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
22721 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22722 that are set but not used.
22724 * xfns.c (make_invisible_cursor): Don't return garbage
22725 if XCreateBitmapFromData fails (Bug#8410).
22727 * xselect.c (x_get_local_selection, x_handle_property_notify):
22728 Remove vars that are set but not used.
22730 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
22731 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
22733 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22734 Remove var that is set but not used.
22735 (scroll_bar_windows_size): Now size_t, not int.
22736 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22737 Check for overflow.
22739 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22740 (map_tty_color) [!defined MSDOS]: Likewise.
22742 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22744 * coding.c: Remove vars that are set but not used.
22745 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22746 All callers changed.
22747 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22748 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22749 (decode_coding_charset): Remove vars that are set but not used.
22751 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22752 that is set but not used.
22754 * print.c (print_object): Remove var that is set but not used.
22756 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
22757 The gnulib version avoids calling malloc in the usual case,
22758 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22759 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22760 * filelock.c (current_lock_owner): Likewise.
22761 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22762 * sysdep.c: Include allocator.h, careadlinkat.h.
22763 (emacs_no_realloc_allocator): New static constant.
22764 (emacs_readlink): New function.
22765 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22766 ../lib/careadlinkat.h.
22768 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22770 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22771 first non-nil return value).
22773 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22775 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22776 if not defined (Bug#8403).
22778 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22780 * xdisp.c (display_count_lines): Remove parameter `start',
22781 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22782 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22783 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22784 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22785 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22786 and thereabouts. All callers changed.
22787 (get_per_char_metric): Remove parameter `f', unused since
22788 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22790 2011-04-02 Jim Meyering <meyering@redhat.com>
22792 do not dereference NULL upon failed strdup
22793 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22794 (ns_get_family): Likewise.
22796 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22798 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22800 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22802 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22805 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22807 Add lexical binding.
22809 * window.c (Ftemp_output_buffer_show): New fun.
22810 (Fsave_window_excursion):
22811 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22813 * lread.c (lisp_file_lexically_bound_p): New function.
22814 (Fload): Bind Qlexical_binding.
22815 (readevalloop): Remove `evalfun' arg.
22816 Bind Qinternal_interpreter_environment.
22817 (Feval_buffer): Bind Qlexical_binding.
22818 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22820 (syms_of_lread): Declare `lexical-binding'.
22822 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22824 * keyboard.c (eval_dyn): New fun.
22825 (menu_item_eval_property): Use it.
22827 * image.c (parse_image_spec): Use Ffunctionp.
22829 * fns.c (concat, mapcar1): Accept byte-code-functions.
22831 * eval.c (Fsetq): Handle lexical vars.
22832 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22833 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22834 (FletX, Flet): Obey lexical binding.
22835 (Fcommandp): Handle closures.
22836 (Feval): New `lexical' arg.
22837 (eval_sub): New function extracted from Feval. Use it almost
22838 everywhere where Feval was used. Look up vars in lexical env.
22840 (Ffunctionp): Move from subr.el.
22841 (Ffuncall): Handle closures.
22842 (apply_lambda): Remove `eval_flags'.
22843 (funcall_lambda): Handle closures and new byte-code-functions.
22844 (Fspecial_variable_p): New function.
22845 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22846 but without exporting it to Lisp.
22848 * doc.c (Fdocumentation, store_function_docstring):
22849 * data.c (Finteractive_form): Handle closures.
22851 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22854 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22856 (exec_byte_code): New function extracted from Fbyte_code to handle new
22857 calling convention for byte-code-functions. Add new byte-codes.
22859 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
22861 * alloc.c (Fmake_symbol): Init new `declared_special' field.
22863 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22865 * xdisp.c (redisplay_internal): Fix prototype.
22867 2011-03-31 Eli Zaretskii <eliz@gnu.org>
22869 * xdisp.c (SCROLL_LIMIT): New macro.
22870 (try_scrolling): Use it when setting scroll_limit.
22871 Limit scrolling to 100 screen lines.
22872 (redisplay_window): Even when falling back on "recentering",
22873 position point in the window according to scroll-conservatively,
22874 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22876 (try_scrolling): When point is above the window, allow searching
22877 as far as scroll_max, or one screenful, to compute vertical
22878 distance from PT to the scroll margin position. This prevents
22879 try_scrolling from unnecessarily failing when
22880 scroll-conservatively is set to a value slightly larger than the
22881 window height. Clean up the case of PT below the margin at bottom
22882 of window: scroll_max can no longer be INT_MAX. When aggressive
22883 scrolling is in use, don't let point enter the opposite scroll
22884 margin as result of the scroll.
22885 (syms_of_xdisp) <scroll-conservatively>: Document the
22886 threshold of 100 lines for never-recentering scrolling.
22888 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22890 * dispextern.h (move_it_by_lines):
22891 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22892 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22893 (message_log_check_duplicate): Remove parameters `prev_bol' and
22894 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22895 (redisplay_internal): Remove parameter `preserve_echo_area',
22896 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22898 * indent.c (Fvertical_motion):
22899 * window.c (window_scroll_pixel_based, Frecenter):
22900 Don't pass `need_y_p' to `move_it_by_lines'.
22902 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22904 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22905 steal a few bits to be more compact.
22906 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22907 Remove unneeded casts.
22909 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22911 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22913 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22914 binding" message (bug#7967).
22916 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22918 Fix more problems found by GCC 4.6.0's static checks.
22920 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22921 Remove unused local var.
22923 * editfns.c (Fmessage_box): Remove unused local var.
22925 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22926 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22927 Omit unused local vars.
22928 * window.c (shrink_windows): Omit unused local var.
22929 * menu.c (digest_single_submenu): Omit unused local var.
22930 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22931 Omit unused local var.
22933 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22934 Don't assume string length fits in int.
22935 (keyremap_step, read_key_sequence): Use size_t for sizes.
22936 (read_key_sequence): Don't check last_real_key_start redundantly.
22938 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22939 instead of alloca (Bug#8344).
22941 * eval.c (Fbacktrace): Don't assume nargs fits in int.
22942 (Fbacktrace_frame): Don't assume nframes fits in int.
22944 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22946 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22949 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22951 * cm.c (calccost): Turn while-do into do-while, for clarity.
22953 * keyboard.c (syms_of_keyboard): Use the same style as later
22954 in this function when indexing through an array. This also
22955 works around GCC bug 48267.
22957 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22959 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22961 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22962 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22964 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22965 This avoids undefined behavior on integer overflow, and is a bit
22966 more convenient anyway since it is compared to a size_t variable.
22968 Variadic C functions now count arguments with size_t, not int.
22969 This avoids an unnecessary limitation on 64-bit machines, which
22970 caused (substring ...) to crash on large vectors (Bug#8344).
22971 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22972 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
22973 All variadic functions and their callers changed accordingly.
22974 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22975 * data.c (arith_driver, float_arith_driver): Likewise.
22976 * editfns.c (general_insert_function): Likewise.
22977 * eval.c (struct backtrace.nargs, interactive_p)
22978 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22979 (funcall_lambda, mark_backtrace): Likewise.
22980 * fns.c (concat): Likewise.
22981 * frame.c (x_set_frame_parameters): Likewise.
22982 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22983 0 if not found, not -1. All callers changed.
22985 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22986 (stack_copy_size): Now size_t, not int.
22987 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22989 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
22991 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22992 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22993 All callers changed.
22995 * lisp.h (multibyte_char_to_unibyte):
22996 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22997 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22998 * character.h (CHAR_TO_BYTE8):
22999 * cmds.c (internal_self_insert):
23000 * editfns.c (general_insert_function):
23001 * keymap.c (push_key_description):
23002 * search.c (Freplace_match):
23003 * xdisp.c (message_dolog, set_message_1): All callers changed.
23005 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23007 * keyboard.c (safe_run_hook_funcall): New function.
23008 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23009 don't set the hook to nil, but remove the offending function instead.
23010 (Qcommand_hook_internal): Remove, unused.
23011 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23012 Vcommand_hook_internal.
23014 * eval.c (enum run_hooks_condition): Remove.
23015 (funcall_nil, funcall_not): New functions.
23016 (run_hook_with_args): Call each function through a `funcall' argument.
23017 Remove `cond' argument, now redundant.
23018 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23019 (Frun_hook_with_args_until_failure): Adjust accordingly.
23020 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23022 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23024 * dispextern.h (string_buffer_position): Remove declaration.
23026 * print.c (strout): Remove parameter `multibyte', unused since
23027 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23029 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23030 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23031 All callers changed.
23033 * w32.c (_wsa_errlist): Use braces for struct initializers.
23035 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23036 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23037 All callers changed.
23038 (string_buffer_position): Likewise. Also, make static (it's never
23039 used outside xdisp.c).
23040 (cursor_row_p): Remove parameter `w', unused since
23041 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23042 (decode_mode_spec): Remove parameter `precision', introduced during
23043 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23044 All callers changed.
23046 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23048 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23050 2011-03-27 Anders Lindgren <andlind@gmail.com>
23052 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23053 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23054 (ns_update_auto_hide_menu_bar): New functions.
23055 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23056 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23057 ns_constrain_all_frames.
23058 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23059 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23061 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23063 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23065 2011-03-27 Glenn Morris <rgm@gnu.org>
23067 * syssignal.h: Replace RETSIGTYPE with void.
23068 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23069 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23070 Replace SIGTYPE with void everywhere.
23071 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23072 * s/template.h (SIGTYPE): Remove commented out definition.
23074 2011-03-26 Eli Zaretskii <eliz@gnu.org>
23076 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23077 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23079 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
23081 * w32.c (read_unc_volume): Use parameter `henum', instead of
23082 global variable `wget_enum_handle'.
23084 * keymap.c (describe_vector): Remove parameters `indices' and
23085 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23086 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23088 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23090 * keyboard.c (timer_check): Remove parameter `do_it_now',
23091 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23092 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23093 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23095 * keyboard.c (read_char):
23096 * w32menu.c (w32_menu_display_help):
23097 * xmenu.c (show_help_event, menu_help_callback):
23098 Adjust calls to `show_help_echo'.
23100 * gtkutil.c (xg_maybe_add_timer):
23101 * keyboard.c (readable_events):
23102 * process.c (wait_reading_process_output):
23103 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23105 * insdel.c (adjust_markers_gap_motion):
23106 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23107 (gap_left, gap_right): Don't call it.
23109 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
23111 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23112 incurred during fontification.
23114 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23116 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23117 (DEFVAR_PER_BUFFER): Don't pass it.
23119 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23120 (scrolling_window): Don't pass it.
23122 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23124 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23126 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23128 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23129 of variables specific to SELinux and computation of `encoded_absname'.
23131 * image.c (XPutPixel): Remove unused variable `height'.
23133 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23135 * unexw32.c (get_section_info): Remove unused variable `section'.
23137 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23138 (system_process_attributes): Remove unused variable `sess'.
23139 (sys_read): Remove unused variable `err'.
23141 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23142 (w32_wnd_proc): Remove unused variable `isdead'.
23143 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23144 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23145 (x_create_tip_frame): Remove unused variable `tem'.
23147 * w32inevt.c (w32_console_read_socket):
23148 Remove unused variable `no_events'.
23150 * w32term.c (x_draw_composite_glyph_string_foreground):
23151 Remove unused variable `width'.
23153 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
23155 * w32term.c (x_set_glyph_string_clipping):
23156 Don't pass uninitialized region to CombineRgn.
23158 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
23160 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23161 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23162 (Fx_close_connection): Remove unused variable `i'.
23164 * w32font.c (w32font_draw): Return number of glyphs.
23165 (w32font_open_internal): Remove unused variable `i'.
23166 (w32font_driver): Add missing initializer.
23168 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23169 (fill_in_menu): Remove unused variable `items_added'.
23171 * w32term.c (last_mouse_press_frame): Remove static global variable.
23172 (w32_clip_to_row): Remove unused variable `f'.
23173 (x_delete_terminal): Remove unused variable `i'.
23175 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23176 (NOTHING): Remove unused static global variable.
23177 (uniscribe_check_otf): Remove unused variable `table'.
23178 (uniscribe_font_driver): Add missing initializers.
23180 2011-03-23 Julien Danjou <julien@danjou.info>
23182 * term.c (Fsuspend_tty, Fresume_tty):
23183 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23184 * window.c (temp_output_buffer_show):
23185 * insdel.c (signal_before_change):
23186 * frame.c (Fhandle_switch_frame):
23187 * fileio.c (Fdo_auto_save):
23188 * emacs.c (Fkill_emacs):
23189 * editfns.c (save_excursion_restore):
23190 * cmds.c (internal_self_insert):
23191 * callint.c (Fcall_interactively):
23192 * buffer.c (Fkill_all_local_variables):
23193 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23195 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23196 unconditionally since it does the check itself.
23198 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23200 Fix more problems found by GCC 4.5.2's static checks.
23202 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23203 the first time through the loop, since we know p0 < p1 then.
23204 This also avoids a gcc -Wstrict-overflow warning.
23206 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23207 leading to a memory leak, possible in functions like
23208 load_charset_map_from_file that can allocate an unbounded number
23209 of objects (Bug#8318).
23211 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23212 that could (at least in theory) be that large.
23214 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23215 This is less likely to overflow, and avoids undefined behavior if
23216 overflow does occur. All callers changed. Use strtoul to scan
23217 for the unsigned long integer.
23218 (pint2hrstr): Simplify and tune code slightly.
23219 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23221 * scroll.c (do_scrolling): Work around GCC bug 48228.
23222 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23224 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23225 This also avoids a warning with gcc -Wstrict-overflow.
23226 (validate_x_resource_name): Simplify count usage.
23227 This also avoids a warning with gcc -Wstrict-overflow.
23229 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23232 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23234 * process.c (Fmake_network_process): Use socklen_t, not int,
23235 where POSIX says socklen_t is required in portable programs.
23236 This fixes a porting bug on hosts like 64-bit HP-UX, where
23237 socklen_t is wider than int (Bug#8277).
23238 (Fmake_network_process, server_accept_connection):
23239 (wait_reading_process_output, read_process_output):
23242 * process.c: Rename or move locals to avoid shadowing.
23243 (list_processes_1, Fmake_network_process):
23244 (read_process_output_error_handler, exec_sentinel_error_handler):
23245 Rename or move locals.
23246 (Fmake_network_process): Define label "retry_connect" only if needed.
23247 (Fnetwork_interface_info): Fix pointer signedness.
23248 (process_send_signal): Add cast to avoid pointer signedness problem.
23249 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23250 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23252 Make tparam.h and terminfo.c consistent.
23253 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23254 Include tparam.h instead, since it declares them.
23255 * cm.h (PC): Remove extern decl; tparam.h now does this.
23256 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23257 * terminfo.c: Include tparam.h, to check interfaces.
23258 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23259 (tparam): Adjust signature to match interface in tparam.h;
23260 this removes some undefined behavior. Check that outstring and len
23261 are zero, which they always are with Emacs.
23262 * tparam.h (PC, BC, UP): New extern decls.
23264 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23265 (xftfont_open): Rename locals to avoid shadowing.
23267 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23268 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23269 (OTF_TAG_SYM): Omit macro if not needed.
23270 (ftfont_list): Remove unused local.
23271 (get_adstyle_property, ftfont_pattern_entity):
23272 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23273 Rename locals to avoid shadowing.
23275 * xfont.c (xfont_list_family): Mark var as initialized.
23277 * xml.c (make_dom): Now static.
23279 * composite.c (composition_compute_stop_pos): Rename local to
23281 (composition_reseat_it): Remove unused locals.
23282 (find_automatic_composition, composition_adjust_point): Likewise.
23283 (composition_update_it): Mark var as initialized.
23284 (find_automatic_composition): Mark vars as initialized,
23285 with a FIXME (Bug#8290).
23287 character.h: Rename locals to avoid shadowing.
23288 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23289 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23290 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23291 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23292 to avoid shadowing.
23294 * textprop.c (property_change_between_p): Remove; unused.
23296 * intervals.c (interval_start_pos): Now static.
23298 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23300 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23301 Rename locals to avoid shadowing.
23303 * sound.c (wav_play, au_play, Fplay_sound_internal):
23304 Fix pointer signedness.
23305 (alsa_choose_format): Remove unused local var.
23306 (wav_play): Initialize a variable to 0, to prevent undefined
23307 behavior (Bug#8278).
23309 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23311 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23313 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23314 clobbering (Bug#8298).
23315 * sysdep.c (sys_subshell): Likewise.
23316 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23318 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23319 This should get cleaned up, so that child_setup has the
23320 same signature on all platforms.
23322 * callproc.c (call_process_cleanup): Now static.
23323 (relocate_fd): Rename locals to avoid shadowing.
23325 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23327 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23328 not to be necessary, and produces flickering.
23330 2011-03-20 Glenn Morris <rgm@gnu.org>
23332 * config.in: Remove file.
23334 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23336 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23337 are now in src/globals.h.
23338 (syms_of_minibuf): Remove spurious & from previous change.
23340 2011-03-20 Leo Liu <sdl.web@gmail.com>
23342 * minibuf.c (completing-read-function): New variable.
23343 (completing-read-default): Rename from completing-read.
23344 (completing-read): Call completing-read-function.
23346 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23348 * xfaces.c (Fx_load_color_file):
23349 Read color file from absolute filename (bug#8250).
23351 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23353 * makefile.w32-in: Update dependencies.
23355 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23357 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23359 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23361 Fix more problems found by GCC 4.5.2's static checks.
23363 * process.c (make_serial_process_unwind, send_process_trap):
23364 (sigchld_handler): Now static.
23366 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23367 That way, the code declares only the vars that it needs.
23368 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23369 * s/cygwin.h (PTY_ITERATION): Likewise.
23370 * s/darwin.h (PTY_ITERATION): Likewise.
23371 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23373 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23374 * process.c (allocate_pty): Don't declare stb unless it's needed.
23376 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23377 (CONSTANTLIM): Remove; unused.
23378 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23379 Define only if needed.
23381 * unexelf.c (unexec): Name an expression,
23382 to avoid gcc -Wbad-function-cast warning.
23383 Use a different way to cause a compilation error if anyone uses
23384 n rather than nn, a way that does not involve shadowing.
23385 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23387 * deps.mk (unexalpha.o): Remove; unused.
23389 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23390 * unexec.h: New file.
23391 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23392 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23393 Depend on unexec.h.
23394 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23395 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23396 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23397 Change as necessary to match prototype in unexec.h.
23399 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23401 (back_comment, skip_chars): Mark vars as initialized.
23403 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23404 Rename locals to avoid shadowing.
23406 * lread.c (read1): Rewrite so as not to use empty "else".
23407 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23409 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23411 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23412 warning when compiling print.c.
23414 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23415 instead of using an uninitialized var.
23416 (font_sort_entities): Mark var as initialized.
23418 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23420 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23421 pointers to constants.
23422 (font_parse_fcname): Remove unused vars.
23423 (font_delete_unmatched): Now static.
23424 (font_get_spec): Remove; unused.
23425 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23426 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23427 Rename or move locals to avoid shadowing.
23429 * fns.c (require_nesting_list, require_unwind): Now static.
23430 (Ffillarray): Rename locals to avoid shadowing.
23432 * floatfns.c (domain_error2): Define only if needed.
23433 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23435 * alloc.c (mark_backtrace): Move decl from here ...
23436 * lisp.h: ... to here, so that it can be checked.
23438 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23439 (Fdefvar): Rewrite so as not to use empty "else".
23440 (lisp_indirect_variable): Name an expression,
23441 to avoid gcc -Wbad-function-cast warning.
23442 (Fdefvar): Rename locals to avoid shadowing.
23444 * callint.c (quotify_arg, quotify_args): Now static.
23445 (Fcall_interactively): Rename locals to avoid shadowing.
23446 Use const pointer when appropriate.
23448 * lisp.h (get_system_name, get_operating_system_release):
23449 Move decls here, to check interfaces.
23450 * process.c (get_operating_system_release): Move decl to lisp.h.
23451 * xrdb.c (get_system_name): Likewise.
23452 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23453 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23454 some of which prompt warnings from gcc -Wbad-function-cast.
23455 (Fformat_time_string, Fencode_time, Finsert_char):
23456 (Ftranslate_region_internal, Fformat):
23457 Rename or remove local vars to avoid shadowing.
23458 (Ftranslate_region_internal): Mark var as initialized.
23460 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23463 * lisp.h (eassert): Check that the argument compiles, even if
23464 ENABLE_CHECKING is not defined.
23466 * data.c (Findirect_variable): Name an expression, to avoid
23467 gcc -Wbad-function-cast warning.
23468 (default_value, arithcompare, arith_driver, arith_error): Now static.
23469 (store_symval_forwarding): Rename local to avoid shadowing.
23470 (Fmake_variable_buffer_local, Fmake_local_variable):
23471 Mark variables as initialized.
23472 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23474 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23475 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23476 Rename locals to avoid shadowing.
23477 (mark_stack): Move local variables into the #ifdef region where
23479 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23480 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23482 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23483 (GC_STRING_CHARS): Remove; not used.
23484 (Fmemory_limit): Cast sbrk's returned value to char *.
23486 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23487 avoids undefined behavior in theory.
23489 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23491 Use functions, not macros, for up- and down-casing (Bug#8254).
23492 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23493 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23494 to use the following functions instead of these macros.
23495 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23496 EMACS_INT, since callers assume the returned value fits in int.
23497 (upcase1): Likewise, for UPCASE_TABLE.
23498 (uppercasep, lowercasep, upcase): New static inline functions.
23499 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23500 the race-condition problem in the old DOWNCASE.
23502 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23503 Rename locals to avoid shadowing.
23504 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23505 (regex_compile, re_search_2, re_match_2_internal):
23506 Remove unused local vars.
23507 (FREE_VAR): Rewrite so as not to use empty "else",
23508 which gcc can warn about.
23509 (regex_compile, re_match_2_internal): Mark locals as initialized.
23510 (RETALLOC_IF): Define only if needed.
23511 (WORDCHAR_P): Likewise. This one is never needed, but is used
23512 only in a comment talking about a compiler bug, so put inside
23513 the #if 0 of that comment.
23514 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23515 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23518 * search.c (boyer_moore): Rename locals to avoid shadowing.
23519 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23520 (PREV_CHAR_BOUNDARY): Likewise.
23522 * search.c (simple_search): Remove unused var.
23524 * dired.c (compile_pattern): Move decl from here ...
23525 * lisp.h: ... to here, so that it can be checked.
23526 (struct re_registers): New forward decl.
23528 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23530 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23532 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23533 Rename locals to avoid shadowing.
23534 (Fvertical_motion): Mark locals as initialized.
23536 * casefiddle.c (casify_object, casify_region): Now static.
23537 (casify_region): Mark local as initialized.
23539 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23541 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23542 New macros, so that the caller can use some names other than
23543 gcpro1, gcpro2, etc.
23544 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23546 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23547 argument, for consistency with GCPRO2_VAR, etc: it is now the
23548 prefix of the variable, not the variable itself. All uses
23550 * dired.c (directory_files_internal, file_name_completion):
23551 Rename locals to avoid shadowing.
23553 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23554 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23555 dired.c's scmp function, had undefined behavior.
23556 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23557 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23558 * buffer.h: ... to here, because these macros use current_buffer,
23559 and the new implementation with inline functions needs to have
23560 current_buffer in scope now, rather than later when the macros
23562 (downcase, upcase1): New static inline functions.
23563 (DOWNCASE, UPCASE1): Reimplement using these functions.
23564 This avoids undefined behavior in expressions like
23565 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23566 from race conditions in accessing the global variables
23567 case_temp1 and case_temp2.
23568 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23569 * lisp.h (case_temp1, case_temp2): Remove their decls.
23570 * character.h (ASCII_CHAR_P): Move from here ...
23571 * lisp.h: ... to here, so that the inline functions mentioned
23572 above can use them.
23574 * dired.c (directory_files_internal_unwind): Now static.
23576 * fileio.c (file_name_as_directory, directory_file_name):
23577 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23579 (file_name_as_directory): Use const pointers when appropriate.
23580 (Fexpand_file_name): Likewise. In particular, newdir might
23581 point at constant storage, so make it a const pointer.
23582 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
23583 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23585 (Fset_file_times, Finsert_file_contents, auto_save_error):
23586 Rename locals to avoid shadowing.
23588 * minibuf.c (choose_minibuf_frame_1): Now static.
23589 (Ftry_completion, Fall_completions): Rename or remove locals
23590 to avoid shadowing.
23592 * marker.c (bytepos_to_charpos): Remove; unused.
23594 * lisp.h (verify_bytepos, count_markers): New decls,
23595 so that gcc does not warn that these functions aren't declared.
23597 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23598 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
23599 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
23600 (copy_text): Remove unused local var.
23602 * filelock.c (within_one_second): Now static.
23603 (lock_file_1): Rename local to avoid shadowing.
23605 * buffer.c (fix_overlays_before): Mark locals as initialized.
23606 (fix_start_end_in_overlays): Likewise. This function should be
23607 simplified by using pointers-to-pointers, but that's a different
23609 (switch_to_buffer_1): Now static.
23610 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23611 (report_overlay_modification): Rename locals to avoid shadowing.
23613 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
23614 Fix pointer signedness issue.
23615 (sys_subshell): Mark local as volatile if checking for lint,
23616 to suppress a gcc -Wclobbered warning that does not seem to be right.
23617 (MAXPATHLEN): Define only if needed.
23619 * process.c (serial_open, serial_configure): Move decls from here ...
23620 * systty.h: ... to here, so that they can be checked.
23622 * fns.c (get_random, seed_random): Move extern decls from here ...
23623 * lisp.h: ... to here, so that they can be checked.
23625 * sysdep.c (reset_io): Now static.
23626 (wait_for_termination_signal): Remove; unused.
23628 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23629 (copy_keymap_item, append_key, push_text_char_description):
23631 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
23632 (DENSE_TABLE_SIZE): Remove; unused.
23633 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23634 (describe_map_tree):
23635 Rename locals to avoid shadowing.
23637 * keyboard.c: Declare functions static if they are not used elsewhere.
23638 (echo_char, echo_dash, cmd_error, top_level_2):
23639 (poll_for_input, handle_async_input): Now static.
23640 (read_char, kbd_buffer_get_event, make_lispy_position):
23641 (make_lispy_event, make_lispy_movement, apply_modifiers):
23642 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23643 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23644 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
23645 (read_key_sequence, read_char): Mark locals as initialized.
23646 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
23648 * keyboard.h (make_ctrl_char): New decl.
23649 (mark_kboards): Move decl here ...
23650 * alloc.c (mark_kboards): ... from here.
23652 * lisp.h (force_auto_save_soon): New decl.
23654 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
23655 (DEFINE_DUMMY_FUNCTION): New macro.
23656 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23658 (main): Add casts to avoid warnings
23659 if GCC considers string literals to be constants.
23661 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23663 * dbusbind.c: Pointer signedness fixes.
23664 (xd_signature, xd_append_arg, xd_initialize):
23665 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23666 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23667 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23668 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23670 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23671 if GCC considers string literals to be constants.
23672 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
23674 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23676 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23677 (print_preprocess, print_object): New macro to fix last change.
23679 * print.c (print_preprocess): Don't forget font objects.
23681 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
23683 * emacs.c (USAGE3): Doc fixes.
23685 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23687 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23690 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
23692 * lisp.h (VWindow_system, Qfile_name_history):
23693 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23694 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23695 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23697 * w32select.c: Don't #include "keyboard.h".
23698 (run_protected): Add extern declaration for waiting_for_input.
23700 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23701 * w32console.c (detect_input_pending, read_input_pending)
23702 (encode_terminal_code):
23703 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23704 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23705 (w32_system_caret_y, Qfile_name_history):
23706 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23707 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23708 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23709 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23710 * w32proc.c (Qlocal, report_file_error):
23711 * w32term.c (Vwindow_system, updating_frame):
23712 * w32uniscribe.c (initialized, uniscribe_font_driver):
23713 Remove unneeded extern declarations.
23715 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
23717 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
23719 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
23721 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23722 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23723 These macros can no longer be used for assignment.
23725 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23726 Assign struct members directly, instead of using BUF_BEGV etc.
23727 (record_buffer_markers, fetch_buffer_markers): New functions for
23728 recording and fetching special buffer markers.
23729 (set_buffer_internal_1, set_buffer_temp): Use them.
23731 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23733 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23735 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23736 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23738 * xdisp.c (hscroll_window_tree):
23739 (reconsider_clip_changes): Use PT instead of BUF_PT.
23741 2011-03-13 Eli Zaretskii <eliz@gnu.org>
23743 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23744 $(EMACS_ROOT)/lib/intprops.h.
23746 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23748 Fix more problems found by GCC 4.5.2's static checks.
23750 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23751 to unsigned char * to avoid compiler diagnostic.
23752 (xg_free_frame_widgets): Make it clear that a local variable is
23753 needed only if USE_GTK_TOOLTIP.
23754 (gdk_window_get_screen): Make it clear that this macro is needed
23755 only if USE_GTK_TOOLTIP.
23756 (int_gtk_range_get_value): New function, which avoids a diagnostic
23757 from gcc -Wbad-function-cast.
23758 (xg_set_toolkit_scroll_bar_thumb): Use it.
23759 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23760 diagnostic from gcc -Wbad-function-cast.
23761 (get_utf8_string, xg_get_file_with_chooser):
23762 Rename locals to avoid shadowing.
23763 (create_dialog): Move locals to avoid shadowing.
23765 * xgselect.c (xg_select): Remove unused var.
23767 * image.c (four_corners_best): Mark locals as initialized.
23768 (gif_load): Initialize transparent_p to zero (Bug#8238).
23769 Mark another local as initialized.
23770 (my_png_error, my_error_exit): Mark with NO_RETURN.
23772 * image.c (clear_image_cache): Now static.
23773 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
23774 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
23775 (x_edge_detection): Remove unnecessary cast that
23776 gcc -Wbad-function-cast diagnoses.
23777 (gif_load): Fix pointer signedness.
23778 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23779 (jpeg_load, gif_load): Rename locals to avoid shadowing.
23781 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
23783 Improve quality of tests for time stamp overflow.
23784 For example, without this patch (encode-time 0 0 0 1 1
23785 1152921504606846976) returns the obviously-bogus value (-948597
23786 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23787 reports time overflow. See
23788 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
23789 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23790 * editfns.c: Include limits.h and intprops.h.
23791 (TIME_T_MIN, TIME_T_MAX): New macros.
23792 (time_overflow): Move earlier, to before first use.
23793 (hi_time, lo_time): New functions, for an accurate test for
23794 out-of-range times.
23795 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23796 (Fget_internal_run_time): Don't assume time_t fits in int.
23797 (make_time): Use list2 instead of Fcons twice.
23798 (Fdecode_time): More accurate test for out-of-range times.
23799 (check_tm_member): New function.
23800 (Fencode_time): Use it, to test for out-of-range times.
23801 (lisp_time_argument): Don't rely on undefined left-shift and
23802 right-shift behavior when checking for time stamp overflow.
23804 * editfns.c (time_overflow): New function, refactoring common code.
23805 (Fformat_time_string, Fdecode_time, Fencode_time):
23806 (Fcurrent_time_string): Use it.
23808 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23809 * dired.c (make_time): Move to ...
23810 * editfns.c (make_time): ... here.
23811 * systime.h: Note the move.
23813 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23815 * fringe.c (update_window_fringes): Remove unused variables.
23817 * unexmacosx.c (copy_data_segment): Also copy __got section.
23820 2011-03-12 Eli Zaretskii <eliz@gnu.org>
23822 * termcap.c [MSDOS]: Include "msdos.h".
23823 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23824 Constify `char *' arguments and their references according to
23825 prototypes in tparam.h.
23827 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
23829 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23830 Adapt all references accordingly.
23832 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23834 2011-03-11 Tom Tromey <tromey@redhat.com>
23836 * buffer.c (syms_of_buffer): Remove obsolete comment.
23838 2011-03-11 Eli Zaretskii <eliz@gnu.org>
23840 * termhooks.h (encode_terminal_code): Declare prototype.
23842 * msdos.c (encode_terminal_code): Don't declare prototype.
23844 * term.c (encode_terminal_code): Now external again, used by
23845 w32console.c and msdos.c.
23847 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23848 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
23850 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
23852 Fix some minor problems found by GCC 4.5.2's static checks.
23854 * fringe.c (update_window_fringes): Mark locals as initialized
23856 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
23858 * alloc.c (mark_fringe_data): Move decl from here ...
23859 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23860 to check its interface.
23861 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23863 * fontset.c (free_realized_fontset): Now static.
23864 (Fset_fontset_font): Rename local to avoid shadowing.
23865 (fontset_font): Mark local as initialized.
23866 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
23868 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23870 * xselect.c (x_disown_buffer_selections): Remove; not used.
23871 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
23872 (x_own_selection, Fx_disown_selection_internal): Rename locals
23873 to avoid shadowing.
23874 (x_handle_dnd_message): Remove local to avoid shadowing.
23876 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23877 so that the caller can use some name other than gcpro1.
23878 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
23879 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23880 (Fx_backspace_delete_keys_p):
23881 Use them to avoid shadowing, and rename vars to avoid shadowing.
23882 (x_decode_color, x_set_name, x_window): Now static.
23883 (Fx_create_frame): Add braces to silence GCC warning.
23884 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
23885 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23886 Remove unused locals.
23887 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23888 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23889 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23892 * xterm.h (x_mouse_leave): New decl.
23894 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23895 Remove unused functions.
23896 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23897 (x_calc_absolute_position): Now static.
23898 (XTread_socket): Don't define label "out" unless it's used.
23899 Don't declare local "event" unless it's used.
23900 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23901 unless they are used.
23902 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23903 (x_fatal_error_signal): Remove; not used.
23904 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23905 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23906 (x_error_catcher, x_connection_closed, x_error_handler):
23907 (x_error_quitter, xembed_send_message, x_iconify_frame):
23908 (my_log_handler): Rename locals to avoid shadowing.
23909 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
23910 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
23912 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23913 Rename or move locals to avoid shadowing.
23914 (tty_defined_color, merge_face_heights): Now static.
23915 (free_realized_faces_for_fontset): Remove; not used.
23916 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23917 does not deduce is never used uninitialized.
23918 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23919 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
23921 * terminal.c (store_terminal_param): Now static.
23923 * xmenu.c (menu_highlight_callback): Now static.
23924 (set_frame_menubar): Remove unused local.
23925 (xmenu_show): Rename parameter to avoid shadowing.
23926 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23927 since they might point to immutable storage.
23928 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23929 since it's unused otherwise.
23931 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
23932 Add a FIXME, since the code still doesn't look right. (Bug#8215)
23933 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23934 avoids a gcc -Wuninitialized diagnostic.
23935 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
23936 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23937 does not deduce are never used uninitialized.
23939 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23941 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
23942 * window.c (window_loop, size_window):
23943 (run_window_configuration_change_hook, enlarge_window): Likewise.
23945 * window.c (display_buffer): Now static.
23946 (size_window): Mark variables that gcc -Wuninitialized
23947 does not deduce are never used uninitialized.
23948 * window.h (check_all_windows): New decl, to forestall
23949 gcc -Wmissing-prototypes diagnostic.
23950 * dispextern.h (bidi_dump_cached_states): Likewise.
23952 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23954 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
23955 Include <limits.h>.
23956 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23957 and to avoid gcc -Wuninitialized warning.
23958 (load_charset_map): Mark variables that gcc -Wuninitialized
23959 does not deduce are never used uninitialized.
23960 (load_charset): Abort instead of using uninitialized var (Bug#8229).
23962 * coding.c (coding_set_source, coding_set_destination):
23963 Use "else { /* comment */ }" rather than "else /* comment */;"
23964 for clarity, and to avoid gcc -Wempty-body warning.
23965 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23966 a block, when the outer 'i' will do.
23967 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23968 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23969 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23970 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23971 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23972 Rename locals to avoid shadowing.
23973 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
23974 * coding.c (emacs_mule_char, encode_invocation_designation):
23975 Now static, since they're not used elsewhere.
23976 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
23977 (decode_coding_object, encode_coding_object, detect_coding_system):
23978 (decode_coding_emacs_mule): Mark variables that gcc
23979 -Wuninitialized does not deduce are never used uninitialized.
23980 (detect_coding_iso_2022): Initialize a local variable that might
23981 be used uninitialized. Leave a FIXME because it's not clear that
23982 this initialization is needed. (Bug#8211)
23983 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23984 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23985 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23986 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23987 Remove unused macros.
23989 * category.c (hash_get_category_set): Remove unused local var.
23990 (copy_category_table): Now static, since it's not used elsewhere.
23991 * character.c (string_count_byte8): Likewise.
23993 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23994 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23996 * chartab.c (copy_sub_char_table): Now static, since it's not used
23998 (sub_char_table_ref_and_range, char_table_ref_and_range):
23999 Rename locals to avoid shadowing.
24000 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
24002 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
24003 (BIDI_BOB): Remove unused macro.
24005 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24006 deduce are never used uninitialized.
24007 * term.c (encode_terminal_code): Likewise.
24009 * term.c (encode_terminal_code): Now static. Remove unused local.
24011 * tparam.h: New file.
24012 * term.c, tparam.h: Include it.
24013 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24014 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24015 Move these decls to tparam.h, and make them agree with what
24016 is actually in tparam.c. The previous trick of using incompatible
24017 decls in different modules does not conform to the C standard.
24018 All callers of tparam changed to use tparam's actual API.
24019 * tparam.c (tparam1, tparam, tgoto):
24020 Use const pointers where appropriate.
24022 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24023 * cm.h (struct cm): Likewise.
24024 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24025 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24026 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24027 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24028 (turn_on_face, init_tty): Likewise.
24029 * termchar.h (struct tty_display_info): Likewise.
24031 * term.c (term_mouse_position): Rename local to avoid shadowing.
24033 * alloc.c (mark_ttys): Move decl from here ...
24034 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24036 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24038 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24040 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
24042 * search.c (compile_pattern_1): Remove argument regp, unused since
24043 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24044 (compile_pattern): Don't pass it.
24046 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24048 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24049 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24051 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24053 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24055 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24056 gdk_window_get_screen, gdk_window_get_geometry,
24057 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24058 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24059 (xg_get_pixbuf_from_pixmap): New function.
24060 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24061 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24062 Call xg_get_pixbuf_from_pixmap instead of
24063 gdk_pixbuf_get_from_drawable.
24064 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24065 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24066 (xg_check_special_colors): Use GtkStyleContext and its functions
24068 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24069 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24070 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24071 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24072 Call gtk_widget_get_preferred_size.
24073 (xg_frame_resized): gdk_window_get_geometry only takes 5
24075 (xg_win_to_widget, xg_event_is_for_menubar):
24076 Call gdk_x11_window_lookup_for_display.
24077 (xg_set_widget_bg): New function.
24078 (delete_cb): New function.
24079 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24080 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24081 (xg_set_background_color): Call xg_set_widget_bg.
24082 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24083 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24084 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24085 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24087 (update_frame_tool_bar): Call gtk_widget_hide.
24088 (xg_initialize): Use GDK_KEY_g.
24090 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24092 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24094 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24095 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24096 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24098 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
24100 * w32xfns.c (select_palette): Check success of RealizePalette against
24101 GDI_ERROR, not zero.
24103 See ChangeLog.11 for earlier changes.
24105 ;; Local Variables:
24109 Copyright (C) 2011-2013 Free Software Foundation, Inc.
24111 This file is part of GNU Emacs.
24113 GNU Emacs is free software: you can redistribute it and/or modify
24114 it under the terms of the GNU General Public License as published by
24115 the Free Software Foundation, either version 3 of the License, or
24116 (at your option) any later version.
24118 GNU Emacs is distributed in the hope that it will be useful,
24119 but WITHOUT ANY WARRANTY; without even the implied warranty of
24120 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24121 GNU General Public License for more details.
24123 You should have received a copy of the GNU General Public License
24124 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.