Factor out common code for multimonitors, for Gtk+, non-Gtk+ X11 and NS.
[bpt/emacs.git] / src / ChangeLog
1 2013-05-25 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
4 (struct MonitorInfo, free_monitors): Remove.
5 (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
6 (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
7 (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
8 Qframes, Qsource.
9
10 * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
11 (struct MonitorInfo, free_monitors): Remove.
12 (ns_screen_name): Make static.
13 (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
14 (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
15 Qframes, Qsource.
16
17 * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
18 (struct MonitorInfo): New struct.
19 (free_monitors, make_monitor_attribute_list): Declare.
20
21 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New
22 Lisp_Object:s.
23 (free_monitors, make_monitor_attribute_list): New functions.
24 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
25 Qsource.
26
27 2013-05-25 Xue Fuqiao <xfq.free@gmail.com>
28
29 * callproc.c (call_process): Refine the doc string. (Bug#14045)
30
31 2013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
32
33 * keyboard.c: Apply keyboard decoding only to events that come directly
34 from the tty, not from unread-command-events (bug#14368).
35 (read_event_from_main_queue): New function, extracted from read_char).
36 (read_decoded_char): Remove.
37 (read_decoded_event_from_main_queue): New function to replace it.
38 (read_char): Use it.
39 (read_key_sequence): Use read_char rather than read_decoded_char.
40
41 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
42
43 2013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
44
45 * casetab.c (init_casetab_once): Fix last change (bug#14424).
46
47 2013-05-22 Kenichi Handa <handa@gnu.org>
48
49 The following changes are to fix the setting of
50 buffer-file-coding-system on, for instance, C-x RET c unix RET
51 _FILE_OF_DOS_EOL_TYPE_ RET.
52
53 * coding.h (struct coding_system): New member detected_utf8_chars.
54
55 * coding.c (detect_coding_utf_8): Count characters and check EOL
56 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
57 BOM is there.
58 (setup_coding_system): Do not initialize coding->head_ascii.
59 (check_ascii): Do not set coding->eol_seen but update it. Do not
60 call adjust_coding_eol_type here.
61 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
62 If the eol-type of CODING is already specified, adjust the eol type
63 of the found coding-system.
64 (decode_coding_gap): Cancel previous change. Utilize the
65 character numbers counted by detect_coding_utf_8. Fix detection
66 of BOM for utf-8.
67
68 2013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
69
70 * search.c (looking_at_1): Only set last_thing_searched if the match
71 changed the match-data (bug#14281).
72
73 2013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
74
75 * xdisp.c (reseat_at_previous_visible_line_start):
76 Already declared in dispextern.h, so remove it here.
77 (move_it_vertically_backward): Likewise.
78
79 2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
80
81 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
82 (Fx_display_pixel_width, Fx_display_pixel_height)
83 (Fx_display_mm_width, Fx_display_mm_height):
84 Mention `display-monitor-attributes-list' in docstrings.
85
86 * nsfns.m (ns_get_screen): Remove function. All uses removed.
87 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
88 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
89 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
90 (Fx_display_backing_store, Fx_display_visual_class)
91 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
92 (Fx_display_grayscale_p, Fx_display_pixel_width)
93 (Fx_display_pixel_height, Fx_display_planes)
94 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
95 (Fx_display_screens): Don't confuse X11 screens with NS screens.
96 (Fx_display_mm_width, Fx_display_mm_height)
97 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
98 height for all physical monitors as in X11.
99
100 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
101 Return pixel width or height for all physical monitors as in X11.
102
103 2013-05-18 Paul Eggert <eggert@cs.ucla.edu>
104
105 Port --enable-gcc-warnings to clang.
106 * bytecode.c (exec_byte_code):
107 * regex.c:
108 Redo diagnostic pragmas to pacify clang, too.
109 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
110 * editfns.c (Fencode_time):
111 * fileio.c (file_accessible_directory_p):
112 * font.c (font_unparse_xlfd):
113 Use '&"string"[index]' instead of '"string" + (index)'.
114 * undo.c (user_error): Remove; unused.
115
116 2013-05-16 Eli Zaretskii <eliz@gnu.org>
117
118 * insdel.c (insert_1_both): Document the arguments, instead of
119 referring to insert_1, which no longer exists.
120
121 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
122 some window, increment windows_or_buffers_changed, so that
123 *Messages* display in that window is updated. (Bug#14408)
124
125 * w32.c: Include epaths.h.
126 (init_environment): Use cmdproxy.exe without leading directories.
127 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
128 case.
129 (gettimeofday): Adjust signature and return value to Posix
130 expectations.
131
132 * unexw32.c (open_output_file): Delete the existing emacs.exe
133 before creating it, to break the hard link to the versioned
134 executable.
135
136 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
137 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
138 (FIRSTFILE_OBJ): New variables.
139 (W32_RES): Rename to EMACSRES. All users changed.
140 (base_obj): Use $(CM_OBJ).
141 (ALLOBJS): Use $(FIRSTFILE_OBJ).
142 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
143 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
144 $(W32_RES_LINK) before $(LIBES).
145 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
146
147 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
148
149 * makefile.w32-in (DOC): Use just "DOC".
150
151 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
152
153 * process.c: Export default filters and sentinels to Elisp.
154 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
155 New constants.
156 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
157 (Fset_process_sentinel, Fformat_network_address):
158 Default to them instead of nil.
159 (server_accept_connection): Sentinels can't be nil any more.
160 (read_and_dispose_of_process_output): New function, extracted from
161 read_process_output.
162 (read_process_output): Use it; filters can't be nil.
163 (Finternal_default_process_filter): New function, extracted from
164 read_process_output.
165 (exec_sentinel_unwind): Remove function.
166 (exec_sentinel): Don't zilch sentinel while running.
167 (status_notify): Sentinels can't be nil.
168 (Finternal_default_process_sentinel): New function extracted from
169 status_notify.
170 (setup_process_coding_systems): Default filter is not nil any more.
171 (syms_of_process): Export new Elisp functions and initialize
172 new constants.
173 * lisp.h (make_lisp_proc): New function.
174
175 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
176
177 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
178
179 2013-05-14 Eli Zaretskii <eliz@gnu.org>
180
181 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
182 unless we know that the window w is a leaf window.
183 Another attempt at solving bug#14062.
184
185 2013-05-14 Jan Djärv <jan.h.d@swipnet.se>
186
187 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
188 fdesc (Bug#14375).
189
190 2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
191
192 * image.c (gif_load): Check that subimages fit (Bug#14345).
193
194 2013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
195
196 * lread.c (skip_dyn_eof): New function.
197 (read1): Use it to skip the end of a file in response to #@00.
198
199 * doc.c (get_doc_string): Slightly relax the sanity checking.
200
201 2013-05-09 Jan Djärv <jan.h.d@swipnet.se>
202
203 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
204 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
205 (MonitorInfo): New struct.
206 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
207 (Fns_display_monitor_attributes_list): New functions.
208 (display-usable-bounds): Remove.
209 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
210 Qsource.
211
212 2013-05-09 Paul Eggert <eggert@cs.ucla.edu>
213
214 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
215 (GTK_CHECK_VERSION): New macro, if not already defined.
216 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
217 replaced by GTK_CHECK_VERSION.
218
219 2013-05-08 Paul Eggert <eggert@cs.ucla.edu>
220
221 * xterm.h (GTK_PREREQ): New macro.
222 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
223 to use this macro instead, for consistency and clarity.
224
225 2013-05-08 Eli Zaretskii <eliz@gnu.org>
226
227 * xdisp.c (row_for_charpos_p): New function, with code of
228 cursor_row_p, but accepts an additional argument CHARPOS instead
229 of using a hardcoded PT.
230 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
231 (row_containing_pos): Call row_for_charpos_p instead of partially
232 doing the same. Fixes cursor positioning under longlines-mode
233 when longlines-show-effect includes more than one newline, when
234 moving the cursor vertically up.
235
236 2013-05-08 Juanma Barranquero <lekktu@gmail.com>
237
238 * makefile.w32-in (ACL_H): New macro.
239 ($(BLD)/fileio.$(O)): Update dependencies.
240
241 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
242
243 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
244 * Makefile.in (LIB_ACL): New macro.
245 (LIBACL_LIBS): Remove.
246 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
247 * fileio.c: Include <acl.h>.
248 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
249 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
250 !acl_errno_valid.
251 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
252 it ourselves.
253
254 * unexelf.c: Don't assume ElfW (Half) fits in int.
255 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
256 when dealing with ElfW (Half) values, since they can exceed 2**31
257 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
258 (entry_address): Omit unused NUM arg. All uses changed.
259
260 2013-05-07 Juri Linkov <juri@jurta.org>
261
262 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
263 to the string converted from number with `Fnumber_to_string'.
264 (Bug#14254)
265
266 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
267
268 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
269 This fixes a problem introduced by my previous change.
270
271 2013-05-07 Glenn Morris <rgm@gnu.org>
272
273 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
274
275 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
276
277 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
278
279 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
280
281 Static checking by GCC 4.8.0.
282 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
283 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
284 (x_get_monitor_attributes_fallback)
285 (x_get_monitor_attributes_xinerama)
286 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
287 Define only if USE_GTK.
288 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
289 (x_get_monitor_attributes_fallback): Omit unused locals.
290 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
291 Use double, not float, to avoid mixed-mode floating point arithmetic.
292
293 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
294 Jan Djärv <jan.h.d@swipnet.se>
295
296 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
297 (XINERAMA_CFLAGS): New macros.
298 (ALL_CFLAGS, LIBES): Use them.
299
300 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
301 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
302 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
303 (syms_of_xfns): DEFSYM them.
304 (struct MonitorInfo): New struct.
305 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
306 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
307 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
308 (x_get_monitor_attributes_xinerama): New functions.
309 (Fx_display_monitor_attributes_list): New primitive.
310 (syms_of_xfns): Defsubr it.
311
312 * xterm.h (x_display_info): Add Xatom_net_workarea and
313 Xatom_net_current_desktop.
314
315 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
316 and dpyinfo->Xatom_net_current_desktop.
317
318 2013-05-06 Eli Zaretskii <eliz@gnu.org>
319
320 * xdisp.c (pos_visible_p): Use the special code for finding the
321 beginning of a display property or overlay for any "replacing"
322 display property, not just for display strings. This solves
323 incorrect reporting of position by posn-at-point. (Bug#14241)
324
325 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
326
327 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
328 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
329 Verify that ElfW (Half) fits in int.
330 (fatal): Use same signature as lisp.h.
331 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
332 configure and build with -DUNEXELF_DEBUG without worrying about
333 other modules that use DEBUG.
334 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
335 possibly-wide integers now uses it instead of plain fprintf.
336 (entry_address): New function, which avoids problems with 32-bit
337 overflow on 64-bit hosts.
338 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
339 (round_up): Don't assume the remainder fits in int.
340 (find_section): Use bool for boolean. Simplify debug code.
341 (unexec): Don't assume file sizes fit in int or size_t.
342 Omit unnecessary trailing newline in 'fatal' format.
343 Use strerror rather than outputting decimal error number.
344 Remove unused code when emacs is not defined;
345 this file relies on Emacs now.
346 Don't assume e_phnum and e_shnum are positive.
347
348 * regex.c: Fix problems when DEBUG is defined.
349 (extract_number, extract_number_and_incr): Define regardless of
350 whether DEBUG is defined; that's simpler and makes the code less
351 likely to go stale in the normal case when DEBUG is not defined.
352 Return int rather than taking an int * arg. All callers changed.
353 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
354 Remove, replacing with ...
355 (DEBUG_PRINT): New macro. All callers changed.
356 (DEBUG_COMPILES_ARGUMENTS): New macro.
357 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
358 (print_compiled_pattern, print_double_string) [DEBUG]:
359 Use prototype rather than old-style definition.
360 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
361 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
362 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
363 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
364 Don't assume ptrdiff_t, size_t, and long are the same width as int.
365 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
366 This matters only when DEBUG is defined.
367
368 2013-05-05 Eli Zaretskii <eliz@gnu.org>
369
370 * xdisp.c (set_iterator_to_next): Set the
371 ignore_overlay_strings_at_pos_p flag only if we are _really_
372 iterating over an overlay string, as indicated by the
373 current.overlay_string_index member. (Bug#14306)
374
375 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
376
377 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
378 to where it is used, to avoid autorelease issues (Bug#14050).
379
380 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
381
382 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
383 * fileio.c (syms_of_fileio): Implement this.
384 * filelock.c (create_lock_file): If symbolic links don't work, so
385 we use a regular file as a lock file, do not fsync the lock file;
386 it's not needed.
387
388 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
389
390 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
391 (syms_of_minibuf): Adjust accodingly.
392 * lread.c (Fread):
393 * callint.c (Fcall_interactively): Adjust calls accordingly.
394
395 2013-05-04 Eli Zaretskii <eliz@gnu.org>
396
397 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
398 w->contents is a buffer before computing everything else.
399 Use parentheses to disambiguate last part of the condition.
400
401 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
402 assertion violations. (Bug#14062)
403
404 2013-05-01 David Reitter <david.reitter@gmail.com>
405
406 * nsfns.m (ns_tooltip): Initialize.
407
408 2013-04-28 Eli Zaretskii <eliz@gnu.org>
409
410 * coding.c (decode_coding_gap): Don't remove the character before
411 a newline unless it's a CR character. (Bug#14287)
412
413 2013-04-28 Dan Nicolaescu <dann@gnu.org>
414
415 * dispextern.h (struct face): Move enum face_underline_type
416 earlier so that bitfields can be in the same word.
417
418 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
419
420 * nsfns.m (handlePanelKeys): New function.
421 (EmacsOpenPanel:performKeyEquivalent:)
422 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
423 arrows/function/control and copy/paste keys (Bug#14296).
424
425 2013-04-27 Juri Linkov <juri@jurta.org>
426
427 * callint.c (Fcall_interactively): Call `Qread_number' for
428 interactive code letter `n' instead of using duplicate code.
429 (Bug#14254)
430
431 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
432
433 * systime.h (make_timeval): Declare as 'const'.
434
435 2013-04-27 Kenichi Handa <handa@gnu.org>
436
437 * font.c (font_open_entity): Always open a font of manageable
438 size.
439
440 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
441
442 Port better to AIX (Bug#14258).
443 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
444 to pacify AIX xlc.
445
446 2013-04-24 Kenichi Handa <handa@gnu.org>
447
448 * coding.c (decode_coding_iso_2022): When an invalid escape
449 sequence is encountered, reset the invocation and designation
450 status to the safest one.
451
452 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
453
454 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
455 Without this fix, "make distclean" leaves stamp-h1 behind.
456
457 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
458
459 * w32fns.c (w32_fullscreen_rect): New function to compute the
460 window rectangle for the given fullscreen mode.
461 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
462 longer tunes the window size. This keeps the window's edges flush
463 with the screen and allows the taskbar to hide itself in fullboth.
464
465 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
466 window decorations and uses the entire screen.
467
468 * w32term.h (w32_fullscreen_rect) Add prototype.
469 (struct w32_output): Replace normal_width, normal_height,
470 normal_top, and normal_left members with a single normal_placement
471 struct.
472 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
473 Remove macros.
474 (FRAME_NORMAL_PLACEMENT): New macro.
475
476 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
477
478 * minibuf.c (Ftest_completion): Silence compiler warning.
479
480 2013-04-15 Eli Zaretskii <eliz@gnu.org>
481
482 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
483 bug#14062.
484
485 * frame.h (WINDOW_FRAME): Protect macro and its argument with
486 parentheses.
487
488 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
489 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
490 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
491 parentheses where appropriate.
492
493 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
494
495 * keyboard.c (timer_start_idle): Remove no-longer-used local.
496
497 2013-04-14 Eli Zaretskii <eliz@gnu.org>
498
499 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
500 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
501 Mention in the doc string that setting these variables takes
502 effect only after a call to set-window-buffer. (Bug#14200)
503
504 2013-04-13 Eli Zaretskii <eliz@gnu.org>
505
506 * indent.c (Fvertical_motion): Don't consider display strings on
507 overlay strings as display strings on the buffer position we
508 started from. This prevents vertical cursor motion from jumping
509 more than one line when there's an overlay string with a display
510 property at end of line.
511 Reported by Karl Chen <Karl.Chen@quarl.org> in
512 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
513
514 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
515
516 * window.c (select_window): `record_buffer' even if window is
517 already selected (bug#14191).
518
519 2013-04-11 Eli Zaretskii <eliz@gnu.org>
520
521 * window.c (Fwindow_end): Test more flags, including the buffer's
522 last_overlay_modified flag, to determine whether the window's
523 display is really up-to-date. Prevents the function from
524 returning a stale value. (Bug#14170)
525 (Fwindow_line_height): Fix the test for up-to-date-ness of the
526 current matrix.
527
528 2013-04-10 Eli Zaretskii <eliz@gnu.org>
529
530 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
531 garbaged only if it is not already the top frame on its TTY.
532 This prevents flickering due to constant redrawing of TTY frames when
533 there are GUI frames open in the same session. (Bug#13864)
534
535 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
536
537 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
538 of marking the idle timers directly.
539
540 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
541
542 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
543 tables (bug#14054).
544
545 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
546
547 * window.c (select_window): Don't record_buffer while the invariant is
548 temporarily broken (bug#14161).
549
550 * fns.c (Fdelq): Don't assume !NILP => CONSP.
551
552 2013-04-07 Eli Zaretskii <eliz@gnu.org>
553
554 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
555
556 2013-04-07 Romain Francoise <romain@orebokech.com>
557
558 Ignore additional platform-specific ACL errors (Bug#13702).
559 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
560 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
561
562 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
563
564 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
565 f->output_data.ns.
566
567 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
568
569 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
570 This bug was introduced by my 2013-02-25 change that simplified
571 data_start configuration. Without this change, on GNU/Linux
572 an Emacs configured with --enable-profiling fails immediately
573 due to a profiler signal.
574 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
575 with these flags. On platforms where special flags are needed
576 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
577 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
578 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
579
580 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
581
582 Get rid of some platform-specific functions examining window
583 system and its capabilities. This is a partial rework of the
584 2013-04-05 change.
585 * lisp.h (have_menus_p): Remove prototype. This function is
586 replaced with platform-independent window_system_available.
587 (check_window_system): Move to...
588 * frame.h (decode_window_system_frame, window_system_available):
589 ...here, add new prototypes.
590 * frame.c (window_system_available, decode_window_system_frame):
591 New functions.
592 (check_window_system): Platform-independent now.
593 * xterm.h (x_in_use): Remove declaration.
594 (check_x_frame):
595 * w32term.h (check_x_frame):
596 * nsterm.h (check_x_frame): Remove prototypes. This function
597 is replaced with platform-independent decode_window_system_frame.
598 * msdos.c (have_menus_p): Remove.
599 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
600 Remove platform-specific functions. Use check_window_system,
601 decode_window_system_frame and check_ns_display_info where
602 appropriate. Minor style and comment tweaks.
603 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
604 (check_x_frame): Likewise.
605 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
606 Likewise.
607 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
608 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
609 * xmenu.c, xselect.c: All related users changed.
610
611 2013-04-03 Kenichi Handa <handa@gnu.org>
612
613 The following changes is to optimize the code for reading UTF-8
614 files.
615
616 * coding.c (check_ascii): Rename from detect_ascii. Return value
617 changed. Check EOL format. Do not call adjust_coding_eol_type
618 here.
619 (check_utf_8): New function.
620 (adjust_coding_eol_type): Do nothing if already adjusted.
621 (detect_coding): Compare the return value of check_ascii with
622 coding->src_bytes. Call adjust_coding_eol_type if necessary.
623 (decode_coding_gap): Optimize for valid UTF-8.
624
625 2013-03-21 Kenichi Handa <handa@gnu.org>
626
627 * coding.c (syms_of_coding): Cancel previous change.
628
629 * insdel.c (insert_from_gap): Fix previous change.
630
631 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
632
633 Consistently use platform-specific function to detect window system.
634 * lisp.h (check_window_system): New prototype. This function is
635 going to replace check_x, check_w32 and check_ns.
636 (have_menus_p): Mention msdos.c in comment.
637 * fontset.c (check_window_system_func): Remove. Adjust all users.
638 * fontset.h (check_window_system_func): Remove prototype.
639 * nsterm.h (check_ns):
640 * xterm.h (check_x):
641 * w32term.h (check_w32): Likewise.
642 * menu.c (Fx_popup_menu): Use check_window_system.
643 * msdos.c (check_window_system): Define for MS-DOS.
644 * nsfns.m (check_window_system): Define for NS. Adjust all users.
645 * w32fns.c (check_window_system): Likewise for MS-Windows.
646 * xfns.c (check_window_system): Likewise for X.
647 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
648 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
649
650 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
651
652 Prefer < to > in range checks such as 0 <= i && i < N.
653 This makes it easier to visualize quantities on a number line.
654 This patch doesn't apply to all such range checks,
655 only to the range checks affected by the 2013-03-24 change.
656 This patch reverts most of the 2013-03-24 change.
657 * alloc.c (xpalloc, Fgarbage_collect):
658 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
659 * character.c (string_escape_byte8):
660 * charset.c (read_hex):
661 * data.c (cons_to_unsigned):
662 * dispnew.c (update_frame_1):
663 * doc.c (Fsubstitute_command_keys):
664 * doprnt.c (doprnt):
665 * editfns.c (hi_time, decode_time_components):
666 * fileio.c (file_offset):
667 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
668 * font.c (font_intern_prop):
669 * frame.c (x_set_alpha):
670 * gtkutil.c (get_utf8_string):
671 * indent.c (check_display_width):
672 * keymap.c (Fkey_description):
673 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
674 * lread.c (read1):
675 * minibuf.c (read_minibuf_noninteractive):
676 * process.c (wait_reading_process_output):
677 * search.c (Freplace_match):
678 * window.c (get_phys_cursor_glyph):
679 * xdisp.c (redisplay_internal):
680 * xsmfns.c (smc_save_yourself_CB):
681 Prefer < to > for range checks.
682 * dispnew.c (sit_for): Don't mishandle NaNs.
683 This fixes a bug introduced in the 2013-03-24 change.
684 * editfns.c (decode_time_components): Don't hoist comparison.
685 This fixes another bug introduced in the 2013-03-24 change.
686
687 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
688
689 * frame.h (struct frame): Drop scroll_bottom_vpos
690 member becaue all real users are dead long ago.
691 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
692 * xdisp.c (redisplay_internal): Adjust user.
693
694 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
695
696 * nsmenu.m (showAtX:Y:for:): setLevel to
697 NSPopUpMenuWindowLevel (Bug#13998).
698
699 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
700
701 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
702 (ns_check_pending_open_menu): Declare.
703
704 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
705 (x_activate_menubar): Update the menu with title that matches
706 ns_get_pending_menu_title, and call
707 ns_check_pending_openmenu (Bug#12698).
708 (menuWillOpen:): New method.
709 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
710
711 * nsterm.m (menu_will_open_state, menu_mouse_point)
712 (menu_pending_title): New varaibles.
713 (ns_get_pending_menu_title, ns_check_menu_open)
714 (ns_check_pending_open_menu): New functions.
715
716 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
717
718 * indent.c (current_column_bol_cache): Remove leftover which is not
719 used in Fmove_to_column any more.
720 (current_column, scan_for_column): Adjust users.
721 * keyboard.c (last_point_position_buffer, last_point_position_window):
722 Remove leftovers which are not used for recording undo any more.
723 (command_loop_1, syms_of_keyboard): Adjust users.
724 * xdisp.c (last_max_ascent): Remove leftover which is not used in
725 redisplay_window any more.
726 (move_it_to): Adjust user.
727
728 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
729
730 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
731 Update dependencies.
732
733 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
734
735 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
736 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
737 forward references.
738
739 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
740
741 * window.h (struct window): Replace hchild, vchild and buffer slots
742 with the only contents slot. This is possible because each valid
743 window may have either the child window (in vertical or horizontal
744 combination) or buffer to display (for the leaf window). Using that,
745 a lof of operations to traverse and/or change window hierarchies may
746 be simplified. New member horizontal is used to distinguish between
747 horizontal and vertical combinations of internal windows.
748 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
749 (WINDOW_VERTICAL_COMBINATION_P): New macros.
750 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
751 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
752 Use contents slot, not buffer, where appropriate.
753 (wset_combination): New function.
754 (wset_buffer): Add eassert.
755 (Fframe_first_window): Simplify the loop reaching first window.
756 (Fwindow_buffer): Use WINDOW_LEAF_P.
757 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
758 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
759 (unshow_buffer): Convert initial debugging check to eassert.
760 (replace_window, recombine_windows, Fdelete_other_windows_internal)
761 (make_parent_window, window_resize_check, window_resize_apply)
762 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
763 (Fset_window_configuration, delete_all_child_windows, save_window_save):
764 Adjust to match struct window changes.
765 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
766 (mark_window_cursors_off, count_windows, get_leaf_windows)
767 (foreach_window_1): Simplify the loop.
768 * alloc.c (mark_object): Do not check for the leaf window because
769 internal windows has no glyph matrices anyway.
770 * dispnew.c (clear_window_matrices, showing_window_margins_p)
771 (allocate_matrices_for_window_redisplay, fake_current_matrices)
772 (allocate_matrices_for_frame_redisplay, free_window_matrices)
773 (build_frame_matrix_from_window_tree, mirror_make_current)
774 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
775 (update_window_tree, set_window_update_flags): Simplify the loop.
776 (sync_window_with_frame_matrix_rows): Enforce live window.
777 Use contents slot, not buffer, where appropriate.
778 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
779 and WINDOW_HORIZONTAL_COMBINATION_P.
780 (make_frame_visible_1): Simplify the loop.
781 Use contents slot, not buffer, where appropriate.
782 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
783 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
784 (expose_window_tree): Likewise.
785 Use contents slot, not buffer, where appropriate.
786 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
787 to avoid deleted windows. Use contents slot instead of buffer.
788 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
789 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
790 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
791 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
792
793 2013-03-28 Eli Zaretskii <eliz@gnu.org>
794
795 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
796 identify the reasons for assertion violations in bug#14062 and
797 similar ones.
798 (Fx_show_tip): Fix compilation error under
799 "--enable-check-lisp-object-type". (Bug#14073)
800
801 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
802 Reported by <rzl24ozi@gmail.com>.
803
804 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
805
806 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
807 start marker...
808 (unwind_with_echo_area_buffer): ...to restore it here.
809 This is needed to ensure that...
810 (redisplay_window): ...both window markers are valid here,
811 which is verified by eassert.
812 * editfns.c (save_excursion_save): Do not assume that
813 selected_window always displays the buffer.
814 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
815 Fix comment.
816
817 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
818
819 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
820 the upcase table.
821
822 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
823
824 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
825
826 2013-03-27 Eli Zaretskii <eliz@gnu.org>
827
828 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
829 since MinGW's w32api headers do. This avoids compiler warnings.
830
831 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
832 if already defined.
833
834 2013-03-26 Eli Zaretskii <eliz@gnu.org>
835
836 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
837
838 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
839
840 * gtkutil.c (style_changed_cb): Check if frame is live and an
841 X frame (Bug#14038).
842
843 2013-03-26 Eli Zaretskii <eliz@gnu.org>
844
845 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
846 Define only for _WIN32_WINNT less than 0x0500.
847 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
848 MinGW64.
849 Move inclusion of time.h before sys/time.h, so that MinGW64 could
850 see its own definitions of 'struct timeval' and 'struct timezone'.
851
852 Fix incompatibilities between MinGW.org and MinGW64 headers.
853 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
854
855 * w32.c (REPARSE_DATA_BUFFER): Guard with
856 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
857
858 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
859
860 * xterm.c: Include X11/XKBlib.h
861 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
862
863 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
864
865 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
866 written backwards.
867 * blockinput.h (input_blocked_p): Likewise.
868 * bytecode.c (exec_byte_code): Likewise.
869 * callproc.c (call_process_kill, call_process_cleanup)
870 (Fcall_process): Likewise.
871 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
872 (Fccl_execute_on_string): Likewise.
873 * character.c (string_escape_byte8): Likewise.
874 * charset.c (read_hex): Likewise.
875 * cm.c (calccost): Likewise.
876 * data.c (cons_to_unsigned): Likewise.
877 * dired.c (directory_files_internal, file_name_completion):
878 Likewise.
879 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
880 (sit_for): Likewise.
881 * doc.c (Fsubstitute_command_keys): Likewise.
882 * doprnt.c (doprnt): Likewise.
883 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
884 * emacsgtkfixed.c: Likewise.
885 * fileio.c (file_offset, Fwrite_region): Likewise.
886 * floatfns.c (Fexpt, fmod_float): Likewise.
887 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
888 Likewise.
889 * font.c (font_intern_prop): Likewise.
890 * frame.c (x_set_alpha): Likewise.
891 * gtkutil.c (get_utf8_string): Likewise.
892 * indent.c (check_display_width): Likewise.
893 * intervals.c (create_root_interval, rotate_right, rotate_left)
894 (split_interval_right, split_interval_left)
895 (adjust_intervals_for_insertion, delete_node)
896 (interval_deletion_adjustment, adjust_intervals_for_deletion)
897 (merge_interval_right, merge_interval_left, copy_intervals)
898 (set_intervals_multibyte_1): Likewise.
899 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
900 * keymap.c (Fkey_description): Likewise.
901 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
902 * lread.c (openp, read_integer, read1, string_to_number):
903 Likewise.
904 * menu.c (ensure_menu_items): Likewise.
905 * minibuf.c (read_minibuf_noninteractive): Likewise.
906 * print.c (printchar, strout): Likewise.
907 * process.c (create_process, Faccept_process_output)
908 (wait_reading_process_output, read_process_output, send_process)
909 (wait_reading_process_output): Likewise.
910 * profiler.c (make_log, handle_profiler_signal): Likewise.
911 * regex.c (re_exec): Likewise.
912 * regex.h: Likewise.
913 * search.c (looking_at_1, Freplace_match): Likewise.
914 * sysdep.c (get_child_status, procfs_ttyname)
915 (procfs_get_total_memory): Likewise.
916 * systime.h (EMACS_TIME_VALID_P): Likewise.
917 * term.c (dissociate_if_controlling_tty): Likewise.
918 * window.c (get_phys_cursor_glyph): Likewise.
919 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
920 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
921 Likewise.
922 * xfns.c (Fx_window_property): Likewise.
923 * xmenu.c (set_frame_menubar): Likewise.
924 * xselect.c (x_get_window_property, x_handle_dnd_message):
925 Likewise.
926 * xsmfns.c (smc_save_yourself_CB): Likewise.
927 * xterm.c (x_scroll_bar_set_handle): Likewise.
928
929 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
930
931 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
932 to be optional or nil. Adjust comment and convert it to docstring.
933 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
934 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
935
936 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
937
938 Static checking by GCC 4.8-20130319.
939 * image.c (gif_load): Assume pass < 3 to pacify GCC.
940 * process.c (Fset_process_datagram_address)
941 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
942 * xdisp.c (get_char_face_and_encoding):
943 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
944 (get_glyph_face_and_encoding): Prepare face before possibly using it.
945 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
946
947 2013-03-24 Ken Brown <kbrown@cornell.edu>
948
949 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
950 fix compilation on 64-bit Cygwin, where underscores are not
951 automatically prepended.
952
953 * w32term.c (w32_initialize): Silence compiler warning.
954
955 2013-03-23 Eli Zaretskii <eliz@gnu.org>
956
957 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
958 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
959 variables, to save and restore frame dimensions.
960 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
961 after returning from a 'fullscreen' configuration.
962 use SendMessage instead of PostMessage to send the SC_RESTORE message,
963 to avoid races between the main thread and the input thread.
964
965 * w32term.h (struct w32_output): New members normal_width,
966 normal_height, normal_top, normal_left, and prev_fsmode.
967 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
968 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
969 members of a frame.
970
971 * w32term.c (w32fullscreen_hook): Record last value of the frame's
972 'fullscreen' parameter. Always record previous width and height
973 of the frame, except when switching out of maximized modes, so
974 that they could be restored correctly, instead of resetting to the
975 default frame dimensions. Send SC_RESTORE command to the frame,
976 unless we are going to send SC_MAXIMIZE, to restore the frame
977 resize hints in the mouse pointer shown by the window manager.
978 (Bug#14032)
979
980 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
981
982 * lisp.h (get_frame_param): Adjust conditions for prototype
983 declaration.
984
985 2013-03-22 Ken Brown <kbrown@cornell.edu>
986
987 * unexcw.c: Drop unneeded inclusion of w32common.h.
988 (report_sheap_usage): Declare.
989 (read_exe_header): Add magic numbers for x86_64.
990 (fixup_executable): Fix printf format specifier for unsigned long
991 argument.
992
993 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
994
995 * frame.h (struct frame): Put menu_bar_window under #ifdef
996 because this member is not needed when X toolkit is in use.
997 (fset_menu_bar_window):
998 * dispnew.c (clear_current_matrices, clear_desired_matrices)
999 (free_glyphs, update_frame):
1000 * xdisp.c (expose_frame): Likewise.
1001 (display_menu_bar): Likewise. Remove redundant eassert.
1002 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
1003 toolkit is in use.
1004
1005 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
1006
1007 Use functions and constants to manipulate Lisp_Save_Value objects.
1008 This replaces code that used macros and strings and token-pasting.
1009 The change makes the C source a bit easier to follow,
1010 and shrinks the Emacs executable a bit.
1011 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
1012 (make_save_value): Change 1st arg from string to enum. All callers
1013 changed.
1014 (INTX): Remove.
1015 (mark_object): Use if, not #if, for GC_MARK_STACK.
1016 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
1017 (XSAVE_OBJECT): Now functions, not macros.
1018 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
1019 the constant was never used.
1020 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
1021 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
1022 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
1023 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
1024 New constants.
1025 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
1026 type3 with a single member save_type. All uses changed.
1027 (save_type, set_save_pointer, set_save_integer): New functions.
1028 * print.c (PRINTX): Remove.
1029
1030 * alloc.c: Remove redundant static declarations.
1031
1032 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1033
1034 * window.h (struct window): Convert left_col, top_line, total_lines
1035 and total_cols from Lisp_Objects to integers. Adjust comments.
1036 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
1037 Remove.
1038 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
1039 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
1040 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
1041 Adjust users where appropriate.
1042
1043 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1044
1045 * frame.h (struct frame): Drop resx and resy because the same data is
1046 available from window system-specific output context. Adjust users.
1047 (default_pixels_per_inch_x, default_pixels_per_inch_y):
1048 New functions to provide defaults when no window system available.
1049 (FRAME_RES_X, FRAME_RES_Y): New macros.
1050 (NUMVAL): Move from xdisp.c.
1051 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
1052 (Ffont_face_attributes, Fopen_font):
1053 * image.c (gs_load):
1054 * w32font.c (fill_in_logfont):
1055 * xdisp.c (calc_pixel_width_or_height):
1056 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
1057 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
1058
1059 2013-03-20 Kenichi Handa <handa@gnu.org>
1060
1061 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
1062 to 1 (temporary workaround until a bug related to ASCII
1063 optimization is fixed).
1064
1065 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
1066
1067 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
1068 Signal error if window is not internal. Adjust docstring.
1069 (delete_all_child_windows): Use combination_limit to save the buffer.
1070 (Fset_window_configuration): Adjust accordingly.
1071 * print.c (syms_of_print): Initialize debugging output not here...
1072 (init_print_once): ...but in a new function here.
1073 * lisp.h (init_print_once): Add prototype.
1074 * emacs.c (main): Add call to init_print_once. Adjust comments.
1075
1076 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
1077
1078 * window.c (window_resize_check, window_resize_apply)
1079 (window_from_coordinates, recombine_windows, set_window_buffer)
1080 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
1081 (Fsplit_window_internal, Fdelete_window_internal)
1082 (freeze_window_starts): Use bool for booleans.
1083 * window.h (window_frame_coordinates, resize_frame_windows)
1084 (freeze_window_starts, set_window_buffer): Adjust prototypes.
1085
1086 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
1087
1088 * dispnew.c (bitch_at_user): Use `user-error'.
1089
1090 2013-03-17 Ken Brown <kbrown@cornell.edu>
1091
1092 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
1093 as return type of image_background. (Bug#13981)
1094 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
1095
1096 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
1097
1098 * nsterm.m (updateFrameSize:): Change resize increments if needed.
1099 (ns_select): Don't return with result uninitialized.
1100
1101 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
1102 and getDirectory.
1103
1104 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
1105 New functions.
1106 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
1107 directories. If filename is nil, get directory name (Bug#13932).
1108 Use getFilename and getDirectory.
1109 (getFilename, getDirectory): New methods for EmacsSavePanel and
1110 EmacsOpenPanel.
1111 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
1112
1113 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
1114
1115 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1116
1117 2013-03-15 Kenichi Handa <handa@gnu.org>
1118
1119 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1120 (adjust_after_replace): Make it back to static. Delete the third
1121 arg text_at_gap_tail. Cancel the code for handling it.
1122
1123 * coding.h (struct coding_system): New member eol_seen.
1124
1125 * coding.c (detect_ascii): New function.
1126 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1127 when the source bytes are actually scanned. On detecting for
1128 coding_category_utf_8_auto, call detect_ascii instead of scanning
1129 source bytes directly.
1130 (produce_chars): Call insert_from_gap with the new arg 0.
1131 (encode_coding): Likewise.
1132 (decode_coding_gap): Control ASCII optimization by the variable
1133 disable_ascii_optimization instead of #ifndef .. #endif.
1134 Deccode EOL format according to coding->eol_seen.
1135 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1136 variable.
1137
1138 * lisp.h (adjust_after_replace): Cancel externing it.
1139 (insert_from_gap): Adjust prototype.
1140
1141 2013-03-15 Eli Zaretskii <eliz@gnu.org>
1142
1143 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1144 FULLSCREEN_MAXIMIZED. (Bug#13935)
1145
1146 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1147
1148 * region-cache.c (find_cache_boundary, move_cache_gap)
1149 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1150 Simplify debugging check and convert to eassert. Adjust comment.
1151 (pp_cache): Put under ENABLE_CHECKING.
1152
1153 2013-03-14 Eli Zaretskii <eliz@gnu.org>
1154
1155 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1156 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1157 and WM_ACTIVATEAPP.
1158 (w32fullscreen_hook): If the frame is visible, reset
1159 f->want_fullscreen flag after changing the frame size. If the
1160 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1161 (Bug#13953)
1162
1163 2013-03-13 Daniel Colascione <dancol@dancol.org>
1164
1165 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1166 too so that these builds can use Cygwin's file conversion
1167 functions. (We've been building and linking cygw32.o all along
1168 and just not using it.)
1169
1170 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1171
1172 File synchronization fixes (Bug#13944).
1173 * Makefile.in (LIB_FDATASYNC): New macro.
1174 (LIBES): Use it.
1175 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1176 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1177 Don't worry about HAVE_FSYNC, since a substitute fsync is
1178 available if the system lacks one.
1179 (Fwrite_regin): Retry fsync if interrupted.
1180
1181 2013-03-13 Eli Zaretskii <eliz@gnu.org>
1182
1183 * w32term.c (w32_read_socket): If the Emacs frame is being
1184 activated, call w32fullscreen_hook, to make sure the new frame
1185 dimensions are in effect. (Bug#13937)
1186
1187 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1188
1189 * xdisp.c (init_iterator): Simplify because both character and byte
1190 positions are either specified or -1. Add eassert. Adjust comment.
1191 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1192 character and byte positions can be obtained from marker.
1193
1194 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1195
1196 Static checking by Sun C 5.12.
1197 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1198 * bytecode.c (exec_byte_code):
1199 * dispnew.c (init_display):
1200 * eval.c (error):
1201 * fileio.c (Fsubstitute_in_file_name):
1202 * keyboard.c (Fevent_convert_list):
1203 * keymap.c (Fsingle_key_description):
1204 * term.c (maybe_fatal, fatal):
1205 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1206 * xsmfns.c (Fhandle_save_session):
1207 Omit unreachable code.
1208 * keymap.c (map_keymap_char_table_item): Cast void * to
1209 a function pointer type; the C Standard requires this.
1210
1211 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1212 Include <sys/param.h> unconditionally, as that works elsewhere and
1213 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1214 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1215 and FreeBSD now.
1216
1217 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1218
1219 * insdel.c (adjust_after_replace): Use bool for boolean.
1220
1221 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1222
1223 * keyboard.c: Move keyboard decoding to read_key_sequence.
1224 (decode_keyboard_code): Remove.
1225 (tty_read_avail_input): Don't try to decode input.
1226 (read_decoded_char): New function.
1227 (read_key_sequence): Use it.
1228
1229 2013-03-10 Daniel Colascione <dancol@dancol.org>
1230
1231 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1232 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1233 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1234 w32fns.c.
1235
1236 * w32term.c (construct_drag_n_drop): Use the above macros to make
1237 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1238
1239 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1240 properly display non-ASCII frame titles in cygw32 builds.
1241
1242 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1243 call ShellExecute in cygw32 builds.
1244
1245 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1246 common file dialog code.
1247
1248 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1249 can just use du like other systems.
1250
1251 * coding.c (from_unicode_buffer): Declare.
1252 * coding.c (from_unicode_buffer): Implement.
1253
1254 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1255
1256 * lread.c: Minor cleanup.
1257 (FROM_FILE_P): New macro.
1258 (skip_dyn_bytes, unreadchar, read1): Use it.
1259 (read_list): Consolidate duplicated code.
1260
1261 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1262
1263 2013-03-10 Eli Zaretskii <eliz@gnu.org>
1264
1265 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1266 (redisplay_internal, set_cursor_from_row, try_window)
1267 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1268 (display_line, notice_overwritten_cursor)
1269 (mouse_face_from_buffer_pos, note_mouse_highlight):
1270 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1271 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1272 (mouse_face_from_string_pos, fast_find_string_pos):
1273 Use MATRIX_ROW_VPOS.
1274
1275 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1276
1277 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1278
1279 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1280 MATRIX_MODE_LINE_ROW.
1281
1282 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1283
1284 2013-03-10 handa <handa@gnu.org>
1285
1286 * lisp.h (adjust_after_replace): Extern it.
1287
1288 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1289 case of detection for coding_category_utf_8_auto.
1290 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1291 Skip decoding if all bytes are ASCII.
1292
1293 * insdel.c (adjust_after_replace): Make it public. New arg
1294 text_at_gap_tail.
1295 (adjust_after_insert): Call adjust_after_replace with the new arg
1296 value 0.
1297
1298 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1299
1300 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1301 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1302 from Elisp via unread-command-events.
1303
1304 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1305 functions to mean "no change".
1306
1307 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1308
1309 region-cache.c, scroll.c, search.c: Use bool for booleans.
1310 * lisp.h (compile_pattern):
1311 * scroll.c (do_scrolling, do_direct_scrolling):
1312 * search.c (struct regexp_cache, compile_pattern_1)
1313 (compile_pattern, string_match_1, search_command)
1314 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1315 (search_regs_saved, Fregexp_quote):
1316 Use bool for boolean.
1317 * region-cache.c (region_cache_forward, region_cache_backward):
1318 Fix comments to match code: these functions return int, not boolean.
1319
1320 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1321
1322 * search.c (find_newline): Accept start and end byte positions
1323 as arguments and allow -1 if not known.
1324 (find_newline_no_quit): Likewise for start position.
1325 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1326 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1327 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1328 * editfns.c (Fconstrain_to_field): Break long line.
1329 Adjust call to find_newline.
1330 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1331 Use DEC_BOTH to start next search from the previous buffer
1332 position, where appropriate.
1333 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1334 (get_visually_first_element, move_it_vertically_backward): Likewise.
1335 Obtain byte position from the display iterator, where appropriate.
1336
1337 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1338
1339 print.c, process.c: Use bool for booleans.
1340 * lisp.h (wait_reading_process_output):
1341 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1342 (strout, debug_output_compilation_hack, float_to_string, print)
1343 (print_object):
1344 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1345 (decode_status, status_message, create_process, create_pty)
1346 (Fmake_network_process, Fnetwork_interface_info)
1347 (wait_reading_process_output, read_process_output)
1348 (write_queue_push, write_queue_pop, process_send_signal)
1349 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1350 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1351 Use bool for booleans.
1352 * process.c (Fnetwork_interface_list): Remove unused local.
1353 (connect_counter): Now EMACS_INT, not int.
1354
1355 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1356
1357 * bidi.c (bidi_fetch_char): Swap first and second arguments
1358 to match other functions accepting character and byte positions.
1359 Adjust comment.
1360 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1361 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1362 when you need just to move to the previous buffer position.
1363 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1364
1365 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1366
1367 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1368
1369 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1370
1371 Avoid character to byte conversions in motion subroutines.
1372 * indent.h (compute_motion, vmotion): Add byte position argument.
1373 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1374 Add eassert.
1375 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1376 Use list5 for return value.
1377 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1378 Adjust comments, style and calls to compute_motion.
1379 (Fvertical_motion): Adjust call to vmotion.
1380 * window.c (Fdelete_other_windows_internal): Record window start
1381 byte position and adjust call to vmotion.
1382 (window_scroll_line_based): Likewise with call to compute_motion.
1383 Use SET_PT_BOTH.
1384 (Frecenter): Adjust calls to vmotion.
1385
1386 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1387
1388 * lisp.h (list2i, list3i): New functions.
1389 (list4i): Move from window.c and make LISP_INLINE.
1390 * editfns.c (make_lisp_time):
1391 * fns.c (Flocale_info):
1392 * keyboard.c (parse_modifiers):
1393 * xterm.c (x_ewmh_activate_frame): Use list2i.
1394 * instel.c (signal_after_change):
1395 * nsfns.m (Fx_server_version, Fxw_color_values):
1396 * w32fns.c (Fxw_color_values, Fx_server_version):
1397 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1398 * fileio.c (Fvisited_file_modtime):
1399 * nsfns.m (Fns_display_usable_bounds):
1400 * w32.c (ltime): Use list4i.
1401
1402 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1403
1404 * search.c (find_newline_no_quit): Rename from find_next_newline.
1405 Add commentary.
1406
1407 * lisp.h (find_newline_no_quit): Rename prototype.
1408
1409 * xdisp.c (back_to_previous_line_start)
1410 (forward_to_next_line_start, get_visually_first_element)
1411 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1412 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1413 * bidi.c (bidi_find_paragraph_start): Callers of
1414 find_newline_no_quit changed.
1415
1416 * msdos.c: Change encoding to cp850. (Bug#13879)
1417 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1418
1419 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1420
1421 Coding system support cleanup and minor refactoring.
1422 * coding.h (enum coding_result_code): Remove
1423 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1424 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1425 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1426 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1427 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1428 (decode_coding_region, encode_coding_region, decode_coding_string):
1429 Remove unused compatibility macros.
1430 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1431 (record_conversion_result): Adjust user.
1432 (syms_of_coding): Likewise.
1433 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1434 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1435 (decode_coding_object): Simplify since xrealloc never returns NULL.
1436 Add eassert.
1437
1438 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1439
1440 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1441 * sysdep.c (list_system_processes)
1442 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1443 Make it a stub in this case; otherwise the build might fail,
1444 and this code hasn't been tested on such hosts anyway.
1445 Problem reported by Nelson H. F. Beebe in
1446 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1447 and analyzed by Jérémie Courrèges-Anglas in
1448 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1449
1450 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1451
1452 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1453 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1454 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1455 * bidi.c (bidi_find_paragraph_start): Likewise.
1456 * indent.c (vmotion): Likewise.
1457
1458 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1459
1460 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1461 * filelock.c: Include <c-ctype.h>.
1462 (MAX_LFINFO): New top-level constant.
1463 (lock_info_type): Remove members pid, boot_time. Add members at,
1464 dot, colon. Change user member to be the entire buffer, not a
1465 pointer. This allows us to handle the case where a foreign
1466 pid or boot time exceeds the local range. All uses changed.
1467 (LINKS_MIGHT_NOT_WORK): New constant.
1468 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1469 (defined_WINDOWSNT): Remove.
1470 (MAKE_LOCK_NAME, file_in_lock_file_name):
1471 Always use .#FILE (not .#-FILE) for the file lock,
1472 even if it is a regular file.
1473 (rename_lock_file): New function.
1474 (create_lock_file): Use it.
1475 (create_lock_file, read_lock_data):
1476 Prefer a symbolic link for the lock file, falling back on a
1477 regular file if symlinks don't work. Do not try to create
1478 symlinks on MS-Windows, due to security hassles. Stick with
1479 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1480 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1481 host may be using a Windowsish file system, and cannot use
1482 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1483 doesn't work. Don't fail merely because of a symlink-contents
1484 length limit in the current file system; fall back on regular
1485 files. Increase the symlink contents length limit to 8 KiB, this
1486 should be big enough for any real use and doesn't crunch the
1487 stack.
1488 (create_lock_file, lock_file_1, read_lock_data):
1489 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1490 (lock_file_1): Return error number, not bool. All callers changed.
1491 (ELOOP): New macro, if not already defined.
1492 (read_lock_data): Return size of lock file contents, not Lisp object.
1493 All callers changed. Handle a race condition if some other process
1494 replaces a regular-file lock with a symlink lock or vice versa,
1495 while we're trying to read the lock.
1496 (current_lock_owner): Parse contents more carefully, to help avoid
1497 confusing a regular-file lock with some other application's use
1498 of the file. Check for lock file contents being too long, or
1499 not parsing correctly.
1500 (current_lock_owner, lock_file):
1501 Allow foreign pid and boot times that exceed the local range.
1502 (current_lock_owner, lock_if_free, lock_file):
1503 Simplify allocation of lock file contents.
1504 * w32.c (sys_rename_replace): New function, containing most of
1505 the contents of the old sys_rename.
1506 (sys_rename): Use it.
1507 (fchmod): New dummy function.
1508 * w32.h (sys_rename_replace, fchmod): New decls.
1509
1510 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1511
1512 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1513 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1514 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1515 <dmantipov@yandex.ru>.
1516
1517 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1518
1519 * composite.c (get_composition_id, fill_gstring_header):
1520 Use make_uninit_vector where appropriate.
1521 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1522 * xselect.c (clean_local_selection_data): Likewise.
1523
1524 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1525
1526 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1527 * image.c (imagemagick_load_image): Calculate height and width
1528 after flattening the image, not before.
1529
1530 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1531
1532 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1533 * ftfont.c (ftfont_shape_by_flt): Likewise.
1534 * w32uniscribe.c (uniscribe_shape): Likewise.
1535
1536 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1537
1538 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1539 The old approach, which fell back on DIR/.#FILE.0 through
1540 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1541 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1542 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1543 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1544 because the locking mechanism was never reliable in that case).
1545 This patch fixes this and other bugs discovered by a code
1546 inspection that was prompted by
1547 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1548 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1549 to avoid interoperability problems between the MS-Windows and
1550 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1551 instances of Emacs now ignore each others' locks.
1552 * filelock.c (defined_WINDOWSNT): New constant.
1553 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1554 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1555 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1556 regular files on MS-Windows hosts.
1557 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1558 Use SAFE_ALLOCA to avoid problems with long file names.
1559 (MAX_LFINFO): Now a local constant, not a global macro.
1560 (IS_LOCK_FILE): Remove.
1561 (lock_file_1): Don't inspect errno if symlink call succeeds;
1562 that's not portable.
1563 (lock_file): Document that this function can return if lock
1564 creation fails.
1565 (lock_file): Don't access freed storage.
1566
1567 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1568
1569 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1570
1571 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1572
1573 * textprop.c: Use bool for booleans.
1574 (validate_interval_range, Fadd_text_properties)
1575 (Fremove_text_properties): Prefer bool to int when either works.
1576
1577 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1578
1579 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1580 If the interval tree changes as a side effect of calling
1581 modify_region, re-do processing starting from the call to
1582 validate_interval_range. (Bug#13743)
1583
1584 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1585
1586 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1587 (Bug#13546).
1588
1589 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1590
1591 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1592 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1593 access to the lock file until it is written and closed.
1594 (Bug#13807)
1595
1596 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1597
1598 * callint.c (Qcall_interactively):
1599 * macros.c (Qexecute_kbd_macro):
1600 Now static.
1601
1602 2013-02-26 Bastien Guerry <bzg@gnu.org>
1603
1604 * window.c (Frecenter): Tiny docstring enhancement.
1605
1606 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1607
1608 Minor textprop integer cleanup.
1609 * intervals.h, textprop.c (add_text_properties_from_list):
1610 Return void, not int, since nobody uses the return value.
1611 * textprop.c (validate_plist, add_properties, remove_properties)
1612 (Fadd_text_properties):
1613 Don't assume list length fits in int.
1614 (interval_has_all_properties, interval_has_some_properties)
1615 (interval_has_some_properties_list, add_properties, remove_properties)
1616 (Fadd_text_properties, Fremove_text_properties)
1617 (Fremove_list_of_text_properties, text_property_stickiness):
1618 Use bool for booleans.
1619 (Fadd_text_properties, Fremove_text_properties):
1620 (Fremove_list_of_text_properties):
1621 Reindent do-while as per GNU style.
1622
1623 2013-02-25 Eli Zaretskii <eliz@gnu.org>
1624
1625 Implement CLASH_DETECTION for MS-Windows.
1626
1627 * filelock.c [WINDOWSNT]: Include w32.h.
1628 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1629 function of that name. Up-case the macro arguments.
1630 (IS_LOCK_FILE): New macro.
1631 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1632 (create_lock_file): New function, with body extracted from
1633 lock_file_1.
1634 [WINDOWSNT]: Implement lock files by writing a regular file with
1635 the lock information as its contents.
1636 (read_lock_data): New function, on Posix platforms just calls
1637 emacs_readlinkat.
1638 [WINDOWSNT]: Read the lock info from the file.
1639 (current_lock_owner): Call read_lock_data instead of calling
1640 emacs_readlinkat directly.
1641 (lock_file) [WINDOWSNT]: Run the file name through
1642 dostounix_filename.
1643
1644 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1645 just check if the process by that PID exists.
1646
1647 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1648 also present, as doing so will fail to error out if the file
1649 already exists.
1650
1651 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1652
1653 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1654 (Fremove_list_of_text_properties): Skip all of the intervals in
1655 the region between START and END that already have resp. don't
1656 have the requested properties, not just the first one.
1657 Add assertions that the loop afterwards always modifies the
1658 properties. (Bug#13743)
1659
1660 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1661
1662 * callint.c (Fcall_interactively): Use the right lexical environment
1663 for `interactive' specs (bug#13811).
1664 * eval.c (Feval): Accept a lexical environment.
1665
1666 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1667
1668 Simplify data_start configuration (Bug#13783).
1669 This is a followon simplification to the fix for Bug#13650.
1670 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1671 (START_FILES): Remove. All uses removed.
1672 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1673 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1674 (buildobj.h): Use it.
1675 ($(ALLOBJS)): Depend on globals.h.
1676 (temacs$(EXEEXT)): Use $(ALLOBJS).
1677 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1678 * deps.mk (vm-limit.o):
1679 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1680 Do not depend on mem-limits.h.
1681 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1682 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1683 [__GNUC__ && !ORDINARY_LINK]: Remove.
1684 * mem-limits.h, pre-crt0.c: Remove.
1685 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1686 * unexcoff.c (etext): New decl.
1687 (make_hdr): Use DATA_START instead of start_of_data.
1688 * vm-limit.c: Move most of mem-limits.h's contents here.
1689 (data_start): New decl. It's OK if this is approximate,
1690 so simplify-away some unnecessary exactness.
1691 (POINTER): Remove; all uses removed.
1692 (data_space_start): Now char *, to avoid casts.
1693 (exceeds_lisp_ptr): New function, replacing the old
1694 EXCEEDS_LISP_PTR macro. All uses changed.
1695 (check_memory_limits): Simplify and remove casts.
1696 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1697 (memory_warnings): Use data_start instead of start_of_data.
1698
1699 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1700
1701 * xdisp.c (set_message): Only check for debug-on-message if STRING
1702 is a string. (Bug#13797)
1703
1704 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1705
1706 Fix regression introduced by July 10 filelock.c patch.
1707 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1708 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1709 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1710 and diagnosed by Andreas Schwab in
1711 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1712
1713 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1714
1715 Assume C89 or better.
1716 * ralloc.c (SIZE, POINTER, NIL):
1717 * vm-limit.c (POINTER):
1718 Remove, replacing all uses with C89 equivalents. These old
1719 symbols were present only for porting to pre-C89 platforms.
1720
1721 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
1722
1723 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1724 This avoids warning messages reported as part of Bug#13546.
1725
1726 2013-02-21 Ken Brown <kbrown@cornell.edu>
1727
1728 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1729
1730 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1731
1732 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1733
1734 * keyboard.c (Qcommand_execute): New var.
1735 (command_loop_1, read_char): Use it.
1736 (Fcommand_execute): Remove, replace by an Elisp implementation.
1737 (syms_of_keyboard): Adjust accordingly.
1738
1739 2013-02-19 Daniel Colascione <dancol@dancol.org>
1740
1741 * sheap.c (report_sheap_usage): Use message, not message1, so
1742 that we don't try to create a buffer while we're in the middle
1743 of dumping Emacs. Explain why.
1744
1745 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
1746
1747 * search.c (find_newline): Return byte position in bytepos.
1748 Adjust comment.
1749 (find_next_newline_no_quit, find_before_next_newline):
1750 Add bytepos argument.
1751 * lisp.h (find_newline, find_next_newline_no_quit)
1752 (find_before_next_newline): Adjust prototypes.
1753 * bidi.c (bidi_find_paragraph_start):
1754 * editfns.c (Fconstrain_to_field, Fline_end_position):
1755 * indent.c (compute_motion, vmotion):
1756 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1757 (get_visually_first_element, move_it_vertically_backward):
1758 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1759
1760 2013-02-19 Eli Zaretskii <eliz@gnu.org>
1761
1762 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1763 resources were not orderly released.
1764
1765 2013-02-17 Eli Zaretskii <eliz@gnu.org>
1766
1767 * xdisp.c (x_draw_vertical_border): For a window that is neither
1768 the leftmost nor the rightmost, redraw both the left and the right
1769 vertical borders. (Bug#13723)
1770
1771 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1772
1773 * xml.c (init_libxml2_functions):
1774 * sound.c (sound_warning):
1775 * sheap.c (report_sheap_usage):
1776 * process.c (wait_reading_process_output):
1777 * msdos.c (XMenuActivate):
1778 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1779 * keyboard.c (top_level_1):
1780 * editfns.c (Fmessage, Fmessage_box):
1781 * callint.c (Fcall_interactively):
1782 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1783
1784 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1785
1786 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
1787 * frame.c (syms_of_frame): ... to here.
1788
1789 2013-02-16 Eli Zaretskii <eliz@gnu.org>
1790
1791 * w32.c (sys_chown): Remove unused function.
1792
1793 * w32term.c <input_signal_count>: Declare 'volatile'
1794 unconditionally. (Bug#9066)
1795
1796 * w32.c (set_errno): Reset h_errno and don't set it to any other
1797 value. Set errno instead.
1798 (check_errno): Reset h_errno.
1799 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1800 (sys_gethostname, sys_getservbyname, sys_getpeername)
1801 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1802 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1803 h_errno.
1804 (sys_gethostbyname): Set h_errno only errors detected.
1805
1806 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1807
1808 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1809
1810 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1811
1812 * keyboard.c (read_char): Fix calculation of auto-save time out
1813 when auto-save-timeout is less than 4. (Bug#13720)
1814
1815 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
1816 time. Improve diagnostics in DebPrint. (Bug#13546)
1817
1818 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1819 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1820 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1821 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1822 make sure errno is set to an appropriate value. (Bug#13546)
1823 (socket_to_fd): Add assertion against indexing fd_info[] with a
1824 value that is out of bounds.
1825 (sys_accept): If fd is negative, do not set up the child_process
1826 structure for reading.
1827
1828 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1829
1830 * composite.c (fill_gstring_header): Remove useless prototype.
1831 Break long line.
1832 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1833 * print.c (PRINTDECLARE, print_object):
1834 * search.c (compile_pattern, fast_looking_at, search_buffer):
1835 (simple_search, boyer_moore, Freplace_match):
1836 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1837 (get_overlay_arrow_glyph_row, display_mode_element):
1838 (decode_mode_spec_coding, message3):
1839 * xfaces.c (face_at_string_position): Use bool for booleans.
1840 Adjust comments.
1841
1842 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1843
1844 Fix AIX port (Bug#13650).
1845 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1846 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1847 was #undeffed earlier, so it cannot be used as a macro here.
1848 Use the constant and not the macro.
1849
1850 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1851
1852 * w32proc.c (new_child): If no vacant slots are found in
1853 child_procs[], make another pass looking for slots whose process
1854 has exited or died. (Bug#13546)
1855
1856 * w32.c (sys_pipe): When failing due to file descriptors above
1857 MAXDESC, set errno to EMFILE.
1858 (_sys_read_ahead): Update cp->status when failing to read serial
1859 communications input, so that the status doesn't stay at
1860 STATUS_READ_IN_PROGRESS. (Bug#13546)
1861
1862 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1863
1864 * gtkutil.c (tb_size_cb): New function.
1865 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1866
1867 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1868
1869 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1870 an event.
1871
1872 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1873
1874 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1875
1876 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1877
1878 * font.c (font_range): Add pos_byte argument. Adjust comment
1879 and break long line.
1880 * font.h (font_range): Adjust prototype.
1881 * composite.c (autocmp_chars): Pass byte position to font_range.
1882 Break long line. Remove useless prototype and format comment.
1883
1884 2013-02-13 Glenn Morris <rgm@gnu.org>
1885
1886 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1887
1888 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1889
1890 Improve AIX port some more (Bug#13650).
1891 With this, it should be as good as it was in 23.3, though it's
1892 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1893 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1894 * unexaix.c (start_of_text): Remove.
1895 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1896 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1897 (orig_load_scnptr, orig_data_scnptr):
1898 Now off_t, not long, since they are file offsets.
1899 (make_hdr): Use _data, not start_of_data ().
1900 This is the key part of the fix.
1901 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1902 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1903
1904 * pre-crt0.c (data_start): Initialize to 1.
1905 This ports to compilers that optimize the external declaration
1906 'int x = 0;' as if it were 'int x;' to shrink the executable.
1907
1908 Improve AIX port (Bug#13650).
1909 This doesn't fix the bug, but it makes progress: Emacs builds now.
1910 * unexaix.c: Include inttypes.h, stdarg.h.
1911 (report_error, report_error_1): Mark as _Noreturn.
1912 (report_error): Don't report the wrong errno.
1913 (report_error_1): Now varargs. All callers changed.
1914 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1915 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1916 (write_ptr): Use %p to print address rather than %lx and a cast
1917 to unsigned long. Grow buffer a bit, to be safer.
1918
1919 2013-02-13 Eli Zaretskii <eliz@gnu.org>
1920
1921 * bidi.c (bidi_resolve_neutral): After finding the next
1922 non-neutral character, accept NEUTRAL_ON type as well, because
1923 directional control characters, such as LRE and RLE, have their
1924 type converted to that by bidi_resolve_weak. This avoids aborts
1925 when LRE/RLE follows a run of neutrals.
1926 (bidi_move_to_visually_next): Assert that return value of
1927 bidi_peek_at_next_level is non-negative. Negative values will
1928 cause an infloop.
1929
1930 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1931
1932 Minor getenv-related fixes.
1933 * callproc.c (Fcall_process_region) [!DOS_NT]:
1934 Avoid unnecessary duplicate call to getenv.
1935 * callproc.c (init_callproc):
1936 * dispnew.c (init_display):
1937 * sysdep.c (sys_subshell):
1938 Omit unnecessary cast of getenv or egetenv.
1939
1940 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
1941
1942 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1943 Update dependencies.
1944
1945 2013-02-12 Eli Zaretskii <eliz@gnu.org>
1946
1947 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1948 marker's position.
1949 (display_line): Set w->region_showing to the value of
1950 it->region_beg_charpos, not to -1. This fixes redisplay
1951 optimization when cursor is moved up after M->. (Bug#13623)
1952 (Bug#13626)
1953 (try_scrolling): Scroll text up more if point is too close to ZV
1954 and inside the scroll margin. This makes sure point is moved
1955 outside the scroll margin in these cases.
1956
1957 * window.h (struct window): region_showing can no longer be
1958 negative.
1959
1960 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1961
1962 Tune by using memchr and memrchr.
1963 * doc.c (Fsnarf_documentation):
1964 * fileio.c (Fsubstitute_in_file_name):
1965 * search.c (find_newline, scan_newline):
1966 * xdisp.c (pos_visible_p, display_count_lines):
1967 Use memchr and memrchr rather than scanning byte-by-byte.
1968 * search.c (find_newline): Rename from scan_buffer.
1969 Omit first arg TARGET, as it's always '\n'. All callers changed.
1970
1971 Clean up read_key_sequence a tiny bit more.
1972 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1973 (read_key_sequence): Remove unused locals.
1974
1975 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1976
1977 Clean up read_key_sequence a bit; reread active keymaps after first event.
1978 * keyboard.c (read_char, read_char_x_menu_prompt)
1979 (read_char_minibuf_menu_prompt):
1980 Replace nmaps+maps with a single `map' arg.
1981 (follow_key): Operate on a single map.
1982 (active_maps): New function.
1983 (test_undefined): Also return true for nil bindings.
1984 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1985 a single (composed) keymap. Remember `first_event' to choose the right
1986 set of active keymaps. Recompute the set of keymaps after receiving
1987 the first event. Remove GOBBLE_FIRST_EVENT.
1988 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1989 * keyboard.h (read_char): Update declaration.
1990 * lread.c (read_filtered_event): Adjust call to read_char.
1991
1992 2013-02-11 Eli Zaretskii <eliz@gnu.org>
1993
1994 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1995 Don't use the limitation on backwards movement when lines are truncated
1996 in the window. (Bug#13675)
1997
1998 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1999
2000 * marker.c (set_marker_internal): If desired position is passed
2001 as a marker, avoid call to buf_charpos_to_bytepos.
2002 * window.c (Fset_window_point): Omit redundant type checking.
2003 (Fset_window_start): Likewise. Format comment.
2004 (window_scroll_pixel_based): Use set_marker_restricted_both
2005 with character and byte positions obtained from an iterator.
2006 (Fset_window_configuration): Use set_marker_restricted_both.
2007 * xdisp.c (message_dolog): Likewise.
2008
2009 2013-02-10 Eli Zaretskii <eliz@gnu.org>
2010
2011 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2012 When text lines are longer than window's screen lines, don't move back
2013 too far. This speeds up some redisplay operations. (Bug#13675)
2014
2015 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
2016
2017 * syntax.c (scan_sexps_forward): Fix byte position calculation
2018 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
2019
2020 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
2021
2022 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
2023 that was not needed.
2024
2025 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
2026
2027 Minor hashing refactoring.
2028 * fns.c (SXHASH_REDUCE): Move to lisp.h.
2029 (sxhash_float): Return EMACS_UINT, for consistency with the other
2030 hash functions.
2031 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
2032 non-static inline function and therefore can't use static vars.
2033 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
2034 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
2035 with the other hash functions.
2036
2037 2013-02-09 Eli Zaretskii <eliz@gnu.org>
2038
2039 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2040 XXXXXX part of the temporary file pattern is not downcased even
2041 when w32-downcase-file-names is non-nil. (Bug#13661)
2042
2043 * xdisp.c (decode_mode_spec): Remove handling of %t.
2044
2045 * msdos.c (careadlinkatcwd): Remove.
2046
2047 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2048
2049 * lread.c (skip_dyn_bytes): New function (bug#12598).
2050 (read1): Use it. Use getc instead of READCHAR to read bytes.
2051 (load_each_byte): Remove. Update users.
2052
2053 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2054
2055 * search.c (scan_buffer): Calculate end byte position just once.
2056 (scan_newline): Do not recalculate start_byte.
2057 (search_command): Use eassert.
2058 * syntax.c (struct lisp_parse_state): New member location_byte.
2059 (scan_sexps_forward): Record from_byte and avoid redundant
2060 character to byte position calculation ...
2061 (Fparse_partial_sexp): ... here. Break too long line.
2062
2063 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2064
2065 * lisp.h (make_uninit_vector): New function.
2066 * alloc.c (Fvector, Fmake_byte_code):
2067 * ccl.c (Fregister_ccl_program):
2068 * charset.c (Fdefine_charset_internal, define_charset_internal):
2069 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2070 * composite.c (syms_of_composite):
2071 * font.c (Fquery_font, Ffont_info, syms_of_font):
2072 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2073 * ftfont.c (ftfont_shape_by_flt):
2074 * indent.c (recompute_width_table):
2075 * nsselect.m (clean_local_selection_data):
2076 * syntax.c (init_syntax_once):
2077 * w32unsubscribe.c (uniscribe_shape):
2078 * window.c (Fcurrent_window_configuration):
2079 * xfaces.c (Fx_family_fonts):
2080 * xselect.c (selection_data_to_lisp_data): Use it.
2081
2082 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2083
2084 * coding.c (Fdefine_coding_system_internal): Use AREF where
2085 argument is known to be a vector.
2086 * fns.c (Flocale_info): Likewise for ASET.
2087 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2088 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2089
2090 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2091
2092 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2093 height.
2094
2095 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2096 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2097 updateCollectionBehaviour.
2098
2099 * nsterm.m (NEW_STYLE_FS): Remove.
2100 (ns_last_use_native_fullscreen): New variable.
2101 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2102 (x_set_window_size): Do not take title bar and tool bar into account
2103 if isFullscreen returns YES.
2104 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2105 (check_native_fs): New function.
2106 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2107 (ns_term_init): Remove NEW_STYLE_FS.
2108 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2109 and tool bar if isFullscreen returns NO.
2110 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2111 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2112 with HAVE_NATIVE_FS.
2113 (window:willUseFullScreenPresentationOptions:): New method.
2114 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2115 Hide toolbar if not enabled (Bug#13444).
2116 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2117 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2118 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2119 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2120 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2121 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2122 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2123 (syms_of_nsterm): Add ns-use-native-fullscreen.
2124
2125 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2126
2127 * fileio.c (Qchoose_write_coding_system): Now static.
2128
2129 2013-02-04 Eli Zaretskii <eliz@gnu.org>
2130
2131 * xdisp.c (window_buffer_changed): region_showing can be negative,
2132 which still means region is being displayed.
2133 (redisplay_internal): Resurrect code that forced redisplay of the
2134 whole window when showing region and the mark has changed.
2135 Record the new mark position to allow redisplay optimizations.
2136 (display_line): If it->region_beg_charpos is non-zero, set the
2137 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2138
2139 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2140 not bitfield of 1 bit.
2141
2142 2013-02-03 Daniel Colascione <dancol@dancol.org>
2143
2144 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2145 daemon mode works on cygw32 when Emacs is installed and not just
2146 during development.
2147
2148 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2149
2150 Avoid file time stamp bug on MS-Windows (Bug#13149).
2151 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2152 as FAT32 doesn't update time stamps when truncating them.
2153 Also, check that a file time stamp is not a multiple of 100 ns;
2154 this should catch all instances of the problem on MS-Windows,
2155 as its native file system resolution is 100 ns or worse, and
2156 checking for a non-multiple of 100 ns should impose only a small
2157 overhead on systems with ns resolution.
2158
2159 2013-02-02 Eli Zaretskii <eliz@gnu.org>
2160
2161 Avoid encoding file names on MS-Windows when they need to be run
2162 through dostounix_filename.
2163 * w32.c (normalize_filename): Accept an additional argument
2164 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2165 downcase it even if w32-downcase-file-names is non-nil.
2166 (dostounix_filename): Accept an additional argument MULTIBYTE and
2167 pass it to normalize_filename.
2168 (emacs_root_dir): Adjust.
2169
2170 * msdos.h (dostounix_filename): Adjust prototype.
2171
2172 * w32.h (dostounix_filename): Adjust prototype.
2173
2174 * msdos.c (dostounix_filename): Accept an additional argument and
2175 ignore it.
2176 (init_environment): Adjust callers of dostounix_filename.
2177
2178 * fileio.c (Ffile_name_directory, file_name_as_directory)
2179 (directory_file_name, Fexpand_file_name)
2180 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2181 dostounix_filename.
2182 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2183 non-nil.
2184 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2185 variables, as egetenv is case-insensitive for DOS_NT.
2186
2187 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2188 with an encoded file name.
2189
2190 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2191 Adjust calls to dostounix_filename.
2192
2193 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2194
2195 * unexw32.c (unexec): Adjust call to dostounix_filename.
2196
2197 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2198
2199 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2200 dostounix_filename.
2201
2202 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2203 dostounix_filename.
2204
2205 * callproc.c (Fcall_process): Make sure program name in PATH and
2206 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2207 is passed to exec/spawnve, which fails unless the file-name
2208 encoding is UTF-8.
2209
2210 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2211 even if w32-quote-process-args is nil.
2212
2213 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2214
2215 Fix timestamp bug when write-region appends nothing (Bug#13149).
2216 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2217 the file's time stamp doesn't change if Emacs happens to write nothing
2218 to the file, and on a buggy file system this could cause Emacs to
2219 incorrectly infer that the file system doesn't have the bug.
2220 Avoid this problem by inhibiting the inference in this case.
2221
2222 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2223
2224 * window.h (struct window): Convert base_line_number, base_line_pos
2225 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2226 Convert region_showing member from Lisp_Object to bitfield.
2227 Remove sequence_number member. Adjust comments.
2228 * window.c (sequence_number): Remove.
2229 (make_window): Initialize column_number_displayed.
2230 * print.c (print_object): Follow the printed representation of
2231 frames and print window pointer to distinguish between windows.
2232 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2233 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2234 (wset_column_number_displayed, wset_region_showing): Remove.
2235 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2236 (try_scrolling, try_cursor_movement, redisplay_window)
2237 (try_window_reusing_current_matrix, try_window_id, display_line)
2238 (display_mode_lines, decode_mode_spec): Adjust users.
2239 * .gdbinit (pwinx): Do not print sequence_number.
2240
2241 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2242
2243 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2244 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2245 * dired.c: Include <fcntl.h>.
2246 (open_directory): New function, which uses open and fdopendir
2247 rather than opendir. DOS_NT platforms still use opendir, though.
2248 (directory_files_internal, file_name_completion): Use it.
2249 (file_attributes): New function, with most of the old Ffile_attributes.
2250 (directory_files_internal, Ffile_attributes): Use it.
2251 (file_attributes, file_name_completion_stat): First arg is now fd,
2252 not dir name. All uses changed. Use fstatat rather than lstat +
2253 stat.
2254 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2255 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2256 (emacs_readlinkat): New function, with much of the old
2257 Ffile_symlink_p, but with an fd argument for speed.
2258 It uses readlinkat rather than careadlinkatcwd, so that it
2259 need not assume the working directory.
2260 (Ffile_symlink_p): Use it.
2261 * filelock.c (current_lock_owner): Use emacs_readlinkat
2262 rather than emacs_readlink.
2263 * lisp.h (emacs_readlinkat): New decl.
2264 (READLINK_BUFSIZE, emacs_readlink): Remove.
2265 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2266 (emacs_norealloc_allocator, emacs_readlink): Remove.
2267 This stuff is moved to fileio.c.
2268 * w32.c (fstatat, readlinkat): New functions.
2269 (careadlinkat): Don't check that fd == AT_FDCWD.
2270 (careadlinkatcwd): Remove; no longer needed.
2271
2272 2013-01-31 Glenn Morris <rgm@gnu.org>
2273
2274 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2275 (Fwrite_region): Update for new choose_write_coding_system args.
2276 Move the last piece of choose_write_coding_system here. (Bug#13522)
2277 (syms_of_fileio): Add choose-write-coding-system.
2278
2279 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2280
2281 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2282 (sys_close): Zero out the flags for the file descriptor before
2283 closing it. (Bug#13546)
2284
2285 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2286 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2287 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2288 DBCS. (Bug#13553)
2289
2290 * w32.c (w32_get_long_filename, init_environment, readlink):
2291 Support file names encoded in DBCS codepages.
2292 (readlink): Use the current file-name-coding-system, not the ANSI
2293 codepage, to decode and handle targets of symlinks.
2294
2295 2013-01-28 Eli Zaretskii <eliz@gnu.org>
2296
2297 * w32.c (opendir): Now accepts a 'const char *'.
2298
2299 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2300
2301 Remove obsolete redisplay code. See the discussion at
2302 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2303 * dispnew.c (preemption_period, preemption_next_check): Remove.
2304 (Vredisplay_preemption_period): Likewise.
2305 (update_frame, update_single_window, update_window, update_frame_1):
2306 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2307 used, following the 2012-06-22 change.
2308
2309 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2310
2311 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2312
2313 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2314
2315 * font.c (num_fonts): Remove the leftover from old
2316 debugging code. Adjust comment style here and there.
2317 * insdel.c (insert_1): Remove.
2318 * lisp.h (insert_1): Remove prototype.
2319 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2320
2321 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2322
2323 * w32.c (max_filename_mbslen): New function.
2324 (normalize_filename, readdir): Use it to detect locales where ANSI
2325 encoding of file names uses a double-byte character set (DBCS).
2326 If a DBCS encoding is used, advance by characters using
2327 CharNextExA, instead of incrementing a 'char *' pointer.
2328 Use _mbslwr instead of _strlwr. (Bug#13515)
2329
2330 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2331 request of memory reservation to 1.7GB. (Bug#13065)
2332
2333 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2334
2335 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2336 at check_extra_latin label. (Bug#13505)
2337
2338 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2339
2340 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2341 Avoid redundant calls to strlen.
2342
2343 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2344
2345 Drop async_visible and async_iconified fields of struct frame.
2346 This is possible because async input is gone; for details, see
2347 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2348 * frame.h (struct frame): Remove async_visible and async_iconified
2349 members, convert garbaged to unsigned bitfield. Adjust comments.
2350 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2351 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2352 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2353 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2354 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2355 * w32term.c: Ditto.
2356 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2357 properly. Likewise for obscured.
2358 * xterm.c: Ditto.
2359 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2360 properly.
2361 * nsterm.m: Ditto.
2362 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2363
2364 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2365
2366 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2367 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2368
2369 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2370
2371 * xdisp.c (message2, message2_nolog): Remove functions.
2372 (message3, message3_nolog): Extract nbytes and multibyteness directly
2373 from the string. Change all callers.
2374 (message3_nolog): Don't set message_enable_multibyte since set_message
2375 will reset it anyway.
2376 (message1, message1_nolog): Use message3.
2377 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2378 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2379 (set_message): Drop all but the second arg, which has to be a string.
2380 (set_message_1): Simplify now that we know that a1 is NULL and the
2381 second arg is a string.
2382 * frame.h (struct frame): Remove `message_buf' field.
2383 Use glyphs_initialized_p instead.
2384 (FRAME_MESSAGE_BUF): Remove macro.
2385 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2386 * lisp.h (message2, message2_nolog): Remove declarations.
2387 (message3, message3_nolog): Update declarations.
2388 * keyboard.c (read_char_minibuf_menu_text)
2389 (read_char_minibuf_menu_width): Remove vars.
2390 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2391 to correctly handle multibyte strings.
2392 * frame.c (delete_frame): Don't free message_buf any more.
2393 * editfns.c (message_text, message_length): Remove vars.
2394 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2395 * fileio.c (auto_save_error): Use message3 instead of message2.
2396 * dispnew.c (adjust_frame_message_buffer): Remove function.
2397
2398 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2399
2400 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2401 real estate used for the tool bar and the menu bar.
2402
2403 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2404
2405 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2406 hidden buffer is prepared to modification (Bug#13164).
2407
2408 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2409
2410 * window.h (struct window): Change window_end_valid member from
2411 Lisp_Object to a bitfield. Adjust comments.
2412 (wset_window_end_valid): Remove.
2413 * window.c (adjust_window_count): Clear window_end_valid.
2414 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2415 (Fwindow_line_height, set_window_buffer, Frecenter)
2416 (Fsplit_window_internal, Fdelete_other_windows_internal)
2417 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2418 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2419 * xdisp.c (check_window_end, reconsider_clip_changes)
2420 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2421 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2422 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2423
2424 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2425
2426 * xdisp.c (mark_window_display_accurate): Simplify the loop
2427 assuming that the only one of vchild, hchild or buffer window
2428 slots is non-nil. Call mark_window_display_accurate_1 for
2429 the leaf windows only.
2430 (mark_window_display_accurate_1): Always assume leaf window.
2431 Adjust comment.
2432
2433 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2434
2435 * emacs.c (Qkill_emacs_hook): Now static.
2436
2437 * fileio.c (Finsert_file_contents): Simplify.
2438 Remove unnecessary assignments and tests.
2439
2440 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2441
2442 * w32.c (acl_set_file): Don't test for errors unless
2443 set_file_security returns FALSE. Avoids spurious errors when
2444 saving files.
2445
2446 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2447
2448 * fileio.c (Finsert_file_contents): Revert code introduced at
2449 2013-01-18 in favor of the simpler and generally better fix.
2450 Save stack space by removing 'buffer' and reusing 'read_buf'
2451 where appropriate.
2452
2453 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2454
2455 * lisp.h (eabs): Define unconditionally (Bug#13419).
2456 The old "#if !defined (eabs)" was an unnecessary revenant of back
2457 when this macro was called "abs". Document 'eabs' better.
2458
2459 2013-01-19 Glenn Morris <rgm@gnu.org>
2460
2461 * fns.c (Frandom): Doc fix.
2462
2463 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2464
2465 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2466 segfault when there are lots of overlays.
2467
2468 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2469 when there are lots of overlays.
2470 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2471 for the details and a way to reproduce.
2472
2473 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2474
2475 * fileio.c: Use O_APPEND to append.
2476 This corresponds better to the natural interpretation of "append",
2477 and avoids the need to open the output file twice, or to invoke
2478 lseek when APPEND is neither nil nor a number.
2479 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2480 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2481 file possibly twice, and lseeking to its end; this avoids the
2482 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2483 at the same time: the combination is never needed and apparently
2484 it doesn't work with DOS_NT.
2485
2486 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2487 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2488
2489 Allow floating-point file offsets.
2490 Problem reported by Vitalie Spinu in
2491 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2492 * fileio.c (emacs_lseek): Remove.
2493 (file_offset): New function.
2494 (Finsert_file_contents, Fwrite_region): Use it.
2495
2496 2013-01-19 Chong Yidong <cyd@gnu.org>
2497
2498 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2499 aborting on Fsignal (Bug#13289).
2500
2501 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2502
2503 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2504 set_file_security as failure due to insufficient privileges.
2505 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2506 (fstat): Return owner and group like 'stat' and 'lstat' do.
2507
2508 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2509
2510 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2511 The bug was observed on Ubuntu operating inside a virtual machine,
2512 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2513 The workaround introduces a race condition on non-buggy hosts,
2514 but it's an unlikely race and anyway there's a nearly identical
2515 nearby race that can't be fixed.
2516 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2517 New static vars.
2518 (Fwrite_region): Test for file system time stamp bug.
2519 (init_fileio): New function.
2520 * lisp.h (init_fileio): Declare it.
2521 * emacs.c (main): Call it.
2522
2523 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2524 and make it more consistent with other stat-failure diagnostics.
2525
2526 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2527
2528 Fix crash when inserting data from non-regular files.
2529 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2530 for the error description produced by valgrind.
2531 * fileio.c (read_non_regular): Rename to read_contents.
2532 Free Lisp_Save_Value object used to pass parameters.
2533 (read_non_regular_quit): Rename to read_contents_quit.
2534 (Finsert_file_contents): Redesign internal file reading loop to adjust
2535 gap and end positions after each read and so help make_gap to work
2536 properly. Do not signal an I/O error too early and so do not leave
2537 not yet decoded characters in a buffer, which was the reason of
2538 redisplay crash. Use list2 to build return value. Adjust comments.
2539
2540 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2541
2542 Close a race when statting and reading files (Bug#13149).
2543 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2544 This avoids a race if the file is renamed between stat and open.
2545 This race is not the problem originally noted in Bug#13149;
2546 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2547
2548 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2549
2550 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2551 objects, related functions and macros.
2552 (make_save_value): Adjust prototype.
2553 (make_save_pointer): New prototype.
2554 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2555 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2556 * alloc.c (format_save_value): Rename to make_save_value.
2557 (make_save_pointer): New function.
2558 (record_xmalloc): Use make_save_pointer.
2559 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2560 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2561 Change users of make_save_value to make_save_pointer.
2562 Likewise for format_save_value and make_save_value.
2563
2564 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2565
2566 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2567 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2568 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2569 debugging stubs.
2570
2571 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2572
2573 * alloc.c (free_save_value): Now static.
2574
2575 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2576
2577 * keymap.c (map_keymap_internal): Use format_save_value.
2578 (map_keymap_char_table_item): Adjust accordingly.
2579 * fileio.c (non_regular_fd, non_regular_inserted)
2580 (non_regular_nbytes): Remove.
2581 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2582 Use format_save_value to pass parameters to read_non_regular.
2583 (read_non_regular): Use XSAVE_ macros to extract parameters.
2584 Adjust comment.
2585 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2586 format_save_value.
2587 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2588
2589 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2590
2591 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2592 extraction from any Lisp_Save_Value slot. Add type checking.
2593 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2594 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2595 * xselect.c: All users changed.
2596
2597 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2598
2599 Some convenient bits to deal with Lisp_Save_Values.
2600 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2601 (allocate_misc): Remove prototype.
2602 (format_save_value): New prototype.
2603 * alloc.c (allocate_misc): Revert back to static.
2604 (format_save_value): New function to build Lisp_Save_Value
2605 object with the specified internal structure.
2606 (make_save_value): Reimplement using format_save_value.
2607 * editfns.c (save_excursion_save): Use format_save_value.
2608 (save_excursion_restore): Use XSAVE_OBJECT.
2609
2610 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2611
2612 Avoid needless casts with XSAVE_POINTER.
2613 * alloc.c (mark_object) [GC_MARK_STACK]:
2614 * dired.c (directory_files_internal_unwind):
2615 * fileio.c (do_auto_save_unwind):
2616 * gtkutil.c (pop_down_dialog):
2617 * keymap.c (map_keymap_char_table_item):
2618 * lread.c (load_unwind):
2619 * nsmenu.m (pop_down_menu):
2620 * print.c (print_object) [GC_MARK_STACK]:
2621 * xfns.c (clean_up_file_dialog):
2622 * xmenu.c (cleanup_widget_value_tree):
2623 Omit casts between XSAVE_POINTER and a pointer type.
2624
2625 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2626
2627 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2628 * eval.c (eval_sub): Protect `form' from being GCed before its
2629 car and cdr becomes protected with the backtrace entry.
2630
2631 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2632
2633 Make Lisp_Save_Value more versatile storage for up to four objects.
2634 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2635 (struct Lisp_Save_Value): New layout. Adjust comments.
2636 (XSAVE_POINTER): New macro.
2637 (XSAVE_INTEGER): Likewise.
2638 (allocate_misc): Add prototype.
2639 (free_misc): Likewise.
2640 * alloc.c (allocate_misc): Now global.
2641 (free_misc): Likewise. Adjust comment.
2642 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2643 (free_save_value): Likewise.
2644 (mark_object): Likewise.
2645 * editfns.c (save_excursion_save): Pack everything within
2646 Lisp_Save_Value and so avoid xmalloc.
2647 (save_excursion_restore): Adjust to match new layout. Use free_misc
2648 because we do not allocate extra memory any more. Add eassert.
2649 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2650 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2651 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2652 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2653 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2654
2655 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2656
2657 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2658 (nsfont_draw): Remove disabling of LCD smoothing.
2659 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2660 Bug#11484 with LCD smoothing on.
2661
2662 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
2663
2664 Fix SIGDANGER handlers, for AIX (Bug#13408).
2665 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2666 Move handlers here from emacs.c; they were out of place.
2667
2668 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2669
2670 * xterm.c (syms_of_xterm): Adjust documentation for
2671 scroll-bar-adjust-thumb-portion.
2672
2673 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2674
2675 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2676 determine whether scroll bar thumb size should be adjusted or
2677 not. Use variable for MOTIF.
2678
2679 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2680 GTK.
2681
2682 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2683
2684 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2685 event is generated.
2686 (doCommandBySelector:): Set processingCompose to NO.
2687
2688 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2689 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2690 (nsfont_list_family): Add block/unblock_input calls.
2691 (nsfont_open): Move block_input earlier. Add unblock_input before early
2692 return.
2693 (nsfont_draw): Add block/unblock_input calls.
2694
2695 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2696
2697 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2698 for old_charpos and old_bytepos.
2699
2700 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2701
2702 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2703 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2704 Clear tzvalbuf_in_environ if this workaround is in effect.
2705 Problem and fix reported by Kazuhiro Ito.
2706
2707 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2708
2709 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2710 Fix ambiguous doc string cross-reference(s).
2711
2712 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2713 doc string cross-reference(s).
2714
2715 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2716 string cross-reference(s).
2717
2718 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2719
2720 Avoid unnecessary byte position calculation for the gap movement.
2721 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2722 anyway, all of them should use move_gap_both instead.
2723 * lisp.h (move_gap): Remove prototype.
2724 * insdel.c (move_gap): Remove.
2725 (move_gap_both): Add eassert.
2726 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2727 * xml.c (parse_region): Likewise.
2728
2729 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2730
2731 emacsclient -t should not suspend Emacs server (Bug#13387)
2732 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2733 New functions.
2734 * term.c (init_tty): Use them instead of rolling our own code.
2735 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2736 switches from 'signal' to 'pthread_sigmask', which is safer in
2737 multithreaded applications.
2738 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2739 which has already arranged for that.
2740 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2741 This is the main part of the bug fix.
2742
2743 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
2744
2745 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2746 x_last_font_name (Bug#13403).
2747
2748 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2749
2750 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2751 the type of per-buffer values where appropriate.
2752 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2753 predicate, which is how it's really used now. Adjust comment.
2754 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2755 * buffer.c (buffer_slot_type_mismatch): Remove.
2756 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2757 predicate. Adjust comment.
2758 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2759 fill-column, left-margin, tab-width, buffer-saved-size,
2760 left-margin-width, right-margin-width, left-fringe-width,
2761 right-fringe-width, scroll-bar-width and buffer-display-count.
2762 Use Qstringp for default-directory, buffer-file-name,
2763 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2764 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2765 line-spacing.
2766 * data.c (store_symval_forwarding): Adjust to call the predicate.
2767
2768 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
2769
2770 * w32.c (get_name_and_id, acl_set_file):
2771 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2772
2773 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2774
2775 * lisp.h (make_gap_1): New prototype.
2776 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2777 gap size values.
2778 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2779 naming convention.
2780 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2781 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
2782 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2783 (make_gap_1): New function to adjust the gap of any buffer.
2784 * coding.c (coding_alloc_by_making_gap): Use it.
2785 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2786 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2787
2788 2013-01-08 Juri Linkov <juri@jurta.org>
2789
2790 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2791 of (supports :underline (:style wave)). (Bug#13000)
2792
2793 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2794
2795 * undo.c (Fprimitive_undo): Move to simple.el.
2796 (syms_of_undo): Remove declarations for Sprimitive_undo.
2797
2798 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2799
2800 * keyboard.c (echo_add_key): Rename from echo_add_char.
2801
2802 2013-01-06 Chong Yidong <cyd@gnu.org>
2803
2804 * keyboard.c (echo_add_char): New function, factored out from
2805 echo_char. Don't add a space if the previous echo string was
2806 empty (Bug#13255).
2807 (echo_char): Use it.
2808 (read_key_sequence): When echoing mock input, ensure that the
2809 trailing dash is properly added.
2810
2811 2013-01-05 Eli Zaretskii <eliz@gnu.org>
2812
2813 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2814 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
2815 digits for buffer positions, before misalignment starts.
2816 Display "0" for integer "object" field.
2817 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2818 Display the newline glyph more unambiguously.
2819
2820 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2821
2822 * nsterm.m (ns_draw_underwave):
2823 * w32term.c (w32_draw_underwave):
2824 * xterm.c (x_draw_underwave): Make underwave look more triangular
2825 and also degrade gracefully for small fonts. (Bug#13000)
2826
2827 * nsterm.m (ns_draw_text_decoration):
2828 * w32term.c (x_draw_glyph_string):
2829 * xterm.c (x_draw_glyph_string): Don't use previous underline
2830 thickness and position if previous underline type is underwave.
2831
2832 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2833
2834 * fileio.c (Ffile_acl): Undocument return format.
2835
2836 2013-01-02 Glenn Morris <rgm@gnu.org>
2837
2838 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2839
2840 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2841
2842 Simplify via eabs.
2843 * dired.c (file_name_completion):
2844 * doc.c (get_doc_string):
2845 * floatfns.c (round2):
2846 * font.c (font_score, font_delete_unmatched):
2847 * fringe.c (compute_fringe_widths):
2848 * lread.c (read_list):
2849 * minibuf.c (Ftry_completion):
2850 * term.c (tty_ins_del_lines):
2851 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2852 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2853
2854 2012-12-31 Eli Zaretskii <eliz@gnu.org>
2855
2856 * w32.c (unsetenv): Set up the string passed to _putenv
2857 correctly.
2858 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
2859 for the bug this caused.
2860
2861 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2862
2863 * coding.c (Qmac): Now static.
2864
2865 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2866
2867 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2868 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2869 handlebox_widget. Set toolbar_in_hbox to false/true, set
2870 toolbar_is_packed to true.
2871 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2872 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2873 Show all on TOOLBAR_TOP_WIDGET.
2874 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2875 by TOOLBAR_TOP_WIDGET.
2876 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2877 Check toolbar_is_packed.
2878 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2879 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2880 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2881 false.
2882 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2883 (xg_update_menubar): Update title only if
2884 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2885 (xg_update_submenu): Skip tearoff only if
2886 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2887 (xg_initialize): Initialize xg_detached_menus only if
2888 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2889
2890 * xterm.h (struct x_output): Surround handlebox_widget with
2891 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2892 toolbar_in_hbox is bool.
2893
2894 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2895
2896 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2897 (LIBS_GNUSTEP): Define.
2898 (LIBES): Add $(LIBS_GNUSTEP).
2899 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2900
2901 2012-12-30 Eli Zaretskii <eliz@gnu.org>
2902
2903 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2904 continuation glyph on a TTY with an indication of an empty line.
2905 (Bug#13277)
2906
2907 2012-12-29 Eli Zaretskii <eliz@gnu.org>
2908
2909 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2910 file's SELinux context or ACLs successfully set, nil otherwise.
2911 (Bug#13298)
2912 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
2913
2914 * w32proc.c (reader_thread): Avoid passing NULL handles to
2915 SetEvent and WaitForSingleObject.
2916
2917 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2918
2919 Port EXTERNALLY_VISIBLE to Clang 3.2.
2920 * conf_post.h (__has_attribute): New macro.
2921 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2922
2923 2012-12-27 Glenn Morris <rgm@gnu.org>
2924
2925 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2926 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2927
2928 2012-12-27 Eli Zaretskii <eliz@gnu.org>
2929
2930 * fileio.c (file_name_as_directory, directory_file_name):
2931 Accept an additional argument MULTIBYTE to indicate whether the input C
2932 came from a multibyte or a unibyte Lisp string; all callers
2933 adjusted. Don't assume the input string is always multibyte.
2934 (Bug#13262)
2935 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2936 don't ENCODE_FILE them, and return a unibyte string if the input
2937 was unibyte.
2938 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2939 don't assume the input strings will always be multibyte. If the
2940 input strings are multibyte, decode strings obtained from C
2941 library functions.
2942
2943 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2944
2945 * lisp.h (toplevel): Add two notices to the comment about
2946 defining a new Lisp data type.
2947 * print.c (print_object): If Lisp_Save_Value object's pointer
2948 is the address of a memory area containing Lisp_Objects, try
2949 to print them.
2950 * alloc.c (valid_lisp_object_p): Adjust comment.
2951
2952 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2953
2954 * keyboard.c (record_asynch_buffer_change): Initialize an event
2955 only if it's really needed.
2956 * frame.h (enum output_method): Remove output_mac member since
2957 it's a leftover from the deleted code.
2958 * frame.c (Fframep): Adjust user here ...
2959 * terminal.c (Fterminal_live_p): ... and here.
2960 * coding.c (Qmac): Now here because it's only used to denote
2961 end-of-line encoding type.
2962 (syms_of_coding): DEFSYM it.
2963 * frame.h (Qmac): Remove duplicated declaration.
2964
2965 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2966
2967 * window.c (select_window_1): Now static, since it's used only here.
2968
2969 2012-12-25 Eli Zaretskii <eliz@gnu.org>
2970
2971 * window.c (window_body_cols): Subtract display margins from the
2972 window body width on TTYs as well. See
2973 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2974 for the original report.
2975
2976 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2977
2978 * xdisp.c (redisplay_window): Remove inner local variable
2979 because the outer shadowed one has the same meaning.
2980 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2981 set but never used.
2982 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2983 (xg_create_tool_bar): Adjust users.
2984
2985 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2986
2987 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2988 * buffer.c (Fget_buffer_create): Use it to set compact field of
2989 struct buffer_text to avoid accessing an uninitialized value
2990 when compact_buffer is called for the first time.
2991 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2992 (Fset_buffer_modified_p): Use buffer_window_count to check
2993 whether the buffer is displayed in some window.
2994 * xdisp.c (message_dolog): Likewise.
2995
2996 2012-12-23 Eli Zaretskii <eliz@gnu.org>
2997
2998 * w32.c (acl_set_file): If setting the file security descriptor
2999 fails, and the new DACL is identical to the existing one, silently
3000 return success. This fixes problems for users backing up their
3001 own files without having the necessary privileges for setting
3002 security descriptors.
3003
3004 * w32proc.c (reader_thread): Do not index fd_info[] with negative
3005 values.
3006 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
3007 after WaitForSingleObject returns normally. This expedites reader
3008 thread shutdown when delete_child triggers it.
3009 (reap_subprocess): More accurate commentary for why we call
3010 delete_child only when cp->fd is negative.
3011
3012 * w32.c (sys_close): Do not call delete_child on a subprocess
3013 whose handle is not yet closed. Instead, set its file descriptor
3014 to a negative value, so that reap_subprocess will call
3015 delete_child on that subprocess when its SIGCHLD arrives.
3016 This avoids closing handles used for communications between sys_select
3017 and reader_thread, which doesn't give sys_select a chance to
3018 notice that the process exited and invoke the SIGCHLD handler for
3019 it.
3020
3021 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
3022
3023 * nsfns.m (Fns_do_applescript): Run event loop until script has
3024 been executed (Bug#12969).
3025 (ns_run_ascript): Chech as_script for nil, set to nil after
3026 executing script.
3027
3028 2012-12-22 Martin Rudalics <rudalics@gmx.at>
3029
3030 * window.c (Fselect_window): Reword doc-string (Bug#13248).
3031
3032 2012-12-22 Eli Zaretskii <eliz@gnu.org>
3033
3034 * w32term.c (w32fullscreen_hook): New function.
3035 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
3036
3037 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3038
3039 * fileio.c (Finsert_file_contents): Doc fix.
3040
3041 * w32proc.c (new_child, delete_child, find_child_pid): For a
3042 subprocess, consider its slot being in use as long as its process
3043 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3044 slot when a new process is started immediately after killing
3045 another one, without waiting enough time for the first process to
3046 be reaped and resources allocated for it be orderly freed.
3047 (Bug#13086)
3048 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3049
3050 2012-12-21 Chong Yidong <cyd@gnu.org>
3051
3052 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3053
3054 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3055
3056 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3057
3058 * w32.c (get_name_and_id): Always pass NULL as the first argument
3059 of lookup_account_sid. Avoids crashes with UNC file names that
3060 refer to DFS domains, not to specific machine names. (Bug#12621)
3061 Remove now unused argument FNAME; all callers changed.
3062 (get_file_owner_and_group): Remove now unused argument FNAME; all
3063 callers changed.
3064
3065 2012-12-21 Chong Yidong <cyd@gnu.org>
3066
3067 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3068 error for invalid chars, don't check for a nil return value.
3069
3070 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3071
3072 Avoid calls to CHAR_TO_BYTE if byte position is known.
3073 * editfns.c (make_buffer_string_both): Use move_gap_both.
3074 (Fbuffer_string): Use make_buffer_string_both.
3075 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3076 Adjust comment.
3077 (buf_bytepos_to_charpos): Likewise.
3078 (charpos_to_bytepos): Remove.
3079 * fileio.c (Finsert_file_contents): Use move_gap_both.
3080 * search.c (Freplace_match): Likewise.
3081 * process.c (process_send_region): Likewise. Use convenient
3082 names for byte positions.
3083 * lisp.h (charpos_to_bytepos): Remove prototype.
3084 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3085 * insdel.c (move_gap): Likewise.
3086
3087 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3088
3089 * xdisp.c (redisplay_internal): Remove now-unused local.
3090
3091 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3092
3093 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3094 (redisplay_internal): Don't bother selecting the frame to get the
3095 proper value of frame-local variables (bug#13225).
3096
3097 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3098
3099 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3100 Rename 4th argument since it may be buffer or string. Adjust comment.
3101 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3102
3103 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3104
3105 * coding.c (Fdetect_coding_region): Do not check start and end with
3106 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3107 (code_convert_region): Likewise.
3108
3109 2012-12-18 Eli Zaretskii <eliz@gnu.org>
3110
3111 * w32.c (acl_get_file, acl_set_file): Run the file name through
3112 map_w32_filename, and resolve any symlinks in the file name, like
3113 Posix platforms do.
3114 (acl_set_file): Call revert_to_self, if any privileges were
3115 enabled.
3116
3117 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
3118
3119 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3120 ($(BLD)/w32.$(O)): Update dependencies.
3121
3122 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3123
3124 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3125 propagate redisplay's scrolling (if any) to the right window.
3126 (redisplay_internal): Use ensure_selected_frame.
3127 (display_mode_lines): Complete last fix.
3128 * window.c (select_window_1): New func, extracted from select_window.
3129 (select_window): Use it.
3130 * window.h (select_window_1): Declare.
3131
3132 2012-12-17 Eli Zaretskii <eliz@gnu.org>
3133
3134 Emulate Posix ACL APIs on MS-Windows.
3135 * w32.c: Include sddl.h and sys/acl.h.
3136 (SDDL_REVISION_1): Define if not already defined.
3137 (g_b_init_get_security_descriptor_dacl)
3138 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3139 (g_b_init_is_valid_security_descriptor)
3140 (g_b_init_set_file_security): New static flags.
3141 (globals_of_w32): Initialize them to zero.
3142 (SetFileSecurity_Name): New string constant.
3143 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3144 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3145 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3146 (IsValidSecurityDescriptor_Proc): New typedefs.
3147 (get_file_security, get_security_descriptor_owner)
3148 (get_security_descriptor_group): Set errno to ENOTSUP.
3149 (set_file_security, get_security_descriptor_dacl)
3150 (is_valid_security_descriptor, convert_sd_to_sddl)
3151 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3152 (acl_free, acl_get_file, acl_set_file): New functions.
3153
3154 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3155
3156 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3157
3158 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3159 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3160 for some of that bug's symptoms can now cause Emacs to abort.
3161 Remove the workaround.
3162 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3163 The bug that caused SIGCHLD to get lost has been fixed, and the
3164 workaround for it can now cause Emacs to abort.
3165
3166 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3167
3168 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3169 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3170 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3171
3172 2012-12-16 Romain Francoise <romain@orebokech.com>
3173
3174 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3175 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3176 and copy ACL entries of file in addition to SELinux context if set.
3177 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3178
3179 * Makefile.in (LIBACL_LIBS): New macro.
3180 (LIBES): Use it.
3181
3182 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3183
3184 * fileio.c (internal_delete_file): Use bool for boolean.
3185
3186 2012-12-15 Eli Zaretskii <eliz@gnu.org>
3187
3188 Fix bug #13079 on MS-Windows with temp files not being deleted.
3189 * w32.h (_child_process): New members input_file and
3190 pending_deletion.
3191 (register_child): First argument is now pid_t.
3192 (record_infile, record_pending_deletion): New prototypes.
3193
3194 * w32proc.c (new_child): Initialize input_file and
3195 pending_deletion members of the child.
3196 (delete_child): Delete the child's temporary input file, if any,
3197 that is pending deletion.
3198 (register_child): First argument is now pid_t.
3199 (record_infile, record_pending_deletion): New functions.
3200 (reap_subprocess): Fix a typo in DebPrint string.
3201 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3202
3203 * fileio.c (internal_delete_file): Return an int again: non-zero
3204 if delete-file succeeds, zero otherwise.
3205
3206 * lisp.h (internal_delete_file): Adjust prototype.
3207
3208 * callproc.c (Fcall_process): Don't overwrite infile with result
3209 of DECODE_FILE.
3210 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3211 asynchronous subprocess, record the name of the input file name,
3212 if any.
3213 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3214 delete the file, record it as pending deletion when the subprocess
3215 exits.
3216
3217 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3218
3219 * editfns.c [HAVE_PWD_H]: Include grp.h.
3220
3221 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3222
3223 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3224
3225 Fix permissions bugs with setgid directories etc. (Bug#13125)
3226 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3227 to mark it as a placeholder. The old value was often wrong.
3228 The only user of this attribute has been changed to use
3229 file-ownership-preserved-p instead, with its new group arg.
3230 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3231
3232 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3233
3234 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3235 Keep selected_window and selected_frame in sync.
3236
3237 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3238
3239 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3240 try to get accurate owner and group information from NT file
3241 security APIs. This is to make most callers of 'stat' and
3242 'lstat', which don't need that information, much faster.
3243
3244 * dired.c (Ffile_attributes) [WINDOWSNT]:
3245 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3246 owner and group information from 'lstat'.
3247
3248 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3249
3250 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3251 as that confuses set-auto-coding, so insist on the head-read
3252 returning the full 1024 bytes. Let lseek compute the tail offset;
3253 less work for us. Do not ignore I/O errors when reading the tail.
3254
3255 * xdisp.c: Minor style fixes.
3256 (init_iterator): Hoist assignment out of if-expression.
3257 (markpos_of_region): Callers now test for sign, not for -1.
3258
3259 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3260
3261 Minor redisplay optimization when the region length is zero.
3262 * xdisp.c (markpos_of_region): New function.
3263 (init_iterator): Do not highlight the region of zero length.
3264 (redisplay_window): Check whether the region is of non-zero length.
3265 (try_cursor_movement): Allow if the region length is zero.
3266 (try_window_reusing_current_matrix, try_window_id): Likewise.
3267
3268 2012-12-13 Eli Zaretskii <eliz@gnu.org>
3269
3270 * search.c (search_buffer): Check the inverse translations of each
3271 character in pattern when the buffer being searched is unibyte.
3272 (Bug#13084)
3273
3274 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3275
3276 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3277 files, fixing a regression from 24.2.
3278 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3279
3280 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3283 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3284 Remove unnecessary S_ISLNK test, as (contra the comments) this
3285 function can't copy symlinks. Improve quality of error message
3286 when attempting to copy files that are neither regular files nor
3287 directories.
3288
3289 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3290
3291 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3292 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3293 * window.c (Frecenter):
3294 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3295 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3296
3297 2012-12-12 Daniel Colascione <dancol@dancol.org>
3298
3299 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3300 the dumped Emacs is not a sparse file, greatly improving Cygwin
3301 "make bootstrap" performance.
3302
3303 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
3304
3305 * inotify.c (inotify_callback): Generate an Emacs event for every
3306 incoming inotify event.
3307
3308 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3309
3310 * xdisp.c (handle_face_prop): Fix logic of computing
3311 it->start_of_box_run_p.
3312 (append_space_for_newline): If the glyph row is R2L, reset the
3313 iterator's end_of_box_run_p flag before prepending the space glyph.
3314 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3315 iterator's start_of_box_run_p flag before prepending the stretch.
3316 (append_glyph, produce_image_glyph, append_composite_glyph)
3317 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3318 left_box_line_p and right_box_line_p flags of the glyph for R2L
3319 glyph rows. (Bug#13011)
3320
3321 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3322
3323 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3324 if changed buffer is not shown in a window.
3325 * insdel.c (prepare_to_modify_buffer): Likewise.
3326 * window.c (replace_buffer_in_windows_safely): Do nothing
3327 if buffer is not shown in a window.
3328 (Fforce_window_update): Likewise if string or buffer argument
3329 is passed.
3330
3331 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3332
3333 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3334 encoded_file_name, which is what it is.
3335
3336 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3337
3338 Consistently use marker_position and marker_byte_position.
3339 * fringe.c (Ffringe_bitmaps_at_pos):
3340 * indent.c (Fvertical_motion):
3341 * insdel.c (prepare_to_modify_buffer):
3342 * keyboard.c (make_lispy_position):
3343 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3344 (window_scroll_pixel_based, displayed_window_lines)
3345 (Fset_window_configuration):
3346 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3347 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3348 Replace direct access to marker fields with calls
3349 to marker_position and/or marker_byte_position.
3350
3351 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3352
3353 * makefile.w32-in (SIG2STR_H): New macro.
3354 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3355 ($(BLD)/w32notify.$(O)): Update dependencies.
3356
3357 2012-12-10 Daniel Colascione <dancol@dancol.org>
3358
3359 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3360 Windows file notification functionality unless WINDOWSNT.
3361
3362 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3363 declarations.
3364
3365 * w32fns.c (cache_system_info): Initialize the global hinst
3366 variable here so various initialization calls DTRT.
3367
3368 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3369 (hinst): Remove unneeded extern declaration.
3370 (_start): Remove initialization of above variables; remove
3371 initialization of hinst, as cache_system_info now does that.
3372
3373 * emacs.c (main): Call cache_system_info early in startup; we
3374 previously weren't calling it in Cygwin builds.
3375
3376 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3377 Teach the autoconf build system how to compile a Windows resource file
3378 and link it to Emacs.
3379
3380 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3381
3382 Per-buffer window counters.
3383 * buffer.h (struct buffer): New member window_count.
3384 (buffer_window_count): New function.
3385 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3386 Initialize window_count.
3387 (Fkill_buffer): Verify window_count for the buffer being killed.
3388 (modify_overlay): Do not force redisplay if buffer is not shown
3389 in any window.
3390 (init_buffer_once): Initialize window_count for buffer_defaults
3391 and buffer_local_symbols.
3392 * window.h (buffer_shared): Remove declaration.
3393 (wset_buffer): Convert from inline ...
3394 * window.c (wset_buffer): ... to an ordinary function.
3395 (adjust_window_count): New function.
3396 (make_parent_window): Use it.
3397 * xdisp.c (buffer_shared): Remove.
3398 (redisplay_internal, redisplay_window): Adjust users.
3399 (buffer_shared_and_changed): Use per-buffer window counter.
3400
3401 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3402
3403 Support for filesystem notifications on MS-Windows.
3404 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3405 and this is a TTY frame, signal the caller that keyboard input is
3406 available.
3407
3408 * w32xfns.c (drain_message_queue): Now returns an int: an
3409 indication whether any WM_EMACS_FILENOTIFY messages were found in
3410 the queue.
3411
3412 * w32inevt.c (handle_file_notifications): New function.
3413 (w32_console_read_socket): Call it to process file notifications.
3414
3415 * w32console.c (initialize_w32_display): Record the main thread ID
3416 in dwMainThreadId.
3417
3418 * deps.mk (inotify.o): New dependency list.
3419
3420 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3421
3422 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3423 (WM_EMACS_END): Bump value by 1.
3424 (notification_buffer_in_use, file_notifications)
3425 (notifications_size, notifications_desc): Declare.
3426 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3427 Add prototypes.
3428
3429 * w32term.c (lispy_file_action, queue_notifications): New functions.
3430 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3431 <Qrenamed_to>: New symbols.
3432 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3433
3434 * w32notify.c: New file, implements file event notifications for
3435 MS-Windows.
3436
3437 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3438 by posting it to the w32_read_socket queue.
3439
3440 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3441
3442 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3443 (GLOBAL_SOURCES): Add w32notify.c
3444 ($(BLD)/w32notify.$(O)): New set of dependencies.
3445
3446 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3447
3448 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3449 Handle FILE_NOTIFY_EVENT.
3450 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3451 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3452 w32notify-handle-event by default.
3453
3454 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3455 syms_of_w32notify.
3456
3457 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3458
3459 Support for filesystem notifications on GNU/Linux via inotify.
3460 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3461
3462 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3463
3464 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3465 (syms_of_keyboard): DEFSYM it.
3466 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3467 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3468 Qfile_inotify events.
3469 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3470 special-event-map to inotify-handle-event.
3471
3472 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3473
3474 * Makefile.in (base_obj): Add inotify.o.
3475
3476 * inotify.c: New file.
3477
3478 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3479
3480 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3481
3482 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3483
3484 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3485 DWORD_PTR, for compatibility with 64-bit builds.
3486
3487 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3488 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3489 (system_process_attributes): Use SIZE_T rather than DWORD, for
3490 compatibility with 64-bit builds.
3491
3492 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3493
3494 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3495
3496 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3497
3498 * indent.c (Fvertical_motion): If a display string will be
3499 displayed on the left or the right margin, don't consider it as a
3500 factor in cursor positioning. (Bug#13108)
3501
3502 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3503
3504 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3505
3506 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3507
3508 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3509 for string length.
3510
3511 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3512
3513 * w32.c (unsetenv): Return 0 if the input string is too long.
3514
3515 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3516
3517 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3518 * alloc.c (xputenv): New function.
3519 * dbusbind.c (Fdbus_init_bus):
3520 * emacs.c (main):
3521 * xterm.c (x_term_init):
3522 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3523 * editfns.c (initial_tz): Move static var decl up.
3524 (tzvalbuf_in_environ): New static var.
3525 (init_editfns): Initialize these two static vars.
3526 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3527 Save old TZ value on stack, if it's small.
3528 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3529 instead, use xputenv+unsetenv to set and restore TZ.
3530 (environbuf): Remove static var. All uses removed.
3531 (Fset_time_zone_rule): Do not save TZ and environ;
3532 no longer needed here.
3533 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3534 Move to inside set_time_zone_rule; they don't need file scope any more.
3535 (set_time_zone_rule): Maintain the TZ=value string separately.
3536 (syms_of_editfns): Don't initialize initial_tz;
3537 init_editfns now does it.
3538 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3539 * lisp.h (xputenv): New decl.
3540
3541 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3542
3543 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3544
3545 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3546
3547 * w32.c (unsetenv, sys_putenv): New functions.
3548
3549 2012-12-08 Chong Yidong <cyd@gnu.org>
3550
3551 * editfns.c (Finsert_char): Make the error message more
3552 informative (Bug#12992).
3553
3554 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3555
3556 Simplify get_lim_data.
3557 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3558 Remove USG and vlimit methods; no longer used these days.
3559 Add #error catchall just in case.
3560
3561 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3562 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3563 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3564 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3565 (deleted_pid_list, Fdelete_process, create_process)
3566 (record_child_status_change, handle_child_signal, deliver_child_signal)
3567 (init_process_emacs, syms_of_process):
3568 Assume SIGCHLD is defined.
3569 (parse_signal): Remove. All uses removed.
3570 (abbr_to_signal): New static function.
3571 (Fsignal_process): Use it to convert signal names to ints.
3572 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3573 kill (getpgrp (), ...).
3574 (emacs_sigaction_init): Assume SIGCHLD is defined.
3575 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3576 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3577 * syssignal.h (EMACS_KILLPG): Remove.
3578 All uses replaced by 'kill' with a negative pid.
3579 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3580 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3581
3582 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3583
3584 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3585 This will cause a production Emacs to dump core instead of
3586 infinite-looping.
3587
3588 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3589
3590 * frame.c (make_frame): Do not set window's buffer to t.
3591 * window.c (Fsplit_window_internal): Likewise. Previously it was
3592 used to indicate that the window is being set up. Now we use
3593 set_window_buffer for all new windows, so the condition in ...
3594 (Fset_window_buffer): ... is always true and can be removed.
3595
3596 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3597
3598 Convenient macro to check whether the buffer is hidden.
3599 * buffer.h (BUFFER_HIDDEN_P): New macro.
3600 * frame.c (make_frame): Use it. Adjust comment.
3601 * buffer.c (candidate_buffer): New function.
3602 (Fother_buffer, other_buffer_safely): Use it.
3603
3604 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3605
3606 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3607 if the child process is still running. Instead, exit the wait
3608 loop and return zero. (Bug#13086)
3609
3610 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3611
3612 * frame.h (x_char_width, x_char_height): Remove prototypes.
3613 * w32term.h (x_char_width, x_char_height): Likewise.
3614 * xfns.c (x_char_width, x_char_height): Remove.
3615 * w32fns.c (x_char_width, x_char_height): Likewise.
3616 * nsfns.c (x_char_width, x_char_height): Likewise.
3617 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3618 all window frames.
3619 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3620 * keyboard.c (command_loop_1): Remove prototype.
3621 (command_loop_2, top_level_1): Add static to match prototype.
3622
3623 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3624
3625 Fix a recently-introduced delete-process race condition.
3626 * callproc.c, process.h (record_kill_process):
3627 New function, containing part of the old call_process_kill.
3628 (call_process_kill): Use it.
3629 This does not change call_process_kill's behavior.
3630 * process.c (Fdelete_process): Use record_kill_process to fix a
3631 race condition that could cause Emacs to lose track of a child.
3632
3633 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3634
3635 Avoid code duplication between prev_frame and next_frame.
3636 * frame.c (candidate_frame): New function. Add comment.
3637 (prev_frame, next_frame): Use it. Adjust comment.
3638
3639 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3640
3641 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3642 fails, signal an error instead of continuing with an empty
3643 string. (Bug#13079)
3644 Encode expanded temp file pattern before passing it to mkstemp or
3645 mktemp.
3646
3647 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3648 Encode the file name before passing it to dostounix_filename, in
3649 case it will downcase it (under w32-downcase-file-names).
3650 (Bug#12933)
3651
3652 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3653
3654 Minor call-process cleanups.
3655 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3656 at the same time as other platforms, to simplify analysis.
3657 No need for fd0_volatile since we have synch_process_fd.
3658 Avoid needless emacs_close; arg is always negative.
3659
3660 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3661
3662 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3663 processes.
3664
3665 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3666
3667 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3668 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3669 and mouse_face_hidden members to a bitfields.
3670 * frame.h (struct frame): Remove set-but-not-used space_width member.
3671 (FRAME_SPACE_WIDTH): Remove.
3672 * nsterm.m, w32term.c, xterm.c: Adjust users.
3673 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3674 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3675 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3676 members to a bitfields.
3677
3678 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3679
3680 Don't let call-process be a zombie factory (Bug#12980).
3681 Fixing this bug required some cleanup of the signal-handling code.
3682 As a side effect, this change also fixes a longstanding rare race
3683 condition whereby Emacs could mistakenly kill unrelated processes,
3684 and it fixes a bug where a second C-g does not kill a recalcitrant
3685 synchronous process in GNU/Linux and similar platforms.
3686 The patch should also fix the last vestiges of Bug#9488,
3687 a bug which has mostly been fixed on the trunk by other changes.
3688 * callproc.c, process.h (synch_process_alive, synch_process_death)
3689 (synch_process_termsig, sync_process_retcode):
3690 Remove. All uses removed, to simplify analysis and so that
3691 less consing is done inside critical sections.
3692 * callproc.c (call_process_exited): Remove. All uses replaced
3693 with !synch_process_pid.
3694 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3695 These take the role of what used to be in unwind-protect arg.
3696 All uses changed.
3697 (block_child_signal, unblock_child_signal):
3698 New functions, to avoid races that could kill innocent-victim processes.
3699 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3700 (call_process_kill): Record killed processes as deleted, so that
3701 zombies do not clutter up the system. Do this inside a critical
3702 section, to avoid a race that would allow the clutter.
3703 (call_process_cleanup): Fix code so that the second C-g works again
3704 on common platforms such as GNU/Linux.
3705 (Fcall_process): Create the child process in a critical section,
3706 to fix a race condition. If creating an asynchronous process,
3707 record it as deleted so that zombies do not clutter up the system.
3708 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3709 light of these changes. Omit unnecessary call to emacs_close
3710 before failure, as the unwind-protect code does that.
3711 * callproc.c (call_process_cleanup):
3712 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3713 * process.c (record_deleted_pid): New function, containing
3714 code refactored out of Fdelete_process.
3715 (Fdelete_process): Use it.
3716 (process_status_retrieved): Remove. All callers changed to use
3717 child_status_change.
3718 (record_child_status_change): Remove, folding its contents into ...
3719 (handle_child_signal): ... this signal handler. Now, this
3720 function is purely a handler for SIGCHLD, and is not called after
3721 a synchronous waitpid returns; the synchronous code is moved to
3722 wait_for_termination. There is no need to worry about reaping
3723 more than one child now.
3724 * sysdep.c (get_child_status, child_status_changed): New functions.
3725 (wait_for_termination): Now takes int * status and bool
3726 interruptible arguments, too. Do not record child status change;
3727 that's now the caller's responsibility. All callers changed.
3728 Reimplement in terms of get_child_status.
3729 (wait_for_termination_1, interruptible_wait_for_termination):
3730 Remove. All callers changed to use wait_for_termination.
3731 * syswait.h: Include <stdbool.h>, for bool.
3732 (record_child_status_change, interruptible_wait_for_termination):
3733 Remove decls.
3734 (record_deleted_pid, child_status_changed): New decls.
3735 (wait_for_termination): Adjust to API changes noted above.
3736
3737 * bytecode.c, lisp.h (Qbytecode): Remove.
3738 No longer needed after 2012-11-20 interactive-p changes.
3739
3740 2012-12-03 Eli Zaretskii <eliz@gnu.org>
3741
3742 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3743 the scroll margin, move point outside the margin. (Bug#13055)
3744
3745 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3746
3747 * gtkutil.c (my_log_handler): New function.
3748 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3749
3750 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3751
3752 * lisp.h (modify_region): Rename to...
3753 (modify_region_1): ...new prototype.
3754 * textprop.c (modify_region): Now static. Adjust users.
3755 * insdel.c (modify_region): Rename to...
3756 (modify_region_1): ...new function to work with current buffer.
3757 Adjust comment and users. Use true and false for booleans.
3758
3759 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3760
3761 * alloc.c (free_save_value): New function.
3762 (safe_alloca_unwind): Use it.
3763 * lisp.h (free_save_value): New prototype.
3764 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3765 Add comment.
3766 (save_excursion_restore): Adjust to match saved data structure.
3767 Use free_save_value to offload some work from GC. Drop obsolete
3768 #if 0 code.
3769
3770 2012-12-03 Chong Yidong <cyd@gnu.org>
3771
3772 * fileio.c (Vauto_save_list_file_name): Doc fix.
3773
3774 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
3775
3776 * w32fns.c: Remove prototype of atof.
3777 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
3778 builds.
3779 (file_dialog_callback): Make it UINT_PTR.
3780
3781 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3782 with 64-bit builds.
3783
3784 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3785 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3786 defined.
3787
3788 2012-12-03 Glenn Morris <rgm@gnu.org>
3789
3790 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
3791
3792 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3793
3794 Fix xpalloc confusion after memory is exhausted.
3795 * alloc.c (xpalloc): Comment fix.
3796 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3797 and signals an error, do not clear charset_table_size, as
3798 charset_table is still valid.
3799 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3800
3801 Use execve to avoid need to munge environ (Bug#13054).
3802 * callproc.c (Fcall_process):
3803 * process.c (create_process):
3804 Don't save and restore environ; no longer needed.
3805 * callproc.c (child_setup):
3806 Use execve, not execvp, to preserve environ.
3807
3808 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3809
3810 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3811
3812 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3813
3814 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3815 display for sliced images (Bug#10500).
3816
3817 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3818
3819 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
3820
3821 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3822 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3823
3824 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3825
3826 * xdisp.c (window_outdated): Remove eassert since it hits
3827 some suspicious corner cases (see Bug#13007 and Bug#13012).
3828 (mode_line_update_needed): New function.
3829 (redisplay_internal, redisplay_window): Use it.
3830 (ensure_selected_frame): New function.
3831 (redisplay_internal, unwind_redisplay): Use it.
3832 (redisplay_internal): Move comment about buffer_shared...
3833 (buffer_shared_and_changed): ...near to its real use.
3834
3835 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3836
3837 * callproc.c (Fcall_process): Don't misreport vfork failure.
3838
3839 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3840
3841 * callproc.c (Fcall_process): Fix vfork portability problems.
3842 Do not assume that fd[0], count, filefd, and save_environ survive
3843 vfork. Fix bug whereby wrong errno value could be reported for
3844 pipe failure. Some minor cleanups, too, as follows. Move buf and
3845 bufsize to the context where they're needed. Change new_argv to
3846 be of type char **, as this is more convenient and avoids casts.
3847 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3848 Now local constants, not macros.
3849
3850 2012-11-18 Kenichi Handa <handa@gnu.org>
3851
3852 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3853 for the variable "f".
3854
3855 2012-11-13 Kenichi Handa <handa@gnu.org>
3856
3857 * font.c (font_unparse_xlfd): Exclude special characters from the
3858 generating XLFD name.
3859
3860 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3861
3862 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3863 * dired.c (stat_uname, stat_gname):
3864 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3865
3866 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3867 * dired.c (directory_files_internal, file_name_completion):
3868 Assume EAGAIN and EINTR are defined.
3869
3870 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3871 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3872 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3873 * lread.c (readbyte_from_file): Assume EINTR is defined.
3874 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3875 Assume EIO and EAGAIN are defined.
3876 * unexcoff.c (write_segment): Assume EFAULT is defined.
3877
3878 2012-11-27 Eli Zaretskii <eliz@gnu.org>
3879
3880 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3881 (Bug#11964)
3882
3883 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3884 highlighting on the frame was cleared. Prevents assertion
3885 violations when repeatedly clicking on the "Top" link of the
3886 "bread-crumbs" in Info buffers.
3887
3888 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3889
3890 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3891
3892 2012-11-24 Ken Brown <kbrown@cornell.edu>
3893
3894 * keyboard.c (HAVE_MOUSE):
3895 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3896 were always defined.
3897
3898 2012-11-24 Eli Zaretskii <eliz@gnu.org>
3899
3900 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3901 between bpos_covered and bpos_max. This fixes cursor display when
3902 several display strings follow each other.
3903
3904 * .gdbinit (pgx): If the glyph's object is a string, display the
3905 pointer to string data, rather than the value of the string object
3906 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3907
3908 * indent.c (Fvertical_motion): If the starting position is covered
3909 by a display string, return to one position before that, to avoid
3910 overshooting it inside move_it_to. (Bug#12930)
3911
3912 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3913
3914 * frame.h (struct frame): Remove display_preempted member
3915 since all users are dead long ago.
3916 * nsterm.h (struct x_output): Use the only dummy member.
3917 * w32menu.c (pending_menu_activation): Remove since not
3918 really used.
3919 (set_frame_menubar): Adjust user.
3920 * w32term.h (struct x_output): Drop outdated #if 0 code.
3921 (struct w32_output): Use bitfields for explicit_parent,
3922 asked_for_visible and menubar_active members.
3923 Drop unused pending_menu_activation member.
3924 * xterm.h (struct x_output): Drop outdated #if 0 code.
3925 Use bitfields for explicit_parent, asked_for_visible,
3926 has_been_visible and net_wm_state_hidden_seen members.
3927
3928 2012-11-23 Eli Zaretskii <eliz@gnu.org>
3929
3930 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3931 of a literal "/". (Bug#12955)
3932 (gl-stamp): Invoke fc.exe directly, not through cmd.
3933
3934 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3935
3936 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3937 * dired.c: Assume HAVE_DIRENT_H.
3938 (NAMLEN): Remove, replacing with ...
3939 (dirent_namelen): New function. All uses changed. Use the GNU macro
3940 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3941 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3942 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3943 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3944 $(NT_INC)/dirent.h.
3945 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3946 * ndir.h: Rename to ../nt/inc/dirent.h.
3947 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3948 Do not include <dirent.h>; no longer needed.
3949 * w32.c: Include <dirent.h> rather than "ndir.h".
3950
3951 2012-11-23 Chong Yidong <cyd@gnu.org>
3952
3953 * xftfont.c (xftfont_open): Remove duplicate assignment.
3954
3955 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3956
3957 * alloc.c (Fgarbage_collect): Unblock input after clearing
3958 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3959 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3960 * msdos.c (IT_frame_up_to_date): Use it here...
3961 * w32term.c (w32_frame_up_to_date): ...here...
3962 * xterm.c (XTframe_up_to_date): ...and here...
3963 * nsterm.m (ns_frame_up_to_date): ...but not here.
3964 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3965 Adjust users.
3966 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3967 Do not check whether GC is in progress.
3968
3969 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3970
3971 * xdisp.c (window_buffer_changed): New function.
3972 (update_menu_bar, update_tool_bar): Use it to
3973 simplify large 'if' statements.
3974 (redisplay_internal): Generalize commonly used
3975 'tail' and 'frame' local variables.
3976
3977 2012-11-22 Eli Zaretskii <eliz@gnu.org>
3978
3979 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3980 with Windows system header.
3981
3982 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3983
3984 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3985 * alloc.c: Assume unistd.h exists.
3986 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3987 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3988 (getwd) [USG]: Remove; no longer needed.
3989 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3990 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3991 * w32.h (getcwd): Remove decl.
3992
3993 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3994
3995 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3996 Make it set selected_window as well.
3997 (update_tool_bar): Use it.
3998
3999 2012-11-21 Ken Brown <kbrown@cornell.edu>
4000
4001 * emacs.c (main): Set the G_SLICE environment variable for all
4002 Cygwin builds, not just GTK builds. See
4003 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
4004
4005 2012-11-21 Eli Zaretskii <eliz@gnu.org>
4006
4007 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4008 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
4009 Define for the MSVC compiler.
4010
4011 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
4012
4013 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4014 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
4015 dostounix_filename. Prevents crashes down the road, because
4016 dostounix_filename assumes it gets a unibyte string.
4017 Reported by Michel de Ruiter <michel@sentient.nl>, see
4018 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
4019
4020 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4021
4022 Conflate Qnil and Qunbound for `symbol-function'.
4023 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
4024 * lread.c (init_obarray): Set `function' fields to Qnil.
4025 * eval.c (Fcommandp): Ignore Qunbound.
4026 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
4027 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
4028 Test NILP rather than Qunbound.
4029 (Ffmakunbound): Set to Qnil.
4030 (Fsymbol_function): Never signal an error.
4031 (Finteractive_form): Ignore Qunbound.
4032
4033 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
4034
4035 * eval.c (interactive_p): Remove no-longer-used decl.
4036
4037 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4038
4039 * xdisp.c (buffer_shared): Adjust comment.
4040 (buffer_shared_and_changed): New function.
4041 (prepare_menu_bars, redisplay_internal): Use it to
4042 decide whether all windows or frames should be updated.
4043 (window_outdated): New function.
4044 (text_outside_line_unchanged_p, redisplay_window): Use it.
4045 (redisplay_internal): Likewise. Fix indentation.
4046
4047 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4048
4049 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4050 (syms_of_eval): Remove corresponding defsubr.
4051 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4052
4053 2012-11-19 Daniel Colascione <dancol@dancol.org>
4054
4055 * w32fns.c (Fx_file_dialog):
4056 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4057 cygwin_convert_file_name*.
4058
4059 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4060 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4061
4062 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4063
4064 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4065
4066 2012-11-18 Eli Zaretskii <eliz@gnu.org>
4067
4068 * w32select.c: Include w32common.h before w32term.h, so that
4069 windows.h gets included before w32term.h uses some of its
4070 features, see below.
4071
4072 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4073 New typedefs.
4074 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4075 New prototypes.
4076 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4077
4078 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
4079
4080 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4081 (ns_select): Return at once if events are held (Bug#12834).
4082
4083 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
4084
4085 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4086 Needed following 2012-10-20 change. (Bug#12902)
4087
4088 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
4089
4090 * w32proc.c (waitpid): Remove unused label get_result.
4091
4092 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
4093
4094 * makefile.w32-in (SYSWAIT_H): New macro.
4095 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4096 ($(BLD)/sysdep.$(O)): Update dependencies.
4097
4098 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4099
4100 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4101 * callproc.c (relocate_fd): Assume F_DUPFD.
4102 * emacs.c, term.c (O_RDWR): Remove.
4103 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4104 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4105 * nsterm.m: Assume <fcntl.h> exists.
4106 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4107 (create_pty, Fmake_network_process, server_accept_connection)
4108 (wait_reading_process_output, init_process_emacs):
4109 Assume O_NONBLOCK.
4110 (wait_reading_process_output): Put in a special case for WINDOWSNT
4111 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4112 It's not clear this is needed, but it's a more-conservative change.
4113 (create_process): Assume FD_CLOEXEC.
4114 (create_process, create_pty): Assume O_NOCTTY.
4115 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4116 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4117 Omit if not DOS_NT, since F_GETFL is not defined there.
4118 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4119 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4120 (O_NOCTTY): Remove.
4121 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4122 lack it, since gnulib guarantees this.
4123 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4124
4125 2012-11-17 Eli Zaretskii <eliz@gnu.org>
4126
4127 * w32.c (faccessat): Pretend that directories have the execute bit
4128 set. Emacs expects that, e.g., in files.el:cd-absolute.
4129
4130 * w32proc.c (create_child): Don't clip the PID of the child
4131 process to fit into an Emacs integer, as this is no longer a
4132 restriction.
4133 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4134 reaping only the process specified by PID argument, if that is
4135 positive. Use PID instead of dead_child to know which process to
4136 reap. Wait for the child to die only if WNOHANG is not in
4137 OPTIONS.
4138 (sys_select): Don't set dead_child.
4139
4140 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4141 as it is no longer needed.
4142
4143 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4144 no longer needed.
4145 (record_child_status_change): Remove the setting of
4146 record_at_most_one_child for the !WNOHANG case.
4147
4148 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4149
4150 Fix problems in ns port found by static checking.
4151 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4152 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4153 not to process group.
4154 (ns_select): Use emacs_write, not write, as that's more robust
4155 in the presence of signals.
4156 (fd_handler:): Check for read errors.
4157
4158 2012-11-16 Glenn Morris <rgm@gnu.org>
4159
4160 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4161
4162 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4163
4164 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4165
4166 2012-11-16 Eli Zaretskii <eliz@gnu.org>
4167
4168 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4169 use the same value of thread handle.
4170 (start_timer_thread): If the timer thread exited (due to error),
4171 clean up by closing the two handles it used. Duplicate the caller
4172 thread's handle here, so it gets duplicated only once, when
4173 launching the timer thread. Set priority of the timer thread, not
4174 the caller thread.
4175 (getitimer): Don't duplicate the caller thread's handle here.
4176 (Bug#12832)
4177
4178 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4179
4180 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4181 called (Bug#12834).
4182
4183 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4184
4185 Remove no-longer-used pty_max_bytes variable.
4186 * process.c (pty_max_bytes): Remove; unused.
4187 (send_process): Do not set it.
4188
4189 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
4190
4191 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4192 Update dependencies.
4193
4194 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4195
4196 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4197 This follows up on the 2012-09-29 patch that removed indirection
4198 for the 'function' field. Reported by Sergey Vinokurov in
4199 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4200
4201 2012-11-14 Eli Zaretskii <eliz@gnu.org>
4202
4203 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4204 different name, as the MS runtime does not have such a function,
4205 and probably never will.) All callers changed. Ignore DIRFD
4206 value if PATH is an absolute file name, to match Posix spec
4207 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4208 symlinks.
4209
4210 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4211
4212 * xdisp.c (echo_area_display, redisplay_internal):
4213 Omit redundant check whether frame_garbaged is set.
4214
4215 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4216
4217 Use faccessat, not access, when checking file permissions (Bug#12632).
4218 This fixes a bug that has been present in Emacs since its creation.
4219 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4220 which must set some sort of record. (Torek's bug report was against
4221 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4222 same common flaw.) See Torek's Usenet posting
4223 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4224 Posted: Fri Apr 8 14:18:56 1983.
4225 * Makefile.in (LIB_EACCESS): New macro.
4226 (LIBES): Use it.
4227 * callproc.c (init_callproc):
4228 * charset.c (init_charset):
4229 * fileio.c (check_existing, check_executable, check_writable)
4230 (Ffile_readable_p):
4231 * lread.c (openp, load_path_check):
4232 * process.c (allocate_pty):
4233 * xrdb.c (file_p):
4234 Use effective UID when checking permissions, not real UID.
4235 * callproc.c (init_callproc):
4236 * charset.c (init_charset):
4237 * lread.c (load_path_check, init_lread):
4238 Test whether directories are accessible, not merely whether they exist.
4239 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4240 * fileio.c (check_existing, check_executable, check_writable)
4241 (Ffile_readable_p):
4242 Use symbolic names instead of integers for the flags, as they're
4243 portable now.
4244 (check_writable): New arg AMODE. All uses changed.
4245 Set errno on failure.
4246 (Ffile_readable_p): Use faccessat, not stat + open + close.
4247 (Ffile_writable_p): No need to call check_existing + check_writable.
4248 Just call check_writable and then look at errno. This saves a syscall.
4249 dir should never be nil; replace an unnecessary runtime check
4250 with an eassert. When checking the parent directory of a nonexistent
4251 file, check that the directory is searchable as well as writable, as
4252 we can't create files in unsearchable directories.
4253 (file_directory_p): New function, which uses 'stat' on most platforms
4254 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4255 (Ffile_directory_p, Fset_file_times): Use it.
4256 (file_accessible_directory_p): New function, which uses a single
4257 syscall for efficiency.
4258 (Ffile_accessible_directory_p): Use it.
4259 * xrdb.c (file_p): Use file_directory_p.
4260 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4261 * lread.c (openp): When opening a file, use fstat rather than
4262 stat, as that avoids a permissions race. When not opening a file,
4263 use file_directory_p rather than stat.
4264 (dir_warning): First arg is now a usage string, not a format.
4265 Use errno. All uses changed.
4266 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4267 that merely introduced a race.
4268 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4269 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4270 and similarly for the other O_* flags.
4271 * w32.c (sys_faccessat): Rename from sys_access and switch to
4272 faccessat's API. All uses changed.
4273 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4274 (magic_db): Rename from magic_file_p.
4275 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4276 char *, so that we don't have to test for file existence
4277 separately from opening the file for reading. This removes a race
4278 fixes a permission-checking problem, and simplifies the code.
4279 All uses changed.
4280 (file_p): Remove; no longer needed.
4281
4282 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4283
4284 Omit glyphs initialization at startup.
4285 * dispnew.c (glyphs_initialized_initially_p): Remove.
4286 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4287 (Fredraw_frame): Move actual code from here...
4288 (redraw_frame): ...to here. Add eassert. Adjust comment.
4289 (Fredraw_display): Use redraw_frame.
4290 * xdisp.c (clear_garbaged_frames): Likewise.
4291
4292 2012-11-13 Eli Zaretskii <eliz@gnu.org>
4293
4294 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4295 passed to pint2str and pint2hrstr to be at most the size of the
4296 frame's decode_mode_spec_buffer. This avoids crashes with very
4297 large values of FIELD_WIDTH argument to decode_mode_spec.
4298 (Bug#12867)
4299
4300 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4301
4302 Fix a race with verify-visited-file-modtime (Bug#12863).
4303 Since at least 1991 Emacs has ignored an mtime difference of no
4304 more than one second, but my guess is that this was to work around
4305 file system bugs that were fixed long ago. Since the race is
4306 causing problems now, let's remove that code.
4307 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4308 whose time stamp is off by no more than a second. Insist that the
4309 file time stamps match exactly.
4310
4311 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4312
4313 * frame.h (struct frame): Convert external_tool_bar member to
4314 1-bit unsigned bitfield.
4315 * termhooks.h (struct terminal): Remove mouse_moved member since
4316 all users are long dead. Adjust comment on mouse_position_hook.
4317
4318 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4319
4320 Simplify by using FOR_EACH_FRAME here and there.
4321 * frame.c (next_frame, prev_frame, other_visible_frames)
4322 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4323 * w32term.c (x_window_to_scroll_bar): Likewise.
4324 * window.c (window_list): Likewise.
4325 * xdisp.c (x_consider_frame_title): Likewise.
4326 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4327 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4328 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4329 * xmenu.c (menubar_id_to_frame): Likewise.
4330 * xselect.c (frame_for_x_selection): Likewise.
4331 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4332 (x_window_to_menu_bar): Likewise.
4333 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4334
4335 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4336
4337 * data.c (Qdefalias_fset_function): Now static.
4338
4339 Another tweak to vectorlike_header change.
4340 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4341 Remove, and replace all uses with ...
4342 (next_in_free_list, set_next_in_free_list):
4343 New functions, which respect C's aliasing rules better.
4344
4345 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4346
4347 * window.c (list4i): Rename from 'quad'. All uses changed.
4348 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4349
4350 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4351
4352 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4353 warning about mixing declarations and code in ISO C90.
4354
4355 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4356
4357 * window.c (Fsplit_window_internal): Set combination limit of
4358 new parent window to t iff Vwindow_combination_limit is t;
4359 fixing a regression introduced with the change from 2012-09-22.
4360 (Fset_window_combination_limit): Fix doc-string.
4361
4362 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4363
4364 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4365 amount when the scroll margins are too large. When scrolling
4366 backwards in the buffer, give up if cannot reach point or the
4367 scroll margin within a reasonable number of screen lines.
4368 Fixes point position in window under scroll-up/down-aggressively when
4369 point is positioned many lines beyond the window top/bottom.
4370 (Bug#12811)
4371
4372 * ralloc.c (relinquish): If real_morecore fails to return memory
4373 to the system, don't crash; instead, leave the last heap
4374 unchanged and return. (Bug#12774)
4375
4376 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4377
4378 * lisp.h (AUTOLOADP): New macro.
4379 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4380 * data.c (Ffset): Remove special ad-advice-info handling.
4381 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4382 (Fsubr_arity): CSE.
4383 (Finteractive_form): Simplify.
4384 (Fquo): Don't insist on having at least 2 arguments.
4385 (Qdefalias_fset_function): New var.
4386
4387 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4388
4389 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4390
4391 * nsfont.m (Qcondensed, Qexpanded): New variables.
4392 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4393 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4394
4395 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4396
4397 Fix recently introduced crash on MS-Windows (Bug#12839).
4398 * w32term.h (struct scroll_bar): Use convenient header.
4399 (SCROLL_BAR_VEC_SIZE): Remove.
4400 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4401
4402 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4403
4404 Tweak last vectorlike_header change.
4405 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4406 vectorlike object on the free list. This is introduced to avoid
4407 some (but not all) pointer casting and aliasing problems, see
4408 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4409 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4410 objects.
4411 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4412
4413 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4414
4415 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4416 been removed, so remove them here also.
4417
4418 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4419
4420 * doc.c (Fdocumentation): Handle new property
4421 dynamic-docstring-function to replace the old ad-advice-info.
4422
4423 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4424
4425 * fns.c (Qeql, hashtest_eq): Now static.
4426
4427 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4428
4429 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4430 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4431 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4432 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4433
4434 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4435
4436 Use same hash function for hashfn_profiler as for hash_string etc.
4437 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4438 * lisp.h (sxhash_combine): New inline function, with the contents
4439 of the old SXHASH_COMBINE.
4440 * profiler.c (hashfn_profiler): Use it, instead of having a
4441 special hash function containing a comparison that always yields 1.
4442
4443 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4444
4445 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4446 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4447 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4448 Remove unused vars.
4449
4450 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4451
4452 * image.c (xpm_make_color_table_h): Fix compiler error because
4453 make_hash_table changed.
4454
4455 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4456
4457 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4458
4459 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4460
4461 Use ad-hoc comparison function for the profiler's hash-tables.
4462 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4463 (make_log): Use them.
4464 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4465 call Fequal any more.
4466 (Ffunction_equal): New function.
4467 (cmpfn_profiler, hashfn_profiler): New functions.
4468 (syms_of_profiler): Initialize them.
4469 * lisp.h (struct hash_table_test): New struct.
4470 (struct Lisp_Hash_Table): Use it.
4471 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4472 * fns.c (make_hash_table): Take a struct to describe the test.
4473 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4474 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4475 (hash_lookup, hash_remove_from_table): Move assertion checking of
4476 hashfn result here. Check hash-equality before calling cmpfn.
4477 (Fmake_hash_table): Adjust call to make_hash_table.
4478 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4479 (syms_of_fns): Initialize them.
4480 * emacs.c (main): Move syms_of_fns earlier.
4481 * xterm.c (syms_of_xterm):
4482 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4483 * print.c (print_object): Adjust to new hash-table struct.
4484 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4485
4486 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4487
4488 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4489 value of w32-scroll-lock-modifier is neither nil nor one of the
4490 known key modifiers. (Bug#12806)
4491
4492 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4493
4494 Shrink struct vectorlike_header to the only size field.
4495 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4496 Adjust comment.
4497 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4498 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4499 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4500 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4501 information from the vector header. Adjust comment.
4502 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4503 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4504 layout.
4505 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4506 (struct vectorlike_header): Remove next member. Adjust comment.
4507 (struct Lisp_Subr): Add convenient header. Adjust comment.
4508 (allocate_pseudovector): Adjust prototype.
4509 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4510 (sweep_string, lisp_malloc): Remove useless prototypes.
4511 (enum mem_type): Adjust comment.
4512 (NEXT_IN_FREE_LIST): New macro.
4513 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4514 (Fmake_bool_vector): Likewise.
4515 (struct large_vector): New type to represent allocation unit for
4516 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4517 (large_vectors): Change type to struct large_vector.
4518 (allocate_vector_from_block): Simplify.
4519 (PSEUDOVECTOR_NBYTES): Replace with...
4520 (vector_nbytes): ...new function. Adjust users.
4521 (sweep_vectors): Adjust processing of large vectors.
4522 (allocate_vectorlike): Likewise.
4523 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4524 Add easserts. Adjust XSETPVECTYPESIZE usage.
4525 (allocate_buffer): Use BUFFER_PVEC_INIT.
4526 (live_vector_p): Adjust to match large vector.
4527 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4528 * buffer.h (struct buffer): Add next member.
4529 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4530 New macros.
4531 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4532 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4533 (copy_hash_table): Adjust to match vector header change.
4534 * lread.c (defsubr): Use XSETPVECTYPE.
4535 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4536 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4537 (xvecsize): New command.
4538
4539 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4540
4541 * keyboard.c (event_to_kboard): Do not dereference
4542 frame_or_window field of SELECTION_REQUEST_EVENT
4543 and SELECTION_CLEAR_EVENT events (Bug#12814).
4544 * xterm.h (struct selection_input_event): Adjust comment.
4545
4546 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4547
4548 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4549 such as Scroll Lock, if the respective keys are treated as
4550 function keys, not as modifiers. This avoids destroying non-ASCII
4551 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4552
4553 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4554
4555 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4556
4557 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4558
4559 Restore some duplicate definitions (Bug#12814).
4560 This undoes part of the 2012-11-03 changes. Some people build
4561 with plain -g rather than with -g3, and they need the duplicate
4562 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4563 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4564 Define as macros, as well as as enums or as constants.
4565
4566 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4567
4568 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4569 to keypad keys (Bug#12816).
4570
4571 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4572
4573 Minor adjustments of recently-changed frame functions.
4574 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4575 known to be a frame (we're in the FRAMEP branch).
4576 * lisp.h (Qframep): Remove decl. frame.h declares this.
4577 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4578 since they're meant for Lisp fixnum values.
4579
4580 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4581
4582 * window.c (Fwindow_combination_limit): Revert to the only
4583 required argument and adjust docstring as suggested in
4584 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4585 by Martin Rudalics <rudalics@gmx.at>.
4586
4587 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4588
4589 Widely used frame validity and checking functions.
4590 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4591 * frame.c (decode_live_frame, decode_any_frame): New functions.
4592 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4593 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4594 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4595 (Fframe_pointer_visible_p): Use decode_any_frame.
4596 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4597 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4598 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4599 (Fframe_focus): Likewise. Allow zero number of arguments.
4600 Adjust docstring.
4601 (frame_buffer_list, frame_buffer_predicate): Remove.
4602 * lisp.h (frame_buffer_predicate): Remove prototype.
4603 * buffer.c (Fother_buffer): Use decode_any_frame.
4604 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4605 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4606 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4607 (Fclose_font, Ffont_info): Use decode_live_frame.
4608 * fontset.c (check_fontset_name): Likewise.
4609 * terminal.c (Fframe_terminal): Likewise.
4610 * w32fns.c (check_x_frame): Likewise.
4611 * window.c (Fminibuffer_window, Fwindow_at)
4612 (Fcurrent_window_configuration): Likewise.
4613 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4614 Likewise. Allow zero number of arguments. Adjust docstring.
4615 * dispnew.c (Fredraw_frame): Likewise.
4616 * xfaces.c (frame_or_selected_frame): Remove.
4617 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4618 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4619 (Fframe_face_alist): Use decode_live_frame.
4620 * xfns.c (check_x_frame): Likewise.
4621
4622 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4623
4624 * window.c (quad): New function.
4625 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4626 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4627 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4628 (Fwindow_line_height): Use it.
4629 (Fwindow_fringes): Use list3.
4630 (Fwindow_scroll_bars): Use list4.
4631 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4632 (Fwindow_combination_limit): Allow zero number of arguments.
4633
4634 2012-11-05 Eli Zaretskii <eliz@gnu.org>
4635
4636 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4637
4638 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
4639 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
4640 file descriptor 2 for standard error. (Bug#12805)
4641
4642 2012-11-05 Chong Yidong <cyd@gnu.org>
4643
4644 * process.c (wait_reading_process_output): Revert previous change.
4645
4646 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4647
4648 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4649 This removes code that has been obsolete since around 1990.
4650 * callproc.c (Fcall_process):
4651 * emacs.c (main):
4652 * process.c (create_process):
4653 * term.c (dissociate_if_controlling_tty):
4654 Assume setsid exists.
4655 * callproc.c (child_setup): Assume setpgid exists and behaves as
4656 per POSIX.1-1988 or later.
4657 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4658 * emacs.c (shut_down_emacs):
4659 * sysdep.c (sys_suspend, init_foreground_group):
4660 Assume getpgrp behaves as per POSIX.1-1998 or later.
4661 * msdos.c (setpgrp): Remove.
4662 (tcgetpgrp, setpgid, setsid): New functions.
4663 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4664 * term.c (no_controlling_tty): Remove; unused.
4665 * w32proc.c (setpgrp): Remove.
4666 (setsid, tcgetpgrp): New functions.
4667
4668 Simplify by assuming __fpending.
4669 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4670 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4671 Do not assume that __fpending's result fits in int.
4672
4673 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4674
4675 Remove EMACS_OUTQSIZE+sleep hack.
4676 * dispnew.c (update_frame_1): Remove hack for terminals slower
4677 than 2400 bps, which throttled Emacs by having it sleep.
4678 This code hasn't worked since at least 2007, when the multi-tty stuff
4679 was added, and anyway those old terminals are long dead.
4680 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4681 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4682
4683 Fix data-loss with --version (Bug#9574).
4684 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4685 as we can't assume that emacs_strerror is initialized, and strerror
4686 is good enough here.
4687 (main): Invoke atexit earlier, to catch earlier instances of
4688 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4689
4690 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4691
4692 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4693 (keyDown): Remap keypad keys to X11 virtual key codes.
4694
4695 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4696
4697 Fix data-loss with --batch (Bug#9574).
4698 * emacs.c: Include <close-stream.h>.
4699 (close_output_streams): New function.
4700 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4701 and handles errors appropriately.
4702 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4703 does that now.
4704
4705 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4706 The symptom is a diagnostic "GLib-WARNING **: In call to
4707 g_spawn_sync(), exit status of a child process was requested but
4708 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4709 waitpid(), so exit status can't be returned." The diagnostic
4710 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4711 The real bug is a race condition between Emacs and glib: Emacs
4712 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4713 so that glib can't find it. Work around the bug by invoking
4714 waitpid only on subprocesses that Emacs itself creates.
4715 * process.c (create_process, record_child_status_change):
4716 Don't use special value -1 in pid field, as the caller now must
4717 know the pid rather than having the callee infer it.
4718 The inference was sometimes incorrect anyway, due to another race.
4719 (create_process): Set new 'alive' member if child is created.
4720 (process_status_retrieved): New function.
4721 (record_child_status_change): Use it.
4722 Accept negative 1st argument, which means to wait for the
4723 processes that Emacs already knows about. Move special-case code
4724 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4725 processes that have already been waited for, by testing and
4726 clearing new 'alive' member.
4727 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4728 now does this internally.
4729 (handle_child_signal): Let record_child_status_change do all
4730 the work, since we do not want to reap all exited child processes,
4731 only the child processes that Emacs itself created.
4732 * process.h (Lisp_Process): New boolean member 'alive'.
4733
4734 Omit duplicate definitions no longer needed with gcc -g3.
4735 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4736 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4737 Define only as macros. There's no longer any need to also define
4738 these symbols as enums or as constants, since we now assume
4739 gcc -g3 when debugging.
4740
4741 2012-11-03 Eli Zaretskii <eliz@gnu.org>
4742
4743 * lisp.mk: Adjust comments to the fact that term/internal is now
4744 loaded from loadup.el.
4745
4746 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4747 (msdos_fatal_signal): New function.
4748 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4749 its argument list.
4750
4751 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4752 for GCC versions before 4.
4753 (emacs_raise): Define to call msdos_fatal_signal.
4754
4755 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4756 iterator when starting in the middle of a display or overlay
4757 string. (Bug#12745)
4758
4759 2012-11-03 Chong Yidong <cyd@gnu.org>
4760
4761 * process.c (wait_reading_process_output): Clean up the last
4762 change.
4763
4764 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4765
4766 * process.c (wait_reading_process_output): Avoid a race condition
4767 with SIGIO delivery (Bug#11536).
4768
4769 2012-11-03 Chong Yidong <cyd@gnu.org>
4770
4771 * buffer.c (cursor_type): Untabify docstring.
4772
4773 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4774
4775 * frame.h (struct frame): Drop can_have_scroll_bars member
4776 which is meaningless for a long time. Adjust comments.
4777 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4778 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4779
4780 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4781
4782 * window.c (decode_next_window_args): Update window arg after
4783 calling decode_live_window and so fix crash reported at
4784 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4785 by Juanma Barranquero <lekktu@gmail.com>.
4786 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4787 * font.c (Ffont_at): Likewise.
4788
4789 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4790
4791 * widget.c (resize_cb): New function.
4792 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4793 (EmacsFrameResize): Check if all is up to date before changing frame
4794 size.
4795
4796 2012-11-02 Eli Zaretskii <eliz@gnu.org>
4797
4798 Implement backtrace output for fatal errors on MS-Windows.
4799 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4800 (BACKTRACE_LIMIT_MAX): New macro.
4801 (w32_backtrace): New function.
4802 (emacs_abort): Use w32_backtrace when the user chooses not to
4803 attach a debugger. Update the text of the abort dialog.
4804
4805 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4806
4807 Window-related stuff cleanup here and there.
4808 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4809 Use decode_any_window.
4810 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4811 * xdisp.c (Fformat_mode_line): Likewise.
4812 * font.c (Ffont_at): Use decode_live_window.
4813 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4814 * window.c (decode_next_window_args): Likewise.
4815 (decode_any_window): Remove static.
4816 * window.h (decode_any_window): Add prototype.
4817 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4818 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4819 respectively.
4820
4821 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4822
4823 Remove pad from struct input_event.
4824 * termhooks.h (struct input_event): Remove padding field.
4825 Adjust comment.
4826 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4827 member is never cons for a long time. Adjust comment.
4828 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4829 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4830 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4831 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4832
4833 2012-11-01 Eli Zaretskii <eliz@gnu.org>
4834
4835 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4836
4837 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4838
4839 Fix crash when using Emacs as commit editor for git (Bug#12697).
4840 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4841 and it is configured in conf_post.h.
4842 (Fcall_process): Don't invoke both setsid and setpgid; the former
4843 is enough, if it exists.
4844 * callproc.c (Fcall_process, child_setup):
4845 * process.c (create_process): Use setpgid.
4846 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4847 for the real thing.
4848 * dispnew.c (init_display): Initialize the foreground group
4849 if we are running a tty display.
4850 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4851 * lisp.h (init_foreground_group): New decl.
4852 * sysdep.c (inherited_pgroup): New static var.
4853 (init_foreground_group, tcsetpgrp_without_stopping)
4854 (narrow_foreground_group, widen_foreground_group): New functions.
4855 (init_sys_modes): Narrow foreground group.
4856 (reset_sys_modes): Widen foreground group.
4857
4858 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
4859
4860 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4861
4862 2012-10-31 Martin Rudalics <rudalics@gmx.at>
4863
4864 * minibuf.c (read_minibuf): Restore current buffer since
4865 choose_minibuf_frame calling Fset_frame_selected_window may
4866 change it (Bug#12766).
4867
4868 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4869
4870 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4871
4872 2012-10-30 Kenichi Handa <handa@gnu.org>
4873
4874 * font.c (Ffont_at): If WINDOW is specified and it is not
4875 displaying the current buffer, signal an error.
4876
4877 2012-10-29 Daniel Colascione <dancol@dancol.org>
4878
4879 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4880 In preparation for fixing bug#12739, move these functions from
4881 here...
4882
4883 * coding.h, coding.c: ... to here, and compile them only when
4884 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4885 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
4886
4887 2012-10-28 Eli Zaretskii <eliz@gnu.org>
4888
4889 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4890 (timer_loop, getitimer, setitimer): Use it instead of
4891 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4892 'clock'.
4893 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4894 literal 10000.
4895
4896 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4897
4898 * nsterm.m (NO_APPDEFINED_DATA): New define.
4899 (last_appdefined_event_data): New variable
4900 (last_appdefined_event): Remove.
4901 (ns_select): Initialize t from last_appdefined_event_data instead
4902 of [last_appdefined_event data1].
4903 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4904 remove last_appdefined_event (Bug#12698).
4905
4906 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4907
4908 * frame.c (x_set_font): Catch internal error.
4909
4910 2012-10-27 Eli Zaretskii <eliz@gnu.org>
4911
4912 Avoid overflow in w32 implementation of interval timers.
4913 When possible, for ITIMER_PROF count only times the main thread
4914 actually executes.
4915 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
4916 'volatile ULONGLONG' types. All the other data which was
4917 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
4918 (GetThreadTimes_Proc): New typedef.
4919 (w32_get_timer_time): New function, returns a suitable time value
4920 for the timer.
4921 (timer_loop): Enter critical section when accessing ULONGLONG
4922 values of the itimer_data struct, as these accesses are no longer
4923 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4924 Remove unused variable.
4925 (init_timers): Initialize s_pfn_Get_Thread_Times.
4926 (start_timer_thread): Don't assign itimer->caller_thread here.
4927 (getitimer): Assign itimer->caller_thread here.
4928 (setitimer): Always call getitimer to get the value of ticks_now.
4929 (sys_spawnve): Avoid compiler warning about format mismatch.
4930
4931 2012-10-26 Eli Zaretskii <eliz@gnu.org>
4932
4933 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4934 mouse movement events if the menu bar is active. This avoids
4935 producing a busy "hour-glass" cursor by Windows if the mouse
4936 pointer is positioned over a tooltip shown for some menu item.
4937
4938 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4939
4940 Don't assume process IDs fit in int.
4941 * emacs.c (shut_down_emacs) [!DOS_NT]:
4942 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4943 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4944 Use pid_t, not int, to store process IDs, as 'int'
4945 is not wide enough on a few platforms (e.g., AIX and IRIX).
4946
4947 2012-10-23 Kenichi Handa <handa@gnu.org>
4948
4949 The following change is to make face-font-rescale-alist work
4950 correctly for non-ASCII fonts.
4951
4952 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4953 (font_open_for_lface): Handle Vface_font_rescale_alist.
4954
4955 2012-10-23 Chong Yidong <cyd@gnu.org>
4956
4957 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4958
4959 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4960
4961 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4962 for screen font.
4963 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4964
4965 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4966 event (Bug#12681).
4967
4968 2012-10-21 Glenn Morris <rgm@gnu.org>
4969
4970 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4971
4972 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4973
4974 Port to OpenBSD 5.1.
4975 * frame.c (Fmouse_position, Fmouse_pixel_position):
4976 * xdisp.c (produce_stretch_glyph):
4977 Declare local vars only when they're needed.
4978 This is clearer and avoids a warning on OpenBSD about unused vars.
4979 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4980 This is safer, and avoids OpenBSD warnings about unused vars.
4981 * keyboard.c (record_menu_key): Remove unnecessary decl.
4982 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4983 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4984 as our definition clashes with OpenBSD's.
4985 * xfaces.c (load_face_colors, check_lface_attrs)
4986 (get_lface_attributes_no_remap, get_lface_attributes)
4987 (lface_fully_specified_p, x_supports_face_attributes_p)
4988 (tty_supports_face_attributes_p, face_fontset, realize_face)
4989 (realize_x_face, realize_tty_face):
4990 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4991 merely Lisp_Object *. This is more informative and avoids
4992 a warning on OpenBSD about accessing beyond an object's size.
4993
4994 2012-10-20 Chong Yidong <cyd@gnu.org>
4995
4996 * lread.c (Fload): Doc fix (Bug#12592).
4997
4998 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4999
5000 * font.c (Ffont_at): Fix previous change.
5001
5002 2012-10-19 Eli Zaretskii <eliz@gnu.org>
5003
5004 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
5005 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
5006 for the reasons.
5007
5008 * alloc.c (NSTATICS): Decrease to 0x800.
5009
5010 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
5011
5012 * fns.c (Fnreverse): Include the problem element when signaling an
5013 error (bug#12677).
5014
5015 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
5016
5017 * nsterm.m (ns_select): Check writefds before call to
5018 FD_ISSET (Bug#12668).
5019
5020 2012-10-18 Daniel Colascione <dancol@dancol.org>
5021
5022 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
5023 (staticpro): If we run out of staticpro slots, die with an
5024 informative error instead of just calling emacs_abort.
5025
5026 2012-10-18 Martin Rudalics <rudalics@gmx.at>
5027
5028 Fix two flaws reported by Dmitry Antipov.
5029 * window.c (Ftemp_output_buffer_show): Remove.
5030 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
5031 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
5032
5033 2012-10-17 Eli Zaretskii <eliz@gnu.org>
5034
5035 * makefile.w32-in ($(BLD)/w32.$(O)):
5036 ($(BLD)/vm-limit.$(O)):
5037 ($(BLD)/term.$(O)):
5038 ($(BLD)/unexw32.$(O)):
5039 ($(BLD)/fileio.$(O)):
5040 ($(BLD)/dispnew.$(O)): Update dependencies.
5041
5042 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5043 Add prototypes.
5044
5045 * w32proc.c: Include ctype.h.
5046
5047 * w32.h (init_environment, check_windows_init_file)
5048 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5049 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5050 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5051 (sys_link): Add prototypes.
5052
5053 * w32.c: Include w32select.h.
5054 (sys_access, e_malloc, sys_select): Add prototypes.
5055 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5056
5057 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5058
5059 * unexw32.c: Include lisp.h and w32.h.
5060
5061 * term.c [WINDOWSNT]: Include w32term.h.
5062
5063 * process.c [WINDOWSNT]: Add prototype of sys_select.
5064
5065 * fileio.c [WINDOWSNT]: Include w32.h.
5066
5067 * dispnew.c [WINDOWSNT]: Include w32.h.
5068
5069 * cygw32.c (Fcygwin_convert_path_to_windows)
5070 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5071 Lisp_Object values. (Bug#12661)
5072
5073 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5074 to Lisp_Object. (Bug#12661)
5075
5076 2012-10-17 Kenichi Handa <handa@gnu.org>
5077
5078 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5079 invalidate.
5080
5081 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5082
5083 * buffer.c (Fkill_buffer): When unchaining the marker,
5084 reset its buffer pointer to NULL (Bug#12652).
5085
5086 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5087
5088 Do not verify indirection counters of killed buffers (Bug#12579).
5089 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5090 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5091
5092 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5093
5094 * alloc.c (Fmake_byte_code): Fix typo in comment.
5095 * print.c (print_interval): Define as static to match prototype.
5096 * indent.c (disptab_matches_widthtab, recompute_width_table):
5097 Convert to eassert.
5098
5099 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5100
5101 * editfns.c (get_system_name): Remove.
5102 * lisp.h (get_system_name): Remove prototype.
5103 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5104 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5105
5106 2012-10-15 Daniel Colascione <dancol@dancol.org>
5107
5108 * dbusbind.c: Add comment explaining reason for previous change.
5109
5110 2012-10-15 Martin Rudalics <rudalics@gmx.at>
5111
5112 * window.c (Fwindow_end): Rewrite check whether cached position
5113 can be used (Bug#12600).
5114 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5115 Set windows_or_buffers_changed.
5116
5117 2012-10-15 Daniel Colascione <dancol@dancol.org>
5118
5119 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5120 enabled by undefining the symbol "interface", which the platform
5121 headers define to something incompatible.
5122
5123 2012-10-14 Daniel Colascione <dancol@dancol.org>
5124
5125 * image.c (init_tiff_functions, init_imagemagick_functions)
5126 (init_svg_functions): Fix cygw32 build break by using these
5127 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5128
5129 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5130
5131 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5132
5133 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5134
5135 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5136
5137 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5138
5139 * coding.c (detect_coding): Set coding->id before calling
5140 this->detector.
5141
5142 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5143
5144 * fileio.c: Formatting fixes.
5145
5146 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5147
5148 Fix some stat-related races.
5149 * fileio.c (Fwrite_region): Avoid race condition if a file is
5150 removed or renamed by some other process immediately after Emacs
5151 writes it but before Emacs stats it. Do not assume that stat (or
5152 fstat) succeeds.
5153 * image.c (slurp_file): Resolve the file name with fopen + fstat
5154 rather than stat + fopen.
5155 (pbm_read_file) [0]: Remove unused code with stat race.
5156 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5157 Remove ineffective code with stat race.
5158
5159 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5160
5161 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5162
5163 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5164
5165 * nsterm.m (hold_event_q): New static variable.
5166 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5167 ! q_event_ptr.
5168 (hold_event): New function.
5169 (ns_read_socket): If hold_event_q have events, store them and
5170 return (Bug#12384).
5171 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5172 is zero (Bug#12384).
5173
5174 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
5175
5176 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5177
5178 2012-10-12 Eli Zaretskii <eliz@gnu.org>
5179
5180 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5181
5182 * fileio.c (check_existing): New function.
5183 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5184 instead of calling 'stat', when what's needed is to check whether
5185 a file exists. This avoids expensive system calls on MS-Windows.
5186 (Bug#12587)
5187
5188 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5189
5190 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5191 determine whether a file exists and is not a directory.
5192
5193 * lisp.h (check_existing): Add prototype.
5194
5195 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5196
5197 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5198
5199 2012-10-12 Glenn Morris <rgm@gnu.org>
5200
5201 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5202
5203 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5204
5205 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5206
5207 * eval.c (Fautoload): Remember previous autoload status in load-history.
5208
5209 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5210
5211 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5212 * lread.c (load_each_byte, new_backquote_flag, readchar)
5213 (read_filtered_event, lisp_file_lexically_bound_p)
5214 (safe_to_load_version, Fload, complete_filename_p, openp)
5215 (build_load_history, readevalloop, read_escape, read1)
5216 (string_to_number, read_vector, read_list):
5217 * macros.c (Fstart_kbd_macro):
5218 * marker.c (CONSIDER):
5219 * menu.c (parse_single_submenu, digest_single_submenu)
5220 (find_and_return_menu_selection, Fx_popup_menu):
5221 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5222 (Ftry_completion):
5223 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5224 (ns_menu_show):
5225 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5226 (xmenu_show, xdialog_show):
5227 Use bool for booleans.
5228 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5229 as it's not a predicate. All uses changed. Omit unnecessary
5230 buffer termination.
5231
5232 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5233
5234 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5235 (save_excursion_restore): Do not restore mark if it was not saved.
5236
5237 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5238
5239 * marker.c (cached_modiff): EMACS_INT, not int.
5240
5241 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5242 instead of having a wrong decl.
5243 * nsmenu.m (waiting_for_input): Remove wrong decl.
5244
5245 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5246
5247 keyboard.c, keymap.c: Use bool for booleans.
5248 * dispnew.c (sit_for): Distinguish between 3-way display_option
5249 and boolean do_display.
5250 * keyboard.c (single_kboard, this_command_key_count_reset)
5251 (waiting_for_input, echoing, immediate_quit, input_pending)
5252 (interrupt_input, interrupts_deferred, pop_kboard)
5253 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5254 (command_loop_1, adjust_point_for_property)
5255 (safe_run_hooks_error, input_polling_used, read_char):
5256 (help_char_p, readable_events, kbd_buffer_events_waiting)
5257 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5258 (lucid_event_type_list_p, get_input_pending):
5259 (gobble_input, menu_separator_name_p, menu_bar_item)
5260 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5261 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5262 (keyremap_step, test_undefined, read_key_sequence)
5263 (detect_input_pending, detect_input_pending_ignore_squeezables)
5264 (detect_input_pending_run_timers, requeued_events_pending_p)
5265 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5266 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5267 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5268 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5269 (accessible_keymaps_1, Fkey_description, push_key_description):
5270 (shadow_lookup, struct where_is_internal_data)
5271 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5272 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5273 (describe_map, describe_vector):
5274 * menu.c (single_menu_item):
5275 * nsmenu.m (ns_update_menubar):
5276 * process.c (wait_reading_process_output):
5277 * search.c (scan_buffer, scan_newline):
5278 Use bool for boolean.
5279 * keyboard.c (timers_run, swallow_events)
5280 (detect_input_pending_run_timers):
5281 * process.c (wait_reading_process_output):
5282 Use unsigned for counter where wraparound-on-overflow is desired,
5283 since unsigned is guaranteed to have that behavior and signed is not.
5284 (read_char): Use ptrdiff_t for string length.
5285 (get_input_pending): Remove first argument, since it was always
5286 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5287 and behave as if it had that value. Return new value of
5288 input_pending. All callers changed.
5289 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5290 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5291 a string length.
5292 * keymap.c (push_key_description): Omit last arg, which was always 1.
5293 All callers changed.
5294
5295 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5296
5297 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
5298
5299 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5300 ($(BLD)/term.$(O)): Update dependencies.
5301
5302 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5303
5304 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5305 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5306 initializer for PVEC_NORMAL_VECTOR.
5307
5308 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5309
5310 Clean out old termopts cruft.
5311 * termopts.h (flow_control, meta_key): Remove unused decls.
5312 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5313 Don't include termopts.h.
5314
5315 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5316
5317 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5318
5319 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5320
5321 * commands.h (immediate_quit): Remove duplicate decl.
5322
5323 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5324
5325 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5326 caching.
5327 (nsfont_open): Remove setting of Vfonts_in_cache.
5328 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5329
5330 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5331
5332 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5333 match what GetLastError returns. Explain why the function is
5334 needed.
5335
5336 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5337 'is_tooltip_frame', to avoid confusion with its global namesake.
5338
5339 2012-10-08 Daniel Colascione <dancol@dancol.org>
5340
5341 * xdisp.c (start_hourglass): Call w32_note_current_window when
5342 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5343 build that caused Emacs to display the hourglass cursor forever.
5344
5345 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5346 which is broken under remote desktop, calculate the number of
5347 colors available for a display based on the display's number of
5348 planes and number of bits per pixel per plane. (bug#10397).
5349
5350 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5351
5352 * nsfont.m (Vfonts_in_cache): New variable.
5353 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5354 are used. Add cached fonts to Vfonts_in_cache.
5355 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5356
5357 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5358
5359 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5360 in nt/config.nt.
5361 (FONT_H): Define after FRAME_H.
5362 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5363 Update dependencies.
5364
5365 * w32term.c: Remove leftover declaration of keyboard_codepage.
5366
5367 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5368
5369 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5370 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5371 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5372 (GLOBAL_SOURCES): Add cygw32.c.
5373 ($(BLD)/unexw32.$(O)):
5374 ($(BLD)/w32.$(O)):
5375 ($(BLD)/w32console.$(O)):
5376 ($(BLD)/w32fns.$(O)):
5377 ($(BLD)/w32heap.$(O)):
5378 ($(BLD)/w32menu.$(O)):
5379 ($(BLD)/w32proc.$(O)): Add w32common.h.
5380
5381 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5382 'const char *'.
5383 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5384
5385 2012-10-08 Daniel Colascione <dancol@dancol.org>
5386
5387 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5388 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5389 accidental message numbering hole. Change other messages to
5390 match.
5391
5392 * w32select.h (HAVE_W32SELECT): Remove.
5393
5394 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5395 w32common.h instead of w32heap.h.
5396
5397 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5398 (get_allocation_unit, get_processor_type, get_w32_major_version)
5399 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5400 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5401 (OS_NT, os_subtype, cache_system_info): Move declarations to
5402 w32common.
5403
5404 * w32heap.c: Include w32common.h.
5405 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5406 (w32_minor_version, w32_build_number, w32_subtype):
5407 Remove duplicate definitions.
5408
5409 * w32fns.c: Include w32common.h; include w32heap.h only in
5410 WINDOWSNT.
5411
5412 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5413 Use `report_file_error' instead of `error' in order to better
5414 inform users of what went wrong. Increase NTGUI_UNICODE file
5415 dialog box file name length to 32k, the maximum allowed by the NT
5416 kernel.
5417
5418 * w32common.h: New file.
5419 (ROUND_UP, ROUND_DOWN, get_page_size)
5420 (get_allocation_unit, get_processor_type, get_w32_major_version)
5421 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5422 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5423 (OS_NT, os_subtype, cache_system_info): Move here.
5424
5425 * unexw32.c, unexcw.c: Include w32common.h.
5426
5427 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5428 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5429 to call syms_of_w32select.
5430
5431 * cygw32.h: Remove obsolete EXFUN declarations.
5432
5433 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5434
5435 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5436 of w32inevt.o from SOME_MACHINE_OBJECTS.
5437
5438 2012-10-08 Daniel Colascione <dancol@dancol.org>
5439
5440 * image.c: Permanent fix for JPEG compilation issue --- limit
5441 jpeglib `boolean' redefinition to Cygwin builds.
5442
5443 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5444
5445 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5446
5447 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5448 Cygwin.
5449
5450 2012-10-08 Daniel Colascione <dancol@dancol.org>
5451
5452 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5453 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5454 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5455 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5456 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5457 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5458 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5459 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5460 now a supported configuration.
5461
5462 * Makefile.in: consolidate image variables into LIBIMAGE; add
5463 W32_OBJ and W32_LIBS. Compile new files.
5464
5465 * conf_post.h:
5466 (_DebPrint) declare tracing facility for W32 debugging. We need
5467 to unify tracing later.
5468
5469 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5470 unconditional use of W32 Unicode functions. Cygwin runs only on
5471 100% Unicode operating systems.
5472
5473 * cygw32.c: New file. Define Cygwin-specific facilities.
5474 (Fcygwin_convert_path_to_windows)
5475 (Fcygwin_convert_path_from_windows): New user functions for
5476 accessing Cygwin path-munging routines.
5477
5478 * cygw32.h: New file.
5479 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5480 UTF-16LE strings temporarily inside non-Lisp-visible string
5481 objects.
5482
5483 (w32_strerror): Just what it says on the tin.
5484
5485 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5486 also run for Cygwin; both systems have the same problem with using
5487 GUI facilities in a forked child. Also call syms_of_cygw32,
5488 syms_of_w32select in correct places.
5489
5490 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5491 needs fork-then-exec for daemon launching.
5492
5493 * font.h: Include frame.h.
5494
5495 * image.c: Use the image library cache machinery only when we're
5496 compiling for native WINDOWSNT; Cygwin can use shared libraries
5497 like any other Unixlike system.
5498
5499 * keyboard.c: Clarify a comment regarding the input loop.
5500
5501 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5502 functions directly instead of trying to detect at runtime that our
5503 host operating system supports them. We make this change for two
5504 reasons: Cygwin lacks support for the multibyte character
5505 conversion functions used by the legacy menu code, and Cygwin
5506 never needs to rely on non-Unicode APIs.
5507
5508 * unexw32.c (hinst): Declare extern.
5509
5510 * w32.c: Change header order;
5511 (w32_strerror): Move to w32fns.c because we need it for
5512 non-WINDOWSNT builds.
5513
5514 * w32.h: Add #error macro to make sure we don't include w32.h for
5515 Cygwin builds. Remove w32select declarations.
5516
5517 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5518 w32fns.c. w32console.c is WINDOWSNT-only.
5519
5520 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5521 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5522 POSIXy alternative.
5523 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5524 (w32_major_version, w32_minor_version, w32_build_number)
5525 (os_subtype, sound_type): Define here
5526 (w32_defined_color): Make color parameter const for consistency
5527 with other _defined_color functions.
5528 (w32_createwindow): Unconditionally call w32_init_class instead of
5529 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5530 through the code is complex and unnecessary because class
5531 registration is practically free.
5532 (w32_name_of_message): New EMACSDEBUG-only function.
5533 (Fset_message_beep): Move here
5534 (Fx_open_connection): Require that the display name for Windows be
5535 "w32" for consistency, emacsclient disambiguation, and maybe, one
5536 day, multi-window-system support.
5537 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5538 Cygwin files for W32 GUI facilities, since these clearly don't
5539 expect Cygwin names.
5540 (_DebPrint): Define.
5541 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5542 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5543 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5544 (w32_last_error): Remove.
5545
5546 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5547
5548 * w32heap.c (syspage_mask): Declare here.
5549 (cache_system_info): Remove.
5550
5551 * w32inevt.c (faked_key): Define globally, not statically.
5552 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5553 (w32_console_toggle_lock_key): Move to w32fns.c.
5554
5555 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5556
5557 * w32proc.c (_DebPrint): Move to w32fns.c.
5558 * w32select.c: Include string.h, stdio.h for Cygwin.
5559 * w32select.h: New File.
5560
5561 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5562 get_osfhandle.
5563 (w32_message_fd): New variable. Under Cygwin, holds the file
5564 descriptor the system used to tell us about pending thread
5565 messages.
5566
5567 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5568 that prevented compilation under non-WINDOWSNT systems.
5569
5570 (w32_initialize): Open /dev/windows and assign it to
5571 w32_message_fd. Provide w32 feature.
5572
5573 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5574 (WM_EMACS_INPUT_READY): add.
5575 (prepend_msg, w32_message_fd): Declare globally.
5576
5577 * w32xfns.c:
5578 (keyboard_handle): Use only when WINDOWSNT.
5579 (notify_msg_ready): New function. Posts a message to the main
5580 thread's message queue under CYGWIN, which wakes up the main
5581 thread from select(2) by making the /dev/windows file descriptor
5582 ready. Under WINDOWSNT, it sets an event the same way the old
5583 code did.
5584
5585 (post, prepend_msg): Actually call notify_msg_ready instead of
5586 setting the input event directly.
5587
5588 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5589
5590 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5591 but it still has blocs in it, don't return it to the system,
5592 instead of aborting. (Bug#12402)
5593
5594 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5595
5596 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
5597
5598 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5599 MAC_OS_X_VERSION_10_6.
5600 (syms_of_nsterm): Remove comment about Panther and above for
5601 ns-antialias-text.
5602 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5603 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5604 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5605
5606 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5607 MAC_OS_X_VERSION_10_4.
5608
5609 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5610 MAC_OS_X_VERSION_10_2.
5611
5612 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5613
5614 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5615 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5616
5617 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5618 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
5619 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5620 Remove ns_in_resize check.
5621 (ns_clear_frame_area): Remove resize handle code.
5622
5623 * nsfns.m (ns_in_resize): Remove.
5624 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5625 Remove ns_in_resize check.
5626
5627 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5628
5629 Improve sys_siglist detection.
5630 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5631 defined as a macro, as is done in Solaris.
5632 (sys_siglist_entries): New macro.
5633 (save_strsignal): Use it.
5634 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5635 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5636
5637 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5638
5639 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5640 fullscreen/Fullscreen.
5641
5642 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5643 tobar_height is new.
5644
5645 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5646 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5647 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5648 (windowDidResize:): Check for correct window if old style fullscreen.
5649 Capitalize word in comment. Remove incorrect comment.
5650 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5651 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5652 error in drawing background.
5653 (toggleFullScreen:): Remove comment. Rearrange calls.
5654 Set toolbar values to zero, save old height in tobar_height.
5655 Restore tool bar height when leaving fullscreen.
5656 (canBecomeMainWindow): New function.
5657
5658 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5659
5660 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5661
5662 2012-10-05 Eli Zaretskii <eliz@gnu.org>
5663
5664 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5665
5666 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
5667 that time stamps of directories could also be changed.
5668 Don't request the too broad GENERIC_WRITE, only the more restrictive
5669 FILE_WRITE_ATTRIBUTES access rights.
5670
5671 * fileio.c (Fset_file_times): Special-case ignoring errors for
5672 directories only on MSDOS, not on MS-Windows.
5673
5674 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
5675
5676 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5677
5678 2012-10-04 Eli Zaretskii <eliz@gnu.org>
5679
5680 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5681 see whether CreateFile failed.
5682
5683 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5684
5685 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5686 to avoid similar races.
5687 * keyboard.c (pending_signals): Now bool, not int.
5688
5689 Port timers to OpenBSD, plus check for timer failures.
5690 OpenBSD problem reported by Han Boetes.
5691 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5692 and/or setitimer.
5693 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5694 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5695 like OpenBSD, which has timer_settime but does not declare it.
5696 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5697 whether to use itimerspec-related primitives. All uses of
5698 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5699
5700 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5701
5702 * profiler.c (handle_profiler_signal): Fix a malloc race
5703 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5704
5705 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5706
5707 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5708
5709 2012-10-02 Eli Zaretskii <eliz@gnu.org>
5710
5711 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5712 consistent with the change in return value of 'safe_strsignal'.
5713
5714 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5715
5716 Prefer plain 'static' to 'static inline' (Bug#12541).
5717 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5718 (bidi_set_sor_type, bidi_push_embedding_level)
5719 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5720 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5721 (bidi_cache_search, bidi_cache_ensure_space)
5722 (bidi_cache_iterator_state, bidi_cache_find)
5723 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5724 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5725 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5726 Now 'static', not 'static inline'.
5727
5728 Count overruns when profiling; change units to ns.
5729 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5730 Give extra weight to samples after overruns, to attempt to count
5731 the time more accurately.
5732 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5733 the underlying primitives nominally do ns.
5734 (Fprofiler_cpu_start): Document the change. Mention that
5735 the sampling intervals are only approximate.
5736
5737 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5738
5739 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5740
5741 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5742 case for the special 0 coding-system.
5743
5744 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5745 (Fmake_overlay): Remove redundant tests.
5746 (fix_start_end_in_overlays): Remove redundant recentering.
5747
5748 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
5749
5750 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5751 Update dependencies.
5752
5753 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5754
5755 Fix a malloc race condition involving strsignal.
5756 A signal can arrive in the middle of a malloc, and Emacs's signal
5757 handler can invoke strsignal, which can invoke malloc, which is
5758 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5759 Fix it by altering the signal handler so that it does not invoke
5760 strsignal.
5761 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5762 * process.c (status_message): Use const pointer, in case strsignal
5763 is #defined to safe_strsignal.
5764 * sysdep.c (sys_siglist, init_signals): Always define and
5765 initialize a substitute sys_siglist if the system does not define
5766 one, even if HAVE_STRSIGNAL.
5767 (safe_strsignal): Rename from strsignal. Always define,
5768 using sys_siglist. Return a const pointer.
5769 * syssignal.h (safe_strsignal): New decl.
5770 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5771
5772 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5773
5774 * w32proc.c (timer_loop): Fix code that waits for timer
5775 expiration, to avoid high CPU usage.
5776
5777 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5778
5779 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5780 (sweep_weak_table): Remove redundant prototypes.
5781
5782 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5783
5784 * emacs.c: Move the inclusion of TERM_HEADER after including
5785 windows.h on WINDOWSNT. This avoids compilation problems with
5786 MSVC.
5787
5788 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5789
5790 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5791 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5792 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5793 as the previous version used 'void *'.
5794
5795 * ralloc.c (ROUNDUP): Fix last change.
5796 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5797 'size_t'.
5798
5799 * w32proc.c <disable_itimers>: New static flag.
5800 (init_timers): Initialize it to zero, after creating the critical
5801 sections used by the timer threads.
5802 (term_timers): Set to 1 before deleting the critical sections.
5803 (getitimer, setitimer): If disable_itimers is non-zero, return an
5804 error indication without doing anything. Reported by Fabrice
5805 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
5806 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5807 return results.
5808 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5809 support timers.
5810
5811 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5812 term_ntproc after all the other bookkeeping, to get timers working
5813 as long as possible.
5814
5815 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5816
5817 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5818 Suggested by Juri Linkov in
5819 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5820
5821 Prefer plain 'static' to 'static inline' (Bug#12541).
5822 With static functions, modern compilers inline pretty well by
5823 themselves; advice from programmers often hurts as much as it helps.
5824 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5825 this change shrinks the text size of the Emacs executable by 1.1%
5826 without affecting CPU significantly in my benchmark.
5827 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5828 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5829 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5830 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5831 (bset_auto_fill_function, bset_auto_save_file_format)
5832 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5833 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5834 (bset_cache_long_line_scans, bset_case_fold_search)
5835 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5836 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5837 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5838 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5839 (bset_header_line_format, bset_indicate_buffer_boundaries)
5840 (bset_indicate_empty_lines, bset_invisibility_spec)
5841 (bset_left_fringe_width, bset_major_mode, bset_mark)
5842 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5843 (bset_name, bset_overwrite_mode, bset_pt_marker)
5844 (bset_right_fringe_width, bset_save_length)
5845 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5846 (bset_scroll_up_aggressively, bset_selective_display)
5847 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5848 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5849 (set_buffer_overlays_after):
5850 * category.c (bset_category_table):
5851 * charset.c (read_hex):
5852 * coding.c (produce_composition, produce_charset)
5853 (handle_composition_annotation, handle_charset_annotation)
5854 (char_encodable_p):
5855 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5856 (assign_row, set_frame_matrix_frame, make_current)
5857 (add_row_entry):
5858 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5859 * fns.c (maybe_resize_hash_table):
5860 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5861 * gmalloc.c (register_heapinfo):
5862 * image.c (lookup_image_type):
5863 * intervals.c (set_interval_object, set_interval_left)
5864 (set_interval_right, copy_interval_parent, rotate_right)
5865 (rotate_left, balance_possible_root_interval):
5866 * keyboard.c (kset_echo_string, kset_kbd_queue)
5867 (kset_keyboard_translate_table, kset_last_prefix_arg)
5868 (kset_last_repeatable_command, kset_local_function_key_map)
5869 (kset_overriding_terminal_local_map, kset_real_last_command)
5870 (kset_system_key_syms, clear_event, set_prop):
5871 * lread.c (digit_to_number):
5872 * marker.c (attach_marker, live_buffer, set_marker_internal):
5873 * nsterm.m (ns_compute_glyph_string_overhangs):
5874 * process.c (pset_buffer, pset_command)
5875 (pset_decode_coding_system, pset_decoding_buf)
5876 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5877 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5878 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5879 * syntax.c (bset_syntax_table, dec_bytepos):
5880 * terminal.c (tset_param_alist):
5881 * textprop.c (interval_has_some_properties)
5882 (interval_has_some_properties_list):
5883 * window.c (wset_combination_limit, wset_dedicated)
5884 (wset_display_table, wset_hchild, wset_left_fringe_width)
5885 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5886 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5887 (wset_right_fringe_width, wset_right_margin_cols)
5888 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5889 (wset_vertical_scroll_bar_type, wset_window_parameters):
5890 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5891 (wset_column_number_displayed, wset_region_showing)
5892 (window_box_edges, run_window_scroll_functions)
5893 (append_glyph_string_lists, prepend_glyph_string_lists)
5894 (append_glyph_string, set_glyph_string_background_width)
5895 (append_glyph, append_composite_glyph)
5896 (take_vertical_position_into_account):
5897 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5898 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5899 (lface_hash, lface_same_font_attributes_p, lookup_face):
5900 * xml.c (libxml2_loaded_p):
5901 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5902 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5903 Now 'static', not 'static inline'.
5904
5905 * bidi.c: Tune.
5906 (bidi_copy_it): Do the whole copy with a single memcpy.
5907 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5908
5909 Revert the FOLLOW-SYMLINKS change for file-attributes.
5910 Doing it right would require several changes to Tramp, and there's
5911 not enough time to get that tested before the freeze today.
5912 * dired.c (directory_files_internal, Ffile_attributes):
5913 Undo last change.
5914
5915 * frame.c (x_report_frame_params): Port better to wider ints.
5916 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5917 or that pointers can be printed in 15 decimal digits.
5918 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5919
5920 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5921
5922 Support x64 build on MS-Windows.
5923 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5924 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5925 compatibility with x64.
5926 (x_get_focus_frame): Add prototype.
5927
5928 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5929 defining an XRectangle structure.
5930
5931 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5932 arithmetics for compatibility with x64.
5933
5934 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5935 compatibility with x64.
5936
5937 * w32heap.h: Adjust prototypes and declarations.
5938
5939 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5940 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5941 DWORD, long, and unsigned long, for compatibility with x64.
5942 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5943 (sbrk): Argument is now of type ptrdiff_t.
5944
5945 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5946 less than 0x0500.
5947 (w32_msg_pump): Use WPARAM type for 'result'.
5948
5949 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5950 architecture.
5951 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5952 compatibility with x64.
5953
5954 * vm-limit.c (lim_data): Now size_t.
5955 (check_memory_limits): Adjust prototypes of real_morecore and
5956 __morecore to receive argument of type ptrdiff_t. Use size_t for
5957 five_percent and data_size.
5958
5959 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5960 variables, for compatibility with x64.
5961 (rva_to_section, offset_to_section, relocate_offset)
5962 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5963 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5964 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5965 for compatibility with x64.
5966
5967 * sysdep.c (STDERR_FILENO): Define if not already defined.
5968
5969 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5970 (__morecore): Argument type is now ptrdiff_t.
5971 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5972 (relinquish): Use ptrdiff_t type for 'excess'.
5973 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5974
5975 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5976 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5977 instead of a literal number.
5978
5979 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5980 (min): Define only if not already defined.
5981
5982 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5983 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5984 hosts.
5985
5986 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5987 'bitmaps' is a pointer.
5988
5989 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5990
5991 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5992
5993 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5994
5995 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5996 * dired.c (directory_files_internal, Ffile_attributes):
5997 New arg follow_symlinks. All uses changed.
5998
5999 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
6000
6001 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
6002
6003 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6004
6005 Support atimers and CPU profiler via profile.c on MS-Windows.
6006 * w32proc.c (sig_mask, crit_sig): New static variables.
6007 (sys_signal): Support SIGALRM and SIGPROF.
6008 (sigemptyset, sigaddset, sigfillset, sigprocmask)
6009 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
6010 sigfillset, and sigprocmask are no longer no-ops.
6011 (sigismember): New function.
6012 (struct itimer_data): New definition.
6013 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
6014 (crit_prof): New static variables.
6015 (MAX_SINGLE_SLEEP): New definition.
6016 (timer_loop, stop_timer_thread, term_timers, init_timers)
6017 (start_timer_thread, getitimer, setitimer): New functions.
6018 (alarm): No longer a no-op, calls setitimer.
6019
6020 * w32.c (term_ntproc): Call term_timers.
6021 (init_ntproc): Make sure all signals are unblocked at startup, to
6022 erase any traces of dumping. Call init_timers.
6023
6024 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
6025 Windows-specific code to display the hourglass mouse pointer is no
6026 longer used.
6027 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
6028 to hourglass timer expiration.
6029 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
6030 Remove, no longer used.
6031 (w32_note_current_window, show_hourglass, hide_hourglass):
6032 New functions, in support of hourglass cursor display similar to other
6033 window systems.
6034 (syms_of_w32fns): Don't initialize hourglass_timer.
6035
6036 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6037 WINDOWSNT as well.
6038 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6039
6040 * w32.h (init_timers, term_timers): Add prototypes.
6041
6042 2012-09-30 Kenichi Handa <handa@gnu.org>
6043
6044 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6045 to the buffer relocation which may be caused by ccl_driver.
6046
6047 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6048
6049 * xfns.c (Fx_file_dialog): Update comment.
6050
6051 * w32fns.c (Fx_file_dialog): Update comment.
6052
6053 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6054 Initialize panel name field if OSX >= 10.6.
6055
6056 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6057
6058 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6059
6060 * nsterm.m (NEW_STYLE_FS): New define.
6061 (ns_fullscreen_hook, windowWillEnterFullScreen)
6062 (windowDidEnterFullScreen, windowWillExitFullScreen)
6063 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6064 (setFSValue): New functions.
6065 (EmacsFSWindow): New implementation.
6066 (canBecomeKeyWindow): New function for EmacsFSWindow.
6067 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6068 (dealloc): Release nonfs_window if in fullscreen.
6069 (updateFrameSize:): Call windowDidMove to update top/left.
6070 (windowWillResize:toSize:): Check if frame is still maximized.
6071 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6072 next_maximized, maximized_width, maximized_height and nonfs_window.
6073 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6074 tbar_height.
6075 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
6076 fullscreen. Set maximized_width/height. Act on next_maximized.
6077
6078 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6079 (EmacsView): Add variables for fullscreen.
6080 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6081 (EmacsFSWindow): New interface for fullscreen.
6082
6083 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
6084
6085 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6086
6087 2012-09-30 Chong Yidong <cyd@gnu.org>
6088
6089 * fns.c (Frandom): Doc fix.
6090
6091 2012-09-30 Martin Rudalics <rudalics@gmx.at>
6092
6093 * window.c (Vwindow_combination_limit): New default value.
6094 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6095
6096 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6097
6098 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6099 Suggested by Eli Zaretskii in
6100 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6101
6102 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6103
6104 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6105 HAVE_TIMER_SETTIME is defined.
6106
6107 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6108
6109 Profiler improvements: more-accurate timers, overflow checks.
6110 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6111 signal.h, setjmp.h. Include systime.h instead.
6112 (saturated_add): New function.
6113 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6114 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6115 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6116 New static vars.
6117 (enum profiler_cpu_running): New enum.
6118 (profiler_cpu_running): Now of that enum type, not bool.
6119 All uses changed to store the new value.
6120 (handle_profiler_signal): Rename from sigprof_handler_1,
6121 for consistency with other handlers. Do not check whether
6122 cpu_log is a hash-table if garbage collecting, since it
6123 doesn't matter in that case.
6124 (deliver_profiler_signal): Rename from sigprof_handler,
6125 for consistency with other handlers.
6126 (setup_cpu_timer): New function, with much of what used to be in
6127 Fprofiler_cpu_start. Check for out-of-range argument.
6128 Prefer timer_settime if available, and prefer
6129 thread cputime clocks, then process cputime clocks, then
6130 monotonic clocks, to the old realtime clock. Use make_timeval
6131 to round more-correctly when falling back to setitimer.
6132 (Fprofiler_cpu_start): Use it.
6133 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6134 Don't assume that passing NULL as the 2nd argument of setitimer
6135 is the same as passing a pointer to all-zero storage.
6136 Ignore SIGPROF afterwards.
6137 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6138 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6139 non-fatal signal handlers. Ignore SIGPROF on startup.
6140 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6141 in profiler.c, since sysdep.c now uses it.
6142
6143 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6144 Suggested by Eli Zaretskii in
6145 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6146
6147 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
6148
6149 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6150
6151 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6152
6153 * lisp.h (struct backtrace): Remove indirection for `function' field.
6154 * xdisp.c (redisplay_internal):
6155 * profiler.c (record_backtrace, sigprof_handler_1):
6156 * alloc.c (Fgarbage_collect):
6157 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6158 (Fbacktrace_frame): Adjust accordingly.
6159
6160 2012-09-28 Glenn Morris <rgm@gnu.org>
6161
6162 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6163 (Frun_hook_with_args_until_failure): Doc fixes.
6164
6165 2012-09-28 Eli Zaretskii <eliz@gnu.org>
6166
6167 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6168 Qautomatic_redisplay and change the symbol name. All users changed.
6169
6170 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6171
6172 * profiler.c (sigprof_handler): Fix race condition.
6173
6174 2012-09-28 Glenn Morris <rgm@gnu.org>
6175
6176 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6177
6178 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6179
6180 Check more robustly for timer_settime.
6181 * Makefile.in (LIB_TIMER_TIME): New macro.
6182 (LIBES): Add it.
6183 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6184 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6185 call timer_settime.
6186
6187 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6188
6189 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6190
6191 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
6192
6193 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6194
6195 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6196
6197 * character.h (MAYBE_UNIFY_CHAR): Remove.
6198 * charset.c, charset.h (maybe_unify_char): Now static.
6199 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6200 Since this stuff is now private to charset.c, there's no need for
6201 a public macro and no need to inline by hand.
6202
6203 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6204 Stefan Monnier <monnier@iro.umontreal.ca>
6205 Juanma Barranquero <lekktu@gmail.com>
6206
6207 * profiler.c: New file.
6208 * Makefile.in (base_obj): Add profiler.o.
6209 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6210 ($(BLD)/profiler.$(O)): New target.
6211 * emacs.c (main): Call syms_of_profiler.
6212 * alloc.c (Qautomatic_gc): New constant.
6213 (MALLOC_PROBE): New macro.
6214 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6215 (total_bytes_of_live_objects): New function.
6216 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6217 Call malloc_probe for the memory profiler.
6218 (syms_of_alloc): Define Qautomatic_gc.
6219 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6220 race condition.
6221 (struct backtrace): Move definition...
6222 * lisp.h (struct backtrace): ..here.
6223 (Qautomatic_gc, profiler_memory_running): Declare vars.
6224 (malloc_probe, syms_of_profiler): Declare functions.
6225 * xdisp.c (Qautomatic_redisplay): New constant.
6226 (redisplay_internal): Record itself in backtrace_list.
6227 (syms_of_xdisp): Define Qautomatic_redisplay.
6228
6229 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6230 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6231
6232 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6233
6234 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6235
6236 Prefer POSIX timers if available.
6237 They avoid a race if the timer is too close to the current time.
6238 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6239 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6240 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6241
6242 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6243
6244 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6245 CHAR_STRING_ADVANCE.
6246 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6247 STRING_CHAR_ADVANCE.
6248
6249 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6250
6251 Move Vlibrary_cache to emacs.c and reset before dumping.
6252
6253 * lisp.h (reset_image_types): Declare.
6254 [WINDOWSNT] (Vlibrary_cache): Declare.
6255
6256 * image.c (reset_image_types): New function.
6257
6258 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6259 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6260 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6261
6262 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6263 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6264
6265 * w32.h (Vlibrary_cache): Do not declare.
6266
6267 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6268
6269 * w32proc.c (sys_signal): Handle all signals defined by the
6270 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6271 handlers for signals supported by Windows. Don't override
6272 term_ntproc as the handler for SIGABRT.
6273 (sigaction): Rewrite to call sys_signal instead of duplicating its
6274 code.
6275 (sys_kill): Improve commentary.
6276
6277 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6278 consistency with a signature of a signal handler. All callers
6279 changed.
6280 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6281 install term_ntproc as a signal handler for SIGABRT, as that
6282 should be done by the dumped Emacs.
6283
6284 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6285
6286 * w32select.c (term_w32select): Protect against repeated
6287 invocation by setting clipboard_owner to NULL after calling
6288 DestroyWindow.
6289
6290 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6291 and term_ntproc to their modified signatures.
6292
6293 * character.c (char_string, string_char): Remove calls to
6294 MAYBE_UNIFY_CHAR. See the discussion starting at
6295 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6296 for the details.
6297
6298 2012-09-25 Chong Yidong <cyd@gnu.org>
6299
6300 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6301
6302 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6303
6304 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6305 when encountering an unknown bytecode.
6306
6307 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6308
6309 image.c, indent.c: Use bool for booleans.
6310 * dispextern.h (struct image_type): Members valid_p, load, init
6311 now return bool, not int. All uses changed.
6312 * image.c: Omit unnecessary static decls.
6313 (x_create_bitmap_mask, x_build_heuristic_mask):
6314 Return void, not int, since callers don't care about the return value.
6315 (x_create_bitmap_mask, define_image_type, valid_image_p)
6316 (struct image_keyword, parse_image_spec, image_spec_value)
6317 (check_image_size, image_background)
6318 (image_background_transparent, x_clear_image_1)
6319 (postprocess_image, lookup_image, x_check_image_size)
6320 (x_create_x_image_and_pixmap, xbm_image_p)
6321 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6322 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6323 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6324 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6325 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6326 (png_image_p, init_png_functions, png_load_body, png_load)
6327 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6328 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6329 (init_gif_functions, gif_load, imagemagick_image_p)
6330 (imagemagick_load_image, imagemagick_load, svg_image_p)
6331 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6332 (gs_load):
6333 * nsimage.m (ns_load_image):
6334 * nsterm.m (ns_defined_color):
6335 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6336 * xfns.c (x_defined_color):
6337 * xterm.c (x_alloc_lighter_color_for_widget)
6338 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6339 (x_alloc_lighter_color):
6340 * indent.c (disptab_matches_widthtab, current_column)
6341 (scan_for_column, string_display_width, indented_beyond_p)
6342 (compute_motion, vmotion, Fvertical_motion):
6343 Use bool for booleans.
6344
6345 2012-09-24 Chong Yidong <cyd@gnu.org>
6346
6347 * chartab.c (Fset_char_table_default): Obsolete function removed.
6348
6349 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6350
6351 Move pid_t related decls out of lisp.h.
6352 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6353 (interruptible_wait_for_termination):
6354 Move these decls from lisp.h to syswait.h, since they use pid_t.
6355 Needed on FreeBSD; see Herbert J. Skuhra in
6356 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6357 * callproc.c: Include syswait.h.
6358
6359 gnutls.c, gtkutil.c: Use bool for boolean.
6360 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6361 (emacs_gnutls_handle_error):
6362 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6363 (xg_hide_tooltip, xg_create_frame_widgets)
6364 (create_dialog, xg_uses_old_file_dialog)
6365 (xg_get_file_with_chooser, xg_get_file_with_selection)
6366 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6367 (xg_item_label_same_p, xg_update_menubar)
6368 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6369 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6370 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6371 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6372 (update_frame_tool_bar, free_frame_tool_bar):
6373 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6374 * nsmenu.m (ns_update_menubar):
6375 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6376 * xfns.c (Fx_show_tip) [USE_GTK]:
6377 Use bool for boolean.
6378 * gtkutil.c (xg_update_frame_menubar):
6379 * xmenu.c (update_frame_menubar):
6380 Return void, not int, since caller ignores return value.
6381 * gtkutil.c (xg_change_toolbar_position):
6382 Return void, not 1.
6383
6384 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6385
6386 * makefile.w32-in (BLOCKINPUT_H): Remove.
6387 (SYSSIGNAL_H): New macro.
6388 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6389 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6390 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6391 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6392 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6393 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6394 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6395 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6396 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6397 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6398 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6399 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6400 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6401 ($(BLD)/w32xfns.$(O)): Update dependencies.
6402
6403 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6404
6405 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6406 fatal_error_backtrace.
6407
6408 * w32proc.c (sys_kill): Undo last change: don't do anything when
6409 invoked to deliver SIGABRT to our own process. This is now
6410 handled by emacs_raise.
6411
6412 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6413
6414 * w32term.c (w32_read_socket): Remove leftover reference to
6415 interrupt_input_pending.
6416
6417 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6418
6419 Do not use SA_NODEFER.
6420 Problem reported by Dani Moncayo in
6421 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6422 * alloc.c (die):
6423 * sysdep.c (emacs_abort): Do not reset signal handler.
6424 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6425 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6426 wanted even on POSIXish hosts, and it doesn't work on Windows.
6427
6428 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6429
6430 * xterm.c (x_term_init): Call fixup_locale before and after calling
6431 gtk_init (Bug#12392).
6432
6433 2012-09-23 Chong Yidong <cyd@gnu.org>
6434
6435 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6436 Vdynamic_library_alist.
6437
6438 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6439 (Fgnutls_available_p): Caller changed.
6440
6441 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6442 (Flibxml_parse_xml_region): Likewise.
6443
6444 * dispextern.h (struct image_type): Remove arg from init function.
6445
6446 * image.c (Finit_image_library, lookup_image_type)
6447 (define_image_type): Remove now-unneeded second arg.
6448 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6449 (init_tiff_functions, init_gif_functions, init_svg_functions):
6450 Arglist and w32_delayed_load calling convention changed.
6451 (gs_type): Remove init_gs_functions; there is no such function.
6452 (valid_image_p, make_image): Fix caller to lookup_image_type.
6453
6454 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6455
6456 Simplify and avoid signal-handling races (Bug#12471).
6457 * alloc.c (die):
6458 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6459 Avoid recursive loop if there's a fatal error in the function itself.
6460 * atimer.c (pending_atimers):
6461 * blockinput.h: Don't include "atimer.h"; no longer needed.
6462 (interrupt_input_pending): Remove. All uses removed.
6463 pending_signals now counts both atimers and ordinary interrupts.
6464 This is less racy than having three separate pending-signal flags.
6465 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6466 (input_blocked_p):
6467 Rename from their upper-case counterparts BLOCK_INPUT,
6468 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6469 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6470 This makes it easier to access volatile variables more accurately.
6471 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6472 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6473 that's more reliable if the code is buggy and sets
6474 interrupt_input_blocked to a negative value. All uses changed.
6475 * atimer.c (deliver_alarm_signal):
6476 Remove. No need to deliver this to the parent; any thread can
6477 handle this signal now. All uses replaced by underlying handler.
6478 * atimer.c (turn_on_atimers):
6479 * dispnew.c (handle_window_change_signal):
6480 * emacs.c (handle_danger_signal):
6481 * keyboard.c (kbd_buffer_get_event):
6482 Don't reestablish signal handler; not needed with sigaction.
6483 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6484 (UNBLOCK_INPUT_TO):
6485 Rework to avoid unnecessary accesses to volatile variables.
6486 (UNBLOCK_INPUT_TO): Now a function.
6487 (totally_unblock_input, unblock_input): New decls.
6488 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6489 (init_data): Remove. Necessary stuff now done in init_signal.
6490 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6491 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6492 (fatal_error_code): Remove; no longer needed.
6493 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6494 it doesn't always backtrace. All uses changed. No need to reset
6495 signal to default, since sigaction and/or die does that for us now.
6496 Use emacs_raise (FOO), not kill (getpid (), FOO).
6497 (main): Check more-accurately whether we're dumping.
6498 Move fatal-error setup to sysdep.c
6499 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6500 * gtkutil.c (xg_get_file_name, xg_get_font):
6501 Remove no-longer-needed signal-mask manipulation.
6502 * keyboard.c, process.c (POLL_FOR_INPUT):
6503 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6504 * keyboard.c (read_avail_input): Remove.
6505 All uses replaced by gobble_input.
6506 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6507 (kbd_buffer_store_event_hold, gobble_input):
6508 (record_asynch_buffer_change) [USABLE_SIGIO]:
6509 (store_user_signal_events):
6510 No need to mess with signal mask.
6511 (gobble_input): If blocking input and there are terminals, simply
6512 set pending_signals to 1 and return. All hooks changed to not
6513 worry about whether input is blocked.
6514 (process_pending_signals): Clear pending_signals before processing
6515 them, in case a signal comes in while we're processing.
6516 By convention callers now test pending_signals before calling us.
6517 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6518 New functions, to support changes to blockinput.h.
6519 (handle_input_available_signal): Now extern.
6520 (reinvoke_input_signal): Remove. All uses replaced by
6521 handle_async_input.
6522 (quit_count): Now volatile, since a signal handler uses it.
6523 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6524 All callers changed. Block SIGINT only if not already blocked.
6525 Clear sigmask reliably, even if Fsignal returns, which it can.
6526 Omit unnecessary accesses to volatile var.
6527 (quit_throw_to_read_char): No need to restore sigmask.
6528 * keyboard.c (gobble_input, handle_user_signal):
6529 * process.c (wait_reading_process_output):
6530 Call signal-handling code rather than killing ourselves.
6531 * lisp.h: Include <float.h>, for...
6532 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6533 (pending_signals): Now volatile.
6534 (syms_of_data): Now const if IEEE floating point.
6535 (handle_input_available_signal) [USABLE_SIGIO]:
6536 (terminate_due_to_signal, record_child_status_change): New decls.
6537 * process.c (create_process): Avoid disaster if memory is exhausted
6538 while we're processing a vfork, by tightening the critical section
6539 around the vfork.
6540 (send_process_frame, process_sent_to, handle_pipe_signal)
6541 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6542 ignores SIGPIPE.
6543 (send_process): No need for setjmp/longjmp any more, since the
6544 SIGPIPE stuff is now gone. Instead, report an error if errno
6545 is EPIPE.
6546 (record_child_status_change): Now extern. PID and W are now args.
6547 Return void, not bool. All callers changed.
6548 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6549 Remove. All uses removed. This bug should be fixed now in a
6550 different way.
6551 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6552 and record the child status change directly. This avoids the
6553 need to futz with the signal mask.
6554 (process_fatal_action): Move here from emacs.c.
6555 (emacs_sigaction_flags): New function, containing
6556 much of what used to be in emacs_sigaction_init.
6557 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6558 caught by emacs, to make races less likely.
6559 (deliver_process_signal): Rename from handle_on_main_thread.
6560 All uses changed.
6561 (BACKTRACE_LIMIT_MAX): Now at top level.
6562 (thread_backtrace_buffer, threadback_backtrace_pointers):
6563 New static vars.
6564 (deliver_thread_signal, deliver_fatal_thread_signal):
6565 New functions, for more-accurate delivery of thread-specific signals.
6566 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6567 (deliver_arith_signal): Handle in this thread, not
6568 in the main thread, since it's triggered by this thread.
6569 (maybe_fatal_sig): New function.
6570 (init_signals): New arg DUMPING so that we can be more accurate
6571 about whether we're dumping. Caller changed.
6572 Treat thread-specific signals differently from process-general signals.
6573 Block all signals while handling fatal error; that's safer.
6574 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6575 on IEEE hosts.
6576 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6577 Ignore SIGPIPE unless batch.
6578 (emacs_backtrace): Output backtrace for the appropriate thread,
6579 which is not necessarily the main thread.
6580 * syssignal.h: Include <stdbool.h>.
6581 (emacs_raise): New macro.
6582 * xterm.c (x_connection_signal): Remove; no longer needed
6583 now that we use sigaction.
6584 (x_connection_closed): No need to mess with sigmask now.
6585 (x_initialize): No need to reset SIGPIPE handler here, since
6586 init_signals does this for us now.
6587
6588 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6589
6590 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6591 background rect may be larger (Bug#12245).
6592
6593 2012-09-23 Chong Yidong <cyd@gnu.org>
6594
6595 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6596
6597 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6598
6599 * .gdbinit: Just stop at fatal_error_backtrace.
6600 See Stefan Monnier's request in
6601 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6602 Remove no-longer-used query of system type.
6603
6604 2012-09-22 Chong Yidong <cyd@gnu.org>
6605
6606 * search.c (Freplace_match): Doc fix (Bug#12325).
6607
6608 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6609
6610 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6611 (Fline_end_position): Doc fix.
6612
6613 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6614
6615 2012-09-22 Chong Yidong <cyd@gnu.org>
6616
6617 * dispextern.h (struct image_type): Add new slot, storing a type
6618 initialization function.
6619
6620 * image.c (define_image_type): Call the image initializer function
6621 if it is defined. Arguments and return value changed.
6622 (valid_image_p, make_image): Callers changed.
6623 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
6624 (gif_type, imagemagick_type, svg_type, gs_type):
6625 Add initialization functions.
6626 (Finit_image_library): Call lookup_image_type.
6627 (CHECK_LIB_AVAILABLE): Macro deleted.
6628 (lookup_image_type): Call define_image_type here, rather than via
6629 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6630 (syms_of_image): Move define_image_type calls for xbm_type and
6631 pbm_type to lookup_image_type.
6632
6633 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6634
6635 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6636 'idle_timers' from here ...
6637 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6638 lists, to avoid infloops when the timer does something stupid,
6639 like reinvoke itself with the same or smaller time-out.
6640 (Bug#12447)
6641
6642 2012-09-22 Martin Rudalics <rudalics@gmx.at>
6643
6644 * window.c (Fsplit_window_internal): Handle only Qt value of
6645 Vwindow_combination_limit separately.
6646 (Qtemp_buffer_resize): New symbol.
6647 (Vwindow_combination_limit): New default value.
6648 Rewrite doc-string.
6649
6650 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6651
6652 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6653 the new overlay string. (Bug#10159)
6654
6655 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6656
6657 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6658 or that fprintf is async-signal-safe. POSIX doesn't require
6659 either assumption.
6660
6661 2012-09-22 Chong Yidong <cyd@gnu.org>
6662
6663 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6664 (Bug#8207).
6665
6666 2012-09-22 Kenichi Handa <handa@gnu.org>
6667
6668 * composite.c (composition_reseat_it): Handle the case that a
6669 grapheme cluster is not covered by a single font (Bug#12352).
6670
6671 2012-09-21 Chong Yidong <cyd@gnu.org>
6672
6673 * image.c (define_image_type): Avoid adding duplicate types to
6674 image_types (Bug#12463). Suggested by Jörg Walter.
6675
6676 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6677
6678 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6679 (print_load_command_name): Add case LC_DATA_IN_CODE.
6680 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6681
6682 2012-09-21 Glenn Morris <rgm@gnu.org>
6683
6684 * eval.c (Frun_hook_with_args_until_success)
6685 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6686
6687 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
6688
6689 * fileio.c (Ffile_selinux_context): Only call freecon when
6690 lgetfilecon succeeded.
6691 (Fset_file_selinux_context): Likewise. (Bug#12444)
6692
6693 2012-09-21 Eli Zaretskii <eliz@gnu.org>
6694
6695 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6696 reordering, locate the cursor by calling set_cursor_from_row; if
6697 that fails, clear the desired glyph matrix before returning a
6698 failure indication to the caller. Fixes leaving garbled display
6699 when fast scrolling with a down-key. (Bug#12403)
6700 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6701 scrolling through multibyte text.
6702
6703 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6704
6705 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6706 calling mark_vectorlike since that's the one that marks the window.
6707 (mark_discard_killed_buffers): Mark the final cdr.
6708 * window.h (struct window): Move prev/next_buffers to the
6709 non-standard fields.
6710 * window.c (make_window): Initialize prev/next_buffers manually.
6711
6712 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6713
6714 Omit unused arg EXPECTED from socket hooks.
6715 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6716 * nsterm.m (ns_term_init):
6717 * termhooks.h (struct terminal.read_socket_hook):
6718 * w32inevt.c (w32_console_read_socket):
6719 * w32term.c (w32_read_socket):
6720 * xterm.c (XTread_socket):
6721 Omit unused arg EXPECTED. All callers changed.
6722 (store_user_signal_events): Return void, not int, since callers no
6723 longer care about the return value. All uses changed.
6724
6725 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
6726
6727 * w32gui.h (XParseGeometry): Do not declare.
6728
6729 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6730
6731 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
6732 Ignore 'expected'. See Eli Zaretskii in
6733 <http://bugs.gnu.org/12471#8> (last line).
6734
6735 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6736 (XParseGeometry): Now static. Substitute extremal values for
6737 values that are out of range.
6738
6739 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6740
6741 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6742
6743 * nsfns.m (XParseGeometry): Remove.
6744 (Fx_create_frame): Call x_set_offset to correctly interpret
6745 top_pos in geometry.
6746
6747 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
6748 (Fx_parse_geometry): If there is a space in string, call
6749 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6750
6751 2012-09-17 Eli Zaretskii <eliz@gnu.org>
6752
6753 * search.c (scan_buffer): Use character positions in calls to
6754 region_cache_forward and region_cache_backward, not byte
6755 positions. (Bug#12196)
6756
6757 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6758 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6759
6760 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6761 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6762 emacs_blocked_malloc, now deleted.
6763
6764 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6765
6766 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6767 The workaround was for improving performance on Solaris 2.4, but
6768 is getting in the way now. Emacs will still work if someone is
6769 still running Solaris 2.4 in a museum somewhere; Sun dropped
6770 support for Solaris 2.4 in 2003.
6771 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6772 * process.c (create_process) [HAVE_WORKING_VFORK]:
6773 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6774 since Emacs no longer uses vfork on that platform.
6775
6776 2012-09-17 Glenn Morris <rgm@gnu.org>
6777
6778 * emacs.c: Use COPYRIGHT.
6779
6780 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6781
6782 Remove configure's --without-sync-input option (Bug#12450).
6783 When auditing signal-handling in preparation for cleaning it up,
6784 I found that SYNC_INPUT has race conditions and would be a real
6785 pain to fix. Since it's an undocumented and deprecated
6786 configure-time option, now seems like a good time to remove it.
6787 Also see <http://bugs.gnu.org/11080#16>.
6788 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6789 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6790 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6791 (malloc_hysteresis):
6792 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6793 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6794 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6795 (dont_register_blocks, bytes_used_when_reconsidered)
6796 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6797 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6798 [!SYSTEM_MALLOC && !SYNC_INPUT]:
6799 Remove. All uses removed.
6800 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6801 implementation, one that depends on whether the new macro
6802 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6803 is defined.
6804 * atimer.c (run_timers, handle_alarm_signal):
6805 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6806 (handle_async_input, process_pending_signals)
6807 (handle_input_available_signal, init_keyboard):
6808 * nsterm.m (ns_read_socket):
6809 * process.c (wait_reading_process_output):
6810 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6811 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6812 (emacs_write):
6813 * xterm.c (XTread_socket):
6814 Assume SYNC_INPUT.
6815 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6816 * eval.c (handling_signal): Remove. All uses removed.
6817 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6818 All uses replaced with the SYNC_INPUT version.
6819 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6820 Remove decls.
6821 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6822 Now static.
6823
6824 * font.c (Ffont_shape_gstring): Remove unused local.
6825
6826 2012-09-16 Glenn Morris <rgm@gnu.org>
6827
6828 * Makefile.in (clean): No longer run nextstep's clean.
6829
6830 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6831 (ns_frag): Remove.
6832 (ns-app): Move here from ns.mk, and simplify.
6833 (clean): Simplify nextstep entry.
6834 * ns.mk: Remove file.
6835
6836 2012-09-17 Kenichi Handa <handa@gnu.org>
6837
6838 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6839 not covert the last few charactes.
6840
6841 2012-09-16 Kenichi Handa <handa@gnu.org>
6842
6843 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6844 here, but just check the validity of glyphs in the glyph-string.
6845
6846 2012-09-16 Martin Rudalics <rudalics@gmx.at>
6847
6848 * window.c (Fwindow_parameter, Fset_window_parameter):
6849 Accept any window as argument (Bug#12452).
6850
6851 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6852
6853 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6854 to ns_term_init to avoid memory leak.
6855
6856 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6857 explicit retain/release.
6858 (ns_term_init): Only allow one display. Initialize outerpool and
6859 ns_*_types.
6860
6861 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6862
6863 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6864 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6865 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6866 the Microsoft problem in a different way, by altering ../nt/config.nt.
6867
6868 2012-09-15 Eli Zaretskii <eliz@gnu.org>
6869
6870 * w32xfns.c:
6871 * w32uniscribe.c:
6872 * w32term.c:
6873 * w32select.c:
6874 * w32reg.c:
6875 * w32proc.c:
6876 * w32menu.c:
6877 * w32inevt.c:
6878 * w32heap.c:
6879 * w32font.c:
6880 * w32fns.c:
6881 * w32console.c:
6882 * w32.c:
6883 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6884 by lisp.h. This completes removal of setjmp.h inclusion
6885 erroneously announced in the previous commit. (Bug#12446)
6886
6887 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6888 more accurate.
6889
6890 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6891 not defined as a macro. The latter happens on MS-Windows.
6892 (Bug#12446)
6893
6894 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6895
6896 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6897 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
6898 Some instances of '#include <setjmp.h>' removed, if the
6899 only reason for the instance was because "lisp.h" was included.
6900 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6901 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6902 and _longjmp with the new symbols. Emacs already uses _setjmp if
6903 available, so this change affects only POSIXish hosts that have
6904 sigsetjmp but not _setjmp, such as some versions of Solaris and
6905 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6906 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6907 (png_load_body) [HAVE_PNG]:
6908 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6909 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6910 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6911 since PNG requires jmp_buf. This is the only exception to the
6912 general rule that we now use sys_setjmp and sys_longjmp.
6913 This exception is OK since this code does not change the signal
6914 mask or longjmp out of a signal handler.
6915
6916 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6917
6918 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6919 Include "syssignal.h", for 'main_thread'.
6920
6921 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6922
6923 Avoid out-of-range marker position (Bug#12426).
6924 * insdel.c (replace_range, replace_range_2):
6925 Adjust markers before overlays, as suggested by comments.
6926 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6927 Remove redundant check before calling offset_intervals.
6928
6929 2012-09-14 Martin Rudalics <rudalics@gmx.at>
6930
6931 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6932 current buffer (Bug#12387).
6933
6934 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
6935
6936 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6937
6938 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6939
6940 Use a more backwards-compatible timer format (Bug#12430).
6941 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6942 vector element, not from the 4th, since PSECS is now at the end.
6943 (Fcurrent_idle_time): Doc fix.
6944
6945 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6946
6947 Function to mark objects and remove killed buffers at once.
6948 * alloc.c (discard_killed_buffers): Rename to ...
6949 (mark_discard_killed buffers) ... new name. Add marking
6950 of remaining objects. Fix comment. Adjust users.
6951 (mark_object): Do not touch frame buffer lists here.
6952 * frame.c (delete_frame): Reset frame buffer lists here.
6953
6954 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6955
6956 Better workaround for GNOME bug when --enable-gcc-warnings.
6957 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6958 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6959 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6960
6961 Simplify SIGIO usage (Bug#12408).
6962 The code that dealt with SIGIO was crufty and confusing, e.g., it
6963 played tricks like "#undef SIGIO" but these tricks were not used
6964 consistently. Simplify mostly by not #undeffing standard symbols,
6965 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6966 or not as we please) rather than "defined SIGIO" (standard symbol
6967 that we probably shouldn't #undef).
6968 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6969 Modules that need it can include it.
6970 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6971 * dispextern.h (ignore_sigio): New decl.
6972 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6973 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6974 * emacs.c (shut_down_emacs):
6975 * keyboard.c (kbd_buffer_store_event_hold):
6976 Use ignore_sigio rather than invoking 'signal' directly.
6977 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6978 for FIONREAD.
6979 (FIONREAD, SIGIO): Do not #undef.
6980 (tty_read_avail_input): Use #error rather than a syntax error.
6981 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6982 for I_PIPE, used by SETUP_SLAVE_PTY.
6983 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6984 * sysdep.c (croak): Remove; no longer needed. This bit of
6985 temporary code, with Fred N. Fish's comment that it's temporary,
6986 has been in Emacs since at least 1992!
6987 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6988 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6989 * syssignal.h (croak): Remove decl.
6990 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6991 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6992 now that we're termios-only.
6993 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6994 * term.c (dissociate_if_controlling_tty): Use #error rather than
6995 a run-time error.
6996
6997 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6998 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6999 to work around GNOME bug 683906.
7000 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
7001 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
7002 This works around GCC bug 54561.
7003
7004 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7005
7006 More fixes for 'volatile' and setjmp/longjmp.
7007 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
7008 * image.c (struct png_load_context) [HAVE_PNG]: New type.
7009 (png_load_body) [HAVE_PNG]:
7010 (jpeg_load_body) [HAVE_JPEG]:
7011 New function, with most of the old parent function's body.
7012 (png_load) [HAVE_PNG]:
7013 (jpeg_load) [HAVE_JPEG]:
7014 Invoke the new function, to avoid longjmp munging our locals.
7015 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
7016 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
7017 longjmp is passed 2, as the C standard doesn't guarantee this.
7018 Instead, store the failure code into mgr->failure_code.
7019
7020 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7021
7022 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
7023 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
7024 (syms_of_keyboard): Remove support for unread-command-char.
7025
7026 2012-09-12 Eli Zaretskii <eliz@gnu.org>
7027
7028 * w32proc.c (sys_kill): If PID is our process ID and the signal is
7029 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
7030 violation. (Bug#12426)
7031
7032 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7033
7034 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
7035
7036 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7037
7038 * eval.c: Add `inhibit-debugger'.
7039 (Qinhibit_debugger): New symbol.
7040 (call_debugger): Bind it instead of Qdebug_on_error.
7041 (maybe_call_debugger): Test Vinhibit_debugger.
7042 (syms_of_eval): Define inhibit-debugger.
7043 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7044 (syms_of_xdisp): Remove inhibit-debug-on-message.
7045
7046 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7047
7048 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7049 If a nonvolatile local variable is written before a _longjmp to
7050 the frame containing the variable, and is read after the _longjmp,
7051 the value read is indeterminate. Some local variables of type
7052 'struct handler' and 'struct catchtag' are used in this way, so
7053 mark each of their slots as volatile if the slot can be set before
7054 _longjmp and read afterwards.
7055 * lisp.h (struct handler): var and chosen_clause are now volatile.
7056 (struct catchtag): val, next, and pdlcount are now volatile.
7057
7058 * bidi.c (bidi_push_it, bidi_pop_it):
7059 * fns.c (copy_hash_table):
7060 * image.c (define_image_type):
7061 * keyboard.c (kbd_buffer_store_event_hold):
7062 * process.c (Fprocess_send_eof):
7063 * xfaces.c (x_create_gc) [HAVE_NS]:
7064 * xgselect.c (xg_select):
7065 Prefer assignment to memcpy when either will do.
7066
7067 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7068 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7069 time an item is removed. No need to mark this function 'inline';
7070 the compiler knows better than we do.
7071
7072 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7073
7074 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7075 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7076 to change_frame_size (Bug#12388).
7077 (windowDidResize:): Pass YES to updateFrameSize.
7078
7079 * nsterm.h: Add delay parameter to updateFrameSize.
7080
7081 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7082
7083 Discard killed buffers from deleted window and frame objects.
7084 This reduces an amount of references to killed buffers and
7085 helps GC to reclaim them faster.
7086 * alloc.c (discard_killed_buffers): New function.
7087 (mark_object): Use it for deleted windows and frames.
7088 (mark_object): If symbol's value is set up for a killed buffer
7089 or deleted frame, restore its global binding.
7090 * data.c (swap_in_global_binding): Add GC notice.
7091 (swap_in_symval_forwarding): Use convenient set_blv_where.
7092 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7093 * window.h: ... to here.
7094
7095 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7096
7097 Convenient macro to check whether the buffer is live.
7098 * buffer.h (BUFFER_LIVE_P): New macro.
7099 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7100 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7101
7102 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7103
7104 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7105 composition cases (Bug#12364).
7106
7107 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7108 overhang of succeeding glyphs overlapping box cursor.
7109
7110 * w32term.c (x_draw_glyph_string): Likewise.
7111
7112 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7113
7114 Simplify, document, and port floating-point (Bug#12381).
7115 The porting part of this patch fixes bugs on non-IEEE platforms
7116 with frexp, ldexp, logb.
7117 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7118 Now static.
7119 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7120 support, by removing commented-out code and briefly listing the
7121 C89 functions excluded. The commented-out stuff was confusing
7122 maintenance, e.g., we thought we needed cbrt but it was commented out.
7123 (logb): Remove decl; no longer needed.
7124 (isfinite): New macro, if not already supplied.
7125 (isnan): Don't replace any existing macro.
7126 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7127 are present on all C89 platforms.
7128 (Ffrexp): Do not special-case zero, as frexp does the right thing
7129 for that case.
7130 (Flogb): Do not use logb, as it doesn't have the desired meaning
7131 on hosts that use non-base-2 floating point. Instead, stick with
7132 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7133 frexp, to avoid getting an unspecified result.
7134
7135 * xdisp.c (Qinhibit_debug_on_message): Now static.
7136
7137 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7138
7139 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7140 NSBezierPath (Bug#12131).
7141
7142 2012-09-10 Chong Yidong <cyd@gnu.org>
7143
7144 * fns.c (Fdelq, Fdelete): Doc fix.
7145
7146 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7147
7148 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7149 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7150
7151 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7152
7153 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7154 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7155 Use it.
7156
7157 2012-09-09 Eli Zaretskii <eliz@gnu.org>
7158
7159 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7160 left fringe if the window has a left margin. This avoids leaving
7161 traces of the cursor because its leftmost pixel is not drawn over.
7162
7163 * dispnew.c (update_window_line): When the left margin area of a
7164 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7165 that screen line. (Bug#12277)
7166
7167 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7168
7169 Assume C89 or later for math functions (Bug#12381).
7170 This simplifies the code, and makes it a bit smaller and faster,
7171 and (most important) makes it easier to clean up signal handling
7172 since we can stop worring about floating-point exceptions in
7173 library code. That was a problem before C89, but the problem
7174 went away many years ago on all practical Emacs targets.
7175 * data.c, image.c, lread.c, print.c:
7176 Don't include <math.h>; no longer needed.
7177 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7178 might be autoconfigured, as that never happens.
7179 * data.c (fmod):
7180 * doprnt.c (DBL_MAX_10_EXP):
7181 * print.c (DBL_DIG):
7182 Remove. C89 or later always defines these.
7183 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7184 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7185 (arith_error, domain_error, domain_error2):
7186 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7187 no longer needed -- we simply return what C returns. All uses removed.
7188 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7189 the wrapped code.
7190 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7191 Remove. All uses expanded, as these macros are no longer used
7192 more than once and are now more trouble than they're worth.
7193 (Ftan): Use tan, not sin / cos.
7194 (Flogb): Assume C89 frexp.
7195 (fmod_float): Assume C89 fmod.
7196 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7197 (init_floatfns): Remove. All uses removed.
7198
7199 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7200
7201 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7202 compositeToPoint for OSX < 10.6 (Bug#12390).
7203
7204 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7205
7206 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7207 This produces more-accurate results.
7208
7209 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7210
7211 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7212 changes (Bug#12088).
7213
7214 2012-09-08 Chong Yidong <cyd@gnu.org>
7215
7216 * syntax.c (Fstring_to_syntax): Doc fix.
7217
7218 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7219
7220 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7221 in the internal border.
7222 (x_set_window_size): Remove static variables and their usage.
7223 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7224 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7225 Remove fringe/internal border adjustment (Bug#11052).
7226 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7227 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7228 (ns_fix_rect_ibw): Remove.
7229 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7230 (ns_dumpglyphs_box_or_relief): Ditto.
7231 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7232 adjustment.
7233 (ns_dumpglyphs_image): Ditto.
7234 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7235 border adjustment.
7236 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7237 their usage. Add fringe_extended_p and its use as in other terms.
7238 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7239 scroll bar was removed.
7240 (updateFrameSize): New function.
7241 (windowDidResize): Move code to updateFrameSize and call it.
7242
7243 * nsterm.h (EmacsView): Add updateFrameSize.
7244
7245 2012-09-07 Chong Yidong <cyd@gnu.org>
7246
7247 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7248
7249 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7250
7251 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7252
7253 More signal-handler cleanup (Bug#12327).
7254 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7255 Problem introduced when merging patches. Noted by Eli Zaretskii in
7256 <http://bugs.gnu.org/12327#67>.
7257 * floatfns.c: Comment fix.
7258 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7259 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7260 and anyway the declaration is harmless even if SIGDANGER is not defined.
7261 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7262 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7263 source files not surprisingly expected syssignal.h to define, or
7264 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7265 Include <sys/ioctl.h>, for FIONREAD.
7266 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7267 This eliminates a problem whereby other files mysteriously had
7268 to include "syssignal.h" before including "systty.h" if they
7269 wanted to use "#ifdef SIGIO".
7270
7271 2012-09-07 Eli Zaretskii <eliz@gnu.org>
7272
7273 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7274
7275 * w32.c (sigemptyset): Empty the set.
7276 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7277
7278 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7279
7280 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7281
7282 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7283 (mark_object): Likewise for frame objects.
7284
7285 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7286
7287 * syssignal.h (handle_on_main_thread): Always declare,
7288 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7289 This ports to platforms without HAVE_PTHREAD.
7290
7291 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7292
7293 Signal-handler cleanup (Bug#12327).
7294 Emacs's signal handlers were written in the old 4.2BSD style with
7295 sigblock and sigmask and so forth, and this led to some
7296 inefficiencies and confusion. Rewrite these to use
7297 pthread_sigmask etc. without copying signal sets around. Also,
7298 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7299 'signal', and instead use functions that do not attempt to take
7300 over the system name space. This patch causes Emacs's text
7301 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7302 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7303 Do not include <signal.h> or "syssignal.h", as these
7304 modules do not use signals.
7305 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7306 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7307 Do not include <signal.h>, as "syssignal.h" does that for us now.
7308 * atimer.c (sigmask_atimers): New function.
7309 (block_atimers, unblock_atimers): New functions,
7310 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7311 All uses replaced.
7312 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7313 no longer needed here.
7314 * emacs.c (main): Inspect existing signal handler with sigaction,
7315 so that there's no need to block and unblock SIGHUP.
7316 * sysdep.c (struct save_signal): New member 'action', replacing
7317 old member 'handler'.
7318 (save_signal_handlers, restore_signal_handlers):
7319 Use sigaction instead of 'signal' to save and restore.
7320 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7321 New function. All users of 'signal' modified to use set_sighandler
7322 if they're writeonly, and to use sys_signal if they're read+write.
7323 (emacs_sigaction_init, forwarded_signal): New functions.
7324 (sys_signal): Remove. All uses replaced by calls to sigaction
7325 and emacs_sigaction_init, or by direct calls to 'signal'.
7326 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7327 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7328 all uses replaced by pthread_sigmask etc. calls.
7329 * syssignal.h: Include <signal.h>.
7330 (emacs_sigaction_init, forwarded_signal): New decls.
7331 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7332 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7333 (sigmask, sys_sigmask): Remove; no longer needed.
7334 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7335 (sigblock, sigunblock, sigfree):
7336 (sigsetmask) [!defined sigsetmask]:
7337 Remove. All uses replaced by pthread_sigmask.
7338 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7339 no longer need to be replaced, and its typical old uses
7340 are now done via emacs_sigaction_init and sigaction.
7341 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7342 (sys_sigdel): Remove; unused.
7343 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7344
7345 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7346
7347 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7348 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7349
7350 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7351
7352 Explicitly mark buffer_defaults and buffer_local_symbols.
7353 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7354 mark_local_symbols here.
7355 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7356 since special buffers aren't marked here any more.
7357 (allocate_buffer): Chain new buffer with all_buffers here...
7358 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7359 not here.
7360 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7361 (syms_of_buffer): Remove staticpro of the above.
7362 (init_buffer_once): Set names for buffer_defaults and
7363 buffer_local_symbols.
7364
7365 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7366
7367 Use bool for booleans in font-related modules.
7368 * font.c (font_intern_prop, font_style_to_value)
7369 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7370 (generate_otf_features, font_check_otf_features, font_check_otf)
7371 (font_match_p, font_list_entities, font_at):
7372 * fontset.c (fontset_id_valid_p, reorder_font_vector
7373 (fontset_find_font, Fset_fontset_font)
7374 (face_suitable_for_char_p) [0]:
7375 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7376 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7377 (m17n_flt_initialized, ftfont_shape_by_flt):
7378 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7379 * nsfont.m (nsfont_draw):
7380 * w32font.c (w32font_draw):
7381 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7382 Use bool for booleans.
7383 * font.h: Adjust to above API changes.
7384 (struct font, struct font_driver, struct font_driver_list):
7385 Use bool for booleans.
7386 (struct font): Remove useless member encoding_type.
7387 All users removed.
7388 * fontset.c, xftfont.c: Omit unnecessary static decls.
7389
7390 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7391
7392 * alloc.c (mark_object): Revert window marking code
7393 since it's unsafe for the Fset_window_configuration.
7394
7395 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7396
7397 Fix race conditions with signal handlers and errno (Bug#12327).
7398 Be more systematic about preserving errno whenever a signal
7399 handler returns, even if it's not in the main thread. Do this by
7400 renaming signal handlers to distinguish between signal delivery
7401 and signal handling. All uses changed.
7402 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7403 * data.c (deliver_arith_signal): Rename from arith_error.
7404 * dispnew.c (deliver_window_change_signal): Rename from
7405 window_change_signal.
7406 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7407 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7408 * keyboard.c (deliver_input_available_signal): Rename from
7409 input_available_signal.
7410 (deliver_user_signal): Rename from handle_user_signal.
7411 (deliver_interrupt_signal): Rename from interrupt_signal.
7412 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7413 (deliver_child_signal): Rename from sigchld_handler.
7414 * atimer.c (handle_alarm_signal):
7415 * data.c (handle_arith_signal):
7416 * dispnew.c (handle_window_change_signal):
7417 * emacs.c (handle_fatal_signal, handle_danger_signal):
7418 * keyboard.c (handle_input_available_signal):
7419 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7420 * process.c (handle_pipe_signal, handle_child_signal):
7421 New functions, with the actual signal-handling code taken from the
7422 original respective signal handlers, sans the sporadic attempts to
7423 preserve errno, since that's now done by handle_on_main_thread.
7424 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7425 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7426 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7427 Move to sysdep.c.
7428 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7429 Move initialization of main_thread to sysdep.c's init_signals.
7430 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7431 our usage, and simplifies the mainline code.
7432 (record_child_status_change): New static function, as a helper
7433 for handle_child_signal, and with most of the old child handler's
7434 contents.
7435 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7436 (handle_child_signal): Use the above.
7437 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7438 Moved here from emacs.c.
7439 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7440 code moved here from emacs.c's main function.
7441 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7442 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7443 This lets callers save and restore errno properly.
7444
7445 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7446
7447 Remove redundant or unused things here and there.
7448 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7449 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7450 * editfns.c (Fcompare_buffer_substrings): Likewise.
7451 * frame.h (struct terminal, struct font_driver_list):
7452 Remove redundant declarations.
7453 * window.h (Qleft, Qright): Likewise.
7454
7455 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7456
7457 Do not mark objects from deleted buffers, windows and frames.
7458 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7459 (mark_object): Likewise for windows and frames.
7460
7461 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7462
7463 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7464 buffer_defaults and buffer_local_symbols as valid objects.
7465 Return special value to denote them.
7466
7467 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7468
7469 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7470 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7471 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7472 (file_name_absolute_p, Fsubstitute_in_file_name):
7473 (check_executable, check_writable, Ffile_accessible_directory_p)
7474 (Fset_file_selinux_context, Fdefault_file_modes)
7475 (Finsert_file_contents, choose_write_coding_system)
7476 (Fwrite_region, build_annotations, a_write, e_write)
7477 (Fdo_auto_save):
7478 * filelock.c (boot_time_initialized, get_boot_time)
7479 (get_boot_time_1, lock_file_1, within_one_second):
7480 * floatfns.c (in_float):
7481 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7482 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7483 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7484 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7485 * window.c (compare_window_configurations):
7486 Use bool for booleans.
7487 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7488 (Fdefault_file_modes): Now mode_t, not int, for modes.
7489 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7490 (internal_delete_file): Now returns void, not a (boolean) int,
7491 since nobody was looking at the return value.
7492 * lisp.h, window.h: Adjust to above API changes.
7493
7494 * xdisp.c (set_message): Simplify and reindent last change.
7495
7496 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7497
7498 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7499
7500 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7501
7502 * eval.c (call_debugger): Make the function non-static so that we
7503 can call it from set_message.
7504
7505 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7506 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7507
7508 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7509
7510 Give more-useful info on a fatal error (Bug#12328).
7511 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7512 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7513 of doing the work ourselves.
7514 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7515 do most of the work.
7516 (fatal_error_backtrace): New function, taken from the guts
7517 of the old fatal_error_signal, but with a new option to output
7518 a backtrace.
7519 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7520 info about the signal than just its number.
7521 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7522 * sysdep.c: Include <execinfo.h>
7523 (emacs_backtrace): New function, taken partly from the previous
7524 code of the 'die' function.
7525 (emacs_abort): Call fatal_error_backtrace rather than abort.
7526
7527 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7528
7529 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7530 eager (load-time) macro-expansion.
7531 * lisp.mk (lisp): Add macroexp.
7532
7533 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7534
7535 Simplify redefinition of 'abort' (Bug#12316).
7536 Do not try to redefine the 'abort' function. Instead, redo
7537 the code so that it calls 'emacs_abort' rather than 'abort'.
7538 This removes the need for the NO_ABORT configure-time macro
7539 and makes it easier to change the abort code to do a backtrace.
7540 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7541 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7542 Remove; sysdep.c's emacs_abort now takes its place.
7543 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7544 'abort' changed to use 'emacs_abort'.
7545 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7546 (abort) [!defined abort]: Rename to ...
7547 (emacs_abort): ... new name.
7548 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7549 the place of the old 'abort' in emacs.c.
7550 * w32.c, w32fns.c (abort): Do not #undef.
7551 * w32.c (emacs_abort): Rename from w32_abort.
7552
7553 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7554
7555 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7556 offsets[j].dv, since the y axis of the screen coordinates points
7557 down, while the y axis of the font definition coordinates points
7558 up. This fixes display of Arabic diacritics such as KASRA and
7559 KASRATAN. (Bug#11860)
7560
7561 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7562
7563 Be more systematic about _setjmp vs setjmp.
7564 * alloc.c (test_setjmp, mark_stack):
7565 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7566 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7567 (png_load, my_error_exit, jpeg_load):
7568 * process.c (send_process_trap, send_process):
7569 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7570 The underscored versions are up to 30x faster on some hosts.
7571 Formerly, the code used setjmp+longjmp sometimes and
7572 _setjmp+_longjmp at other times, with no particular reason to
7573 prefer setjmp+longjmp.
7574
7575 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7576
7577 Fix minor problem found by static checking.
7578 * buffer.c (Fdelete_all_overlays): Return nil.
7579
7580 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7581
7582 * buffer.c (Fdelete_all_overlays): New function.
7583
7584 2012-09-03 Chong Yidong <cyd@gnu.org>
7585
7586 * gtkutil.c: Add extern decl for Qxft.
7587
7588 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7589
7590 * emacs.c, eval.c: Use bool for boolean.
7591 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7592 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7593 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7594 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7595 (main, decode_env_path, Fdaemon_initialized):
7596 * eval.c (call_debugger, Finteractive_p, interactive_p):
7597 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7598 (maybe_call_debugger, Fbacktrace):
7599 * process.c (read_process_output, exec_sentinel):
7600 Use bool for booleans.
7601 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7602 All callers changed.
7603 * eval.c (interactive_p): Omit always-true boolean argument
7604 EXCLUDE_SUBRS_P. All callers changed.
7605 * dispextern.h, lisp.h: Reflect above API changes.
7606 * firstfile.c (dummy): Use the address of 'main', whose signature
7607 won't change, instead of the address of 'initialize', whose
7608 signature just changed from int to bool.
7609 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7610 * msdos.c (fatal_error_in_progress): ... from here.
7611 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7612 of incrementing it.
7613 (redisplay_internal, unwind_redisplay): Simply clear
7614 REDISPLAYING_P when unwinding, instead of saving its previous,
7615 always-false value and then restoring it.
7616
7617 Clean up some extern decls.
7618 Mostly, this hoists extern decls out of .c files and into .h files.
7619 That way, we're more likely to catch errors if the interfaces change.
7620 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7621 declare xg_mark_data.
7622 * dispextern.h (x_frame_parm_handlers):
7623 * font.h (Qxft):
7624 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7625 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7626 (Qultra_bold, Qoblique, Qitalic):
7627 Move extern decl here from .c file.
7628 * alloc.c (xg_mark_data) [USE_GTK]:
7629 * doc.c (Qclosure):
7630 * eval.c (Qlexical_binding):
7631 * fns.c (time) [!HAVE_UNISTD_H]:
7632 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7633 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7634 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7635 * lread.c (Qinternal_interpreter_environment):
7636 * minibuf.c (Qbuffer):
7637 * process.c (QCfamily, QCfilter):
7638 * widget.c (free_frame_faces):
7639 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7640 * xfont.c (x_clear_errors):
7641 * xterm.c (x_frame_parm_handlers):
7642 Remove now-redundant extern decls.
7643 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7644 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7645 Now static.
7646 * xfaces.c: Remove unnecessary static decls.
7647 * xterm.c (updating_frame): Remove decl of nonexistent object.
7648
7649 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7650 when building globals.h, as the objects that are not built on
7651 this host are not needed to compile C files on this host.
7652
7653 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7654
7655 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7656
7657 * frame.h: Add missing prototype for x_wm_set_size_hint.
7658
7659 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7660
7661 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7662 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7663 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7664 (Fsubstitute_command_keys):
7665 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7666 (save_excursion_save, save_excursion_restore)
7667 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7668 (format_time_string, general_insert_function)
7669 (make_buffer_string, make_buffer_string_both)
7670 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7671 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7672 (copy_text, insert_1, insert_1_both, insert_from_string)
7673 (insert_from_string_before_markers, insert_from_string_1)
7674 (insert_from_buffer, insert_from_buffer_1, replace_range)
7675 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7676 (del_range_2, modify_region):
7677 * intervals.c (intervals_equal, balance_possible_root_interval)
7678 (adjust_intervals_for_insertion, merge_properties_sticky)
7679 (graft_intervals_into_buffer, lookup_char_property)
7680 (adjust_for_invis_intang, set_point_both)
7681 (get_property_and_range, compare_string_intervals)
7682 (set_intervals_multibyte_1, set_intervals_multibyte):
7683 * keyboard.c (decode_timer):
7684 Use bool for boolean.
7685 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7686 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7687
7688 2012-09-02 Chong Yidong <cyd@gnu.org>
7689
7690 * keymap.c (push_key_description): Print M-TAB as C-M-i
7691 (Bug#11758).
7692
7693 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
7694
7695 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7696 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7697 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7698 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7699 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7700 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7701 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7702
7703 2012-09-01 Eli Zaretskii <eliz@gnu.org>
7704
7705 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7706 more than one grapheme cluster passed to the shaper: compute the
7707 offset adjustment values separately for each cluster. (Bug#11860)
7708
7709 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7710 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7711 about implicit conversions from integer to pointer.
7712
7713 2012-09-01 Daniel Colascione <dancol@dancol.org>
7714
7715 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7716 system used too early.
7717
7718 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7719
7720 Better seed support for (random).
7721 * emacs.c (main): Call init_random.
7722 * fns.c (Frandom): Set the seed from a string argument, if given.
7723 Remove long-obsolete Gentzel cruft.
7724 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7725 (init_random): New function.
7726
7727 2012-09-01 Daniel Colascione <dancol@dancol.org>
7728
7729 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7730 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7731 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7732 x_wm_set_size_hint, x_query_colors, x_real_positions,
7733 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7734 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7735 all of which have been moved to common code.
7736
7737 * xfaces.c: Include TERM_HEADER instead of listing all possible
7738 window-system headers.
7739
7740 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7741 to match header.
7742
7743 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7744 directly accessing frame internals.
7745
7746 * w32font.h: Include font.h. Define syms_of_w32font and
7747 globals_of_w32font.
7748
7749 * process.c: Include TERM_HEADER instead of listing all possible
7750 window-system headers.
7751
7752 * nsterm.h: Remove declarations now in frame.h.
7753 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
7754
7755 * menu.c: Include TERM_HEADER instead of listing all possible
7756 window-system headers.
7757
7758 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7759 window system.
7760
7761 * keyboard.c: Include TERM_HEADER instead of listing all possible
7762 window-system headers.
7763
7764 * image.c: Include TERM_HEADER instead of listing all possible
7765 window-system headers. Declare Vlibrary_cache when compiling for
7766 Windows.
7767
7768 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7769 window system declarations.
7770
7771 * frame.h: Move common functions here: set_frame_menubar,
7772 x_set_window_size, x_sync, x_get_focus_frame,
7773 x_set_mouse_position, x_set_mouse_pixel_position,
7774 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7775 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7776 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7777 x_activate_menubar, x_real_positions, x_bitmap_icon,
7778 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7779 and x_query_colors.
7780
7781 * frame.c: Include TERM_HEADER instead of listing all possible
7782 window-system headers.
7783
7784 * font.c: Include TERM_HEADER instead of listing all possible
7785 window-system headers.
7786
7787 * emacs.c: Include TERM_HEADER.
7788
7789 * dispnew.c: Include TERM_HEADER instead of listing all possible
7790 window-system headers.
7791
7792 * ccl.h: Include character.h.
7793
7794 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7795 the current window system; include in list of objects to link into
7796 Emacs.
7797
7798 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7799
7800 Remove mark_ttys function and fix tty_display_info initialization.
7801 * lisp.h (mark_ttys): Remove prototype.
7802 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7803 to mark_ttys because all possible values of 'top_frame' slot are
7804 the frames which are reachable from Vframe_list.
7805 * term.c (mark_ttys): Remove.
7806 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7807
7808 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7809
7810 Change struct frame bitfields from unsigned char to unsigned.
7811 * frame.h (struct frame): Change type of 'display_preempted',
7812 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7813 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7814 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7815 bitfields from unsigned char to unsigned.
7816
7817 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7818
7819 Remove unused member of struct x_output and struct w32_output.
7820 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7821 * w32term.h (struct w32_output): Likewise.
7822
7823 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7824
7825 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7826 does not become zero (Bug#12234).
7827
7828 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7829
7830 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7831 for GCC 4.7.1 x86-64.
7832
7833 2012-08-30 Glenn Morris <rgm@gnu.org>
7834
7835 * lread.c (init_lread): For out-of-tree builds, only add the
7836 source directory's site-lisp dir to the load-path if it exists,
7837 consistent with in-tree builds. (Bug#12302)
7838
7839 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7840
7841 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
7842 button_values to NULL. Call setStykeMask so dialogs get a close button.
7843 (windowShouldClose:): Set window_closed.
7844 (dealloc): New member, free button_values.
7845 (process_dialog:): Make member function. Remove window argument,
7846 replace window with self. Count buttons and allocate and store values
7847 in button_values.
7848 (addButton:value:row:): value is int with the name tag. Call setTag
7849 with tag. Remove return self, declare return value as void.
7850 (addString:row:): Remove return self, declare return value as void.
7851 (addSplit): Remove return self, declare return value as void.
7852 (clicked:): Remove return self, declare return value as void.
7853 Set dialog_return to button_values[seltag]. Code formatting change.
7854 (initFromContents:isQuestion:): Adjust call to process_dialog.
7855 Code formatting change.
7856 (timeout_handler:): Set timer_fired to YES.
7857 (runDialogAt:): Set timer_fired to NO.
7858 Handle click on close button as quit.
7859
7860 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7861 Add window_closed and button_values. Add void as return value for
7862 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7863 Add process_dialog as new member.
7864
7865 2012-08-28 Eli Zaretskii <eliz@gnu.org>
7866
7867 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7868 is not one of the heaps we manage. (Bug#12242)
7869
7870 2012-08-28 Glenn Morris <rgm@gnu.org>
7871
7872 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7873
7874 2012-08-28 Martin Rudalics <rudalics@gmx.at>
7875
7876 * window.c (Fset_window_configuration): Remove handling of
7877 auto-buffer-name window parameter. Install revision of reverted
7878 fix.
7879
7880 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7881
7882 Do not allow to set major mode for a dead buffer.
7883 * buffer.c (Fset_buffer_major_mode): Signal an error
7884 if the buffer is dead.
7885 (Fother_buffer, other_buffer_safely): Remove redundant
7886 nested declaration.
7887
7888 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7889
7890 Always use set_buffer_if_live to restore original buffer at unwind.
7891 * buffer.h (record_unwind_current_buffer): New function.
7892 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7893 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7894 * undo.c, window.c: Adjust users.
7895 * buffer.c (set_buffer_if_live): Fix comment.
7896
7897 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7898
7899 Fix usage of set_buffer_internal.
7900 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7901 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7902 * coding.c (decode_coding): Omit redundant test.
7903 * fileio.c (decide_coding_unwind): Likewise.
7904 * fns.c (secure_hash): Likewise.
7905 * insdel.c (modify_region): Likewise.
7906 * keyboard.c (command_loop_1): Likewise.
7907 * print.c (PRINTFINISH): Likewise.
7908 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7909
7910 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7911
7912 * dispnew.c: Use bool for boolean.
7913 (frame_garbaged, display_completed, delayed_size_change)
7914 (fonts_changed_p, add_window_display_history)
7915 (add_frame_display_history, verify_row_hash)
7916 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7917 (row_equal_p, realloc_glyph_pool)
7918 (allocate_matrices_for_frame_redisplay)
7919 (showing_window_margins_p)
7920 (adjust_frame_glyphs_for_frame_redisplay)
7921 (build_frame_matrix_from_leaf_window, make_current)
7922 (mirrored_line_dance, mirror_line_dance, update_frame)
7923 (update_window_tree, update_single_window)
7924 (check_current_matrix_flags, update_window, update_text_area)
7925 (update_window_line, set_window_update_flags, scrolling_window)
7926 (update_frame_1, scrolling, buffer_posn_from_coords)
7927 (do_pending_window_change, change_frame_size)
7928 (change_frame_size_1, sit_for):
7929 Use bool for boolean.
7930 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7931 and remove last int (actually boolean) argument, which was always 0.
7932 All callers changed.
7933 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7934 * dispextern.h (struct composition_it): Use bool for boolean.
7935 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7936 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7937 * dired.c (file_name_completion):
7938 Use bool for boolean. (This was missed in an earlier change.)
7939
7940 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7941
7942 * window.c (Fset_window_configuration): Revert first part of
7943 last change.
7944
7945 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7946
7947 * nsterm.h (NSPanel): New class variable dialog_return.
7948
7949 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7950 Initialize dialog_return.
7951 (windowShouldClose:): Use stop instead of stopModalWithCode.
7952 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7953 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7954 event.
7955 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7956 modal loop returns.
7957
7958 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7959
7960 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7961 * composite.c (find_composition, composition_gstring_p)
7962 (composition_reseat_it, find_automatic_composition):
7963 * data.c (let_shadows_buffer_binding_p)
7964 (let_shadows_global_binding_p, set_internal, make_blv)
7965 (Fmake_variable_buffer_local, Fmake_local_variable)
7966 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7967 (cons_to_signed, arith_driver):
7968 * dbusbind.c (xd_in_read_queued_messages):
7969 * dired.c (directory_files_internal, file_name_completion):
7970 Use bool for booleans.
7971 * dired.c (file_name_completion):
7972 * process.h (fd_callback):
7973 Omit int (actually boolean) argument. It wasn't being used.
7974 All uses changed.
7975 * composite.h, lisp.h: Reflect above API changes.
7976
7977 * cmds.c, coding.c: Use bool for booleans.
7978 * cmds.c (move_point, Fself_insert_command):
7979 * coding.h (struct composition status, struct coding_system):
7980 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7981 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7982 (emacs_mule_char, decode_coding_emacs_mule)
7983 (encode_coding_emacs_mule, detect_coding_iso_2022)
7984 (decode_coding_iso_2022, encode_invocation_designation)
7985 (encode_designation_at_bol, encode_coding_iso_2022)
7986 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7987 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7988 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7989 (encode_coding_raw_text, detect_coding_charset)
7990 (decode_coding_charset, encode_coding_charset, detect_eol)
7991 (detect_coding, get_translation_table, produce_chars)
7992 (consume_chars, reused_workbuf_in_use)
7993 (make_conversion_work_buffer, code_conversion_save)
7994 (decode_coding_object, encode_coding_object)
7995 (detect_coding_system, char_encodable_p)
7996 (Funencodable_char_position, code_convert_region)
7997 (code_convert_string, code_convert_string_norecord)
7998 (Fset_coding_system_priority):
7999 * fileio.c (Finsert_file_contents):
8000 Use bool for booleans.
8001 * coding.h, lisp.h: Reflect above API changes.
8002 * coding.c: Remove unnecessary static function decls.
8003 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
8004 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
8005 not a boolean 'int', since callers never look at the return value.
8006 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
8007 * coding.h (decoding_buffer_size, encoding_buffer_size)
8008 (emacs_mule_string_char): Remove unused extern decls.
8009 (struct iso_2022_spec, struct coding_system):
8010 Use 'unsigned int : 1' for boolean fields, since there's more than one.
8011 (struct emacs_mule_spec): Remove unused field 'full_support'.
8012 All initializations removed.
8013 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
8014
8015 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8016
8017 Fix spare memory change (Bug#12286).
8018 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
8019 (valid_lisp_object_p): Likewise.
8020
8021 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8022
8023 * window.c (Fset_window_configuration): Record any window's old
8024 buffer if it's replaced (see Bug#8789). If the new current
8025 buffer doesn't appear in the selected window, go to its old
8026 point (Bug#12208).
8027
8028 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8029
8030 Special MEM_TYPE_SPARE to denote reserved memory.
8031 * alloc.c (enum mem_type): New memory type.
8032 (refill_memory_reserve): Use new type for spare memory.
8033 This prevents live_cons_p and live_string_p from incorrect
8034 detection of uninitialized objects from spare memory as live.
8035
8036 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8037
8038 Spelling fixes.
8039 * Makefile.in (.PHONY): versioclean -> versionclean.
8040
8041 Remove unused external symbols.
8042 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8043 * window.c (Qwindow_valid_p, decode_valid_window):
8044 Now static, not extern.
8045 * data.c (Qinterval): Remove; unused.
8046 (syms_of_data): Do not define 'interval'.
8047 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8048 * window.h (decode_valid_window):
8049 Remove decls.
8050
8051 * character.c, charset.c, chartab.c: Use bool for booleans.
8052 * character.c (lisp_string_width, string_count_byte8)
8053 (string_escape_byte8):
8054 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8055 (load_charset_map_from_file, map_charset_chars)
8056 (Fdefine_charset_internal, define_charset_internal)
8057 (Fdeclare_equiv_charset, find_charsets_in_text)
8058 (Ffind_charset_region, char_charset, Fiso_charset):
8059 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8060 (sub_char_table_set, sub_char_table_set_range)
8061 (char_table_set_range, optimize_sub_char_table)
8062 (map_sub_char_table):
8063 Use bool for boolean.
8064 * character.c (str_to_unibyte): Omit last boolean argument; it was
8065 always 0. All callers changed.
8066 * character.h, charset.h: Adjust to match previous changes.
8067 * character.h (char_printable_p): Remove decl of nonexistent function.
8068 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8069 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8070 are all boolean, so make them single-bit bitfields.
8071
8072 * lisp.h (ASET): Remove attempt to detect side effects.
8073 It was meant to be temporary and it often doesn't work,
8074 because when IDX has side effects the behavior of IDX==IDX
8075 is undefined. See Stefan Monnier in
8076 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8077
8078 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8079
8080 * lisp.h (functionp): New function (extracted from Ffunctionp).
8081 (FUNCTIONP): Use it.
8082 * eval.c (Ffunctionp): Use it.
8083
8084 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8085
8086 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8087 as that's faster and simpler than static storage. Don't bother
8088 with the g_main_context_query overhead if g_main_context_pending
8089 says no events are pending.
8090 (gfds, gfds_size): Remove these static vars.
8091 (xgselect_initialize): Remove; no longer needed.
8092 All uses and decls removed.
8093
8094 * emacs.c (fatal_error_signal_hook): Remove.
8095 All uses removed. This leftover from old code was always 0.
8096
8097 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8098 * casefiddle.c (casify_object, casify_region):
8099 * casetab.c (set_case_table):
8100 * category.c, category.h (word_boundary_p):
8101 * category.h (CHAR_HAS_CATEGORY):
8102 Use bool for booleans, instead of int.
8103
8104 2012-08-25 Eli Zaretskii <eliz@gnu.org>
8105
8106 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8107
8108 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8109
8110 On assertion failure, print backtrace if available.
8111 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8112 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8113 * Makefile.in (LIB_EXECINFO): New macro.
8114 (LIBES): Use it.
8115
8116 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8117 * bytecode.c (exec_byte_code):
8118 * callint.c (check_mark, Fcall_interactively):
8119 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8120 (getenv_internal, sync_process_alive, call_process_exited):
8121 * lisp.h (USE_SAFE_ALLOCA):
8122 Use bool for booleans, instead of int.
8123 * lisp.h, process.h: Adjust prototypes to match above changes.
8124 * callint.c (Fcall_interactively): Don't assume the mark's
8125 offset fits in 'int'.
8126
8127 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8128
8129 * buffer.c, buffer.h: Use bool for boolean.
8130 * buffer.c (reset_buffer_local_variables)
8131 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8132 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8133 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8134 (overlay_touches_p, overlay_strings, Foverlay_put)
8135 (report_overlay_modification, call_overlay_mod_hooks):
8136 (mmap_enlarge, mmap_set_vars):
8137 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8138 Use bool for booleans, instead of int.
8139 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8140 since the 1-or-0 return value is always ignored anyway.
8141 (mmap_initialized_p):
8142 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8143 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8144
8145 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8146
8147 * bidi.c: Use bool for boolean.
8148 This is a bit more readable, and makes the text segment of bidi.o
8149 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8150 Presumably it's faster too.
8151 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8152 Now bool.
8153 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8154 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8155 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8156 (bidi_explicit_dir_char, bidi_level_of_next_char)
8157 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8158 Use bool for booleans, instead of int.
8159 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8160 (bidi_unshelve_cache): Adjust decls to match code.
8161
8162 2012-08-23 Martin Rudalics <rudalics@gmx.at>
8163
8164 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8165 argument.
8166
8167 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8168
8169 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8170 * atimer.h: Include <stdbool.h>.
8171
8172 2012-08-22 Dan Nicolaescu <dann@gnu.org>
8173
8174 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8175 compile time tests instead of run time tests on systems that do
8176 not use them.
8177 (FRAME_MAC_P): Remove leftover from deleted code.
8178 * frame.c (syms_of_frame): Remove leftover from deleted code.
8179
8180 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8181
8182 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8183
8184 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8185
8186 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8187 Otherwise, the compiler complains about (A?B:C) where B is void
8188 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8189 (fontset_add): Return void, for FONTSET_ADD.
8190
8191 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8192
8193 * alloc.c: Use bool for booleans.
8194 (gc_in_progress, abort_on_gc)
8195 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8196 (dont_register_blocks) [GC_MALLOC_CHECK]:
8197 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8198 (check_string_bytes, make_specified_string, memory_full)
8199 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8200 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8201 (mark_stack, valid_pointer_p, make_pure_string)
8202 (Fgarbage_collect, survives_gc_p, gc_sweep):
8203 Use bool for booleans, instead of int.
8204 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8205 Remove unused local.
8206 * alloc.c (PURE_POINTER_P):
8207 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8208 * editfns.c (Fformat):
8209 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8210 (Fdo_auto_save):
8211 * fns.c (sweep_weak_table):
8212 * lisp.h (suppress_checking, push_message, survives_gc_p)
8213 (make_pure_string, gc_in_progress, abort_on_gc):
8214 * lread.c (readchar, read1):
8215 * print.c (Fprin1_to_string):
8216 * xdisp.c (push_message):
8217 Use bool for booleans affected directly or indirectly by
8218 alloc.c's changes.
8219
8220 Make recently-introduced setters macros.
8221 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8222 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8223 (set_fontset_default, set_fontset_fallback): Rename from their
8224 upper-case counterparts, and make them functions rather than macros.
8225 This is more consistent with the other recently-introduced setters.
8226 These don't need to be inline, since they're local.
8227
8228 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8229
8230 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8231 the loop (Bug#12247).
8232
8233 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8234
8235 * lisp.h (vcopy): Use memcpy rather than our own loop.
8236 This fixes a performance regression introduced by the recent
8237 addition of vcopy. This means 'vcopy' will need to be modified
8238 for a copying collector, but that's OK. Also, tighten the
8239 checking in the assertion.
8240
8241 2012-08-21 Eli Zaretskii <eliz@gnu.org>
8242
8243 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8244 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8245 non-base glyph for the width of the base character, according to
8246 what x_draw_composite_glyph_string_foreground expects.
8247 Generate WADJUST value according to composition_gstring_width's
8248 expectations, to produce correct width of the composed character.
8249 Reverse the sign of the DU offset produced by ScriptPlace.
8250
8251 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8252
8253 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8254
8255 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8256
8257 Avoid direct writes to contents member of struct Lisp_Vector.
8258 * lisp.h (vcopy): New function to copy data into vector.
8259 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8260 * fns.c (Ffillarray): Use ASET.
8261 * keyboard.c (timer_check_2): Use AREF and ASET.
8262 (append_tool_bar_item, Frecent_keys): Use vcopy.
8263 * lread.c (read_vector): Use ASET.
8264 * msdos.c (Frecent_doskeys): Use vcopy.
8265 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8266 (Finternal_merge_in_global_face): Use ASET and vcopy.
8267 * xfont.c (xfont_list_pattern): Likewise.
8268
8269 2012-08-21 Martin Rudalics <rudalics@gmx.at>
8270
8271 * window.c (Fwindow_point): For the selected window always return
8272 the position of its buffer's point.
8273 (Fset_window_point): For the selected window always go in its
8274 buffer to the specified position.
8275
8276 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8277
8278 Setter macros for fontsets.
8279 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8280 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8281 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8282 Adjust users.
8283
8284 2012-08-20 Glenn Morris <rgm@gnu.org>
8285
8286 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8287 Don't assume that `ln -f' works.
8288
8289 2012-08-20 Eli Zaretskii <eliz@gnu.org>
8290
8291 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8292 and later about non-assignments with no effect. See discussion at
8293 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8294 details.
8295
8296 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8297
8298 Inline setter functions for Lisp_Objects slots of struct specbinding.
8299 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8300 Adjust users.
8301
8302 2012-08-20 Martin Rudalics <rudalics@gmx.at>
8303
8304 * window.c (select_window): Always make selected window's buffer
8305 current.
8306
8307 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8308
8309 Use AREF and ASET for docstrings of category tables.
8310 * category.h (CATEGORY_DOCSTRING): Use AREF.
8311 (SET_CATEGORY_DOCSTRING): Use ASET.
8312 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8313
8314 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8315
8316 Inline setter functions for hash table members.
8317 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8318 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8319 (set_hash_key_and_value, set_hash_index, set_hash_next)
8320 (set_hash_hash): New functions.
8321 * charset.c, fns.c: Adjust users.
8322
8323 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8324
8325 Inline getter and setter functions for per-buffer values.
8326 * buffer.h (per_buffer_default, set_per_buffer_default)
8327 (per_buffer_value, set_per_buffer_value): New functions.
8328 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8329 * buffer.c, data.c: Adjust users.
8330
8331 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8332
8333 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8334
8335 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8336
8337 Rely on <config.h> + <unistd.h> to declare 'environ',
8338 as gnulib does this if the system doesn't.
8339 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8340 Remove declaration. MS-Windows declares it on stdlib.h which is
8341 included by conf_post.h.
8342 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8343 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8344 * vm-limit.c: Include <unistd.h>, for 'environ'.
8345
8346 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8347 (start_of_data): Remove decl; mem-limits.h provides it.
8348
8349 * xdisp.c (handle_invisible_prop): Make it a bit faster
8350 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8351
8352 2012-08-19 Chong Yidong <cyd@gnu.org>
8353
8354 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8355 ends (Bug#3874).
8356
8357 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8358
8359 * .gdbinit: Use call instead of set when calling a function in the
8360 inferior.
8361
8362 * data.c (set_internal): Don't use set_blv_found.
8363 (Fkill_local_variable): Likewise.
8364
8365 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8366
8367 * nsfont.m (ns_ascii_average_width): Ensure the string
8368 ascii_printable is initialized with a null-terminated character
8369 array. Otherwise, it can contain undesired extra characters.
8370
8371 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8372
8373 port new setting code to Sun C 5.8 2005/10/13
8374 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8375 Return void, not Lisp_Object. Otherwise, the compiler
8376 complains about (A?B:C) where B is void and C is Lisp_Object
8377 when compiling CHAR_TABLE_SET, due to the recent change to
8378 the API of sub_char_table_set_contents.
8379
8380 2012-08-18 Chong Yidong <cyd@gnu.org>
8381
8382 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8383 for the string case (Bug#3874).
8384
8385 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8386
8387 * buffer.h (BSET): Remove (Bug#12215).
8388 Replace all uses with calls to new setter functions.
8389 (bset_bidi_paragraph_direction, bset_case_canon_table)
8390 (bset_case_eqv_table, bset_directory, bset_display_count)
8391 (bset_display_time, bset_downcase_table)
8392 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8393 (bset_last_selected_window, bset_local_var_alist)
8394 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8395 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8396 (bset_width_table):
8397 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8398 (bset_auto_fill_function, bset_auto_save_file_format)
8399 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8400 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8401 (bset_cache_long_line_scans, bset_case_fold_search)
8402 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8403 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8404 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8405 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8406 (bset_header_line_format, bset_indicate_buffer_boundaries)
8407 (bset_indicate_empty_lines, bset_invisibility_spec)
8408 (bset_left_fringe_width, bset_major_mode, bset_mark)
8409 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8410 (bset_name, bset_overwrite_mode, bset_pt_marker)
8411 (bset_right_fringe_width, bset_save_length)
8412 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8413 (bset_scroll_up_aggressively, bset_selective_display)
8414 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8415 (bset_word_wrap, bset_zv_marker):
8416 * category.c (bset_category_table):
8417 * syntax.c (bset_syntax_table):
8418 New setter functions.
8419
8420 * process.h (PSET): Remove (Bug#12215).
8421 Replace all uses with calls to new setter functions.
8422 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8423 (PROCESS_INLINE): New macro.
8424 (pset_childp): New setter function.
8425 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8426 * process.c (PROCESS_INLINE):
8427 Define to EXTERN_INLINE, so that the corresponding functions
8428 are compiled into code.
8429 (pset_buffer, pset_command, pset_decode_coding_system)
8430 (pset_decoding_buf, pset_encode_coding_system)
8431 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8432 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8433 (pset_type, pset_write_queue): New setter functions.
8434
8435 * window.h (WSET): Remove (Bug#12215).
8436 Replace all uses with calls to new setter functions.
8437 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8438 (WINDOW_INLINE): New macro.
8439 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8440 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8441 (wset_total_lines, wset_vertical_scroll_bar)
8442 (wset_window_end_pos, wset_window_end_valid)
8443 (wset_window_end_vpos): New setter functions.
8444 * window.c (WINDOW_INLINE):
8445 Define to EXTERN_INLINE, so that the corresponding functions
8446 are compiled into code.
8447 (wset_combination_limit, wset_dedicated, wset_display_table)
8448 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8449 (wset_new_normal, wset_new_total, wset_next_buffers)
8450 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8451 (wset_prev_buffers, wset_right_fringe_width)
8452 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8453 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8454 (wset_window_parameters):
8455 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8456 (wset_column_number_displayed, wset_region_showing):
8457 New setter functions.
8458
8459 * termhooks.h (TSET): Remove (Bug#12215).
8460 Replace all uses with calls to new setter functions.
8461 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8462 (TERMHOOKS_INLINE): New macro.
8463 (tset_charset_list, tset_selection_alist): New setter functions.
8464 * terminal.c (TERMHOOKS_INLINE):
8465 Define to EXTERN_INLINE, so that the corresponding functions
8466 are compiled into code.
8467 (tset_param_alist): New setter function.
8468
8469 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8470
8471 * keyboard.h (KSET): Remove (Bug#12215).
8472 Replace all uses with calls to new setter functions.
8473 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8474 (KEYBOARD_INLINE): New macro.
8475 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8476 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8477 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8478 New setter functions.
8479 * keyboard.c (KEYBOARD_INLINE):
8480 Define to EXTERN_INLINE, so that the corresponding functions
8481 are compiled into code.
8482 (kset_echo_string, kset_kbd_queue)
8483 (kset_keyboard_translate_table, kset_last_prefix_arg)
8484 (kset_last_repeatable_command, kset_local_function_key_map)
8485 (kset_overriding_terminal_local_map, kset_real_last_command)
8486 (kset_system_key_syms): New setter functions.
8487
8488 * frame.h (FSET): Remove (Bug#12215).
8489 Replace all uses with calls to new setter functions.
8490 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8491 (FRAME_INLINE): New macro.
8492 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8493 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8494 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8495 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8496 (fset_param_alist, fset_root_window, fset_scroll_bars)
8497 (fset_selected_window, fset_title, fset_tool_bar_items)
8498 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8499 * frame.c (FRAME_INLINE):
8500 Define to EXTERN_INLINE, so that the corresponding functions
8501 are compiled into code.
8502 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8503
8504 A few more naming-convention fixes for getters and setters.
8505 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8506 and rename from buffer_overlays_set_before.
8507 (set_buffer_overlays_after): Move here from buffer.h, and rename
8508 from buffer_overlays_set_after.
8509 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8510 All uses changed.
8511 (set_buffer_intervals): Rename from buffer_set_intervals.
8512 * intervals.c (set_interval_object): Move here from intervals.h,
8513 and rename from interval_set_object.
8514 (set_interval_left): Move here from intervals.h, and rename from
8515 interval_set_left.
8516 (set_interval_right): Move here from intervals.h, and rename from
8517 interval_set_right.
8518 (copy_interval_parent): Move here from intervals.h, and rename from
8519 interval_copy_parent.
8520 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8521 (set_interval_plist): Rename from interval_set_plist.
8522 Return void, not Lisp_Object, since no caller uses the result.
8523 * lisp.h (string_intervals): Rename from string_get_intervals.
8524 (set_string_intervals): Rename from string_set_intervals.
8525
8526 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8527 (set_char_table_contents): Rename from char_table_set_contents.
8528 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8529 All uses changed. See the end of
8530 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8531
8532 * lisp.h (CSET): Remove (Bug#12215).
8533 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8534 (set_char_table_purpose): New functions,
8535 replacing CSET. All uses changed. For example, replace
8536 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8537 "set_char_table_parent (char_table, parent);".
8538 The old version was confusing because it used the same name
8539 'parent' for two different things.
8540
8541 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8542
8543 Functions to get and set Lisp_Object fields of buffer-local variables.
8544 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8545 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8546 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8547 * data.c, eval.c, frame.c: Adjust users.
8548
8549 2012-08-17 Chong Yidong <cyd@gnu.org>
8550
8551 * xfaces.c (merge_face_vectors): If the target font specfies a
8552 font spec, make the font's attributes take precedence over
8553 directly-specified attributes.
8554 (merge_face_ref): Recognize :font.
8555
8556 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8557
8558 Do not use memcpy for copying intervals.
8559 * intervals.c (reproduce_interval): New function.
8560 (reproduce_tree, reproduce_tree_obj): Use it.
8561 (reproduce_tree_obj): Remove prototype.
8562
8563 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8564
8565 * lisp.h (duration_to_sec_usec): Remove unused decl.
8566
8567 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8568
8569 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8570 to an allocated instance of NSString, not to the class itself.
8571
8572 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8573
8574 * makefile.w32-in (C_CTYPE_H): New macro.
8575 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8576 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8577 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8578
8579 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8580
8581 Use ASCII tests for character types.
8582 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8583 * xfns.c, xterm.c:
8584 Don't include <ctype.h>; was not needed.
8585 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8586 * sysdep.c, xfaces.c:
8587 Include <c-ctype.h> instead of <ctype.h>.
8588 * nsterm.m: Include <c-ctype.h>.
8589 * charset.c (read_hex):
8590 * doc.c (Fsnarf_documentation):
8591 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8592 (DRIVE_LETTER) [DOS_NT]:
8593 (Ffile_name_directory, Fexpand_file_name)
8594 (Fsubstitute_in_file_name):
8595 * font.c (font_parse_xlfd, font_parse_fcname):
8596 * frame.c (x_set_font_backend):
8597 * gtkutil.c (xg_get_font):
8598 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8599 * nsimage.m (hexchar):
8600 * nsterm.m (ns_xlfd_to_fontname):
8601 * sysdep.c (system_process_attributes):
8602 * xfaces.c (hash_string_case_insensitive):
8603 Use C-locale tests instead of locale-specific tests for character
8604 types, since we want the ASCII interpretation here, not the
8605 interpretation suitable for whatever happens to be the current locale.
8606
8607 2012-08-16 Martin Rudalics <rudalics@gmx.at>
8608
8609 Consistently check windows for validity/liveness
8610 (Bug#11984, Bug#12025, Bug#12026).
8611 * lisp.h (CHECK_VALID_WINDOW): New macro.
8612 * window.c (decode_window): Rename to decode_live_window.
8613 (decode_valid_window, Fwindow_valid_p): New functions.
8614 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8615 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8616 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8617 (Fwindow_prev_sibling, Fwindow_combination_limit)
8618 (Fset_window_combination_limit, Fwindow_use_time)
8619 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8620 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8621 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8622 (Fwindow_hscroll, Fset_window_hscroll)
8623 (Fwindow_redisplay_end_trigger)
8624 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8625 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8626 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8627 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8628 (Fwindow_end, Fset_window_point, Fset_window_start)
8629 (Fpos_visible_in_window_p, Fwindow_line_height)
8630 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8631 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8632 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8633 (Fset_window_parameter, Fwindow_display_table)
8634 (Fset_window_display_table, Fdelete_other_windows_internal)
8635 (Fset_window_buffer, Fset_window_new_total)
8636 (Fset_window_new_normal, Fdelete_window_internal)
8637 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8638 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8639 (Fwindow_scroll_bars): Check whether argument window is a valid or
8640 live window. Update doc-strings.
8641 (syms_of_window): New symbol Qwindow_valid_p.
8642 * keyboard.c (Fposn_at_x_y): Check whether argument
8643 frame_or_window denotes a valid window.
8644
8645 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8646
8647 Fix previous char table change.
8648 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8649 * chartab.c (optimize_sub_char_table): Likewise.
8650
8651 2012-08-16 Chong Yidong <cyd@gnu.org>
8652
8653 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8654
8655 * xfont.c (xfont_open):
8656 * xftfont.c (xftfont_open): Set the font's max_width field.
8657
8658 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8659 min_width to space_width and average_width to the average over
8660 printable ASCII characters.
8661 (ns_char_width): Code cleanup.
8662 (ns_ascii_average_width): New utility function.
8663
8664 * font.h (struct font): Update comments.
8665
8666 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8667
8668 Simple interface to set Lisp_Object fields of character tables.
8669 * lisp.h (CSET): New macro.
8670 (char_table_set_extras, char_table_set_contents)
8671 (sub_char_table_set_contents): New function.
8672 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8673 * syntax.c: Adjust users.
8674
8675 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8676
8677 * eval.c (eval_sub): Bind lexical-binding.
8678 * lread.c (Qlexical_binding): Make non-static.
8679
8680 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8681
8682 * nsmenu.m (popupSession): Remove.
8683 (pop_down_menu): Remove endModalSession.
8684 (timeout_handler:): New method.
8685 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8686 Call runModalForWindow. Check timer_fired when it returns.
8687 If not set, cancel timer and break out of loop.
8688 Otherwise loop again, with a new timeout.
8689
8690 * nsterm.m: Include fcntl.h if present.
8691 (fd_entry, t_readfds, inNsSelect): Remove.
8692 (select_writefds, select_valid, select_timeout, selfds)
8693 (select_mutex, apploopnr): Add.
8694 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8695 Otherwise call kbd_buffer_store_event.
8696 (ns_send_appdefined): Remove release of fd_entry.
8697 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8698 Increment and decrement apploopnr.
8699 (ns_select): If no file descriptors, just do a NSTimer.
8700 Otherwise copy read/write masks and start select thread (fd_handler).
8701 Start main loop and wait for application defined event.
8702 Inform select thread to stop selecting after main loop is exited.
8703 (ns_term_init): Create selfds pipe and set non-blocking.
8704 Initialize select_mutex. Start the select thread (fd_handler).
8705 (fd_handler:): Loop forever, wait for info from the main thread
8706 to either start or stop selecting. When select returns, send
8707 and appdefined event.
8708 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8709 If not call kbd_buffer_store_event.
8710
8711 * nsterm.h (EmacsApp): fd_handler takes id argument.
8712 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8713
8714 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8715
8716 2012-08-15 Eli Zaretskii <eliz@gnu.org>
8717
8718 * region-cache.c (move_cache_gap): Update gap_len using the actual
8719 growth of the boundaries array. Do not change cache_len.
8720 (Bug#12196)
8721
8722 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8723
8724 Generalize and cleanup font subsystem checks.
8725 * font.h (FONT_DEBUG, font_assert): Remove.
8726 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8727 Change font_assert to eassert. Use eassert where appropriate.
8728
8729 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8730
8731 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8732
8733 2012-08-15 Chong Yidong <cyd@gnu.org>
8734
8735 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8736 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8737 extract the font descriptor instead of just the font name.
8738 In that case, return a font spec instead of a string.
8739 (x_last_font_name): Move to this file from xfns.c.
8740
8741 * xfns.c (Fx_select_font): The return value can also be a font
8742 spec. Move x_last_font_name management to gtkutil.c.
8743
8744 * xfaces.c: Make font weight and style symbols non-static.
8745
8746 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8747
8748 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8749 (bug#12117).
8750
8751 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8752
8753 * alloc.c (Fgarbage_collect): Use plural form consistently.
8754
8755 2012-08-14 Eli Zaretskii <eliz@gnu.org>
8756
8757 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8758 iteration through the command loop. Fixes a problem whereby mouse
8759 movements are ignored until the first mouse click.
8760
8761 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8762
8763 Use bool, not int, for Lisp booleans.
8764 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8765 makes Emacs a bit smaller and presumably a bit faster.
8766 * lisp.h: Include <stdbool.h>.
8767 (struct Lisp_Boolfwd, defvar_bool):
8768 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8769 * regex.c [!emacs]: Include <stdbool.h>.
8770 (false, true): Remove; <stdbool.h> does this for us now.
8771
8772 2012-08-14 Chong Yidong <cyd@gnu.org>
8773
8774 * character.c (Fcharacterp): Doc fix (Bug#12076).
8775
8776 * data.c (Findirect_variable): Doc fix (Bug#11040).
8777
8778 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8779
8780 * editfns.c (Fformat): Doc fix (Bug#12059).
8781 (Fsave_current_buffer): Doc fix (Bug#11542).
8782
8783 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8784
8785 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8786 (bug#12022).
8787
8788 2012-08-14 Martin Rudalics <rudalics@gmx.at>
8789
8790 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8791 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8792 * minibuf.c (choose_minibuf_frame, read_minibuf):
8793 * w32fns.c (x_create_tip_frame):
8794 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8795 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8796
8797 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8798
8799 * intervals.c (offset_intervals): Remove obsolete comment.
8800
8801 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8802
8803 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8804
8805 2012-08-14 Gergely Risko <gergely@risko.hu>
8806
8807 * coding.c (decode_coding): Record buffer modification before
8808 disabling undo_list (Bug#11773).
8809
8810 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8811
8812 Revert and cleanup some recent overlay changes.
8813 * buffer.h (enum overlay_type): Remove.
8814 (buffer_get_overlays, buffer_set_overlays): Likewise.
8815 (buffer_set_overlays_before, buffer_set_overlays_after):
8816 New function. Adjust users.
8817 (unchain_both): Add eassert.
8818
8819 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8820
8821 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8822
8823 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8824
8825 * gtkutil.c (xg_mark_data): Don't assume C99.
8826
8827 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8828
8829 * gtkutil.c (xg_frame_tb_info): New struct.
8830 (TB_INFO_KEY): New define.
8831 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8832 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8833 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8834 if not present.
8835 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
8836 is up to date. Otherwise store new data.
8837 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8838
8839 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8840
8841 Use KSET for write access to Lisp_Object members of struct kboard.
8842 * keyboard.h (KSET): New macro.
8843 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8844 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8845 * xterm.c: Adjust users.
8846
8847 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8848
8849 Use BSET for write access to Lisp_Object members of struct buffer.
8850 * buffer.h (BSET): New macro.
8851 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8852 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8853 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8854 * window.c, xdisp.c, xfns.c: Adjust users.
8855
8856 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8857
8858 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8859
8860 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8861
8862 * nsterm.m (not_in_argv): New function.
8863 (application:openFile, application:openTempFile:):
8864 (application:openFileWithoutUI:, application:openFiles:): Open file
8865 if not_in_argv returns non-zero (bug#12171).
8866
8867 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
8868 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8869 Define for Gtk+ versions less than 3.2.
8870 (xg_get_font_name): Use those functions/macros here.
8871 Reported by Frans Oilinki <moilinki@gmail.com>.
8872
8873 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8874
8875 * unexmacosx.c (copy_data_segment): Copy initialized data in
8876 statically linked libraries from input file rather than memory.
8877
8878 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8879 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8880 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8881
8882 2012-08-10 Glenn Morris <rgm@gnu.org>
8883
8884 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8885 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8886
8887 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8888
8889 Fix last change to allow compilation with low optimization levels.
8890 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8891 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8892
8893 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8894
8895 Use common inline syntax in intervals.h.
8896 * intervals.h (INTERVALS_INLINE): New macro.
8897 Change all users from LISP_INLINE.
8898
8899 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8900
8901 Define Qnone once for all platforms.
8902 * frame.c (Qnone): Define here.
8903 (syms_of_frame): DEFSYM it.
8904 * lisp.h (Qnone): New declaration.
8905 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8906 * xfns.c: Remove duplication. Adjust users.
8907
8908 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8909
8910 Remove unused macros from intervals.h.
8911 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8912 * intervals.c: Adjust comment.
8913
8914 2012-08-10 Eli Zaretskii <eliz@gnu.org>
8915
8916 * w32fns.c <w32_unicode_gui>: New static variable.
8917 (globals_of_w32fns): Initialize it according to os_subtype.
8918 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8919 testing os_subtype.
8920
8921 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
8922 Eli Zaretskii <eliz@gnu.org>
8923
8924 Fix bug #10299 with Unicode characters sent by customized
8925 keyboards created by MSKLC.
8926 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8927 (w32_init_class): Use it to initialize the Emacs class with either
8928 ANSI or Unicode API calls.
8929 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8930 later.
8931 (w32_wnd_proc): If the character code sent by WM_CHAR or
8932 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8933 original message. Call DefWindowProcW on NT and later.
8934
8935 2012-08-10 Glenn Morris <rgm@gnu.org>
8936
8937 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8938
8939 * lisp.h (DIRECTORY_SEP): Let configure set it.
8940
8941 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8942
8943 Use TSET for write access to Lisp_Object slots of struct terminal.
8944 * termhooks.h (TSET): New macro.
8945 * coding.c, terminal.c, xselect.c: Adjust users.
8946
8947 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8948
8949 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8950 the failing expression, include them in the error message.
8951 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8952 * lisp.h (internal_condition_case_n): Update declaration.
8953
8954 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8955
8956 Inline functions to examine and change buffer overlays.
8957 * buffer.c (unchain_both): New function.
8958 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8959 (buffer_has_overlays): New function.
8960 (enum overlay_type): New enum.
8961 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8962 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8963
8964 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8965
8966 Inline functions to examine and change buffer intervals.
8967 * alloc.c (mark_interval_tree): Remove.
8968 (MARK_INTERVAL_TREE): Simplify.
8969 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8970 * intervals.c (buffer_balance_intervals): New function.
8971 (graft_intervals_into_buffer): Adjust indentation.
8972 (set_intervals_multibyte): Simplify.
8973 * buffer.h (BUF_INTERVALS): Remove.
8974 (buffer_get_intervals, buffer_set_intervals): New function.
8975 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8976 * intervals.c, textprop.c: Adjust users.
8977
8978 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8979
8980 Inline functions to examine and change string intervals.
8981 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8982 (string_get_intervals, string_set_intervals): New function.
8983 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8984 * lread.c, print.c, textprop.c: Adjust users.
8985
8986 2012-08-08 Glenn Morris <rgm@gnu.org>
8987
8988 * lisp.mk (lisp): Remove language/persian.elc.
8989
8990 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8991
8992 Cleanup intervals.
8993 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8994 (NULL_INTERVAL_P): Likewise. Adjust users.
8995 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8996 Adjust comment. Move under #if 0.
8997 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8998 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8999
9000 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9001
9002 Check total length of intervals with eassert.
9003 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
9004 * intervals.c: Change all users to eassert.
9005
9006 2012-08-07 Eli Zaretskii <eliz@gnu.org>
9007
9008 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
9009 Rename fields to match removal of FGET and WGET and disuse of
9010 INTERNAL_FIELD in Lisp_Cons.
9011
9012 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9013
9014 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
9015 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
9016 name since all xname users are fixed long time ago. Do not
9017 use INTERNAL_FIELD.
9018 (set_symbol_name, set_symbol_function, set_symbol_plist):
9019 (set_symbol_next, set_overlay_plist): New function.
9020 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
9021 (struct Lisp_Overlay): Likewise.
9022 (CVAR, MVAR, SVAR): Remove.
9023 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
9024 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
9025 * xterm.c: Adjust users.
9026 * .gdbinit: Change to use name field of struct Lisp_Symbol
9027 where appropriate.
9028
9029 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9030
9031 Basic functions to set Lisp_Object and pointer slots of intervals.
9032 * intervals.h (interval_set_parent, interval_set_object):
9033 (interval_set_left, interval_set_right, interval_set_plist):
9034 (interval_copy_parent): New function.
9035 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
9036 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9037 Adjust indentation.
9038 (INTERVAL_SIZE): Remove. Adjust users.
9039 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9040
9041 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9042
9043 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9044 * process.h (PGET): Remove.
9045 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9046 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9047
9048 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9049
9050 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9051 * window.h (WGET): Remove.
9052 (struct window): Do not use INTERNAL_FIELD.
9053 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9054 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9055 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9056 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9057 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9058 Adjust users.
9059
9060 2012-08-07 Chong Yidong <cyd@gnu.org>
9061
9062 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9063 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9064 (Fdelete_window_internal): Signal an error if the window is not on
9065 a live frame (Bug#12025).
9066
9067 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9068
9069 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9070 * frame.h (FGET): Remove.
9071 (struct frame): Do not use INTERNAL_FIELD.
9072 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9073 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9074 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9075 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9076
9077 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
9078
9079 * w32.c: Silence compiler warnings.
9080 (map_w32_filename): Remove unused variable `is_fat'.
9081 (chase_symlinks): Add parentheses around expression.
9082
9083 2012-08-06 Glenn Morris <rgm@gnu.org>
9084
9085 * sysdep.c: Respect BROKEN_GETWD.
9086
9087 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9088 Let configure handle it.
9089 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9090
9091 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9092
9093 Use GCALIGNMENT where appropriate.
9094 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9095 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9096 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9097
9098 2012-08-06 Eli Zaretskii <eliz@gnu.org>
9099
9100 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9101 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9102
9103 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9104
9105 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9106 that should be sufficient for everyone.
9107
9108 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9109
9110 * keyboard.c (timer_check_2): Add break so timer_check returns next
9111 timeout.
9112
9113 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9114
9115 Fix Windows build errors introduced after converting to WGET and WSET.
9116 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9117 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9118
9119 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9120
9121 * nsterm.m (ns_frame_rehighlight): Use FSET.
9122
9123 * nsmenu.m (ns_update_menubar): Use FSET.
9124
9125 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9126
9127 Separate read and write access to Lisp_Object slots of Lisp_Process.
9128 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9129 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9130
9131 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9132
9133 Separate read and write access to Lisp_Object slots of struct window.
9134 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9135 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9136 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9137 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9138 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9139 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9140 Adjust users.
9141
9142 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9143
9144 Fix Windows build errors introduced after converting to FGET and FSET.
9145 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9146 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9147 (w32_judge_scroll_bars): Change to use FSET.
9148 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9149
9150 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9151
9152 Fix replacement typo.
9153 * window.c (replace_window): Set root_window instead of
9154 selected_window. This fixes a total window subsystem
9155 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9156
9157 2012-08-06 Glenn Morris <rgm@gnu.org>
9158
9159 * lisp.mk (lisp): Add language/persian.elc.
9160
9161 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9162
9163 Separate read and write access to Lisp_Object slots of struct frame.
9164 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9165 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9166 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9167 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9168 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9169
9170 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9171
9172 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9173
9174 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9175
9176 Generalize common compile-time constants.
9177 * lisp.h (header_size, bool_header_size, word_size): Now here.
9178 (struct Lisp_Vector): Add comment.
9179 (struct Lisp_Bool_Vector): Move up to define handy constants.
9180 (VECSIZE, PSEUDOVECSIZE): Simplify.
9181 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9182 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9183 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9184 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9185 * xfont.c, xmenu.c: Use word_size where appropriate.
9186
9187 2012-08-05 Lawrence Mitchell <wence@gmx.li>
9188
9189 * search.c (Freplace_match): Treat \? in the replacement text
9190 literally (Bug#8161).
9191
9192 2012-08-05 Chong Yidong <cyd@gnu.org>
9193
9194 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9195 * frame.c (Vdelete_frame_functions):
9196 * emacs.c (Vkill_emacs_hook): Doc fix.
9197
9198 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9199
9200 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9201 --with-x-toolkit=no builds.
9202 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9203
9204 2012-08-04 Chong Yidong <cyd@gnu.org>
9205
9206 * syntax.c (Fmodify_syntax_entry): Doc fix.
9207
9208 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9209
9210 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9211 * w32.c (init_environment): Change the default values of many
9212 environment variables in dflt_envvars[] to NULL, to avoid pushing
9213 them into environment when they were not already defined.
9214 Remove the code that deletes site-lisp subdirectories from the default
9215 value of EMACSLOADPATH, as it is no longer needed.
9216 (check_windows_init_file): Now external, not static.
9217 Use Vload_path as is, without adding anything, as this function is now
9218 called when Vload_path is already set up.
9219
9220 * w32.h (check_windows_init_file): Add prototype.
9221
9222 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9223 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9224 compatibility with Posix platforms.
9225 (main): Move the call to check_windows_init_file to here from
9226 w32.c.
9227 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9228 any, in the DEFALT argument into the root of the Emacs build or
9229 installation tree, as appropriate.
9230
9231 * callproc.c (init_callproc_1): Call decode_env_path instead of
9232 doing its equivalent by hand.
9233 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9234 the code that sets Vexec_path run on MS-Windows.
9235
9236 * lread.c (init_lread): Add comments to #ifdef's.
9237
9238 * msdos.c (dos_set_window_size, IT_update_begin)
9239 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9240 instead of direct references.
9241
9242 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9243
9244 Export DEFAULT_REHASH_* to GDB.
9245 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9246 Now constants, not macros.
9247
9248 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9249
9250 Remove unnecessary casts involving pointers.
9251 These casts are no longer needed now that we assume C89 or later,
9252 since they involve casting to or from void *.
9253 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9254 (make_pure_float, make_pure_vector):
9255 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9256 * macros.c (Fstart_kbd_macro):
9257 * menu.c (find_and_return_menu_selection):
9258 * minibuf.c (read_minibuf_noninteractive):
9259 * sysdep.c (closedir):
9260 * xdisp.c (x_produce_glyphs):
9261 * xfaces.c (compare_fonts_by_sort_order):
9262 * xfns.c (x_real_positions, select_visual):
9263 * xselect.c (x_stop_queuing_selection_requests)
9264 (x_get_window_property, x_get_window_property_as_lisp_data):
9265 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9266 Remove unnecessary pointer casts.
9267 * alloc.c (record_xmalloc): New function.
9268 * lisp.h (record_xmalloc): New decl.
9269 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9270 more like a function. This is because the pointer cast is not
9271 needed. All uses changed.
9272 * print.c (print_string, print_error_message): Avoid length recalc.
9273
9274 Improve fix for macroexp crash with debugging (Bug#12118).
9275 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9276 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9277 not supposed to be invoked from the garbage collector.
9278 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9279 (gc_aset): New function, which is like ASET but can be
9280 used in the garbage collector.
9281 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9282 (set_hash_index): Use it instead of ASET.
9283
9284 2012-08-03 Eli Zaretskii <eliz@gnu.org>
9285
9286 Support symlinks on latest versions of MS-Windows.
9287 * w32.c: Include winioctl.h and aclapi.h.
9288 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9289 (revert_to_self): Forward declarations of static functions.
9290 <static BOOL g_b_init_get_security_info>:
9291 <g_b_init_create_symbolic_link>: New static flags.
9292 (globals_of_w32): Initialize them to zero.
9293 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9294 (map_w32_filename): Improve commentary. Simplify switch.
9295 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9296 headers (most versions of MinGW w32api don't).
9297 (get_security_info, create_symbolic_link)
9298 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9299 New functions.
9300 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9301 in the argument file name.
9302 (sys_access): Call unc_volume_file_attributes only if
9303 GetFileAttributes fails with network-related error codes.
9304 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9305 have the required privileges.
9306 (get_file_security_desc_by_name): Rename from
9307 get_file_security_desc.
9308 (stat_worker): New function, with most of the guts of 'stat', and
9309 with addition of handling of symlinks and support for 'lstat'.
9310 If possible, get file's attributes and security information by
9311 handle, not by name. Produce S_IFLNK bit for symlinks, when
9312 called from 'lstat'.
9313 (stat, lstat): New functions, call 'stat_worker'.
9314 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9315 symlinks when the underlying filesystem supports them.
9316
9317 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9318
9319 Fix macroexp crash on Windows with debugging (Bug#12118).
9320 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9321 checking subscripts; problem introduced with the recent
9322 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9323 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9324 since it's used in non-static inline functions now.
9325
9326 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9327 Don't assume buffer size fits in 'int'. Remove unused local.
9328
9329 Use C99-style 'extern inline' if available.
9330 * buffer.h (BUFFER_INLINE):
9331 * category.h (CATEGORY_INLINE):
9332 * character.h (CHARACTER_INLINE):
9333 * charset.h (CHARSET_INLINE):
9334 * composite.h (COMPOSITE_INLINE):
9335 * dispextern.h (DISPEXTERN_INLINE):
9336 * lisp.h (LISP_INLINE):
9337 * systime.h (SYSTIME_INLINE):
9338 New macro, replacing 'static inline' in this header.
9339 * buffer.h, category.h, character.h, charset.h, composite.h:
9340 * dispextern.h, lisp.h, systime.h:
9341 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9342 * alloc.c (LISP_INLINE):
9343 * buffer.c (BUFFER_INLINE):
9344 * category.c (CATEGORY_INLINE):
9345 * character.c (CHARACTER_INLINE):
9346 * charset.c (CHARSET_INLINE):
9347 * composite.c (COMPOSITE_INLINE):
9348 * dispnew.c (DISPEXTERN_INLINE):
9349 * sysdep.c (SYSTIME_INLINE):
9350 Define to EXTERN_INLINE, so that the corresponding functions
9351 are compiled into code.
9352 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9353 (INLINE_HEADER_END): New macros.
9354 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9355 since it's used in non-static inline functions now.
9356 (VALMASK) [!USE_LSB_TAG]: Likewise.
9357
9358 2012-08-02 Glenn Morris <rgm@gnu.org>
9359
9360 * s/: Remove empty directory.
9361
9362 * s/ms-w32.h: Move to ../nt/inc.
9363 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9364 Update for new ms-w32.h location.
9365
9366 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9367
9368 Port to Solaris 8.
9369 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9370
9371 2012-08-02 Glenn Morris <rgm@gnu.org>
9372
9373 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9374 hard-coding the path separator.
9375
9376 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9377
9378 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9379 This how ASET and AREF are supposed to work, and makes
9380 it easier to think about future improvements. See
9381 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9382 * charset.h (set_charset_attr): New function.
9383 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9384 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9385 (aref_addr): New function. All uses of &AREF(...) changed.
9386 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9387 (set_hash_index): New functions. All lvalue-style uses of
9388 HASH_KEY etc. changed.
9389 * keyboard.c (set_prop): New function. All lvalue-style uses
9390 of PROP changed.
9391
9392 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9393
9394 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9395 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9396 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9397 * nsfns.m (ns_set_name_as_filename): Likewise.
9398 * nsmenu.m (ns_update_menubar): Likewise.
9399 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9400
9401 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9402
9403 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9404 Adapt to latest changes in field names of the corresponding Lisp
9405 objects.
9406
9407 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9408
9409 2012-08-01 Glenn Morris <rgm@gnu.org>
9410
9411 * s/msdos.h: Remove file.
9412 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9413 * Makefile.in (S_FILE): Remove.
9414 (config_h): Remove S_FILE.
9415
9416 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9417
9418 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9419 Remove; moved to nt/config.nt.
9420
9421 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9422
9423 Use INTERNAL_FIELD for conses and overlays.
9424 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9425 Remove obsolete comment.
9426 (MVAR): New macro.
9427 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9428 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9429
9430 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9431
9432 Use INTERNAL_FIELD for symbols.
9433 * lisp.h (SVAR): New macro. Adjust users.
9434 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9435 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9436
9437 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9438
9439 Use INTERNAL_FIELD for processes.
9440 * process.h (PVAR): New macro. Adjust style.
9441 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9442 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9443
9444 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9445
9446 Use INTERNAL_FIELD for windows.
9447 * window.h (WVAR): New macro.
9448 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9449 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9450 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9451 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9452 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9453 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9454
9455 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9456
9457 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9458
9459 2012-08-01 Glenn Morris <rgm@gnu.org>
9460
9461 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9462 Move to configure.ac.
9463
9464 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9465
9466 * makefile.w32-in (CONFIG_H): Update dependencies.
9467 (CONF_POST_H): New macro.
9468
9469 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9470
9471 2012-07-31 Glenn Morris <rgm@gnu.org>
9472
9473 * Makefile.in (S_FILE): No longer set by configure.
9474
9475 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9476 is available.
9477 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9478
9479 * process.h (NULL_DEVICE):
9480 * emacs.c (SEPCHAR):
9481 * editfns.c (USER_FULL_NAME): Let configure set them.
9482
9483 * s/README, s/template.h: Remove files.
9484
9485 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9486
9487 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9488 Move to configure.ac.
9489
9490 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9491
9492 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9493 resulting renaming of 'struct frame' members.
9494
9495 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9496
9497 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9498 after introduction of FVAR.
9499
9500 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9501
9502 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9503
9504 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9505 instead of compositeToPoint.
9506 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9507
9508 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9509
9510 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9511
9512 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9513 * lisp.h (INTERNAL_FIELD): New macro.
9514 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9515 (BVAR): Change to use INTERNAL_FIELD.
9516 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9517 (KVAR): Change to use INTERNAL_FIELD.
9518 * frame.h (FVAR): New macro.
9519 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9520 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9521 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9522 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9523 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9524
9525 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9526
9527 Miscellaneous fixes for non-default X toolkits.
9528 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9529 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9530 Move under #ifdef USE_LUCID.
9531 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9532 definition and usage to avoid warnings.
9533
9534 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9535
9536 * nsterm.m (openFiles): Fix previous checkin.
9537
9538 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9539
9540 * indent.c (compute_motion): Remove unused local.
9541
9542 2012-07-31 Glenn Morris <rgm@gnu.org>
9543
9544 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9545
9546 * conf_post.h [USG5_4]:
9547 Move remaining contents of s/usg5-4-common.h here.
9548 * s/usg5-4-common.h: Remove file.
9549
9550 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9551 * s/irix6-5.h: Remove file.
9552
9553 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9554 * s/darwin.h: Remove file.
9555
9556 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9557 * s/hpux10-20.h: Remove file, which is now empty.
9558
9559 2012-07-30 Glenn Morris <rgm@gnu.org>
9560
9561 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9562 * Makefile.in (config_h): Add conf_post.h.
9563 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9564
9565 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9566
9567 * nsterm.m (ns_do_open_file): New variable.
9568 (ns_term_init): Set ns_do_open_file to YES after run returns.
9569 (openFile, openTempFile, openFileWithoutUI, openFiles):
9570 Open files only if ns_do_open_file.
9571
9572 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9573
9574 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9575 This no-op macro hasn't been needed for many years.
9576 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9577
9578 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9579 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9580 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9581 gdb_make_enums_visible.
9582 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9583 (DIRECTORY_SEP): Now a constant, not a macro.
9584
9585 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9586
9587 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9588 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9589
9590 * w32term.c <w32_keyboard_codepage>: Renamed from
9591 keyboard_codepage and now external. All users changed.
9592
9593 * w32term.h: Add declaration of w32_keyboard_codepage.
9594
9595 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9596 the codepage to translate keys to Unicode. If this argument is
9597 -1, use the value returned by GetConsoleCP. All callers changed.
9598
9599 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9600
9601 Update .PHONY listings in makefiles.
9602 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9603 bootstrap-clean, distclean, maintainer-clean, versioclean,
9604 extraclean, frc.
9605
9606 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9607 This is a bit clearer. Fix some commentary typos.
9608
9609 2012-07-30 Glenn Morris <rgm@gnu.org>
9610
9611 * s/netbsd.h: Let configure include signal.h if needed.
9612 Remove file, which is now empty.
9613
9614 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9615 Let configure set them.
9616 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9617 No more need to undefine.
9618
9619 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9620
9621 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9622 non-single-byte char when adding meta modifier. (Bug#12090)
9623
9624 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9625
9626 Convert safe_call to use variable number of arguments.
9627 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9628 (safe_call2): Fix comment.
9629 * lisp.h (safe_call): Adjust prototype.
9630 * coding.c (encode_coding_object): Change to use safe_call2.
9631 * xfaces.c (merge_face_heights): Change to use safe_call1.
9632
9633 2012-07-30 Glenn Morris <rgm@gnu.org>
9634
9635 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
9636 does that unconditionally. Remove file, which is now empty.
9637
9638 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9639 Remove empty files.
9640
9641 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9642
9643 Export to GDB most of lisp.h's remaining object-like macros.
9644 * lisp.h (min, max): Move earlier, because they're used earlier now.
9645 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9646 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9647 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9648 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9649 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9650 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9651 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9652 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9653 Now constants, for GDB. They need not be macros.
9654 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9655 Now constants, for GDB, as well as macros, for static initializers.
9656 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9657 Move to after the definition of struct Lisp_Char_Table,
9658 since the former now needs that type defined.
9659 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9660 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9661 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9662 New enums, for gdb_make_enums_visible.
9663 (GLYPH_MODE_LINE_FACE): Remove; unused.
9664 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
9665 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9666 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9667 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9668 enum maxargs, enum MAX_ALLOCA.
9669 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9670 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9671 no longer needed, now that they are done in lisp.h.
9672
9673 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9674
9675 Cleanup string bytes checking.
9676 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9677 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9678 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9679 (check_sblock, compact_small_strings): Simplify.
9680
9681 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9682
9683 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9684 These macros are confusing and no longer need to be defined, as
9685 the enum values now suffice. All uses replaced with definiens.
9686 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9687
9688 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
9689
9690 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9691 ($(BLD)/w32console.$(O)): Update dependencies.
9692
9693 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9694
9695 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9696 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9697 time. Adjust users.
9698 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9699
9700 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9701
9702 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9703 setting sitelisp (Bug#12010).
9704
9705 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9706
9707 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
9708
9709 * w32heap.c (cache_system_info):
9710 * w32.c (sys_rename):
9711 * w32proc.c (find_child_console, sys_kill): All users changed.
9712
9713 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9714
9715 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9716
9717 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9718
9719 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9720
9721 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9722
9723 Cleanup statistics calculation in Fgarbage_collect.
9724 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9725 Fix zombies percentage calculation. Simplify elapsed time calculation.
9726
9727 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9728
9729 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9730 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9731 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9732 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9733 (replace_range, replace_range_2, del_range_2): Change to eassert.
9734 * marker.c (byte_char_debug_check): Adjust style.
9735
9736 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9737
9738 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9739 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9740 long-ago-commented-out code that talks about "WIN32".
9741 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9742 All uses changed.
9743
9744 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9745
9746 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9747 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9748 Simplify by using alignof.
9749 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9750 * lisp.h: Include <stdalign.h>.
9751 (GCALIGNMENT): New macro and constant.
9752 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9753 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9754 (stdalign): New macro, if not already defined.
9755
9756 2012-07-28 Eli Zaretskii <eliz@gnu.org>
9757
9758 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9759 * w32inevt.c: Include w32inevt.h.
9760 (w32_read_console_input): New inline function, calls either
9761 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9762 w32_console_unicode_input.
9763 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9764 (w32_kbd_patch_key, key_event): Use the codepage returned by
9765 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9766 (key_event): use uChar.UnicodeChar only if
9767 w32_console_unicode_input is non-zero.
9768
9769 * w32console.c: Include w32heap.h.
9770 <w32_console_unicode_input>: New global variable.
9771 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9772 family of Windows, zero otherwise.
9773
9774 * w32inevt.h: Declare w32_console_unicode_input.
9775
9776 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9777 --without-x. (Bug#11742)
9778
9779 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9780
9781 Adjust GDB to reflect pvec_type changes (Bug#12036).
9782 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
9783 2012-07-04 changes to pseudovector representation.
9784 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
9785
9786 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
9787
9788 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9789 bus address.
9790 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9791
9792 2012-07-27 Eli Zaretskii <eliz@gnu.org>
9793
9794 * alloc.c (listn): Fix the order the arguments are consed onto the
9795 list.
9796
9797 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9798 enumeration constants, as PURE and HEAP are too general, and clash
9799 with other headers and sources, such as gmalloc.c and the
9800 MS-Windows system headers. All users changed.
9801
9802 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9803
9804 Revert last save_excursion_save and save_excursion_restore changes.
9805 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9806 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9807
9808 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9809
9810 Fix recently-introduced typos in Windows port.
9811 Reported by Martin Rudalics <rudalics@gmx.at>.
9812 * w32.c (init_environment): Replace comma with semicolon.
9813 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
9814
9815 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9816
9817 Improve GDB symbol export (Bug#12036).
9818 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9819 arms of an 'if', not using conditional expressions; otherwise GDB
9820 complains about the types in the unevaluated arm when the argument
9821 is an integer literal.
9822 (xgetint): Simplify expression.
9823 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9824 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9825 Zaretskii in <http://bugs.gnu.org/12036#13>.
9826 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9827 needed now that we have gdb_make_enums_visible.
9828 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9829 (enum enum_USE_LSB_TAG):
9830 New enum types, packaging up enums that need to be exported to GDB.
9831
9832 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9833
9834 Utility function to make a list from specified amount of objects.
9835 * lisp.h (enum constype): New datatype.
9836 (listn): New prototype.
9837 * alloc.c (listn): New function.
9838 (Fmemory_use_count, syms_of_alloc): Use it.
9839 * buffer.c (syms_of_buffer): Likewise.
9840 * callint.c (syms_of_callint): Likewise.
9841 * charset.c (define_charset_internal): Likewise.
9842 * coding.c (syms_of_coding): Likewise.
9843 * keymap.c (syms_of_keymap): Likewise.
9844 * search.c (syms_of_search): Likewise.
9845 * syntax.c (syms_of_syntax): Likewise.
9846 * w32.c (init_environment): Likewise.
9847 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9848 * xdisp.c (syms_of_xdisp): Likewise.
9849 * xfns.c (syms_of_xfns): Likewise.
9850
9851 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9852
9853 Fast save_excursion_save and save_excursion_restore.
9854 * lisp.h (struct Lisp_Excursion): New data type.
9855 (PVEC_EXCURSION): New pseudovector type.
9856 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9857 to deal with it. Adjust comments.
9858 (init_marker, attach_marker): New prototype.
9859 (unchain_marker): Adjust prototype.
9860 * marker.c (attach_marker): Change to global.
9861 (init_marker): New function.
9862 * alloc.c (Fmake_marker, build_marker): Use it.
9863 (build_marker): More easserts.
9864 (mark_object): Handle struct Lisp_Excursion.
9865 * editfns.c (save_excursion_save, save_excursion_restore):
9866 Reimplement to use struct Lisp_Excursion. Add comments.
9867
9868 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9869
9870 Fix export of symbols to GDB (Bug#12036).
9871 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9872 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9873 emacs.c, as this is a more-suitable home. Had this been done earlier
9874 the fix for 12036 would have avoided some of the problems noted in
9875 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9876 would have been more obvious.
9877 * emacs.c: Do not include <verify.h>; no longer needed.
9878 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
9879 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9880 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9881 Remove; now done in lisp.h.
9882 * lisp.h (PUBLISH_TO_GDB): New macro.
9883 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9884 (DATA_SEG_BITS): Use it.
9885 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9886 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9887 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9888 not be usable in #if. This simplifies things.
9889
9890 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
9891
9892 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9893
9894 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9895
9896 Simplify export of symbols to GDB (Bug#12036).
9897 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9898 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9899 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9900 Adjust to changes in lisp.h and emacs.c, by using
9901 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9902 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9903 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9904 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9905 instead of gdb_valbits.
9906 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9907 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9908 instead of gdb_array_mark_flag.
9909 (xboolvector): Get size from $->size, not $->header.size.
9910 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9911 (xreload, hook-run, hookpost-run): Remove.
9912 * emacs.c: Include <verify.h>.
9913 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9914 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9915 Remove.
9916 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9917 (gdb_USE_LSB_TAG): New enum constants.
9918 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9919 Also define these as enum constants, so they're visible to GDB.
9920 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9921 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9922 as constants, so they're visible to GDB.
9923 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9924 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9925 Now enum constants, not macros, so they're visible to GDB.
9926 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9927 more convenient now. All uses changed.
9928 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9929 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9930
9931 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9932
9933 Explicitly free restriction data that are not needed anymore.
9934 * editfns.c (save_restriction_restore): Free restriction data.
9935
9936 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9937
9938 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9939 add argument, tune behavior, and adjust all callers.
9940
9941 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9942
9943 Use typedef for EMACS_INT, EMACS_UINT.
9944 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9945 than macros. This simplifies debugging in the usual case, since
9946 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9947 and it allows expressions involving EMACS_INT casts.
9948 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9949
9950 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9951
9952 * nsterm.m (ns_read_socket): Return early if there is a modal
9953 window (Bug#12043).
9954
9955 2012-07-25 Martin Rudalics <rudalics@gmx.at>
9956
9957 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9958 that FOCUS-FRAME can be omitted.
9959
9960 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9961
9962 Adjust buffer text indirection counters at the end of Fkill_buffer.
9963 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9964 buffer is definitely dead. This should really fix an issue reported
9965 by Christoph Scholtes again. (Bug#12007).
9966 (init_buffer_once): Initialize indirection counters of
9967 buffer_defaults and buffer_local_symbols (for sanity and safety).
9968
9969 2012-07-24 Eli Zaretskii <eliz@gnu.org>
9970
9971 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9972 and continuation glyphs on tooltip frames, leave them at zero.
9973 Avoids continued lines in tooltips. (Bug#11832)
9974
9975 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9976
9977 Simplify copy_overlay.
9978 * buffer.c (copy_overlay): Simplify. Use build_marker.
9979 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9980
9981 2012-07-23 Eli Zaretskii <eliz@gnu.org>
9982
9983 * print.c (print_object): Don't crash when a frame's name is nil
9984 or invalid. (Bug#12025)
9985
9986 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9987 it signals an error when a tooltip frame is being created.
9988
9989 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9990
9991 Cleanup miscellaneous objects allocation and initialization.
9992 * alloc.c (allocate_misc): Change to static. Add argument to
9993 specify the subtype. Adjust comment and users.
9994 (build_overlay): New function.
9995 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9996 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9997 (allocate_misc): Remove prototype.
9998 (build_overlay): Add prototype.
9999
10000 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10001
10002 Swap buffer text indirection counters in Fbuffer_swap_text.
10003 * buffer.c (Fbuffer_swap_text): Swap indirections too.
10004 This avoids crash reported by Christoph Scholtes at
10005 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
10006
10007 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
10008
10009 * nsmenu.m (Popdown_data): New struct.
10010 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
10011 free Popdown_data.
10012 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
10013 (initWithContentRect): Make imgView and contentView non-static
10014 and autorelease them. Also autorelease img and matrix (Bug#12005).
10015 (dealloc): Remove (Bug#12005).
10016
10017 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10018
10019 Adjust consing_since_gc when objects are explicitly freed.
10020 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
10021 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
10022 (free_cons, free_misc): Subtract object size from consing_since_gc.
10023
10024 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10025
10026 Simplify and cleanup markers positioning code.
10027 * marker.c (attach_marker): More useful eassert.
10028 (live_buffer, set_marker_internal): New function.
10029 (Fset_marker, set_marker_restricted): Use set_marker_internal.
10030 (set_marker_both, set_marker_restricted_both): Use live_buffer.
10031
10032 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
10033
10034 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
10035 as it's limited by the amount of memory, not by INT_MAX.
10036
10037 2012-07-21 Eli Zaretskii <eliz@gnu.org>
10038
10039 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10040 in special-event-map. See the discussion at
10041 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10042 for the reasons.
10043
10044 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
10045 info.dwItemData. Fixes crashes on 64-bit Windows.
10046 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
10047
10048 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10049
10050 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
10051 (conversationIdentifier): Return value is NSInteger.
10052 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
10053
10054 2012-07-21 Chong Yidong <cyd@gnu.org>
10055
10056 * window.c (decode_any_window): Signal an error if the window is
10057 on a dead frame (Bug#11984).
10058
10059 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10060
10061 Add indirection counting to speed up Fkill_buffer.
10062 * buffer.h (struct buffer): New member.
10063 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10064 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10065 base buffer indirection counter.
10066 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10067 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10068 through buffer list if indirection counter is 0.
10069
10070 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10071
10072 Extend the value returned by Fgarbage_collect with heap statistics.
10073 * alloc.c (Qheap): New symbol.
10074 (syms_of_alloc): DEFSYM it.
10075 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10076 (Fmemory_free): Remove.
10077 (syms_of_alloc): Don't defsubr it.
10078 * buffer.c (Fcompact_buffer): Remove.
10079 (syms_of_buffer): Don't defsubr it.
10080
10081 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10082
10083 Make maybe_gc inline.
10084 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10085 * lisp.h (consing_since_gc, gc_relative_threshold)
10086 (memory_full_cons_threshold): Revert declaration.
10087 (maybe_gc): Remove prototype, define as inline.
10088 * alloc.c: Remove old commented-out code.
10089 (consing_since_gc, gc_relative_threshold)
10090 (memory_full_cons_threshold): Revert to global.
10091 (maybe_gc): Remove.
10092
10093 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10094
10095 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10096 * lisp.h (build_unibyte_string): New function.
10097 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10098 * sysdep.c, w32fns.c, xfns.c: Use it.
10099 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10100 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10101 Adjust users accordingly.
10102 * font.h (font_open_by_name): Adjust prototype.
10103
10104 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10105
10106 Cleanup calls to Fgarbage_collect.
10107 * lisp.h (maybe_gc): New prototype.
10108 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10109 Remove declarations.
10110 * alloc.c (maybe_gc): New function.
10111 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10112 Make them static.
10113 * bytecode.c (MAYBE_GC): Use maybe_gc.
10114 * eval.c (eval_sub, Ffuncall): Likewise.
10115 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10116 to avoid dependency from auto-save feature.
10117
10118 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10119
10120 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10121 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10122 'for_each_per_buffer_object_at'.
10123 All uses changed. It's better to use upper-case for macros that
10124 cannot be implemented as functions, to give the reader a clue
10125 that they're special.
10126
10127 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10128
10129 * alloc.c (Fgarbage_collect): Tweak docstring.
10130
10131 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10132
10133 Tweak the value returned from Fgarbage_collect again.
10134 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10135 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10136 Adjust documentation.
10137 (total_vector_bytes): Rename to total_vector_slots, adjust
10138 accounting.
10139 (total_free_vector_bytes): Rename to total_free_vector_slots,
10140 adjust accounting.
10141 (Qstring_bytes, Qvector_slots): New symbols.
10142 (syms_of_alloc): DEFSYM them.
10143
10144 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10145
10146 Buffer compaction primitive which may be used from Lisp.
10147 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10148 (syms_of_buffer): Register Fcompact_buffer.
10149 * alloc.c (Fgarbage_collect): Use compact_buffer.
10150 * buffer.h (compact_buffer): New prototype.
10151 (struct buffer_text): New member.
10152
10153 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10154
10155 New macro to iterate over all buffers, miscellaneous cleanups.
10156 * lisp.h (all_buffers): Remove declaration.
10157 * buffer.h (all_buffers): Add declaration, with comment.
10158 (for_each_buffer): New macro.
10159 * alloc.c (Fgarbage_collect, mark_object): Use it.
10160 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10161 (init_buffer): Likewise.
10162 * data.c (Fset_default): Likewise.
10163 * coding.c (code_conversion_restore): Remove redundant check
10164 for dead buffer.
10165 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10166
10167 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10168
10169 Fix bug that created negative-length intervals.
10170 * intervals.c (merge_interval_right, merge_interval_left):
10171 Do not zero out this interval if it is absorbed by its children,
10172 as this interval's total length doesn't change in that case. See
10173 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10174
10175 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10176
10177 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10178 when invoking (make-bool-vector N t) and N is a positive
10179 multiple of 8 -- the last 8 bits were mistakenly cleared.
10180
10181 Remove some struct layout assumptions in bool vectors.
10182 * alloc.c (bool_header_size): New constant.
10183 (header_size, word_size): Move earlier, as they're now used earlier.
10184 Use 'word_size' in a few more places, where it's appropriate.
10185 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10186 padding before the data member of a bool vector.
10187 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10188 than doing the check by hand with an abort ().
10189
10190 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10191
10192 * eval.c (Fdefvar): Don't check constants since we only set the var if
10193 it's not yet defined anyway (bug#11904).
10194
10195 * lisp.h (last_undo_boundary): Declare new var.
10196 * keyboard.c (command_loop_1): Set it.
10197 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10198 were auto-added by the command loop (bug#11774).
10199
10200 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10201
10202 * w32font.c (Qsymbol): Remove local definition.
10203 (syms_of_w32font): Don't DEFSYM it.
10204
10205 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10206
10207 Fix sweep_vectors to handle large bool vectors correctly.
10208 * alloc.c (sweep_vectors): Account total_vector_bytes for
10209 bool vectors larger than VBLOCK_BYTES_MAX.
10210
10211 2012-07-18 Chong Yidong <cyd@gnu.org>
10212
10213 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10214 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10215
10216 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10217
10218 Return more descriptive data from Fgarbage_collect.
10219 Suggested by Stefan Monnier in
10220 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10221 * alloc.c (bounded_number): New function.
10222 (total_buffers, total_vectors): New variable.
10223 (total_string_size): Rename to total_string_bytes, adjust users.
10224 (total_vector_size): Rename to total_vector_bytes, adjust users.
10225 (sweep_vectors): Account total_vectors and total_vector_bytes.
10226 (Fgarbage_collect): New return value. Adjust documentation.
10227 (gc_sweep): Account total_buffers.
10228 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10229 (VECTOR_SIZE): Remove.
10230 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10231 (Qinterval, Qmisc): New symbols.
10232 (syms_of_data): Initialize them.
10233 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10234 (Qcons, Qbuffer): New declarations.
10235
10236 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10237
10238 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10239 Round up, not down. Improve doc.
10240
10241 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10242
10243 Restore old code in allocate_string_data to avoid Faset breakage.
10244 Reported by Julien Danjou <julien@danjou.info> in
10245 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10246 * alloc.c (allocate_string_data): Restore old code with minor
10247 adjustments, fix comment to explain this subtle issue.
10248
10249 2012-07-17 Eli Zaretskii <eliz@gnu.org>
10250
10251 Remove FILE_SYSTEM_CASE.
10252 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10253
10254 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10255 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10256 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10257 call-process-region passes it through expand-file-name.
10258
10259 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10260
10261 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10262
10263 Fix crash when creating indirect buffer (Bug#11917)
10264 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10265 Don't handle unbound variables specially if non-zero.
10266 (Fbuffer_local_variables): Pass zero.
10267 (clone_per_buffer_values): Pass non-zero.
10268
10269 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10270
10271 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10272 to make the loop interruptible.
10273
10274 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10275
10276 * gnutls.c (emacs_gnutls_handshake): Only retry if
10277 GNUTLS_E_INTERRUPTED.
10278
10279 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10280
10281 Cleanup and convert miscellaneous checks to eassert.
10282 * alloc.c (mark_interval): Fix comment, partially rephrase
10283 old comment from intervals.h (see below).
10284 * intervals.c (find_interval, adjust_intervals_for_insertion)
10285 (delete_interval, adjust_intervals_for_deletion)
10286 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10287 Convert to eassert.
10288 (adjust_intervals_for_insertion, make_new_interval):
10289 Remove obsolete and unused code.
10290 * intervals.h (struct interval): Remove obsolete comment.
10291 * textprotp.c (erase_properties): Remove unused code.
10292 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10293 (Fremove_list_of_text_properties): Convert to eassert.
10294
10295 2012-07-17 Chong Yidong <cyd@gnu.org>
10296
10297 * editfns.c (Finsert_char): Doc fix.
10298
10299 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10300
10301 Fix previous change to make Fmemory_free always accurate.
10302 * alloc.c (make_interval): Update total_free_intervals.
10303 (make_float): Likewise for total_free_floats.
10304 (free_cons, Fcons): Likewise for total_free_conses.
10305 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10306 Likewise for total_free_vector_bytes.
10307 (Fmake_symbol): Likewise for total_free_symbols.
10308 (bytes_free): Remove.
10309
10310 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10311
10312 Simple free memory accounting feature.
10313 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10314 (sweep_vectors): Accumulate size of free vectors.
10315 (Fgarbage_collect): Setup bytes_free.
10316 (Fmemory_free): New function.
10317 (syms_of_alloc): Register it.
10318
10319 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10320
10321 Cleanup overlays checking.
10322 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10323 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10324 eassert and OVERLAYP.
10325 (sort_overlays): Change to use OVERLAYP.
10326
10327 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10328
10329 * editfns.c (Finsert_char): Make it interactive, and make the
10330 second arg optional. Copy interactive spec and docstring from
10331 ucs-insert.
10332
10333 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10334
10335 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10336 Unlike the other wrapped functions, fabs has an unspecified
10337 effect on errno.
10338
10339 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10340
10341 * nsterm.m (keyDown): Interpret flags without left/right bits
10342 as the left key (Bug#11670).
10343
10344 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10345
10346 Remove empty and useless init functions.
10347 * lisp.h (init_character_once, init_fns, init_image)
10348 (init_filelock, init_sound): Remove prototype.
10349 * character.c (init_character_once): Remove.
10350 * filelock.c (init_filelock): Likewise.
10351 * fns.c (init_fns): Likewise.
10352 * image.c (init_image): Likewise.
10353 * sound.c (init_sound): Likewise.
10354 * emacs.c (main): Adjust accordingly.
10355
10356 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10357
10358 * gtkutil.h: Tiny cleanups.
10359 (use_old_gtk_file_dialog): Remove useless declaration.
10360 (xg_uses_old_file_dialog): Add suggested const attribute.
10361
10362 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10363
10364 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10365 (bidi_paragraph_init): Use it to limit search forward for a strong
10366 directional character in abnormally large paragraphs full of
10367 neutral or weak characters. (Bug#11943)
10368
10369 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10370
10371 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10372 the toolbar (Bug#9451).
10373 (xg_make_tool_item): Give the widget event box a transparent
10374 background.
10375
10376 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10377
10378 Cleanup basic allocation variables and functions.
10379 * alloc.c (ignore_warnings, init_intervals, init_float)
10380 (init_cons, init_symbol, init_marker): Remove.
10381 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10382 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10383 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10384 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10385 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10386 (staticidx, init_alloc_once, init_strings, free_ablock):
10387 Remove redundant initialization.
10388 * fns.c (init_weak_hash_tables): Remove.
10389 * lisp.h (init_weak_hash_tables): Remove prototype.
10390
10391 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10392
10393 Use zero_vector where appropriate.
10394 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10395 accordingly.
10396 * lisp.h (zero_vector): New declaration.
10397 * font.c (null_vector): Remove.
10398 (syms_of_font): Remove initialization and staticpro.
10399 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10400 * keymap.c (Faccessible_keymaps): Likewise.
10401
10402 2012-07-15 Leo Liu <sdl.web@gmail.com>
10403
10404 * fringe.c: Fix typo in comments.
10405
10406 2012-07-14 Leo Liu <sdl.web@gmail.com>
10407
10408 * fringe.c: Add a new bitmap exclamation-mark.
10409
10410 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10411
10412 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10413
10414 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10415 (HAVE_MENUS): Don't define, defined by editing config.in with
10416 msdos/sed2v2.inp.
10417 (GMALLOC_INHIBIT_VALLOC): Don't define.
10418 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10419
10420 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10421
10422 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10423
10424 2012-07-14 Glenn Morris <rgm@gnu.org>
10425
10426 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10427 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10428 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10429
10430 2012-07-13 Glenn Morris <rgm@gnu.org>
10431
10432 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10433
10434 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10435 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10436
10437 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10438
10439 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10440 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10441 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10442 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10443 where appropriate.
10444 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10445 as boolean expression.
10446 (x_set_window_size): Remove unused variable toolbar.
10447 (ns_get_color_default, ns_mod_to_lisp): Remove.
10448 (ns_mouse_position): Remove unused variables xchar and ychar.
10449 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10450 (ns_set_vertical_scroll_bar): Remove unused variable count.
10451 (ns_delete_terminal): Remove unused variable i.
10452 (ns_term_init): Remove unused variables r, g and b.
10453 (mouseDown): Remove unused variable window.
10454 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10455 (initFrameFromEmacs): Remove unused variable vbextra.
10456 (mouseEntered): Remove unused variables p and dpyinfo.
10457 (mouseExited): Remove unused variables p and r.
10458 (ns_define_frame_cursor, ns_clear_frame_area)
10459 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10460 (menuDown): Assign [sender tag] to variable and cast the variable.
10461
10462 * nsterm.h (menuDown): Add id as type to argument sender.
10463 (ns_display_info_for_name): Add Lisp_Object argument.
10464 (ns_term_init): Add Lisp_Object argument.
10465 (ns_map_event_to_object): Add void argument.
10466 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10467 prototype with arguments and only declare if __OBJC__.
10468 (nxatoms_of_nsselect): Add void argument.
10469 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10470 (ns_alloc_autorelease_pool): Add void argument.
10471 (ns_release_autorelease_pool): Add void* argument.
10472 (ns_get_defaults_value): Add const char* argument.
10473
10474 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10475 (initFromContents): Use SSDATA where appropriate.
10476 (ns_update_menubar): Add braces to ambigous if-else.
10477 (initWithTitle): Put () around assignment in if statement.
10478 (ns_menu_show): Remove unused variables window and keymap.
10479 (update_frame_tool_bar): Remove unused variable selected_p.
10480 (initWithContentRect): Remove unused variable this_cmd_name.
10481
10482 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10483 appropriate.
10484 (setXBMColor): Remove unused variable len.
10485 (setPixmapData): Put () around assignment in loop statement.
10486
10487 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10488 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10489 where appropriate.
10490 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10491 around assignment in loop statement.
10492 (nsfont_open): Remove unused variable i.
10493 (nsfont_open): Remove unused variable len.
10494 (nsfont_draw): Remove unused variable cs.
10495
10496 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10497 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10498 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10499 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10500 (Fns_font_name, Fns_perform_service)
10501 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10502 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10503 (ns_set_name): Remove unused variable view.
10504 (x_set_menu_bar_lines): Remove unused variable olines.
10505 (x_set_tool_bar_lines): Remove unused variable root_window.
10506 (Fns_list_colors): Put () around assignment in while statement.
10507 (Fns_perform_service): Remove unused variable len.
10508 (Fns_display_usable_bounds): Remove unused variable top.
10509 (syms_of_nsfns): Remove unused variable i.
10510
10511 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10512 memcpy (Bug#11907).
10513
10514 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10515
10516 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10517 and free it with DestroyExceptionInfo (Bug#11558).
10518
10519 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10520
10521 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10522 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10523 Set here, not in nt/config.nt.
10524
10525 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10526
10527 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10528 cursor overflow into the last glyph on display line when the right
10529 fringe is off. (Bug#11832)
10530
10531 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10532
10533 * xdisp.c (produce_special_glyphs): Now static.
10534 * dispextern.h (produce_special_glyphs): Remove decl.
10535
10536 2012-07-13 Glenn Morris <rgm@gnu.org>
10537
10538 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10539 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10540
10541 * s/usg5-4-common.h (USG, USG5):
10542 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10543 * s/sol2-6.h (SOLARIS2):
10544 * s/irix6-5.h (IRIX6_5):
10545 * s/hpux10-20.h (USG, USG5, HPUX):
10546 * s/gnu-linux.h (USG, GNU_LINUX):
10547 * s/freebsd.h (BSD_SYSTEM):
10548 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10549 * s/cygwin.h (CYGWIN):
10550 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10551 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10552
10553 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10554
10555 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10556
10557 2012-07-13 Glenn Morris <rgm@gnu.org>
10558
10559 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10560
10561 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10562
10563 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10564 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10565
10566 2012-07-12 Glenn Morris <rgm@gnu.org>
10567
10568 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10569
10570 * process.c (init_process_emacs): Rename from init_process.
10571 The old name is also the name of a Mach system call.
10572 * lisp.h, emacs.c: Update for this name change.
10573 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10574 longer needed.
10575
10576 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10577
10578 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10579 memmove call that removes glyphs covered by the left truncation
10580 glyph. Improve commentary.
10581 (display_line): Fix display of continuation glyphs on GUI frames
10582 when the right fringe is turned off and variable-size fonts are
10583 used in the window. Move the code that appends a stretch glyph to
10584 produce_special_glyphs, so that it could be used for truncation
10585 and continuation glyphs alike.
10586 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10587 glyph of a suitably computed width, to align the special glyphs at
10588 the window margin. Code moved from display_line. (Bug#11832)
10589
10590 2012-07-12 Glenn Morris <rgm@gnu.org>
10591
10592 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10593
10594 * s/gnu-linux.h, s/hpux10-20.h:
10595 Do not unconditionally define HAVE_XRMSETDATABASE.
10596
10597 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10598
10599 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10600
10601 Fix typos that broke OS X build.
10602 Reported by Randal L. Schwartz in
10603 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10604 * nsterm.m (ns_timeout): Add missing local decl.
10605 (ns_get_color): snprintf -> sprintf, to fix typo.
10606
10607 2012-07-12 Glenn Morris <rgm@gnu.org>
10608
10609 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10610 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10611 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10612 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10613
10614 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10615 Move PTY_OPEN to configure.
10616
10617 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10618 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10619 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10620
10621 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10622
10623 Use empty_unibyte_string where applicable.
10624 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10625 * lread.c (read1): Likewise.
10626 * xsettings.c (syms_of_xsettings): Likewise.
10627
10628 2012-07-12 Glenn Morris <rgm@gnu.org>
10629
10630 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10631 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
10632 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10633 * s/hpux10-20.h (RUN_TIME_REMAP):
10634 * s/bsd-common.h (TABDLY): Move to configure.
10635
10636 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10637
10638 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10639
10640 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10641 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
10642
10643 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
10644
10645 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10646 * s/template.h: Move NARROWPROTO to configure.
10647
10648 2012-07-11 Glenn Morris <rgm@gnu.org>
10649
10650 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10651 unused since 2011-01-17 change to systty.h.
10652
10653 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10654 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10655 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10656
10657 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10658
10659 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10660
10661 2012-07-11 Glenn Morris <rgm@gnu.org>
10662
10663 * s/darwin.h, s/gnu-linux.h, s/template.h:
10664 Move INTERRUPT_INPUT to configure.
10665
10666 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10667
10668 Minor adjustments to interning code.
10669 * lisp.h (intern, intern_c_string): Redefine as static inline
10670 wrappers for intern_1 and intern_c_string_1, respectively.
10671 (intern_1, intern_c_string_1): Rename prototypes.
10672 * lread.c (intern_1, intern_c_string_1, oblookup):
10673 Simplify Vobarray checking.
10674 * font.c (font_intern_prop): Likewise. Adjust comment.
10675 * w32font.c (intern_font_name): Likewise.
10676
10677 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10678
10679 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10680
10681 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10682 of Fcar/Fcdr if possible.
10683 * font.c (check_otf_features): Likewise.
10684 * fontset.c (Fnew_fontset): Likewise.
10685 * gnutls.c (Fgnutls_boot): Likewise.
10686 * minibuf.c (read_minibuf): Likewise.
10687 * msdos.c (IT_set_frame_parameters): Likewise.
10688 * xmenu.c (Fx_popup_dialog): Likewise.
10689 * w32menu.c (Fx_popup_dialog): Likewise.
10690
10691 2012-07-11 Glenn Morris <rgm@gnu.org>
10692
10693 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10694 since nothing has defined it on these platforms.
10695
10696 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10697 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10698
10699 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10700 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10701 Move CLASH_DETECTION to configure.
10702
10703 * s/gnu.h: Remove file, which is now empty.
10704
10705 * s/gnu.h, s/gnu-linux.h:
10706 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10707
10708 2012-07-11 John Wiegley <johnw@newartisans.com>
10709
10710 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10711 function attribute, so we only use it if it exists in the
10712 compiler.
10713
10714 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10715
10716 Avoid call to strlen in fast_c_string_match_ignore_case.
10717 * search.c (fast_c_string_match_ignore_case): Change to use
10718 length argument. Adjust users accordingly.
10719 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10720
10721 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10722
10723 Assume mkdir, rmdir.
10724 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10725 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10726
10727 Assume rename.
10728 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10729
10730 Assume perror.
10731 * s/hpux10-20.h (HAVE_PERROR): Remove.
10732 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10733 Remove dummy definition, as this problem was obsolete long ago.
10734
10735 Assume strerror.
10736 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10737
10738 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10739
10740 Avoid calls to strlen in font processing functions.
10741 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
10742 (font_open_by_name): Change to use length argument.
10743 Adjust users accordingly.
10744 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10745 Adjust prototypes.
10746 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10747 Change to return ptrdiff_t.
10748 (xfont_list_pattern, xfont_match): Use length returned by
10749 xfont_decode_coding_xlfd.
10750 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10751
10752 2012-07-11 Glenn Morris <rgm@gnu.org>
10753
10754 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10755 Move DONT_REOPEN_PTY to configure.
10756
10757 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10758 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10759
10760 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10761
10762 Remove "#define unix" that is no longer needed (Bug#11905).
10763 * s/aix4-2.h (unix): Remove; no longer needed.
10764
10765 EMACS_TIME simplification (Bug#11875).
10766 This replaces macros (which typically do not work in GDB)
10767 with functions, typedefs and enums, making the code easier to debug.
10768 The functional style also makes code easier to read and maintain.
10769 * systime.h: Include <sys/time.h> on all hosts, not just if
10770 WINDOWSNT, since 'struct timeval' is needed in general.
10771 (EMACS_TIME): Now a typedef, not a macro.
10772 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10773 not macros.
10774 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10775 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10776 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10777 (EMACS_TIME_LE): Now functions, not macros.
10778 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10779 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10780 which are not functions. All uses rewritten to use:
10781 (make_emacs_time): New function.
10782 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10783 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10784 not functions. All uses rewritten to use the following, respectively:
10785 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10786 (add_emacs_time, sub_emacs_time): New functions.
10787 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
10788 * fileio.c (Fcopy_file):
10789 * xterm.c (XTflash): Get the current time closer to when it's used.
10790 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10791
10792 * bytecode.c (targets): Suppress -Woverride-init warnings.
10793
10794 Simplify by avoiding confusing use of strncpy etc.
10795 * doc.c (Fsnarf_documentation):
10796 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10797 * frame.c (Fmake_terminal_frame):
10798 * gtkutil.c (get_utf8_string):
10799 * lread.c (openp):
10800 * nsmenu.m (ns_update_menubar):
10801 * regex.c (regerror):
10802 Prefer memcpy to strncpy and strncat when either will do.
10803 * fileio.c (Fsubstitute_in_file_name):
10804 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10805 (menu_separator_name_p):
10806 * nsmenu.m (ns_update_menubar):
10807 Prefer memcmp to strncmp when either will do.
10808 * nsterm.m: Include <ftoastr.h>.
10809 (ns_get_color):
10810 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10811 Prefer snprintf to strncpy.
10812 * nsterm.m (ns_term_init):
10813 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10814 * nsterm.m (ns_term_init):
10815 Avoid the need for strncpy, by using build_string or
10816 make_unibyte_string directly. Use dtoastr, not snprintf.
10817 * process.c (Fmake_network_process): Diagnose service names that
10818 are too long, rather than silently truncating them or creating
10819 non-null-terminated names.
10820 (Fnetwork_interface_info): Likewise, for interface names.
10821 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10822 Prefer sprintf to strncat.
10823 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10824 Prefer vsnprintf to vsprintf + strncpy.
10825
10826 2012-07-10 Glenn Morris <rgm@gnu.org>
10827
10828 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10829 Clarify fallback case.
10830
10831 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10832
10833 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10834 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10835 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
10836 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
10837 where argument type is known to be a Lisp_Cons.
10838
10839 2012-07-10 Tom Tromey <tromey@redhat.com>
10840
10841 * bytecode.c (BYTE_CODE_THREADED): New macro.
10842 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10843 (enum byte_code_op): New type.
10844 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10845 (exec_byte_code): Use them. Use token threading when applicable.
10846
10847 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10848
10849 Optimize pure C strings initialization.
10850 * lisp.h (make_pure_string): Fix prototype.
10851 (build_pure_c_string): New function, defined as static inline. This
10852 provides a better opportunity to optimize away calls to strlen when
10853 the function is called with compile-time constant argument.
10854 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10855 argument, adjust users accordingly. Use build_pure_c_string where
10856 appropriate.
10857 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10858 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10859 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10860
10861 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10862
10863 Avoid calls to strlen in miscellaneous functions.
10864 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10865 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10866 * lread.c (openp): Likewise.
10867
10868 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10869
10870 Avoid calls to strlen in path processing functions.
10871 * fileio.c (file_name_as_directory): Add comment. Change to add
10872 srclen argument and return the length of result. Adjust users
10873 accordingly.
10874 (directory_file_name): Fix comment. Change to add srclen argument,
10875 swap 1st and 2nd arguments to obey the common convention.
10876 Adjust users accordingly.
10877 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10878
10879 2012-07-10 Glenn Morris <rgm@gnu.org>
10880
10881 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10882 Move PENDING_OUTPUT_COUNT definition to configure.
10883
10884 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10885 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10886 * s/gnu.h (DATA_START): Move definitions to configure.
10887
10888 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10889 We include usg5-4-common.h, which defines them both.
10890
10891 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10892 O_RDONLY already includes it).
10893
10894 Stop ns builds setting the EMACSLOADPATH environment variable.
10895 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10896 Now it does not set EMACSLOADPATH, just returns the load-path string.
10897 * nsterm.h: Update accordingly.
10898 * lread.c [HAVE_NS]: Include nsterm.h.
10899 (init_lread) [HAVE_NS]: Use ns_load_path.
10900 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10901
10902 2012-07-09 Glenn Morris <rgm@gnu.org>
10903
10904 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10905 since the included bsd-common.h does so.
10906
10907 Stop ns builds setting the EMACSPATH environment variable.
10908 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10909 (ns_init_paths): Do not set EMACSPATH.
10910 * nsterm.h (ns_exec_path): Add it.
10911 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10912 Use ns_exec_path.
10913
10914 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10915
10916 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10917
10918 * process.c (wait_reading_process_output): 'waitchannels' was unset
10919 when read_kbd || !NILP (wait_for_cell); fix this.
10920
10921 Add GCC-style 'const' attribute to functions that can use it.
10922 * character.h (char_resolve_modifier_mask):
10923 * keyboard.h (make_ctrl_char):
10924 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10925 (init_character_once, next_almost_prime, init_fns, init_image)
10926 (flush_pending_output, init_sound):
10927 * mem-limits.h (start_of_data):
10928 * menu.h (finish_menu_items):
10929 Add ATTRIBUTE_CONST.
10930 * emacs.c (DEFINE_DUMMY_FUNCTION):
10931 Declare the dummy function with ATTRIBUTE_CONST.
10932 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10933 Add decls with ATTRIBUTE_CONST.
10934
10935 Minor improvements to make_formatted_string.
10936 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10937 where int is good enough, as vsprintf returns an int.
10938 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10939
10940 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10941
10942 Use make_formatted_string to avoid double length calculation.
10943 * lisp.h (make_formatted_string): New prototype.
10944 * alloc.c (make_formatted_string): New function.
10945 * buffer.c (Fgenerate_new_buffer_name): Use it.
10946 * dbusbind.c (syms_of_dbusbind): Likewise.
10947 * editfns.c (Fcurrent_time_zone): Likewise.
10948 * filelock.c (get_boot_time): Likewise.
10949 * frame.c (make_terminal_frame, set_term_frame_name)
10950 (x_report_frame_params): Likewise.
10951 * image.c (gs_load): Likewise.
10952 * minibuf.c (get_minibuffer): Likewise.
10953 * msdos.c (dos_set_window_size): Likewise.
10954 * process.c (make_process): Likewise.
10955 * xdisp.c (ensure_echo_area_buffers): Likewise.
10956 * xsettings.c (apply_xft_settings): Likewise.
10957
10958 2012-07-09 Glenn Morris <rgm@gnu.org>
10959
10960 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10961 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10962 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10963 * nsterm.h (ns_etc_directory): Add it.
10964 * callproc.c [HAVE_NS]: Include nsterm.h.
10965 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10966
10967 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10968
10969 Move marker debugging code under MARKER_DEBUG.
10970 * marker.c (MARKER_DEBUG): Move marker debugging code under
10971 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10972 for bootstrap with --enable-checking (~3x slowdown reported
10973 by Juanma Barranquero <lekktu@gmail.com>).
10974 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10975
10976 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10977
10978 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10979 See <http://bugs.gnu.org/11825#29>.
10980
10981 2012-07-08 Eli Zaretskii <eliz@gnu.org>
10982
10983 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10984 has no font, use the frame's font. (Bug#11813)
10985 (display_line): Add commentary about displaying truncation glyphs
10986 on GUI frames.
10987 (produce_special_glyphs): Move here from term.c.
10988
10989 * term.c (produce_special_glyphs): Move to xdisp.c.
10990
10991 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10992 section.
10993
10994 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10995
10996 * xdisp.c (display_line): Avoid warning about implicit declaration
10997 of FRAME_FONT.
10998
10999 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
11000
11001 * lisp.h: Remove empty conditional.
11002
11003 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11004
11005 * lread.c (load_path_check): Now static.
11006
11007 Fix some minor --with-ns problems found by static checking.
11008 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
11009 (x_set_font) [!HAVE_X_WINDOWS]:
11010 * image.c (xpm_load_image) [HAVE_NS]:
11011 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
11012 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
11013 Remove unused local.
11014 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
11015 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
11016 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
11017 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
11018 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
11019 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
11020 Fix pointer signedness problem.
11021 * xfaces.c (FRAME_X_FONT_TABLE):
11022 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
11023
11024 2012-07-07 Glenn Morris <rgm@gnu.org>
11025
11026 * lread.c (load_path_check): New function, split from init_lread.
11027 (init_lread): Reorganize. Motivation:
11028 If EMACSLOADPATH is set, check/warn about that rather than the
11029 defaults, which we are not going to use. Hence we can remove
11030 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
11031 Don't warn if site-lisp directories are missing.
11032 If not installed, start from a blank load-path, since
11033 PATH_LOADSEARCH refers to the eventual installation directories.
11034
11035 2012-07-07 Eli Zaretskii <eliz@gnu.org>
11036
11037 Support truncation and continuation glyphs on GUI frames, when
11038 fringes are disabled. (Bug#11832)
11039 * xdisp.c (init_iterator): Get dimensions of truncation and
11040 continuation glyphs even if on GUI frames.
11041 Adjust it->last_visible_x on GUI frames when the left or right fringes,
11042 or both, are absent.
11043 (start_display, move_it_in_display_line_to): Handle the case of a
11044 GUI frame without a fringe to display continuation or truncation
11045 glyphs.
11046 (insert_left_trunc_glyphs): Support GUI frames: make sure
11047 truncation glyphs overwrite enough glyphs from the current line to
11048 have sufficient space in pixels.
11049 (display_line): Support truncation and continuation glyphs on GUI
11050 frames. If some spare pixels are left on the line after inserting
11051 the truncation glyphs, fill that space with a stretch glyph of a
11052 suitably computed width.
11053
11054 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11055 produce_glyphs, to support GUI sessions.
11056
11057 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11058
11059 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11060
11061 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11062
11063 Do not require float-time's arg to fit in time_t (Bug#11825).
11064 This works better on hosts where time_t is unsigned, and where
11065 float-time is applied to the (negative) difference between two times.
11066 * editfns.c (decode_time_components): Last arg is now double *,
11067 not int *, and means to store all the result as a double, without
11068 worrying about whether the seconds part fits in time_t.
11069 All callers changed.
11070 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11071 All callers changed.
11072 (Ffloat_time): Do not fail merely because the specified time falls
11073 outside of time_t range.
11074
11075 2012-07-07 Glenn Morris <rgm@gnu.org>
11076
11077 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11078 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11079 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11080
11081 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
11082
11083 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11084 Update dependencies.
11085
11086 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11087
11088 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11089
11090 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11091 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11092 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11093 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11094 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11095 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11096
11097 * xfont.c (compare_font_names): Redo to omit the need for casts.
11098
11099 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11100
11101 * xfns.c (Fx_change_window_property): Doc fix.
11102 * w32fns.c (Fx_change_window_property): Doc fix.
11103
11104 * w32fns.c (Fx_window_property): Accept the same arguments as the
11105 X Windows version. Doc fix.
11106 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11107
11108 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
11109 Eli Zaretskii <eliz@gnu.org>
11110
11111 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11112 Windows-specific code from nt/config.nt moved here.
11113 Obsolete settings removed.
11114
11115 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11116
11117 * process.c: Avoid unnecessary calls to gettime.
11118 (wait_reading_process_output): Don't get the time of day
11119 when gobbling data immediately and not waiting, as there's no need
11120 for it in that case. This removes a FIXME.
11121
11122 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11123
11124 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11125 is defined (Bug#11768).
11126
11127 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11128
11129 Fix marker debugging code.
11130 * marker.c (byte_char_debug_check): Do not perform the check
11131 if buffer is not multibyte.
11132 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11133 Call byte_char_debug_check with correct arguments.
11134
11135 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11136
11137 Compile marker debugging code only if ENABLE_CHECKING is defined.
11138 * marker.c (byte_char_debug_check, count_markers):
11139 Use only if ENABLE_CHECKING is defined.
11140 (byte_debug_flag): Remove.
11141 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11142 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11143
11144 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11145
11146 Avoid code repetition in marker-related functions.
11147 * marker.c (attach_marker): New function.
11148 (Fset_marker, set_marker_restricted, set_marker_both)
11149 (set_marker_restricted_both): Use it.
11150 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11151 Consistently rename charno to charpos.
11152 (marker_position): Add eassert.
11153 (marker_byte_position): Convert to eassert.
11154
11155 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11156
11157 Simplify list operations in unchain_overlay and unchain_marker.
11158 * buffer.c (unchain_overlay): Simplify. Add comment.
11159 * marker.c (unchain_marker): Simplify. Fix comments.
11160
11161 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11162
11163 Introduce fast path for the widely used marker operation.
11164 * alloc.c (build_marker): New function.
11165 * lisp.h (build_marker): New prototype.
11166 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11167 * composite.c (autocmp_chars): Likewise.
11168 * editfns.c (buildmark): Remove.
11169 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11170 (save_restriction_save): Use build_marker.
11171 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11172 * window.c (save_window_save): Likewise.
11173
11174 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11175
11176 Do not use Fdelete_overlay in delete_all_overlays
11177 to avoid redundant calls to unchain_overlay.
11178 * buffer.c (drop_overlay): New function.
11179 (delete_all_overlays, Fdelete_overlay): Use it.
11180 * minibuf.c (get_minibuffer): Fix comment.
11181
11182 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11183
11184 Port to OpenBSD 5.1 amd64.
11185 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11186 This is needed for OpenBSD, and should be harmless on all BSD systems.
11187 Also, include <sys/sysctl.h>, as it should be available on all
11188 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11189 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11190 use p_pid member, not kp_proc.pid.
11191
11192 2012-07-06 Glenn Morris <rgm@gnu.org>
11193
11194 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11195
11196 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11197
11198 More xmalloc and related cleanup.
11199 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11200 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11201 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11202 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11203 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11204 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11205 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11206 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11207 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11208 * xterm.c:
11209 Omit needless casts involving void * pointers and allocation.
11210 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11211 as the former is more robust if P's type is changed.
11212 Prefer xzalloc to xmalloc + memset 0.
11213 Simplify malloc-or-realloc to realloc.
11214 Don't worry about xmalloc returning a null pointer.
11215 Prefer xstrdup to xmalloc + strcpy.
11216 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11217 growing it.
11218 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11219 alloca of a constant.
11220
11221 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11222
11223 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11224 hscroll is larger than the line width. Fixes long and futile
11225 looping inside extend_face_to_end_of_line (on a TTY) producing
11226 glyphs that are not needed and thrown away.
11227
11228 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11229
11230 * marker.c (set_marker_restricted_both): Simplify by using
11231 clip_to_bounds.
11232
11233 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11234
11235 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11236
11237 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11238
11239 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11240 not defined (Bug#11768).
11241 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11242 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11243 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11244 followed by gtk_box_set_homogeneous (Bug#11768).
11245 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11246 (update_theme_scrollbar_width, xg_create_scroll_bar):
11247 Use gtk_scrollbar_new (Bug#11768).
11248 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11249 (is_box_type): New function (Bug#11768).
11250 (xg_tool_item_stale_p): Call is_box_type.
11251 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11252 with default display (Bug#11768).
11253
11254 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11255
11256 * xdisp.c (window_hscroll_limited): New function.
11257 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11258 coordinates when window's hscroll is set to insanely large
11259 values. (Bug#11857)
11260
11261 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
11262
11263 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11264 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11265
11266 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11267
11268 Cleanup xmalloc.
11269 * lisp.h (xzalloc): New prototype. Omit needless casts.
11270 * alloc.c (xzalloc): New function. Omit needless casts.
11271 * charset.c: Omit needless casts. Convert all calls to
11272 xmalloc with following memset to xzalloc.
11273 * dispnew.c: Likewise.
11274 * fringe.c: Likewise.
11275 * image.c: Likewise.
11276 * sound.c: Likewise.
11277 * term.c: Likewise.
11278 * w32fns.c: Likewise.
11279 * w32font.c: Likewise.
11280 * w32term.c: Likewise.
11281 * xfaces.c: Likewise.
11282 * xfns.c: Likewise.
11283 * xterm.c: Likewise.
11284 * atimer.c: Omit needless casts.
11285 * buffer.c: Likewise.
11286 * callproc.c: Likewise.
11287 * ccl.c: Likewise.
11288 * coding.c: Likewise.
11289 * composite.c: Likewise.
11290 * doc.c: Likewise.
11291 * doprnt.c: Likewise.
11292 * editfns.c: Likewise.
11293 * emacs.c: Likewise.
11294 * eval.c: Likewise.
11295 * filelock.c: Likewise.
11296 * fns.c: Likewise.
11297 * gtkutil.c: Likewise.
11298 * keyboard.c: Likewise.
11299 * lisp.h: Likewise.
11300 * lread.c: Likewise.
11301 * minibuf.c: Likewise.
11302 * msdos.c: Likewise.
11303 * print.c: Likewise.
11304 * process.c: Likewise.
11305 * region-cache.c: Likewise.
11306 * search.c: Likewise.
11307 * sysdep.c: Likewise.
11308 * termcap.c: Likewise.
11309 * terminal.c: Likewise.
11310 * tparam.c: Likewise.
11311 * w16select.c: Likewise.
11312 * w32.c: Likewise.
11313 * w32reg.c: Likewise.
11314 * w32select.c: Likewise.
11315 * w32uniscribe.c: Likewise.
11316 * widget.c: Likewise.
11317 * xdisp.c: Likewise.
11318 * xmenu.c: Likewise.
11319 * xrdb.c: Likewise.
11320 * xselect.c: Likewise.
11321
11322 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11323
11324 * fileio.c (time_error_value): Check the right error number.
11325 Problem reported by Troels Nielsen in
11326 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11327
11328 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11329
11330 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11331 This should be fixed in a better way; see Eli Zaretskii in
11332 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11333 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11334
11335 * fileio.c (time_error_value): Rename from special_mtime.
11336 The old name's problems were noted by Eli Zaretskii in
11337 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11338
11339 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11340 This variable's comment says Emacs needs at least one GDB-visible
11341 symbol of type enum pvec_type, to work around GDB problems.
11342 The symbol's value doesn't matter.
11343
11344 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11345 that causes compilation to fail on pre-C99 compilers.
11346
11347 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11348
11349 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11350 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11351
11352 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11353
11354 * buffer.c (init_buffer_once): Fix initialization of
11355 headers for buffer_defaults and buffer_local_symbols.
11356 Reported by Juanma Barranquero <lekktu@gmail.com>.
11357
11358 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11359
11360 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11361 * lisp.h (enum pvec_type): Use fewer bits.
11362 (PSEUDOVECTOR_SIZE_BITS): New constant.
11363 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11364 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11365 change in pvec_type.
11366 (PSEUDOVECTOR_TYPEP): New macro.
11367 (TYPED_PSEUDOVECTORP): Use it.
11368 * fns.c (internal_equal): Adapt code to extract pvectype.
11369 * emacs.c (gdb_pvec_type): Update type.
11370 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11371 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11372 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11373 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11374 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11375 abusing vector->header.next.nbytes.
11376 (live_vector_p): Use PVEC_TYPE.
11377 (mark_object): Adapt code to extract pvectype. Use switch.
11378
11379 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11380
11381 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11382 Tighten new eassert a bit.
11383
11384 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11385
11386 Fix compilation with --enable-gcc-warnings and -O1
11387 optimization level.
11388 * doprnt.c (doprnt): Change type of tem to int, initialize
11389 to avoid compiler warning. Add eassert.
11390 * search.c (simple_search): Initialize match_byte to avoid
11391 compiler warning. Add eassert.
11392
11393 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11394
11395 Avoid weird behavior with large horizontal scrolls.
11396 Without this change, for example, large hscroll values would
11397 mess up Emacs's display on Fedora 15 x86, presumably due to
11398 overflows in int calculations in the display code.
11399 Also, if buffers had long lines, Emacs would freeze.
11400 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11401 (set_window_hscroll): New function, containing the old guts of
11402 Fset_window_hscroll. Return the clipped value.
11403 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11404 This avoids the need to check against PTRDIFF_MAX.
11405
11406 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11407
11408 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11409
11410 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11411
11412 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11413
11414 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11415 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11416 since GCC 4.4.6 issues a bogus warning for them.
11417
11418 Fix bugs in file timestamp newness comparisons.
11419 * fileio.c (Ffile_newer_than_file_p):
11420 * lread.c (Fload): Use full timestamp resolution of files,
11421 not just the 1-second resolution, so that files that are only
11422 slightly newer still count as newer.
11423 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11424 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11425
11426 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11427
11428 * fileio.c: Improve handling of file time marker. (Bug#11852)
11429 (special_mtime): New function.
11430 (Finsert_file_contents, Fverify_visited_file_modtime):
11431 Use it to set special mtime values consistently.
11432
11433 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11434
11435 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11436 marker for non-existing file. (Bug#11852)
11437
11438 2012-07-03 Glenn Morris <rgm@gnu.org>
11439
11440 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11441 and did not make it into globals.h).
11442
11443 2012-07-03 Tom Tromey <tromey@redhat.com>
11444
11445 * window.c (Fset_window_margins, Fset_window_fringes)
11446 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11447 * textprop.c (Fprevious_property_change): No longer static.
11448 * syntax.c (Fsyntax_table_p): No longer static.
11449 * process.c (Fget_process, Fprocess_datagram_address): No longer
11450 static.
11451 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11452 * keyboard.c (Fcommand_execute): No longer static.
11453 Remove EXFUN.
11454 * insdel.c (Fcombine_after_change_execute): No longer static.
11455 * image.c (Finit_image_library): No longer static.
11456 * fileio.c (Fmake_symbolic_link): No longer static.
11457 * eval.c (Ffetch_bytecode): No longer static.
11458 * editfns.c (Fuser_full_name): No longer static.
11459 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11460 No longer static.
11461 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11462 static.
11463 * dired.c (Ffile_attributes): No longer static.
11464 * composite.c (Fcomposition_get_gstring): No longer static.
11465 * callproc.c (Fgetenv_internal): No longer static.
11466
11467 * ccl.h: Remove EXFUNs.
11468 * buffer.h: Remove EXFUNs.
11469 * dispextern.h: Remove EXFUNs.
11470 * intervals.h: Remove EXFUNs.
11471 * fontset.h: Remove EXFUN.
11472 * font.h: Remove EXFUNs.
11473 * dosfns.c (system_process_attributes): Remove EXFUN.
11474 * keymap.h: Remove EXFUNs.
11475 * lisp.h: Remove EXFUNs.
11476 * w32term.h: Remove EXFUNs.
11477 * window.h: Remove EXFUNs.
11478 * xsettings.h: Remove EXFUN.
11479 * xterm.h: Remove EXFUN.
11480
11481 2012-07-03 Glenn Morris <rgm@gnu.org>
11482
11483 * lisp.h (Frandom): Make it visible to C.
11484 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11485 buffer for invisible buffers. (Bug#1229)
11486
11487 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11488
11489 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11490 values which aren't power of 2.
11491 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11492 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11493 accordingly.
11494
11495 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11496
11497 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11498
11499 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11500
11501 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11502
11503 * alloc.c (allocate_vector_block): Remove redundant
11504 calls to mallopt if DOUG_LEA_MALLOC is defined.
11505 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11506 avoid calls to mallopt if zero_vector is returned.
11507
11508 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11509
11510 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11511 is enabled, avoid dereferencing NULL current_sblock if
11512 running undumped.
11513
11514 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11515
11516 Cleanup basic buffer management.
11517 * buffer.h (struct buffer): Change layout to use generic vector
11518 marking code. Fix some comments. Change type of 'clip_changed'
11519 to bitfield. Remove unused #ifndef old.
11520 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11521 (GET_OVERLAYS_AT): Fix indentation.
11522 (for_each_per_buffer_object_at): New macro.
11523 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11524 (Fbuffer_local_variables): Use it.
11525 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11526 * alloc.c (allocate_buffer): Adjust to match new layout of
11527 struct buffer. Fix comment.
11528 (mark_overlay): New function.
11529 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11530 Lisp area of struct buffer.
11531 (mark_object): Use it. Adjust marking of misc objects
11532 and related comments.
11533
11534 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11535
11536 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11537 wrapper that is not needed because the wrapped code is a no-op (zero
11538 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11539 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11540
11541 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11542
11543 * alloc.c (mark_buffer): Simplify. Remove prototype.
11544 (mark_object): Add comment. Reorganize marking of vector-like
11545 objects. Use CHECK_LIVE for all vector-like objects except buffers
11546 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11547 Avoid redundant calls to mark_vectorlike for bool vectors.
11548
11549 2012-06-30 Glenn Morris <rgm@gnu.org>
11550
11551 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11552
11553 * epaths.in (PATH_SITELOADSEARCH): New.
11554 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11555 This is rather than relying on --enable-locallisppath elements
11556 having "site-lisp" in their names. (Bug#10208#25, 11658)
11557
11558 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11559
11560 * w32proc.c (sys_select): Accept and ignore one more argument.
11561
11562 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11563
11564 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11565 (pselect) [!MS_DOS]: Redirect to sys_select.
11566
11567 * sysdep.c: Don't include dos.h and dosfns.h.
11568
11569 * process.c (sys_select):
11570 * msdos.c (sys_select): Accept one more argument and ignore it.
11571
11572 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11573 adapt data types and code to that.
11574
11575 * dosfns.c:
11576 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11577 which clashes with the gnulib function of the same name.
11578
11579 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11580
11581 * font.c (font_style_to_value, font_style_symbolic)
11582 (font_prop_validate_style): Add type checks for values in
11583 font_style_table.
11584
11585 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11586 argument.
11587 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11588 uses.
11589
11590 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11591
11592 * xdisp.c (try_window_id): Undo last change.
11593
11594 * w32.c (getwd): Adjust commentary about startup_dir.
11595 (init_environment): Always call sys_access, even in non-MSVC
11596 builds. Don't chdir to the directory of the Emacs executable.
11597 This undoes code from 1997 which was justified by the need to
11598 "avoid conflicts when removing and renaming directories". But its
11599 downside was that every relative file name was being interpreted
11600 relative to the directory of the Emacs executable, which can never
11601 be TRT. In particular, it broke sys_access when called with
11602 relative file names.
11603 (sys_access): Map GetLastError to errno.
11604
11605 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11606
11607 * window.h (struct window): Change type of 'fringes_outside_margins'
11608 to bitfield. Fix comment. Adjust users accordingly.
11609 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
11610 Adjust comment.
11611 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11612 to ptrdiff_t.
11613
11614 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
11615
11616 * gnutls.c (emacs_gnutls_handshake):
11617 Add QUIT to make the loop interruptible.
11618
11619 2012-06-29 Glenn Morris <rgm@gnu.org>
11620
11621 * charset.c (init_charset): Make lack of etc/charsets fatal.
11622
11623 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11624
11625 * editfns.c (region_limit): Fix type mismatch.
11626
11627 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11628
11629 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11630 undefined. Convert from xassert to eassert.
11631 * nsmenu.m: Convert from xassert to eassert.
11632 * nsterm.m: Likewise.
11633
11634 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11635
11636 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11637
11638 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11639
11640 Avoid integer overflow on scroll-left and scroll-right.
11641 * window.c (HSCROLL_MAX): New macro.
11642 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11643 overflow when requested scroll falls outside ptrdiff_t range.
11644
11645 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11646
11647 * window.h (struct window): Change type of 'hscroll',
11648 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11649 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11650 Adjust users accordingly.
11651 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11652 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11653 from EMACS_INT to ptrdiff_t.
11654 (make_window): Omit redundant initialization.
11655
11656 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
11657
11658 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11659
11660 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11661
11662 * window.h (struct window): Change type of 'use_time' and
11663 'sequence_number' from Lisp_Object to int.
11664 * frame.c (make_frame): Adjust users accordingly.
11665 * print.c (print_object): Likewise.
11666 * window.c (select_window, Fwindow_use_time, make_parent_window)
11667 (make_window): Likewise.
11668
11669 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11670
11671 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11672 enabled with --enable-checking=[all,glyphs] configure option.
11673 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11674 adjust comments accordingly.
11675 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11676 undefined, adjust comments accordingly.
11677 * image.c: Likewise.
11678 * scroll.c: Likewise.
11679 * w32fns.c: Likewise.
11680 * w32term.c: Likewise.
11681 * xdisp.c: Likewise.
11682 * xfaces.c: Likewise.
11683 * xfns.c: Likewise.
11684 * xterm.c: Likewise.
11685
11686 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11687
11688 Generalize run-time debugging checks.
11689 * dispextern.h (XASSERTS): Remove.
11690 * fontset.c (xassert): Remove.
11691 Convert from xassert to eassert.
11692 * alloc.c: Convert from xassert to eassert.
11693 * bidi.c: Likewise.
11694 * dispnew.c: Likewise.
11695 * fns.c: Likewise.
11696 * fringe.c: Likewise.
11697 * ftfont.c: Likewise.
11698 * gtkutil.c: Likewise.
11699 * image.c: Likewise.
11700 * keyboard.c: Likewise.
11701 * menu.c: Likewise.
11702 * process.c: Likewise.
11703 * scroll.c: Likewise.
11704 * sound.c: Likewise.
11705 * term.c: Likewise.
11706 * w32console.c: Likewise.
11707 * w32fns.c: Likewise.
11708 * w32term.c: Likewise.
11709 * window.c: Likewise.
11710 * xdisp.c: Likewise.
11711 * xfaces.c: Likewise.
11712 * xfns.c: Likewise.
11713 * xselect.c: Likewise.
11714 * xterm.c: Likewise.
11715
11716 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11717
11718 * fns.c (maybe_resize_hash_table): Output message when growing the
11719 purify-hashtable.
11720
11721 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11722
11723 * alloc.c (allocate_string_data): Remove dead code.
11724 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11725 avoid GCC warning about unused macro.
11726
11727 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11728
11729 * alloc.c (allocate_string): Omit intervals initialization.
11730 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11731 as in make_pure_string and make_pure_c_string.
11732
11733 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11734
11735 * alloc.c (allocate_string): Fix last change.
11736
11737 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11738
11739 * alloc.c (allocate_string): Remove two redundant calls
11740 to memset, add explicit initialization where appropriate.
11741
11742 2012-06-27 Glenn Morris <rgm@gnu.org>
11743
11744 * lisp.mk (lisp): Remove paths.elc.
11745
11746 2012-06-27 Chong Yidong <cyd@gnu.org>
11747
11748 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11749
11750 2012-06-26 John Wiegley <johnw@newartisans.com>
11751
11752 * unexmacosx.c (copy_data_segment): Add two section names used
11753 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11754
11755 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11756 when building with Clang.
11757
11758 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11759
11760 * eval.c (Fapply): Allow calling it with a single argument.
11761
11762 2012-06-26 Eli Zaretskii <eliz@gnu.org>
11763
11764 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11765 _stricmp and _strnicmp.
11766 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11767
11768 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11769
11770 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11771 allocated window.
11772 (allocate_process): Likewise for new process.
11773 (allocate_terminal): Change to use offsetof.
11774 (allocate_frame): Likewise.
11775 * frame.c (make_frame): Omit redundant initialization.
11776 * window.c (make_parent_window): Use memset.
11777 (make_window): Omit redundant initialization.
11778 * process.c (make_process): Omit redundant initialization.
11779 * terminal.c (create_terminal): Likewise.
11780
11781 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11782
11783 * term.c (delete_tty): Remove redundant call to memset.
11784
11785 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11786
11787 * alloc.c: Remove build_string.
11788 * lisp.h: Define build_string as static inline. This provides
11789 a better opportunity to optimize away calls to strlen when the
11790 function is called with compile-time constant argument.
11791 * image.c (imagemagick_error): Convert to build_string.
11792 * w32proc.c (sys_spawnve): Likewise.
11793 * xterm.c (x_term_init): Likewise.
11794
11795 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11796
11797 Use sprintf return value instead of invoking strlen on result.
11798 In the old days this wasn't portable, since some sprintf
11799 implementations returned char *. But they died out years ago and
11800 Emacs already assumes sprintf returns int.
11801 Similarly for float_to_string.
11802 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11803 * ccl.c (ccl_driver):
11804 * character.c (string_escape_byte8):
11805 * data.c (Fnumber_to_string):
11806 * doprnt.c (doprnt):
11807 * print.c (print_object):
11808 * xdisp.c (message_dolog):
11809 * xfns.c (syms_of_xfns):
11810 Use sprintf or float_to_string result to avoid need to call strlen.
11811 * data.c (Fnumber_to_string):
11812 Use make_unibyte_string, since the string must be ASCII.
11813 * lisp.h, print.c (float_to_string): Now returns int length.
11814 * term.c (produce_glyphless_glyph):
11815 Use sprintf result rather than recomputing it.
11816
11817 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11818 * Makefile.in (ALL_CFLAGS):
11819 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11820 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11821
11822 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11823
11824 * dispextern.h (xstrcasecmp): Define to library function
11825 strcasecmp if available.
11826 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11827
11828 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11829
11830 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11831 Avoid comma operator.
11832 * menu.c (push_submenu_start, push_submenu_end)
11833 (push_left_right_boundary, push_menu_pane): Likewise.
11834 * msdos.c (dos_rawgetc): Likewise.
11835
11836 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11837
11838 * xfns.c (xic_create_fontsetname): Remove redundant calls
11839 to memset.
11840
11841 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11842
11843 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11844 sprintf already null-terminates its output.
11845
11846 * xfns.c (x_window): Remove redundant cast.
11847
11848 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11849
11850 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11851 `const char *' to `char *' to avoid compiler warning.
11852
11853 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11854
11855 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11856 instead of truncating it to 63 (admittedly a generous limit).
11857
11858 * process.c: Fix spelling and caps in comments.
11859
11860 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11861
11862 * emacs.c (setpgrp): Remove definition, unused.
11863 * sysdep.c (setpgrp): Remove definition, not used in this file.
11864
11865 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
11866
11867 * makefile.w32-in: Update dependencies.
11868
11869 2012-06-24 Eli Zaretskii <eliz@gnu.org>
11870
11871 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11872 (SYSTIME_H): Add nt/inc/sys/time.h.
11873
11874 * systime.h [WINDOWSNT]: Include sys/time.h.
11875
11876 * s/ms-w32.h (struct timespec): Definition moved from
11877 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11878
11879 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11880
11881 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11882 * buffer.h (buffer_slot_type_mismatch):
11883 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11884 * eval.c (unwind_to_catch):
11885 * image.c (my_png_error, my_error_exit):
11886 * keyboard.c (quit_throw_to_read_char, user_error)
11887 (Fexit_recursive_edit, Fabort_recursive_edit):
11888 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11889 (wrong_type_argument, buffer_overflow, __executable_start)
11890 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11891 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11892 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11893 (fatal):
11894 (child_setup) [!DOS_NT]:
11895 * lread.c (end_of_file_error, invalid_syntax):
11896 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11897 * puresize.h (pure_write_error):
11898 * search.c (matcher_overflow):
11899 * sound.c (sound_perror, alsa_sound_perror):
11900 * sysdep.c, syssignal.h (croak):
11901 * term.c (maybe_fatal, vfatal):
11902 * textprop.c (text_read_only):
11903 * undo.c (user_error):
11904 * unexmacosx.c (unexec_error):
11905 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11906 Use _Noreturn rather than NO_RETURN.
11907 No need for separate decl merely because of _Noreturn.
11908 * sound.c (sound_warning, parse_sound):
11909 Remove unnecessary forward decls.
11910
11911 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11912
11913 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11914 * lisp.h (WAIT_READING_MAX): New macro.
11915 * dispnew.c (Fsleep_for, sit_for):
11916 * keyboard.c (kbd_buffer_get_event):
11917 * process.c (Faccept_process_output):
11918 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11919 This improves on the previous patch, which introduced a bug
11920 when time_t is unsigned and as wide as intmax_t.
11921 See <http://bugs.gnu.org/9000#51>.
11922
11923 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11924
11925 * dispnew.c (sit_for, Fsleep_for):
11926 * keyboard.c (kbd_buffer_get_event):
11927 * process.c (Faccept_process_output): Avoid compiler warnings when
11928 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11929
11930 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
11931
11932 * makefile.w32-in: Update dependencies.
11933
11934 * w32.c (ltime): Add return type and declare static.
11935 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11936
11937 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11938
11939 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11940 Privately reported by Herbert J. Skuhra.
11941 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11942 All uses changed.
11943 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11944 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11945
11946 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11947
11948 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11949 last argument of make_unibyte_string.
11950
11951 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11952 language ID in the event parameters.
11953
11954 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11955 event.code, not the obscure "character set ID".
11956
11957 2012-06-23 Chong Yidong <cyd@gnu.org>
11958
11959 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11960
11961 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11962
11963 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11964 * w32.c (fdutimens): New function.
11965
11966 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11967
11968 * s/ms-w32.h (pselect): Redirect to sys_select.
11969
11970 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11971
11972 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11973 in the logic of incrementing and decrementing the value of
11974 use_relocatable_buffers.
11975
11976 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11977
11978 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11979 Privately reported by Herbert J. Skuhra.
11980 [__FreeBSD__]: Remove "*/" typo after "#include".
11981 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11982 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11983 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11984 Don't assume EMACS_TIME and struct timeval are the same type.
11985
11986 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11987
11988 Support higher-resolution time stamps (Bug#9000).
11989 The time stamps are only nanosecond-resolution at the C level,
11990 since that's the best that any real-world system supports now.
11991 But they are picosecond-resolution at the Lisp level, as that's
11992 easy, and leaves room for future OS improvements.
11993
11994 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11995 (LIBES): Use it.
11996
11997 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11998 Don't get current time unless it's needed.
11999
12000 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
12001 now provides it if it's absent.
12002 (start_atimer): Port to higher-res time stamps.
12003 Check for time stamp overflow. Don't get current time more
12004 often than is needed.
12005
12006 * buffer.h (struct buffer): Buffer modtime now has high resolution.
12007 Include systime.h, not time.h.
12008 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
12009
12010 * dired.c: Include stat-time.h.
12011 (Ffile-attributes): File times now have higher resolution.
12012
12013 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
12014 (struct image): Timestamp now has higher resolution.
12015
12016 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
12017 has at least microseconds now. All uses removed.
12018 (update_frame, update_single_window, update_window, update_frame_1)
12019 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
12020 (duration_to_sec_usec): Remove; no longer needed.
12021
12022 * editfns.c (time_overflow): Now extern.
12023 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
12024 (float-time, Fformat_time_string, Fcurrent_time_string)
12025 (Fcurrent_time_zone): Accept and generate higher-resolution
12026 time stamps.
12027 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
12028 (decode_time_components, lisp_seconds_argument): New functions.
12029 (make_time): Now static.
12030 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
12031 Report an error if the time is invalid, rather than having the caller
12032 do that.
12033
12034 * fileio.c: Include <stat-time.h>
12035 (Fcopy_file): Copy higher-resolution time stamps.
12036 Prefer to set the time stamp via a file descriptor if that works.
12037 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12038 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12039 (Fvisited_file_modtime, Fset_visited_file_modtime):
12040 Support higher-resolution time stamps.
12041
12042 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12043
12044 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12045
12046 * image.c (prepare_image_for_display, clear_image_cache)
12047 (lookup_image): Port to higer-resolution time stamps.
12048
12049 * keyboard.c (start_polling, bind_polling_period):
12050 Check for time stamp overflow.
12051 (read_char, kbd_buffer_get_event, timer_start_idle)
12052 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12053 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12054 Port to higher-resolution time stamps. Do not assume time_t is signed.
12055 (decode_timer): New function. Timers are now vectors of length 9,
12056 not 8, to accommodate the picosecond component.
12057 (timer_check_2): Use it.
12058
12059 * nsterm.m (select_timeout, timeval_subtract): Remove.
12060 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12061 as they're a bit more accurate and handle overflow better.
12062 (ns_select): Change prototype to be compatible with pselect.
12063 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12064 * nsterm.h (ns_select): Adjust prototype.
12065
12066 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12067 us-resolution time stamps.
12068 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12069
12070 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12071
12072 * lisp.h (time_overflow): New decl.
12073 (wait_reading_process_output): First arg is now intmax_t, not int,
12074 to accommodate larger waits.
12075
12076 * process.h (struct Lisp_Process.read_output_delay):
12077 Now counts nanoseconds, not microseconds.
12078 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12079 EMACS_HAS_USECS.
12080 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12081 (wait_reading_process_output):
12082 Port to ns-resolution time stamps.
12083 (Faccept_process_output, wait_reading_process_output):
12084 Check for time stamp overflow. Do not assume time_t is signed.
12085 (select_wrapper): Remove; we now use pselect.
12086 (Fprocess_attributes): Now generates ns-resolution time stamps.
12087
12088 * sysdep.c: Include utimens.h. Don't include utime.h
12089 or worry about struct utimbuf; gnulib does that for us now.
12090 (gettimeofday): Remove; gnulib provides a substitute.
12091 (make_timeval): New function.
12092 (set_file_times): Now sets ns-resolution time stamps.
12093 New arg FD; all uses changed.
12094 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12095 (system_process_attributes):
12096 Now returns ns-resolution time stamp. All uses changed.
12097 Check for time stamp overflow.
12098
12099 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12100 provides a substitute now.
12101
12102 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12103 since it guarantees struct timespec.
12104 (EMACS_TIME): Now struct timespec, so that we can support
12105 ns-resolution time stamps.
12106 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12107 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12108 (EMACS_USECS): Remove.
12109 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12110 so multiply the arg by 1000 before storing it.
12111 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12112 New macros.
12113 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12114 Port to ns-resolution time stamps.
12115 (EMACS_TIME_NEG_P): Remove; replaced by....
12116 (EMACS_TIME_SIGN): New macro.
12117 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12118 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12119 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12120 (make_timeval, make_lisp_time, decode_time_components): New decls.
12121 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12122 that it mishandled time_t overflow. You can't compare by subtracting!
12123 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12124 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12125
12126 * term.c: Include <sys/time.h>.
12127 (timeval_to_Time): New function, for proper overflow wraparound.
12128 (term_mouse_position, term_mouse_click): Use it.
12129
12130 * undo.c (record_first_change): Support higher-resolution time stamps
12131 in the undo buffer.
12132 (Fprimitive_undo): Use them when restoring time stamps.
12133
12134 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12135 (w32_get_internal_run_time):
12136 Port to higher-resolution Emacs time stamps.
12137 (ltime): Now accepts single 64-bit integer, as that's more convenient
12138 for callers.
12139
12140 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12141
12142 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12143 for compatibility with pselect. Support ns-resolution time stamps.
12144
12145 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12146
12147 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12148 Check for time stamp overflow, and support ns-resolution time stamps.
12149
12150 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12151 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12152 (timeval_subtract): Remove; no longer needed.
12153 (XTflash, XTring_bell, x_wait_for_event):
12154 Port to ns-resolution time stamps. Don't assume time_t is signed.
12155
12156 2012-06-22 Chong Yidong <cyd@gnu.org>
12157
12158 * xdisp.c (x_consider_frame_title): Revert last change.
12159
12160 2012-06-22 Eli Zaretskii <eliz@gnu.org>
12161
12162 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12163 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12164 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12165 staticidx goes up to 1597 out of 1600 = 0x640.)
12166
12167 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12168
12169 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12170 Otherwise, the umask might be mistakenly 0 while handling input signals.
12171
12172 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12173
12174 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12175
12176 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12177
12178 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12179 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12180 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12181 access to `contents' member of Lisp_Vector objects with AREF and ASET
12182 where appropriate.
12183
12184 2012-06-19 Chong Yidong <cyd@gnu.org>
12185
12186 * frame.c (delete_frame): When selecting a frame on a different
12187 text terminal, do not alter the terminal's top-frame.
12188
12189 * xdisp.c (format_mode_line_unwind_data): Record the target
12190 frame's selected window and its terminal's top-frame.
12191 (unwind_format_mode_line): Restore them.
12192 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12193 Callers changed.
12194 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12195 since tty frames can be explicitly named.
12196 (prepare_menu_bars): Likewise.
12197
12198 * term.c (Ftty_top_frame): New function.
12199
12200 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12201
12202 Port byte-code-meter to modern targets.
12203 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12204 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12205 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12206 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12207 (METER_1, METER_2): Simplify.
12208
12209 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12210
12211 * data.c (Fdefalias): Return `symbol' (bug#11686).
12212
12213 2012-06-18 Martin Rudalics <rudalics@gmx.at>
12214
12215 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12216 gets killed during executing of this function (Bug#11665).
12217 Try to always return Qt when the buffer has been actually killed.
12218 (Vkill_buffer_query_functions): In doc-string say that functions
12219 run by this hook should not change the current buffer.
12220
12221 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12222
12223 Fix recently-introduced process.c problems found by static checking.
12224 * process.c (write_queue_push, write_queue_pop, send_process):
12225 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12226 (write_queue_pop): Fix pointer signedness problem.
12227 (send_process): Remove unused local.
12228
12229 2012-06-17 Chong Yidong <cyd@gnu.org>
12230
12231 * xdisp.c (redisplay_internal): No need to redisplay terminal
12232 frames that are not on top.
12233
12234 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
12235
12236 * process.c (make_process): Initialize write_queue.
12237 (write_queue_push, write_queue_pop): New functions.
12238 (send_process): Use them to maintain correct ordering of process
12239 writes (Bug#10815).
12240
12241 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12242
12243 * lisp.h (eassert): Assume C89 or later.
12244 This removes the need for CHECK.
12245 (CHECK): Remove. Its comments about always evaluating its
12246 argument were confusing, as 'eassert' typically does not evaluate
12247 its argument.
12248
12249 * coding.c (produce_chars): Use ptrdiff_t, not int.
12250
12251 * xterm.c (x_draw_underwave): Check for integer overflow.
12252 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12253
12254 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12255
12256 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12257 referenced (Bug#11583).
12258
12259 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12260
12261 Implement wave-style variant of underlining.
12262 * dispextern.h (face_underline_type): New enum.
12263 (face): Add field for underline type.
12264 * nsterm.m (ns_draw_underwave): New function.
12265 (ns_draw_text_decoration): Use it.
12266 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12267 New functions.
12268 (x_draw_glyph_string): Use them.
12269 * xfaces.c (Qline, Qwave): New Lisp objects.
12270 (check_lface_attrs, merge_face_ref)
12271 (Finternal_set_lisp_face_attribute, realize_x_face):
12272 Handle wave-style underline face attributes.
12273 * xterm.c (x_draw_underwave): New function.
12274 (x_draw_glyph_string): Use it.
12275
12276 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
12277
12278 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12279 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12280 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12281 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12282 ($(BLD)/w32select.$(O)): Update dependencies.
12283
12284 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12285
12286 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12287 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12288 * character.c (_fetch_multibyte_char_p): Remove.
12289 * alloc.c: Include "character.h" before "buffer.h".
12290 * bidi.c: Likewise.
12291 * buffer.c: Likewise.
12292 * bytecode.c: Likewise.
12293 * callint.c: Likewise.
12294 * callproc.c: Likewise.
12295 * casefiddle.c: Likewise.
12296 * casetab.c: Likewise.
12297 * category.c: Likewise.
12298 * cmds.c: Likewise.
12299 * coding.c: Likewise.
12300 * composite.c: Likewise.
12301 * dired.c: Likewise.
12302 * dispnew.c: Likewise.
12303 * doc.c: Likewise.
12304 * dosfns.c: Likewise.
12305 * editfns.c: Likewise.
12306 * emacs.c: Likewise.
12307 * fileio.c: Likewise.
12308 * filelock.c: Likewise.
12309 * font.c: Likewise.
12310 * fontset.c: Likewise.
12311 * fringe.c: Likewise.
12312 * indent.c: Likewise.
12313 * insdel.c: Likewise.
12314 * intervals.c: Likewise.
12315 * keyboard.c: Likewise.
12316 * keymap.c: Likewise.
12317 * lread.c: Likewise.
12318 * macros.c: Likewise.
12319 * marker.c: Likewise.
12320 * minibuf.c: Likewise.
12321 * nsfns.m: Likewise.
12322 * nsmenu.m: Likewise.
12323 * print.c: Likewise.
12324 * process.c: Likewise.
12325 * regex.c: Likewise.
12326 * region-cache.c: Likewise.
12327 * search.c: Likewise.
12328 * syntax.c: Likewise.
12329 * term.c: Likewise.
12330 * textprop.c: Likewise.
12331 * undo.c: Likewise.
12332 * unexsol.c: Likewise.
12333 * w16select.c: Likewise.
12334 * w32fns.c: Likewise.
12335 * w32menu.c: Likewise.
12336 * window.c: Likewise.
12337 * xdisp.c: Likewise.
12338 * xfns.c: Likewise.
12339 * xmenu.c: Likewise.
12340 * xml.c: Likewise.
12341 * xselect.c: Likewise.
12342
12343 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12344
12345 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12346 If all the glyphs of the glyph row came from strings, and we have no
12347 cursor positioning clues, put the cursor on the first glyph of the
12348 row.
12349 (handle_face_prop): Use chunk-relative overlay string index when
12350 indexing into it->string_overlays array. (Bug#11653)
12351 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12352 the rightmost. (Bug#11720)
12353
12354 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12355
12356 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12357 (CATEGORY_MEMBER): Enforce 1/0 value.
12358 * category.c (_temp_category_set): Remove.
12359
12360 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12361
12362 * window.c (Fdelete_other_windows_internal)
12363 (Fdelete_window_internal): Don't access frame's mouse highlight
12364 info of the initial frame. (Bug#11677)
12365
12366 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12367
12368 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12369 Assume USE_2_TAGS_FOR_INTS.
12370 (xreload): Adjust $tagmask width to match recent lisp.h change.
12371
12372 Simplify lisp.h in minor ways that should not affect code.
12373 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12374 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12375 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12376 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12377 (INTTYPEBITS): New macro, for clarity.
12378 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12379 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12380 Simplify now that USE_LSB_TAG is always defined.
12381 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12382 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12383
12384 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12385
12386 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12387
12388 2012-06-13 Glenn Morris <rgm@gnu.org>
12389
12390 * s/bsd-common.h (BSD4_3):
12391 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12392
12393 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12394
12395 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12396 instead of union.
12397 (XLI, XIL): Define.
12398 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12399 Use them.
12400 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12401 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12402 * alloc.c (widen_to_Lisp_Object): Remove.
12403 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12404 * frame.c (delete_frame): Remove outdated comment.
12405 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12406 USE_LISP_UNION_TYPE.
12407 (Fw32_unregister_hot_key): Likewise.
12408 (Fw32_toggle_lock_key): Likewise.
12409 * w32menu.c (add_menu_item): Likewise.
12410 (w32_menu_display_help): Use XIL instead of checking
12411 USE_LISP_UNION_TYPE.
12412 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12413 (init_heap): Likewise.
12414 * w32term.c (w32_read_socket): Update comment.
12415
12416 2012-06-13 Glenn Morris <rgm@gnu.org>
12417
12418 * s/usg5-4-common.h, src/s/unixware.h:
12419 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12420
12421 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12422
12423 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12424
12425 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12426 * alloc.c (make_number) [!defined make_number]:
12427 Remove, as lisp.h always defines this now.
12428 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12429 (roundup_size): Verify that it is a power of 2.
12430 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12431 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12432 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12433 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12434 USE_LSB_TAG now is always defined to be either 0 or 1.
12435 All uses changed.
12436 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12437 code works fine either way, and efficiency is not a concern here,
12438 as the union type is for debugging, not for production.
12439 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12440 Use an inline function on all platforms when using the union type,
12441 since this is simpler and 'static inline' can be used portably
12442 within Emacs now.
12443 (LISP_INITIALLY_ZERO): New macro.
12444 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12445 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12446
12447 2012-06-12 Glenn Morris <rgm@gnu.org>
12448
12449 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12450
12451 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12452
12453 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12454 Move BROKEN_SIGIO to configure.
12455
12456 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12457 Move NO_TERMIO to configure.
12458
12459 2012-06-12 Chong Yidong <cyd@gnu.org>
12460
12461 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12462 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12463 MagickExportImagePixels is undefined.
12464
12465 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12466
12467 * image.c (imagemagick_load_image): Remove unused label.
12468
12469 2012-06-11 Glenn Morris <rgm@gnu.org>
12470
12471 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12472 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12473 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12474 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12475
12476 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12477
12478 * alloc.c (make_byte_code): New function.
12479 (Fmake_byte_code): Use it. Don't purify here.
12480 * lread.c (read1): Use it as well to avoid extra allocation.
12481
12482 2012-06-11 Chong Yidong <cyd@gnu.org>
12483
12484 * image.c (imagemagick_load_image): Implement transparency.
12485
12486 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12487
12488 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12489 account for preceding backslashes. (Bug#11663)
12490
12491 2012-06-09 Chong Yidong <cyd@gnu.org>
12492
12493 * term.c: Support italics in capable terminals (Bug#9652).
12494 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12495 (turn_on_face): Output using TS_enter_italic_mode if available.
12496 Don't handle unused blinking and alt-charset cases.
12497 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12498 and tty_alt_charset_p cases.
12499 (tty_capable_p, init_tty): Support italics.
12500
12501 * termchar.h (struct tty_display_info): Add field for italics.
12502 Remove unused blink field.
12503
12504 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12505 Handle slant.
12506
12507 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12508 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12509 tty_alt_charset_p. Add tty_italic_p.
12510
12511 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12512
12513 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12514 dbus_type_is_basic if available.
12515 (xd_extract_signed, xd_extract_unsigned): Rename from
12516 extract_signed and extract_unsigned, respectively. Adapt callers.
12517
12518 2012-06-09 Chong Yidong <cyd@gnu.org>
12519
12520 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12521
12522 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12523 case (Bug#9752).
12524
12525 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12526
12527 * xdisp.c (vmessage): Treat frame message as multibyte.
12528 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12529 would generate the diagnostic "Making \302\247 buffer-local while
12530 let-bound!".
12531
12532 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12533
12534 * dispnew.c (showing_window_margins_p): Undo last change, which
12535 was done due to an inadvertent commit.
12536 (adjust_frame_glyphs_for_frame_redisplay): Do call
12537 showing_window_margins_p.
12538
12539 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12540
12541 * eval.c (Fmake_var_non_special): New primitive.
12542 (syms_of_eval): Defsubr it.
12543 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12544
12545 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12546
12547 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12548 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12549
12550 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12551
12552 * alloc.c (allocate_vectorlike): Fix last change.
12553
12554 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12555
12556 Block-based vector allocation of small vectors.
12557 * lisp.h (struct vectorlike_header): New field `nbytes',
12558 adjust comment accordingly.
12559 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12560 to denote vector blocks. Adjust users (live_vector_p,
12561 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12562 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12563 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12564 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12565 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12566 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12567 (roundup_size): New constant.
12568 (struct vector_block): New data type.
12569 (vector_blocks, vector_free_lists, zero_vector): New variables.
12570 (all_vectors): Rename to `large_vectors'.
12571 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12572 (sweep_vectors): New functions.
12573 (allocate_vectorlike): Return `zero_vector' as the only vector of
12574 0 items. Allocate new vector from block if vector size is less than
12575 or equal to VBLOCK_BYTES_MAX.
12576 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12577 (init_alloc_once): Add call to init_vectors.
12578
12579 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12580
12581 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12582
12583 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12584
12585 * doprnt.c (doprnt): Truncate multibyte char correctly.
12586 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12587 would mishandle a string argument "Xc" if X was a multibyte
12588 character of length 2: it would truncate after X's first byte
12589 rather than including all of X.
12590
12591 2012-06-06 Chong Yidong <cyd@gnu.org>
12592
12593 * buffer.c (word_wrap): Doc fix.
12594
12595 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12596
12597 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12598
12599 2012-06-03 Glenn Morris <rgm@gnu.org>
12600
12601 * xdisp.c (tool-bar-style): Doc fix.
12602
12603 2012-06-03 Ulrich Müller <ulm@gentoo.org>
12604
12605 * Makefile.in (PAXCTL): Define.
12606 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12607 binary via PaX flags if the paxctl utility is available.
12608 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12609 Restore PaX flags to their default. (Bug#11398)
12610
12611 2012-06-03 Chong Yidong <cyd@gnu.org>
12612
12613 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12614 buffer (Bug#11226).
12615
12616 2012-06-03 Chong Yidong <cyd@gnu.org>
12617
12618 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12619 (note_mode_line_or_margin_highlight): If there is no help echo,
12620 use mode-line-default-help-echo. Handle the case where the mouse
12621 position is past the end of the mode line string.
12622
12623 * buffer.c (buffer_local_value_1): New function, split from
12624 Fbuffer_local_value; can return Qunbound.
12625 (Fbuffer_local_value): Use it.
12626 (Vmode_line_format): Docstring tweaks.
12627
12628 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12629
12630 * sysdep.c (system_process_attributes): Improve comment.
12631
12632 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12633
12634 * keyboard.c: Export real-this-command to Elisp.
12635 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12636 and DEFVAR it. Update all users.
12637
12638 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12639
12640 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12641
12642 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12643 Convert pctcpu and pctmem to Lisp float properly.
12644 Let the compiler fold better, as 100.0/0x8000 is exact.
12645
12646 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12647
12648 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12649 cons_block.
12650
12651 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12652
12653 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12654
12655 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12656
12657 For a 'struct window', replace some Lisp_Object fields to
12658 bitfields where appropriate, remove unused fields.
12659 * window.h (struct window): Remove unused 'last_mark_x' and
12660 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
12661 change its type from Lisp_Object to bitfield.
12662 Change type of 'force_start', 'optional_new_start',
12663 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
12664 fields from Lisp_Object to bitfield. Adjust users accordingly.
12665
12666 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12667
12668 Pacify gcc -Wdouble-precision when using Xaw.
12669 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12670 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12671 Use 'float' consistently, rather than 'float' in most places
12672 and 'double' in a couple of places.
12673
12674 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12675
12676 * xdisp.c (handle_stop): Detect whether we have overlay strings
12677 loaded by testing it->current.overlay_string_index to be
12678 non-negative, instead of checking whether n_overlay_strings is
12679 positive. (Bug#11587)
12680
12681 2012-05-31 Chong Yidong <cyd@gnu.org>
12682
12683 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12684
12685 * doc.c (Fsubstitute_command_keys): Doc fix.
12686
12687 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12688
12689 * search.c (search_buffer): Remove calls to
12690 r_alloc_inhibit_buffer_relocation, as it is now called by
12691 maybe_unify_char, which was the cause of relocation of buffer text
12692 in bug#11519.
12693
12694 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12695
12696 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12697 for the duration of call to load_charset, to avoid problems with
12698 callers of maybe_unify_char that access buffer text through C
12699 pointers.
12700
12701 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12702 decrement the inhibition flag, instead of just setting or
12703 resetting it.
12704
12705 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12706
12707 Remove obsolete '#define static' cruft.
12708 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12709 This #undef was "temporary" in 2000; it is no longer needed
12710 now that '#define static' has gone away.
12711 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12712 (gray_bitmap_bits): Remove; no longer needed.
12713 All uses replaced with definiens.
12714 * xterm.c: Include "bitmaps/gray.xbm".
12715
12716 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12717
12718 Clean up __executable_start, monstartup when --enable-profiling.
12719 The following changes affect the code only when profiling.
12720 * dispnew.c (__executable_start): Rename from safe_bcopy.
12721 Define only on platforms that need it.
12722 * emacs.c: Include <sys/gmon.h> when profiling.
12723 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12724 (__executable_start): Remove decl, since lisp.h does it now.
12725 (safe_bcopy): Remove decl; no longer has that name.
12726 (main): Coalesce #if into single bit of code, for simplicity.
12727 Cast pointers to uintptr_t, since standard libraries want integers
12728 and not pointers.
12729 * lisp.h (__executable_start): New decl.
12730
12731 2012-05-31 Glenn Morris <rgm@gnu.org>
12732
12733 * image.c (Fimagemagick_types): Doc fix.
12734
12735 2012-05-30 Jim Meyering <meyering@redhat.com>
12736
12737 * callproc.c (Fcall_process_region): Include directory component
12738 in mkstemp error message (Bug#11586).
12739
12740 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12741
12742 * alloc.c, lisp.h (make_pure_vector): Now static.
12743
12744 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12745
12746 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12747 Move to byte-run.el.
12748 (Fautoload): Do the hash-doc more carefully.
12749 * data.c (Fdefalias): Purify definition, except for keymaps.
12750 (Qdefun): Move from eval.c.
12751 * lisp.h (Qdefun): Remove.
12752 * lread.c (read1): Tiny simplification.
12753
12754 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
12755
12756 Do not create empty overlays with the evaporate property (Bug#9642).
12757 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12758 Bug#9642, but explicitly check that the buffer the overlay would
12759 be moved to is live and rearrange lines to make sure that errors
12760 will not put the overlay in an inconsistent state.
12761 (Fdelete_overlay): Cosmetics.
12762
12763 2012-05-28 Eli Zaretskii <eliz@gnu.org>
12764
12765 * w32term.c (my_bring_window_to_top): New function.
12766 (x_raise_frame): Use handle returned by DeferWindowPos, which
12767 could be different from the original one.
12768 Call my_bring_window_to_top instead of my_set_foreground_window.
12769 (Bug#11513)
12770
12771 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12772 by calling BringWindowToTop.
12773
12774 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12775 (WM_EMACS_END): Increase by one.
12776
12777 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12778
12779 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12780 This avoids undefined behavior that might cause the eassert
12781 to not catch an out-of-range value.
12782
12783 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
12784
12785 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12786 Update dependencies.
12787
12788 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12789
12790 * bidi.c (bidi_mirror_char): Fix last change.
12791
12792 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12793
12794 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12795 when referring to sectname field in printf format.
12796
12797 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12798
12799 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12800 Only r_alloc_inhibit_buffer_relocation needed to be added;
12801 the others were already declared.
12802
12803 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12804 before checking whether it's out of range. Put the check inside
12805 eassert. See
12806 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12807
12808 2012-05-27 Ken Brown <kbrown@cornell.edu>
12809
12810 * callproc.c (Fcall_process): Restore a line that was accidentally
12811 commented out in the 2011-02-13 change (bug#11547).
12812
12813 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12814
12815 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12816 defined on ralloc.c.
12817
12818 * buffer.c [REL_ALLOC]: Remove prototypes of
12819 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12820 they are now on lisp.h.
12821
12822 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12823
12824 * search.c (search_buffer): Use it to inhibit relocation of buffer
12825 text while re_search_2 is doing its job, because re_search_2 is
12826 passed C pointers to buffer text. (Bug#11519)
12827
12828 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12829 Update value to 24.
12830
12831 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12832 state after an additional call to move_it_in_display_line_to, keep
12833 the values of it->max_ascent and it->max_descent found for the
12834 entire line.
12835 (pos_visible_p): Revert the comparison against bottom_y to what it
12836 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12837 (Bug#11464)
12838
12839 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12840
12841 Fix coding-related core dumps with gcc -ftrapv.
12842 The code was computing A - B, where A and B are pointers, and B is
12843 random garbage. This can lead to core dumps on platforms that
12844 have special pointer registers, and it also leads to core dumps on
12845 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12846 A - B only when B is initialized properly.
12847 * coding.c (coding_set_source, coding_set_destination): Return void.
12848 (coding_change_source, coding_change_destinations): New functions,
12849 with the old behaviors of coding_set_source and coding_set_destination.
12850 All callers that need an offset changed to use these new functions.
12851
12852 2012-05-26 Glenn Morris <rgm@gnu.org>
12853
12854 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12855
12856 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12857
12858 Extend mouse support on W32 text-mode console.
12859 * xdisp.c (draw_row_with_mouse_face):
12860 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
12861
12862 * w32console.c: Include window.h.
12863 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12864 New functions.
12865 (initialize_w32_display): Initialize mouse-highlight data.
12866
12867 * w32inevt.c: Include termchar.h and window.h.
12868 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12869 moves, call note_mouse_highlight. If help_echo changed, call
12870 gen_help_event to produce help-echo message in the echo area.
12871 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12872 highlight info.
12873
12874 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12875
12876 * lread.c (read1): Simplify slightly to avoid an overflow warning
12877 with GCC 4.7.0 on x86-64.
12878
12879 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12880
12881 * bidi.c (bidi_mirror_char): Revert last change: an int is
12882 definitely wide enough here.
12883
12884 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
12885
12886 Fix integer width and related bugs (Bug#9874).
12887 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
12888 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12889 (string_bytes, check_sblock, allocate_string_data):
12890 (compact_small_strings, Fmake_bool_vector, make_string)
12891 (make_unibyte_string, make_multibyte_string)
12892 (make_string_from_bytes, make_specified_string)
12893 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12894 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12895 (mark_vectorlike):
12896 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12897 (allocate_pseudovector):
12898 Use int, not EMACS_INT, where int is wide enough.
12899 (inhibit_garbage_collection, Fgarbage_collect):
12900 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12901 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12902 int might not be wide enough.
12903 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12904 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12905 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12906 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12907 (bidi_level_of_next_char, bidi_move_to_visually_next):
12908 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12909 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12910 (Fkill_buffer, Fset_buffer_major_mode)
12911 (advance_to_char_boundary, Fbuffer_swap_text)
12912 (Fset_buffer_multibyte, overlays_at, overlays_in)
12913 (overlay_touches_p, struct sortvec, record_overlay_string)
12914 (overlay_strings, recenter_overlay_lists)
12915 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12916 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12917 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12918 (Foverlay_recenter, last_overlay_modification_hooks_used)
12919 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12920 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12921 (validate_region): Omit unnecessary test for b <= e,
12922 since that's guaranteed by the previous test.
12923 (adjust_overlays_for_delete): Avoid pos + length overflow.
12924 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12925 (report_overlay_modification):
12926 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12927 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12928 Omit pointer cast, which isn't needed anyway, and doesn't work
12929 after the EMACS_INT -> ptrdiff_t change.
12930 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
12931 * buffer.h: Adjust decls to match defn changes elsewhere.
12932 (struct buffer_text, struct buffer):
12933 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12934 Use EMACS_INT, not int, where int might not be wide enough.
12935 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12936 not int, to avoid needless 32-bit limit on 64-bit hosts.
12937 (exec_byte_code): Use tighter memory-full test, one that checks
12938 for alloca overflow. Don't compute the address of the object just
12939 before an array, as that's not portable. Use EMACS_INT, not
12940 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
12941 * callint.c (Fcall_interactively):
12942 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12943 * callproc.c (call_process_kill, Fcall_process):
12944 Don't assume pid_t fits into an Emacs fixnum.
12945 (call_process_cleanup, Fcall_process, child_setup):
12946 Don't assume pid_t fits into int.
12947 (call_process_cleanup, Fcall_process, delete_temp_file)
12948 (Fcall_process_region):
12949 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12950 (Fcall_process): Simplify handling of volatile integers.
12951 Use int, not EMACS_INT, where int will do.
12952 * casefiddle.c (casify_object, casify_region, operate_on_word)
12953 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12954 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12955 (casify_object): Avoid integer overflow when overallocating buffer.
12956 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
12957 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
12958 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12959 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12960 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12961 integers are now checked earlier. All uses replaced with XINT.
12962 (ccl_driver):
12963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12964 For CCL_MapSingle, check that content and value are in int range.
12965 (ccl_driver, Fregister_code_conversion_map):
12966 Check that Vcode_version_map_vector is a vector.
12967 (resolve_symbol_ccl_program): Check that vector header is in range.
12968 Always copy the vector, so that we can check its contents reliably
12969 now rather than having to recheck each instruction as it's being
12970 executed. Check that vector words fit in 'int'.
12971 (ccl_get_compiled_code, Fregister_ccl_program)
12972 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12973 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12974 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12975 contents are in range.
12976 (Fccl_execute_on_string): Check that status is in range.
12977 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12978 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12979 Accept and return EMACS_INT, not int, because callers can pass values
12980 out of 'int' range.
12981 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12982 (multibyte_chars_in_text, parse_str_as_multibyte)
12983 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12984 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12985 (string_escape_byte8, Fget_byte):
12986 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12987 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
12988 avoid mishandling large integers.
12989 * character.h: Adjust decls to match defn changes elsewhere.
12990 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12991 (Ffind_charset_region):
12992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12993 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12994 (load_charset_map_from_vector, Fdefine_charset_internal):
12995 Don't assume fixnum fits in int.
12996 (load_charset_map_from_vector, Fmap_charset_chars):
12997 Remove now-unnecessary CHECK_NATNUMs.
12998 (Fdefine_charset_internal): Check ranges here, more carefully.
12999 Don't rely on undefined behavior with signed left shift overflow.
13000 Don't assume unsigned int fits into fixnum, or that fixnum fits
13001 into unsigned int. Don't require max_code to be a valid fixnum;
13002 that's not true for gb10830 4-byte on a 32-bit host. Allow
13003 invalid_code to be a cons, for the same reason. Require code_offset
13004 to be a character. Avoid int overflow if max_char is close
13005 to INT_MAX.
13006 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
13007 this is intended anyway and avoids some undefined behavior.
13008 (load_charset_map): Pass unsigned, not int, as 2nd arg of
13009 INDEX_TO_CODE_POINT, as that's what it expects.
13010 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
13011 * charset.h (DECODE_CHAR): Return int, not unsigned;
13012 this is what was intended anyway, and it avoids undefined behavior.
13013 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
13014 integer-overflow issues.
13015 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
13016 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
13017 where the argument is EMACS_INT, and this behavior is not intended.
13018 * chartab.c (Fmake_char_table, Fset_char_table_range)
13019 (uniprop_get_decoder, uniprop_get_encoder):
13020 Don't assume fixnum fits in int.
13021 * cmds.c (move_point): New function, that does the gist of
13022 Fforward_char and Fbackward_char, but does so while checking
13023 for integer overflow more accurately.
13024 (Fforward_char, Fbackward_char): Use it.
13025 (Fforward_line, Fend_of_line, internal_self_insert)
13026 (internal_self_insert):
13027 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13028 Fix a FIXME, by checking for integer overflow when calculating
13029 target_clm and actual_clm.
13030 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
13031 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
13032 (ASSURE_DESTINATION, coding_alloc_by_realloc)
13033 (coding_alloc_by_making_gap, alloc_destination)
13034 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
13035 (encode_coding_utf_16, detect_coding_emacs_mule)
13036 (decode_coding_emacs_mule, encode_coding_emacs_mule)
13037 (detect_coding_iso_2022, decode_coding_iso_2022)
13038 (encode_invocation_designation, encode_designation_at_bol)
13039 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13040 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13041 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13042 (encode_coding_ccl, encode_coding_raw_text)
13043 (detect_coding_charset, decode_coding_charset)
13044 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13045 (produce_composition, produce_charset, produce_annotation)
13046 (decode_coding, handle_composition_annotation)
13047 (handle_charset_annotation, consume_chars, decode_coding_gap)
13048 (decode_coding_object, encode_coding_object, detect_coding_system)
13049 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13050 (code_convert_region, code_convert_string)
13051 (Fdefine_coding_system_internal)
13052 (coding_set_source, coding_set_destination):
13053 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13054 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13055 (Fdefine_coding_system_internal):
13056 Don't assume fixnums fit in int.
13057 (decode_coding_gap, decode_coding_object, encode_coding_object)
13058 (Fread_coding_system, Fdetect_coding_region)
13059 (Funencodable_char_position, Fcheck_coding_systems_region)
13060 (get_translation, handle_composition_annotation, consume_chars):
13061 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13062 (consume_chars): Rewrite to not calculate an address outside buffer.
13063 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
13064 Don't access memory outside of the args array.
13065 (Fdefine_coding_system_internal): Check for charset-id overflow.
13066 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13067 result of ENCODE_CHAR.
13068 * coding.h: Adjust decls to match defn changes elsewhere.
13069 (struct coding_system):
13070 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13071 * composite.c (get_composition_id, find_composition)
13072 (run_composition_function, update_compositions)
13073 (compose_text, composition_gstring_put_cache)
13074 (composition_gstring_p, composition_gstring_width)
13075 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13076 (composition_compute_stop_pos, composition_reseat_it)
13077 (composition_update_it, struct position_record)
13078 (find_automatic_composition, composition_adjust_point)
13079 (Fcomposition_get_gstring, Ffind_composition_internal):
13080 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13081 (update_compositions):
13082 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13083 * composite.h: Adjust decls to match defn changes elsewhere.
13084 (struct composition):
13085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13086 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13087 Do not attempt to compute the address of the object just before a
13088 buffer; this is not portable.
13089 (Faref, Faset):
13090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13091 (Faset): Use int, not EMACS_INT, where int is wide enough.
13092 (Fstring_to_number): Don't assume fixnums fit in int.
13093 (Frem): Don't assume arg is nonnegative.
13094 * dbusbind.c (xd_append_arg): Check for integers out of range.
13095 (Fdbus_call_method): Don't overflow the timeout int.
13096 (extract_signed, extract_unsigned): New functions.
13097 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13098 (xd_get_connection_references): Return ptrdiff_t, not int.
13099 All uses changed.
13100 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13101 (xd_read_message_1):
13102 Use int, not unsigned, where the dbus API uses int.
13103 (Fdbus_message_internal): Don't overflow mtype.
13104 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13105 * dired.c (directory_files_internal, file_name_completion, scmp)
13106 (file_name_completion_stat):
13107 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13108 (file_name_completion): Don't overflow matchcount.
13109 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13110 * dispextern.h: Adjust decls to match defn changes elsewhere.
13111 (struct text_pos, struct glyph, struct bidi_saved_info)
13112 (struct bidi_string_data, struct bidi_it, struct composition_it)
13113 (struct it):
13114 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13115 (struct display_pos, struct composition_it, struct it):
13116 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13117 * dispnew.c (increment_matrix_positions)
13118 (increment_row_positions, mode_line_string)
13119 (marginal_area_string):
13120 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13121 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13122 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13123 (duration_to_sec_usec): New function, to check for overflow better.
13124 (Fsleep_for, sit_for): Use it.
13125 * doc.c (get_doc_string, store_function_docstring):
13126 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13127 (get_doc_string, Fsnarf_documentation):
13128 Use int, not EMACS_INT, where int is wide enough.
13129 (get_doc_string):
13130 Use SAFE_ALLOCA, not alloca.
13131 Check for overflow when converting EMACS_INT to off_t.
13132 * doprnt.c (doprnt):
13133 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13134 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13135 Don't assume uid_t fits into fixnum.
13136 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13137 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13138 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13139 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13140 (general_insert_function)
13141 (Finsert_char, make_buffer_string, make_buffer_string_both)
13142 (update_buffer_properties, Fbuffer_substring)
13143 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13144 (Fsubst_char_in_region, check_translation)
13145 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13146 (transpose_markers, Ftranspose_regions):
13147 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13148 (clip_to_bounds): Move to lisp.h as an inline function).
13149 (Fconstrain_to_field): Don't assume integers are nonnegative.
13150 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13151 (Fsubst_char_in_region, Fsave_restriction):
13152 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13153 (Femacs_pid): Don't assume pid_t fits into fixnum.
13154 (lo_time): Use int, not EMACS_INT, when int suffices.
13155 (lisp_time_argument): Check for usec out of range.
13156 (Fencode_time): Don't assume fixnum fits in int.
13157 (Fuser_login_name, Fuser_full_name): Signal an error
13158 if a uid argument is out of range, rather than relying on
13159 undefined behavior.
13160 (Fformat_time_string): Remove now-unnecessary check.
13161 lisp_time_argument checks for out-of-range usec now.
13162 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13163 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13164 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13165 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13166 (init_cmdargs, Fdump_emacs):
13167 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13168 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13169 the bottom (typically) 32 bits of the fixnum.
13170 * eval.c (specpdl_size, call_debugger):
13171 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13172 (when_entered_debugger, Fbacktrace_debug):
13173 Don't assume fixnum can fit in int.
13174 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13175 the object just before a buffer; this is not portable.
13176 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13177 (grow_specpdl, unbind_to):
13178 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13179 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13180 (grow_specpdl): Simplify allocation by using xpalloc.
13181 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13182 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13183 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13184 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13185 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13186 (a_write, e_write):
13187 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13188 (Fcopy_file, non_regular_nbytes, read_non_regular)
13189 (Finsert_file_contents):
13190 Use int, not EMACS_INT, where int is wide enough.
13191 (READ_BUF_SIZE): Verify that it fits in int.
13192 (Finsert_file_contents): Check that counts are in proper range,
13193 rather than assuming fixnums fit into ptrdiff_t etc.
13194 Don't assume fixnums fit into int.
13195 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13196 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13197 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13198 (string_char_to_byte, string_byte_to_char)
13199 (string_make_multibyte, string_to_multibyte)
13200 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13201 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13202 (substring_both, Fdelete, internal_equal, Ffillarray)
13203 (Fclear_string, mapcar1)
13204 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13205 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13206 (larger_vector, make_hash_table, maybe_resize_hash_table)
13207 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13208 (Fmaphash, secure_hash):
13209 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13210 (concat): Check for string index and length overflow.
13211 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13212 (Frequire):
13213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13214 (larger_vector): New API (vec, incr_min, size_max) replaces old
13215 one (vec, new_size, init). This catches size overflow.
13216 INIT was removed because it was always Qnil.
13217 All callers changed.
13218 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13219 the upper bound on a hash table index size.
13220 (make_hash_table, maybe_resize_hash_table): Use it.
13221 (secure_hash): Computer start_byte and end_byte only after
13222 they're known to be in ptrdiff_t range.
13223 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13224 (Ffont_get_glyphs, Ffont_at):
13225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13226 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13227 (Flist_fonts, Fopen_font):
13228 Don't assume fixnum can fit in int.
13229 (check_gstring): Don't assume index can fit in int.
13230 (font_match_p): Check that fixnum is a character, not a nonnegative
13231 fixnum, since the later code needs to stuff it into an int.
13232 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13233 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13234 conversion overflow issues.
13235 (Fopen_font): Check for integer out of range.
13236 (Ffont_get_glyphs): Don't assume index can fit in int.
13237 * font.h: Adjust decls to match defn changes elsewhere.
13238 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13239 integer overflow.
13240 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13241 printmax_t, where ptrdiff_t is wide enough.
13242 (Finternal_char_font):
13243 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13244 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13245 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13246 (Fset_frame_position, x_set_frame_parameters)
13247 (x_set_line_spacing, x_set_border_width)
13248 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13249 Check that fixnums are in proper range for system types.
13250 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13252 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13253 Use SAFE_ALLOCA_LISP, not alloca.
13254 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13255 intptr_t is wide enough.
13256 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13257 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13258 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13259 Check for fixnum out of range.
13260 * ftfont.c (ftfont_list): Don't assume index fits in int.
13261 Check that fixnums are in proper range for system types.
13262 (ftfont_shape_by_flt):
13263 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13264 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13265 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13266 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13267 Check that fixnums are in proper range for system types.
13268 * gnutls.h: Adjust decls to match defn changes elsewhere.
13269 * gtkutil.c (xg_dialog_run):
13270 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13271 (update_frame_tool_bar):
13272 Check that fixnums are in proper range for system types.
13273 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13274 (lookup_image): Check that fixnums are in range for system types.
13275 * indent.c (last_known_column, last_known_column_point):
13276 (current_column_bol_cache):
13277 (skip_invisible, current_column, check_display_width):
13278 (check_display_width, scan_for_column, current_column_1)
13279 (Findent_to, Fcurrent_indentation, position_indentation)
13280 (indented_beyond_p, Fmove_to_column, compute_motion):
13281 (Fcompute_motion, Fvertical_motion):
13282 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13283 (last_known_column_modified): Use EMACS_INT, not int.
13284 (check_display_width):
13285 (Fcompute_motion):
13286 Check that fixnums and floats are in proper range for system types.
13287 (compute_motion): Don't assume index or fixnum fits in int.
13288 (compute_motion, Fcompute_motion):
13289 Use int, not EMACS_INT, when it is wide enough.
13290 (vmotion): Omit local var start_hpos that is always 0; that way
13291 we don't need to worry about overflow in expressions involving it.
13292 * indent.h: Adjust decls to match defn changes elsewhere.
13293 (struct position):
13294 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13295 Use int, not EMACS_INT, where int is wide enough.
13296 Remove unused members ovstring_chars_done and tab_offset;
13297 all uses removed.
13298 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13299 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13300 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13301 (make_gap, copy_text, insert, insert_and_inherit)
13302 (insert_before_markers, insert_before_markers_and_inherit)
13303 (insert_1, count_combining_before, count_combining_after)
13304 (insert_1_both, insert_from_string)
13305 (insert_from_string_before_markers, insert_from_string_1)
13306 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13307 (adjust_after_replace, adjust_after_insert, replace_range)
13308 (replace_range_2, del_range, del_range_1, del_range_byte)
13309 (del_range_both, del_range_2, modify_region)
13310 (prepare_to_modify_buffer, signal_before_change)
13311 (signal_after_change, Fcombine_after_change_execute):
13312 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13313 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13314 (balance_an_interval, split_interval_right, split_interval_left)
13315 (find_interval, next_interval, update_interval)
13316 (adjust_intervals_for_insertion, delete_node, delete_interval)
13317 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13318 (static_offset_intervals, offset_intervals)
13319 (merge_interval_right, merge_interval_left, make_new_interval)
13320 (graft_intervals_into_buffer, temp_set_point_both)
13321 (temp_set_point, set_point, adjust_for_invis_intang)
13322 (set_point_both, move_if_not_intangible, get_property_and_range)
13323 (get_local_map, copy_intervals, copy_intervals_to_string)
13324 (compare_string_intervals, set_intervals_multibyte_1):
13325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13326 * intervals.h: Adjust decls to match defn changes elsewhere.
13327 (struct interval):
13328 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13329 * keyboard.c (this_command_key_count, this_single_command_key_start)
13330 (before_command_key_count, before_command_echo_length, echo_now)
13331 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13332 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13333 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13334 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13336 (last_non_minibuf_size, last_point_position, echo_truncate)
13337 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13338 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13339 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13340 (stuff_buffered_input):
13341 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13342 (last_auto_save, command_loop_1, read_char):
13343 Use EMACS_INT, not int, to avoid integer overflow.
13344 (record_char): Avoid overflow in total_keys computation.
13345 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13346 * keyboard.h: Adjust decls to match defn changes elsewhere.
13347 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13348 (Fkey_description, Fdescribe_vector, Flookup_key):
13349 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13350 (click_position): New function, to check that positions are in range.
13351 (Fcurrent_active_maps):
13352 (describe_command):
13353 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13354 (Faccessible_keymaps, Fkey_description):
13355 (preferred_sequence_p):
13356 Don't assume fixnum can fit into int.
13357 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13358 Check for integer overflow in size calculations.
13359 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13360 avoid mishandling large integers.
13361 * lisp.h: Adjust decls to match defn changes elsewhere.
13362 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13363 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13364 (struct Lisp_Marker):
13365 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13366 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13367 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13368 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13369 All callers changed.
13370 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13371 Assume the arg has valid form, since it always does.
13372 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13373 unsigned integer system type.
13374 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13375 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13376 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13377 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13378 (duration_to_sec_usec): New decl.
13379 * lread.c (read_from_string_index, read_from_string_index_byte)
13380 (read_from_string_limit, readchar, unreadchar, openp)
13381 (read_internal_start, read1, oblookup):
13382 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13383 (Fload, readevalloop, Feval_buffer, Feval_region):
13384 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13385 (openp): Check for out-of-range argument to 'access'.
13386 (read1): Use int, not EMACS_INT, where int is wide enough.
13387 Don't assume fixnum fits into int.
13388 Fix off-by-one error that can read outside a buffer.
13389 (read_filtered_event): Use duration_to_sec_usec
13390 to do proper overflow checking on durations.
13391 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13392 in size calculation.
13393 (Fexecute_kbd_macro):
13394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13395 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13396 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13397 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13398 (set_marker_both, set_marker_restricted_both, marker_position)
13399 (marker_byte_position, Fbuffer_has_markers_at):
13400 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13401 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13402 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13403 It now merely ensures that the menu is large enough, without
13404 necessarily growing it, as this avoids some integer overflow issues.
13405 All callers changed.
13406 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13407 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13408 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13409 Use SAFE_ALLOCA_LISP, not alloca.
13410 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13411 to EMACS_INT. Check that fixnums are in proper range for system types.
13412 * minibuf.c (minibuf_prompt_width, string_to_object)
13413 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13414 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13416 (get_minibuffer, read_minibuf_unwind):
13417 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13418 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13419 this simplifies overflow checking. All callers changed.
13420 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13421 (Ftest_completion):
13422 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13423 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13424 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13425 Check that fixnums are in proper range for system types.
13426 (Fx_create_frame, Fx_show_tip):
13427 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13428 * nsfont.m (ns_findfonts, nsfont_list_family):
13429 Don't assume fixnum fits in long.
13430 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13431 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13432 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13433 wide enough.
13434 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13435 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13436 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13437 (PRINTDECLARE, PRINTPREPARE):
13438 (strout, print_string):
13439 (print, print_preprocess, print_check_string_charset_prop)
13440 (print_object):
13441 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13442 (PRINTDECLARE):
13443 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13445 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13446 (printchar, strout): Use xpalloc to catch size calculation overflow.
13447 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13448 (print_error_message): Use SAFE_ALLOCA, not alloca.
13449 (print_object): Use int, not EMACS_INT, where int is wide enough.
13450 (print_depth, new_backquote_output, print_number_index):
13451 Use ptrdiff_t, not int, where int might not be wide enough.
13452 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13453 (Fset_process_window_size, Fformat_network_address)
13454 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13455 (sigchld_handler):
13456 Check that fixnums are in proper range for system types.
13457 (Fsignal_process): Simplify by avoiding a goto.
13458 Check for process-ids out of pid_t range rather than relying on
13459 undefined behavior.
13460 (process_tick, update_tick): Use EMACS_INT, not int.
13461 (Fformat_network_address, read_process_output, send_process)
13462 (Fprocess_send_region, status_notify):
13463 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13464 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13465 (wait_reading_process_output, read_process_output, exec_sentinel):
13466 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13467 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13468 (Faccept_process_output): Use duration_to_sec_usec to do proper
13469 overflow checking on durations.
13470 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13471 Don't assume pid_t fits in int.
13472 * process.h (struct Lisp_Process): Members tick and update_tick
13473 are now of type EMACS_INT, not int.
13474 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13475 configured --with-wide-int.
13476 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13477 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13478 * search.c (looking_at_1, string_match_1):
13479 (fast_string_match, fast_c_string_match_ignore_case)
13480 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13481 (scan_newline, find_before_next_newline, search_command)
13482 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13483 (set_search_regs, wordify):
13484 (Freplace_match):
13485 (Fmatch_data):
13486 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13487 (string_match_1, search_buffer, set_search_regs):
13488 (Fmatch_data):
13489 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13490 (wordify): Check for overflow in size calculation.
13491 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13492 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13493 Check that fixnums are in proper range for system types.
13494 * sound.c (struct sound_device)
13495 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13496 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13497 (Fplay_sound_internal):
13498 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13499 * syntax.c (struct lisp_parse_state, find_start_modiff)
13500 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13501 (Fparse_partial_sexp):
13502 Don't assume fixnums can fit in int.
13503 (struct lisp_parse_state, find_start_pos, find_start_value)
13504 (find_start_value_byte, find_start_begv)
13505 (update_syntax_table, char_quoted, dec_bytepos)
13506 (find_defun_start, prev_char_comend_first, back_comment):
13507 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13508 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13510 (Finternal_describe_syntax_value): Check that match_lisp is a
13511 character, not an integer, since the code stuffs it into int.
13512 (scan_words, scan_sexps_forward):
13513 Check that fixnums are in proper range for system types.
13514 (Fforward_word):
13515 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13516 (scan_sexps_forward):
13517 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13518 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13519 * syntax.h: Adjust decls to match defn changes elsewhere.
13520 (struct gl_state_s):
13521 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13522 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13523 MOST_POSITIVE_FIXNUM.
13524 * sysdep.c (wait_for_termination_1, wait_for_termination)
13525 (interruptible_wait_for_termination, mkdir):
13526 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13527 (emacs_read, emacs_write):
13528 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13529 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13530 and double all fit in int.
13531 * term.c (set_tty_color_mode):
13532 Check that fixnums are in proper range for system types.
13533 * termhooks.h (struct input_event):
13534 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13535 * textprop.c (validate_interval_range, interval_of)
13536 (Fadd_text_properties, set_text_properties_1)
13537 (Fremove_text_properties, Fremove_list_of_text_properties)
13538 (Ftext_property_any, Ftext_property_not_all)
13539 (copy_text_properties, text_property_list, extend_property_ranges)
13540 (verify_interval_modification):
13541 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13542 (Fnext_single_char_property_change)
13543 (Fprevious_single_char_property_change):
13544 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13545 (copy_text_properties):
13546 Check for integer overflow in index calculation.
13547 * undo.c (last_boundary_position, record_point, record_insert)
13548 (record_delete, record_marker_adjustment, record_change)
13549 (record_property_change):
13550 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13551 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13552 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13553 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13554 (Fx_hide_tip, Fx_file_dialog):
13555 * w32menu.c (set_frame_menubar):
13556 Use ptrdiff_t, not int, for consistency with rest of code.
13557 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13558 (select_window, Fdelete_other_windows_internal)
13559 (window_scroll_pixel_based, window_scroll_line_based)
13560 (Frecenter, Fset_window_configuration):
13561 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13562 (Fset_window_hscroll, run_window_configuration_change_hook)
13563 (set_window_buffer, temp_output_buffer_show, scroll_command)
13564 (Fscroll_other_window, Frecenter):
13565 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13566 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13567 Don't assume fixnum fits in int.
13568 (Fset_window_scroll_bars):
13569 Check that fixnums are in proper range for system types.
13570 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13571 (string_pos, c_string_pos, number_of_chars, init_iterator)
13572 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13573 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13574 (compute_display_string_end, handle_face_prop)
13575 (face_before_or_after_it_pos, handle_invisible_prop)
13576 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13577 (display_prop_intangible_p, string_buffer_position_lim)
13578 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13579 (get_overlay_strings_1, get_overlay_strings)
13580 (iterate_out_of_display_property, forward_to_next_line_start)
13581 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13582 (get_next_display_element, set_iterator_to_next)
13583 (get_visually_first_element, compute_stop_pos_backwards)
13584 (handle_stop_backwards, next_element_from_buffer)
13585 (move_it_in_display_line_to, move_it_in_display_line)
13586 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13587 (add_to_log, message_dolog, message_log_check_duplicate)
13588 (message2, message2_nolog, message3, message3_nolog
13589 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13590 (current_message_1, truncate_echo_area, truncate_message_1)
13591 (set_message, set_message_1, store_mode_line_noprop)
13592 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13593 (text_outside_line_unchanged_p, check_point_in_composition)
13594 (reconsider_clip_changes)
13595 (redisplay_internal, set_cursor_from_row, try_scrolling)
13596 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13597 (redisplay_window, find_last_unchanged_at_beg_row)
13598 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13599 (trailing_whitespace_p, find_row_edges, display_line)
13600 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13601 (display_mode_element, store_mode_line_string)
13602 (pint2str, pint2hrstr, decode_mode_spec)
13603 (display_count_lines, display_string, draw_glyphs)
13604 (x_produce_glyphs, x_insert_glyphs)
13605 (rows_from_pos_range, mouse_face_from_buffer_pos)
13606 (fast_find_string_pos, mouse_face_from_string_pos)
13607 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13608 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13609 (safe_call, init_from_display_pos, handle_fontified_prop)
13610 (handle_single_display_spec, load_overlay_strings)
13611 (with_echo_area_buffer, setup_echo_area_for_printing)
13612 (display_echo_area, echo_area_display)
13613 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13614 (update_tool_bar, hscroll_window_tree, redisplay_internal)
13615 (redisplay_window, dump_glyph_row, display_mode_line)
13616 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
13617 (handle_display_spec, display_prop_string_p):
13618 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13619 (handle_single_display_spec, build_desired_tool_bar_string)
13620 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13621 (get_specified_cursor_type):
13622 Check that fixnums are in proper range for system types.
13623 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13624 (Flookup_image_map):
13625 Don't assume fixnums fit in int.
13626 (compare_overlay_entries):
13627 Avoid mishandling comparisons due to subtraction overflow.
13628 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13629 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13630 (handle_tool_bar_click):
13631 Use int, not unsigned, since we prefer signed and the signedness
13632 doesn't matter here.
13633 (get_next_display_element, next_element_from_display_vector):
13634 Use int, not EMACS_INT, when int is wide enough.
13635 (start_hourglass): Use duration_to_sec_usec to do proper
13636 overflow checking on durations.
13637 * xfaces.c (Fbitmap_spec_p):
13638 Check that fixnums are in proper range for system types.
13639 (compare_fonts_by_sort_order):
13640 Avoid mishandling comparisons due to subtraction overflow.
13641 (Fx_family_fonts, realize_basic_faces):
13642 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13643 (Fx_family_fonts):
13644 Don't assume fixnum fits in int.
13645 Use SAFE_ALLOCA_LISP, not alloca.
13646 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13647 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13648 (face_at_buffer_position, face_for_overlay_string)
13649 (face_at_string_position):
13650 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13651 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13652 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13653 (Fx_show_tip):
13654 Check that fixnums are in proper range for system types.
13655 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13656 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13657 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13658 (Fx_change_window_property): Don't assume fixnums fit in int.
13659 * xfont.c (xfont_chars_supported):
13660 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13661 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13662 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13663 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13664 * xml.c (parse_region):
13665 * xrdb.c (magic_file_p):
13666 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13667 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13668 (x_get_local_selection, x_reply_selection_request)
13669 (x_handle_selection_request, wait_for_property_change):
13670 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13671 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13672 short is wide enough.
13673 (x_send_client_event): Don't assume fixnum fits in int.
13674 * xterm.c (x_x_to_emacs_modifiers):
13675 Don't assume EMACS_INT overflows nicely into int.
13676 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13677 may come from Lisp.
13678 (handle_one_xevent): NATNUMP can eval its arg twice.
13679 (x_connection_closed):
13680 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13681 * xterm.h: Adjust decls to match defn changes elsewhere.
13682 (struct scroll_bar): Use struct vectorlike_header
13683 rather than rolling our own approximation.
13684 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13685
13686 2012-05-25 Glenn Morris <rgm@gnu.org>
13687
13688 * lisp.mk (lisp): Update for more files being compiled now.
13689
13690 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13691
13692 * lread.c: Remove `read_pure' which makes no difference.
13693 (read_pure): Remove var.
13694 (unreadpure): Remove function.
13695 (readevalloop): Don't call read_list with -1 flag.
13696 (read1, read_vector): Don't test read_pure any more.
13697 (read_list): Simplify.
13698
13699 * fileio.c, character.h: Minor style tweaks.
13700
13701 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13702
13703 * window.h (clip_changed): Remove useless declaration.
13704
13705 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
13706
13707 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13708 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13709
13710 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13711
13712 Remove src/m/*.
13713 This directory predates autoconf and is no longer needed nowadays.
13714 Move its few remaining bits of functionality to where they're needed.
13715 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13716 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13717 * m/template.h: Remove.
13718 * Makefile.in (M_FILE): Remove. All uses removed.
13719 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13720 * lisp.h (USE_LSB_TAG):
13721 * mem-limits.h (EXCEEDS_LISP_PTR):
13722 Use VAL_MAX, not VALBITS, in #if.
13723 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13724 (EMACS_UINT): Define unconditionally now.
13725 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13726 (BITS_PER_EMACS_INT): New constants, replacing
13727 what used to be in config.h, but not useful in #if.
13728 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13729 define them any more.
13730 (VAL_MAX): New macro.
13731 (VALMASK): Use it.
13732 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13733 BITS_PER_EMACS_INT, in #if.
13734 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13735 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13736 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13737 * s/ms-w32.h (DATA_START):
13738 Move here from removed file m/intel386.h.
13739 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13740 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13741
13742 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13743
13744 Assume C89 or later.
13745 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13746 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13747 (xrealloc):
13748 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13749 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13750 * textprop.c, tparam.c (NULL): Remove.
13751 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13752 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13753 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13754 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13755 * xterm.c (input_signal_count): Assume volatile works.
13756
13757 2012-05-21 Ken Brown <kbrown@cornell.edu>
13758
13759 * xgselect.c (xg_select): Fix first argument in call to 'select'
13760 (bug#11508).
13761
13762 2012-05-20 Ken Brown <kbrown@cornell.edu>
13763
13764 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
13765 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
13766
13767 2012-05-19 Ken Brown <kbrown@cornell.edu>
13768
13769 * xfns.c (x_in_use): Remove `static' qualifier.
13770 * xterm.h (x_in_use): Declare.
13771 * xgselect.c: Include xterm.h.
13772 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13773 and `display_arg' (bug#9754).
13774
13775 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13776
13777 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13778
13779 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13780 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13781
13782 2012-05-18 Eli Zaretskii <eliz@gnu.org>
13783
13784 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13785
13786 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
13787 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
13788
13789 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13790 reference to image_cache->refcount.
13791 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13792
13793 2012-05-17 Juri Linkov <juri@jurta.org>
13794
13795 * search.c (Fword_search_regexp, Fword_search_backward)
13796 (Fword_search_forward, Fword_search_backward_lax)
13797 (Fword_search_forward_lax): Move functions to isearch.el
13798 (bug#10145, bug#11381).
13799
13800 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13801
13802 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13803
13804 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13805
13806 * lread.c (init_obarray): Declare Qt and Qnil as special.
13807
13808 2012-05-14 Glenn Morris <rgm@gnu.org>
13809
13810 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
13811 Put "libexec" before "bin", for the sake of init_callproc_1.
13812
13813 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13814
13815 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13816
13817 * unexaix.c: Port to more-recent AIX compilers.
13818 (report_error, report_error_1, make_hdr, copy_sym)
13819 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13820 Make arguments const char *, not char *, to avoid violations of C
13821 standard and to fix some AIX warnings reported by Gilles Pion.
13822
13823 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13824
13825 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13826 already have overlays loaded.
13827 (handle_single_display_spec): Before returning without displaying
13828 fringe bitmap, synchronize the bidi iterator with the main display
13829 iterator, by calling iterate_out_of_display_property.
13830 (iterate_out_of_display_property): Detect buffer iteration by
13831 testing that it->string is a Lisp string.
13832 (get_next_display_element): When the current object is exhausted,
13833 and there's something on it->stack, call set_iterator_to_next to
13834 proceed with what's on the stack, instead of returning zero.
13835 (set_iterator_to_next): If called at the end of a Lisp string,
13836 proceed to consider_string_end without incrementing string
13837 position. Don't increment display vector index past the end of
13838 the display vector. (Bug#11417)
13839 (pos_visible_p): Don't report a position visible when move_it_to
13840 stopped at the last line of window, which happens to be scanned
13841 backwards by the bidi iteration. (Bug#11464)
13842
13843 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13844
13845 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13846 and right-margin display specs even if the spec is invalid or we
13847 are on a TTY, and thus unable to display on the fringes.
13848 That's because the text with the property will not be displayed anyway,
13849 so we need to signal to the caller that this is a "replacing"
13850 display spec. This fixes display when the spec is invalid or we
13851 are on a TTY.
13852
13853 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13854
13855 * unexaix.c (make_hdr): Fix typo in prototype.
13856 This bug broke the build on AIX. Problem reported by Gilles Pion.
13857
13858 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
13859
13860 * keyboard.c (kbd_buffer_get_event): Read special events also in
13861 batch mode. (Bug#11415)
13862
13863 2012-05-12 Glenn Morris <rgm@gnu.org>
13864
13865 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13866
13867 2012-05-12 Eli Zaretskii <eliz@gnu.org>
13868
13869 * lisp.mk (lisp): Add newcomment.elc.
13870
13871 2012-05-12 Glenn Morris <rgm@gnu.org>
13872
13873 * Makefile.in (MKDIR_P): New, set by configure.
13874 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13875
13876 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13877
13878 Remove unused function hourglass_started.
13879 * dispextern.h (hourglass_started):
13880 * w32fns.c (hourglass_started):
13881 * xdisp.c (hourglass_started): Remove.
13882
13883 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
13884
13885 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13886 Update dependencies.
13887
13888 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13889
13890 * xgselect.c (xg_select): Put maxfds+1 into a var.
13891 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13892
13893 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13894
13895 2012-05-10 Dave Abrahams <dave@boostpro.com>
13896
13897 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13898 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13899
13900 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
13901
13902 * dbusbind.c (xd_registered_buses): New internal Lisp object.
13903 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
13904 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13905 Initialize xd_registered_buses.
13906
13907 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13908
13909 Untag more efficiently if USE_LSB_TAG.
13910 This is based on a proposal by YAMAMOTO Mitsuharu in
13911 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13912 For an admittedly artificial (nth 8000 longlist) benchmark on
13913 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13914 Emacs's overall text size by 1%.
13915 * lisp.h (XUNTAG): New macro.
13916 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13917 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13918 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13919 * eval.c (Fautoload):
13920 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13921 * frame.h (XFRAME): Use XUNTAG.
13922
13923 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13924 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13925 Remove unportable assumptions about print widths of types like
13926 dbus_uint32_t.
13927 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13928 intptr_t when converting between pointer and integer, to avoid GCC
13929 warnings about wrong width.
13930
13931 2012-05-09 Eli Zaretskii <eliz@gnu.org>
13932
13933 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13934 stack for each reader_thread, instead of defaulting to 8MB
13935 determined by the linker. This avoids failures in creating
13936 subprocesses on Windows 7, see the discussion in this thread:
13937 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13938
13939 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13940
13941 Fix up display of the *Minibuf-0* buffer in the mini window.
13942 * keyboard.c (read_char): Don't clear the echo area if there's no
13943 message to clear.
13944 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
13945 contents of *Minibuf-0*) if there's no message displayed in its stead.
13946
13947 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
13948
13949 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13950 batch mode.
13951
13952 2012-05-06 Chong Yidong <cyd@gnu.org>
13953
13954 * lisp.mk (lisp): Update.
13955
13956 2012-05-05 Jim Meyering <meyering@redhat.com>
13957
13958 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13959
13960 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13961
13962 * data.c (PUT_ERROR): New macro.
13963 (syms_of_data): Use it. Add new error type `user-error'.
13964 * undo.c (user_error): New function.
13965 (Fprimitive_undo): Use it.
13966 * print.c (print_error_message): Adjust print style for `user-error'.
13967 * keyboard.c (user_error): New function.
13968 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13969
13970 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13971
13972 Do not limit current-time-string to years 1000..9999.
13973 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13974 (Fcurrent_time_string): Support any year that is supported by the
13975 underlying localtime representation. Don't use asctime, as it
13976 has undefined behavior for years outside the range -999..9999.
13977
13978 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13979
13980 Fix race conditions involving setenv, gmtime, localtime, asctime.
13981 Without this fix, interrupts could mess up code that uses these
13982 nonreentrant functions, since setting TZ invalidates existing
13983 tm_zone or tzname values, and since most of these functions return
13984 pointers to static storage.
13985 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13986 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13987 Grow the critical sections to include not just invoking
13988 localtime/gmtime, but also accessing these functions' results
13989 including their tm_zone values if any, and any related TZ setting.
13990 (format_time_string): Last arg is now struct tm *, not struct tm **,
13991 so that the struct tm is saved in the critical section.
13992 All callers changed. Simplify allocation of initial buffer, partly
13993 motivated by the fact that memory allocation needs to be outside
13994 the critical section.
13995
13996 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13997
13998 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13999 with RESET_INTERVAL.
14000
14001 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14002 Remove duplicated buffer name initialization.
14003
14004 2012-05-02 Jim Meyering <jim@meyering.net>
14005
14006 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
14007
14008 * xfns.c (x_window): Use xstrdup (Bug#11375).
14009
14010 2012-05-02 Eli Zaretskii <eliz@gnu.org>
14011
14012 * xdisp.c (pos_visible_p): If already at a newline from the
14013 display string before the 'while' loop, don't walk back the glyphs
14014 from it3.glyph_row. Solves assertion violation when the display
14015 string begins with a newline (egg.el). (Bug#11367)
14016
14017 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
14018
14019 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
14020 Move to simple.el.
14021
14022 2012-05-01 Glenn Morris <rgm@gnu.org>
14023
14024 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
14025 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
14026 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
14027 All were removed before 23.1.
14028
14029 * dispnew.c: Remove HAVE_LIBNCURSES test;
14030 it is always true on relevant platforms.
14031
14032 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
14033 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
14034
14035 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
14036
14037 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14038
14039 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14040 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14041 Remove.
14042
14043 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14044
14045 Do not avoid creating empty evaporating overlays (Bug#9642).
14046 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14047 That is, do not delete an evaporating overlay if it becomes
14048 empty after its bounds are adjusted to fit within its buffer.
14049 This fix caused other problems, and I'm reverting it until we get
14050 to the bottom of them.
14051
14052 2012-04-27 Chong Yidong <cyd@gnu.org>
14053
14054 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14055
14056 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14057
14058 * xdisp.c (pos_visible_p): If the window start position is beyond
14059 ZV, start the display from buffer beginning. Prevents assertion
14060 violation in init_iterator when the minibuffer window is scrolled
14061 via the scroll bar.
14062
14063 * window.c (window_scroll_pixel_based): Likewise.
14064
14065 2012-04-27 Chong Yidong <cyd@gnu.org>
14066
14067 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14068
14069 2012-04-27 Glenn Morris <rgm@gnu.org>
14070
14071 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14072 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14073
14074 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14075
14076 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14077 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
14078
14079 2012-04-26 Eli Zaretskii <eliz@gnu.org>
14080
14081 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14082 display element, check also the underlying string or buffer
14083 character. (Bug#11341)
14084
14085 * w32menu.c: Include w32heap.h.
14086 (add_menu_item): If the call to AppendMenuW (via
14087 unicode_append_menu) fails, disable Unicode menus only if we are
14088 running on Windows 9X/Me.
14089
14090 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14091
14092 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14093 (xgetint): Add missing shift for LSB tags.
14094
14095 2012-04-24 Martin Rudalics <rudalics@gmx.at>
14096
14097 * keyboard.c (read_char): Don't wipe echo area for select window
14098 events: These might get delayed via `mouse-autoselect-window'
14099 (Bug#11304).
14100
14101 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
14102
14103 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14104 manipulation of :loaded-from data.
14105
14106 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
14107
14108 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14109 now a cons (bug#11311).
14110
14111 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14112
14113 Do not create empty overlays with the evaporate property (Bug#9642).
14114 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14115 if it becomes empty after its bounds are adjusted to fit within
14116 its buffer. Without this fix, in a nonempty buffer (let ((o
14117 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14118 yields an empty overlay that has the evaporate property, which is
14119 not supposed to happen.
14120
14121 Fix minor GTK3 problems found by static checking.
14122 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14123 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14124 (struct _EmacsFixedClass, emacs_fixed_get_type):
14125 Move decls here from emacsgtkfixed.h, since they needn't be public.
14126 (emacs_fixed_get_type): Now static.
14127 (emacs_fixed_class_init): Omit unused local.
14128 (emacs_fixed_child_type): Remove; unused.
14129 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14130 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14131 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14132 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14133 (EMACS_FIXED_GET_CLASS): Remove; unused.
14134 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14135
14136 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14137 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14138
14139 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14140
14141 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14142 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14143 (__malloc_size_t, __malloc_ptrdiff_t):
14144 Remove. All uses removed, replaced by the definiens if needed,
14145 since we can assume C89 or better now.
14146 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14147 (protect_malloc_state, align, get_contiguous_space)
14148 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14149 (malloc_atfork_handler_child, malloc_enable_thread)
14150 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14151 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14152 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14153 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14154 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14155 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14156 Define using prototypes, not old style.
14157 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14158 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14159 (align): Don't assume that signed integer overflow wraps around.
14160 Omit unused local var.
14161 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14162 (_free_internal_nolock, memalign, mallochook, reallochook):
14163 Omit no-longer-needed casts.
14164 (valloc): Use getpagesize, not __getpagesize.
14165 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14166 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14167
14168 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14169
14170 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
14171
14172 Move functions from C to Lisp. Make non-blocking method calls
14173 the default. Implement further D-Bus standard interfaces.
14174
14175 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14176 (QCdbus_request_name_allow_replacement)
14177 (QCdbus_request_name_replace_existing)
14178 (QCdbus_request_name_do_not_queue)
14179 (QCdbus_request_name_reply_primary_owner)
14180 (QCdbus_request_name_reply_in_queue)
14181 (QCdbus_request_name_reply_exists)
14182 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14183 (QCdbus_registered_serial, QCdbus_registered_method)
14184 (QCdbus_registered_signal): New Lisp objects.
14185 (XD_DEBUG_MESSAGE): Use sizeof.
14186 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14187 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14188 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14189 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14190 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14191 (xd_signature, xd_append_arg): Allow float for integer types.
14192 (xd_get_connection_references): New function.
14193 (xd_get_connection_address): Rename from xd_initialize.
14194 Return cached address.
14195 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14196 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14197 level.
14198 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14199 Return number of refcounts.
14200 (Fdbus_get_unique_name): Make stronger parameter check.
14201 (Fdbus_message_internal): New defun.
14202 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14203 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14204 (Fdbus_send_signal, Fdbus_register_service)
14205 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14206 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14207 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14208 (Vdbus_compiled_version, Vdbus_runtime_version)
14209 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14210 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14211 (Vdbus_message_type_signal): New defvars.
14212 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14213 Adapt docstring.
14214
14215 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14216
14217 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14218 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14219 Do not assume ptrdiff_t is the same width as 'int'.
14220
14221 * alloc.c: Handle unusual debugging option combinations.
14222 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14223 since the two debugging options are incompatible.
14224 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14225 is defined.
14226 (mem_init, mem_insert, mem_insert_fixup):
14227 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14228 (NEED_MEM_INSERT): Remove; no longer needed.
14229
14230 2012-04-22 Leo Liu <sdl.web@gmail.com>
14231
14232 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14233
14234 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14235
14236 * sysdep.c [__FreeBSD__]: Minor cleanups.
14237 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14238 Use Emacs indenting style more consistently. Avoid some casts.
14239 Use 'double' consistently rather than mixing 'float' and 'double'.
14240
14241 2012-04-21 Eduard Wiebe <usenet@pusto.de>
14242
14243 * sysdep.c (list_system_processes, system_process_attributes):
14244 Add implementation for FreeBSD (Bug#5243).
14245
14246 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14247
14248 * lisp.mk (lisp): Update.
14249
14250 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14251
14252 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14253 It is never used otherwise.
14254
14255 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14256
14257 * print.c (print_preprocess): Only check print_depth if print-circle
14258 is nil.
14259 (print_object): Check for cycles even when print-circle is nil and
14260 print-gensym is t, but only check print_depth if print-circle is nil.
14261
14262 2012-04-20 Chong Yidong <cyd@gnu.org>
14263
14264 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14265 set the status to "failed" and ensure that sentinel is run.
14266
14267 2012-04-20 Glenn Morris <rgm@gnu.org>
14268
14269 * process.c (Fset_process_inherit_coding_system_flag)
14270 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14271 (Fmake_network_process, Fmake_serial_process): Doc fix.
14272
14273 2012-04-20 Eli Zaretskii <eliz@gnu.org>
14274
14275 * xdisp.c (string_buffer_position_lim): Limit starting position to
14276 BEGV.
14277 (set_cursor_from_row): If called for a mode-line or header-line
14278 row, return zero immediately.
14279 (try_cursor_movement): If inside continuation line, don't back up
14280 farther than the first row after the header line, if any.
14281 Don't consider the header-line row as "partially visible", even if
14282 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14283
14284 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14285
14286 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14287 (bug#11238).
14288
14289 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
14290 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14291
14292 configure: new option --enable-gcc-warnings (Bug#11207)
14293 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14294 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14295 (ALL_CFLAGS): Use new macros rather than old.
14296 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14297 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14298 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14299 -Wunused-result, -Wunused-variable. This should go away once
14300 the Emacs and Gnulib regex code is merged.
14301 (xmalloc, xrealloc): Now static.
14302
14303 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14304
14305 * dired.c (Fsystem_groups): Remove unused local.
14306
14307 2012-04-17 Glenn Morris <rgm@gnu.org>
14308
14309 * dired.c (Fsystem_users): Doc fix.
14310
14311 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14312
14313 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14314 (syms_of_dired): Add them.
14315
14316 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14317
14318 Fix minor alloc.c problems found by static checking.
14319 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14320 New extern decls, to avoid calling undeclared functions.
14321 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14322 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14323 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14324 (NEED_MEM_INSERT): New macro.
14325 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14326 Remove one incorrect comment and fix another.
14327
14328 Fix minor ralloc.c problems found by static checking.
14329 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14330 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14331 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14332 (r_alloc_sbrk): Now static.
14333
14334 Improve ralloc.c interface checking.
14335 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14336 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14337 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14338 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14339 [REL_ALLOC]: ... to here, to check interface.
14340 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14341 Remove decls. This fixes an "It stinks!".
14342
14343 * alloc.c (which_symbols): Fix alignment issue / type clash.
14344
14345 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14346
14347 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14348 (struct Lisp_Misc_Any): Likewise.
14349 (struct Lisp_Free): Likewise.
14350 * alloc.c (union aligned_Lisp_Symbol): Define.
14351 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14352 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14353 (union aligned_Lisp_Misc): Define.
14354 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14355 aligned_Lisp_Misc instead of union Lisp_Misc.
14356 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14357
14358 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14359
14360 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14361 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14362 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14363 * s/netbsd.h, s/sol2-6.h:
14364 Remove definition of GC_MARK_STACK, since the default now works.
14365 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14366 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14367 no longer the default.
14368 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14369
14370 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14371
14372 * lread.c (lisp_file_lexically_bound_p):
14373 Fix hang at ";-*-\n" (bug#11238).
14374
14375 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14376
14377 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14378 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14379
14380 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14381
14382 * nsterm.m (constrainFrameRect): Always constrain when there is only
14383 one screen (Bug#10962).
14384
14385 2012-04-13 Ken Brown <kbrown@cornell.edu>
14386
14387 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14388
14389 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14390
14391 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14392
14393 2012-04-11 Daniel Colascione <dancol@dancol.org>
14394
14395 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14396 against is gone. It's better to use vfork now so that when Cygwin
14397 gains a new, working vfork, we use it automatically (bug#10398).
14398
14399 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14400
14401 * window.c (save_window_save): Obey window-point-insertion-type.
14402
14403 2012-04-11 Glenn Morris <rgm@gnu.org>
14404
14405 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14406
14407 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14408
14409 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14410
14411 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14412
14413 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14414 (force_quit_count): New var.
14415 (handle_interrupt): Use it.
14416
14417 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14418
14419 * w32.c (w32_delayed_load): Record the full path of the library
14420 being loaded (bug#10424).
14421
14422 2012-04-09 Glenn Morris <rgm@gnu.org>
14423
14424 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14425 not just in the obarray, before snarfing them. (Bug#11036)
14426
14427 * Makefile.in ($(leimdir)/leim-list.el):
14428 Pass EMACS rather than BUILT_EMACS.
14429
14430 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14431
14432 * process.c (make_process):
14433 * process.h: Add integer `gnutls_handshakes_tried' member to
14434 process struct.
14435
14436 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14437 Add convenience `GNUTLS_LOG2i' macro.
14438
14439 * gnutls.c (gnutls_log_function2i): Convenience log function.
14440 (emacs_gnutls_read): Use new log functions,
14441 `gnutls_handshakes_tried' process member, and
14442 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14443 attempts per process (connection).
14444
14445 2012-04-09 Chong Yidong <cyd@gnu.org>
14446
14447 * eval.c (Fuser_variable_p, user_variable_p_eh)
14448 (lisp_indirect_variable): Functions deleted.
14449 (Fdefvar): Caller changed.
14450
14451 * callint.c (Finteractive, Fcall_interactively):
14452 * minibuf.c (Fread_variable): Callers changed.
14453
14454 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14455
14456 * xdisp.c (set_cursor_from_row): If the display string appears in
14457 the buffer at position that is closer to point than the position
14458 after the display string, display the cursor on the first glyph of
14459 the display string. Fixes cursor display when a 'display' text
14460 property immediately follows invisible text. (Bug#11094)
14461
14462 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14463
14464 composite.c: use 'double' consistently
14465 * composite.c (get_composition_id): Use 'double' consistently
14466 instead of converting 'float' to 'double' and vice versa; this is
14467 easier to understand and avoids a GCC warning.
14468
14469 2012-04-09 Glenn Morris <rgm@gnu.org>
14470
14471 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14472 preparation for dumping it with emacs. (Bug#4789)
14473 (leimdir): New variable.
14474 ($(leimdir)/leim-list.el): New rule.
14475 (emacs$(EXEEXT)): Depend on leim-list.el.
14476
14477 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14478 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14479 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14480
14481 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14482
14483 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14484 proper alignment.
14485
14486 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14487
14488 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14489 Remove unused local variable.
14490
14491 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14492
14493 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14494 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14495 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14496 objects, as mark_maybe_pointer will catch them otherwise.
14497 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14498 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14499
14500 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14501
14502 Fix typo that broke non-Windows builds.
14503 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14504
14505 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14506
14507 Support building on MS-Windows with libxml2.
14508
14509 * makefile.w32-in (OBJ2): Add xml.$(O).
14510 (GLOBAL_SOURCES): Add xml.c.
14511 ($(BLD)/xml.$(O)): New dependency list.
14512
14513 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14514 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14515 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14516 [!WINDOWSNT]: New macros.
14517 (init_libxml2_functions, libxml2_loaded_p): New functions.
14518 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14519 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14520 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14521 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14522 linked in).
14523 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14524 Call init_libxml2_functions before calling libxml2 functions.
14525 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14526
14527 * emacs.c: Don't include libxml/parser.h.
14528 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14529 xmlCleanupParser directly.
14530
14531 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14532
14533 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14534
14535 * indent.c (Fvertical_motion): If there is a display string at
14536 point, use it.vpos to compute how many lines to backtrack after
14537 move_it_to point. (Bug#11133)
14538
14539 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14540
14541 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14542 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14543 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14544 macros related to unification of CJK characters. For the details,
14545 see the discussion following the message here:
14546 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14547
14548 2012-04-04 Chong Yidong <cyd@gnu.org>
14549
14550 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14551
14552 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14553
14554 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14555 instead of alloca. (Bug#11138)
14556
14557 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14558
14559 * w32menu.c (is_simple_dialog): Properly check lisp types.
14560 (Bug#11141)
14561
14562 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14563
14564 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14565 position we get to after a call to move_it_to fails the
14566 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14567 only if we wind up in a string from display property. (Bug#11063)
14568
14569 * window.c (Fdelete_other_windows_internal): Invalidate the row
14570 and column information about mouse highlight, so that redisplay
14571 restores it after reallocating the glyph matrices. (Bug#7464)
14572
14573 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14574 string comes from a `display' text property, use the buffer
14575 position of that property as if we actually saw that position in
14576 the row's glyphs.
14577 (move_it_by_lines): Remove the assertion that
14578 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14579 violated when there's a before-string at the beginning of a line.
14580 (Bug#11063)
14581
14582 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14583
14584 * xdisp.c (append_space_for_newline): If the default face was
14585 remapped, use the remapped face for the appended newline.
14586 (extend_face_to_end_of_line): Use the remapped default face for
14587 extending the face to the end of the line.
14588 (display_line): Call extend_face_to_end_of_line when the default
14589 face was remapped. (Bug#11068)
14590
14591 2012-03-29 Eli Zaretskii <eliz@gnu.org>
14592
14593 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14594
14595 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14596
14597 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14598
14599 2012-03-27 Glenn Morris <rgm@gnu.org>
14600
14601 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14602 Doc fixes.
14603
14604 2012-03-26 Kenichi Handa <handa@m17n.org>
14605
14606 * dispextern.h (struct glyph): Fix previous change. Change the
14607 bit length of glyphless.ch to 25 (Bug#11082).
14608
14609 2012-03-26 Chong Yidong <cyd@gnu.org>
14610
14611 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14612 (command_loop_1): Use it; inhibit selection update for
14613 handle-select-window too (Bug#8996).
14614
14615 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14616
14617 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
14618
14619 2012-03-25 Kenichi Handa <handa@m17n.org>
14620
14621 * dispextern.h (struct glyph): Change the bit length of
14622 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14623
14624 2012-03-24 Eli Zaretskii <eliz@gnu.org>
14625
14626 * s/ms-w32.h (tzname): Include time.h before redirecting to
14627 _tzname. Fixes the MSVC build. (Bug#9960)
14628
14629 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14630
14631 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14632 characters.
14633
14634 * xterm.c (XTread_socket): Only modify handling_signal if
14635 !SYNC_INPUT. (Bug#11080)
14636
14637 2012-03-23 Eli Zaretskii <eliz@gnu.org>
14638
14639 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14640 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14641 when fetching a multibyte character consumes more bytes than
14642 CHAR_BYTES returns, due to unification of CJK characters in
14643 string_char. (Bug#11073)
14644
14645 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14646
14647 * process.c (wait_reading_process_output): Handle pty disconnect
14648 by refraining from sending oneself a SIGCHLD (bug#10933).
14649
14650 2012-03-22 Chong Yidong <cyd@gnu.org>
14651
14652 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14653
14654 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
14655 Mark string as coming from a prefix property.
14656 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14657 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14658
14659 2012-03-21 Chong Yidong <cyd@gnu.org>
14660
14661 * xfaces.c (Vface_remapping_alist): Doc fix.
14662
14663 2012-03-20 Eli Zaretskii <eliz@gnu.org>
14664
14665 * w32proc.c (Fw32_set_console_codepage)
14666 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14667 Doc fixes.
14668
14669 2012-03-20 Chong Yidong <cyd@gnu.org>
14670
14671 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14672 to reflect default non-nil value of redisplay-dont-pause.
14673
14674 2012-03-19 Kenichi Handa <handa@m17n.org>
14675
14676 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14677 it fit in a valid range (Bug#11003).
14678
14679 2012-03-18 Eli Zaretskii <eliz@gnu.org>
14680
14681 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14682 that is not from display property, accept the row as a "cursor
14683 row" if one of the string's character has a non-nil `cursor'
14684 property. Fixes cursor positioning when there are newlines in
14685 overlay strings, e.g. in icomplete.el. (Bug#11035)
14686
14687 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14688
14689 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14690
14691 2012-03-12 Chong Yidong <cyd@gnu.org>
14692
14693 * eval.c (inhibit_lisp_code): Rename from
14694 inhibit_window_configuration_change_hook; move from window.c.
14695
14696 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14697 * window.c (run_window_configuration_change_hook)
14698 (syms_of_window): Callers changed.
14699
14700 2012-03-11 Chong Yidong <cyd@gnu.org>
14701
14702 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14703
14704 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14705
14706 2012-03-10 Chong Yidong <cyd@gnu.org>
14707
14708 * frame.c (other_visible_frames): Don't assume the selected frame
14709 is visible (Bug#10955).
14710
14711 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14712
14713 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14714
14715 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14716
14717 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14718 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14719 zero (Bug#10954).
14720
14721 2012-03-03 Glenn Morris <rgm@gnu.org>
14722
14723 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
14724
14725 2012-03-02 Eli Zaretskii <eliz@gnu.org>
14726
14727 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14728 position past the first glyph_row that ends at ZV. (Bug#10902)
14729 (redisplay_window, next_element_from_string): Fix typos in
14730 comments.
14731 (redisplay_window): Pass to move_it_vertically the margin in
14732 pixels, not in screen lines.
14733
14734 2012-03-02 Glenn Morris <rgm@gnu.org>
14735
14736 * buffer.c (buffer-list-update-hook): Doc fix.
14737
14738 2012-02-29 Eli Zaretskii <eliz@gnu.org>
14739
14740 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14741 push_it before setting up the iterator for the first overlay
14742 string, even if we have an empty string loaded.
14743 (next_overlay_string): If there's an empty string on the iterator
14744 stack, pop the stack. (Bug#10903)
14745
14746 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14747
14748 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14749 Suggested by Stefan Monnier in
14750 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14751 * alloc.c (widen_to_Lisp_Object): New static function.
14752 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14753 and widening them to Lisp_Objects. This would work even if
14754 USE_LSB_TAG is defined and wide integers are used, which might
14755 happen in a future version of Emacs.
14756
14757 2012-02-25 Chong Yidong <cyd@gnu.org>
14758
14759 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14760 Doc fix.
14761
14762 * xselect.c (Fx_selection_exists_p): Doc fix.
14763 (x_clipboard_manager_save_all): Print an informative message
14764 before saving to clipboard manager.
14765
14766 2012-02-24 Chong Yidong <cyd@gnu.org>
14767
14768 * keyboard.c (process_special_events): Handle all X selection
14769 requests in kbd_buffer, not just the next one (Bug#8869).
14770
14771 2012-02-23 Chong Yidong <cyd@gnu.org>
14772
14773 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14774 call when setting menu-bar-lines and tool-bar-lines parameters.
14775 (unwind_create_frame_1): New helper function.
14776
14777 * window.c (inhibit_window_configuration_change_hook): New var.
14778 (run_window_configuration_change_hook): Obey it.
14779 (syms_of_window): Initialize it.
14780
14781 2012-02-22 Chong Yidong <cyd@gnu.org>
14782
14783 * xterm.c (x_draw_image_relief): Add missing type check for
14784 Vtool_bar_button_margin (Bug#10743).
14785
14786 2012-02-21 Chong Yidong <cyd@gnu.org>
14787
14788 * fileio.c (Vfile_name_handler_alist): Doc fix.
14789
14790 * buffer.c (Fget_file_buffer): Protect against invalid file
14791 handler return value.
14792
14793 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14794
14795 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14796 when computing $valmask.
14797
14798 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14799 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14800 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14801 It's useless in that case, and it can cause problems on hosts
14802 that allocate halves of EMACS_INT values separately.
14803 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14804 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14805 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14806 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14807 it avoids undefined behavior on hosts where shifting right by more
14808 than the word width has undefined behavior.
14809
14810 2012-02-19 Chong Yidong <cyd@gnu.org>
14811
14812 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14813 (Funhandled_file_name_directory, Ffile_name_as_directory)
14814 (Fdirectory_file_name, Fexpand_file_name)
14815 (Fsubstitute_in_file_name): Protect against invalid file handler
14816 return values (Bug#10845).
14817
14818 2012-02-18 Eli Zaretskii <eliz@gnu.org>
14819
14820 * .gdbinit (pitx): Fix incorrect references to fields of the
14821 iterator stack.
14822
14823 2012-02-17 Chong Yidong <cyd@gnu.org>
14824
14825 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14826
14827 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14828
14829 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14830 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14831
14832 2012-02-15 Chong Yidong <cyd@gnu.org>
14833
14834 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14835 marked as special. Also, starting docstrings with * is obsolete.
14836
14837 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14838
14839 * gnutls.c (emacs_gnutls_write): Fix last change.
14840
14841 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14842
14843 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14844 send_process.
14845
14846 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14847
14848 * keymap.c (Fsingle_key_description): Handle char ranges.
14849
14850 2012-02-12 Chong Yidong <cyd@gnu.org>
14851
14852 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14853 as that creates a dangerous corner case.
14854
14855 * window.c (Fdelete_window_internal): Invalidate the mouse
14856 highlight (Bug#9904).
14857
14858 2012-02-12 Glenn Morris <rgm@gnu.org>
14859
14860 * xselect.c (Fx_own_selection_internal)
14861 (Fx_get_selection_internal, Fx_disown_selection_internal)
14862 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14863 * nsselect.m (Fx_own_selection_internal)
14864 (Fx_disown_selection_internal, Fx_selection_exists_p)
14865 (Fx_selection_owner_p, Fx_get_selection_internal):
14866 Sync docs and argument specs with the xselect.c versions.
14867
14868 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14869
14870 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14871
14872 2012-02-11 Eli Zaretskii <eliz@gnu.org>
14873
14874 * w32select.c (Fx_selection_exists_p): Sync doc string and
14875 argument list with xselect.c. (Bug#10783)
14876
14877 * w16select.c (Fx_selection_exists_p): Sync doc string and
14878 argument list with xselect.c. (Bug#10783)
14879
14880 2012-02-10 Glenn Morris <rgm@gnu.org>
14881
14882 * fns.c (Fsecure_hash): Doc fix.
14883
14884 2012-02-09 Kenichi Handa <handa@m17n.org>
14885
14886 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14887
14888 2012-02-07 Chong Yidong <cyd@gnu.org>
14889
14890 * buffer.c (Fbuffer_local_variables)
14891 (buffer_lisp_local_variables): Handle unbound vars correctly;
14892 don't let Qunbound leak into Lisp.
14893
14894 2012-02-07 Glenn Morris <rgm@gnu.org>
14895
14896 * image.c (Fimagemagick_types): Doc fix.
14897
14898 * image.c (imagemagick-render-type): Change it from a lisp object
14899 to an integer. Move the doc here from the lisp manual.
14900 Treat all values not equal to 0 the same.
14901
14902 2012-02-06 Chong Yidong <cyd@gnu.org>
14903
14904 * doc.c (store_function_docstring): Avoid applying docstring of
14905 alias to base function (Bug#2603).
14906
14907 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14908
14909 * .gdbinit (pp1, pv1): Remove redundant defines.
14910 (pr): Use pp.
14911
14912 2012-02-04 Chong Yidong <cyd@gnu.org>
14913
14914 * nsterm.m: Declare a global (Bug#10694).
14915
14916 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14917
14918 * w32.c (get_emacs_configuration_options):
14919 Include --enable-checking, if specified, in the return value.
14920
14921 2012-02-04 Martin Rudalics <rudalics@gmx.at>
14922
14923 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14924 after rounding frame sizes. (Bug#9723)
14925
14926 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14927
14928 * keyboard.c (adjust_point_for_property): Don't position point
14929 before BEGV. (Bug#10696)
14930
14931 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14932
14933 Handle overflow when computing char display width (Bug#9496).
14934 * character.c (char_width): Return EMACS_INT, not int.
14935 (char_width, c_string_width): Check for overflow when
14936 computing the width; this is possible now that individual
14937 characters can have unbounded width. Problem introduced
14938 by merge from Emacs 23 on 2012-01-19.
14939
14940 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
14941
14942 * dbusbind.c (Fdbus_register_method): Mention the return value
14943 :ignore in the docstring.
14944
14945 2012-02-02 Glenn Morris <rgm@gnu.org>
14946
14947 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14948
14949 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14950 Unconditionally set to t. (Bug#10673)
14951 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14952 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14953 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14954
14955 2012-02-02 Kenichi Handa <handa@m17n.org>
14956
14957 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14958 0, do not call append_composite_glyph.
14959
14960 2012-02-02 Kenichi Handa <handa@m17n.org>
14961
14962 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14963 NULL (Bug#6988).
14964 (x_produce_glyphs): If the component of a composition is a null
14965 string, set it->pixel_width to 1 to avoid zero-width glyph.
14966
14967 2012-02-01 Eli Zaretskii <eliz@gnu.org>
14968
14969 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14970 first 2 arguments are identical. This makes inserting large
14971 output from a subprocess an order of magnitude faster on
14972 MS-Windows, where all sbrk'ed memory is always contiguous.
14973
14974 2012-01-31 Glenn Morris <rgm@gnu.org>
14975
14976 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14977 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14978 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14979
14980 2012-01-29 Glenn Morris <rgm@gnu.org>
14981
14982 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14983
14984 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14985
14986 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14987
14988 2012-01-28 Chong Yidong <cyd@gnu.org>
14989
14990 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14991
14992 2012-01-26 Chong Yidong <cyd@gnu.org>
14993
14994 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14995
14996 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14997 repeat counts (Bug#10507).
14998
14999 2012-01-26 Glenn Morris <rgm@gnu.org>
15000
15001 * lread.c (syms_of_lread): Doc fix.
15002
15003 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
15004
15005 * coding.c (encode_designation_at_bol): Change return value to
15006 EMACS_INT.
15007
15008 2012-01-25 Chong Yidong <cyd@gnu.org>
15009
15010 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
15011
15012 2012-01-21 Chong Yidong <cyd@gnu.org>
15013
15014 * floatfns.c (Fcopysign): Make the second argument non-optional,
15015 since nil is not allowed anyway.
15016
15017 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
15018
15019 * process.c (read_process_output): Use p instead of XPROCESS (proc).
15020 (send_process): Likewise.
15021
15022 2012-01-19 Martin Rudalics <rudalics@gmx.at>
15023
15024 * window.c (save_window_save, Fcurrent_window_configuration)
15025 (Vwindow_persistent_parameters): Do not use Qstate.
15026 Rewrite doc-strings.
15027
15028 2012-01-19 Kenichi Handa <handa@m17n.org>
15029
15030 * character.c (char_width): New function.
15031 (Fchar_width, c_string_width, lisp_string_width):
15032 Use char_width (Bug#9496).
15033
15034 2012-01-16 Martin Rudalics <rudalics@gmx.at>
15035
15036 * window.c (Vwindow_persistent_parameters): New variable.
15037 (Fset_window_configuration, save_window_save): Handle persistent
15038 window parameters.
15039
15040 2012-01-14 Eli Zaretskii <eliz@gnu.org>
15041
15042 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15043 thrashing the stack of the thread. (Bug#9087)
15044
15045 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15046
15047 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15048
15049 2012-01-11 Eli Zaretskii <eliz@gnu.org>
15050
15051 * xdisp.c (rows_from_pos_range): Handle the case where the
15052 highlight ends on a newline. (Bug#10464)
15053 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15054 he end column for display of highlight that ends on a newline
15055 before a R2L line.
15056
15057 2012-01-11 Glenn Morris <rgm@gnu.org>
15058
15059 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15060 from load-path also when installation-directory is nil. (Bug#10208)
15061
15062 2012-01-10 Glenn Morris <rgm@gnu.org>
15063
15064 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15065
15066 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15067 Update template values to be closer to their typical values these days.
15068
15069 2012-01-09 Eli Zaretskii <eliz@gnu.org>
15070
15071 * xdisp.c (rows_from_pos_range): Accept additional argument
15072 DISP_STRING, and accept any glyph in a row whose object is that
15073 string as eligible for mouse highlight. Fixes mouse highlight of
15074 display strings from overlays. (Bug#10464)
15075
15076 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
15077
15078 emacs: fix an auto-save permissions race condition (Bug#10400)
15079 * fileio.c (auto_saving_dir_umask): New static var.
15080 (Fmake_directory_internal): Use it.
15081 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15082 creating the directory. The old code temporarily assigns
15083 too-generous permissions to the directory.
15084 (do_auto_save_eh): Clear it.
15085 (Fdo_auto_save): Catch all errors, not just file errors, so
15086 that the var is always cleared.
15087
15088 2012-01-07 Eli Zaretskii <eliz@gnu.org>
15089
15090 * search.c (scan_buffer): Pass character positions to
15091 know_region_cache, not byte positions. (Bug#6540)
15092
15093 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
15094
15095 * w32.c (sys_rename): Report EXDEV when rename of a directory
15096 fails because the target is on another logical disk. (Bug#10284)
15097
15098 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15099
15100 * xterm.c (x_embed_request_focus): New function.
15101
15102 * xterm.h: Add prototype.
15103
15104 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15105
15106 2012-01-05 Glenn Morris <rgm@gnu.org>
15107
15108 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15109
15110 2012-01-01 Eli Zaretskii <eliz@gnu.org>
15111
15112 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15113 Load gnutls_transport_set_lowat only if GnuTLS version is below
15114 2.11.1.
15115 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15116 GnuTLS versions below 2.11.1.
15117
15118 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15119
15120 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15121 to the doc string advising against its use for altering the way
15122 windows are scrolled.
15123
15124 2011-12-28 Kenichi Handa <handa@m17n.org>
15125
15126 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15127 coding-system ASCII compatible only when it does not produce BOM
15128 on encoding (Bug#10383).
15129
15130 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15131
15132 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15133 can scroll.
15134 (create_and_show_popup_menu): Always use menu_position_func for
15135 Gtk3 (Bug#10361).
15136
15137 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15138
15139 * callint.c (Fcall_interactively): Don't truncate prompt string.
15140
15141 2011-12-23 Eli Zaretskii <eliz@gnu.org>
15142
15143 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15144 property that ends at ZV, so that the bidi iteration could be
15145 resumed from there (after widening). (Bug#10360)
15146
15147 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15148
15149 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15150
15151 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15152
15153 * nsterm.m (x_free_frame_resources):
15154 Release f->output_data.ns->miniimage.
15155 (ns_index_color): Fix indentation. Do not retain
15156 color_table->colors[i].
15157
15158 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15159 before returning.
15160
15161 * nsfns.m (x_set_background_color): Assign return value from
15162 ns_index_color to face-background instead of NSColor*.
15163 (ns_implicitly_set_icon_type): Fix indentation.
15164 Change assignment in for loop to comparison.
15165
15166 * emacs.c (ns_pool): New variable.
15167 (main): Assign ns_pool.
15168 (Fkill_emacs): Call ns_release_autorelease_pool.
15169
15170 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15171 autorelease fdesc, release fdAttrs and tdict.
15172 (ns_get_covering_families): Release charset.
15173 (ns_findfonts): Release NSFontDescriptor created with new.
15174 (ns_uni_to_glyphs): Fix indentation.
15175 (setString): Release attrStr before assigning new value.
15176
15177 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15178
15179 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15180 and NS_IMPL_COCOA.
15181 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15182 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15183
15184 2011-12-18 David Reitter <reitter@cmu.edu>
15185
15186 * nsterm.m (ns_term_init): Subscribe for notifications
15187 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15188 to method trackingNotification in EmacsMenu.
15189
15190 * nsmenu.m (trackingMenu): New variable.
15191 (trackingNotification): New method (from Aquamacs).
15192 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15193 from Aquamacs (Bug#7030).
15194
15195 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15196
15197 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15198 (symbol_to_nsstring): Fix indentation.
15199 (ns_symbol_to_pb): New function.
15200 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15201 (Fns_rotate_cut_buffers_internal): Remove.
15202 (Fns_store_selection_internal): Rename from
15203 Fns_store_cut_buffer_internal.
15204 (ns_get_foreign_selection, Fx_own_selection_internal)
15205 (Fx_disown_selection_internal, Fx_selection_exists_p)
15206 (Fns_get_selection_internal, Fns_store_selection_internal):
15207 Use ns_symbol_to_pb and check if return value is nil.
15208 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15209 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15210 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15211 renamed to Sns_store_selection_internal.
15212 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15213 and remove this function.
15214 (ns_handle_selection_clear): Remove, never used.
15215 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15216 here.
15217
15218 2011-12-17 Ken Brown <kbrown@cornell.edu>
15219
15220 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15221 GID is unknown (Bug#10257).
15222
15223 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15224
15225 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15226 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15227 which caused a build failure on GNU/Linux IA-64. This problem was
15228 introduced by my 2011-10-07 patch.
15229
15230 2011-12-15 Juri Linkov <juri@jurta.org>
15231
15232 * image.c (imagemagick_error): New function. (Bug#10112)
15233 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15234 Use `imagemagick_error' where ImageMagick functions return
15235 `MagickFalse'.
15236 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15237 proper order.
15238
15239 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15240
15241 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15242 fill background (Bug#8992).
15243
15244 2011-12-13 Martin Rudalics <rudalics@gmx.at>
15245
15246 * window.c (Vwindow_combination_resize)
15247 (Vwindow_combination_limit): Use t instead of non-nil in
15248 doc-strings.
15249 (Vrecenter_redisplay): Add first sentence of doc-string on
15250 separate line.
15251 (Frecenter): Fix doc-string typo.
15252
15253 2011-12-11 Kenichi Handa <handa@m17n.org>
15254
15255 * coding.c (Funencodable_char_position): Pay attention to the
15256 buffer text relocation (Bug#9389).
15257
15258 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15259
15260 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15261 gtk_init (Bug#10100).
15262
15263 2011-12-10 Eli Zaretskii <eliz@gnu.org>
15264
15265 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15266 IT->string is nil. (Bug#10263)
15267
15268 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15269
15270 * nsterm.h (x_free_frame_resources): Declare.
15271
15272 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15273 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15274
15275 * nsterm.h (ns_get_defaults_value): Declare.
15276
15277 * nsterm.m (ns_default): Call ns_get_defaults_value.
15278
15279 2011-12-09 Eli Zaretskii <eliz@gnu.org>
15280
15281 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15282 (Bug#10170)
15283
15284 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15285
15286 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15287 that where the value of an _OBJC_* symbol points to is in the .bss
15288 section (Bug#10240).
15289
15290 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15291
15292 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15293 after the loop to call ccl_driver at least once (Bug#8619).
15294
15295 2011-12-08 Kenichi Handa <handa@m17n.org>
15296
15297 * ftfont.c (get_adstyle_property): Fix previous change
15298 (Bug#10233).
15299
15300 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
15301
15302 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15303 dirs from the default value of EMACSLOADPATH (bug#10208).
15304
15305 2011-12-07 Glenn Morris <rgm@gnu.org>
15306
15307 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15308 installation and source directories as well. (Bug#10208)
15309
15310 2011-12-06 Chong Yidong <cyd@gnu.org>
15311
15312 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15313
15314 2011-12-06 Glenn Morris <rgm@gnu.org>
15315
15316 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15317 as an error, not just -1. (Bug#10217)
15318
15319 2011-12-05 Chong Yidong <cyd@gnu.org>
15320
15321 * keyboard.c (process_special_events): New function.
15322 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15323
15324 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15325
15326 * coding.c (encode_designation_at_bol): Don't use uninitialized
15327 local variable (Bug#9318).
15328
15329 2011-12-05 Kenichi Handa <handa@m17n.org>
15330
15331 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15332 return Qnil (Bug#8046, Bug#10193).
15333
15334 2011-12-05 Kenichi Handa <handa@m17n.org>
15335
15336 * coding.c (encode_designation_at_bol): New args charbuf_end and
15337 dst. Return the number of produced bytes. Callers changed.
15338 (coding_set_source): Return how many bytes coding->source was
15339 relocated.
15340 (coding_set_destination): Return how many bytes
15341 coding->destination was relocated.
15342 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15343 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15344
15345 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15346
15347 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15348 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15349 macro (Bug#9318).
15350
15351 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15352
15353 The following changes are to fix Bug#9318.
15354
15355 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15356 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15357 (encode_coding_iso_2022, encode_coding_sjis)
15358 (encode_coding_big5, encode_coding_charset): Use the above macros.
15359
15360 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15361
15362 * lisp.h (process_quit_flag): Fix external declaration.
15363
15364 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15365
15366 Don't macro-inline non-performance-critical code.
15367 * eval.c (process_quit_flag): New function.
15368 * lisp.h (QUIT): Use it.
15369
15370 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15371
15372 * nsfns.m (get_geometry_from_preferences): New function.
15373 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15374
15375 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15376
15377 * emacs.c (Qkill_emacs): Define.
15378 (syms_of_emacs): Initialize it.
15379 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15380 Qquit_flag to `kill-emacs' instead.
15381 (quit_throw_to_read_char): Add parameter `from_signal'.
15382 All callers changed. Call Fkill_emacs if requested and safe.
15383 * lisp.h (QUIT): Call Fkill_emacs if requested.
15384
15385 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15386
15387 * widget.c (update_wm_hints): Return if wmshell is null.
15388 (widget_update_wm_size_hints): New function.
15389
15390 * widget.h (widget_update_wm_size_hints): Declare.
15391
15392 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15393 widget_update_wm_size_hints (Bug#10104).
15394
15395 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15396
15397 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15398 before a newline, prepare the bidi iterator for consuming the
15399 newline, and keep the current paragraph direction. (Bug#10183)
15400 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15401
15402 2011-12-02 Juri Linkov <juri@jurta.org>
15403
15404 * search.c (Fword_search_regexp): New Lisp function created from
15405 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15406 (Fword_search_backward, Fword_search_forward)
15407 (Fword_search_backward_lax, Fword_search_forward_lax):
15408 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15409 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15410
15411 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15412
15413 * fileio.c (Finsert_file_contents): Move after-change-function call
15414 to before the "handled:" label, since all "goto handled" appear in
15415 cases where the *-change-functions have already been properly called
15416 (bug#10117).
15417
15418 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15419
15420 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15421 waiting for input. (Bug#10169)
15422
15423 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15424
15425 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15426 verifies glyph row's hash code--we have just reallocated the
15427 glyphs, so their contents can be complete garbage. (Bug#10164)
15428
15429 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15430
15431 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15432
15433 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15434
15435 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15436 attributes are tested _before_ calling verify_row_hash, to protect
15437 against GCC re-ordering of the tests. (Bug#10164)
15438
15439 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15440
15441 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15442
15443 * xterm.c (handle_one_xevent): Only set async_visible and friends
15444 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15445 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15446 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15447
15448 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15449
15450 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15451 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15452 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15453 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15454 All uses changed to use GCPRO1 etc.
15455 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15456 Revert to old implementation (i.e., before 2011-03-11).
15457
15458 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15459
15460 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15461 of scroll runs so as to avoid assigning disabled bogus rows and
15462 unnecessary graphics copy operations.
15463
15464 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15465
15466 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15467 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15468 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15469 (malloc, free, realloc, calloc): Redirect to e_* only when
15470 compiling Emacs.
15471
15472 * lisp.h (GCTYPEBITS): Move before first use.
15473 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15474 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15475 this macro definition.
15476
15477 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15478 _MSC_VER.
15479
15480 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15481
15482 * gtkutil.c (xg_create_frame_widgets):
15483 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15484 present with Gtk+ 2.0.
15485
15486 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15487
15488 * fileio.c (Finsert_file_contents): Undo previous change; see
15489 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15490
15491 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15492
15493 Rename locals to avoid shadowing.
15494 * fileio.c (Finsert_file_contents):
15495 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15496 * process.c (wait_reading_process_output):
15497 Rename inner 'proc' to 'p' to avoid shadowing.
15498 Indent for consistency with usual Emacs style.
15499
15500 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15501
15502 * xdisp.c (redisplay_window): If cursor row is not fully visible
15503 after recentering, and scroll-conservatively is set to a large
15504 number, scroll window by a few more lines to make the cursor fully
15505 visible and out of scroll-margin. (Bug#10105)
15506 (start_display): Don't move to the next line if the display should
15507 start at a newline that is part of a display vector or an overlay
15508 string. (Bug#10119)
15509
15510 2011-11-24 Juri Linkov <juri@jurta.org>
15511
15512 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15513 after the `MagickPingImage' call. (Bug#10112)
15514
15515 2011-11-23 Chong Yidong <cyd@gnu.org>
15516
15517 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15518
15519 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15520
15521 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15522 making another buffer current. (Bug#10114)
15523
15524 2011-11-23 Glenn Morris <rgm@gnu.org>
15525
15526 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15527
15528 2011-11-23 Chong Yidong <cyd@gnu.org>
15529
15530 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15531 using it (Bug#5984).
15532
15533 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15534
15535 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15536 and header-lines, as they don't have one computed for them.
15537 (Bug#10098)
15538
15539 * .gdbinit (prow): Make displayed values more self-explaining.
15540 Add row's hash code.
15541
15542 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15543
15544 * process.c (wait_reading_process_output): Fix asynchrounous
15545 GnuTLS socket handling on some versions of the GnuTLS library.
15546 (wait_reading_process_output): Add comment and URL.
15547
15548 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15549
15550 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15551
15552 2011-11-21 Chong Yidong <cyd@gnu.org>
15553
15554 * window.c (Fnext_window, Fprevious_window): Doc fix.
15555
15556 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15557
15558 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15559
15560 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15561
15562 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15563
15564 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15565
15566 * window.c (Fset_window_combination_limit): Rename argument
15567 STATUS to LIMIT.
15568 (Vwindow_combination_limit): Remove "status" from doc-string.
15569
15570 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15571
15572 * m/ibms390.h: Remove.
15573 * m/ibms390x.h: Don't include "ibms390.h".
15574
15575 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15576
15577 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15578 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15579
15580 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15581
15582 * casetab.c (Fset_case_table):
15583 * charset.c (Fcharset_after): Fix typos.
15584
15585 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15586
15587 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15588 Otherwise, valgrind does not work on some platforms.
15589 Problem reported by Andreas Schwab in
15590 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15591 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15592 is set, removing the need for VIRT_ADDRESS_VARIES.
15593 (PURE_P): Use a more-efficient implementation that needs just one
15594 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15595 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15596 to 4 (xorl, subq, cmpq, setbe).
15597 * alloc.c (pure): Always extern now, since that's the
15598 VIRT_ADDR_VARIES behavior.
15599 (PURE_POINTER_P): Use a single comparison, not two, for
15600 consistency with the new puresize.h.
15601 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15602 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15603 Remove VIRT_ADDR_VARIES no longer needed.
15604
15605 2011-11-19 Eli Zaretskii <eliz@gnu.org>
15606
15607 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15608 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15609 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15610 behave as if the cursor position were at the window margin.
15611
15612 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15613 and the cursor position is out of bounds, behave as if the cursor
15614 position were at the window margin. (Bug#10075)
15615
15616 2011-11-18 Chong Yidong <cyd@gnu.org>
15617
15618 * window.c (Fwindow_combination_limit): Make first argument
15619 non-optional, since it is meaningless for live windows like the
15620 selected window.
15621
15622 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15623
15624 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15625
15626 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15627
15628 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15629 (graft_intervals_into_buffer): Simplify.
15630
15631 2011-11-18 Eli Zaretskii <eliz@gnu.org>
15632
15633 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15634 hash values of the two rows.
15635 (copy_row_except_pointers): Preserve the used[] arrays and the
15636 hash values of the two rows. (Bug#10035)
15637 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
15638
15639 * xdisp.c (row_hash): New function, body extracted from
15640 compute_line_metrics.
15641 (compute_line_metrics): Call row_hash, instead of computing the
15642 hash code inline.
15643
15644 * dispnew.c (verify_row_hash): Call row_hash for computing the
15645 hash code of a row, instead of duplicating code from xdisp.c.
15646
15647 * dispextern.h (row_hash): Add prototype.
15648
15649 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15650
15651 * frame.c (delete_frame): Don't delete the terminal when the last
15652 X frame is closed if emacs is built with GTK toolkit.
15653
15654 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
15655
15656 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15657
15658 2011-11-17 Martin Rudalics <rudalics@gmx.at>
15659
15660 * window.c (Vwindow_splits): Rename to
15661 Vwindow_combination_resize. Suggested by Juri Linkov.
15662 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15663 of Vwindow_splits.
15664
15665 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
15666
15667 * nsfns.m (Fns_font_name):
15668 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
15669
15670 2011-11-16 Martin Rudalics <rudalics@gmx.at>
15671
15672 * window.h (window): Rename slot "nest" to "combination_limit".
15673 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15674 (Fset_window_nest): Rename to Fset_window_combination_limit.
15675 (Vwindow_nest): Rename to Vwindow_combination_limit.
15676 (recombine_windows, make_parent_window, make_window)
15677 (Fsplit_window_internal, saved_window)
15678 (Fset_window_configuration, save_window_save): Rename all
15679 occurrences of window_nest to window_combination_limit.
15680
15681 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
15682
15683 * image.c (imagemagick_load_image): Fix typo.
15684
15685 2011-11-14 Eli Zaretskii <eliz@gnu.org>
15686
15687 * xdisp.c (display_line): Move the call to
15688 highlight_trailing_whitespace before the call to
15689 compute_line_metrics, since the latter needs to see the final
15690 faces of all the glyphs to compute ROW's hash value.
15691 Fixes assertion violations in row_equal_p. (Bug#10035)
15692
15693 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
15694
15695 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15696 just return (bug#10044).
15697
15698 2011-11-12 Eli Zaretskii <eliz@gnu.org>
15699
15700 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15701 with user-defined heap size. Bump the default size of the temacs
15702 heap to 27MB, to avoid memory warning when running temacs.
15703 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15704
15705 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15706 current_matrix and desired_matrix. (Bug#9990)
15707 (verify_row_hash) [XASSERTS]: New function.
15708 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15709 that the hash value of glyph rows is correct.
15710
15711 2011-11-12 Martin Rudalics <rudalics@gmx.at>
15712
15713 * window.h (window): Remove splits slot.
15714 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15715 (Fdelete_other_windows_internal, make_parent_window)
15716 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15717 (Fset_window_configuration, save_window_save): Don't deal with
15718 split status of windows.
15719 (saved_window): Remove splits slot.
15720 (Vwindow_splits): Rewrite doc-string.
15721
15722 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15723
15724 * xfns.c (unwind_create_frame):
15725 * nsfns.m (unwind_create_frame):
15726 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15727 Vframe_list (Bug#9999).
15728
15729 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15730
15731 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
15732
15733 2011-11-11 Kenichi Handa <handa@m17n.org>
15734
15735 * callproc.c (Fcall_process): Set the member dst_multibyte of
15736 process_coding.
15737
15738 2011-11-11 Johan Bockgård <bojohan@gnu.org>
15739
15740 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15741 avoid a crash (bug#9496).
15742
15743 2011-11-09 Chong Yidong <cyd@gnu.org>
15744
15745 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15746 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15747
15748 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15749
15750 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15751
15752 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15753
15754 Avoid some portability problems by eschewing 'extern inline' functions.
15755 The trivial performance wins aren't worth the portability hassles; see
15756 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15757 et seq.
15758 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15759 (window_box_width, window_box_left, window_box_left_offset)
15760 (window_box_right, window_box_right_offset): Undo previous change,
15761 by removing the "extern"s.
15762 * intervals.c (adjust_intervals_for_insertion)
15763 (adjust_intervals_for_deletion): Undo previous change,
15764 making these static again.
15765 (offset_intervals, temp_set_point_both, temp_set_point)
15766 (copy_intervals_to_string): No longer inline.
15767 * xdisp.c (window_text_bottom_y, window_box_width)
15768 (window_box_height, window_box_left_offset)
15769 (window_box_right_offset, window_box_left, window_box_right)
15770 (window_box): No longer inline.
15771
15772 2011-11-08 Chong Yidong <cyd@gnu.org>
15773
15774 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
15775 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15776 Signal an error if not a live window.
15777 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15778 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15779
15780 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
15781
15782 * lisp.h (syms_of_abbrev): Remove declaration.
15783 Reported by CHENG Gao <chenggao@royau.me>.
15784
15785 2011-11-07 Eli Zaretskii <eliz@gnu.org>
15786
15787 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15788 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15789 of temacs in GUI mode.
15790
15791 2011-11-07 Martin Rudalics <rudalics@gmx.at>
15792
15793 * window.h: Declare delete_all_child_windows instead of
15794 delete_all_subwindows.
15795 * window.c (Fwindow_nest, Fset_window_nest)
15796 (Fset_window_new_total, Fset_window_new_normal)
15797 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15798 (delete_all_subwindows): Rename to delete_all_child_windows.
15799 (Fdelete_other_windows_internal, Fset_window_configuration):
15800 Call delete_all_child_windows instead of delete_all_subwindows.
15801 * frame.c (delete_frame): Call delete_all_child_windows instead
15802 of delete_all_subwindows.
15803
15804 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15805
15806 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15807 This is also needed for porting to any host where GC_MARK_STACK is
15808 not GC_MAKE_GCPROS_NOOPS.
15809 (which_symbols): Use it.
15810
15811 2011-11-07 Kenichi Handa <handa@m17n.org>
15812
15813 * coding.c (coding_set_destination): Check coding->src_pos only
15814 when coding->src_object is a buffer (bug#9910).
15815
15816 * process.c (send_process): Set the member src_multibyte of coding
15817 to 0 (bug#9911) when sending a unibyte text.
15818
15819 * callproc.c (Fcall_process): Set the member src_multibyte of
15820 process_coding to 0 (bug#9912).
15821
15822 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15823
15824 * xmenu.c (cleanup_widget_value_tree): New function.
15825 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15826 calling free_menubar_widget_value_tree directly (Bug#9830).
15827
15828 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15829
15830 Fix some portability problems with 'inline'.
15831 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15832 (window_box_width, window_box_left, window_box_left_offset)
15833 (window_box_right, window_box_right_offset): Declare extern.
15834 Otherwise, these inline functions do not conform to C99 and
15835 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15836 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15837 * intervals.c (adjust_intervals_for_insertion)
15838 (adjust_intervals_for_deletion): Now extern, because otherwise the
15839 extern inline functions 'offset_intervals' couldn't refer to it.
15840 (static_offset_intervals): Remove.
15841 (offset_intervals): Rewrite using the old contents of
15842 static_offset_intervals. The old version didn't conform to C99
15843 because an extern inline function contained a reference to an
15844 identifier with static linkage.
15845
15846 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15847
15848 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15849 GC.
15850
15851 2011-11-06 Eli Zaretskii <eliz@gnu.org>
15852
15853 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15854 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15855 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15856 return Qleft_to_right.
15857
15858 2011-11-06 Chong Yidong <cyd@gnu.org>
15859
15860 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15861 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15862 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15863 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15864 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15865 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15866 (Fwindow_vscroll): Doc fix.
15867 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15868 argument, since it makes no sense to pass a live window and for
15869 consistency with window-child.
15870
15871 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15872
15873 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15874 support MSVC.
15875
15876 2011-11-05 Jason Rumney <jasonr@gnu.org>
15877
15878 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15879 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15880 fonts (Bug#6029).
15881 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15882 bitwise arithmetic preventing use of unicode-sip and non-truetype
15883 opentype fonts.
15884
15885 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15886
15887 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15888 "emacs"-only part.
15889
15890 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15891 initialization code to keep similarity to xfns.c after changes
15892 from 2011-11-05.
15893
15894 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15895
15896 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15897 (unwind_create_frame): New function (Bug#9943).
15898 (Fx_create_frame): Restructure code to be more similar to the one in
15899 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15900 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15901 Move terminal->reference_count++ just before making the frame official
15902 (Bug#9943).
15903
15904 * nsterm.m (x_free_frame_resources): New function.
15905 (x_destroy_window): Move code to x_free_frame_resources.
15906
15907 * xfns.c (unwind_create_frame): Fix comment.
15908 (Fx_create_frame, x_create_tip_frame):
15909 Move terminal->reference_count++ just before making the frame
15910 official. Move initialization of image_cache_refcount and
15911 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15912
15913 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15914
15915 Support MSVC build with newer versions of Visual Studio.
15916 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15917 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15918 nt/gmake.defs.
15919
15920 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15921 which are not supported by MSVC.
15922 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15923 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15924 bitfields.
15925 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15926 types in bitfields.
15927 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15928
15929 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15930
15931 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
15932
15933 Support MSVC build with newer versions of Visual Studio.
15934 * w32.c: Don't include w32api.h for MSVC.
15935 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15936
15937 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15938 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15939 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15940 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15941 e_* cousins.
15942 (alloca) [_MSC_VER]: Define to _alloca.
15943
15944 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15945
15946 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15947
15948 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15949
15950 * xdisp.c (note_mouse_highlight): If either of
15951 previous/next-single-property-change returns nil, treat that as
15952 the beginning or the end of the buffer. (Bug#9955)
15953
15954 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15955
15956 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
15957 label is not null (Bug#9951).
15958 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15959 may be NULL.
15960
15961 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15962
15963 * window.c (Fwindow_body_size): Mention in the doc string that the
15964 return value is in frame's canonical units. (Bug#9949)
15965
15966 2011-11-03 Eli Zaretskii <eliz@gnu.org>
15967
15968 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15969
15970 * w32fns.c (unwind_create_frame): If needed, free the glyph
15971 matrices of the partially constructed frame. (Bug#9943)
15972 * xfns.c (unwind_create_frame): Likewise.
15973
15974 2011-11-01 Eli Zaretskii <eliz@gnu.org>
15975
15976 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15977 Don't stop backward scan on the continuation glyph, even though
15978 its CHARPOS is positive.
15979 (mouse_face_from_buffer_pos, note_mouse_highlight):
15980 Rename cover_string to disp_string.
15981
15982 2011-11-01 Martin Rudalics <rudalics@gmx.at>
15983
15984 * window.c (temp_output_buffer_show): Don't use
15985 Vtemp_buffer_show_specifiers.
15986 (Vtemp_buffer_show_specifiers): Remove unused variable.
15987
15988 2011-10-30 Eli Zaretskii <eliz@gnu.org>
15989
15990 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15991 past the beginning of the current glyph matrix.
15992
15993 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
15994
15995 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15996 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15997 HAVE_GTK3 (Bug#9869).
15998
15999 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
16000 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
16001
16002 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
16003
16004 * xterm.c: Declare x_handle_net_wm_state to return int.
16005 (handle_one_xevent): Check if we are iconified but don't have
16006 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
16007 (get_current_wm_state): Return non-zero if not hidden,
16008 check for _NET_WM_STATE_HIDDEN (Bug#9893).
16009 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
16010 (x_handle_net_wm_state): Return what get_current_wm_state returns.
16011 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
16012
16013 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
16014
16015 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
16016 so that this new function doesn't get optimized away by a
16017 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
16018
16019 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16020
16021 * frame.h (MOUSE_HL_INFO): Remove excess parens.
16022
16023 2011-10-29 Eli Zaretskii <eliz@gnu.org>
16024
16025 Fix the `xbytecode' command.
16026 * .gdbinit (xprintbytestr): New command.
16027 (xwhichsymbols): Rename from `which'; all callers changed.
16028 (xbytecode): Print the byte-code string as well.
16029
16030 2011-10-29 Kim Storm <storm@cua.dk>
16031
16032 * alloc.c (which_symbols): New function.
16033
16034 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16035
16036 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16037 line. (Bug#9903)
16038
16039 2011-10-29 Glenn Morris <rgm@gnu.org>
16040
16041 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16042 Not clear what it was for, and it causes various bugs. (Bug#9839)
16043
16044 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16045
16046 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16047 possible random value that matches one of those tested as
16048 condition to clear the mouse face.
16049
16050 2011-10-28 Chong Yidong <cyd@gnu.org>
16051
16052 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16053
16054 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16055
16056 * window.c (make_window): Initialize phys_cursor_on_p.
16057
16058 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16059
16060 * lisp.h (struct Lisp_Symbol): Update comments.
16061
16062 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
16063
16064 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16065
16066 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16067
16068 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16069 <oslsachem@gmail.com> for helping to debug this.
16070
16071 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16072 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16073 (g_b_init_get_glyph_outline_w): New static variables.
16074 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16075 (GetGlyphOutlineW_Proc): New typedefs.
16076 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
16077 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16078 New functions.
16079 (w32font_open_internal, compute_metrics):
16080 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
16081 instead of calling the "wide" APIs directly.
16082
16083 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16084
16085 * w32.h (syms_of_w32font): Add prototype.
16086
16087 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16088
16089 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16090 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16091 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16092 (Fmove_to_window_line): Doc fix.
16093
16094 2011-10-27 Chong Yidong <cyd@gnu.org>
16095
16096 * process.c (make_process): Set gnutls_state to NULL.
16097
16098 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16099 non-NULL, regardless of GNUTLS_INITSTAGE.
16100 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16101 an error. Set process slots as soon as we allocate them.
16102
16103 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16104
16105 2011-10-27 Chong Yidong <cyd@gnu.org>
16106
16107 * gnutls.c (emacs_gnutls_deinit): New function.
16108 Deallocate credentials structures as well as calling gnutls_deinit.
16109 (Fgnutls_deinit, Fgnutls_boot): Use it.
16110
16111 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16112 (deactivate_process): Call emacs_gnutls_deinit.
16113
16114 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16115
16116 * image.c (x_create_x_image_and_pixmap):
16117 * w32.c (sys_rename, w32_delayed_load):
16118 * w32font.c (fill_in_logfont):
16119 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16120
16121 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
16122
16123 * w32fns.c (w32_default_color_map): New function,
16124 extracted from Fw32_default_color_map.
16125 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16126
16127 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16128
16129 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16130
16131 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16132
16133 * keyboard.c (test_undefined): New function (bug#9751).
16134 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16135
16136 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16137
16138 * sysdep.c (init_sys_modes): Fix the check for the controlling
16139 terminal (Bug#6649).
16140
16141 2011-10-20 Eli Zaretskii <eliz@gnu.org>
16142
16143 * dispextern.h (struct bidi_it): New member next_en_type.
16144
16145 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16146 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16147 current character, check also for next_en_type being WEAK_EN.
16148 (bidi_resolve_weak): Don't enter the expensive loop if the current
16149 position is before next_en_pos. Record the bidi type of the first
16150 non-ET, non-BN character we find, in addition to its position.
16151 (bidi_level_of_next_char): Invalidate next_en_type when
16152 next_en_pos is over-stepped.
16153
16154 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16155
16156 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16157 * editfns.c: Rewrite current-time-zone so that it invokes
16158 the equivalent of (format-time-string "%Z") to get the time zone name.
16159 This fixes a bug when the time zone name contains characters that
16160 need converting from the system time locale to Emacs internal format.
16161 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16162 that patch fixed format-time-string to do the conversion, but
16163 I forgot to fix current-time-zone.
16164 (format_time_string): New function, containing most of
16165 what Fformat_time_string used to contain.
16166 (Fformat_time_string): Rewrite in terms of format_time_string.
16167 This doesn't change this function's behavior.
16168 (current-time-zone): Rewrite to use format_time_string.
16169 This fixes the bug reported by Michael Schierl in
16170 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16171 Jason Rumney's 2007-06-07 change worked around this bug, but
16172 didn't fix it.
16173 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16174
16175 2011-10-19 Eli Zaretskii <eliz@gnu.org>
16176
16177 * xdisp.c (start_display): If the character at POS is displayed
16178 via a display vector, reset IT->current.dpvec_index to zero.
16179 (try_window_reusing_current_matrix): If a line ends in a display
16180 vector or the next line starts in a display vector, continue
16181 redrawing the window even though the character position of
16182 start_row was reached.
16183 (Bug#9771, part 2)
16184
16185 2011-10-18 Chong Yidong <cyd@gnu.org>
16186
16187 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16188 with nobreak-char-display too.
16189
16190 2011-10-18 Eli Zaretskii <eliz@gnu.org>
16191
16192 Fix part 3 of bug#9771.
16193 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16194 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16195 non-neutral characters if the current character is a paragraph
16196 separator (a.k.a. Newline). This avoids running the same
16197 expensive loop twice, once when we consume the preceding newline
16198 and the other time when the line actually needs to be displayed.
16199 Avoid the loop when we see neutrals on the base embedding level
16200 following a character whose directionality is the same as the
16201 paragraph's. This avoids running the expensive loop when a line
16202 ends in a long sequence of neutrals, like control characters.
16203 Add assertion against STRONG_AL type. Slightly rearrange code
16204 that determines the type of a neutral given the first non-neutral
16205 that follows it.
16206 (bidi_level_of_next_char): Set next_en_pos to zero when
16207 invalidating its info.
16208
16209 2011-10-17 Eli Zaretskii <eliz@gnu.org>
16210
16211 * xdisp.c (push_display_prop): Determine whether to record string
16212 or buffer position by IT->string, not by IT->method. Allow
16213 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16214 (move_it_vertically_backward): Don't look for character position
16215 immediately after the newline when in a continuation line.
16216 (Bug#9771, part 1)
16217
16218 2011-10-15 Martin Rudalics <rudalics@gmx.at>
16219
16220 * window.c (coordinates_in_window): Rewrite and delabelize
16221 vertical border check. (Bug#5357) (Bug#9618)
16222
16223 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16224
16225 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16226 errors in XSetWindowBorder (bug#9310).
16227
16228 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16229
16230 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16231 avoid crash when xmalloc overrun checking is enabled.
16232
16233 2011-10-13 Eli Zaretskii <eliz@gnu.org>
16234
16235 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16236 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16237 cursor motion with <left> and <right> arrow keys.
16238
16239 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16240 some callers set that themselves.
16241
16242 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16243
16244 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16245 display string and the previous row comes from the same string and
16246 is empty. (Bug#9739) (Bug#9738)
16247
16248 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16249
16250 * doc.c (get_doc_string): Encode file name (bug#9735).
16251
16252 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16253
16254 * bidi.c (bidi_level_of_next_char):
16255 * xdisp.c (get_visually_first_element): Remove old incorrect
16256 comments regarding the Unicode Line Separator character.
16257
16258 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16259
16260 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16261
16262 * alloc.c (Fgc_status): Do not access beyond zombies array
16263 boundary if nzombies > MAX_ZOMBIES.
16264 * alloc.c (dump_zombies): Add missing format specifier.
16265
16266 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16267
16268 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16269 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16270
16271 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16272 Some packages use them to denote characters with modifiers.
16273
16274 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16275
16276 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16277 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16278 matching a pp-number. Rename parameter var to var1.
16279
16280 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16281
16282 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16283
16284 2011-10-08 Glenn Morris <rgm@gnu.org>
16285
16286 * callint.c (Fcall_interactively): Give a more explicit error for the
16287 'c' case with a non-character input. (Bug#8479)
16288
16289 2011-10-08 Eli Zaretskii <eliz@gnu.org>
16290
16291 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16292 lines.
16293 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16294 lines that are hscrolled on the left.
16295
16296 * dispnew.c (buffer_posn_from_coords): Account for a possible
16297 presence of header-line. (Bug#4426)
16298
16299 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16300
16301 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16302 Don't advertise functionality which we discourage or doesn't work.
16303
16304 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16305
16306 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16307 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16308 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16309 this makes Emacs dump core during garbage collection on rare
16310 occasions. sizeof is obviously inferior to offsetof here, so
16311 stick with offsetof.
16312 (GC_POINTER_ALIGNMENT): New macro.
16313 (mark_memory): Omit 3rd (offset) arg; caller changed.
16314 Don't assume EMACS_INT alignment is the same as pointer alignment.
16315
16316 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16317
16318 * keyboard.c (read_key_sequence_remapped): New var.
16319 (read_key_sequence): Compute remapping in the right buffer.
16320 (command_loop_1): Use read_key_sequence's remapping directly.
16321
16322 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16323
16324 * dired.c (file_name_completion): Don't expand file name.
16325 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16326 before checking file name handler.
16327
16328 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16329 they've been requested explicitly (bug#9591).
16330
16331 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16332
16333 * keymap.c (Fsingle_key_description): Use make_specified_string
16334 instead of build_string to build string from push_key_description.
16335 (Bug#5193)
16336
16337 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16338
16339 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16340 This fixes a Y2038 bug on 64-bit hosts.
16341 * buffer.c (reset_buffer):
16342 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16343 (Fclear_buffer_auto_save_failure):
16344 Use 0, not -1, to represent an unset failure time, since time_t
16345 might not be signed.
16346
16347 Remove dependency on glibc malloc internals.
16348 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16349 Move back here from lisp.h, but with their new implementations.
16350 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16351 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16352 * charset.c (charset_table_init): New static var.
16353 (syms_of_charset): Use it instead of xmalloc. This removes a
16354 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16355 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16356 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16357 Move back to alloc.c.
16358 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16359 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16360
16361 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16362
16363 * nsterm.m (windowDidResize): Call x_set_window_size only when
16364 ns_in_resize is true. Otherwise set pixelwidth/height and
16365 call change_frame_size (Bug#9628).
16366
16367 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16368
16369 Port --enable-checking=all to Fedora 14 x86-64.
16370 * charset.c (syms_of_charset): Also account for glibc malloc's
16371 internal overhead when calculating the initial malloc maximum.
16372
16373 Port --enable-checking=all to Fedora 14 x86.
16374 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16375 Move to lisp.h.
16376 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16377 (overrun_check_realloc, overrun_check_free):
16378 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16379 That way, xmalloc returns a properly-aligned pointer even if
16380 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16381 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16382 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16383 into account when calculating the initial malloc maximum.
16384 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16385 Move here from alloc.c, so that charset.c can use it too.
16386 Properly align; the old code wasn't right for common 32-bit hosts
16387 when configured with --enable-checking=all.
16388 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16389 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16390
16391 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16392
16393 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16394 use EDOM.
16395
16396 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16397
16398 * xdisp.c (compute_display_string_end): If there's no display
16399 string at CHARPOS, return -1.
16400
16401 * bidi.c (bidi_fetch_char): When compute_display_string_end
16402 returns a negative value, treat the character as a normal
16403 character not covered by a display string. (Bug#9624)
16404
16405 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16406
16407 * lread.c (Fread_from_string): Fix typo in docstring.
16408
16409 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16410
16411 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16412 newline, reseat the iterator instead of bidi-iterating there one
16413 character at a time. (Bug#9610)
16414 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16415 TO_CHARPOS if the bidi iterator is at base embedding level.
16416
16417 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16418
16419 * lread.c (readevalloop): Use correct code for NBSP.
16420 (read1): Likewise. (Bug#9608)
16421
16422 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16423
16424 * dbusbind.c (Fdbus_register_signal): When service is not
16425 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16426
16427 2011-09-25 Glenn Morris <rgm@gnu.org>
16428
16429 * buffer.c (truncate-lines): Doc fix.
16430
16431 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16432
16433 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16434 (Fset_window_next_buffers): Doc fix.
16435
16436 2011-09-24 Glenn Morris <rgm@gnu.org>
16437
16438 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16439
16440 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16441
16442 Fix minor problems found by static checking.
16443 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16444 * indent.c (Fvertical_motion): Fix == vs = typo.
16445
16446 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16447
16448 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16449 Default value is now t. Doc fix.
16450
16451 * indent.c (Fvertical_motion): Compute and apply the overshoot
16452 logic when moving up, not only when moving down. Fix the
16453 confusing name and values of the it_overshoot_expected variable;
16454 logic changes accordingly. (Bug#9254) (Bug#9549)
16455
16456 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16457 CHARPOS is covered by a display string which includes newlines.
16458 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16459 is covered by a display string with embedded newlines.
16460
16461 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16462
16463 * dbusbind.c (Fdbus_register_signal): Add match rule to
16464 Vdbus_registered_objects_table. (Bug#9581)
16465 (Fdbus_register_method, Vdbus_registered_objects_table):
16466 Fix docstring.
16467
16468 2011-09-24 Jim Meyering <meyering@redhat.com>
16469
16470 do not ignore write error for any output size
16471 The previous change was incomplete.
16472 While it makes emacs --batch detect the vast majority of stdout
16473 write failures, errors were still ignored whenever the output size is
16474 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16475 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16476 && echo FAIL: ignored write error
16477 FAIL: ignored write error
16478 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16479 && echo FAIL: ignored write error
16480 FAIL: ignored write error
16481 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16482
16483 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16484
16485 * emacs.c (Fkill_emacs): In noninteractive mode exit
16486 non-successfully if a write error occurred on stdout. (Bug#9574)
16487
16488 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16489
16490 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16491 the xassert test.
16492
16493 * dispextern.h (struct it): Update the comment documenting what
16494 can it->OBJECT be.
16495
16496 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16497
16498 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16499 a display string, extend search for cursor position to end of row.
16500 (find_row_edges): If the row ends in a newline from a display
16501 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16502 Handle the case of a display string with multiple newlines.
16503 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16504 non-empty line. Fixes confusing cursor motion with arrow keys at
16505 the beginning of a line that starts with whitespace.
16506
16507 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16508
16509 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16510 (bug#9493).
16511
16512 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16513
16514 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16515 boolean (Bug#9154).
16516
16517 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16518
16519 * xdisp.c (display_line): Record maximum and minimum buffer
16520 positions even if no glyphs were produced (e.g., by a zero-width
16521 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16522 buffer positions that will be removed from the glyph row because
16523 they don't fit.
16524 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16525 column is beyond frame width: don't subtract 1 "pixel" when
16526 computing width of the stretch.
16527 (reseat_at_next_visible_line_start): Undo the change made on
16528 2011-09-17 that saved paragraph information and restored it after
16529 the call to `reseat'. (Bug#9545)
16530
16531 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16532
16533 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16534 and turn window cursor on if cleared (Bug#9415).
16535
16536 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16537
16538 * search.c (boyer_moore): Take unibyte characters from pattern
16539 literally. (Bug#9458)
16540
16541 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16542
16543 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16544
16545 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16546
16547 Fix minor problem found by static checking.
16548 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16549 initialized, to pacify gcc -Wuninitialized.
16550
16551 * fileio.c: Report proper errno when syscall falls.
16552 (Finsert_file_contents): Save and restore errno,
16553 so that report_file_error outputs the correct diagnostic.
16554 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16555
16556 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16557
16558 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16559
16560 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16561
16562 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16563 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16564
16565 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16566
16567 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16568 about the current paragraph and restore it after the call to reseat.
16569
16570 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16571 (bidi_find_paragraph_start): Search back for paragraph beginning
16572 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16573 (bidi_move_to_visually_next): Only trigger paragraph-related
16574 computations when the last character is a newline or at EOB, not
16575 just any NEUTRAL_B. (Bug#9470)
16576
16577 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16578 truncated lines if point is covered by a display string. (Bug#9524)
16579
16580 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16581
16582 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16583 (cons_to_x_long): New function.
16584 (lisp_data_to_selection_data): Use it. Correct the test for
16585 short-versus-long data; it was negated. Break out of vector
16586 loop, for efficiency, when a long datum is discovered.
16587
16588 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16589
16590 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16591
16592 2011-09-16 Eli Zaretskii <eliz@gnu.org>
16593
16594 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16595 GCC PR/17406) by declaring this function with external scope.
16596
16597 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16598
16599 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16600 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16601
16602 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16603
16604 * editfns.c (Fformat): Correctly handle text properties on "%%".
16605
16606 2011-09-15 Eli Zaretskii <eliz@gnu.org>
16607
16608 * xterm.c (x_draw_composite_glyph_string_foreground):
16609 * w32term.c (x_draw_composite_glyph_string_foreground):
16610 * term.c (encode_terminal_code):
16611 * composite.c (composition_update_it, get_composition_id):
16612 * xdisp.c (get_next_display_element)
16613 (fill_composite_glyph_string): Add comments about special meaning
16614 of TAB characters in a composition.
16615
16616 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16617
16618 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
16619 This occurs when processing a multibyte format.
16620 Problem reported by Wolfgang Jenker.
16621
16622 2011-09-15 Johan Bockgård <bojohan@gnu.org>
16623
16624 * xdisp.c (try_cursor_movement): Only check for exact match if
16625 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16626
16627 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16628
16629 Remove unused external symbols.
16630 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16631 * xdisp.c (calc_pixel_width_or_height): Now static.
16632 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16633 * indent.c (check_display_width):
16634 * w32term.c: Fix comment to match code.
16635 * xterm.c, xterm.h (x_catching_errors): Remove.
16636
16637 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16638
16639 * xselect.c: Use signed conversions more consistently (Bug#9498).
16640 (selection_data_to_lisp_data): Assume incoming selection data are
16641 signed integers, not unsigned. This is to be consistent with
16642 outgoing selection data, which was modified to use signed integers
16643 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16644 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16645 expects long, not unsigned long.
16646
16647 2011-09-14 Eli Zaretskii <eliz@gnu.org>
16648
16649 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16650 computation of loop end. Reported by Johan Bockgård
16651 <bojohan@gnu.org>.
16652
16653 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
16654
16655 * frame.c (Fother_visible_frames_p): Function deleted.
16656
16657 2011-09-12 Eli Zaretskii <eliz@gnu.org>
16658
16659 * indent.c (compute_motion): Process display vector front to back
16660 rather than the other way around. (Bug#2496)
16661
16662 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16663
16664 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16665
16666 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
16667
16668 * minibuf.c (Fread_from_minibuffer): Doc fix.
16669
16670 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16671
16672 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16673 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16674
16675 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16676
16677 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16678 value for non-existent files.
16679
16680 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16681
16682 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16683 set its "size" to -1. This will set the modtime_size field of
16684 the corresponding buffer to -1, which is what
16685 verify-visited-file-modtime expects for files that do not exist.
16686 (Bug#9139)
16687
16688 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16689
16690 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16691 here ...
16692 * lisp.h: ... from here. push_key_description is no longer
16693 defined in keyboard.c, so its declaration should not be in
16694 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16695 logically belongs with push_key_description.
16696
16697 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16698
16699 * buffer.h: Include <sys/types.h> instead of <time.h>.
16700 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16701 Problem reported by Herbert J. Skuhra.
16702
16703 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16704
16705 * xml.c (parse_region): Make the parsing work for
16706 non-comment-starting XML files again (bug#9144).
16707
16708 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16709
16710 * image.c (gif_load): Fix calculation of bottom and right corner.
16711 (Bug#9468)
16712
16713 2011-09-10 Eli Zaretskii <eliz@gnu.org>
16714
16715 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16716 redisplay in small windows.
16717
16718 2011-09-09 Eli Zaretskii <eliz@gnu.org>
16719
16720 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16721
16722 2011-09-08 Martin Rudalics <rudalics@gmx.at>
16723
16724 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16725 Operate on live windows only.
16726
16727 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
16728
16729 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16730
16731 2011-09-07 Eli Zaretskii <eliz@gnu.org>
16732
16733 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16734 only under bidi iteration.
16735
16736 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16737
16738 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16739
16740 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16741
16742 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16743 Without this fix, the command to link temacs failed due to an
16744 undefined symbol __builtin_isnan. This is because
16745 /usr/include/iso/math_c99.h #defines isnan(x) to
16746 __builtin_isnan(x), but the bundled gcc, which identifies itself
16747 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16748 a __builtin_isnan.
16749 * floatfns.c (isnan): #undef, and then #define to a clone of
16750 what's in data.c.
16751 (Fisnan): Always define, since it's always available now.
16752 (syms_of_floatfns): Always define isnan at the Lisp level.
16753
16754 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16755
16756 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16757
16758 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16759
16760 * fileio.c: Fix bugs with large file offsets (Bug#9428).
16761 The previous code assumed that file offsets (off_t values) fit in
16762 EMACS_INT variables, which is not true on typical 32-bit hosts.
16763 The code messed up by falsely reporting buffer overflow in cases
16764 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16765 when "big" contains more than 2**29 bytes, even though this
16766 inserts just one byte and does not overflow the buffer.
16767 (Finsert_file_contents): Store file offsets as off_t
16768 values, not as EMACS_INT values. Check for overflow when
16769 converting between EMACS_INT and off_t. When checking for
16770 buffer overflow or for overlap, take the offsets into account.
16771 Don't use EMACS_INT for small values where int suffices.
16772 When checking for overlap, fix a typo: ZV was used where
16773 ZV_BYTE was intended.
16774 (Fwrite_region): Don't assume off_t fits into 'long'.
16775 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16776
16777 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
16778
16779 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16780
16781 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16782
16783 sprintf-related integer and memory overflow issues (Bug#9412).
16784
16785 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
16786 (esprintf, exprintf, evxprintf): New functions.
16787 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
16788 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
16789 (modify_event_symbol): Do not assume that the length of
16790 name_alist_or_stem is safe to alloca and fits in int.
16791 (Fexecute_extended_command): Likewise for function name and binding.
16792 (Frecursion_depth): Wrap around reliably on integer overflow.
16793 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16794 since some callers pass EMACS_INT values.
16795 (Fsingle_key_description): Don't crash if symbol name contains more
16796 than MAX_ALLOCA bytes.
16797 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16798 (get_minibuffer): Arg is now EMACS_INT, not int.
16799 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
16800 (esprintf, exprintf, evxprintf): New decls.
16801 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16802
16803 * dbusbind.c (signature_cat): New function.
16804 (xd_signature, Fdbus_register_signal):
16805 Do not overrun buffer; instead, report string overflow.
16806
16807 * dispnew.c (add_window_display_history): Don't overrun buffer.
16808 Truncate instead; this is OK since it's just a log.
16809
16810 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16811 even if the time zone offset is outlandishly large.
16812 Don't mishandle offset == INT_MIN.
16813
16814 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16815 when creating daemon; the previous buffer-overflow check was incorrect.
16816
16817 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16818 which has the guts of the old verror function.
16819
16820 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16821 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16822
16823 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16824 (font_unparse_xlfd): Don't blindly alloca long strings.
16825 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
16826 fits in int, when using sprintf. Use single snprintf to count
16827 length of string rather than counting it via multiple sprintfs;
16828 that's simpler and more reliable.
16829 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16830 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16831 sprintf, in case result does not fit in int.
16832
16833 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16834 (fontset_from_font): Print it.
16835
16836 * frame.c (tty_frame_count): Now printmax_t, not int.
16837 (make_terminal_frame, set_term_frame_name): Print it.
16838 (x_report_frame_params): In X, window IDs are unsigned long,
16839 not signed long, so print them as unsigned.
16840 (validate_x_resource_name): Check for implausibly long names,
16841 and don't assume name length fits in 'int'.
16842 (x_get_resource_string): Don't blindly alloca invocation name;
16843 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16844 not fit in int.
16845
16846 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16847 (xg_check_special_colors, xg_set_geometry):
16848 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16849
16850 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16851 Use esprintf, not sprintf, in case result does not fit in int.
16852
16853 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16854 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16855 it as a large positive number.
16856 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16857 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16858
16859 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16860 in case result does not fit in int.
16861
16862 * print.c (float_to_string): Detect width overflow more reliably.
16863 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16864 buffer overrun. Don't assume list length fits in 'int'. Treat
16865 print length of 0 as 0, not as infinity; to be consistent with other
16866 uses of print length in this function. Don't overflow print length
16867 index. Don't assume hash table size fits in 'long', or that
16868 vectorlike size fits in 'unsigned long'.
16869
16870 * process.c (make_process): Use printmax_t, not int, to format
16871 process-name gensyms.
16872
16873 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16874
16875 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16876 to avoid potential buffer overrun.
16877
16878 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16879 if X resource line is longer than 512 bytes.
16880
16881 * xfns.c (x_window): Make sprintf buffer a bit bigger
16882 to avoid potential buffer overrun.
16883
16884 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16885
16886 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16887
16888 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16889
16890 Integer overflow fixes for scrolling, etc.
16891 Without these, Emacs silently mishandles large integers sometimes.
16892 For example, "C-u 4294967297 M-x recenter" was treated as if
16893 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16894
16895 * xdisp.c (try_window_id): Check Emacs fixnum range before
16896 converting to 'int'.
16897
16898 * window.c (window_scroll_line_based, Frecenter):
16899 Check that an Emacs fixnum is in range before assigning it to 'int'.
16900 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16901 values converted from Emacs fixnums.
16902 (Frecenter): Don't wrap around a line count if it is out of 'int'
16903 range; instead, treat it as an extreme value.
16904 (Fset_window_configuration, compare_window_configurations):
16905 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16906
16907 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16908 that can exceed INT_MAX. Check that EMACS_INT value is in range
16909 before assigning it to the (possibly-narrower) index.
16910 (match_limit): Don't assume that a fixnum can fit in 'int'.
16911
16912 * print.c (print_object): Use ptrdiff_t, not int, for index that can
16913 exceed INT_MAX.
16914
16915 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
16916 (Fvertical_motion): Don't wrap around LINES values that don't fit
16917 in 'int'. Instead, treat them as extreme values. This is good
16918 enough for windows, which can't have more than INT_MAX lines anyway.
16919
16920 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16921
16922 * Require libxml/parser.h to avoid compilation warning.
16923
16924 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16925
16926 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16927 since this reportedly can destroy thread storage.
16928
16929 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
16930
16931 * syntax.c (find_defun_start): Update all cache variables if
16932 exiting early (Bug#9401).
16933
16934 2011-08-30 Eli Zaretskii <eliz@gnu.org>
16935
16936 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16937
16938 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16939 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16940 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16941
16942 * term.c (tty_append_glyph): New function.
16943 (produce_stretch_glyph): Static function and its prototype deleted.
16944
16945 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16946 Add prototypes.
16947
16948 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16949
16950 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16951 when checking :margin (Bug#9390).
16952 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
16953 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
16954 so that the name doesn't mislead. All uses changed.
16955
16956 2011-08-28 Johan Bockgård <bojohan@gnu.org>
16957
16958 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16959 set_tty_hooks.
16960
16961 2011-08-27 Eli Zaretskii <eliz@gnu.org>
16962
16963 * xdisp.c (move_it_to): Don't bail out early when reaching
16964 position beyond to_charpos, if we are scanning backwards.
16965 (move_it_vertically_backward): When DY == 0, make sure we get to
16966 the first character in the line after the newline.
16967
16968 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16969
16970 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16971 (ccl_driver): Do not generate an out-of-range pointer.
16972 (Fccl_execute_on_string): Remove unnecessary check for
16973 integer overflow, noted by Stefan Monnier in
16974 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16975 Remove a FIXME that didn't need fixing.
16976 Simplify the newly-introduced buffer reallocation code.
16977
16978 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
16979
16980 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16981
16982 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
16983
16984 Integer and memory overflow issues (Bug#9196).
16985
16986 * doc.c (get_doc_string): Rework so that
16987 get_doc_string_buffer_size is the actual buffer size, rather than
16988 being 1 less than the actual buffer size; this makes xpalloc more
16989 convenient.
16990
16991 * image.c (x_allocate_bitmap_record, cache_image):
16992 * xselect.c (Fx_register_dnd_atom):
16993 Simplify previous changes by using xpalloc.
16994
16995 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16996 since either will do and ptrdiff_t is convenient with xpalloc.
16997
16998 * charset.c (charset_table_size)
16999 (struct charset_sort_data.priority): Now ptrdiff_t.
17000 (charset_compare): Don't overflow if priorities differ greatly.
17001 (Fsort_charsets): Don't assume list length fits in int.
17002 Check for size-calculation overflow when allocating sort data.
17003 (syms_of_charset): Allocate an initial charset table that is
17004 just under 64 KiB, to avoid problems with glibc malloc and mmap.
17005
17006 * cmds.c (internal_self_insert): Check for size-calculation overflow.
17007
17008 * composite.h (struct composition.glyph_len): Now int, not unsigned.
17009 The actual value is always <= INT_MAX, and leaving it unsigned made
17010 overflow checking harder.
17011
17012 * dispextern.h (struct glyph_matrix.rows_allocated)
17013 (struct face_cache.size): Now ptrdiff_t, for convenience in use
17014 with xpalloc. The values are still always <= INT_MAX.
17015
17016 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
17017
17018 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
17019 (SAFE_NALLOCA): New macro.
17020
17021 * region-cache.c (struct boundary.pos, find_cache_boundary)
17022 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
17023 (set_cache_region, invalidate_region_cache)
17024 (revalidate_region_cache, know_region_cache, region_cache_forward)
17025 (region_cache_backward, pp_cache):
17026 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
17027 so that ptrdiff_t * can be passed to xpalloc.
17028 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
17029 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
17030 (pp_cache): Don't assume cache_len fits in int.
17031 * region-cache.h: Adjust extern decls to match.
17032
17033 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
17034 EMACS_INT, since either will do, for xpalloc.
17035
17036 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
17037 (xnmalloc, xnrealloc, xpalloc): New functions.
17038
17039 * bidi.c (bidi_shelve_header_size): New constant.
17040 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17041 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17042
17043 * bidi.c (bidi_cache_shrink):
17044 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17045 (overlay_strings):
17046 Don't update size of array until after memory allocation succeeds,
17047 because xmalloc/xrealloc may not return.
17048 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17049 now that we have proper integer overflow checking.
17050 (record_overlay_string, overlay_strings): Catch overflows when
17051 calculating size of overlay_str_buf.
17052
17053 * callproc.c (Fcall_process): Check for size overflow when
17054 calculating size of args2.
17055 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17056 Normally we prefer signed values, but sticking with ptrdiff_t would
17057 require adding more-complicated checks.
17058
17059 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17060 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17061 Redo buffer-overflow calculations to avoid integer overflow.
17062 Add a FIXME comment where memory seems to be over-allocated.
17063
17064 * character.c (Fstring): Check for size-calculation overflow.
17065
17066 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17067 unnecessary integer overflow. Check for size overflow.
17068 (encode_coding_object): Don't update size until xmalloc succeeds.
17069
17070 * composite.c (get_composition_id): Check for overflow in glyph
17071 length calculations.
17072
17073 Integer and memory overflow fixes for display code.
17074 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17075 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17076 (scrolling_window): Check for overflow in size calculations.
17077 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17078 Don't assume glyph table len fits in int.
17079 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17080 (row_table_size): Now ptrdiff_t, not int.
17081 (scrolling_window): Avoid overflow in size calculations.
17082 Don't update size until allocation succeeds.
17083 * fns.c (concat): Check for overflow in size calculations.
17084 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17085 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17086 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17087
17088 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17089 (get_doc_string): Check for size calculation overflow.
17090 Don't update size until allocation succeeds.
17091 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17092 EMACS_INT, where ptrdiff_t will do.
17093 (Fsubstitute_command_keys): Check for string overflow.
17094
17095 * editfns.c (set_time_zone_rule): Don't assume environment length
17096 fits in int.
17097 (message_length): Now ptrdiff_t, not int.
17098 (Fmessage_box): Don't update size until allocation succeeds.
17099 Don't assume message length fits in int.
17100 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17101
17102 * emacs.c (main): Do not reallocate argv, since there is a null at
17103 the end that can be overwritten, and this way there's no need to
17104 worry about size-calculation overflow.
17105 (sort_args): Check for size-calculation overflow.
17106
17107 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17108 alloc succeeds.
17109 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17110
17111 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17112 (x_set_scroll_bar_width, x_figure_window_size):
17113 Check for integer overflow.
17114 (x_set_alpha): Do not assume XINT fits in int.
17115
17116 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17117 This is for the members text_lines, text_cols, total_lines, total_cols,
17118 where the system imposes an 'int' limit.
17119
17120 * fringe.c (Fdefine_fringe_bitmap):
17121 Don't update size until alloc works.
17122
17123 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17124 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17125
17126 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17127 Check for size-calculation overflow.
17128 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17129 do, as we prefer signed integers.
17130 (id_to_widget.max_size, id_to_widget.used)
17131 (xg_store_widget_in_map, xg_remove_widget_from_map)
17132 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17133 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17134 Use and return ptrdiff_t, not int.
17135 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17136 * gtkutil.h: Change prototypes to match the above.
17137
17138 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17139 are duplicate now that they've been promoted to lisp.h.
17140 (x_allocate_bitmap_record, x_alloc_image_color)
17141 (make_image_cache, cache_image, xpm_load):
17142 Don't update size until alloc is done.
17143 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17144 (x_detect_edges):
17145 Check for size calculation overflow.
17146 (ct_colors_allocated_max): New constant.
17147 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17148 overflow.
17149
17150 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17151 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17152 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17153 Use ptrdiff_t, not int, to count maps.
17154 (read_char_minibuf_menu_prompt): Check for overflow in size
17155 calculations. Don't update size until allocation succeeds.
17156 Redo calculations to avoid overflow.
17157 * keyboard.h: Change prototypes to match the above.
17158
17159 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17160 to count maps.
17161 (current_minor_maps): Check for size calculation overflow.
17162 * keymap.h: Change prototypes to match the above.
17163
17164 * lread.c (read1, init_obarray): Don't update size until alloc done.
17165
17166 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17167 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17168
17169 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17170 Now ptrdiff_t, not int.
17171 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17172 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17173
17174 * process.c (Fnetwork_interface_list): Check for overflow
17175 in size calculation.
17176
17177 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17178
17179 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17180 overflow. Don't bother calling xmalloc when xrealloc will do.
17181
17182 * search.c (Freplace_match): Check for size calculation overflow.
17183 (Fset_match_data): Don't assume list lengths fit in 'int'.
17184
17185 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17186 for command line length. Do not attempt to address one before the
17187 beginning of an array, as that's not portable.
17188
17189 * term.c (max_frame_lines): Remove; unused.
17190 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17191 not int.
17192 (encode_terminal_code, calculate_costs): Check for size
17193 calculation overflow.
17194 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17195 table lengths and related sizes. Don't update size until alloc
17196 done. Redo calculations to avoid overflow.
17197 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17198
17199 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17200 subtracting pointers.
17201 (gobble_line): Check for overflow more carefully. Don't update size
17202 until alloc done.
17203
17204 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17205 Don't update size until alloc done.
17206 Redo size calculations to avoid overflow.
17207 Check for size calculation overflow.
17208 (main) [DEBUG]: Fix typo in invoking tparam1.
17209
17210 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17211 Use ptrdiff_t, not int, for sizes.
17212 (store_mode_line_noprop_char): Don't update size until alloc done.
17213
17214 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17215 Use ptrdiff_t, not int, for sizes.
17216 (Finternal_make_lisp_face, cache_face):
17217 Check for size calculation overflow.
17218 (cache_face): Treat size calculation overflows as if they were
17219 memory exhaustion (the usual treatment), rather than aborting.
17220
17221 * xfns.c (x_encode_text, x_set_name_internal)
17222 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17223 sizes, since they can exceed INT_MAX in size. Check for size
17224 calculation overflow.
17225
17226 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17227 (xg_select): Check for size calculation overflow.
17228 Don't update size until alloc done.
17229
17230 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17231 as sprintf is limited to int lengths.
17232
17233 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17234 (X_LONG_MIN): New macros.
17235 Use them to make the following changes clearer.
17236 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17237 This change doesn't affect the value now, but it may help remind
17238 future maintainers not to raise the value too much later.
17239 (SELECTION_QUANTUM): Remove, replacing with ...
17240 (selection_quantum): ... new function, which avoids overflow.
17241 All uses changed.
17242 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17243 assumption that selection length fits in 'int'.
17244 (x_reply_selection_request, x_handle_selection_request)
17245 (x_get_window_property, receive_incremental_selection)
17246 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17247 (lisp_data_to_selection_data, clean_local_selection_data):
17248 Use ptrdiff_t, not int, to record length of selection.
17249 (x_reply_selection_request, x_get_window_property)
17250 (receive_incremental_selection, x_property_data_to_lisp):
17251 Redo calculations to avoid overflow.
17252 (x_reply_selection_request): When sending hint, ceiling it at
17253 X_LONG_MAX rather than relying on wraparound overflow to send
17254 something.
17255 (x_get_window_property, receive_incremental_selection)
17256 (lisp_data_to_selection_data, x_property_data_to_lisp):
17257 Check for size-calculation overflow.
17258 (x_get_window_property, receive_incremental_selection)
17259 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17260 Don't store size until memory allocation succeeds.
17261 (x_get_window_property): Plug memory leak on memory exhaustion.
17262 Don't double-block input; malloc is safe here. Don't assume 2**34
17263 - 4 fits in unsigned long. Add an xassert to check
17264 XGetWindowProperty overflow. Be more careful about overflow
17265 calculations, and distinguish size from memory overflow better.
17266 (receive_incremental_selection): When tracing, don't assume
17267 unsigned int is less than INT_MAX.
17268 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17269 harmful) conversions of unsigned short to int.
17270 (lisp_data_to_selection_data): Don't assume that integers
17271 in the range -65535 through -1 fit in an X unsigned short.
17272 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17273 result parameters unless successful. Rely on cons_to_unsigned
17274 to report problems with elements; the old code wasn't right anyway.
17275 (x_check_property_data): Check for int overflow; we cannot use
17276 a wider type due to X limits.
17277 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17278
17279 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17280
17281 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17282 (x_term_init): Check for size calculation overflow.
17283 (x_color_cells): Don't store size until memory allocation succeeds.
17284 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17285 Don't assume alloca size is less than MAX_ALLOCA.
17286 (x_term_init): Don't assume length fits in int (sprintf is limited
17287 to int size).
17288
17289 Use ptrdiff_t for composition IDs.
17290 * character.c (lisp_string_width):
17291 * composite.c (composition_table_size, n_compositions)
17292 (get_composition_id, composition_gstring_from_id):
17293 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17294 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17295 * window.c (Frecenter):
17296 Use ptrdiff_t, not int, for composition IDs.
17297 * composite.c (get_composition_id): Check for integer overflow.
17298 * composite.h: Adjust prototypes to match the above changes.
17299
17300 Use ptrdiff_t for hash table indexes.
17301 * category.c (hash_get_category_set):
17302 * ccl.c (ccl_driver):
17303 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17304 * coding.c (coding_system_charset_list, detect_coding_system):
17305 * coding.h (struct coding_system.id):
17306 * composite.c (get_composition_id, gstring_lookup_cache):
17307 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17308 * image.c (xpm_get_color_table_h):
17309 * lisp.h (hash_lookup, hash_put):
17310 * minibuf.c (Ftest_completion):
17311 Use ptrdiff_t for hash table indexes, not int (which is too
17312 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17313 32-bit --with-wide-int hosts).
17314
17315 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17316 Add a FIXME comment about memory leaks.
17317 (syms_of_charset): Don't assume xmalloc returns.
17318
17319 Don't assume that stated character widths fit in int.
17320 * character.c (Fchar_width, c_string_width, lisp_string_width):
17321 * character.h (CHAR_WIDTH):
17322 * indent.c (MULTIBYTE_BYTES_WIDTH):
17323 Use sanitize_char_width to avoid undefined and/or bad behavior
17324 with outlandish widths.
17325 * character.h (sanitize_tab_width): Rename from sanitize_width,
17326 now that we have two such functions. All uses changed.
17327 (sanitize_char_width): New inline function.
17328
17329 Don't assume that tab-width fits in int.
17330 * character.h (sanitize_width): New inline function.
17331 (SANE_TAB_WIDTH): New macro.
17332 (ASCII_CHAR_WIDTH): Use it.
17333 * indent.c (sane_tab_width): Remove. All uses replaced by
17334 SANE_TAB_WIDTH (current_buffer).
17335 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17336
17337 * fileio.c: Integer overflow issues with file modes.
17338 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17339
17340 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17341 Remove unreachable code.
17342 (read_hex, load_charset_map_from_file): Check for integer overflow.
17343
17344 * xterm.c: Don't go over XClientMessageEvent limit.
17345 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17346 (x_send_scroll_bar_event): Likewise. Check that the size does not
17347 exceed limits imposed by XClientMessageEvent, as well as the usual
17348 ptrdiff_t and size_t limits.
17349
17350 * keyboard.c: Overflow, signedness and related fixes.
17351 (make_lispy_movement): Use same integer type in forward decl
17352 that is used in the definition.
17353 (read_key_sequence, keyremap_step):
17354 Change bufsize argument back to int, undoing my 2011-03-30 change.
17355 We prefer signed types, and int is wide enough here.
17356 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17357 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17358 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17359 length, not size_t. Use ptrdiff_t for index, not int.
17360 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17361 possibility of integer overflow.
17362
17363 Overflow, signedness and related fixes for images.
17364
17365 * dispextern.h (struct it.stack[0].u.image.image_id)
17366 (struct_it.image_id, struct image.id, struct image_cache.size)
17367 (struct image_cache.used, struct image_cache.ref_count):
17368 * gtkutil.c (update_frame_tool_bar):
17369 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17370 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17371 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17372 * nsmenu.m (update_frame_tool_bar):
17373 * xdisp.c (calc_pixel_width_or_height):
17374 * xfns.c (image_cache_refcount):
17375 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17376 on typical 64-bit hosts.
17377
17378 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17379 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17380 Omit unnecessary casts to int.
17381 (parse_image_spec): Check that integers fall into 'int' range
17382 when the callers expect that.
17383 (image_ascent): Redo ascent calculation to avoid int overflow.
17384 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17385 (lookup_image): Remove unnecessary tests.
17386 (xbm_image_p): Locals are now of int, not EMACS_INT,
17387 since parse_image_check makes sure they fit into int.
17388 (png_load, gif_load, svg_load_image):
17389 Prefer int to unsigned where either will do.
17390 (tiff_handler): New function, combining the cores of the
17391 old tiff_error_handler and tiff_warning_handler.
17392 This function is rewritten to use vsnprintf and thereby avoid
17393 stack buffer overflows. It uses only the features of vsnprintf
17394 that are common to both POSIX and native Microsoft.
17395 (tiff_error_handler, tiff_warning_handler): Use it.
17396 (tiff_load, gif_load, imagemagick_load_image):
17397 Don't assume :index value fits in 'int'.
17398 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17399 (imagemagick_load_image): Check that crop parameters fit into
17400 the integer types that MagickCropImage accepts. Don't assume
17401 Vimagemagick_render_type has a nonnegative value. Don't assume
17402 size_t fits in 'long'.
17403 (gs_load): Use printmax_t to print the widest integers possible.
17404 Check for integer overflow when computing image height and width.
17405
17406 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17407
17408 * xdisp.c (redisplay_window): Don't force window start if point
17409 will be invisible in the resulting window. (Bug#9324)
17410
17411 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17412
17413 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17414 the display spec is of the form `(space ...)'.
17415 (handle_display_spec): Return the value returned by
17416 handle_single_display_spec, not just 1 or zero.
17417 (handle_single_display_spec): If the display spec is of the form
17418 `(space ...)', and specifies display in the text area, return 2
17419 rather than 1.
17420 (try_cursor_movement): Check for the need to scroll more
17421 accurately, and prefer exact match for point under bidi.
17422 Don't advance `row' beyond the last row of the window.
17423
17424 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17425 into disp_prop; all users changed.
17426
17427 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17428 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17429 for the text covered by the display property.
17430
17431 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17432
17433 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17434 Change return value to nil.
17435 (Frecord_buffer): Delete unused function.
17436
17437 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17438
17439 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17440 buffers, return left-to-right.
17441 (set_cursor_from_row): Consider candidate row a win if its glyph
17442 represents a newline and point is on that newline. Fixes cursor
17443 positioning on the newline at EOL of R2L text within L2R
17444 paragraph, and vice versa.
17445 (try_cursor_movement): Check continued rows, in addition to
17446 continuation rows. Fixes unwarranted scroll when point enters a
17447 continued line of R2L text within an L2R paragraph, or vice versa.
17448 (cursor_row_p): Consider the case of point being equal to
17449 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17450 from the end of a short line to the beginning of a continued line
17451 of R2L text within L2R paragraph.
17452 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17453 composed characters.
17454
17455 * bidi.c (bidi_check_type): Use xassert.
17456 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17457 members.
17458
17459 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17460
17461 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17462 a character.
17463
17464 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17465
17466 * nsfont.m (ns_otf_to_script): Fix typo.
17467
17468 2011-08-22 Kenichi Handa <handa@m17n.org>
17469
17470 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17471 extra slot even if the purpose is char-code-property-table.
17472
17473 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17474
17475 * xdisp.c (redisplay_window): When computing centering_position,
17476 account for the height of the header line. (Bug#8874)
17477
17478 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17479 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17480 candidate is selected by the mouse, and that candidate has a
17481 composed character under the mouse.
17482
17483 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17484 coordinates reported by pos-visible-in-window-p for a composed
17485 character in column zero.
17486
17487 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17488
17489 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17490
17491 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17492
17493 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17494 consider it a hit if to_charpos is anywhere in the range of the
17495 composed buffer positions.
17496
17497 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17498
17499 * image.c (gif_load): Don't assume that each subimage has the same
17500 dimensions as the base image. Handle disposal method that is
17501 "undefined" by the gif spec (Bug#9335).
17502
17503 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17504
17505 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17506 (Fcondition_case): Document `debug' symbol in error handler.
17507
17508 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17509
17510 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17511 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17512 from an Org mode buffer to a Speedbar frame.
17513
17514 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17515 a composition, take its buffer position from IT->cmp_it.charpos.
17516 Fixes cursor positioning at the beginning of a line that begins
17517 with a composed character.
17518
17519 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17520
17521 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17522 character bidirectional type, use STRONG_L instead. Fixes crashes
17523 in a buffer produced by `describe-categories'.
17524
17525 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17526 members before the level stack, so they would be saved and
17527 restored when copying iterator state. Fixes incorrect reordering
17528 around TABs covered by display properties.
17529
17530 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17531
17532 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17533
17534 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17535
17536 * eval.c (internal_condition_case, internal_condition_case_1)
17537 (internal_condition_case_2, internal_condition_case_n):
17538 Remove unnecessary aborts (Bug#9081).
17539
17540 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17541
17542 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17543 has no `load' handler, try opening the file locally. (Bug#9311)
17544
17545 2011-08-16 Ken Brown <kbrown@cornell.edu>
17546
17547 * gmalloc.c: Expand comment.
17548
17549 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17550
17551 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17552 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17553
17554 2011-08-16 Ken Brown <kbrown@cornell.edu>
17555
17556 Fix memory allocation problems in Cygwin build (Bug#9273).
17557
17558 * unexcw.c ( __malloc_initialized): Declare external variable.
17559 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17560
17561 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17562 New variables.
17563 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17564 dumped emacs.
17565 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17566 in the static heap.
17567 [CYGWIN] (special_realloc): New function.
17568 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17569 requests to realloc storage in the static heap.
17570
17571 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17572
17573 * bidi.c (bidi_initialize): Remove unused local.
17574
17575 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17576
17577 * bidimirror.h:
17578 * biditype.h: Remove file.
17579 * makefile.w32-in ($(BLD)/bidi.$(O)):
17580 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17581
17582 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17583
17584 * chartab.c: Improve commentary for the uniprop_table API.
17585
17586 * bidi.c (bidi_paragraph_init): Support zero value of
17587 bidi_ignore_explicit_marks_for_paragraph_level.
17588 (bidi_initialize): Use uniprop_table instead of including
17589 biditype.h and bidimirror.h.
17590
17591 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17592 coordinates of the iterator when restoring from ppos_it.
17593 (Bug#9296)
17594
17595 2011-08-14 Kenichi Handa <handa@m17n.org>
17596
17597 * process.c (create_process): Call setup_process_coding_systems
17598 after the pid of the process is set to -1 (Bug#8162).
17599
17600 2011-08-14 Eli Zaretskii <eliz@gnu.org>
17601
17602 * xdisp.c (move_it_in_display_line_to): Don't invoke
17603 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17604 ppos_it. Fixes vertical cursor motion when line beginning is
17605 covered by an image. (Bug#9296)
17606
17607 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17608
17609 * nsterm.h (ns_run_ascript): Declare.
17610 (NSAPP_DATA2_RUNASSCRIPT): Define.
17611
17612 * nsfns.m (as_script, as_result, as_status): New static variables.
17613 (ns_run_ascript): New function.
17614 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
17615 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17616 the event loop. Get status from as_status (Bug#7276).
17617
17618 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17619 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17620 the event loop (Bug#7276).
17621
17622 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17623
17624 * gnutls.c (QCgnutls_bootprop_priority)
17625 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17626 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17627 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17628 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17629 (QCgnutls_bootprop_verify_hostname_error)
17630 (QCgnutls_bootprop_callbacks_verify): Rename from
17631 Qgnutls_bootprop_..., all uses changed.
17632
17633 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17634 uses changed.
17635
17636 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17637
17638 * xfaces.c (Qframe_set_background_mode): Now static.
17639 * dispextern.h (Qframe_set_background_mode): Remove decl.
17640
17641 * process.c (Fnetwork_interface_info): Declare local only if needed.
17642
17643 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17644
17645 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17646 (Fnetwork_interface_list): Allocate in increments of bytes instead
17647 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17648 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17649 sockaddr.
17650 (struct ifflag_def): notrailers is smart on OSX.
17651 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17652 Get hardware address with getifaddrs if available.
17653
17654 2011-08-12 Eli Zaretskii <eliz@gnu.org>
17655
17656 * xdisp.c (iterate_out_of_display_property): xassert that
17657 IT->position is set to within IT->object's boundaries. Break from
17658 the loop as soon as EOB is reached; avoids infloops in redisplay
17659 when IT->position is set up wrongly due to some bug.
17660 Set IT->current to match the bidi iterator unconditionally.
17661 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17662 entry. Force push_it to save on the stack the current
17663 buffer/string position, to be restored by pop_it. Fix flags in
17664 the iterator structure wrt the object coming from a display
17665 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17666 properties. (Bug#9284)
17667
17668 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
17669
17670 * fontset.c (fontset_get_font_group): Add proper type checks.
17671 (Bug#9172)
17672
17673 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17674
17675 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17676 and LC_VERSION_MIN_MACOSX.
17677 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17678 (dump_it) [LC_FUNCTION_STARTS]: Use it.
17679
17680 2011-08-08 Eli Zaretskii <eliz@gnu.org>
17681
17682 * xdisp.c (forward_to_next_line_start): Allow to use the
17683 no-display-properties-and-no-overlays under bidi display.
17684 Set disp_pos in the bidi iterator to avoid searches for display
17685 properties and overlays.
17686
17687 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
17688
17689 * editfns.c (Fset_time_zone_rule): Document relationship with the
17690 setenv function.
17691
17692 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17693 the font entity extracted from the cache (Bug#8109).
17694
17695 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
17696
17697 * composite.c (autocmp_chars): Don't reset point. That is done by
17698 restore_point_unwind (Bug#5984).
17699
17700 2011-08-07 Juri Linkov <juri@jurta.org>
17701
17702 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17703 to show the arg `TIME' instead of `TIMEVAL'.
17704
17705 2011-08-06 Eli Zaretskii <eliz@gnu.org>
17706
17707 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17708 display property strides EOL and includes a newline, as in
17709 longlines-mode. (Bug#9254)
17710 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17711 word-wrap under bidirectional display. (Bug#9224)
17712
17713 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17714 is non-zero, even if the data buffer is NULL. Fixes a crash in
17715 vertical-motion with longlines-mode. (Bug#9254)
17716
17717 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17718
17719 * bidi.c <bidi_cache_total_alloc>: Now static.
17720 (bidi_initialize): Initialize bidi_cache_total_alloc.
17721
17722 * xdisp.c (display_line): Release buffer allocated for shelved bidi
17723 cache. (Bug#9221)
17724
17725 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17726 amount allocated this far in `bidi_cache_total_alloc'.
17727 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17728 non-zero, only free the data buffer without restoring the cache
17729 contents. All callers changed.
17730
17731 * dispextern.h (bidi_unshelve_cache): Update prototype.
17732
17733 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17734 (move_it_in_display_line, move_it_to)
17735 (move_it_vertically_backward, move_it_by_lines): Replace the call
17736 to xfree to an equivalent call to bidi_unshelve_cache.
17737 (move_it_in_display_line_to): Fix logic of returning
17738 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
17739
17740 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17741
17742 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17743 came from a string character with a `cursor' property. (Bug#9229)
17744
17745 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17746
17747 * Makefile.in (LIB_PTHREAD): New variable.
17748 (LIBES): Add LIB_PTHREAD (Bug#9216).
17749
17750 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17751 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17752
17753 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17754
17755 * regex.c (re_iswctype): Remove some redundant boolean conversions.
17756
17757 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17758
17759 * xterm.c (x_find_topmost_parent): New function.
17760 (x_set_frame_alpha): Find topmost parent window with
17761 x_find_topmost_parent and set the property there also (bug#9181).
17762 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17763
17764 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17765
17766 * callproc.c (Fcall_process): Avoid vfork clobbering
17767 the local vars buffer, coding_systems, current_dir.
17768
17769 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17770
17771 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17772
17773 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17774
17775 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17776 so that it is not optimized away.
17777
17778 * xdisp.c (compute_display_string_pos): Remove unused local.
17779
17780 2011-08-02 Eli Zaretskii <eliz@gnu.org>
17781
17782 Fix slow cursor motion and scrolling in large buffers with
17783 selective display, like Org Mode buffers. (Bug#9218)
17784
17785 * dispextern.h (struct bidi_it): New member disp_prop_p.
17786
17787 * xdisp.c: Remove one-slot cache of display string positions.
17788 (compute_display_string_pos): Accept an additional argument
17789 DISP_PROP_P; callers changed. Scan at most 5K characters forward
17790 for a display string or property. If found, set DISP_PROP_P
17791 non-zero.
17792
17793 * bidi.c (bidi_fetch_char): Accept an additional argument
17794 DISP_PROP_P, and pass it to compute_display_string_pos.
17795 Only handle text covered by a display string if DISP_PROP_P is returned
17796 non-zero. All callers of bidi_fetch_char changed.
17797
17798 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17799
17800 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17801
17802 2010-12-03 Don March <don@ohspite.net>
17803
17804 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17805 last character M-[char] is translated to ESC [char] (bug#7541).
17806
17807 2011-08-02 Kenichi Handa <handa@m17n.org>
17808
17809 * lisp.h (uniprop_table): Extern it.
17810
17811 * chartab.c (uniprop_table): Make it non-static.
17812
17813 2011-08-01 Eli Zaretskii <eliz@gnu.org>
17814
17815 * xdisp.c (forward_to_next_line_start): Accept additional argument
17816 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17817 on the newline.
17818 (reseat_at_next_visible_line_start): Use the bidi iterator state
17819 returned by forward_to_next_line_start to restore the state of
17820 it->bidi_it after backing up to previous newline. (Bug#9212)
17821
17822 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17823
17824 * regex.c (re_comp): Protoize.
17825 (re_exec): Fix return type.
17826 (regexec): Fix type of `ret'. (Bug#9203)
17827
17828 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17829
17830 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17831 This is needed if max-image-size is a floating-point number.
17832
17833 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17834
17835 * print.c (print_object): Print empty symbol as ##.
17836
17837 * lread.c (read1): Read ## as empty symbol.
17838
17839 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17840
17841 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17842 setting frame foreground color (Bug#9175).
17843 (x_set_background_color): Likewise.
17844
17845 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17846 contents (Bug#9176).
17847 (EmacsTooltip -init): Remove bezels and add shadows to
17848 tooltip windows.
17849
17850 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17851 or scroll bar (Bug#8470).
17852
17853 * nsfont.m (nsfont_open): Remove assignment to voffset and
17854 unnecessary vars hshink, expand, hd, full_height, min_height.
17855 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17856
17857 * nsterm.h (nsfont_info): Remove voffset field.
17858
17859 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17860
17861 Implement strike-through and overline on NextStep (Bug#8863).
17862
17863 * nsfont.m (nsfont_open): Use underline position provided by font,
17864 instead of hard-coded value of 2.
17865 (nsfont_draw): Call ns_draw_text_decoration instead.
17866
17867 * nsterm.h: Add declaration for ns_draw_text_decoration.
17868
17869 * nsterm.m (ns_draw_text_decoration): New function for drawing
17870 underline, overline, and strike-through.
17871 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17872 ns_draw_text_decoration. Change treatment of cursor drawing to
17873 accommodate underlining, etc.
17874
17875 2011-07-28 Eli Zaretskii <eliz@gnu.org>
17876
17877 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17878 default.
17879
17880 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17881
17882 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17883 Without this fix, if a signal arrives just after memory fills up,
17884 'malloc' might be invoked reentrantly.
17885
17886 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17887 In other words, assume that every image size is allowed, on non-X
17888 hosts. This assumption is probably wrong, but it lets Emacs compile.
17889
17890 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17891
17892 * regex.c (re_iswctype): Convert return values to boolean.
17893
17894 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17895
17896 * xdisp.c (compute_display_string_pos): Don't use cached display
17897 string position if the buffer had its restriction changed.
17898 (Bug#9184)
17899
17900 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17901
17902 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17903
17904 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17905
17906 Integer signedness and overflow and related fixes. (Bug#9079)
17907
17908 * bidi.c: Integer size and overflow fixes.
17909 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17910 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17911 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17912 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17913 (bidi_find_other_level_edge):
17914 Use ptrdiff_t instead of EMACS_INT where either will do.
17915 This works better on 32-bit hosts configured --with-wide-int.
17916 (bidi_cache_ensure_space): Check for size-calculation overflow.
17917 Use % rather than repeated addition, for better worst-case speed.
17918 Don't set bidi_cache_size until after xrealloc returns, because it
17919 might not return.
17920 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
17921 (bidi_cache_ensure_space): Also check that the bidi cache size
17922 does not exceed that of the largest Lisp string or buffer. See Eli
17923 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
17924
17925 * alloc.c (__malloc_size_t): Remove.
17926 All uses replaced by size_t. See Andreas Schwab's note
17927 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17928
17929 * image.c: Improve checking for integer overflow.
17930 (check_image_size): Assume that f is nonnull, since
17931 it is always nonnull in practice. This is one less thing to
17932 worry about when checking for integer overflow later.
17933 (x_check_image_size): New function, which checks for integer
17934 overflow issues inside X.
17935 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17936 This removes the need for a memory_full check.
17937 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17938 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17939 (xbm_read_bitmap_data): Change locals back to 'int', since
17940 their values must fit in 'int'.
17941 (xpm_load_image, png_load, tiff_load):
17942 Invoke x_create_x_image_and_pixmap earlier,
17943 to avoid much needless work if the image is too large.
17944 (tiff_load): Treat overly large images as if
17945 x_create_x_image_and_pixmap failed, not as malloc failures.
17946 (gs_load): Use x_check_image_size.
17947
17948 * gtkutil.c: Omit integer casts.
17949 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17950 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17951
17952 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17953
17954 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17955 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17956 would wrongly return t on a 64-bit host.
17957
17958 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17959 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17960 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17961 and therefore cause GCC to emit a bogus diagnostic in some cases.
17962
17963 * image.c: Integer signedness and overflow and related fixes.
17964 This is not an exhaustive set of fixes, but it's time to
17965 record what I've got.
17966 (lookup_pixel_color, check_image_size): Remove redundant decls.
17967 (check_image_size): Don't assume that arbitrary EMACS_INT values
17968 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17969 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17970 (tiff_load, imagemagick_load_image):
17971 Check for overflow in size calculations.
17972 (x_create_x_image_and_pixmap): Remove unnecessary test for
17973 xmalloc returning NULL; that can't happen.
17974 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17975 (xpm_color_bucket): Use better integer hashing function.
17976 (xpm_cache_color): Don't possibly over-allocate memory.
17977 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17978 (gif_memory_source):
17979 Use ptrdiff_t, not int or size_t, to record sizes.
17980 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17981 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17982 either works, as we prefer signed integers.
17983 (tiff_read_from_memory, tiff_write_from_memory):
17984 Return tsize_t, not size_t, since that's what the TIFF API wants.
17985 (tiff_read_from_memory): Don't fail simply because the read would
17986 go past EOF; instead, return a short read.
17987 (tiff_load): Omit no-longer-needed casts.
17988 (Fimagemagick_types): Don't assume size fits into 'int'.
17989
17990 Improve hashing quality when configured --with-wide-int.
17991 * fns.c (hash_string): New function, taken from sxhash_string.
17992 Do not discard information about ASCII character case; this
17993 discarding is no longer needed.
17994 (sxhash-string): Use it. Change sig to match it. Caller changed.
17995 * lisp.h: Declare it.
17996 * lread.c (hash_string): Remove, since we now use fns.c's version.
17997 The fns.c version returns a wider integer if --with-wide-int is
17998 specified, so this should help the quality of the hashing a bit.
17999
18000 * emacs.c: Integer overflow minor fix.
18001 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
18002 Define only if GNU_LINUX.
18003 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
18004
18005 * dispnew.c: Integer signedness and overflow fixes.
18006 Remove unnecessary forward decls, that were a maintenance hassle.
18007 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
18008 All uses changed.
18009 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
18010 (scrolling_window): Use ptrdiff_t, not int, for byte count.
18011 (prepare_desired_row, line_draw_cost):
18012 Use int, not unsigned, where either works.
18013 (save_current_matrix, restore_current_matrix):
18014 Use ptrdiff_t, not size_t, where either works.
18015 (init_display): Check for overflow more accurately, and without
18016 relying on undefined behavior.
18017
18018 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
18019 Remove, replacing with the new symbols in lisp.h. All uses changed.
18020 * fileio.c (make_temp_name):
18021 * filelock.c (lock_file_1, lock_file):
18022 * xdisp.c (message_dolog):
18023 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
18024 Use pMd etc. instead.
18025 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
18026 replacing the pWIDE etc. symbols removed from editfns.c.
18027
18028 * keyboard.h (num_input_events): Now uintmax_t.
18029 This is (very slightly) less likely to mess up due to wraparound.
18030 All uses changed.
18031
18032 * buffer.c: Integer signedness fixes.
18033 (alloc_buffer_text, enlarge_buffer_text):
18034 Use ptrdiff_t rather than size_t when either will do, as we prefer
18035 signed integers.
18036
18037 * alloc.c: Integer signedness and overflow fixes.
18038 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18039 (__malloc_size_t): Default to size_t, not to int.
18040 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18041 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18042 Prefer ptrdiff_t to size_t when either would do, as we prefer
18043 signed integers.
18044 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18045 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18046 Now const. Initialize with values that are in range even if char
18047 is signed.
18048 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18049 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18050 These functions do the right thing with sizes > 2**32.
18051 (check_depth): Now ptrdiff_t, not int.
18052 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18053 Adjust to new way of storing sizes. Check for size overflow bugs
18054 in rest of code.
18055 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18056 slightly wrong anyway, as it missed one instance of
18057 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18058 (refill_memory_reserve): Omit needless cast to size_t.
18059 (mark_object_loop_halt): Mark as externally visible.
18060
18061 * xselect.c: Integer signedness and overflow fixes.
18062 (Fx_register_dnd_atom, x_handle_dnd_message):
18063 Use ptrdiff_t, not size_t, since we prefer signed.
18064 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18065 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18066 x_dnd_atoms_size and x_dnd_atoms_length.
18067
18068 * doprnt.c: Prefer signed to unsigned when either works.
18069 * eval.c (verror):
18070 * doprnt.c (doprnt):
18071 * lisp.h (doprnt):
18072 * xdisp.c (vmessage):
18073 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18074 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18075 prefer signed arithmetic to avoid comparison confusion.
18076 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18077 but is a bit tricky.
18078
18079 Assume freestanding C89 headers, string.h, stdlib.h.
18080 * data.c, doprnt.c, floatfns.c, print.c:
18081 Include float.h unconditionally.
18082 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18083 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18084 * regex.c: Likewise for stddef.h, string.h.
18085 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18086 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18087 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18088 (STDC_HEADERS): Remove obsolete defines.
18089 * sysdep.c: Include limits.h unconditionally.
18090
18091 Assume support for memcmp, memcpy, memmove, memset.
18092 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18093 * regex.c (memcmp, memcpy):
18094 Remove; we assume C89 now.
18095
18096 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18097 (__malloc_safe_bcopy): Remove; no longer needed.
18098
18099 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18100 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18101 well either way, and we prefer signed to unsigned.
18102
18103 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18104
18105 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18106 closes the connection while we're reading (bug#9182).
18107
18108 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18109
18110 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18111 are specified (Bug#9168).
18112
18113 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18114
18115 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18116 Found by GCC static checking and --with-wide-int on a 32-bit host.
18117
18118 2011-07-25 Eli Zaretskii <eliz@gnu.org>
18119
18120 * xdisp.c (compute_display_string_pos): Fix logic of caching
18121 previous display string position. Initialize cached_prev_pos to
18122 -1. Fixes slow-down at the beginning of a buffer.
18123
18124 2011-07-24 Eli Zaretskii <eliz@gnu.org>
18125
18126 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18127 for attrs[LFACE_FONTSET_INDEX].
18128
18129 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18130
18131 * xml.c (parse_region): Remove unused local
18132 that was recently introduced.
18133
18134 2011-07-23 Eli Zaretskii <eliz@gnu.org>
18135
18136 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18137 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18138
18139 * xdisp.c (move_it_in_display_line_to): Record the best matching
18140 position for TO_CHARPOS while scanning the line, and restore it on
18141 exit if none of the characters scanned was an exact match.
18142 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18143 when exact match is impossible due to invisible text, and the
18144 lines are truncated.
18145
18146 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18147
18148 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18149 for OSX >= 10.7.
18150
18151 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18152
18153 Fix a significant slow-down of cursor motion with C-n, C-p,
18154 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18155 auto-repeat under bidi redisplay in fontified buffers.
18156 * xdisp.c (compute_stop_pos_backwards): New function.
18157 (next_element_from_buffer): Call compute_stop_pos_backwards to
18158 find a suitable prev_stop when we find ourselves before
18159 base_level_stop.
18160 (reseat): Don't look for prev_stop, as that could mean a very long
18161 run.
18162 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18163 <cached_disp_overlay_modiff>: Cache for last found display string
18164 position.
18165 (compute_display_string_pos): Return the cached position if asked
18166 about the same buffer in the same area of character positions, and
18167 the buffer wasn't changed since the time the display string
18168 position was cached.
18169
18170 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18171
18172 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18173 is an integer, which is important for empty lines. (Bug#9149)
18174
18175 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
18176
18177 * frame.c (Fmodify_frame_parameters): In tty case, update the
18178 default face if necessary (Bug#4238).
18179
18180 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
18181
18182 * editfns.c (Fstring_to_char): No need to explain what a character
18183 is in the docstring (Bug#6576).
18184
18185 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18186
18187 * xml.c (parse_region): Make sure we always return a tree.
18188
18189 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18190
18191 * xml.c (parse_region): If a document contains only comments,
18192 return that, too.
18193
18194 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18195
18196 * xml.c (make_dom): Return comments, too.
18197
18198 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18199
18200 Port to OpenBSD.
18201 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18202 and the surrounding thread.
18203 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18204 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18205 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18206 timer goes off.
18207 * s/openbsd.h (BROKEN_SIGIO): Define.
18208 * unexelf.c (unexec) [__OpenBSD__]:
18209 Don't update the .mdebug section of the Alpha COFF symbol table.
18210
18211 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18212
18213 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18214 (bug#8460).
18215
18216 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18217
18218 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18219 This fixes some race conditions on the permissions of any newly
18220 created file.
18221
18222 * alloc.c (valid_pointer_p): Use pipe, not open.
18223 This fixes some permissions issues when debugging.
18224
18225 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18226 If fchown fails to set both uid and gid, try to set just gid,
18227 as that is sometimes allowed. Adjust the file's mode to eliminate
18228 setuid or setgid bits that are inappropriate if fchown fails.
18229
18230 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18231
18232 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18233 to compare Lisp_Objects.
18234 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18235 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18236 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18237
18238 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18239
18240 * lread.c (read_integer): Unread even EOF character.
18241 (read1): Likewise. Properly record start position of symbol.
18242
18243 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18244 symbol character follows.
18245
18246 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18247
18248 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18249 This works around a problem with the previous change to Fcopy_file.
18250 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18251 and without this change, GCC might complain about discarding
18252 fchown's return value.
18253
18254 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
18255
18256 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18257
18258 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18259
18260 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18261
18262 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18263
18264 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18265 it's used from the C level.
18266
18267 * process.c: Use the same condition for POLL_FOR_INPUT in both
18268 keyboard.c and process.c (bug#1858).
18269
18270 2011-07-09 Lawrence Mitchell <wence@gmx.li>
18271
18272 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18273 (Fgnutls_boot): Use it.
18274
18275 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18276
18277 * doc.c (Fsubstitute_command_keys): Revert last change.
18278
18279 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18280
18281 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18282 quotes the next character, and doesn't affect other longer
18283 sequences (bug#8935).
18284
18285 * lread.c (syms_of_lread): Clarify that is isn't only
18286 `eval-buffer' and `eval-defun' that's affected by
18287 `lexical-binding' (bug#8460).
18288
18289 2011-07-15 Eli Zaretskii <eliz@gnu.org>
18290
18291 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18292 bidi redisplay when a line includes both an image and is truncated.
18293
18294 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18295
18296 Fix minor problems found by static checking.
18297 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18298 (elsz): Now a signed constant, not a size_t var. We prefer signed
18299 types to unsigned, to avoid integer comparison confusion. Without
18300 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18301 "cannot optimize loop, the loop counter may overflow", a symptom
18302 of the confusion.
18303 * indent.c (Fvertical_motion): Mark locals as initialized.
18304 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18305
18306 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18307
18308 * search.c (Fre_search_backward): Mention `case-fold-search' in
18309 all the re_search_* functions (bug#8138).
18310
18311 * keyboard.c (Fopen_dribble_file): Document when the file is
18312 closed (bug#8056).
18313
18314 2011-07-14 Eli Zaretskii <eliz@gnu.org>
18315
18316 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18317 bidi_cache_idx.
18318
18319 Support bidi reordering of display and overlay strings.
18320 * xdisp.c (compute_display_string_pos)
18321 (compute_display_string_end): Accept additional argument STRING.
18322 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18323 (reseat_to_string): Initialize bidi_it->string.s and
18324 bidi_it->string.schars.
18325 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18326 NULL (avoids a crash in bidi_paragraph_init).
18327 Initialize itb.string.lstring.
18328 (init_iterator): Call bidi_init_it only of a valid
18329 buffer position was specified. Initialize paragraph_embedding to
18330 L2R.
18331 (reseat_to_string): Initialize the bidi iterator.
18332 (display_string): If we need to ignore text properties of
18333 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18334 original value of -1 will not work with bidi.)
18335 (compute_display_string_pos): First arg is now struct
18336 `text_pos *'; all callers changed. Support display properties on
18337 Lisp strings.
18338 (compute_display_string_end): Support display properties on Lisp
18339 strings.
18340 (init_iterator, reseat_1, reseat_to_string): Initialize the
18341 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18342 when iterating on a string not from display properties).
18343 (compute_display_string_pos, compute_display_string_end):
18344 Fix calculation of the object to scan. Fixes an error when using
18345 arrow keys.
18346 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18347 base_level_stop; instead, set base_level_stop to BEGV.
18348 Fixes crashes in vertical-motion.
18349 (next_element_from_buffer): Improve commentary for when
18350 the iterator is before prev_stop.
18351 (init_iterator): Initialize bidi_p from the default value of
18352 bidi-display-reordering, not from buffer-local value. Use the
18353 buffer-local value only if initializing for buffer iteration.
18354 (handle_invisible_prop): Support invisible properties on strings
18355 that are being bidi-reordered.
18356 (set_iterator_to_next): Support bidi reordering of C strings and
18357 Lisp strings.
18358 (next_element_from_string): Support bidi reordering of Lisp
18359 strings.
18360 (handle_stop_backwards): Support Lisp strings as well.
18361 (display_string): Support display of R2L glyph rows.
18362 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18363 (init_iterator): Don't initialize it->bidi_p for strings
18364 here.
18365 (reseat_to_string): Initialize it->bidi_p for strings here.
18366 (next_element_from_string, next_element_from_c_string)
18367 (next_element_from_buffer): Add xassert's for correspondence
18368 between IT's object being iterated and it->bidi_it.string
18369 structure.
18370 (face_before_or_after_it_pos): Support bidi iteration.
18371 (next_element_from_c_string): Handle the case of the first string
18372 character that is not the first one in the visual order.
18373 (get_visually_first_element): New function, refactored from common
18374 parts of next_element_from_buffer, next_element_from_string, and
18375 next_element_from_c_string.
18376 (tool_bar_lines_needed, redisplay_tool_bar)
18377 (display_menu_bar): Force left-to-right direction. Add a FIXME
18378 comment for making that be controlled by a user option.
18379 (push_it, pop_it): Save and restore the state of the
18380 bidi iterator. Save and restore the bidi_p flag.
18381 (pop_it): Iterate out of display property for string iteration as
18382 well.
18383 (iterate_out_of_display_property): Support iteration over strings.
18384 (handle_single_display_spec): Set up it->bidi_it for iteration
18385 over a display string, and call bidi_init_it.
18386 (handle_single_display_spec, next_overlay_string)
18387 (get_overlay_strings_1, push_display_prop): Set up the bidi
18388 iterator for displaying display or overlay strings.
18389 (forward_to_next_line_start): Don't use the shortcut if
18390 bidi-iterating.
18391 (back_to_previous_visible_line_start): If handle_display_prop
18392 pushed the iterator stack, restore the internal state of the bidi
18393 iterator by calling bidi_pop_it same number of times.
18394 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18395 and we are bidi-iterating, don't decrement the iterator position;
18396 instead, set the first_elt flag in the bidi iterator, to produce
18397 the same effect.
18398 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18399 (push_display_prop): xassert that we are iterating a buffer.
18400 (push_it, pop_it): Save and restore paragraph_embedding member.
18401 (handle_single_display_spec, next_overlay_string)
18402 (get_overlay_strings_1, reseat_1, reseat_to_string)
18403 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18404 correctly. Don't assume unibyte strings are not bidi-reordered.
18405 (compute_display_string_pos)
18406 (compute_display_string_end): Fix handling the case of C string.
18407 (push_it, pop_it): Save and restore from_disp_prop_p.
18408 (handle_single_display_spec, push_display_prop): Set the
18409 from_disp_prop_p flag.
18410 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18411 (pop_it): Call iterate_out_of_display_property only if we are
18412 popping after iteration over a string that came from a display
18413 property. Fix a typo in popping stretch info. Add an assertion
18414 for verifying that the iterator position is in sync with the bidi
18415 iterator.
18416 (handle_single_display_spec, get_overlay_strings_1)
18417 (push_display_prop): Fix initialization of paragraph direction for
18418 string when that of the parent object is not yet determined.
18419 (reseat_1): Call bidi_init_it to resync the bidi
18420 iterator with IT's position. (Bug#7616)
18421 (find_row_edges): If ROW->start.pos gives position
18422 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18423 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18424 Reset the from_disp_prop_p flag.
18425 (SAVE_IT, RESTORE_IT): New macros.
18426 (pos_visible_p, face_before_or_after_it_pos)
18427 (back_to_previous_visible_line_start)
18428 (move_it_in_display_line_to, move_it_in_display_line)
18429 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18430 (try_scrolling, redisplay_window, display_line): Use them when
18431 saving a temporary copy of the iterator and restoring it back.
18432 (back_to_previous_visible_line_start, reseat_1)
18433 (init_iterator): Empty the bidi cache "stack".
18434 (move_it_in_display_line_to): If iterator ended up at
18435 EOL, but we never saw any buffer positions smaller than
18436 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18437 motion in bidi-reordered lines.
18438 (move_it_in_display_line_to): Record prev_method and prev_pos
18439 immediately before the call to set_iterator_to_next. Fixes cursor
18440 motion in bidi-reordered lines with stretch glyphs and strings
18441 displayed in margins. (Bug#8133) (Bug#8867)
18442 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18443 TO_CHARPOS.
18444 (pos_visible_p): Support positions in bidi-reordered lines.
18445 Save and restore bidi cache.
18446
18447 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18448 (bidi_paragraph_info): Delete unused struct.
18449 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18450 (bidi_cache_start): New variable.
18451 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18452 to zero.
18453 (bidi_cache_fetch_state, bidi_cache_search)
18454 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18455 (bidi_cache_find, bidi_peek_at_next_level)
18456 (bidi_level_of_next_char, bidi_find_other_level_edge)
18457 (bidi_move_to_visually_next): Compare cache index with
18458 bidi_cache_start rather than with zero.
18459 (bidi_fetch_char): Accept new argument STRING; all callers
18460 changed. Support iteration over a string. Support strings with
18461 display properties. Support unibyte strings. Fix the type of
18462 `len' according to what STRING_CHAR_AND_LENGTH expects.
18463 (bidi_paragraph_init, bidi_resolve_explicit_1)
18464 (bidi_resolve_explicit, bidi_resolve_weak)
18465 (bidi_level_of_next_char, bidi_move_to_visually_next):
18466 Support iteration over a string.
18467 (bidi_set_sor_type, bidi_resolve_explicit_1)
18468 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18469 can now be zero (for strings); special values 0 and -1 were
18470 changed to -1 and -2, respectively.
18471 (bidi_char_at_pos): New function.
18472 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18473 Call it instead of FETCH_MULTIBYTE_CHAR.
18474 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18475 initialized to valid values.
18476 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18477 values.
18478 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18479 the test for valid cached positions. Fix the logic for looking up
18480 the sentinel state in the cache. GCPRO the Lisp string we are
18481 iterating.
18482 (bidi_push_it, bidi_pop_it): New functions.
18483 (bidi_initialize): Initialize the bidi cache start stack pointer.
18484 (bidi_cache_ensure_space): New function, refactored from part of
18485 bidi_cache_iterator_state. Don't assume the required size is just
18486 one BIDI_CACHE_CHUNK away.
18487 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18488 (bidi_count_bytes, bidi_char_at_pos): New functions.
18489 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18490 always valid if bidi_cache_idx is valid.
18491 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18492 is valid if it's going to be used.
18493 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18494 (bidi_cache_fetch_state, bidi_cache_search)
18495 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18496 (bidi_cache_iterator_state, bidi_cache_find)
18497 (bidi_find_other_level_edge, bidi_cache_start_stack):
18498 All variables related to cache indices are now EMACS_INT.
18499
18500 * dispextern.h (struct bidi_string_data): New structure.
18501 (struct bidi_it): New member `string'. Make flag members be 1-bit
18502 fields, and put them last in the struct.
18503 (compute_display_string_pos, compute_display_string_end):
18504 Update prototypes.
18505 (bidi_push_it, bidi_pop_it): Add prototypes.
18506 (struct iterator_stack_entry): New members bidi_p,
18507 paragraph_embedding, and from_disp_prop_p.
18508 (struct it): Member bidi_p is now a bit field 1 bit wide.
18509 (bidi_shelve_cache, bidi_unshelve_cache):
18510 Declare prototypes.
18511
18512 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18513 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18514 and vector-like objects.
18515
18516 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18517 cache around display iteration.
18518
18519 * window.c (Fwindow_end, window_scroll_pixel_based)
18520 (displayed_window_lines, Frecenter): Save and restore the bidi
18521 cache around display iteration.
18522
18523 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18524
18525 * editfns.c (Fdelete_region): Clarify the use of the named
18526 parameters (bug#6788).
18527
18528 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18529
18530 * indent.c (Fvertical_motion): Set and restore w->pointm when
18531 saving and restoring the window's buffer (Bug#9006).
18532
18533 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18534
18535 * editfns.c (Fstring_to_char): Clarify just what is returned
18536 (bug#6576). Text by Eli Zaretskii.
18537
18538 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18539
18540 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18541
18542 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18543
18544 * buffer.c (mmap_find): Fix a typo.
18545
18546 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18547
18548 Fix execution of x selection hooks.
18549 * xselect.c (Qx_lost_selection_functions)
18550 (Qx_sent_selection_functions): New vars.
18551 (syms_of_xselect): DEFSYM them.
18552 (x_handle_selection_request): Pass Qx_sent_selection_functions
18553 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18554 (x_handle_selection_clear,x_clear_frame_selections):
18555 Pass Qx_lost_selection_functions rather than
18556 Vx_lost_selection_functions to Frun_hook_with_args.
18557
18558 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18559
18560 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18561 The old code sometimes used this field without initializing it.
18562
18563 * alloc.c (gc_sweep): Don't read past end of array.
18564 In theory, the old code could also have corrupted Emacs internals,
18565 though it'd be very unlikely.
18566
18567 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18568
18569 * character.c (Fcharacterp): Don't advertise optional ignored
18570 argument. (Bug#4026)
18571
18572 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18573
18574 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18575 key" (bug#4257).
18576
18577 * window.c (Fset_window_start): Doc fix (bug#4199).
18578 (Fset_window_hscroll): Ditto.
18579
18580 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18581
18582 Fix minor new problems caught by GCC 4.6.1.
18583 * term.c (init_tty): Remove unused local.
18584 * xsettings.c (store_monospaced_changed): Define this function only
18585 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18586 not used otherwise.
18587
18588 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18589
18590 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18591
18592 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18593
18594 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18595 are the mini-buffer and the echo area (bug#3320).
18596
18597 * term.c (init_tty): Remove support for supdup, c10 and perq
18598 terminals, which are no longer supported (bug#1482).
18599
18600 2011-07-10 Johan Bockgård <bojohan@gnu.org>
18601
18602 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18603
18604 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18605
18606 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18607 for non-popups (Bug#3642).
18608
18609 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18610
18611 * alloc.c (reset_malloc_hooks): Protoize.
18612 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
18613 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18614 * cm.c (losecursor): Likewise.
18615 * data.c (fmod): Likewise.
18616 * dispnew.c (swap_glyphs_in_rows): Likewise.
18617 * emacs.c (memory_warning_signal): Likewise.
18618 * floatfns.c (float_error): Likewise.
18619 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18620 (otf_open, font_otf_capability, generate_otf_features)
18621 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18622 Likewise.
18623 * image.c (pbm_read_file): Likewise.
18624 * indent.c (string_display_width): Likewise.
18625 * intervals.c (check_for_interval, search_for_interval)
18626 (inc_interval_count, count_intervals, root_interval)
18627 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18628 * lread.c (defalias): Likewise.
18629 * ralloc.c (r_alloc_check): Likewise.
18630 * regex.c (set_image_of_range_1, set_image_of_range)
18631 (regex_grow_registers): Likewise.
18632 * sysdep.c (strerror): Likewise.
18633 * termcap.c (valid_filename_p, tprint, main): Likewise.
18634 * tparam.c (main): Likewise.
18635 * unexhp9k800.c (run_time_remap, save_data_space)
18636 (update_file_ptrs, read_header, write_header, calculate_checksum)
18637 (copy_file, copy_rest, display_header): Likewise.
18638 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18639 Likewise.
18640 * xdisp.c (check_it): Likewise.
18641 * xfaces.c (register_color, unregister_color, unregister_colors):
18642 Likewise.
18643 * xfns.c (print_fontset_result): Likewise.
18644 * xrdb.c (member, fatal, main): Likewise.
18645
18646 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18647
18648 Fix minor problems found by static checking (Bug#9031).
18649 * chartab.c (char_table_set_range, map_sub_char_table):
18650 Remove unused locals.
18651 (uniprop_table): Now static.
18652 * composite.c (_work_char): Remove unused static var.
18653
18654 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
18655
18656 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18657
18658 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18659
18660 * gtkutil.c (qttip_cb): Remove code without function.
18661
18662 2011-07-09 Eli Zaretskii <eliz@gnu.org>
18663
18664 * w32.c (pthread_sigmask): New stub.
18665
18666 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
18667
18668 Use pthread_sigmask, not sigprocmask (Bug#9010).
18669 sigprocmask is portable only for single-threaded applications, and
18670 Emacs can be multi-threaded when it uses GTK.
18671 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18672 (LIBES): Use it.
18673 * callproc.c (Fcall_process):
18674 * process.c (create_process):
18675 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18676 Use pthread_sigmask, not sigprocmask.
18677
18678 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18679
18680 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18681 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18682 wrong (Bug#8591).
18683
18684 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18685
18686 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18687 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18688 (xg_hide_tooltip): Fix comment.
18689
18690 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18691 in registerServicesMenuSendTypes.
18692 (validRequestorForSendType): Don't check ns_return_types.
18693
18694 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18695 ns_return_type.
18696
18697 2011-07-08 Jason Rumney <jasonr@gnu.org>
18698
18699 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18700 SH_SHOW for hidden windows (Bug#5482).
18701
18702 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18703 frame struct members of non-existent frames (Bug#6284).
18704
18705 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18706
18707 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18708 variable firstTime not needed on OSX >= 10.6.
18709 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18710 >= 10.5. Use setKnobProportion, setDoubleValue.
18711
18712 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18713 (MAC_OS_X_VERSION_10_5): Define if not defined.
18714 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18715 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18716 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18717
18718 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
18719 cString and lossyCString on OSX >= 10.4.
18720
18721 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
18722 sizeToFit on OSX >= 10.2.
18723
18724 * nsimage.m (allocInitFromFile): Don't use deprecated method
18725 bestRepresentationForDevice on OSX >= 10.6.
18726
18727 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18728 to avoid warning.
18729
18730 * emacs.c: Declare unexec_init_emacs_zone.
18731
18732 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18733
18734 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18735
18736 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18737 on svcsMenu (Bug#8842).
18738
18739 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18740 ns_return_types.
18741 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18742
18743 * nsterm.m (QUTF8_STRING): Declare.
18744 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18745 (validRequestorForSendType): Return type is (id).
18746 Change indexOfObjectIdenticalTo to indexOfObject.
18747 Check if we have local selection before returning self (Bug#8842).
18748 (writeSelectionToPasteboard): Put local selection into paste board
18749 if we have a local selection (Bug#8842).
18750 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18751
18752 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18753 (ns_get_local_selection): Declare.
18754
18755 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18756
18757 * keymap.c (describe_map_tree): Don't insert a double newline at
18758 the end of the buffer (bug#1169) and return whether we inserted
18759 something.
18760
18761 * callint.c (Fcall_interactively): Change "reading args" to
18762 "providing args" to try to clarify what it does (bug#1010).
18763
18764 2011-07-07 Kenichi Handa <handa@m17n.org>
18765
18766 * composite.c (composition_compute_stop_pos): Ignore a static
18767 composition starting before CHARPOS (Bug#8915).
18768
18769 * xdisp.c (handle_composition_prop): Likewise.
18770
18771 2011-07-07 Eli Zaretskii <eliz@gnu.org>
18772
18773 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18774 (Bug#9015)
18775
18776 2011-07-07 Kenichi Handa <handa@m17n.org>
18777
18778 * character.h (unicode_category_t): New enum type.
18779
18780 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18781 (Qchar_code_property_table): New variable.
18782 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18783 (UNIPROP_COMPRESSED_FORM_P): New macros.
18784 (char_table_ascii): Uncompress the compressed values.
18785 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18786 Uncompress the compressed values.
18787 (sub_char_table_ref_and_range): Likewise.
18788 (char_table_ref_and_range): Uncompress the compressed values.
18789 (sub_char_table_set): New arg is_uniprop. Callers changed.
18790 Uncompress the compressed values.
18791 (sub_char_table_set_range): Args changed. Callers changed.
18792 (char_table_set_range): Adjuted for the above change.
18793 (map_sub_char_table): Delete args default_val and parent. Add arg
18794 top. Give decoded values to a Lisp function.
18795 (map_char_table): Adjust for the above change. Give decoded
18796 values to a Lisp function. Gcpro more variables.
18797 (uniprop_table_uncompress)
18798 (uniprop_decode_value_run_length): New functions.
18799 (uniprop_decoder, uniprop_decoder_count): New variables.
18800 (uniprop_get_decoder, uniprop_encode_value_character)
18801 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18802 New functions.
18803 (uniprop_encoder, uniprop_encoder_count): New variables.
18804 (uniprop_get_encoder, uniprop_table)
18805 (Funicode_property_table_internal, Fget_unicode_property_internal)
18806 (Fput_unicode_property_internal): New functions.
18807 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18808 Sunicode_property_table_internal, Sget_unicode_property_internal,
18809 and Sput_unicode_property_internal. Defvar_lisp
18810 char-code-property-alist.
18811
18812 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
18813 Vunicode_category_table.
18814
18815 * font.c (font_range): Adjust for the change of
18816 Vunicode_category_table.
18817
18818 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18819
18820 * m/iris4d.h: Remove file, move contents ...
18821 * s/irix6-5.h: ... here.
18822
18823 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18824
18825 Remove unportable assumption about struct layout (Bug#8884).
18826 * alloc.c (mark_buffer):
18827 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18828 (clone_per_buffer_values): Don't assume that
18829 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18830 This isn't true in general, and it's particularly not true
18831 if Emacs is configured with --with-wide-int.
18832 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18833 New macros, used in the buffer.c change.
18834
18835 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18836
18837 * xsettings.c: Use both GConf and GSettings if both are available.
18838 (store_config_changed_event): Add comment.
18839 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18840 (store_tool_bar_style_changed): New functions.
18841 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
18842 (struct xsettings): Move font inside HAVE_XFT.
18843 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
18844 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
18845 Move inside HAVE_XFT.
18846 (something_changed_gsettingsCB): Rename from something_changedCB.
18847 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18848 also.
18849 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
18850 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
18851 (something_changed_gconfCB): Rename from something_changedCB.
18852 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18853 (parse_settings): Move check for font inside HAVE_XFT.
18854 (read_settings, apply_xft_settings): Add comment.
18855 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18856 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18857 call store_font_name_changed.
18858 (xft_settings_event): Add comment.
18859 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18860 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18861 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18862 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18863 (xsettings_initialize): Call init_gsettings last.
18864 (xsettings_get_system_font, xsettings_get_system_normal_font):
18865 Add comment.
18866
18867 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18868
18869 Random fixes. E.g., (random) never returned negative values.
18870 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18871 subseconds part to the entropy, as that's a bit more random.
18872 Prefer signed to unsigned, since the signedness doesn't matter and
18873 in general we prefer signed. When given a limit, use a
18874 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18875 latter isn't right if USE_2_TAGS_FOR_INTS.
18876 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18877 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18878
18879 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18880
18881 * textprop.c (text_property_stickiness):
18882 Obey Vtext_property_default_nonsticky.
18883 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18884 * w32fns.c (syms_of_w32fns):
18885 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18886
18887 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18888
18889 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18890 This is more efficient than Ffile_directory_p and avoids a minor race.
18891
18892 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18893
18894 * buffer.c (Foverlay_put): Say what the return value is
18895 (bug#7835).
18896
18897 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18898 is a directory before asking whether to use the file name
18899 (bug#7564).
18900 (barf_or_query_if_file_exists): Make the "File is a directory"
18901 error be more correct.
18902
18903 * fns.c (Frequire): Remove the mention of the .gz files, since
18904 that's installation-specific, but keep the mention of
18905 `get-load-suffixes'.
18906
18907 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18908
18909 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18910 Report string overflow if the output is too long.
18911
18912 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
18913
18914 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18915 (syms_of_gnutls): Remove duplicate DEFSYM for
18916 Qgnutls_bootprop_verify_hostname_error, an error for
18917 Qgnutls_bootprop_verify_error (which is no longer used).
18918
18919 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18920 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18921 Also (re)move comments that are misplaced or no longer relevant.
18922
18923 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18924
18925 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18926
18927 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
18928
18929 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18930 and background color parameters if they have been changed.
18931
18932 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18933
18934 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18935
18936 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18937
18938 * xsettings.c (SYSTEM_FONT): Define only when used.
18939 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18940
18941 * keymap.c (access_keymap_1): Now static.
18942
18943 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
18944
18945 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18946 leave any prefix arg for the up event (Bug#1586).
18947
18948 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18949
18950 * lread.c (syms_of_lread): Mention single symbols defined by
18951 `defvar' or `defconst' (bug#7154).
18952
18953 * fns.c (Frequire): Mention .el.gz files (bug#7314).
18954 (Frequire): Mention get-load-suffixes.
18955
18956 2011-07-02 Martin Rudalics <rudalics@gmx.at>
18957
18958 * window.h (window): Remove clone_number slot.
18959 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18960 Remove.
18961 (make_parent_window, make_window, saved_window)
18962 (Fset_window_configuration, save_window_save): Don't deal with
18963 clone numbers.
18964 * buffer.c (Qclone_number): Remove declaration.
18965 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18966
18967 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18968
18969 Add multiple inheritance to keymaps.
18970 * keymap.c (Fmake_composed_keymap): New function.
18971 (Fset_keymap_parent): Simplify.
18972 (fix_submap_inheritance): Remove.
18973 (access_keymap_1): New function extracted from access_keymap to handle
18974 embedded parents and handle lists of maps.
18975 (access_keymap): Use it.
18976 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18977 (Fcopy_keymap): Handle embedded parents.
18978 (Fcommand_remapping, define_as_prefix): Simplify.
18979 (Fkey_binding): Simplify.
18980 (syms_of_keymap): Move minibuffer-local-completion-map,
18981 minibuffer-local-filename-completion-map,
18982 minibuffer-local-must-match-map, and
18983 minibuffer-local-filename-must-match-map to Elisp.
18984 (syms_of_keymap): Defsubr make-composed-keymap.
18985 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18986 (parse_menu_item): Trivial simplification.
18987
18988 2011-07-01 Glenn Morris <rgm@gnu.org>
18989
18990 * Makefile.in (SETTINGS_LIBS): Fix typo.
18991
18992 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
18993
18994 * coding.c (Fencode_coding_string): Record the last coding system
18995 used, as the function doc string says (bug#8738).
18996
18997 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18998
18999 * xsettings.c (store_monospaced_changed): Take new font as arg and
19000 check for change against current_mono_font.
19001 (EMACS_TYPE_SETTINGS): Remove this and related defines.
19002 (emacs_settings_constructor, emacs_settings_get_property)
19003 (emacs_settings_set_property, emacs_settings_class_init)
19004 (emacs_settings_init, gsettings_obj): Remove.
19005 (something_changedCB): New function for HAVE_GSETTINGS.
19006 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
19007 with value as argument.
19008 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
19009 g_settings_new (Bug#8967). Do not create gsettings_obj.
19010 Remove calls to g_settings_bind. Connect something_changedCB to
19011 "changed".
19012
19013 * xgselect.c: Add defined (HAVE_GSETTINGS).
19014 (xgselect_initialize): Ditto.
19015
19016 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
19017 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
19018 xg_select.
19019
19020 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
19021
19022 * eval.c (struct backtrace): Simplify and port the data structure.
19023 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
19024 signed bit field, as this assumption is not portable and it makes
19025 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
19026 "char debug_on_exit : 1" as this is not portable either; instead,
19027 use the portable "unsigned int debug_on_exit : 1". Remove unused
19028 member evalargs. Remove obsolete comments about cc bombing out.
19029
19030 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
19031
19032 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
19033 Let HAVE_GSETTINGS override HAVE_GCONF.
19034 (store_monospaced_changed): New function.
19035 (EMACS_SETTINGS): A new type derived from GObject to handle
19036 GSettings notifications.
19037 (emacs_settings_constructor, emacs_settings_get_property)
19038 (emacs_settings_set_property, emacs_settings_class_init):
19039 New functions.
19040 (gsettings_client, gsettings_obj): New variables.
19041 (GSETTINGS_SCHEMA): New define.
19042 (something_changedCB): Call store_monospaced_changed.
19043 (init_gsettings): New function.
19044 (xsettings_initialize): Call init_gsettings.
19045 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19046 to NULL.
19047
19048 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
19049 GCONF_CFLAGS/LIBS.
19050
19051 2011-06-29 Martin Rudalics <rudalics@gmx.at>
19052
19053 * window.c (resize_root_window, grow_mini_window)
19054 (shrink_mini_window): Rename Qresize_root_window to
19055 Qwindow_resize_root_window and Qresize_root_window_vertically to
19056 Qwindow_resize_root_window_vertically.
19057
19058 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19059
19060 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19061
19062 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
19063
19064 * makefile.w32-in: Redesign dependencies so they reflect more
19065 clearly which files are directly included by each source file,
19066 and not through other includes.
19067
19068 2011-06-27 Martin Rudalics <rudalics@gmx.at>
19069
19070 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19071 (sort_overlays, overlay_strings): When an overlay's clone number
19072 matches the window's clone number process the overlay even if
19073 the overlay's window property doesn't match the current window.
19074
19075 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19076 (Fwindow_hchild): Rename to Fwindow_left_child.
19077 (Fwindow_next): Rename to Fwindow_next_sibling.
19078 (Fwindow_prev): Rename to Fwindow_prev_sibling.
19079 (resize_window_check): Rename to window_resize_check.
19080 (resize_window_apply): Rename to window_resize_apply.
19081 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19082 (Fdelete_other_windows_internal, resize_frame_windows)
19083 (Fsplit_window_internal, Fdelete_window_internal)
19084 (grow_mini_window, shrink_mini_window)
19085 (Fresize_mini_window_internal): Fix callers accordingly.
19086
19087 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19088
19089 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19090 (emacs_fixed_set_min_size): Remove.
19091 (emacs_fixed_new): Take frame as argument.
19092
19093 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19094 (_EmacsFixedPrivate): Remove minwidth/height.
19095 Add struct frame *f.
19096 (emacs_fixed_init): Initialize priv->f.
19097 (get_parent_class, emacs_fixed_set_min_size): Remove.
19098 (emacs_fixed_new): Set priv->f to argument.
19099 (emacs_fixed_get_preferred_width)
19100 (emacs_fixed_get_preferred_height): Use min_width/height from
19101 frames size_hint to set minimum and natural (Bug#8919).
19102 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19103 and use min_width/height from frames size_hint to set
19104 min_width/height (Bug#8919).
19105
19106 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19107 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19108 Fix indentation.
19109
19110 2011-06-26 Eli Zaretskii <eliz@gnu.org>
19111
19112 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19113 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19114 called at ZV.
19115
19116 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
19117
19118 * process.c (wait_reading_process_output): Bypass select if
19119 waiting for a cell while ignoring keyboard input, and input is
19120 pending. Suggested by Jan Djärv (Bug#8869).
19121
19122 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19123
19124 Use gnulib's dup2 module instead of rolling our own.
19125 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19126
19127 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19128
19129 * dispnew.c (scrolling_window): Before scrolling, turn off a
19130 mouse-highlight in the window being scrolled.
19131
19132 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
19133
19134 Move DEFSYM to lisp.h and use everywhere.
19135
19136 * character.h (DEFSYM): Move declaration...
19137 * lisp.h (DEFSYM): ...here.
19138
19139 * gnutls.c:
19140 * minibuf.c:
19141 * w32menu.c:
19142 * w32proc.c:
19143 * w32select.c: Don't include character.h.
19144
19145 * alloc.c (syms_of_alloc):
19146 * buffer.c (syms_of_buffer):
19147 * bytecode.c (syms_of_bytecode):
19148 * callint.c (syms_of_callint):
19149 * casefiddle.c (syms_of_casefiddle):
19150 * casetab.c (init_casetab_once):
19151 * category.c (init_category_once, syms_of_category):
19152 * ccl.c (syms_of_ccl):
19153 * cmds.c (syms_of_cmds):
19154 * composite.c (syms_of_composite):
19155 * dbusbind.c (syms_of_dbusbind):
19156 * dired.c (syms_of_dired):
19157 * dispnew.c (syms_of_display):
19158 * doc.c (syms_of_doc):
19159 * editfns.c (syms_of_editfns):
19160 * emacs.c (syms_of_emacs):
19161 * eval.c (syms_of_eval):
19162 * fileio.c (syms_of_fileio):
19163 * fns.c (syms_of_fns):
19164 * frame.c (syms_of_frame):
19165 * fringe.c (syms_of_fringe):
19166 * insdel.c (syms_of_insdel):
19167 * keymap.c (syms_of_keymap):
19168 * lread.c (init_obarray, syms_of_lread):
19169 * macros.c (syms_of_macros):
19170 * msdos.c (syms_of_msdos):
19171 * print.c (syms_of_print):
19172 * process.c (syms_of_process):
19173 * search.c (syms_of_search):
19174 * sound.c (syms_of_sound):
19175 * syntax.c (init_syntax_once, syms_of_syntax):
19176 * terminal.c (syms_of_terminal):
19177 * textprop.c (syms_of_textprop):
19178 * undo.c (syms_of_undo):
19179 * w32.c (globals_of_w32):
19180 * window.c (syms_of_window):
19181 * xdisp.c (syms_of_xdisp):
19182 * xfaces.c (syms_of_xfaces):
19183 * xfns.c (syms_of_xfns):
19184 * xmenu.c (syms_of_xmenu):
19185 * xsettings.c (syms_of_xsettings):
19186 * xterm.c (syms_of_xterm): Use DEFSYM.
19187
19188 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19189
19190 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19191
19192 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19193
19194 Integer and buffer overflow fixes (Bug#8873).
19195
19196 * print.c (printchar, strout): Check for string overflow.
19197 (PRINTPREPARE, printchar, strout):
19198 Don't set size unless allocation succeeds.
19199
19200 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19201 for sizes. Check for string overflow more accurately.
19202 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19203
19204 * macros.c: Integer and buffer overflow fixes.
19205 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19206 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19207 Use ptrdiff_t, not int, for sizes.
19208 Don't increment bufsize until after realloc succeeds.
19209 Check for size-calculation overflow.
19210 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19211
19212 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19213
19214 * lread.c: Integer overflow fixes.
19215 (read_integer): Radix is now EMACS_INT, not int,
19216 to improve quality of diagnostics for out-of-range radices.
19217 Calculate buffer size correctly for out-of-range radices.
19218 (read1): Check for integer overflow in radices, and in
19219 read-circle numbers.
19220 (read_escape): Avoid int overflow.
19221 (Fload, openp, read_buffer_size, read1)
19222 (substitute_object_recurse, read_vector, read_list, map_obarray):
19223 Use ptrdiff_t, not int, for sizes.
19224 (read1): Use EMACS_INT, not int, for sizes.
19225 Check for size overflow.
19226
19227 * image.c (cache_image): Check for size arithmetic overflow.
19228
19229 * lread.c: Integer overflow issues.
19230 (saved_doc_string_size, saved_doc_string_length)
19231 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19232 Now ptrdiff_t, not int.
19233 (read1): Don't assume doc string length fits in int. Check for
19234 out-of-range doc string lengths.
19235 (read_list): Don't assume file position fits in int.
19236 (read_escape): Check for hex character overflow.
19237
19238 2011-06-22 Leo Liu <sdl.web@gmail.com>
19239
19240 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19241 Move to minibuffer.el.
19242
19243 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19244
19245 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19246 The following patches are for when GLYPH_DEBUG && !XASSERT.
19247 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19248 * dispnew.c (flush_stdout):
19249 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19250 Mark as externally visible.
19251 * dispnew.c (check_window_matrix_pointers): Now static.
19252 * dispnew.c (window_to_frame_vpos):
19253 * xfns.c (unwind_create_frame):
19254 * xterm.c (x_check_font): Remove unused local.
19255 * scroll.c (CHECK_BOUNDS):
19256 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19257 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19258 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19259 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19260 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19261 Now static.
19262 (debug_method_add): Use va_list and vsprintf rather than relying
19263 on undefined behavior with wrong number of arguments.
19264 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19265 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19266 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19267 since we're not interested in debugging glyphs with old libraries.
19268 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19269 GCC 4.6.0's static checking.
19270
19271 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19272
19273 Integer overflow and signedness fixes (Bug#8873).
19274 A few related buffer overrun fixes, too.
19275
19276 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19277
19278 * dispextern.h (struct face.stipple):
19279 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19280 (x_bitmap_mask, x_allocate_bitmap_record)
19281 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19282 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19283 (x_create_bitmap_from_xpm_data):
19284 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19285 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19286 (.bitmaps_last):
19287 * xfaces.c (load_pixmap):
19288 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19289 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19290 (.bitmaps_last, struct x_output.icon_bitmap):
19291 Use ptrdiff_t, not int, for bitmap indexes.
19292 (x_allocate_bitmap_record): Check for size overflow.
19293 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19294
19295 Use ptrdiff_t, not int, for overlay counts.
19296 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19297 * editfns.c (overlays_around, get_pos_property):
19298 * textprop.c (get_char_property_and_overlay):
19299 * xdisp.c (next_overlay_change, note_mouse_highlight):
19300 * xfaces.c (face_at_buffer_position):
19301 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19302 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19303 (Fnext_overlay_change, Fprevious_overlay_change)
19304 (mouse_face_overlay_overlaps, Foverlays_in):
19305 Use ptrdiff_t, not int, for sizes.
19306 (overlays_at, overlays_in): Check for size-calculation overflow.
19307
19308 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19309
19310 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19311 (x_session_initialize): Do not assume string length fits in int.
19312
19313 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19314 This is unlikely, but can occur if DPI is outlandish.
19315
19316 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19317 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19318
19319 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19320 * xrdb.c (magic_file_p, search_magic_path):
19321 Omit last arg SUFFIX; it was always 0. All callers changed.
19322 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19323
19324 * xfont.c (xfont_match): Avoid need for strlen.
19325
19326 * xfns.c: Don't assume strlen fits in int.
19327 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19328
19329 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19330 not unsigned long, as we prefer signed integers. All callers changed.
19331 Detect integer overflow in repeat count.
19332 (message_dolog): Don't assume print length fits in 39 bytes.
19333 (display_mode_element): Don't assume strlen fits in int.
19334
19335 * termcap.c: Don't assume sizes fit in int and never overflow.
19336 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19337 (gobble_line): Check for size-calculation overflow.
19338
19339 * minibuf.c (Fread_buffer):
19340 * lread.c (intern, intern_c_string):
19341 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19342 Don't assume string length fits in int.
19343
19344 * keyboard.c (parse_tool_bar_item):
19345 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19346
19347 * font.c: Don't assume string length fits in int.
19348 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19349 Use ptrdiff_t, not int.
19350 (font_intern_prop): Don't assume string length fits in int.
19351 Don't assume integer property fits in fixnum.
19352 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19353
19354 * filelock.c: Fix some buffer overrun and integer overflow issues.
19355 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19356 Reformulate so as not to need the command string.
19357 Invoke gzip -cd rather than gunzip, as it's more portable.
19358 (lock_info_type, lock_file_1, lock_file):
19359 Don't assume pid_t and time_t fit in unsigned long.
19360 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19361 (current_lock_owner): Prefer signed type for sizes.
19362 Use memcpy, not strncpy, where memcpy is what is really wanted.
19363 Don't assume (via atoi) that time_t and pid_t fit in int.
19364 Check for time_t and/or pid_t out of range, e.g., via a network share.
19365 Don't alloca where an auto var works fine.
19366
19367 * fileio.c: Fix some integer overflow issues.
19368 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19369 Don't assume string length fits in int.
19370 (directory_file_name): Don't assume string length fits in long.
19371 (make_temp_name): Don't assume pid fits in int, or that its print
19372 length is less than 20.
19373
19374 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19375
19376 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19377
19378 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19379
19380 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19381 We prefer signed integers, even for size calculations.
19382
19383 * emacs.c: Don't assume string length fits in 'int'.
19384 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19385 (main): Don't invoke strlen when not needed.
19386
19387 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19388 (XD_DEBUG_MESSAGE): Don't waste a byte.
19389
19390 * callproc.c (getenv_internal_1, getenv_internal)
19391 (Fgetenv_internal):
19392 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19393
19394 * lread.c (invalid_syntax): Omit length argument.
19395 All uses changed. This doesn't fix a bug, but it simplifies the
19396 code away from its former Hollerith-constant appearance, and it's
19397 one less 'int' to worry about when looking at integer-overflow issues.
19398 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19399
19400 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19401 This didn't break anything, but it didn't help either.
19402 It's confusing to put a bogus integer in a place where the actual
19403 value does not matter.
19404 (LIST_END_P): Remove unused macro and its bogus comment.
19405 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19406
19407 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19408 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19409 implementation.
19410 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19411 We prefer signed types, and the value cannot exceed the EMACS_INT
19412 range anyway (because otherwise the length would not be representable).
19413 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19414 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19415 This avoids a GCC warning when WIDE_EMACS_INT.
19416
19417 * indent.c (sane_tab_width): New function.
19418 (current_column, scan_for_column, Findent_to, position_indentation)
19419 (compute_motion): Use it. This is just for clarity.
19420 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19421
19422 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19423
19424 * lisp.h (lint_assume): New macro.
19425 * composite.c (composition_gstring_put_cache):
19426 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19427
19428 * editfns.c, insdel.c:
19429 Omit unnecessary forward decls, to simplify future changes.
19430
19431 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19432
19433 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19434
19435 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19436 Use much-faster test for byte-length change.
19437 Don't assume string byte-length fits in 'int'.
19438 Check that character arg fits in 'int'.
19439 (mapcar1): Declare byte as byte, for clarity.
19440
19441 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19442
19443 * fns.c (concat): Catch string overflow earlier.
19444 Do not rely on integer wraparound.
19445
19446 * dispextern.h (struct it.overlay_strings_charpos)
19447 (struct it.selective): Now EMACS_INT, not int.
19448 * xdisp.c (forward_to_next_line_start)
19449 (back_to_previous_visible_line_start)
19450 (reseat_at_next_visible_line_start, next_element_from_buffer):
19451 Don't arbitrarily truncate the value of 'selective' to int.
19452
19453 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19454
19455 * composite.c: Don't truncate sizes to 'int'.
19456 (composition_gstring_p, composition_reseat_it)
19457 (composition_adjust_point): Use EMACS_INT, not int.
19458 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19459 not EMACS_UINT, for indexes.
19460
19461 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19462
19463 * buffer.c: Include <verify.h>.
19464 (struct sortvec.priority, struct sortstr.priority):
19465 Now EMACS_INT, not int.
19466 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19467 (struct sortstr.size, record_overlay_string)
19468 (struct sortstrlist.size, struct sortlist.used):
19469 Don't truncate size to int.
19470 (record_overlay_string): Check for size-calculation overflow.
19471 (init_buffer_once): Check at compile-time, not run-time.
19472
19473 2011-06-22 Jim Meyering <meyering@redhat.com>
19474
19475 Don't leak an XBM-image-sized buffer
19476 * image.c (xbm_load): Free the image buffer after using it.
19477
19478 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19479
19480 Port to Sun C.
19481 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19482 that Sun C diagnosed.
19483 * fns.c (secure_hash): Fix pointer signedness issue.
19484 * intervals.c (static_offset_intervals): New function.
19485 (offset_intervals): Use it.
19486
19487 2011-06-21 Leo Liu <sdl.web@gmail.com>
19488
19489 * deps.mk (fns.o):
19490 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19491 sha512.h.
19492
19493 * fns.c (secure_hash): Rename from crypto_hash_function and change
19494 the first arg to accept symbols.
19495 (Fsecure_hash): New primitive.
19496 (syms_of_fns): New symbols.
19497
19498 2011-06-20 Deniz Dogan <deniz@dogan.se>
19499
19500 * process.c (Fset_process_buffer): Clarify return value in
19501 docstring.
19502
19503 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19504
19505 * dispnew.c (add_window_display_history): Use BVAR.
19506
19507 * xdisp.c (debug_method_add): Use BVAR.
19508 (check_window_end, dump_glyph_matrix, dump_glyph)
19509 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19510
19511 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19512 Likewise.
19513
19514 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19515 check till after the cache is created in init_frame_faces.
19516
19517 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19518
19519 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19520
19521 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19522
19523 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19524 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19525 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19526
19527 Improve buffer-overflow checking (Bug#8873).
19528 * fileio.c (Finsert_file_contents):
19529 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19530 Remove the old (too-loose) buffer overflow checks.
19531 They weren't needed, since make_gap checks for buffer overflow.
19532 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19533 The old code merely checked for Emacs fixnum overflow, and relied
19534 on undefined (wraparound) behavior. The new code avoids undefined
19535 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19536
19537 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19538 Tune. Don't use wider integers than needed. Don't use alloca.
19539 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19540
19541 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19542
19543 * insdel.c, lisp.h (buffer_overflow): New function.
19544 (insert_from_buffer_1, replace_range, replace_range_2):
19545 * insdel.c (make_gap_larger):
19546 * editfns.c (Finsert_char):
19547 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19548
19549 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19550
19551 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19552
19553 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19554
19555 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19556 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19557
19558 * fileio.c: Don't assume EMACS_INT fits in off_t.
19559 (emacs_lseek): New static function.
19560 (Finsert_file_contents, Fwrite_region): Use it.
19561 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19562
19563 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19564
19565 * fns.c: Don't overflow int when computing a list length.
19566 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19567 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19568 truncation on 64-bit hosts. Check for QUIT every
19569 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19570 faster and is responsive enough.
19571 (Flength): Report an error instead of overflowing an integer.
19572 (Fsafe_length): Return a float if the value is not representable
19573 as a fixnum. This shouldn't happen except in contrived situations.
19574 (Fnthcdr, Fsort): Don't assume list length fits in int.
19575 (Fcopy_sequence): Don't assume vector length fits in int.
19576
19577 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19578 (header_size, word_size): New constants.
19579 (allocate_vectorlike): Don't check size overflow here.
19580 (allocate_vector): Check it here instead, since this is the only
19581 caller of allocate_vectorlike that could cause overflow.
19582 Check that the new vector's length is representable as a fixnum.
19583
19584 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19585 The previous code was bogus. For example, next_almost_prime (32)
19586 returned 39, which is undesirable as it is a multiple of 3; and
19587 next_almost_prime (24) returned 25, which is a multiple of 5 so
19588 why was the code bothering to check for multiples of 7?
19589
19590 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19591
19592 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19593
19594 Variadic C functions now count arguments with ptrdiff_t.
19595 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19596 Back then I didn't know that the Emacs coding style prefers signed int.
19597 Also, in the meantime I found a few more instances where arguments
19598 were being counted with int, which may truncate counts on 64-bit
19599 machines, or EMACS_INT, which may be unnecessarily wide.
19600 * lisp.h (struct Lisp_Subr.function.aMANY)
19601 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19602 Arg counts are now ptrdiff_t, not size_t.
19603 All variadic functions and their callers changed accordingly.
19604 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19605 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19606 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19607 * callint.c (Fcall_interactively): Check arg count for overflow,
19608 to avoid potential buffer overrun. Use signed char, not 'int',
19609 for 'varies' array, so that we needn't bother to check its size
19610 calculation for overflow.
19611 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19612 * eval.c (apply_lambda):
19613 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19614 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19615 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19616
19617 * callint.c (Fcall_interactively): Don't use index var as event count.
19618
19619 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19620 * mem-limits.h (SIZE): Remove; no longer used.
19621
19622 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
19623
19624 Remove unnecessary casts.
19625 * xterm.c (x_term_init):
19626 * xfns.c (x_set_border_pixel):
19627 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19628 These aren't needed now that we assume ANSI C.
19629
19630 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19631 It's more likely to cause problems (due to unsigned overflow)
19632 than to cure them.
19633
19634 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19635
19636 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19637
19638 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19639
19640 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19641
19642 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19643
19644 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19645
19646 GLYPH_CODE_FACE returns EMACS_INT, not int.
19647 * dispextern.h (merge_faces):
19648 * xfaces.c (merge_faces):
19649 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19650 Don't assume EMACS_INT fits in int.
19651
19652 * character.h (CHAR_VALID_P): Remove unused parameter.
19653 * fontset.c, lisp.h, xdisp.c: All uses changed.
19654
19655 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19656
19657 * fns.c (concat): Minor tuning based on overflow analysis.
19658 This doesn't fix any bugs. Use int to hold character, instead
19659 of constantly refetching from Emacs object. Use XFASTINT, not
19660 XINT, for value known to be a character. Don't bother comparing
19661 a single byte to 0400, as it's always less.
19662
19663 * floatfns.c (Fexpt):
19664 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19665
19666 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19667 for characters.
19668
19669 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19670
19671 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19672 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19673 incorrectly succeed when S was a string, because 4294967386 was
19674 truncated before it was used.
19675
19676 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19677 Otherwise, an out-of-range integer could cause undefined behavior
19678 on a 64-bit host.
19679
19680 * composite.c: Use int, not EMACS_INT, for characters.
19681 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19682 EMACS_INT, for values that are known to be in character range.
19683 This doesn't fix any bugs but is the usual style inside Emacs and
19684 may generate better code on 32-bit machines.
19685
19686 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19687 This is for reasons similar to the recent CHAR_STRING fix.
19688 * charset.c (Fencode_char): Check that character arg is actually
19689 a character. Pass an int to ENCODE_CHAR.
19690 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19691 wider than 'int', as a compile-time check to prevent future regressions
19692 in this area.
19693
19694 * character.c (char_string): Remove unnecessary casts.
19695
19696 Make sure a 64-bit char is never passed to CHAR_STRING.
19697 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19698 by silently ignoring the top 32 bits, allowing some values
19699 that were far too large to be valid characters.
19700 * character.h: Include <verify.h>.
19701 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19702 arguments are no wider than unsigned, as a compile-time check
19703 to prevent future regressions in this area.
19704 * data.c (Faset):
19705 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
19706 (Fsubst_char_in_region):
19707 * fns.c (concat):
19708 * xdisp.c (decode_mode_spec_coding):
19709 Adjust to CHAR_STRING's new requirement.
19710 * editfns.c (Finsert_char, Fsubst_char_in_region):
19711 * fns.c (concat): Check that character args are actually
19712 characters. Without this test, these functions did the wrong
19713 thing with wildly out-of-range values on 64-bit hosts.
19714
19715 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19716 These casts should not be needed on 32-bit hosts, either.
19717 * keyboard.c (read_char):
19718 * lread.c (Fload): Remove casts to unsigned.
19719
19720 * lisp.h (UNSIGNED_CMP): New macro.
19721 This fixes comparison bugs on 64-bit hosts.
19722 (ASCII_CHAR_P): Use it.
19723 * casefiddle.c (casify_object):
19724 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
19725 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19726 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19727 * dispextern.h (FACE_FROM_ID):
19728 * keyboard.c (read_char): Use UNSIGNED_CMP.
19729
19730 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19731 not to EMACS_INT, to avoid GCC warning.
19732
19733 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19734
19735 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19736 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19737 isn't needed on 32-bit machines.
19738
19739 * buffer.c (Fgenerate_new_buffer_name):
19740 Use EMACS_INT for count, not int.
19741 (advance_to_char_boundary): Return EMACS_INT, not int.
19742
19743 * data.c (Qcompiled_function): Now static.
19744
19745 * window.c (window_body_lines): Now static.
19746
19747 * image.c (gif_load): Rename local to avoid shadowing.
19748
19749 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19750 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19751 * alloc.c (make_save_value): Integer argument is now of type
19752 ptrdiff_t, not int.
19753 (mark_object): Use ptrdiff_t, not int.
19754 * lisp.h (pD): New macro.
19755 * print.c (print_object): Use it.
19756
19757 * alloc.c: Use EMACS_INT, not int, to count objects.
19758 (total_conses, total_markers, total_symbols, total_vector_size)
19759 (total_free_conses, total_free_markers, total_free_symbols)
19760 (total_free_floats, total_floats, total_free_intervals)
19761 (total_intervals, total_strings, total_free_strings):
19762 Now EMACS_INT, not int. All uses changed.
19763 (Fgarbage_collect): Compute overall total using a double, so that
19764 integer overflow is less likely to be a problem. Check for overflow
19765 when converting back to an integer.
19766 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19767 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19768 These were 'int' variables that could overflow on 64-bit hosts;
19769 they were never used, so remove them instead of repairing them.
19770 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
19771 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19772 Previously, this ceilinged at INT_MAX, but that doesn't work on
19773 64-bit machines.
19774 (allocate_pseudovector): Don't use EMACS_INT when int would do.
19775
19776 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
19777 (allocate_vectorlike): Check for ptrdiff_t overflow.
19778 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19779 when a (possibly-narrower) signed value would do just as well.
19780 We prefer using signed arithmetic, to avoid comparison confusion.
19781
19782 * alloc.c: Catch some string size overflows that we were missing.
19783 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19784 for convenience in STRING_BYTES_MAX.
19785 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19786 The definition here is exact; the one in lisp.h was approximate.
19787 (allocate_string_data): Check for string overflow. This catches
19788 some instances we weren't catching before. Also, it catches
19789 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19790 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19791 and ptrdiff_t and EMACS_INT are both 64 bits.
19792
19793 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19794 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
19795 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
19796
19797 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19798
19799 * alloc.c (Fmake_string): Check for out-of-range init.
19800
19801 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19802
19803 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19804
19805 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19806
19807 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19808 xg_get_default_scrollbar_width.
19809
19810 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19811 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19812 (style_changed_cb): Call update_theme_scrollbar_width and call
19813 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19814 all frames (Bug#8505).
19815 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19816 Call gtk_window_set_resizable if HAVE_GTK3.
19817 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19818 and height if HAVE_GTK3 (Bug#8505).
19819 (scroll_bar_width_for_theme): New variable.
19820 (update_theme_scrollbar_width): New function.
19821 (xg_get_default_scrollbar_width): Move code to
19822 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19823 (xg_initialize): Call update_theme_scrollbar_width.
19824
19825 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19826
19827 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19828
19829 2011-06-12 Martin Rudalics <rudalics@gmx.at>
19830
19831 * frame.c (make_frame): Call other_buffer_safely instead of
19832 other_buffer.
19833
19834 * window.c (temp_output_buffer_show): Call display_buffer with
19835 second argument Vtemp_buffer_show_specifiers and reset latter
19836 immediately after the call.
19837 (Vtemp_buffer_show_specifiers): New variable.
19838 (auto_window_vscroll_p, next_screen_context_lines)
19839 (Vscroll_preserve_screen_position): Remove leading asterisks from
19840 doc-strings.
19841
19842 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
19843
19844 Fix minor problems found by GCC 4.6.0 static checking.
19845 * buffer.c (Qclone_number): Remove for now, as it's unused.
19846 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19847 (record_buffer): Remove unused local.
19848 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19849 (set_frame_buffer_list): Remove; unused.
19850 * frame.h (other_visible_frames): Remove decl.
19851 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19852 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19853 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19854 if HAVE_GPM.
19855 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19856 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19857 Define only if HAVE_GPM.
19858 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19859 (update_hints_inhibit): Remove; never set. All uses removed.
19860 * widgetprv.h (emacsFrameClassRec): Remove decl.
19861 * window.c (delete_deletable_window): Now returns void, since it
19862 wasn't returning anything.
19863 (compare_window_configurations): Remove unused locals.
19864 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19865 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
19866 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19867 the same widths as pointers. This follows up on the 2011-05-06 patch.
19868 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19869 * xterm.h: Likewise.
19870 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19871
19872 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
19873
19874 * makefile.w32-in: Update dependencies.
19875 (LISP_H): Add lib/intprops.h.
19876
19877 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19878
19879 * image.c (gif_load): Add animation frame delay to the metadata.
19880 (syms_of_image): Use DEFSYM. New symbol `delay'.
19881
19882 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19883
19884 * window.c (delete_deletable_window): Re-add.
19885 (Fset_window_configuration): Rewrite to handle dead buffers and
19886 consequently deletable windows.
19887 (window_tree, Fwindow_tree): Remove. Supply functionality in
19888 window.el.
19889 (compare_window_configurations): Simplify code.
19890
19891 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19892
19893 * image.c (imagemagick_load_image): Fix type mismatch.
19894 (Fimagemagick_types): Likewise.
19895
19896 * window.h (replace_buffer_in_windows): Declare.
19897
19898 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19899
19900 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19901 Qclone_number. Remove external declaration of Qdelete_window.
19902 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19903 code.
19904 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19905 Run Qbuffer_list_update_hook if allowed.
19906 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19907 buffer list implementation.
19908 (other_buffer_safely): New function.
19909 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19910 calls to replace_buffer_in_windows and
19911 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19912 if allowed.
19913 (record_buffer): Inhibit quitting and rewrite using quittable
19914 functions. Run Qbuffer_list_update_hook if allowed.
19915 (Frecord_buffer, Funrecord_buffer): New functions.
19916 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19917 Move switch-to-buffer to window.el.
19918 (bury-buffer): Move to window.el.
19919 (Vbuffer_list_update_hook): New variable.
19920
19921 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19922 section.
19923
19924 * window.h (resize_frame_windows): Move up in code.
19925 (Fwindow_frame): Remove EXFUN.
19926 (replace_buffer_in_all_windows): Remove prototype.
19927 (replace_buffer_in_windows_safely): Add prototype.
19928
19929 * window.c: Declare Qdelete_window static again. Move down
19930 declaration of select_count.
19931 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19932 (Fother_window): Move to window.el.
19933 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19934 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19935 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19936 window.el.
19937 (replace_buffer_in_windows): Implement by calling
19938 Qreplace_buffer_in_windows.
19939 (replace_buffer_in_all_windows): Remove with some functionality
19940 moved into replace_buffer_in_windows_safely.
19941 (replace_buffer_in_windows_safely): New function.
19942 (select_window_norecord, select_frame_norecord): Move in front
19943 of run_window_configuration_change_hook. Remove now obsolete
19944 declarations.
19945 (Fset_window_buffer): Rewrite doc-string.
19946 Call Qrecord_window_buffer.
19947 (keys_of_window): Move binding for other-window to window.el.
19948
19949 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19950
19951 * dispextern.h (struct image): Replace data member, whose int_val
19952 and ptr_val fields were not used by anything, with a single
19953 lisp_val object.
19954
19955 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19956 (gif_clear_image, gif_load, imagemagick_load_image)
19957 (gs_clear_image, gs_load): Callers changed.
19958
19959 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19960
19961 * buffer.h: Include <time.h>, for time_t.
19962 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19963
19964 Fix minor problems found by static checking.
19965
19966 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19967
19968 Make identifiers static if they are not used in other modules.
19969 * data.c (Qcompiled_function, Qframe, Qvector):
19970 * image.c (QimageMagick, Qsvg):
19971 * minibuf.c (Qmetadata):
19972 * window.c (resize_window_check, resize_root_window): Now static.
19973 * window.h (resize_window_check, resize_root_window): Remove decls.
19974
19975 * window.c (window_deletion_count, delete_deletable_window):
19976 Remove; unused.
19977 (window_body_lines): Now static.
19978 (Fdelete_other_windows_internal): Mark vars as initialized.
19979 Make sure 'resize_failed' is initialized.
19980 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19981 (resize_window_apply): Remove unused local.
19982 * window.h (delete_deletable_window): Remove decl.
19983
19984 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
19985 (imagemagick_load_image): Fix pointer signedness problem by changing
19986 last arg from unsigned char * to char *. All uses changed.
19987 Also, fix a local for similar reasons.
19988 Remove unused locals. Remove locals to avoid shadowing.
19989 (fn_rsvg_handle_free): Remove; unused.
19990 (svg_load, svg_load_image): Fix pointer signedness problem.
19991 (imagemagick_load_image): Don't use garbage pointer image_wand.
19992
19993 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19994
19995 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
19996
19997 * image.c (gif_load): Fix omitted cast error introduced by
19998 2011-06-06 change.
19999
20000 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20001
20002 * window.h (resize_proportionally, orig_total_lines)
20003 (orig_top_line): Remove from window structure.
20004 (set_window_height, set_window_width, change_window_heights)
20005 (Fdelete_window): Remove prototypes.
20006 (resize_frame_windows): Remove duplicate declaration.
20007
20008 2011-06-10 Eli Zaretskii <eliz@gnu.org>
20009
20010 * window.h (resize_frame_windows, resize_window_check)
20011 (delete_deletable_window, resize_root_window)
20012 (resize_frame_windows): Declare prototypes.
20013
20014 * window.c (resize_window_apply): Make definition be "static" to
20015 match the prototype.
20016
20017 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20018
20019 * window.c: Remove declarations of Qwindow_size_fixed,
20020 window_min_size_1, window_min_size_2, window_min_size,
20021 size_window, window_fixed_size_p, enlarge_window, delete_window.
20022 Remove static from declaration of Qdelete_window, it's
20023 temporarily needed by Fbury_buffer.
20024 (replace_window): Don't assign orig_top_line and
20025 orig_total_lines.
20026 (Fdelete_window, delete_window): Remove. Window deletion is
20027 handled by window.el.
20028 (window_loop): Remove DELETE_OTHER_WINDOWS case.
20029 Replace Fdelete_window calls with calls to Qdelete_window.
20030 (Fdelete_other_windows): Remove. Deleting other windows is
20031 handled by window.el.
20032 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
20033 handled in window.el.
20034 (window_min_size_2, window_min_size_1, window_min_size): Remove.
20035 Window minimum sizes are handled in window.el.
20036 (shrink_windows, size_window, set_window_height)
20037 (set_window_width, change_window_heights, window_height)
20038 (window_width, CURBEG, CURSIZE, enlarge_window)
20039 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20040 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20041 handled in window.el.
20042 (make_dummy_parent): Rename to make_parent_window and give it a
20043 second argument horflag.
20044 (make_window): Don't set resize_proportionally any more.
20045 (Fsplit_window): Remove. Windows are split in window.el.
20046 (save_restore_action, save_restore_orig_size)
20047 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20048 Resize mini windows in window.el.
20049 (grow_mini_window, shrink_mini_window): Implement by calling
20050 Qresize_root_window_vertically, resize_window_check and
20051 resize_window_apply.
20052 (saved_window, Fset_window_configuration, save_window_save):
20053 Do not handle orig_top_line, orig_total_lines, and
20054 resize_proportionally.
20055 (window_min_height, window_min_width): Move to window.el.
20056 (keys_of_window): Move bindings for delete-other-windows,
20057 split-window, delete-window and enlarge-window to window.el.
20058
20059 * buffer.c: Temporarily extern Qdelete_window.
20060 (Fbury_buffer): Temporarily call Qdelete_window instead of
20061 Fdelete_window (Fbury_buffer will move to window.el soon).
20062
20063 * frame.c (set_menu_bar_lines_1): Remove code handling
20064 orig_top_line and orig_total_lines.
20065
20066 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20067 set_window_height but set heights directly.
20068 (change_frame_size_1): Use resize_frame_windows.
20069
20070 * xdisp.c (init_xdisp): Don't use set_window_height but set
20071 heights directly.
20072
20073 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20074 Use resize_frame_windows instead of change_window_heights and run
20075 run_window_configuration_change_hook.
20076
20077 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20078 instead of change_window_heights and run
20079 run_window_configuration_change_hook.
20080
20081 2011-06-09 Martin Rudalics <rudalics@gmx.at>
20082
20083 * window.c (replace_window): Rename second argument REPLACEMENT to
20084 NEW. New third argument SETFLAG. Rewrite.
20085 (delete_window, make_dummy_parent): Call replace_window with
20086 third argument 1.
20087 (window_list_1): Move down in code.
20088 (run_window_configuration_change_hook): Move set_buffer part
20089 before select_frame_norecord part in order to unwind correctly.
20090 Rename count1 to count.
20091 (recombine_windows, delete_deletable_window, resize_root_window)
20092 (Fdelete_other_windows_internal)
20093 (Frun_window_configuration_change_hook, make_parent_window)
20094 (resize_window_check, resize_window_apply, Fresize_window_apply)
20095 (resize_frame_windows, Fsplit_window_internal)
20096 (Fdelete_window_internal, Fresize_mini_window_internal):
20097 New functions.
20098 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20099
20100 2011-06-08 Martin Rudalics <rudalics@gmx.at>
20101
20102 * window.h (window): Add some new members to window structure -
20103 normal_lines, normal_cols, new_total, new_normal, clone_number,
20104 splits, nest, prev_buffers, next_buffers.
20105 (WINDOW_TOTAL_SIZE): Move here from window.c.
20106 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20107
20108 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20109 Remove.
20110 (make_dummy_parent): Set new members of windows structure.
20111 (make_window): Move down in code. Handle new members of window
20112 structure.
20113 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20114 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20115 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20116 (Fset_window_prev_buffers, Fwindow_next_buffers)
20117 (Fset_window_next_buffers, Fset_window_clone_number):
20118 New functions.
20119 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20120 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20121 Doc-string fixes.
20122 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20123 Argument WINDOW can be now internal window too.
20124 (Fwindow_use_time): Move up in code.
20125 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20126 Rewrite doc-string.
20127 (Fset_window_configuration, saved_window)
20128 (Fcurrent_window_configuration, save_window_save): Handle new
20129 members of window structure.
20130 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20131 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20132 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20133 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20134 Qget_mru_window, Qresize_root_window,
20135 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20136 Qauto_buffer_name; staticpro them.
20137
20138 2011-06-07 Martin Rudalics <rudalics@gmx.at>
20139
20140 * window.c (Fwindow_total_size, Fwindow_left_column)
20141 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20142 (Fwindow_list_1): New functions.
20143 (window_box_text_cols): Replace with window_body_cols.
20144 (Fwindow_width, Fscroll_left, Fscroll_right):
20145 Use window_body_cols instead of window_box_text_cols.
20146 (delete_window, Fset_window_configuration):
20147 Call delete_all_subwindows with window as argument.
20148 (delete_all_subwindows): Take a window as argument and not a
20149 structure. Rewrite.
20150 (window_loop): Remove handling of GET_LRU_WINDOW and
20151 GET_LARGEST_WINDOW.
20152 (Fget_lru_window, Fget_largest_window): Move to window.el.
20153
20154 * window.h: Extern window_body_cols instead of
20155 window_box_text_cols. delete_all_subwindows now takes a
20156 Lisp_Object as argument.
20157
20158 * indent.c (compute_motion, Fcompute_motion):
20159 Use window_body_cols instead of window_box_text_cols.
20160
20161 * frame.c (delete_frame): Call delete_all_subwindows with root
20162 window as argument.
20163
20164 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20165
20166 * fns.c (Fputhash): Document return value.
20167
20168 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
20169
20170 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20171
20172 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20173
20174 Cons<->int and similar integer overflow fixes (Bug#8794).
20175
20176 Check for overflow when converting integer to cons and back.
20177 * charset.c (Fdefine_charset_internal, Fdecode_char):
20178 Use cons_to_unsigned to catch overflow.
20179 (Fencode_char): Use INTEGER_TO_CONS.
20180 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20181 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20182 * data.c (long_to_cons, cons_to_long): Remove.
20183 (cons_to_unsigned, cons_to_signed): New functions.
20184 These signal an error for invalid or out-of-range values.
20185 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20186 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20187 * font.c (Ffont_variation_glyphs):
20188 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20189 * lisp.h: Include <intprops.h>.
20190 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20191 (cons_to_signed, cons_to_unsigned): New decls.
20192 (long_to_cons, cons_to_long): Remove decls.
20193 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20194 (Fprimitive_undo): Use CONS_TO_INTEGER.
20195 * xfns.c (Fx_window_property): Likewise.
20196 * xselect.c: Include <limits.h>.
20197 (x_own_selection, selection_data_to_lisp_data):
20198 Use INTEGER_TO_CONS.
20199 (x_handle_selection_request, x_handle_selection_clear)
20200 (x_get_foreign_selection, Fx_disown_selection_internal)
20201 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20202 (lisp_data_to_selection_data): Use cons_to_unsigned.
20203 (x_fill_property_data): Use cons_to_signed.
20204 Report values out of range.
20205
20206 Check for buffer and string overflow more precisely.
20207 * buffer.h (BUF_BYTES_MAX): New macro.
20208 * lisp.h (STRING_BYTES_MAX): New macro.
20209 * alloc.c (Fmake_string):
20210 * character.c (string_escape_byte8):
20211 * coding.c (coding_alloc_by_realloc):
20212 * doprnt.c (doprnt):
20213 * editfns.c (Fformat):
20214 * eval.c (verror):
20215 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20216 since they may not be the same number.
20217 * editfns.c (Finsert_char):
20218 * fileio.c (Finsert_file_contents):
20219 Likewise for BUF_BYTES_MAX.
20220
20221 * image.c: Use ptrdiff_t, not int, for sizes.
20222 (slurp_file): Switch from int to ptrdiff_t.
20223 All uses changed.
20224 (slurp_file): Check that file size fits in both size_t (for
20225 malloc) and ptrdiff_t (for sanity and safety).
20226
20227 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20228 if b->modtime has its maximal value.
20229
20230 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20231
20232 Don't assume time_t can fit into int.
20233 * buffer.h (struct buffer.modtime): Now time_t, not int.
20234 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20235 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20236
20237 Minor fixes for signed vs unsigned integers.
20238 * character.h (MAYBE_UNIFY_CHAR):
20239 * charset.c (maybe_unify_char):
20240 * keyboard.c (read_char, reorder_modifiers):
20241 XINT -> XFASTINT, since the integer must be nonnegative.
20242 * ftfont.c (ftfont_spec_pattern):
20243 * keymap.c (access_keymap, silly_event_symbol_error):
20244 XUINT -> XFASTINT, since the integer must be nonnegative.
20245 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20246 since it makes no difference and we prefer signed.
20247 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20248 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20249 nonnegative.
20250
20251 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20252
20253 * window.h (Fwindow_frame): Declare.
20254
20255 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20256
20257 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20258 (SPARE_MEMORY): Always define.
20259 (LARGE_REQUEST): Remove.
20260 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20261
20262 2011-06-06 Martin Rudalics <rudalics@gmx.at>
20263
20264 * lisp.h: Move EXFUNS for Fframe_root_window,
20265 Fframe_first_window and Fset_frame_selected_window to window.h.
20266
20267 * window.h: Move EXFUNS for Fframe_root_window,
20268 Fframe_first_window and Fset_frame_selected_window here from
20269 lisp.h.
20270
20271 * frame.c (Fwindow_frame, Fframe_first_window)
20272 (Fframe_root_window, Fframe_selected_window)
20273 (Fset_frame_selected_window): Move to window.c.
20274 (Factive_minibuffer_window): Move to minibuf.c.
20275 (Fother_visible_frames_p): New function.
20276
20277 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20278
20279 * window.c (decode_window, decode_any_window): Move up in code.
20280 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20281 (inhibit_frame_unsplittable): Remove unused variable.
20282 (Fwindow_buffer): Move up and rewrite doc-string.
20283 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20284 (Fwindow_prev): New functions.
20285 (Fwindow_frame): Move here from frame.c. Accept any window as
20286 argument.
20287 (Fframe_root_window, Fframe_first_window)
20288 (Fframe_selected_window): Move here from frame.c. Accept frame
20289 or arbitrary window as argument. Update doc-strings.
20290 (Fminibuffer_window): Move up in code.
20291 (Fwindow_minibuffer_p): Move up in code and simplify.
20292 (Fset_frame_selected_window): Move here from frame.c.
20293 Marginal rewrite.
20294 (Fselected_window, select_window, Fselect_window): Move up in
20295 code. Minor doc-string fixes.
20296
20297 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20298
20299 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20300 Do not assume that spare memory exists; that assumption is valid
20301 only if SYSTEM_MALLOC.
20302 (LARGE_REQUEST): New macro, so that the issue of large requests
20303 is separated from the issue of spare memory.
20304
20305 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20306
20307 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20308 format. (Bug#8806)
20309
20310 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20311
20312 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20313 before statements.
20314
20315 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20316
20317 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20318
20319 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20320
20321 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20322 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20323
20324 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20325
20326 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20327
20328 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20329
20330 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20331 (x_clipboard_manager_save): Add return value.
20332 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20333 New error handlers.
20334 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20335 Obey Vx_select_enable_clipboard_manager. Catch errors in
20336 x_clipboard_manager_save (Bug#8779).
20337 (Vx_select_enable_clipboard_manager): New variable.
20338 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20339
20340 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20341
20342 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20343
20344 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20345
20346 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20347 in the current matrix if keep_current_p is non-zero.
20348
20349 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20350
20351 * bidi.c (bidi_level_of_next_char): Fix last change.
20352
20353 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20354
20355 Support bidi reordering of text covered by display properties.
20356
20357 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20358 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20359 (bidi_cache_search, bidi_cache_iterator_state)
20360 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20361 (bidi_level_of_next_char, bidi_move_to_visually_next):
20362 Support character positions inside a run of characters covered by a
20363 display string.
20364 (bidi_paragraph_init, bidi_resolve_explicit_1)
20365 (bidi_level_of_next_char): Call bidi_fetch_char and
20366 bidi_fetch_char_advance instead of FETCH_CHAR and
20367 FETCH_CHAR_ADVANCE.
20368 (bidi_init_it): Initialize new members.
20369 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20370 definitions.
20371 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20372 instead of using explicit *_CHAR codes.
20373 (bidi_resolve_explicit, bidi_resolve_weak):
20374 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20375 bidirectional text is supported only in multibyte buffers.
20376 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20377 it to initialize the frame_window_p member of struct bidi_it.
20378 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20379 (bidi_resolve_explicit, bidi_resolve_weak)
20380 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20381 bidi_it->nchars is non-positive.
20382 (bidi_level_of_next_char): Don't try to lookup the cache for the
20383 next/previous character if nothing is cached there yet, or if we
20384 were just reseat()'ed to a new position.
20385
20386 * xdisp.c (set_cursor_from_row): Set start and stop points
20387 according to the row's direction when priming the loop that looks
20388 for the glyph on which to display cursor.
20389 (single_display_spec_intangible_p): Function deleted.
20390 (display_prop_intangible_p): Reimplement to call
20391 handle_display_spec instead of single_display_spec_intangible_p.
20392 Accept 3 additional arguments needed by handle_display_spec.
20393 This fixes incorrect cursor motion across display property with complex
20394 values: lists, `(when COND...)' forms, etc.
20395 (single_display_spec_string_p): Support property values that are
20396 lists with the argument STRING its top-level element.
20397 (display_prop_string_p): Fix the condition for processing a
20398 property that is a list to be consistent with handle_display_spec.
20399 (handle_display_spec): New function, refactored from the
20400 last portion of handle_display_prop.
20401 (compute_display_string_pos): Accept additional argument
20402 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20403 value of a `display' property is a "replacing spec".
20404 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20405 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20406 the display property, but just return a value indicating whether
20407 the display property will replace the characters it covers.
20408 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20409 frame_window_p members of struct bidi_it.
20410 (compute_display_string_pos, compute_display_string_end):
20411 New functions.
20412 (push_it): Accept second argument POSITION, where pop_it should
20413 jump to continue iteration.
20414 (reseat_1): Initialize bidi_it.disp_pos.
20415
20416 * keyboard.c (adjust_point_for_property): Adjust the call to
20417 display_prop_intangible_p to its new signature.
20418
20419 * dispextern.h (struct bidi_it): New member frame_window_p.
20420 (bidi_init_it): Update prototypes.
20421 (display_prop_intangible_p): Update prototype.
20422 (compute_display_string_pos, compute_display_string_end):
20423 Declare prototypes.
20424 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20425 EMACS_INT.
20426
20427 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20428
20429 Malloc failure behavior now depends on size of allocation.
20430 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20431 * lisp.h: Change signatures accordingly.
20432 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20433 All callers changed. (Bug#8762)
20434
20435 * gnutls.c: Use Emacs's memory allocators.
20436 Without this change, the gnutls library would invoke malloc etc.
20437 directly, which causes problems on non-SYNC_INPUT hosts, and which
20438 runs afoul of improving memory_full behavior. (Bug#8761)
20439 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20440 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20441 xfree instead of the default malloc, realloc, free.
20442 (Fgnutls_boot): No need to check for memory allocation failure,
20443 since xmalloc does that for us.
20444
20445 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20446 * category.c (hash_get_category_set):
20447 * ccl.c (ccl_driver):
20448 * charset.c (Fdefine_charset_internal):
20449 * charset.h (struct charset.hash_index):
20450 * composite.c (get_composition_id, gstring_lookup_cache)
20451 (composition_gstring_put_cache):
20452 * composite.h (struct composition.hash_index):
20453 * dispextern.h (struct image.hash):
20454 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20455 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20456 (hashfn_equal, hashfn_user_defined, make_hash_table)
20457 (maybe_resize_hash_table, hash_lookup, hash_put)
20458 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20459 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20460 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20461 * image.c (make_image, search_image_cache, lookup_image)
20462 (xpm_put_color_table_h):
20463 * lisp.h (struct Lisp_Hash_Table):
20464 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20465 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20466 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20467 * alloc.c (allocate_vectorlike):
20468 Check for overflow in vector size calculations.
20469 * ccl.c (ccl_driver):
20470 Check for overflow when converting EMACS_INT to int.
20471 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20472 need to be updated by these changes.
20473 * fns.c (make_hash_table, maybe_resize_hash_table):
20474 Check for integer overflow with large hash tables.
20475 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20476 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20477 (SXHASH_REDUCE): New macro.
20478 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20479 Use it instead of discarding useful hash info with large hash values.
20480 (sxhash_float): New function.
20481 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20482 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20483 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20484 Rewrite to use FIXNUM_BITS, as this simplifies things.
20485 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20486 Adjust signatures to match updated version of code.
20487 (consing_since_gc): Now EMACS_INT, since a single hash table can
20488 use more than INT_MAX bytes.
20489
20490 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20491
20492 Make it possible to build with GCC-4.6+ -O2 -flto.
20493
20494 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20495
20496 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20497
20498 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20499 Call minibuffer-inactive-mode.
20500
20501 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20502
20503 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20504 Update dependencies.
20505
20506 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20507
20508 * data.c (init_data): Remove code for UTS, this system is not
20509 supported anymore.
20510
20511 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20512
20513 Don't force ./temacs to start in terminal mode.
20514
20515 * frame.c (make_initial_frame): Initialize faces in all cases, not
20516 only when CANNOT_DUMP is defined.
20517 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20518
20519 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20520
20521 * dispnew.c (add_window_display_history): Use const for the string
20522 pointer. Remove declaration, not needed.
20523
20524 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20525
20526 Use 'inline', not 'INLINE'.
20527 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20528 * alloc.c, fontset.c (INLINE): Remove.
20529 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20530 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20531 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20532 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20533 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20534
20535 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20536
20537 Make it possible to run ./temacs.
20538
20539 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20540 syms_of_callproc does the same thing. Remove test for
20541 "initialized", do it in the caller.
20542 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20543
20544 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20545
20546 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20547 (read_minibuf): Use get_minibuffer.
20548 (syms_of_minibuf): Use DEFSYM.
20549 (Qmetadata): New var.
20550 * data.c (Qbuffer): Don't make it static.
20551 (syms_of_data): Use DEFSYM.
20552
20553 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20554
20555 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20556 (CCL_CODE_MIN): New macro.
20557
20558 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20559
20560 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20561
20562 * eval.c (Qdebug): Now static.
20563 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20564 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20565 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20566
20567 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20568
20569 * image.c: Various fixes to ImageMagick code comments.
20570 (Fimagemagick_types): Doc fix.
20571
20572 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20573
20574 Minor fixes prompted by GCC 4.6.0 warnings.
20575
20576 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20577
20578 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20579 (x_clipboard_manager_save_all): Move extern decl to ...
20580 * xterm.h: ... here, so that it can be checked for consistency.
20581
20582 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20583
20584 * xselect.c (x_clipboard_manager_save_frame)
20585 (x_clipboard_manager_save_all): New functions.
20586 (Fx_clipboard_manager_save): Lisp function deleted.
20587
20588 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20589 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20590
20591 * xterm.h: Update prototype.
20592
20593 2011-05-28 William Xu <william.xwl@gmail.com>
20594
20595 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20596 exiting (Bug#8239).
20597
20598 2011-05-28 Jim Meyering <meyering@redhat.com>
20599
20600 Avoid a sign-extension bug in crypto_hash_function.
20601 * fns.c (to_uchar): Define.
20602 (crypto_hash_function): Use it to convert some newly-signed
20603 variables to unsigned, to avoid sign-extension bugs. For example,
20604 without this change, (md5 "truc") would evaluate to
20605 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20606 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
20607 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
20608
20609 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20610
20611 Integer overflow fixes.
20612
20613 * dbusbind.c: Serial number integer overflow fixes.
20614 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
20615 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20616 to hold a serial number that is too large for a fixnum.
20617 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20618 Check for serial numbers out of range. Decode any serial number
20619 that was so large that it became a float. (Bug#8722)
20620
20621 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20622 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20623 Use XFASTINT rather than XUINT when numbers are nonnegative.
20624 (xd_append_arg, Fdbus_method_return_internal):
20625 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20626 arguments, check that Lisp number is nonnegative, rather than
20627 silently wrapping negative numbers around. (Bug#8722)
20628 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
20629 (Bug#8722)
20630
20631 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20632
20633 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20634
20635 ccl: Add integer overflow checks.
20636 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20637 (IN_INT_RANGE): New macros.
20638 (ccl_driver): Use them to check for integer overflow when
20639 decoding a CCL program. Many of the new checks are whether XINT (x)
20640 fits in int; it doesn't always, on 64-bit hosts. The new version
20641 doesn't catch all possible integer overflows, but it's an
20642 improvement. (Bug#8719)
20643
20644 * alloc.c (make_event_array): Use XINT, not XUINT.
20645 There's no need for unsigned here.
20646
20647 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20648 This follows up to the 2011-05-06 change that substituted uintptr_t
20649 for EMACS_INT. This case wasn't caught back then.
20650
20651 Rework Fformat to avoid integer overflow issues.
20652 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20653 now (part of C89). Include <verify.h>.
20654 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20655 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20656 (Fformat): Avoid the prepass trying to compute sizes; it was only
20657 approximate and thus did not catch overflow reliably. Instead, walk
20658 through the format just once, formatting and computing sizes as we go,
20659 checking for integer overflow at every step, and allocating a larger
20660 buffer as needed. Keep track separately whether the format is
20661 multibyte. Keep only the most-recently calculated precision, rather
20662 than them all. Record whether each argument has been converted to
20663 string. Use EMACS_INT, not int, for byte and char and arg counts.
20664 Support field widths and precisions larger than INT_MAX. Avoid
20665 sprintf's undefined behavior with conversion specifications such as %#d
20666 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20667 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20668 formatting out-of-range floating point numbers with int
20669 formats. (Bug#8668)
20670
20671 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20672
20673 * data.c: Avoid integer truncation in expressions involving floats.
20674 * data.c: Include <intprops.h>.
20675 (arith_driver): When there's an integer overflow in an expression
20676 involving floating point, convert the integers to floating point
20677 so that the resulting value does not suffer from catastrophic
20678 integer truncation. For example, on a 64-bit host (* 4
20679 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20680 Do not rely on undefined behavior after integer overflow.
20681
20682 merge count_size_as_multibyte, parse_str_to_multibyte
20683 * character.c, character.h (count_size_as_multibyte):
20684 Rename from parse_str_to_multibyte; all uses changed.
20685 Check for integer overflow.
20686 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20687 since it's now a duplicate of the other. This is more of
20688 a character than a buffer op, so better that it's in character.c.
20689 * fns.c, print.c: Adjust to above changes.
20690
20691 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20692
20693 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20694
20695 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20696
20697 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20698 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20699 (x_clipboard_manager_save): Now static.
20700 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20701
20702 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20703 (crypto_hash_function): Now static.
20704 Fix pointer signedness problems. Avoid unnecessary initializations.
20705
20706 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
20707
20708 * termhooks.h (Vselection_alist): Make it terminal-local.
20709
20710 * terminal.c (create_terminal): Initialize it.
20711
20712 * xselect.c: Support for clipboard managers.
20713 (Vselection_alist): Move to termhooks.h as terminal-local var.
20714 (LOCAL_SELECTION): New macro.
20715 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20716 (symbol_to_x_atom): Remove gratuitous arg.
20717 (x_handle_selection_request, lisp_data_to_selection_data)
20718 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
20719 (x_own_selection, x_get_local_selection, x_convert_selection):
20720 New arg, specifying work frame. Use terminal-local Vselection_alist.
20721 (some_frame_on_display): Delete unused function.
20722 (Fx_own_selection_internal, Fx_get_selection_internal)
20723 (Fx_disown_selection_internal, Fx_selection_owner_p)
20724 (Fx_selection_exists_p): New optional frame arg.
20725 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20726 (x_handle_selection_clear): Don't treat other terminals with the
20727 same keyboard specially. Use the terminal-local Vselection_alist.
20728 (x_clear_frame_selections): Use Frun_hook_with_args.
20729
20730 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20731
20732 * xterm.h: Add support for those atoms.
20733
20734 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
20735
20736 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20737 (converted_selections, conversion_fail_tag): New global variables.
20738 (x_selection_request_lisp_error): Free the above.
20739 (x_get_local_selection): Remove unnecessary code.
20740 (x_reply_selection_request): Args changed; handle arbitrary array
20741 of converted selections stored in converted_selections.
20742 Separate the XChangeProperty and SelectionNotify steps.
20743 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20744 (x_convert_selection): New function.
20745 (x_handle_selection_event): Simplify.
20746 (x_get_foreign_selection): Don't ignore incoming requests while
20747 waiting for an answer; this will fail when we implement
20748 SAVE_TARGETS, and seems unnecessary anyway.
20749 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20750 (Vx_sent_selection_functions): Doc fix.
20751
20752 2011-05-26 Leo Liu <sdl.web@gmail.com>
20753
20754 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20755
20756 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20757
20758 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20759
20760 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20761 for fringe update if it has periodic bitmap.
20762 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
20763 and fringe_bitmap_periodic_p.
20764
20765 * fringe.c (get_fringe_bitmap_data): New function.
20766 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20767 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20768 row. Mark glyph row for fringe update if periodicity changed.
20769
20770 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20771 for fringe update unless it has periodic bitmap.
20772
20773 2011-05-25 Kenichi Handa <handa@m17n.org>
20774
20775 * xdisp.c (get_next_display_element): Set correct it->face_id for
20776 a static composition.
20777
20778 2011-05-24 Leo Liu <sdl.web@gmail.com>
20779
20780 * deps.mk (fns.o):
20781 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20782
20783 * fns.c (crypto_hash_function, Fsha1): New function.
20784 (Fmd5): Use crypto_hash_function.
20785 (syms_of_fns): Add Ssha1.
20786
20787 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20788
20789 * gnutls.c: Remove unused macros.
20790 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20791 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20792 Remove macros that are defined and never used.
20793 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20794
20795 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20796
20797 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20798 (Fx_get_selection_internal): Minor cleanup.
20799 (Fx_own_selection_internal): Rename arguments for consistency with
20800 select.el.
20801
20802 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20803
20804 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20805
20806 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20807
20808 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20809
20810 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20811
20812 * dispnew.c (scrolling_window): Don't exclude the case that the
20813 last enabled row in the desired matrix touches the bottom boundary.
20814
20815 2011-05-21 Glenn Morris <rgm@gnu.org>
20816
20817 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
20818 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20819 and add some more files.
20820
20821 2011-05-20 Eli Zaretskii <eliz@gnu.org>
20822
20823 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20824 report_file_error introduced by the change from 2011-05-07.
20825
20826 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20827
20828 * systime.h (Time): Define only if emacs is defined.
20829 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20830 where the include path doesn't have X11/X.h by default. See
20831 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20832
20833 2011-05-20 Kenichi Handa <handa@m17n.org>
20834
20835 * composite.c (find_automatic_composition): Fix previous change.
20836
20837 2011-05-20 Glenn Morris <rgm@gnu.org>
20838
20839 * lisp.mk: New file, split from Makefile.in.
20840 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20841 (shortlisp): Remove.
20842 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20843
20844 2011-05-19 Glenn Morris <rgm@gnu.org>
20845
20846 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20847 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20848 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20849 (lisp): Set the order to that of loadup.el.
20850 (shortlisp): Make it a copy of $lisp.
20851 (SOME_MACHINE_LISP): Remove.
20852 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20853 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20854
20855 2011-05-18 Kenichi Handa <handa@m17n.org>
20856
20857 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20858 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20859 (find_automatic_composition): Mostly rewrite for efficiency.
20860
20861 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
20862
20863 * makefile.w32-in: Update dependencies.
20864
20865 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20866
20867 * menu.c: Include limits.h (fixes the MS-Windows build broken by
20868 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
20869
20870 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
20871
20872 Fix some integer overflow issues, such as string length overflow.
20873
20874 * insdel.c (count_size_as_multibyte): Check for string overflow.
20875
20876 * character.c (lisp_string_width): Check for string overflow.
20877 Use EMACS_INT, not int, for string indexes and lengths; in
20878 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20879 the resulting string length overflows an EMACS_INT; instead,
20880 report a string overflow if no precision given. When checking for
20881 precision exhaustion, use a check that cannot possibly have
20882 integer overflow. (Bug#8675)
20883 * character.h (lisp_string_width): Adjust to new signature.
20884
20885 * alloc.c (string_overflow): New function.
20886 (Fmake_string): Use it. This doesn't change behavior, but saves
20887 a few bytes and will simplify future changes.
20888 * character.c (string_escape_byte8): Likewise.
20889 * lisp.h (string_overflow): New decl.
20890
20891 Fixups, following up to the user-interface timestamp change.
20892 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20893 for UI timestamps, instead of unsigned long.
20894 * msdos.c (mouse_get_pos): Likewise.
20895 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
20896 * w32gui.h (Time): Define by including "systime.h" rather than by
20897 declaring it ourselves. (Bug#8664)
20898
20899 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20900 * image.c (clear_image_cache): Likewise.
20901
20902 * term.c (term_mouse_position): Don't assume time_t wraparound.
20903
20904 Be more systematic about user-interface timestamps.
20905 Before, the code sometimes used 'Time', sometimes 'unsigned long',
20906 and sometimes 'EMACS_UINT', to represent these timestamps.
20907 This change causes it to use 'Time' uniformly, as that's what X uses.
20908 This makes the code easier to follow, and makes it easier to catch
20909 integer overflow bugs such as Bug#8664.
20910 * frame.c (Fmouse_position, Fmouse_pixel_position):
20911 Use Time, not unsigned long, for user-interface timestamps.
20912 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20913 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20914 * keyboard.h (last_event_timestamp): Likewise.
20915 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20916 * menu.h (xmenu_show): Likewise.
20917 * term.c (term_mouse_position): Likewise.
20918 * termhooks.h (struct input_event.timestamp): Likewise.
20919 (struct terminal.mouse_position_hook): Likewise.
20920 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20921 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20922 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20923 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20924 what it was before.
20925 * menu.h, termhooks.h: Include "systime.h", for Time.
20926
20927 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20928 Don't assume that the difference between two unsigned long values
20929 can fit into an integer. At this point, we know button_down_time
20930 <= event->timestamp, so the difference must be nonnegative, so
20931 there's no need to cast the result if double-click-time is
20932 nonnegative, as it should be; check that it's nonnegative, just in
20933 case. This bug is triggered when events are more than 2**31 ms
20934 apart (about 25 days). (Bug#8664)
20935
20936 * xselect.c (last_event_timestamp): Remove duplicate decl.
20937 (x_own_selection): Remove needless cast to unsigned long.
20938
20939 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20940 that always fit in int. Use a sentinel instead of a counter, to
20941 avoid a temp and to allay GCC's concerns about possible int overflow.
20942 * frame.h (struct frame): Use int for menu_bar_items_used
20943 instead of EMACS_INT, since it always fits in int.
20944
20945 * menu.c (grow_menu_items): Check for int overflow.
20946
20947 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20948
20949 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20950 Before, the code was not consistent. These values cannot exceed
20951 2**31 - 1 so there's no need to make them unsigned.
20952 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20953 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20954 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20955 as modifiers.
20956 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20957
20958 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20959 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20960 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20961 presumably because the widths might not match.
20962
20963 * window.c (size_window): Avoid needless test at loop start.
20964
20965 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20966
20967 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20968
20969 2011-05-12 Drew Adams <drew.adams@oracle.com>
20970
20971 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20972
20973 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20974
20975 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20976 `width' to `bar_area_x' and `bar_area_width', respectively.
20977 (x_scroll_run): Take account of fringe background extension.
20978
20979 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20980 Rename local vars `left' and `width' to `bar_area_x' and
20981 `bar_area_width', respectively.
20982 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20983 background extension.
20984
20985 2011-05-10 Jim Meyering <meyering@redhat.com>
20986
20987 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20988
20989 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
20990
20991 * image.c (Finit_image_library): Return t for built-in image types,
20992 like pbm and xbm. (Bug#8640)
20993
20994 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20995
20996 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20997
20998 2011-05-07 Eli Zaretskii <eliz@gnu.org>
20999
21000 * w32console.c (Fset_screen_color): Doc fix.
21001 (Fget_screen_color): New function.
21002 (syms_of_ntterm): Defsubr it.
21003
21004 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
21005 unlink the temporary file if Fcall_process didn't create it in the
21006 first place.
21007 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
21008 child process will be redirected to a file specified with `:file'.
21009 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
21010 cue to call_process_cleanup not to close that handle.
21011
21012 2011-05-07 Ben Key <bkey76@gmail.com>
21013
21014 * makefile.w32-in: The bootstrap-temacs rule now makes use of
21015 one of two shell specific rules, either bootstrap-temacs-CMD or
21016 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
21017 to the previous implementation of the bootstrap-temacs rule.
21018 The bootstrap-temacs-CMD rule is similar to the previous
21019 implementation of the bootstrap-temacs rule except that it
21020 makes use of the ESC_CFLAGS variable instead of the CFLAGS
21021 variable.
21022
21023 These changes, along with some changes to nt/configure.bat,
21024 nt/gmake.defs, and nt/nmake.defs, are required to extend my
21025 earlier fix to add support for --cflags and --ldflags options
21026 that include quotes so that it works whether make uses cmd or
21027 sh as the shell.
21028
21029 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
21030
21031 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
21032 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
21033 is a constant.
21034 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
21035 a string. Handle both cases.
21036 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
21037 (Fdbus_register_method): Use Qinvalid_function.
21038
21039 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21040
21041 * makefile.w32-in: Update dependencies.
21042 (LISP_H): Add inttypes.h and stdin.h.
21043 (PROCESS_H): Add unistd.h.
21044
21045 2011-05-06 Eli Zaretskii <eliz@gnu.org>
21046
21047 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21048 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21049
21050 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
21051
21052 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21053
21054 * term.c (vfatal): Remove stray call to va_end.
21055 It's not needed and the C Standard doesn't allow it here anyway.
21056
21057 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21058 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21059
21060 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21061 bytes.
21062
21063 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21064
21065 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21066
21067 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21068
21069 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21070
21071 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21072
21073 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21074 * charset.c (Fdefine_charset_internal): Don't initialize
21075 charset.code_space[15]. The value was garbage, on hosts with
21076 32-bit int (Bug#8600).
21077
21078 * lread.c (read_integer): Be more consistent with string-to-number.
21079 Use string_to_number to do the actual conversion; this avoids
21080 rounding errors and fixes some other screwups. Without this fix,
21081 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21082 (digit_to_number): Move earlier, for benefit of read_integer.
21083 Return -1 if the digit is out of range for the base, -2 if it is
21084 not a digit in any supported base. (Bug#8602)
21085
21086 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21087
21088 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21089 to match comment at start of function. This also removes a
21090 GCC warning about overflow in a 32+64-bit port.
21091
21092 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21093
21094 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21095 Reported by Stefan Monnier in
21096 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
21097 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21098 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21099
21100 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21101 (EMACS_UINTPTR): Likewise, with uintptr_t.
21102
21103 * lisp.h: Prefer 64-bit EMACS_INT if available.
21104 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21105 on 32-bit hosts that have 64-bit int, so that they can access
21106 large files.
21107 However, temporarily disable this change unless the temporary
21108 symbol WIDE_EMACS_INT is defined.
21109
21110 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21111
21112 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21113 This removes an assumption that EMACS_INT and long are the same
21114 width as pointers. The assumption is true for Emacs porting targets
21115 now, but we want to make other targets possible.
21116 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21117 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21118 In the rest of the code, change types of integers that hold casted
21119 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21120 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21121 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21122 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21123 No need to cast type when ORing.
21124 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21125 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21126 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21127 assume EMACS_INT is the same width as char *.
21128 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21129 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21130 Remove no-longer-needed casts.
21131 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21132 (xg_tool_bar_help_callback, xg_make_tool_item):
21133 Use EMACS_INTPTR to hold an integer
21134 that will be cast to void *; this can avoid a GCC warning
21135 if EMACS_INT is not the same width as void *.
21136 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21137 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21138 (current_message_1, set_message_1):
21139 Use a local to convert to proper width without a cast.
21140 * xmenu.c (dialog_selection_callback): Likewise.
21141
21142 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21143 Also, don't assume VALBITS / RAND_BITS is less than 5,
21144 and don't rely on undefined behavior when shifting a 1 left into
21145 the sign bit.
21146 * lisp.h (get_random): Change signature to match.
21147
21148 * lread.c (hash_string): Use size_t, not int, for hash computation.
21149 Normally we prefer signed values; but hashing is special, because
21150 it's better to use unsigned division on hash table sizes so that
21151 the remainder is nonnegative. Also, size_t is the natural width
21152 for hashing into memory. The previous code used 'int', which doesn't
21153 retain enough info to hash well into very large tables.
21154 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21155
21156 * dbusbind.c: Don't possibly lose pointer info when converting.
21157 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21158 Use XPNTR rather than XHASH, so that the high-order bits of
21159 the pointer aren't lost when converting through void *.
21160
21161 * eval.c (Fautoload): Don't double-shift a pointer.
21162
21163 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21164
21165 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21166
21167 * gnutls.c (DEF_GNUTLS_FN):
21168 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21169
21170 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21171
21172 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21173 marker. (Bug#8610)
21174
21175 2011-05-05 Eli Zaretskii <eliz@gnu.org>
21176
21177 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21178 New version that can reserve upto 2GB of heap space.
21179
21180 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
21181
21182 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21183
21184 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21185
21186 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21187 `gnutls_certificate_set_x509_key_file'.
21188
21189 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
21190
21191 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21192 Update dependencies.
21193
21194 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21195
21196 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21197 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21198 Remove unused parameter `fildes'.
21199 * process.c (read_process_output, send_process): Don't pass it.
21200
21201 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21202
21203 Fix previous change: the library cache is defined in w32.c.
21204 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21205 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21206
21207 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21208
21209 Implement dynamic loading of GnuTLS on Windows.
21210
21211 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21212 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21213 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21214 Declare.
21215
21216 * gnutls.c (Qgnutls_dll): Define.
21217 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21218 (gnutls_*): Declare function pointers.
21219 (init_gnutls_functions): New function to initialize function pointers.
21220 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21221 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21222 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21223 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21224 (emacs_gnutls_write, emacs_gnutls_read)
21225 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21226 (Fgnutls_available_p): New function.
21227 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21228 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21229 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21230
21231 * image.c: Include w32.h.
21232 (Vimage_type_cache): Delete.
21233 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21234 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21235 (w32_delayed_load): Move to w32.c.
21236
21237 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21238
21239 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21240 (w32_delayed_load): Move from image.c. When loading a library, record
21241 its filename in the :loaded-from property of the library id.
21242 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21243 Initialize and staticpro them.
21244 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21245
21246 * process.c: Include lisp.h before w32.h, not after.
21247 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21248 instead of gnutls_record_check_pending.
21249
21250 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21251
21252 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21253
21254 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21255 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21256 as passed in.
21257
21258 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21259
21260 * xterm.c (x_set_frame_alpha): Do not set property on anything
21261 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21262
21263 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21264
21265 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21266
21267 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21268
21269 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21270 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21271 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21272 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21273 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21274 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21275 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21276 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21277 (Qgnutls_bootprop_callbacks_verify): Make static.
21278
21279 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21280
21281 * callproc.c: Indentation fixup.
21282
21283 * sysdep.c (wait_for_termination_1): Make static.
21284 (wait_for_termination, interruptible_wait_for_termination):
21285 Move after wait_for_termination_1.
21286
21287 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21288
21289 * sysdep.c (interruptible_wait_for_termination): New function
21290 which is like wait_for_termination, but allows keyboard
21291 interruptions.
21292
21293 * callproc.c (Fcall_process): Add (:file "file") as an option for
21294 the STDOUT buffer.
21295 (Fcall_process_region): Ditto.
21296
21297 2011-04-30 Eli Zaretskii <eliz@gnu.org>
21298
21299 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21300 rather than `XVECTOR (FOO)->size'.
21301
21302 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21303 inttypes.h, as a gnulib replacement is used if it not available in
21304 system headers.
21305
21306 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21307
21308 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21309 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21310 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21311
21312 * coding.c (coding_alloc_by_realloc): Error out if destination
21313 will grow beyond MOST_POSITIVE_FIXNUM.
21314 (decode_coding_emacs_mule): Abort if there isn't enough place in
21315 charbuf for the composition carryover bytes. Reserve an extra
21316 space for up to 2 characters produced in a loop.
21317 (decode_coding_iso_2022): Abort if there isn't enough place in
21318 charbuf for the composition carryover bytes.
21319
21320 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21321
21322 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21323 aborting when %lld or %lll format is passed.
21324 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21325 %llo or %llx format is passed. (Bug#8545)
21326
21327 * window.c (window_scroll_line_based): Use a marker instead of
21328 simple variables to record original value of point. (Bug#7952)
21329
21330 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21331 produced by %s or %c overflows available buffer space. (Bug#8545)
21332
21333 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21334
21335 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21336 (SIZE_MAX): Move defn after all includes, as they might #define it.
21337
21338 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21339
21340 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21341
21342 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21343
21344 * keyboard.c (Qdelayed_warnings_hook): Define.
21345 (command_loop_1): Run `delayed-warnings-hook'
21346 if Vdelayed_warnings_list is non-nil.
21347 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21348 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21349
21350 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21351
21352 * doprnt.c (doprnt): Don't return value smaller than the buffer
21353 size if the message was truncated. (Bug#8545).
21354
21355 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21356
21357 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21358 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21359
21360 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21361
21362 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21363
21364 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21365
21366 * makefile.w32-in: Update dependencies.
21367
21368 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21369
21370 Improve `doprnt' and its usage. (Bug#8545)
21371 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21372 `format_end'. Remove support for %l as a conversion specifier.
21373 Don't use xrealloc. Improve diagnostics when the %l size modifier
21374 is used. Update the commentary.
21375
21376 * eval.c (verror): Simplify calculation of size_t.
21377
21378 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21379 messages.
21380
21381 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21382
21383 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21384 change.
21385
21386 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21387
21388 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21389 This makes this file independent of the recent pseudovector change.
21390
21391 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21392
21393 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21394
21395 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21396 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21397 Remove unused local.
21398 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21399
21400 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21401 GCC 4.6.0 optimizes based on type-based alias analysis.
21402 For example, if b is of type struct buffer * and v of type struct
21403 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21404 != &v->size, and therefore "v->size = 1; b->size = 2; return
21405 v->size;" must therefore return 1. This assumption is incorrect
21406 for Emacs, since it type-puns struct Lisp_Vector * with many other
21407 types. To fix this problem, this patch adds a new type struct
21408 vectorlike_header that documents the constraints on layout of vectors
21409 and pseudovectors, and helps optimizing compilers not get fooled
21410 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21411 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21412 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21413 the size member.
21414 (XSETPVECTYPE): Rewrite in terms of new macro.
21415 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21416 This is a bit clearer, and further avoids the possibility of
21417 undesirable aliasing.
21418 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21419 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21420 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21421 since Lisp_Subr is a special case (no "next" field).
21422 (ASIZE): Now uses header.size rather than size.
21423 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21424 to avoid the hassle of writing XVECTOR (foo)->header.size.
21425 (struct vectorlike_header): New type.
21426 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21427 object, to help avoid aliasing.
21428 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21429 (SUBRP): Likewise, since Lisp_Subr is a special case.
21430 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21431 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21432 (struct Lisp_Hash_Table): Combine first two members into a single
21433 struct vectorlike_header member. All uses of "size" and "next" members
21434 changed to be "header.size" and "header.next".
21435 * buffer.h (struct buffer): Likewise.
21436 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21437 * frame.h (struct frame): Likewise.
21438 * process.h (struct Lisp_Process): Likewise.
21439 * termhooks.h (struct terminal): Likewise.
21440 * window.c (struct save_window_data, struct saved_window): Likewise.
21441 * window.h (struct window): Likewise.
21442 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21443 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21444 * buffer.c (init_buffer_once): Likewise.
21445 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21446 special case.
21447 * process.c (Fformat_network_address): Use local var for size,
21448 for brevity.
21449
21450 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21451
21452 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21453 * data.c (atof): Remove decl; no longer used or needed.
21454 (digit_to_number): Move to lread.c.
21455 (Fstring_to_number): Use new string_to_number function, to be
21456 consistent with how the Lisp reader treats infinities and NaNs.
21457 Do not assume that floating-point numbers represent EMACS_INT
21458 without losing information; this is not true on most 64-bit hosts.
21459 Avoid double-rounding errors, by insisting on integers when
21460 parsing non-base-10 numbers, as the documentation specifies.
21461 * lisp.h (string_to_number): New decl, replacing ...
21462 (isfloat_string): Remove.
21463 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21464 (read1): Do not accept +. and -. as integers; this
21465 appears to have been a coding error. Similarly, do not accept
21466 strings like +-1e0 as floating point numbers. Do not report
21467 overflow for integer overflows unless the base is not 10 which
21468 means we have no simple and reliable way to continue.
21469 Break out the floating-point parsing into a new
21470 function string_to_number, so that Fstring_to_number parses
21471 floating point numbers consistently with the Lisp reader.
21472 (digit_to_number): Move here from data.c. Make it static inline.
21473 (E_CHAR, EXP_INT): Remove, replacing with ...
21474 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21475 (string_to_number): New function, replacing isfloat_string.
21476 This function checks for valid syntax and produces the resulting
21477 Lisp float number too. Rework it so that string-to-number
21478 no longer mishandles examples like "1.0e+". Use strtoumax,
21479 so that overflow for non-base-10 numbers is reported only when
21480 there's no portable and simple way to convert to floating point.
21481
21482 * textprop.c (set_text_properties_1): Rewrite for clarity,
21483 and to avoid GCC warning about integer overflow.
21484
21485 * intervals.h (struct interval): Use EMACS_INT for members
21486 where EMACS_UINT might cause problems. See
21487 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21488 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21489 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21490 All uses changed.
21491 (offset_intervals): Tell GCC not to worry about length overflow
21492 when negating a negative length.
21493
21494 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21495 (overrun_check_free): Likewise.
21496
21497 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21498 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21499 word size.
21500
21501 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21502 (gnutls_make_error): Rename local to avoid shadowing.
21503 (gnutls_emacs_global_deinit): ifdef out; not used.
21504 (Fgnutls_boot): Use const for pointer to readonly storage.
21505 Comment out unused local. Fix pointer signedness problems.
21506
21507 * lread.c (openp): Don't stuff size_t into an 'int'.
21508 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21509 about possible signed overflow.
21510
21511 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21512 (GDK_KEY_g): Don't define if already defined.
21513 (xg_prepare_tooltip): Avoid pointer signedness problem.
21514 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21515
21516 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21517 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21518
21519 * xfns.c (Fx_window_property): Simplify a bit,
21520 to make a bit faster and to avoid GCC 4.6.0 warning.
21521 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21522
21523 * fns.c (internal_equal): Don't assume size_t fits in int.
21524
21525 * alloc.c (compact_small_strings): Tighten assertion a little.
21526
21527 Replace pEd with more-general pI, and fix some printf arg casts.
21528 * lisp.h (pI): New macro, generalizing old pEd macro to other
21529 conversion specifiers. For example, use "...%"pI"d..." rather
21530 than "...%"pEd"...".
21531 (pEd): Remove. All uses replaced with similar uses of pI.
21532 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21533 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21534 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21535 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21536 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21537 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21538 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21539 64-bit hosts.
21540 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21541 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21542 * print.c (safe_debug_print, print_object): Likewise.
21543 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21544 to int.
21545 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21546 avoiding the 0 flag, which is not portable.
21547 * process.c (Fmake_network_process): Use pI to avoid cast.
21548 * region-cache.c (pp_cache): Likewise.
21549 * xdisp.c (decode_mode_spec): Likewise.
21550 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21551 behavior on 64-bit hosts with printf arg.
21552 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21553 (x_stop_queuing_selection_requests): Likewise.
21554 (x_get_window_property): Don't truncate byte count to an 'int'
21555 when tracing.
21556
21557 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21558 here, since it parses constructs like leading '-' and spaces,
21559 which are not wanted; and it overflows with large numbers.
21560 Instead, simply match F[0-9]+, which is what is wanted anyway.
21561
21562 * alloc.c: Remove unportable assumptions about struct layout.
21563 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21564 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21565 (allocate_vectorlike, make_pure_vector): Use the new macros,
21566 plus offsetof, to remove unportable assumptions about struct layout.
21567 These assumptions hold on all porting targets that I know of, but
21568 they are not guaranteed, they're easy to remove, and removing them
21569 makes further changes easier.
21570
21571 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21572 This doesn't fix a bug but makes the code clearer.
21573 (string_overrun_cookie): Now const. Use initializers that
21574 don't formally overflow signed char, to avoid warnings.
21575 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21576 can cause Emacs to crash when string overrun checking is enabled.
21577 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21578 multiple of sizeof (EMACS_INT); it need not be, if
21579 alignof(EMACS_INT) < sizeof (EMACS_INT).
21580 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21581
21582 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21583
21584 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21585
21586 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21587
21588 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21589 supposed to be handshaking. (Bug#8556)
21590 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21591
21592 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
21593
21594 * lisp.h (Qdebug): List symbol.
21595 * eval.c (Qdebug): Restore global linkage.
21596 * keyboard.c (debug-on-event): New variable.
21597 (handle_user_signal): Break into debugger when debug-on-event
21598 matches the current signal symbol.
21599
21600 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21601
21602 * alloc.c (check_sblock, check_string_bytes)
21603 (check_string_free_list): Convert to standard C.
21604
21605 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21606
21607 * w32.c (emacs_gnutls_push): Fix typo.
21608
21609 2011-04-25 Eli Zaretskii <eliz@gnu.org>
21610
21611 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21612 "cast to pointer from integer of different size".
21613
21614 Improve doprnt and its use in verror. (Bug#8545)
21615 * doprnt.c (doprnt): Document the set of format control sequences
21616 supported by the function. Use SAFE_ALLOCA instead of always
21617 using `alloca'.
21618
21619 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21620 is one byte too soon. Don't use xrealloc; instead xfree and
21621 xmalloc anew.
21622
21623 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21624
21625 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21626 callbacks stage.
21627
21628 * gnutls.c: Renamed global_initialized to
21629 gnutls_global_initialized. Added internals for the
21630 :verify-hostname-error, :verify-error, and :verify-flags
21631 parameters of `gnutls-boot' and documented those parameters in the
21632 docstring. Start callback support.
21633 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21634 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21635 on error. Return error code.
21636 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21637 (emacs_gnutls_read): Likewise.
21638 (Fgnutls_boot): Return handshake error code.
21639 (emacs_gnutls_handle_error): New function.
21640 (wsaerror_to_errno): Likewise.
21641
21642 * w32.h (emacs_gnutls_pull): Add prototype.
21643 (emacs_gnutls_push): Likewise.
21644
21645 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21646 (emacs_gnutls_push): Likewise.
21647
21648 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21649
21650 * process.c (wait_reading_process_output): Check if GnuTLS
21651 buffered some data internally if no FDs are set for TLS
21652 connections.
21653
21654 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21655 (LIBS): Link to USER_LIBS.
21656 ($(BLD)/gnutls.$(0)): New target.
21657
21658 2011-04-24 Eli Zaretskii <eliz@gnu.org>
21659
21660 * xdisp.c (handle_single_display_spec): Rename the
21661 display_replaced_before_p argument into display_replaced_p, to
21662 make it consistent with the commentary. Fix typos in the
21663 commentary.
21664
21665 * textprop.c (syms_of_textprop): Remove dead code.
21666 (copy_text_properties): Delete obsolete commentary about an
21667 interface that was deleted long ago. Fix typos in the description
21668 of arguments.
21669
21670 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21671 to changes in oldXMenu/XMenu.h from 2011-04-16.
21672 <menu_help_message, prev_menu_help_message>: Constify.
21673 (IT_menu_make_room): menu->help_text is now `const char **';
21674 adjust.
21675
21676 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21677 to changes in oldXMenu/XMenu.h from 2011-04-16.
21678 (struct XMenu): Declare `help_text' `const char **'.
21679
21680 * xfaces.c <Qunspecified>: Make extern again.
21681
21682 * syntax.c: Include sys/types.h before including regex.h, as
21683 required by POSIX.
21684
21685 * doc.c (get_doc_string): Improve the format passed to `error'.
21686
21687 * doprnt.c (doprnt): Improve commentary.
21688
21689 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21690
21691 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21692 them with etags.
21693
21694 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21695 changes in globals.h immediately force recompilation.
21696 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21697 $(CURDIR)/s/ms-w32.h.
21698 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
21699
21700 * character.c (Fchar_direction): Function deleted.
21701 (syms_of_character): Don't defsubr it.
21702 <char-direction-table>: Deleted.
21703
21704 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21705
21706 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21707 * doprnt.c: Include limits.h.
21708 (SIZE_MAX): New macro.
21709 (doprnt): Return a size_t value. 2nd arg is now size_t.
21710 Many local variables are now size_t instead of int or unsigned.
21711 Improve overflow protection. Support `l' modifier for integer
21712 conversions. Support %l conversion. Don't assume an EMACS_INT
21713 argument for integer conversions and for %c.
21714
21715 * lisp.h (doprnt): Restore prototype.
21716
21717 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21718 $(SRC)/character.h.
21719
21720 * Makefile.in (base_obj): Add back doprnt.o.
21721
21722 * deps.mk (doprnt.o): Add back prerequisites.
21723 (callint.o): Depend on character.h.
21724
21725 * eval.c (internal_lisp_condition_case): Include the handler
21726 representation in the error message.
21727 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21728 when breaking from the loop.
21729
21730 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21731
21732 * callint.c (Fcall_interactively): When displaying error message
21733 about invalid control letter, pass the character's codepoint, not
21734 a pointer to its multibyte form. Improve display of the character
21735 in octal and display also its hex code.
21736
21737 * character.c (char_string): Use %x to display the (unsigned)
21738 codepoint of an invalid character, to avoid displaying a bogus
21739 negative value.
21740
21741 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21742 `error', not SYMBOL_NAME itself.
21743
21744 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21745 character arguments to `error'.
21746
21747 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21748 to `error' in error message about FINAL_CHAR argument. Make sure
21749 FINAL_CHAR is a character, and use %c when it is passed as
21750 argument to `error'.
21751
21752 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21753
21754 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21755
21756 * w32.c: Include <time.h>.
21757 (sys_localtime): New function.
21758
21759 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
21760
21761 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21762
21763 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
21764
21765 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
21766
21767 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21768 zombies (Bug#8467).
21769
21770 2011-04-19 Eli Zaretskii <eliz@gnu.org>
21771
21772 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21773 gl_state.e_property when gl_state.object is Qt.
21774
21775 * insdel.c (make_gap_larger): Remove limitation of buffer size
21776 to <= INT_MAX.
21777
21778 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
21779
21780 * xdisp.c (lookup_glyphless_char_display)
21781 (produce_glyphless_glyph): Handle cons cell entry in
21782 glyphless-char-display.
21783 (Vglyphless_char_display): Document it.
21784
21785 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21786 glyphless-char-display.
21787
21788 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
21789
21790 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21791
21792 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21793
21794 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21795 definition for no-X builds.
21796
21797 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
21798
21799 Static checks with GCC 4.6.0 and non-default toolkits.
21800
21801 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21802
21803 * process.c (keyboard_bit_set): Define only if SIGIO.
21804 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21805 (send_process): Repair possible setjmp clobbering.
21806
21807 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21808
21809 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21810
21811 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21812
21813 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21814 Define only if needed.
21815
21816 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21817 by pacifying GCC about it. Maybe it's time to retire it?
21818 * xfaces.c (USG, __TIMEVAL__): Likewise.
21819
21820 * dispextern.h (struct redisplay_interface): Rename param
21821 to avoid shadowing.
21822 * termhooks.h (struct terminal): Likewise.
21823 * xterm.c (xembed_send_message): Likewise.
21824
21825 * insdel.c (make_gap_smaller): Define only if
21826 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21827
21828 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21829 it.
21830
21831 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21832 so that we aren't warned about unused symbols.
21833
21834 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21835
21836 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
21837
21838 * xfns.c (x_real_positions): Mark locals as initialized.
21839
21840 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21841
21842 * xterm.c: Fix problems found by static analysis with other toolkits.
21843 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
21844 (x_dispatch_event): Declare static if USE_GTK, and
21845 define if USE_GTK || USE_X_TOOLKIT.
21846 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
21847 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
21848 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21849 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
21850
21851 * xmenu.c (menu_help_callback): Pointer type fixes.
21852 Use const pointers when pointing at readonly data. Avoid pointer
21853 signedness clashes.
21854 (FALSE): Remove unused macro.
21855 (update_frame_menubar): Remove unused decl.
21856
21857 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21858
21859 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21860 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21861 (single_menu_item): Rename local to avoid shadowing.
21862
21863 * keyboard.c (make_lispy_event): Remove unused local var.
21864
21865 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21866 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21867
21868 * bitmaps: Change bitmaps from unsigned char back to the X11
21869 compatible char. Avoid the old compiler warnings about
21870 out-of-range initializers by using, for example, '\xab' rather
21871 than 0xab.
21872
21873 * xgselect.c (xgselect_initialize): Check vs interface
21874 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21875
21876 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21877
21878 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21879 to read-only memory.
21880
21881 * fns.c (vector): Remove; this old hack is no longer needed.
21882
21883 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
21884 Remove unused var.
21885 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
21886
21887 * xrdb.c (x_load_resources): Omit unused local.
21888
21889 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
21890 (x_window): Rename locals to avoid shadowing.
21891 (USG): Use the kludged USG macro, to pacify gcc.
21892
21893 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
21894 (x_term_init): Remove local to avoid shadowing.
21895
21896 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
21897
21898 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21899 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21900
21901 2011-04-16 Eli Zaretskii <eliz@gnu.org>
21902
21903 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21904
21905 Fix regex.c, syntax.c and friends for buffers > 2GB.
21906 * syntax.h (struct gl_state_s): Declare character position members
21907 EMACS_INT.
21908
21909 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21910
21911 * textprop.c (verify_interval_modification, interval_of):
21912 Declare arguments EMACS_INT.
21913
21914 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21915 EMACS_INT.
21916
21917 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21918
21919 * indent.c (Fvertical_motion): Local variable it_start is now
21920 EMACS_INT.
21921
21922 * regex.c (re_match, re_match_2, re_match_2_internal)
21923 (bcmp_translate, regcomp, regexec, print_double_string)
21924 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21925 (re_compile_pattern, re_exec): Declare arguments and local
21926 variables `size_t' and `ssize_t' and return values `regoff_t', as
21927 appropriate.
21928 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21929 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21930 <compile_stack_type>: `size' and `avail' are now `size_t'.
21931
21932 * regex.h <regoff_t>: Use ssize_t, not int.
21933 (re_search, re_search_2, re_match, re_match_2): Arguments that
21934 specify buffer/string position and length are now ssize_t and
21935 size_t. Return type is regoff_t.
21936
21937 2011-04-16 Ben Key <bkey76@gmail.com>
21938
21939 * nsfont.m: Fixed bugs in ns_get_family and
21940 ns_descriptor_to_entity that were caused by using free to
21941 deallocate memory blocks that were allocated by xmalloc (via
21942 xstrdup). This caused Emacs to crash when compiled with
21943 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21944 --enable-checking=xmallocoverrun). xfree is now used to
21945 deallocate these memory blocks.
21946
21947 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
21948
21949 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21950
21951 emacs_write: Accept and return EMACS_INT for sizes.
21952 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21953 et seq.
21954 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21955 Accept and return EMACS_INT.
21956 (emacs_gnutls_write): Return the number of bytes written on
21957 partial writes.
21958 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
21959 (emacs_read, emacs_write): Remove check for negative size, as the
21960 Emacs source code has been audited now.
21961 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21962 (emacs_read, emacs_write): Use it.
21963 * process.c (send_process): Adjust to the new signatures of
21964 emacs_write and emacs_gnutls_write. Do not attempt to store
21965 a byte offset into an 'int'; it might overflow.
21966 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
21967
21968 * sound.c: Don't assume sizes fit in 'int'.
21969 (struct sound_device.period_size, alsa_period_size):
21970 Return EMACS_INT, not int.
21971 (struct sound_device.write, vox_write, alsa_write):
21972 Accept EMACS_INT, not int.
21973 (wav_play, au_play): Use EMACS_INT to store sizes and to
21974 record read return values.
21975
21976 2011-04-15 Ben Key <bkey76@gmail.com>
21977
21978 * keyboard.c (Qundefined): Don't declare static since it is used
21979 in nsfns.m.
21980 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21981 static since they are used in nsfont.m.
21982
21983 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21984
21985 * process.c (Qprocessp): Don't declare static.
21986 * lisp.h (Qprocessp): Declare again.
21987
21988 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
21989
21990 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21991
21992 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21993
21994 Improve C-level modularity by making more things 'static'.
21995
21996 Don't publish debugger-only interfaces to other modules.
21997 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21998 (verify_bytepos, count_markers): Move decls to the only modules
21999 that need them.
22000 * region-cache.h (pp_cache): Likewise.
22001 * window.h (check_all_windows): Likewise.
22002 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
22003
22004 * sysdep.c (croak): Now static, if
22005 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
22006 * syssignal.h (croak): Declare only if not static.
22007
22008 * alloc.c (refill_memory_reserve): Now static if
22009 !defined REL_ALLOC || defined SYSTEM_MALLOC.
22010 * lisp.h (refill_memory_reserve): Declare only if not static.
22011
22012 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
22013 Define only if USE_LUCID.
22014
22015 * xrdb.c (x_customization_string, x_rm_string): Now static.
22016
22017 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
22018 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
22019
22020 * xdisp.c (draw_row_with_mouse_face): Now static.
22021 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
22022
22023 * window.h (check_all_windows): Mark externally visible.
22024
22025 * window.c (window_deletion_count): Now static.
22026
22027 * undo.c: Make symbols static if they're not exported.
22028 (last_undo_buffer, last_boundary_position, pending_boundary):
22029 Now static.
22030
22031 * textprop.c (interval_insert_behind_hooks): Now static.
22032 (interval_insert_in_front_hooks): Likewise.
22033
22034 * term.c: Make symbols static if they're not exported.
22035 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
22036 (max_frame_lines, tty_set_terminal_modes):
22037 (tty_reset_terminal_modes, tty_turn_off_highlight):
22038 (get_tty_terminal): Now static.
22039 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22040 * termhooks.h (term_mouse_moveto): Do not declare if
22041 HAVE_WINDOW_SYSTEM.
22042 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22043 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22044
22045 * sysdep.c: Make symbols static if they're not exported.
22046 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22047 Now static.
22048 (sigprocmask_set, full_mask): Remove; unused.
22049 (wait_debugging): Mark as visible.
22050 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22051 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22052
22053 * syntax.c (syntax_temp): Define only if !__GNUC__.
22054
22055 * sound.c (current_sound_device, current_sound): Now static.
22056
22057 * search.c (searchbufs, searchbuf_head): Now static.
22058
22059 * scroll.c (scroll_cost): Remove; unused.
22060 * dispextern.h (scroll_cost): Remove decl.
22061
22062 * region-cache.h (pp_cache): Mark as externally visible.
22063
22064 * process.c: Make symbols static if they're not exported.
22065 (process_tick, update_tick, create_process, chan_process):
22066 (Vprocess_alist, proc_buffered_char, datagram_access):
22067 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22068 (deactivate_process): Mark defn as static, as well as decl.
22069 * lisp.h (create_process): Remove decl.
22070 * process.h (chan_process, Vprocess_alist): Remove decls.
22071
22072 * print.c: Make symbols static if they're not exported.
22073 (print_depth, new_backquote_output, being_printed, print_buffer):
22074 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22075 (print_interval, print_number_index, initial_stderr_stream):
22076 Now static.
22077 * lisp.h (Fprinc): Remove decl.
22078 (debug_output_compilation_hack): Mark as externally visible.
22079
22080 * sysdep.c (croak): Move decl from here to syssignal.h.
22081 * syssignal.h (croak): Put it here, so the API can be checked when
22082 'croak' is called from dissociate_if_controlling_tty.
22083
22084 * minibuf.c: Make symbols static if they're not exported.
22085 (minibuf_save_list, choose_minibuf_frame): Now static.
22086 * lisp.h (choose_minibuf_frame): Remove decl.
22087
22088 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22089
22090 * lread.c: Make symbols static if they're not exported.
22091 (read_objects, initial_obarray, oblookup_last_bucket_number):
22092 Now static.
22093 (make_symbol): Remove; unused.
22094 * lisp.h (initial_obarray, make_symbol): Remove decls.
22095
22096 * keyboard.c: Make symbols static if they're not exported.
22097 (single_kboard, recent_keys_index, total_keys, recent_keys):
22098 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22099 (this_single_command_key_start, echoing, last_auto_save):
22100 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22101 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22102 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22103 (Vlispy_mouse_stem, double_click_count):
22104 Now static.
22105 (force_auto_save_soon): Define only if SIGDANGER.
22106 (ignore_mouse_drag_p): Now static if
22107 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22108 (print_help): Remove; unused.
22109 (stop_character, last_timer_event): Mark as externally visible.
22110 * keyboard.h (ignore_mouse_drag_p): Declare only if
22111 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22112 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22113 * lisp.h (echoing): Remove decl.
22114 (force_auto_save_soon): Declare only if SIGDANGER.
22115 * xdisp.c (redisplay_window): Simplify code, to make it more
22116 obvious that ignore_mouse_drag_p is not accessed if !defined
22117 USE_GTK && !defined HAVE_NS.
22118
22119 * intervals.c: Make symbols static if they're not exported.
22120 (merge_properties_sticky, merge_interval_right, delete_interval):
22121 Now static.
22122 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22123
22124 * insdel.c: Make symbols static if they're not exported.
22125 However, leave prepare_to_modify_buffer alone. It's never
22126 called from outside this function, but that appears to be a bug.
22127 (combine_after_change_list, combine_after_change_buffer):
22128 (adjust_after_replace, signal_before_change): Now static.
22129 (adjust_after_replace_noundo): Remove; unused.
22130 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22131 (signal_before_change): Remove decls.
22132
22133 * indent.c (val_compute_motion, val_vmotion): Now static.
22134
22135 * image.c: Make symbols static if they're not exported.
22136 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22137 if USE_GTK.
22138 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22139 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22140
22141 * fringe.c (standard_bitmaps): Now static.
22142 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22143
22144 * frame.c: Make symbols static if they're not exported.
22145 (x_report_frame_params, make_terminal_frame): Now static.
22146 (get_frame_param): Now static, unless HAVE_NS.
22147 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22148 (x_get_resource_string): Remove; not used.
22149 * frame.h (make_terminal_frame, x_report_frame_params):
22150 (x_get_resource_string); Remove decls.
22151 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22152 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22153
22154 * font.c, fontset.c: Make symbols static if they're not exported.
22155 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22156 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22157 * font.c (font_close_object): Now static.
22158 * font.h (font_close_object): Remove.
22159 * fontset.c (FONTSET_OBJLIST): Remove.
22160 (free_realized_fontset) #if-0 the body, which does nothing.
22161 (face_suitable_for_char_p): #if-0, as it's never called.
22162 * fontset.h (face_suitable_for_char_p): Remove decl.
22163 * xfaces.c (face_at_string_position):
22164 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22165 since 0 is always ASCII.
22166
22167 * fns.c (weak_hash_tables): Now static.
22168
22169 * fileio.c: Make symbols static if they're not exported.
22170 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22171 (Vwrite_region_annotation_buffers): Now static.
22172
22173 * eval.c: Make symbols static if they're not exported.
22174 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22175 * lisp.h (backtrace_list): Remove decl.
22176
22177 * emacs.c: Make symbols static if they're not exported.
22178 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22179 (fatal_error_code, fatal_error_signal_hook, standard_args):
22180 Now static.
22181 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22182 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22183 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22184 * lisp.h (fatal_error_signal_hook): Remove decl.
22185 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22186
22187 * editfns.c: Move a (normally-unused) function to its only use.
22188 * editfns.c, lisp.h (get_operating_system_release): Remove.
22189 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22190 worth the hassle of breaking this out.
22191
22192 * xterm.c: Make symbols static if they're not exported.
22193 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22194 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22195 (x_destroy_window, x_delete_display):
22196 Now static.
22197 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22198 (x_mouse_leave): Remove; unused.
22199 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22200 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22201 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22202 Remove decls.
22203 (x_mouse_leave): Declare only if WINDOWSNT.
22204 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22205 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22206 USE_X_TOOLKIT.
22207
22208 * ftxfont.c: Make symbols static if they're not exported.
22209 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22210 HAVE_FREETYPE.
22211 * font.h (ftxfont_driver): Likewise.
22212
22213 * xfns.c: Make symbols static if they're not exported.
22214 (x_last_font_name, x_display_info_for_name):
22215 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22216 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22217 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22218 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22219 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22220 (last_show_tip_args): Now static.
22221 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22222 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22223 (x_screen_planes): Remove; unused.
22224 * dispextern.h (x_screen_planes): Remove decl.
22225
22226 * dispnew.c: Make symbols static if they're not exported.
22227 * dispextern.h (redraw_garbaged_frames, scrolling):
22228 (increment_row_positions): Remove.
22229 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22230 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22231 Now static.
22232 (redraw_garbaged_frames): Remove; unused.
22233
22234 * xfaces.c: Make symbols static if they're not exported.
22235 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22236 Remove decls.
22237 * xterm.h (defined_color): Remove decls.
22238 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22239 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22240 (menu_face_changed_default, defined_color, free_realized_face):
22241 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22242 (ascii_face_of_lisp_face): Remove; unused.
22243
22244 * xdisp.c: Make symbols static if they're not exported.
22245 * dispextern.h (scratch_glyph_row, window_box_edges):
22246 (glyph_to_pixel_coords, set_cursor_from_row):
22247 (get_next_display_element, set_iterator_to_next):
22248 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22249 (show_mouse_face): Remove decls
22250 * frame.h (message_buf_print): Likewise.
22251 * lisp.h (pop_message, set_message, check_point_in_composition):
22252 Likewise.
22253 * xterm.h (set_vertical_scroll_bar): Likewise.
22254 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22255 (message_buf_print, scratch_glyph_row, displayed_buffer):
22256 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22257 (get_next_display_element, show_mouse_face, window_box_edges):
22258 (frame_to_window_pixel_xy, check_point_in_composition):
22259 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22260 (glyph_to_pixel_coords): Remove; unused.
22261
22262 * dired.c (file_name_completion): Now static.
22263
22264 * dbusbind.c (xd_in_read_queued_messages): Now static.
22265
22266 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22267 * data.c (circular_list_error): Remove.
22268
22269 * commands.h (last_point_position, last_point_position_buffer):
22270 (last_point_position_window): Remove decls.
22271 * keyboard.c: Make these variables static.
22272
22273 * coding.h (coding, code_convert_region, encode_coding_gap):
22274 Remove decls.
22275 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22276 (iso_code_class, detect_coding, code_convert_region): Now static.
22277 (encode_coding_gap): Remove; unused.
22278
22279 * chartab.c (chartab_chars, chartab_bits): Now static.
22280
22281 * charset.h (charset_iso_8859_1): Remove decl.
22282 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22283 Now static.
22284
22285 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22286 * ccl.c (Vccl_program_table): Now static.
22287 (check_ccl_update): Remove; unused.
22288
22289 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22290 * category.h: ... from here.
22291 * category.c (check_category_table, set_category_set): Now static.
22292
22293 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22294 * lisp.h: Remove these decls.
22295
22296 * buffer.c (buffer_count): Remove unused var.
22297
22298 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22299 so that it's not optimized away.
22300 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22301 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22302 exported only to the debugger.
22303
22304 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22305 * atimer.h (run_all_atimers): Remove; not exported.
22306
22307 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22308 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22309 was inaccessible from Lisp.
22310 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22311 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22312
22313 alloc.c: Import and export fewer symbols, and remove unused items.
22314 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22315 is defined.
22316 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22317 it's not optimized away by whole-program optimization.
22318 (message_enable_multibyte, free_misc): Remove.
22319 (catchlist, handlerlist, mark_backtrace):
22320 Declare only if BYTE_MARK_STACK.
22321 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22322 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22323 (message_enable_multibyte): Remove decl.
22324 (free_misc, interval_free_list, float_block, float_block_index):
22325 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22326 (cons_free_list, last_marked_index):
22327 Now static.
22328 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22329 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22330 (mark_backtrace): Define only if BYTE_MARK_STACK.
22331 * xdisp.c (message_enable_multibyte): Now static.
22332
22333 Declare Lisp_Object Q* variables to be 'static' if not exported.
22334 This makes it easier for human readers (and static analyzers)
22335 to see whether these variables are used from other modules.
22336 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22337 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22338 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22339 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22340 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22341 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22342 * xmenu.c, xselect.c:
22343 Declare Q* vars static if they are not used in other modules.
22344 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22345 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22346 Remove decls of unexported vars.
22347 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22348
22349 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22350
22351 Make Emacs functions such as Fatom 'static' by default.
22352 This makes it easier for human readers (and static analyzers)
22353 to see whether these functions can be called from other modules.
22354 DEFUN now defines a static function. To make the function external
22355 so that it can be used in other C modules, use the new macro DEFUE.
22356 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22357 (Finit_image_library):
22358 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22359 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22360 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22361 Remove decls, since these functions are now static.
22362 (Funintern, Fget_internal_run_time): New decls, since these functions
22363 were already external.
22364
22365 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22366 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22367 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22368 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22369 * keyboard.c, keymap.c, lread.c:
22370 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22371 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22372 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22373 Mark functions with DEFUE instead of DEFUN,
22374 if they are used in other modules.
22375 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22376 decls for now-static functions.
22377 * buffer.h (Fdelete_overlay): Remove decl.
22378 * callproc.c (Fgetenv_internal): Mark as internal.
22379 * composite.c (Fremove_list_of_text_properties): Remove decl.
22380 (Fcomposition_get_gstring): New forward static decl.
22381 * composite.h (Fcomposite_get_gstring): Remove decl.
22382 * dired.c (Ffile_attributes): New forward static decl.
22383 * doc.c (Fdocumntation_property): New forward static decl.
22384 * eval.c (Ffetch_bytecode): New forward static decl.
22385 (Funintern): Remove extern decl; now in .h file where it belongs.
22386 * fileio.c (Fmake_symbolic_link): New forward static decl.
22387 * image.c (Finit_image_library): New forward static decl.
22388 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22389 * intervals.h (Fprevious_property_change):
22390 (Fremove_list_of_text_properties): Remove decls.
22391 * keyboard.c (Fthis_command_keys): Remove decl.
22392 (Fcommand_execute): New forward static decl.
22393 * keymap.c (Flookup_key): New forward static decl.
22394 (Fcopy_keymap): Now static.
22395 * keymap.h (Flookup_key): Remove decl.
22396 * process.c (Fget_process): New forward static decl.
22397 (Fprocess_datagram_address): Mark as internal.
22398 * syntax.c (Fsyntax_table_p): New forward static decl.
22399 (skip_chars): Remove duplicate decl.
22400 * textprop.c (Fprevious_property_change): New forward static decl.
22401 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22402 Now internal.
22403 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22404 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22405
22406 * editfns.c (Fformat): Remove unreachable code.
22407
22408 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22409
22410 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22411 change. (Bug#8496)
22412
22413 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22414
22415 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22416 when at ZV. (Bug#8487)
22417
22418 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22419
22420 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22421 (Bug#8437)
22422 * keyboard.c (parse_tool_bar_item): Likewise.
22423 * sound.c (sound_cleanup, alsa_close): Likewise.
22424 * termcap.c (tgetent): Likewise.
22425 * xfns.c (x_default_font_parameter): Likewise.
22426 * xsettings.c (read_and_apply_settings): Likewise.
22427
22428 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22429 (overrun_check_free): Protoize.
22430
22431 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22432
22433 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22434 since callers should never pass a negative size.
22435 Change the signature to match that of plain 'read' and 'write'; see
22436 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22437 * lisp.h: Update prototypes of emacs_write and emacs_read.
22438
22439 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22440
22441 * xdisp.c (redisplay_window): Don't try to determine the character
22442 position of the scroll margin if the window start point w->startp
22443 is outside the buffer's accessible region. (Bug#8468)
22444
22445 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22446
22447 Fix write-region and its subroutines for buffers > 2GB.
22448 * fileio.c (a_write, e_write): Modify declaration of arguments and
22449 local variables to support buffers larger than 2GB.
22450 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22451
22452 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22453 argument, local variables, and return value.
22454
22455 * lisp.h: Update prototypes of emacs_write and emacs_read.
22456
22457 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22458
22459 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22460
22461 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22462
22463 Fix more problems found by GCC 4.6.0's static checks.
22464
22465 * xdisp.c (vmessage): Use a better test for character truncation.
22466
22467 * charset.c (load_charset_map): <, not <=, for optimization,
22468 and to avoid potential problems with integer overflow.
22469 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22470 * casetab.c (set_identity, shuffle): Likewise.
22471 * editfns.c (Fformat): Likewise.
22472 * syntax.c (skip_chars): Likewise.
22473
22474 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22475 This also lets GCC 4.6.0 generate slightly better loop code.
22476
22477 * callint.c (Fcall_interactively): <, not <=, for optimization.
22478 (Fcall_interactively): Count the number of arguments produced,
22479 not the number of arguments given. This is simpler and lets GCC
22480 4.6.0 generate slightly better code.
22481
22482 * ftfont.c: Distingish more carefully between FcChar8 and char.
22483 The previous code passed unsigned char * to a functions like
22484 strlen and xstrcasecmp that expect char *, which does not
22485 conform to the C standard.
22486 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22487 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22488 char * when the C standard requires it.
22489
22490 * keyboard.c (read_char): Remove unused var.
22491
22492 * eval.c: Port to Windows vsnprintf (Bug#8435).
22493 Include <limits.h>.
22494 (SIZE_MAX): Define if the headers do not.
22495 (verror): Do not give up if vsnprintf returns a negative count.
22496 Instead, grow the buffer. This ports to Windows vsnprintf, which
22497 does not conform to C99. Problem reported by Eli Zaretskii.
22498 Also, simplify the allocation scheme, by avoiding the need for
22499 calling realloc, and removing the ALLOCATED variable.
22500
22501 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22502
22503 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22504 But keep the doprint source code for now, as we might revamp it
22505 and use it again (Bug#8435).
22506 * lisp.h (doprnt): Remove.
22507 * Makefile.in (base_obj): Remove doprnt.o.
22508 * deps.mk (doprnt.o): Remove.
22509
22510 error: Print 32- and 64-bit integers portably (Bug#8435).
22511 Without this change, on typical 64-bit hosts error ("...%d...", N)
22512 was used to print both 32- and 64-bit integers N, which relied on
22513 undefined behavior.
22514 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22515 * lisp.h (error, verror): Mark as printf-like functions.
22516 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22517 Report overflow in size calculations when allocating printf buffer.
22518 Do not truncate output string at its first null byte.
22519 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22520 Truncate the output at a character boundary, since vsnprintf does not
22521 do that.
22522 * charset.c (check_iso_charset_parameter): Convert internal
22523 character to string before calling 'error', since %c now has the
22524 printf meaning.
22525 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22526 overflow when computing char to be passed to 'error'. Do not
22527 pass Lisp_Object to 'error'; pass the integer instead.
22528 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22529 formatted with plain %d.
22530
22531 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22532
22533 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22534
22535 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22536
22537 * xterm.c (x_catch_errors): Remove duplicate declaration.
22538
22539 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22540
22541 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22542
22543 2011-04-10 Jim Meyering <meyering@redhat.com>
22544
22545 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22546 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22547 return ssize_t not "int", and use size_t as the buffer length.
22548 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22549 * gnutls.h: Update declarations.
22550 * process.c (read_process_output): Use ssize_t, to match.
22551 (send_process): Likewise.
22552
22553 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22554
22555 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22556
22557 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22558
22559 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22560 Use unsigned char, to match FcChar8 type definition.
22561
22562 * xterm.c (handle_one_xevent):
22563 * xmenu.c (create_and_show_popup_menu):
22564 * xselect.c (x_decline_selection_request)
22565 (x_reply_selection_request): Avoid type-punned deref of X events.
22566
22567 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22568
22569 Fix some uses of `int' instead of EMACS_INT.
22570 * search.c (string_match_1, fast_string_match)
22571 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22572 (scan_buffer, find_next_newline_no_quit)
22573 (find_before_next_newline, search_command, Freplace_match)
22574 (Fmatch_data): Make some `int' variables be EMACS_INT.
22575
22576 * xdisp.c (display_count_lines): 3rd argument and return value now
22577 EMACS_INT. All callers changed.
22578 (pint2hrstr): Last argument is now EMACS_INT.
22579
22580 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22581 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22582 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22583 (decode_coding_utf_16, decode_coding_emacs_mule)
22584 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22585 (decode_coding_ccl, decode_coding_charset)
22586 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22587 (decode_coding_iso_2022, decode_coding_emacs_mule)
22588 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22589 <char_offset, last_offset>: Declare EMACS_INT.
22590 (encode_coding_utf_8, encode_coding_utf_16)
22591 (encode_coding_emacs_mule, encode_invocation_designation)
22592 (encode_designation_at_bol, encode_coding_iso_2022)
22593 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22594 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22595 Declare EMACS_INT.
22596 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22597 (encode_invocation_designation): Last argument P_NCHARS is now
22598 EMACS_INT.
22599 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22600 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22601
22602 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22603 All users changed.
22604
22605 * ccl.c (Fccl_execute_on_string): Declare some variables
22606 EMACS_INT.
22607
22608 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
22609
22610 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22611
22612 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22613
22614 * process.c (Fformat_network_address): Doc fix.
22615
22616 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22617
22618 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
22619
22620 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
22621
22622 * keyboard.c (read_char): Call Lisp function help-form-show,
22623 instead of using internal_with_output_to_temp_buffer.
22624 (Qhelp_form_show): New var.
22625 (syms_of_keyboard): Use DEFSYM macro.
22626
22627 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22628
22629 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22630
22631 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
22632
22633 * process.c (Flist_processes): Remove to Lisp.
22634 (list_processes_1): Delete.
22635
22636 2011-04-06 Eli Zaretskii <eliz@gnu.org>
22637
22638 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22639
22640 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22641
22642 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
22643
22644 Fix more problems found by GCC 4.6.0's static checks.
22645
22646 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22647
22648 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22649
22650 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
22651
22652 * xdisp.c (vmessage): Mark as a printf-like function.
22653
22654 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22655
22656 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22657
22658 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22659 printf-like functions.
22660 (tiff_load): Add casts to remove these marks before passing them
22661 to system-supplied API.
22662
22663 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22664
22665 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22666 This avoids several warnings with gcc -Wstrict-overflow.
22667 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22668 directly, rather than having caller test rule sign. This avoids
22669 some unnecessary tests.
22670 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22671 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22672 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
22673
22674 * xfont.c (xfont_text_extents): Remove var that was set but not used.
22675 (xfont_open): Avoid unnecessary tests.
22676
22677 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22678
22679 * composite.h, composite.c (composition_gstring_put_cache):
22680 Use EMACS_INT, not int, for length.
22681
22682 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22683 breaking out part of COMPOSITION_DECODE_RULE.
22684 (COMPOSITION_DECODE_RULE): Use it.
22685 * composite.c (get_composition_id): Remove unused local vars,
22686 by using the new macro.
22687
22688 * textprop.c (set_text_properties_1): Change while to do-while,
22689 since the condition is always true at first.
22690
22691 * intervals.c (graft_intervals_into_buffer): Mark var as used.
22692 (interval_deletion_adjustment): Return unsigned value.
22693 All uses changed.
22694
22695 * process.c (list_processes_1, create_pty, read_process_output):
22696 (exec_sentinel): Remove vars that were set but not used.
22697 (create_pty): Remove unnecessary "volatile"s.
22698 (Fnetwork_interface_info): Avoid possibility of int overflow.
22699 (read_process_output): Do adaptive read buffering even if carryover.
22700 (read_process_output): Simplify nbytes computation if buffered.
22701
22702 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22703
22704 * syntax.c (scan_words): Remove var that was set but not used.
22705 (update_syntax_table): Use unsigned instead of int.
22706
22707 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
22708 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
22709 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
22710
22711 * print.c (print_error_message): Avoid int overflow.
22712
22713 * font.c (font_list_entities): Redo for clarity,
22714 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22715
22716 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
22717 (font_score): Avoid potential overflow in diff calculation.
22718
22719 * fns.c (substring_both): Remove var that is set but not used.
22720 (sxhash): Redo loop for clarity and to avoid wraparound warning.
22721
22722 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22723
22724 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22725 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22726 can always succeed if overflow has undefined behavior.
22727
22728 * search.c (boyer_moore, wordify): Remove vars set but not used.
22729 (wordify): Omit three unnecessary tests.
22730
22731 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22732 All callers changed. This avoids the need for an unused var.
22733
22734 * casefiddle.c (casify_region): Remove var that is set but not used.
22735
22736 * dired.c (file_name_completion): Remove var that is set but not used.
22737
22738 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22739
22740 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
22741 (Finsert_file_contents): Remove unnecessary code checking fd.
22742
22743 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22744 Check for integer overflow on size calculations.
22745
22746 * buffer.c (Fprevious_overlay_change): Remove var that is set
22747 but not used.
22748
22749 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22750 Remove vars that are set but not used.
22751 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
22752 (timer_check_2): Mark vars as initialized.
22753
22754 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22755
22756 * image.c (lookup_image): Remove var that is set but not used.
22757 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
22758
22759 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22760 that are set but not used.
22761
22762 * xfns.c (make_invisible_cursor): Don't return garbage
22763 if XCreateBitmapFromData fails (Bug#8410).
22764
22765 * xselect.c (x_get_local_selection, x_handle_property_notify):
22766 Remove vars that are set but not used.
22767
22768 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
22769 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
22770
22771 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22772 Remove var that is set but not used.
22773 (scroll_bar_windows_size): Now size_t, not int.
22774 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22775 Check for overflow.
22776
22777 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22778 (map_tty_color) [!defined MSDOS]: Likewise.
22779
22780 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22781
22782 * coding.c: Remove vars that are set but not used.
22783 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22784 All callers changed.
22785 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22786 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22787 (decode_coding_charset): Remove vars that are set but not used.
22788
22789 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22790 that is set but not used.
22791
22792 * print.c (print_object): Remove var that is set but not used.
22793
22794 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
22795 The gnulib version avoids calling malloc in the usual case,
22796 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22797 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22798 * filelock.c (current_lock_owner): Likewise.
22799 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22800 * sysdep.c: Include allocator.h, careadlinkat.h.
22801 (emacs_no_realloc_allocator): New static constant.
22802 (emacs_readlink): New function.
22803 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22804 ../lib/careadlinkat.h.
22805
22806 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22807
22808 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22809 first non-nil return value).
22810
22811 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22812
22813 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22814 if not defined (Bug#8403).
22815
22816 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22817
22818 * xdisp.c (display_count_lines): Remove parameter `start',
22819 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22820 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22821 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22822 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22823 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22824 and thereabouts. All callers changed.
22825 (get_per_char_metric): Remove parameter `f', unused since
22826 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22827
22828 2011-04-02 Jim Meyering <meyering@redhat.com>
22829
22830 do not dereference NULL upon failed strdup
22831 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22832 (ns_get_family): Likewise.
22833
22834 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22835
22836 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22837
22838 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22839
22840 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22841 later (Bug#8403).
22842
22843 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22844
22845 Add lexical binding.
22846
22847 * window.c (Ftemp_output_buffer_show): New fun.
22848 (Fsave_window_excursion):
22849 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22850
22851 * lread.c (lisp_file_lexically_bound_p): New function.
22852 (Fload): Bind Qlexical_binding.
22853 (readevalloop): Remove `evalfun' arg.
22854 Bind Qinternal_interpreter_environment.
22855 (Feval_buffer): Bind Qlexical_binding.
22856 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22857 Mark as dynamic.
22858 (syms_of_lread): Declare `lexical-binding'.
22859
22860 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22861
22862 * keyboard.c (eval_dyn): New fun.
22863 (menu_item_eval_property): Use it.
22864
22865 * image.c (parse_image_spec): Use Ffunctionp.
22866
22867 * fns.c (concat, mapcar1): Accept byte-code-functions.
22868
22869 * eval.c (Fsetq): Handle lexical vars.
22870 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22871 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22872 (FletX, Flet): Obey lexical binding.
22873 (Fcommandp): Handle closures.
22874 (Feval): New `lexical' arg.
22875 (eval_sub): New function extracted from Feval. Use it almost
22876 everywhere where Feval was used. Look up vars in lexical env.
22877 Handle closures.
22878 (Ffunctionp): Move from subr.el.
22879 (Ffuncall): Handle closures.
22880 (apply_lambda): Remove `eval_flags'.
22881 (funcall_lambda): Handle closures and new byte-code-functions.
22882 (Fspecial_variable_p): New function.
22883 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22884 but without exporting it to Lisp.
22885
22886 * doc.c (Fdocumentation, store_function_docstring):
22887 * data.c (Finteractive_form): Handle closures.
22888
22889 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22890 interactive spec.
22891
22892 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22893 New byte-codes.
22894 (exec_byte_code): New function extracted from Fbyte_code to handle new
22895 calling convention for byte-code-functions. Add new byte-codes.
22896
22897 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
22898
22899 * alloc.c (Fmake_symbol): Init new `declared_special' field.
22900
22901 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22902
22903 * xdisp.c (redisplay_internal): Fix prototype.
22904
22905 2011-03-31 Eli Zaretskii <eliz@gnu.org>
22906
22907 * xdisp.c (SCROLL_LIMIT): New macro.
22908 (try_scrolling): Use it when setting scroll_limit.
22909 Limit scrolling to 100 screen lines.
22910 (redisplay_window): Even when falling back on "recentering",
22911 position point in the window according to scroll-conservatively,
22912 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22913
22914 (try_scrolling): When point is above the window, allow searching
22915 as far as scroll_max, or one screenful, to compute vertical
22916 distance from PT to the scroll margin position. This prevents
22917 try_scrolling from unnecessarily failing when
22918 scroll-conservatively is set to a value slightly larger than the
22919 window height. Clean up the case of PT below the margin at bottom
22920 of window: scroll_max can no longer be INT_MAX. When aggressive
22921 scrolling is in use, don't let point enter the opposite scroll
22922 margin as result of the scroll.
22923 (syms_of_xdisp) <scroll-conservatively>: Document the
22924 threshold of 100 lines for never-recentering scrolling.
22925
22926 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22927
22928 * dispextern.h (move_it_by_lines):
22929 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22930 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22931 (message_log_check_duplicate): Remove parameters `prev_bol' and
22932 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22933 (redisplay_internal): Remove parameter `preserve_echo_area',
22934 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22935
22936 * indent.c (Fvertical_motion):
22937 * window.c (window_scroll_pixel_based, Frecenter):
22938 Don't pass `need_y_p' to `move_it_by_lines'.
22939
22940 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22941
22942 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22943 steal a few bits to be more compact.
22944 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22945 Remove unneeded casts.
22946
22947 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22948
22949 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22950
22951 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22952 binding" message (bug#7967).
22953
22954 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22955
22956 Fix more problems found by GCC 4.6.0's static checks.
22957
22958 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22959 Remove unused local var.
22960
22961 * editfns.c (Fmessage_box): Remove unused local var.
22962
22963 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22964 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22965 Omit unused local vars.
22966 * window.c (shrink_windows): Omit unused local var.
22967 * menu.c (digest_single_submenu): Omit unused local var.
22968 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22969 Omit unused local var.
22970
22971 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22972 Don't assume string length fits in int.
22973 (keyremap_step, read_key_sequence): Use size_t for sizes.
22974 (read_key_sequence): Don't check last_real_key_start redundantly.
22975
22976 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22977 instead of alloca (Bug#8344).
22978
22979 * eval.c (Fbacktrace): Don't assume nargs fits in int.
22980 (Fbacktrace_frame): Don't assume nframes fits in int.
22981
22982 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22983
22984 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22985 concerns.
22986
22987 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22988
22989 * cm.c (calccost): Turn while-do into do-while, for clarity.
22990
22991 * keyboard.c (syms_of_keyboard): Use the same style as later
22992 in this function when indexing through an array. This also
22993 works around GCC bug 48267.
22994
22995 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22996
22997 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22998
22999 * chartab.c (sub_char_table_ref_and_range): Redo for slight
23000 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
23001
23002 * keyboard.c, keyboard.h (num_input_events): Now size_t.
23003 This avoids undefined behavior on integer overflow, and is a bit
23004 more convenient anyway since it is compared to a size_t variable.
23005
23006 Variadic C functions now count arguments with size_t, not int.
23007 This avoids an unnecessary limitation on 64-bit machines, which
23008 caused (substring ...) to crash on large vectors (Bug#8344).
23009 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
23010 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
23011 All variadic functions and their callers changed accordingly.
23012 (struct gcpro.nvars): Now size_t, not int. All uses changed.
23013 * data.c (arith_driver, float_arith_driver): Likewise.
23014 * editfns.c (general_insert_function): Likewise.
23015 * eval.c (struct backtrace.nargs, interactive_p)
23016 (internal_condition_case_n, run_hook_with_args, apply_lambda)
23017 (funcall_lambda, mark_backtrace): Likewise.
23018 * fns.c (concat): Likewise.
23019 * frame.c (x_set_frame_parameters): Likewise.
23020 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
23021 0 if not found, not -1. All callers changed.
23022
23023 * alloc.c (garbage_collect): Don't assume stack size fits in int.
23024 (stack_copy_size): Now size_t, not int.
23025 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
23026
23027 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23028
23029 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
23030 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23031 All callers changed.
23032
23033 * lisp.h (multibyte_char_to_unibyte):
23034 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
23035 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23036 * character.h (CHAR_TO_BYTE8):
23037 * cmds.c (internal_self_insert):
23038 * editfns.c (general_insert_function):
23039 * keymap.c (push_key_description):
23040 * search.c (Freplace_match):
23041 * xdisp.c (message_dolog, set_message_1): All callers changed.
23042
23043 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23044
23045 * keyboard.c (safe_run_hook_funcall): New function.
23046 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23047 don't set the hook to nil, but remove the offending function instead.
23048 (Qcommand_hook_internal): Remove, unused.
23049 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23050 Vcommand_hook_internal.
23051
23052 * eval.c (enum run_hooks_condition): Remove.
23053 (funcall_nil, funcall_not): New functions.
23054 (run_hook_with_args): Call each function through a `funcall' argument.
23055 Remove `cond' argument, now redundant.
23056 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23057 (Frun_hook_with_args_until_failure): Adjust accordingly.
23058 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23059
23060 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23061
23062 * dispextern.h (string_buffer_position): Remove declaration.
23063
23064 * print.c (strout): Remove parameter `multibyte', unused since
23065 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23066
23067 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23068 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23069 All callers changed.
23070
23071 * w32.c (_wsa_errlist): Use braces for struct initializers.
23072
23073 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23074 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23075 All callers changed.
23076 (string_buffer_position): Likewise. Also, make static (it's never
23077 used outside xdisp.c).
23078 (cursor_row_p): Remove parameter `w', unused since
23079 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23080 (decode_mode_spec): Remove parameter `precision', introduced during
23081 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23082 All callers changed.
23083
23084 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23085
23086 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23087
23088 2011-03-27 Anders Lindgren <andlind@gmail.com>
23089
23090 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23091 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23092 (ns_update_auto_hide_menu_bar): New functions.
23093 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23094 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23095 ns_constrain_all_frames.
23096 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23097 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23098
23099 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23100
23101 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23102
23103 2011-03-27 Glenn Morris <rgm@gnu.org>
23104
23105 * syssignal.h: Replace RETSIGTYPE with void.
23106 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23107 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23108 Replace SIGTYPE with void everywhere.
23109 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23110 * s/template.h (SIGTYPE): Remove commented out definition.
23111
23112 2011-03-26 Eli Zaretskii <eliz@gnu.org>
23113
23114 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23115 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23116
23117 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
23118
23119 * w32.c (read_unc_volume): Use parameter `henum', instead of
23120 global variable `wget_enum_handle'.
23121
23122 * keymap.c (describe_vector): Remove parameters `indices' and
23123 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23124 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23125
23126 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23127
23128 * keyboard.c (timer_check): Remove parameter `do_it_now',
23129 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23130 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23131 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23132
23133 * keyboard.c (read_char):
23134 * w32menu.c (w32_menu_display_help):
23135 * xmenu.c (show_help_event, menu_help_callback):
23136 Adjust calls to `show_help_echo'.
23137
23138 * gtkutil.c (xg_maybe_add_timer):
23139 * keyboard.c (readable_events):
23140 * process.c (wait_reading_process_output):
23141 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23142
23143 * insdel.c (adjust_markers_gap_motion):
23144 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23145 (gap_left, gap_right): Don't call it.
23146
23147 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
23148
23149 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23150 incurred during fontification.
23151
23152 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23153
23154 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23155 (DEFVAR_PER_BUFFER): Don't pass it.
23156
23157 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23158 (scrolling_window): Don't pass it.
23159
23160 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23161
23162 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23163
23164 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23165 and `suffix'.
23166 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23167 of variables specific to SELinux and computation of `encoded_absname'.
23168
23169 * image.c (XPutPixel): Remove unused variable `height'.
23170
23171 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23172
23173 * unexw32.c (get_section_info): Remove unused variable `section'.
23174
23175 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23176 (system_process_attributes): Remove unused variable `sess'.
23177 (sys_read): Remove unused variable `err'.
23178
23179 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23180 (w32_wnd_proc): Remove unused variable `isdead'.
23181 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23182 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23183 (x_create_tip_frame): Remove unused variable `tem'.
23184
23185 * w32inevt.c (w32_console_read_socket):
23186 Remove unused variable `no_events'.
23187
23188 * w32term.c (x_draw_composite_glyph_string_foreground):
23189 Remove unused variable `width'.
23190
23191 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
23192
23193 * w32term.c (x_set_glyph_string_clipping):
23194 Don't pass uninitialized region to CombineRgn.
23195
23196 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
23197
23198 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23199 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23200 (Fx_close_connection): Remove unused variable `i'.
23201
23202 * w32font.c (w32font_draw): Return number of glyphs.
23203 (w32font_open_internal): Remove unused variable `i'.
23204 (w32font_driver): Add missing initializer.
23205
23206 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23207 (fill_in_menu): Remove unused variable `items_added'.
23208
23209 * w32term.c (last_mouse_press_frame): Remove static global variable.
23210 (w32_clip_to_row): Remove unused variable `f'.
23211 (x_delete_terminal): Remove unused variable `i'.
23212
23213 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23214 (NOTHING): Remove unused static global variable.
23215 (uniscribe_check_otf): Remove unused variable `table'.
23216 (uniscribe_font_driver): Add missing initializers.
23217
23218 2011-03-23 Julien Danjou <julien@danjou.info>
23219
23220 * term.c (Fsuspend_tty, Fresume_tty):
23221 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23222 * window.c (temp_output_buffer_show):
23223 * insdel.c (signal_before_change):
23224 * frame.c (Fhandle_switch_frame):
23225 * fileio.c (Fdo_auto_save):
23226 * emacs.c (Fkill_emacs):
23227 * editfns.c (save_excursion_restore):
23228 * cmds.c (internal_self_insert):
23229 * callint.c (Fcall_interactively):
23230 * buffer.c (Fkill_all_local_variables):
23231 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23232 Use Frun_hooks.
23233 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23234 unconditionally since it does the check itself.
23235
23236 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23237
23238 Fix more problems found by GCC 4.5.2's static checks.
23239
23240 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23241 the first time through the loop, since we know p0 < p1 then.
23242 This also avoids a gcc -Wstrict-overflow warning.
23243
23244 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23245 leading to a memory leak, possible in functions like
23246 load_charset_map_from_file that can allocate an unbounded number
23247 of objects (Bug#8318).
23248
23249 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23250 that could (at least in theory) be that large.
23251
23252 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23253 This is less likely to overflow, and avoids undefined behavior if
23254 overflow does occur. All callers changed. Use strtoul to scan
23255 for the unsigned long integer.
23256 (pint2hrstr): Simplify and tune code slightly.
23257 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23258
23259 * scroll.c (do_scrolling): Work around GCC bug 48228.
23260 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23261
23262 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23263 This also avoids a warning with gcc -Wstrict-overflow.
23264 (validate_x_resource_name): Simplify count usage.
23265 This also avoids a warning with gcc -Wstrict-overflow.
23266
23267 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23268 fail (Bug#8306).
23269
23270 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23271
23272 * process.c (Fmake_network_process): Use socklen_t, not int,
23273 where POSIX says socklen_t is required in portable programs.
23274 This fixes a porting bug on hosts like 64-bit HP-UX, where
23275 socklen_t is wider than int (Bug#8277).
23276 (Fmake_network_process, server_accept_connection):
23277 (wait_reading_process_output, read_process_output):
23278 Likewise.
23279
23280 * process.c: Rename or move locals to avoid shadowing.
23281 (list_processes_1, Fmake_network_process):
23282 (read_process_output_error_handler, exec_sentinel_error_handler):
23283 Rename or move locals.
23284 (Fmake_network_process): Define label "retry_connect" only if needed.
23285 (Fnetwork_interface_info): Fix pointer signedness.
23286 (process_send_signal): Add cast to avoid pointer signedness problem.
23287 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23288 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23289
23290 Make tparam.h and terminfo.c consistent.
23291 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23292 Include tparam.h instead, since it declares them.
23293 * cm.h (PC): Remove extern decl; tparam.h now does this.
23294 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23295 * terminfo.c: Include tparam.h, to check interfaces.
23296 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23297 (tparam): Adjust signature to match interface in tparam.h;
23298 this removes some undefined behavior. Check that outstring and len
23299 are zero, which they always are with Emacs.
23300 * tparam.h (PC, BC, UP): New extern decls.
23301
23302 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23303 (xftfont_open): Rename locals to avoid shadowing.
23304
23305 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23306 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23307 (OTF_TAG_SYM): Omit macro if not needed.
23308 (ftfont_list): Remove unused local.
23309 (get_adstyle_property, ftfont_pattern_entity):
23310 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23311 Rename locals to avoid shadowing.
23312
23313 * xfont.c (xfont_list_family): Mark var as initialized.
23314
23315 * xml.c (make_dom): Now static.
23316
23317 * composite.c (composition_compute_stop_pos): Rename local to
23318 avoid shadowing.
23319 (composition_reseat_it): Remove unused locals.
23320 (find_automatic_composition, composition_adjust_point): Likewise.
23321 (composition_update_it): Mark var as initialized.
23322 (find_automatic_composition): Mark vars as initialized,
23323 with a FIXME (Bug#8290).
23324
23325 character.h: Rename locals to avoid shadowing.
23326 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23327 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23328 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23329 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23330 to avoid shadowing.
23331
23332 * textprop.c (property_change_between_p): Remove; unused.
23333
23334 * intervals.c (interval_start_pos): Now static.
23335
23336 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23337
23338 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23339 Rename locals to avoid shadowing.
23340
23341 * sound.c (wav_play, au_play, Fplay_sound_internal):
23342 Fix pointer signedness.
23343 (alsa_choose_format): Remove unused local var.
23344 (wav_play): Initialize a variable to 0, to prevent undefined
23345 behavior (Bug#8278).
23346
23347 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23348
23349 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23350
23351 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23352 clobbering (Bug#8298).
23353 * sysdep.c (sys_subshell): Likewise.
23354 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23355
23356 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23357 This should get cleaned up, so that child_setup has the
23358 same signature on all platforms.
23359
23360 * callproc.c (call_process_cleanup): Now static.
23361 (relocate_fd): Rename locals to avoid shadowing.
23362
23363 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23364
23365 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23366 not to be necessary, and produces flickering.
23367
23368 2011-03-20 Glenn Morris <rgm@gnu.org>
23369
23370 * config.in: Remove file.
23371
23372 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23373
23374 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23375 are now in src/globals.h.
23376 (syms_of_minibuf): Remove spurious & from previous change.
23377
23378 2011-03-20 Leo Liu <sdl.web@gmail.com>
23379
23380 * minibuf.c (completing-read-function): New variable.
23381 (completing-read-default): Rename from completing-read.
23382 (completing-read): Call completing-read-function.
23383
23384 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23385
23386 * xfaces.c (Fx_load_color_file):
23387 Read color file from absolute filename (bug#8250).
23388
23389 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23390
23391 * makefile.w32-in: Update dependencies.
23392
23393 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23394
23395 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23396
23397 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23398
23399 Fix more problems found by GCC 4.5.2's static checks.
23400
23401 * process.c (make_serial_process_unwind, send_process_trap):
23402 (sigchld_handler): Now static.
23403
23404 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23405 That way, the code declares only the vars that it needs.
23406 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23407 * s/cygwin.h (PTY_ITERATION): Likewise.
23408 * s/darwin.h (PTY_ITERATION): Likewise.
23409 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23410
23411 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23412 * process.c (allocate_pty): Don't declare stb unless it's needed.
23413
23414 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23415 (CONSTANTLIM): Remove; unused.
23416 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23417 Define only if needed.
23418
23419 * unexelf.c (unexec): Name an expression,
23420 to avoid gcc -Wbad-function-cast warning.
23421 Use a different way to cause a compilation error if anyone uses
23422 n rather than nn, a way that does not involve shadowing.
23423 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23424
23425 * deps.mk (unexalpha.o): Remove; unused.
23426
23427 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23428 * unexec.h: New file.
23429 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23430 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23431 Depend on unexec.h.
23432 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23433 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23434 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23435 Change as necessary to match prototype in unexec.h.
23436
23437 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23438 shadowing.
23439 (back_comment, skip_chars): Mark vars as initialized.
23440
23441 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23442 Rename locals to avoid shadowing.
23443
23444 * lread.c (read1): Rewrite so as not to use empty "else".
23445 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23446
23447 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23448
23449 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23450 warning when compiling print.c.
23451
23452 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23453 instead of using an uninitialized var.
23454 (font_sort_entities): Mark var as initialized.
23455
23456 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23457
23458 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23459 pointers to constants.
23460 (font_parse_fcname): Remove unused vars.
23461 (font_delete_unmatched): Now static.
23462 (font_get_spec): Remove; unused.
23463 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23464 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23465 Rename or move locals to avoid shadowing.
23466
23467 * fns.c (require_nesting_list, require_unwind): Now static.
23468 (Ffillarray): Rename locals to avoid shadowing.
23469
23470 * floatfns.c (domain_error2): Define only if needed.
23471 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23472
23473 * alloc.c (mark_backtrace): Move decl from here ...
23474 * lisp.h: ... to here, so that it can be checked.
23475
23476 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23477 (Fdefvar): Rewrite so as not to use empty "else".
23478 (lisp_indirect_variable): Name an expression,
23479 to avoid gcc -Wbad-function-cast warning.
23480 (Fdefvar): Rename locals to avoid shadowing.
23481
23482 * callint.c (quotify_arg, quotify_args): Now static.
23483 (Fcall_interactively): Rename locals to avoid shadowing.
23484 Use const pointer when appropriate.
23485
23486 * lisp.h (get_system_name, get_operating_system_release):
23487 Move decls here, to check interfaces.
23488 * process.c (get_operating_system_release): Move decl to lisp.h.
23489 * xrdb.c (get_system_name): Likewise.
23490 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23491 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23492 some of which prompt warnings from gcc -Wbad-function-cast.
23493 (Fformat_time_string, Fencode_time, Finsert_char):
23494 (Ftranslate_region_internal, Fformat):
23495 Rename or remove local vars to avoid shadowing.
23496 (Ftranslate_region_internal): Mark var as initialized.
23497
23498 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23499 avoid shadowing.
23500
23501 * lisp.h (eassert): Check that the argument compiles, even if
23502 ENABLE_CHECKING is not defined.
23503
23504 * data.c (Findirect_variable): Name an expression, to avoid
23505 gcc -Wbad-function-cast warning.
23506 (default_value, arithcompare, arith_driver, arith_error): Now static.
23507 (store_symval_forwarding): Rename local to avoid shadowing.
23508 (Fmake_variable_buffer_local, Fmake_local_variable):
23509 Mark variables as initialized.
23510 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23511
23512 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23513 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23514 Rename locals to avoid shadowing.
23515 (mark_stack): Move local variables into the #ifdef region where
23516 they're used.
23517 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23518 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23519 needed otherwise.
23520 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23521 (GC_STRING_CHARS): Remove; not used.
23522 (Fmemory_limit): Cast sbrk's returned value to char *.
23523
23524 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23525 avoids undefined behavior in theory.
23526
23527 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23528
23529 Use functions, not macros, for up- and down-casing (Bug#8254).
23530 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23531 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23532 to use the following functions instead of these macros.
23533 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23534 EMACS_INT, since callers assume the returned value fits in int.
23535 (upcase1): Likewise, for UPCASE_TABLE.
23536 (uppercasep, lowercasep, upcase): New static inline functions.
23537 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23538 the race-condition problem in the old DOWNCASE.
23539
23540 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23541 Rename locals to avoid shadowing.
23542 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23543 (regex_compile, re_search_2, re_match_2_internal):
23544 Remove unused local vars.
23545 (FREE_VAR): Rewrite so as not to use empty "else",
23546 which gcc can warn about.
23547 (regex_compile, re_match_2_internal): Mark locals as initialized.
23548 (RETALLOC_IF): Define only if needed.
23549 (WORDCHAR_P): Likewise. This one is never needed, but is used
23550 only in a comment talking about a compiler bug, so put inside
23551 the #if 0 of that comment.
23552 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23553 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23554 Remove; unused.
23555
23556 * search.c (boyer_moore): Rename locals to avoid shadowing.
23557 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23558 (PREV_CHAR_BOUNDARY): Likewise.
23559
23560 * search.c (simple_search): Remove unused var.
23561
23562 * dired.c (compile_pattern): Move decl from here ...
23563 * lisp.h: ... to here, so that it can be checked.
23564 (struct re_registers): New forward decl.
23565
23566 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23567
23568 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23569 All uses changed.
23570 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23571 Rename locals to avoid shadowing.
23572 (Fvertical_motion): Mark locals as initialized.
23573
23574 * casefiddle.c (casify_object, casify_region): Now static.
23575 (casify_region): Mark local as initialized.
23576
23577 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23578
23579 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23580 New macros, so that the caller can use some names other than
23581 gcpro1, gcpro2, etc.
23582 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23583 of the new macros.
23584 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23585 argument, for consistency with GCPRO2_VAR, etc: it is now the
23586 prefix of the variable, not the variable itself. All uses
23587 changed.
23588 * dired.c (directory_files_internal, file_name_completion):
23589 Rename locals to avoid shadowing.
23590
23591 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23592 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23593 dired.c's scmp function, had undefined behavior.
23594 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23595 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23596 * buffer.h: ... to here, because these macros use current_buffer,
23597 and the new implementation with inline functions needs to have
23598 current_buffer in scope now, rather than later when the macros
23599 are used.
23600 (downcase, upcase1): New static inline functions.
23601 (DOWNCASE, UPCASE1): Reimplement using these functions.
23602 This avoids undefined behavior in expressions like
23603 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23604 from race conditions in accessing the global variables
23605 case_temp1 and case_temp2.
23606 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23607 * lisp.h (case_temp1, case_temp2): Remove their decls.
23608 * character.h (ASCII_CHAR_P): Move from here ...
23609 * lisp.h: ... to here, so that the inline functions mentioned
23610 above can use them.
23611
23612 * dired.c (directory_files_internal_unwind): Now static.
23613
23614 * fileio.c (file_name_as_directory, directory_file_name):
23615 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23616 Now static.
23617 (file_name_as_directory): Use const pointers when appropriate.
23618 (Fexpand_file_name): Likewise. In particular, newdir might
23619 point at constant storage, so make it a const pointer.
23620 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
23621 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23622 signedness issues.
23623 (Fset_file_times, Finsert_file_contents, auto_save_error):
23624 Rename locals to avoid shadowing.
23625
23626 * minibuf.c (choose_minibuf_frame_1): Now static.
23627 (Ftry_completion, Fall_completions): Rename or remove locals
23628 to avoid shadowing.
23629
23630 * marker.c (bytepos_to_charpos): Remove; unused.
23631
23632 * lisp.h (verify_bytepos, count_markers): New decls,
23633 so that gcc does not warn that these functions aren't declared.
23634
23635 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23636 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
23637 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
23638 (copy_text): Remove unused local var.
23639
23640 * filelock.c (within_one_second): Now static.
23641 (lock_file_1): Rename local to avoid shadowing.
23642
23643 * buffer.c (fix_overlays_before): Mark locals as initialized.
23644 (fix_start_end_in_overlays): Likewise. This function should be
23645 simplified by using pointers-to-pointers, but that's a different
23646 matter.
23647 (switch_to_buffer_1): Now static.
23648 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23649 (report_overlay_modification): Rename locals to avoid shadowing.
23650
23651 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
23652 Fix pointer signedness issue.
23653 (sys_subshell): Mark local as volatile if checking for lint,
23654 to suppress a gcc -Wclobbered warning that does not seem to be right.
23655 (MAXPATHLEN): Define only if needed.
23656
23657 * process.c (serial_open, serial_configure): Move decls from here ...
23658 * systty.h: ... to here, so that they can be checked.
23659
23660 * fns.c (get_random, seed_random): Move extern decls from here ...
23661 * lisp.h: ... to here, so that they can be checked.
23662
23663 * sysdep.c (reset_io): Now static.
23664 (wait_for_termination_signal): Remove; unused.
23665
23666 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23667 (copy_keymap_item, append_key, push_text_char_description):
23668 Now static.
23669 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
23670 (DENSE_TABLE_SIZE): Remove; unused.
23671 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23672 (describe_map_tree):
23673 Rename locals to avoid shadowing.
23674
23675 * keyboard.c: Declare functions static if they are not used elsewhere.
23676 (echo_char, echo_dash, cmd_error, top_level_2):
23677 (poll_for_input, handle_async_input): Now static.
23678 (read_char, kbd_buffer_get_event, make_lispy_position):
23679 (make_lispy_event, make_lispy_movement, apply_modifiers):
23680 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23681 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23682 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
23683 (read_key_sequence, read_char): Mark locals as initialized.
23684 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
23685
23686 * keyboard.h (make_ctrl_char): New decl.
23687 (mark_kboards): Move decl here ...
23688 * alloc.c (mark_kboards): ... from here.
23689
23690 * lisp.h (force_auto_save_soon): New decl.
23691
23692 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
23693 (DEFINE_DUMMY_FUNCTION): New macro.
23694 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23695 Use it.
23696 (main): Add casts to avoid warnings
23697 if GCC considers string literals to be constants.
23698
23699 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23700
23701 * dbusbind.c: Pointer signedness fixes.
23702 (xd_signature, xd_append_arg, xd_initialize):
23703 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23704 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23705 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23706 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23707
23708 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23709 if GCC considers string literals to be constants.
23710 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
23711
23712 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23713
23714 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23715 (print_preprocess, print_object): New macro to fix last change.
23716
23717 * print.c (print_preprocess): Don't forget font objects.
23718
23719 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
23720
23721 * emacs.c (USAGE3): Doc fixes.
23722
23723 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23724
23725 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23726 structure.
23727
23728 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
23729
23730 * lisp.h (VWindow_system, Qfile_name_history):
23731 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23732 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23733 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23734
23735 * w32select.c: Don't #include "keyboard.h".
23736 (run_protected): Add extern declaration for waiting_for_input.
23737
23738 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23739 * w32console.c (detect_input_pending, read_input_pending)
23740 (encode_terminal_code):
23741 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23742 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23743 (w32_system_caret_y, Qfile_name_history):
23744 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23745 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23746 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23747 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23748 * w32proc.c (Qlocal, report_file_error):
23749 * w32term.c (Vwindow_system, updating_frame):
23750 * w32uniscribe.c (initialized, uniscribe_font_driver):
23751 Remove unneeded extern declarations.
23752
23753 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
23754
23755 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
23756
23757 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
23758
23759 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23760 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23761 These macros can no longer be used for assignment.
23762
23763 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23764 Assign struct members directly, instead of using BUF_BEGV etc.
23765 (record_buffer_markers, fetch_buffer_markers): New functions for
23766 recording and fetching special buffer markers.
23767 (set_buffer_internal_1, set_buffer_temp): Use them.
23768
23769 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23770
23771 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23772
23773 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23774 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23775
23776 * xdisp.c (hscroll_window_tree):
23777 (reconsider_clip_changes): Use PT instead of BUF_PT.
23778
23779 2011-03-13 Eli Zaretskii <eliz@gnu.org>
23780
23781 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23782 $(EMACS_ROOT)/lib/intprops.h.
23783
23784 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23785
23786 Fix more problems found by GCC 4.5.2's static checks.
23787
23788 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23789 to unsigned char * to avoid compiler diagnostic.
23790 (xg_free_frame_widgets): Make it clear that a local variable is
23791 needed only if USE_GTK_TOOLTIP.
23792 (gdk_window_get_screen): Make it clear that this macro is needed
23793 only if USE_GTK_TOOLTIP.
23794 (int_gtk_range_get_value): New function, which avoids a diagnostic
23795 from gcc -Wbad-function-cast.
23796 (xg_set_toolkit_scroll_bar_thumb): Use it.
23797 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23798 diagnostic from gcc -Wbad-function-cast.
23799 (get_utf8_string, xg_get_file_with_chooser):
23800 Rename locals to avoid shadowing.
23801 (create_dialog): Move locals to avoid shadowing.
23802
23803 * xgselect.c (xg_select): Remove unused var.
23804
23805 * image.c (four_corners_best): Mark locals as initialized.
23806 (gif_load): Initialize transparent_p to zero (Bug#8238).
23807 Mark another local as initialized.
23808 (my_png_error, my_error_exit): Mark with NO_RETURN.
23809
23810 * image.c (clear_image_cache): Now static.
23811 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
23812 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
23813 (x_edge_detection): Remove unnecessary cast that
23814 gcc -Wbad-function-cast diagnoses.
23815 (gif_load): Fix pointer signedness.
23816 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23817 (jpeg_load, gif_load): Rename locals to avoid shadowing.
23818
23819 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
23820
23821 Improve quality of tests for time stamp overflow.
23822 For example, without this patch (encode-time 0 0 0 1 1
23823 1152921504606846976) returns the obviously-bogus value (-948597
23824 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23825 reports time overflow. See
23826 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
23827 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23828 * editfns.c: Include limits.h and intprops.h.
23829 (TIME_T_MIN, TIME_T_MAX): New macros.
23830 (time_overflow): Move earlier, to before first use.
23831 (hi_time, lo_time): New functions, for an accurate test for
23832 out-of-range times.
23833 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23834 (Fget_internal_run_time): Don't assume time_t fits in int.
23835 (make_time): Use list2 instead of Fcons twice.
23836 (Fdecode_time): More accurate test for out-of-range times.
23837 (check_tm_member): New function.
23838 (Fencode_time): Use it, to test for out-of-range times.
23839 (lisp_time_argument): Don't rely on undefined left-shift and
23840 right-shift behavior when checking for time stamp overflow.
23841
23842 * editfns.c (time_overflow): New function, refactoring common code.
23843 (Fformat_time_string, Fdecode_time, Fencode_time):
23844 (Fcurrent_time_string): Use it.
23845
23846 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23847 * dired.c (make_time): Move to ...
23848 * editfns.c (make_time): ... here.
23849 * systime.h: Note the move.
23850
23851 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23852
23853 * fringe.c (update_window_fringes): Remove unused variables.
23854
23855 * unexmacosx.c (copy_data_segment): Also copy __got section.
23856 (Bug#8223)
23857
23858 2011-03-12 Eli Zaretskii <eliz@gnu.org>
23859
23860 * termcap.c [MSDOS]: Include "msdos.h".
23861 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23862 Constify `char *' arguments and their references according to
23863 prototypes in tparam.h.
23864
23865 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
23866
23867 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23868 Adapt all references accordingly.
23869
23870 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23871
23872 2011-03-11 Tom Tromey <tromey@redhat.com>
23873
23874 * buffer.c (syms_of_buffer): Remove obsolete comment.
23875
23876 2011-03-11 Eli Zaretskii <eliz@gnu.org>
23877
23878 * termhooks.h (encode_terminal_code): Declare prototype.
23879
23880 * msdos.c (encode_terminal_code): Don't declare prototype.
23881
23882 * term.c (encode_terminal_code): Now external again, used by
23883 w32console.c and msdos.c.
23884
23885 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23886 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
23887
23888 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
23889
23890 Fix some minor problems found by GCC 4.5.2's static checks.
23891
23892 * fringe.c (update_window_fringes): Mark locals as initialized
23893 (Bug#8227).
23894 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
23895
23896 * alloc.c (mark_fringe_data): Move decl from here ...
23897 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23898 to check its interface.
23899 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23900
23901 * fontset.c (free_realized_fontset): Now static.
23902 (Fset_fontset_font): Rename local to avoid shadowing.
23903 (fontset_font): Mark local as initialized.
23904 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
23905
23906 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23907
23908 * xselect.c (x_disown_buffer_selections): Remove; not used.
23909 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
23910 (x_own_selection, Fx_disown_selection_internal): Rename locals
23911 to avoid shadowing.
23912 (x_handle_dnd_message): Remove local to avoid shadowing.
23913
23914 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23915 so that the caller can use some name other than gcpro1.
23916 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
23917 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23918 (Fx_backspace_delete_keys_p):
23919 Use them to avoid shadowing, and rename vars to avoid shadowing.
23920 (x_decode_color, x_set_name, x_window): Now static.
23921 (Fx_create_frame): Add braces to silence GCC warning.
23922 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
23923 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23924 Remove unused locals.
23925 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23926 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23927 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23928 macros.
23929
23930 * xterm.h (x_mouse_leave): New decl.
23931
23932 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23933 Remove unused functions.
23934 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23935 (x_calc_absolute_position): Now static.
23936 (XTread_socket): Don't define label "out" unless it's used.
23937 Don't declare local "event" unless it's used.
23938 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23939 unless they are used.
23940 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23941 (x_fatal_error_signal): Remove; not used.
23942 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23943 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23944 (x_error_catcher, x_connection_closed, x_error_handler):
23945 (x_error_quitter, xembed_send_message, x_iconify_frame):
23946 (my_log_handler): Rename locals to avoid shadowing.
23947 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
23948 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
23949
23950 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23951 Rename or move locals to avoid shadowing.
23952 (tty_defined_color, merge_face_heights): Now static.
23953 (free_realized_faces_for_fontset): Remove; not used.
23954 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23955 does not deduce is never used uninitialized.
23956 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23957 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
23958
23959 * terminal.c (store_terminal_param): Now static.
23960
23961 * xmenu.c (menu_highlight_callback): Now static.
23962 (set_frame_menubar): Remove unused local.
23963 (xmenu_show): Rename parameter to avoid shadowing.
23964 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23965 since they might point to immutable storage.
23966 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23967 since it's unused otherwise.
23968
23969 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
23970 Add a FIXME, since the code still doesn't look right. (Bug#8215)
23971 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23972 avoids a gcc -Wuninitialized diagnostic.
23973 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
23974 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23975 does not deduce are never used uninitialized.
23976
23977 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23978
23979 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
23980 * window.c (window_loop, size_window):
23981 (run_window_configuration_change_hook, enlarge_window): Likewise.
23982
23983 * window.c (display_buffer): Now static.
23984 (size_window): Mark variables that gcc -Wuninitialized
23985 does not deduce are never used uninitialized.
23986 * window.h (check_all_windows): New decl, to forestall
23987 gcc -Wmissing-prototypes diagnostic.
23988 * dispextern.h (bidi_dump_cached_states): Likewise.
23989
23990 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23991 shadowing.
23992 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
23993 Include <limits.h>.
23994 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23995 and to avoid gcc -Wuninitialized warning.
23996 (load_charset_map): Mark variables that gcc -Wuninitialized
23997 does not deduce are never used uninitialized.
23998 (load_charset): Abort instead of using uninitialized var (Bug#8229).
23999
24000 * coding.c (coding_set_source, coding_set_destination):
24001 Use "else { /* comment */ }" rather than "else /* comment */;"
24002 for clarity, and to avoid gcc -Wempty-body warning.
24003 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
24004 a block, when the outer 'i' will do.
24005 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
24006 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
24007 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
24008 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
24009 (Fdecode_sjis_char, Fdefine_coding_system_internal):
24010 Rename locals to avoid shadowing.
24011 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
24012 * coding.c (emacs_mule_char, encode_invocation_designation):
24013 Now static, since they're not used elsewhere.
24014 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
24015 (decode_coding_object, encode_coding_object, detect_coding_system):
24016 (decode_coding_emacs_mule): Mark variables that gcc
24017 -Wuninitialized does not deduce are never used uninitialized.
24018 (detect_coding_iso_2022): Initialize a local variable that might
24019 be used uninitialized. Leave a FIXME because it's not clear that
24020 this initialization is needed. (Bug#8211)
24021 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
24022 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
24023 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
24024 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
24025 Remove unused macros.
24026
24027 * category.c (hash_get_category_set): Remove unused local var.
24028 (copy_category_table): Now static, since it's not used elsewhere.
24029 * character.c (string_count_byte8): Likewise.
24030
24031 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
24032 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
24033
24034 * chartab.c (copy_sub_char_table): Now static, since it's not used
24035 elsewhere.
24036 (sub_char_table_ref_and_range, char_table_ref_and_range):
24037 Rename locals to avoid shadowing.
24038 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
24039
24040 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
24041 (BIDI_BOB): Remove unused macro.
24042
24043 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24044 deduce are never used uninitialized.
24045 * term.c (encode_terminal_code): Likewise.
24046
24047 * term.c (encode_terminal_code): Now static. Remove unused local.
24048
24049 * tparam.h: New file.
24050 * term.c, tparam.h: Include it.
24051 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24052 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24053 Move these decls to tparam.h, and make them agree with what
24054 is actually in tparam.c. The previous trick of using incompatible
24055 decls in different modules does not conform to the C standard.
24056 All callers of tparam changed to use tparam's actual API.
24057 * tparam.c (tparam1, tparam, tgoto):
24058 Use const pointers where appropriate.
24059
24060 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24061 * cm.h (struct cm): Likewise.
24062 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24063 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24064 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24065 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24066 (turn_on_face, init_tty): Likewise.
24067 * termchar.h (struct tty_display_info): Likewise.
24068
24069 * term.c (term_mouse_position): Rename local to avoid shadowing.
24070
24071 * alloc.c (mark_ttys): Move decl from here ...
24072 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24073
24074 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24075
24076 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24077
24078 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
24079
24080 * search.c (compile_pattern_1): Remove argument regp, unused since
24081 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24082 (compile_pattern): Don't pass it.
24083
24084 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24085
24086 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24087 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24088 for ! HAVE_GTK3.
24089 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24090
24091 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24092
24093 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24094 gdk_window_get_screen, gdk_window_get_geometry,
24095 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24096 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24097 (xg_get_pixbuf_from_pixmap): New function.
24098 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24099 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24100 Call xg_get_pixbuf_from_pixmap instead of
24101 gdk_pixbuf_get_from_drawable.
24102 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24103 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24104 (xg_check_special_colors): Use GtkStyleContext and its functions
24105 for HAVE_GTK3.
24106 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24107 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24108 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24109 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24110 Call gtk_widget_get_preferred_size.
24111 (xg_frame_resized): gdk_window_get_geometry only takes 5
24112 parameters.
24113 (xg_win_to_widget, xg_event_is_for_menubar):
24114 Call gdk_x11_window_lookup_for_display.
24115 (xg_set_widget_bg): New function.
24116 (delete_cb): New function.
24117 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24118 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24119 (xg_set_background_color): Call xg_set_widget_bg.
24120 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24121 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24122 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24123 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24124 if ! HAVE_GTK3.
24125 (update_frame_tool_bar): Call gtk_widget_hide.
24126 (xg_initialize): Use GDK_KEY_g.
24127
24128 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24129 if ! HAVE_GTK3
24130 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24131
24132 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24133 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24134 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24135
24136 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
24137
24138 * w32xfns.c (select_palette): Check success of RealizePalette against
24139 GDI_ERROR, not zero.
24140
24141 See ChangeLog.11 for earlier changes.
24142
24143 ;; Local Variables:
24144 ;; coding: utf-8
24145 ;; End:
24146
24147 Copyright (C) 2011-2013 Free Software Foundation, Inc.
24148
24149 This file is part of GNU Emacs.
24150
24151 GNU Emacs is free software: you can redistribute it and/or modify
24152 it under the terms of the GNU General Public License as published by
24153 the Free Software Foundation, either version 3 of the License, or
24154 (at your option) any later version.
24155
24156 GNU Emacs is distributed in the hope that it will be useful,
24157 but WITHOUT ANY WARRANTY; without even the implied warranty of
24158 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24159 GNU General Public License for more details.
24160
24161 You should have received a copy of the GNU General Public License
24162 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.