* process.c (handle_child_signal): Also use WCONTINUED.
[bpt/emacs.git] / src / ChangeLog
1 2013-06-01 Paul Eggert <eggert@cs.ucla.edu>
2
3 * process.c (handle_child_signal): Also use WCONTINUED.
4 This is so that list-processes doesn't mistakenly list the process
5 as stopped, when the process has actually been continued and is
6 now running.
7
8 2013-05-31 Paul Eggert <eggert@cs.ucla.edu>
9
10 Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
11 * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
12 not already configured.
13
14 * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
15
16 2013-05-29 Eli Zaretskii <eliz@gnu.org>
17
18 * Makefile.in (mostlyclean): Remove *.res files.
19
20 2013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
21
22 * fileio.c (Finsert_file_contents): Preserve undo info when reverting
23 a buffer (bug#8447).
24
25 2013-05-27 Eli Zaretskii <eliz@gnu.org>
26
27 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
28 display vector, and we backtrack, handle the case that the
29 previous character position is also displayed from a display
30 vector or covered by a display string or image. (Bug#14476)
31
32 2013-05-25 Jan Djärv <jan.h.d@swipnet.se>
33
34 * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
35 (struct MonitorInfo, free_monitors): Remove.
36 (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
37 (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
38 (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
39 Qframes, Qsource.
40
41 * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
42 (struct MonitorInfo, free_monitors): Remove.
43 (ns_screen_name): Make static.
44 (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
45 (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
46 Qframes, Qsource.
47
48 * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
49 (struct MonitorInfo): New struct.
50 (free_monitors, make_monitor_attribute_list): Declare.
51
52 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
53 New Lisp_Object:s.
54 (free_monitors, make_monitor_attribute_list): New functions.
55 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
56 Qsource.
57
58 2013-05-25 Xue Fuqiao <xfq.free@gmail.com>
59
60 * callproc.c (call_process): Refine the doc string. (Bug#14045)
61
62 2013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
63
64 * keyboard.c: Apply keyboard decoding only to events that come directly
65 from the tty, not from unread-command-events (bug#14368).
66 (read_event_from_main_queue): New function, extracted from read_char).
67 (read_decoded_char): Remove.
68 (read_decoded_event_from_main_queue): New function to replace it.
69 (read_char): Use it.
70 (read_key_sequence): Use read_char rather than read_decoded_char.
71
72 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
73
74 2013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
75
76 * casetab.c (init_casetab_once): Fix last change (bug#14424).
77
78 2013-05-22 Kenichi Handa <handa@gnu.org>
79
80 The following changes are to fix the setting of
81 buffer-file-coding-system on, for instance, C-x RET c unix RET
82 _FILE_OF_DOS_EOL_TYPE_ RET.
83
84 * coding.h (struct coding_system): New member detected_utf8_chars.
85
86 * coding.c (detect_coding_utf_8): Count characters and check EOL
87 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
88 BOM is there.
89 (setup_coding_system): Do not initialize coding->head_ascii.
90 (check_ascii): Do not set coding->eol_seen but update it. Do not
91 call adjust_coding_eol_type here.
92 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
93 If the eol-type of CODING is already specified, adjust the eol type
94 of the found coding-system.
95 (decode_coding_gap): Cancel previous change. Utilize the
96 character numbers counted by detect_coding_utf_8. Fix detection
97 of BOM for utf-8.
98
99 2013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
100
101 * search.c (looking_at_1): Only set last_thing_searched if the match
102 changed the match-data (bug#14281).
103
104 2013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
105
106 * xdisp.c (reseat_at_previous_visible_line_start):
107 Already declared in dispextern.h, so remove it here.
108 (move_it_vertically_backward): Likewise.
109
110 2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
111
112 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
113 (Fx_display_pixel_width, Fx_display_pixel_height)
114 (Fx_display_mm_width, Fx_display_mm_height):
115 Mention `display-monitor-attributes-list' in docstrings.
116
117 * nsfns.m (ns_get_screen): Remove function. All uses removed.
118 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
119 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
120 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
121 (Fx_display_backing_store, Fx_display_visual_class)
122 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
123 (Fx_display_grayscale_p, Fx_display_pixel_width)
124 (Fx_display_pixel_height, Fx_display_planes)
125 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
126 (Fx_display_screens): Don't confuse X11 screens with NS screens.
127 (Fx_display_mm_width, Fx_display_mm_height)
128 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
129 height for all physical monitors as in X11.
130
131 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
132 Return pixel width or height for all physical monitors as in X11.
133
134 2013-05-18 Paul Eggert <eggert@cs.ucla.edu>
135
136 Port --enable-gcc-warnings to clang.
137 * bytecode.c (exec_byte_code):
138 * regex.c:
139 Redo diagnostic pragmas to pacify clang, too.
140 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
141 * editfns.c (Fencode_time):
142 * fileio.c (file_accessible_directory_p):
143 * font.c (font_unparse_xlfd):
144 Use '&"string"[index]' instead of '"string" + (index)'.
145 * undo.c (user_error): Remove; unused.
146
147 2013-05-16 Eli Zaretskii <eliz@gnu.org>
148
149 * insdel.c (insert_1_both): Document the arguments, instead of
150 referring to insert_1, which no longer exists.
151
152 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
153 some window, increment windows_or_buffers_changed, so that
154 *Messages* display in that window is updated. (Bug#14408)
155
156 * w32.c: Include epaths.h.
157 (init_environment): Use cmdproxy.exe without leading directories.
158 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
159 case.
160 (gettimeofday): Adjust signature and return value to Posix
161 expectations.
162
163 * unexw32.c (open_output_file): Delete the existing emacs.exe
164 before creating it, to break the hard link to the versioned
165 executable.
166
167 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
168 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
169 (FIRSTFILE_OBJ): New variables.
170 (W32_RES): Rename to EMACSRES. All users changed.
171 (base_obj): Use $(CM_OBJ).
172 (ALLOBJS): Use $(FIRSTFILE_OBJ).
173 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
174 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
175 $(W32_RES_LINK) before $(LIBES).
176 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
177
178 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
179
180 * makefile.w32-in (DOC): Use just "DOC".
181
182 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
183
184 * process.c: Export default filters and sentinels to Elisp.
185 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
186 New constants.
187 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
188 (Fset_process_sentinel, Fformat_network_address):
189 Default to them instead of nil.
190 (server_accept_connection): Sentinels can't be nil any more.
191 (read_and_dispose_of_process_output): New function, extracted from
192 read_process_output.
193 (read_process_output): Use it; filters can't be nil.
194 (Finternal_default_process_filter): New function, extracted from
195 read_process_output.
196 (exec_sentinel_unwind): Remove function.
197 (exec_sentinel): Don't zilch sentinel while running.
198 (status_notify): Sentinels can't be nil.
199 (Finternal_default_process_sentinel): New function extracted from
200 status_notify.
201 (setup_process_coding_systems): Default filter is not nil any more.
202 (syms_of_process): Export new Elisp functions and initialize
203 new constants.
204 * lisp.h (make_lisp_proc): New function.
205
206 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
207
208 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
209
210 2013-05-14 Eli Zaretskii <eliz@gnu.org>
211
212 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
213 unless we know that the window w is a leaf window.
214 Another attempt at solving bug#14062.
215
216 2013-05-14 Jan Djärv <jan.h.d@swipnet.se>
217
218 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
219 fdesc (Bug#14375).
220
221 2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
222
223 * image.c (gif_load): Check that subimages fit (Bug#14345).
224
225 2013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
226
227 * lread.c (skip_dyn_eof): New function.
228 (read1): Use it to skip the end of a file in response to #@00.
229
230 * doc.c (get_doc_string): Slightly relax the sanity checking.
231
232 2013-05-09 Jan Djärv <jan.h.d@swipnet.se>
233
234 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
235 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
236 (MonitorInfo): New struct.
237 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
238 (Fns_display_monitor_attributes_list): New functions.
239 (display-usable-bounds): Remove.
240 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
241 Qsource.
242
243 2013-05-09 Paul Eggert <eggert@cs.ucla.edu>
244
245 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
246 (GTK_CHECK_VERSION): New macro, if not already defined.
247 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
248 replaced by GTK_CHECK_VERSION.
249
250 2013-05-08 Paul Eggert <eggert@cs.ucla.edu>
251
252 * xterm.h (GTK_PREREQ): New macro.
253 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
254 to use this macro instead, for consistency and clarity.
255
256 2013-05-08 Eli Zaretskii <eliz@gnu.org>
257
258 * xdisp.c (row_for_charpos_p): New function, with code of
259 cursor_row_p, but accepts an additional argument CHARPOS instead
260 of using a hardcoded PT.
261 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
262 (row_containing_pos): Call row_for_charpos_p instead of partially
263 doing the same. Fixes cursor positioning under longlines-mode
264 when longlines-show-effect includes more than one newline, when
265 moving the cursor vertically up.
266
267 2013-05-08 Juanma Barranquero <lekktu@gmail.com>
268
269 * makefile.w32-in (ACL_H): New macro.
270 ($(BLD)/fileio.$(O)): Update dependencies.
271
272 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
273
274 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
275 * Makefile.in (LIB_ACL): New macro.
276 (LIBACL_LIBS): Remove.
277 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
278 * fileio.c: Include <acl.h>.
279 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
280 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
281 !acl_errno_valid.
282 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
283 it ourselves.
284
285 * unexelf.c: Don't assume ElfW (Half) fits in int.
286 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
287 when dealing with ElfW (Half) values, since they can exceed 2**31
288 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
289 (entry_address): Omit unused NUM arg. All uses changed.
290
291 2013-05-07 Juri Linkov <juri@jurta.org>
292
293 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
294 to the string converted from number with `Fnumber_to_string'.
295 (Bug#14254)
296
297 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
298
299 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
300 This fixes a problem introduced by my previous change.
301
302 2013-05-07 Glenn Morris <rgm@gnu.org>
303
304 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
305
306 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
307
308 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
309
310 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
311
312 Static checking by GCC 4.8.0.
313 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
314 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
315 (x_get_monitor_attributes_fallback)
316 (x_get_monitor_attributes_xinerama)
317 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
318 Define only if USE_GTK.
319 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
320 (x_get_monitor_attributes_fallback): Omit unused locals.
321 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
322 Use double, not float, to avoid mixed-mode floating point arithmetic.
323
324 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
325 Jan Djärv <jan.h.d@swipnet.se>
326
327 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
328 (XINERAMA_CFLAGS): New macros.
329 (ALL_CFLAGS, LIBES): Use them.
330
331 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
332 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
333 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
334 (syms_of_xfns): DEFSYM them.
335 (struct MonitorInfo): New struct.
336 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
337 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
338 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
339 (x_get_monitor_attributes_xinerama): New functions.
340 (Fx_display_monitor_attributes_list): New primitive.
341 (syms_of_xfns): Defsubr it.
342
343 * xterm.h (x_display_info): Add Xatom_net_workarea and
344 Xatom_net_current_desktop.
345
346 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
347 and dpyinfo->Xatom_net_current_desktop.
348
349 2013-05-06 Eli Zaretskii <eliz@gnu.org>
350
351 * xdisp.c (pos_visible_p): Use the special code for finding the
352 beginning of a display property or overlay for any "replacing"
353 display property, not just for display strings. This solves
354 incorrect reporting of position by posn-at-point. (Bug#14241)
355
356 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
357
358 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
359 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
360 Verify that ElfW (Half) fits in int.
361 (fatal): Use same signature as lisp.h.
362 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
363 configure and build with -DUNEXELF_DEBUG without worrying about
364 other modules that use DEBUG.
365 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
366 possibly-wide integers now uses it instead of plain fprintf.
367 (entry_address): New function, which avoids problems with 32-bit
368 overflow on 64-bit hosts.
369 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
370 (round_up): Don't assume the remainder fits in int.
371 (find_section): Use bool for boolean. Simplify debug code.
372 (unexec): Don't assume file sizes fit in int or size_t.
373 Omit unnecessary trailing newline in 'fatal' format.
374 Use strerror rather than outputting decimal error number.
375 Remove unused code when emacs is not defined;
376 this file relies on Emacs now.
377 Don't assume e_phnum and e_shnum are positive.
378
379 * regex.c: Fix problems when DEBUG is defined.
380 (extract_number, extract_number_and_incr): Define regardless of
381 whether DEBUG is defined; that's simpler and makes the code less
382 likely to go stale in the normal case when DEBUG is not defined.
383 Return int rather than taking an int * arg. All callers changed.
384 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
385 Remove, replacing with ...
386 (DEBUG_PRINT): New macro. All callers changed.
387 (DEBUG_COMPILES_ARGUMENTS): New macro.
388 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
389 (print_compiled_pattern, print_double_string) [DEBUG]:
390 Use prototype rather than old-style definition.
391 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
392 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
393 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
394 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
395 Don't assume ptrdiff_t, size_t, and long are the same width as int.
396 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
397 This matters only when DEBUG is defined.
398
399 2013-05-05 Eli Zaretskii <eliz@gnu.org>
400
401 * xdisp.c (set_iterator_to_next): Set the
402 ignore_overlay_strings_at_pos_p flag only if we are _really_
403 iterating over an overlay string, as indicated by the
404 current.overlay_string_index member. (Bug#14306)
405
406 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
407
408 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
409 to where it is used, to avoid autorelease issues (Bug#14050).
410
411 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
412
413 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
414 * fileio.c (syms_of_fileio): Implement this.
415 * filelock.c (create_lock_file): If symbolic links don't work, so
416 we use a regular file as a lock file, do not fsync the lock file;
417 it's not needed.
418
419 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
420
421 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
422 (syms_of_minibuf): Adjust accodingly.
423 * lread.c (Fread):
424 * callint.c (Fcall_interactively): Adjust calls accordingly.
425
426 2013-05-04 Eli Zaretskii <eliz@gnu.org>
427
428 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
429 w->contents is a buffer before computing everything else.
430 Use parentheses to disambiguate last part of the condition.
431
432 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
433 assertion violations. (Bug#14062)
434
435 2013-05-01 David Reitter <david.reitter@gmail.com>
436
437 * nsfns.m (ns_tooltip): Initialize.
438
439 2013-04-28 Eli Zaretskii <eliz@gnu.org>
440
441 * coding.c (decode_coding_gap): Don't remove the character before
442 a newline unless it's a CR character. (Bug#14287)
443
444 2013-04-28 Dan Nicolaescu <dann@gnu.org>
445
446 * dispextern.h (struct face): Move enum face_underline_type
447 earlier so that bitfields can be in the same word.
448
449 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
450
451 * nsfns.m (handlePanelKeys): New function.
452 (EmacsOpenPanel:performKeyEquivalent:)
453 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
454 arrows/function/control and copy/paste keys (Bug#14296).
455
456 2013-04-27 Juri Linkov <juri@jurta.org>
457
458 * callint.c (Fcall_interactively): Call `Qread_number' for
459 interactive code letter `n' instead of using duplicate code.
460 (Bug#14254)
461
462 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
463
464 * systime.h (make_timeval): Declare as 'const'.
465
466 2013-04-27 Kenichi Handa <handa@gnu.org>
467
468 * font.c (font_open_entity): Always open a font of manageable
469 size.
470
471 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
472
473 Port better to AIX (Bug#14258).
474 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
475 to pacify AIX xlc.
476
477 2013-04-24 Kenichi Handa <handa@gnu.org>
478
479 * coding.c (decode_coding_iso_2022): When an invalid escape
480 sequence is encountered, reset the invocation and designation
481 status to the safest one.
482
483 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
484
485 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
486 Without this fix, "make distclean" leaves stamp-h1 behind.
487
488 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
489
490 * w32fns.c (w32_fullscreen_rect): New function to compute the
491 window rectangle for the given fullscreen mode.
492 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
493 longer tunes the window size. This keeps the window's edges flush
494 with the screen and allows the taskbar to hide itself in fullboth.
495
496 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
497 window decorations and uses the entire screen.
498
499 * w32term.h (w32_fullscreen_rect) Add prototype.
500 (struct w32_output): Replace normal_width, normal_height,
501 normal_top, and normal_left members with a single normal_placement
502 struct.
503 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
504 Remove macros.
505 (FRAME_NORMAL_PLACEMENT): New macro.
506
507 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
508
509 * minibuf.c (Ftest_completion): Silence compiler warning.
510
511 2013-04-15 Eli Zaretskii <eliz@gnu.org>
512
513 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
514 bug#14062.
515
516 * frame.h (WINDOW_FRAME): Protect macro and its argument with
517 parentheses.
518
519 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
520 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
521 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
522 parentheses where appropriate.
523
524 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
525
526 * keyboard.c (timer_start_idle): Remove no-longer-used local.
527
528 2013-04-14 Eli Zaretskii <eliz@gnu.org>
529
530 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
531 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
532 Mention in the doc string that setting these variables takes
533 effect only after a call to set-window-buffer. (Bug#14200)
534
535 2013-04-13 Eli Zaretskii <eliz@gnu.org>
536
537 * indent.c (Fvertical_motion): Don't consider display strings on
538 overlay strings as display strings on the buffer position we
539 started from. This prevents vertical cursor motion from jumping
540 more than one line when there's an overlay string with a display
541 property at end of line.
542 Reported by Karl Chen <Karl.Chen@quarl.org> in
543 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
544
545 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
546
547 * window.c (select_window): `record_buffer' even if window is
548 already selected (bug#14191).
549
550 2013-04-11 Eli Zaretskii <eliz@gnu.org>
551
552 * window.c (Fwindow_end): Test more flags, including the buffer's
553 last_overlay_modified flag, to determine whether the window's
554 display is really up-to-date. Prevents the function from
555 returning a stale value. (Bug#14170)
556 (Fwindow_line_height): Fix the test for up-to-date-ness of the
557 current matrix.
558
559 2013-04-10 Eli Zaretskii <eliz@gnu.org>
560
561 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
562 garbaged only if it is not already the top frame on its TTY.
563 This prevents flickering due to constant redrawing of TTY frames when
564 there are GUI frames open in the same session. (Bug#13864)
565
566 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
567
568 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
569 of marking the idle timers directly.
570
571 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
572
573 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
574 tables (bug#14054).
575
576 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
577
578 * window.c (select_window): Don't record_buffer while the invariant is
579 temporarily broken (bug#14161).
580
581 * fns.c (Fdelq): Don't assume !NILP => CONSP.
582
583 2013-04-07 Eli Zaretskii <eliz@gnu.org>
584
585 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
586
587 2013-04-07 Romain Francoise <romain@orebokech.com>
588
589 Ignore additional platform-specific ACL errors (Bug#13702).
590 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
591 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
592
593 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
594
595 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
596 f->output_data.ns.
597
598 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
599
600 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
601 This bug was introduced by my 2013-02-25 change that simplified
602 data_start configuration. Without this change, on GNU/Linux
603 an Emacs configured with --enable-profiling fails immediately
604 due to a profiler signal.
605 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
606 with these flags. On platforms where special flags are needed
607 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
608 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
609 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
610
611 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
612
613 Get rid of some platform-specific functions examining window
614 system and its capabilities. This is a partial rework of the
615 2013-04-05 change.
616 * lisp.h (have_menus_p): Remove prototype. This function is
617 replaced with platform-independent window_system_available.
618 (check_window_system): Move to...
619 * frame.h (decode_window_system_frame, window_system_available):
620 ...here, add new prototypes.
621 * frame.c (window_system_available, decode_window_system_frame):
622 New functions.
623 (check_window_system): Platform-independent now.
624 * xterm.h (x_in_use): Remove declaration.
625 (check_x_frame):
626 * w32term.h (check_x_frame):
627 * nsterm.h (check_x_frame): Remove prototypes. This function
628 is replaced with platform-independent decode_window_system_frame.
629 * msdos.c (have_menus_p): Remove.
630 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
631 Remove platform-specific functions. Use check_window_system,
632 decode_window_system_frame and check_ns_display_info where
633 appropriate. Minor style and comment tweaks.
634 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
635 (check_x_frame): Likewise.
636 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
637 Likewise.
638 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
639 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
640 * xmenu.c, xselect.c: All related users changed.
641
642 2013-04-03 Kenichi Handa <handa@gnu.org>
643
644 The following changes is to optimize the code for reading UTF-8
645 files.
646
647 * coding.c (check_ascii): Rename from detect_ascii. Return value
648 changed. Check EOL format. Do not call adjust_coding_eol_type
649 here.
650 (check_utf_8): New function.
651 (adjust_coding_eol_type): Do nothing if already adjusted.
652 (detect_coding): Compare the return value of check_ascii with
653 coding->src_bytes. Call adjust_coding_eol_type if necessary.
654 (decode_coding_gap): Optimize for valid UTF-8.
655
656 2013-03-21 Kenichi Handa <handa@gnu.org>
657
658 * coding.c (syms_of_coding): Cancel previous change.
659
660 * insdel.c (insert_from_gap): Fix previous change.
661
662 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
663
664 Consistently use platform-specific function to detect window system.
665 * lisp.h (check_window_system): New prototype. This function is
666 going to replace check_x, check_w32 and check_ns.
667 (have_menus_p): Mention msdos.c in comment.
668 * fontset.c (check_window_system_func): Remove. Adjust all users.
669 * fontset.h (check_window_system_func): Remove prototype.
670 * nsterm.h (check_ns):
671 * xterm.h (check_x):
672 * w32term.h (check_w32): Likewise.
673 * menu.c (Fx_popup_menu): Use check_window_system.
674 * msdos.c (check_window_system): Define for MS-DOS.
675 * nsfns.m (check_window_system): Define for NS. Adjust all users.
676 * w32fns.c (check_window_system): Likewise for MS-Windows.
677 * xfns.c (check_window_system): Likewise for X.
678 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
679 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
680
681 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
682
683 Prefer < to > in range checks such as 0 <= i && i < N.
684 This makes it easier to visualize quantities on a number line.
685 This patch doesn't apply to all such range checks,
686 only to the range checks affected by the 2013-03-24 change.
687 This patch reverts most of the 2013-03-24 change.
688 * alloc.c (xpalloc, Fgarbage_collect):
689 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
690 * character.c (string_escape_byte8):
691 * charset.c (read_hex):
692 * data.c (cons_to_unsigned):
693 * dispnew.c (update_frame_1):
694 * doc.c (Fsubstitute_command_keys):
695 * doprnt.c (doprnt):
696 * editfns.c (hi_time, decode_time_components):
697 * fileio.c (file_offset):
698 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
699 * font.c (font_intern_prop):
700 * frame.c (x_set_alpha):
701 * gtkutil.c (get_utf8_string):
702 * indent.c (check_display_width):
703 * keymap.c (Fkey_description):
704 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
705 * lread.c (read1):
706 * minibuf.c (read_minibuf_noninteractive):
707 * process.c (wait_reading_process_output):
708 * search.c (Freplace_match):
709 * window.c (get_phys_cursor_glyph):
710 * xdisp.c (redisplay_internal):
711 * xsmfns.c (smc_save_yourself_CB):
712 Prefer < to > for range checks.
713 * dispnew.c (sit_for): Don't mishandle NaNs.
714 This fixes a bug introduced in the 2013-03-24 change.
715 * editfns.c (decode_time_components): Don't hoist comparison.
716 This fixes another bug introduced in the 2013-03-24 change.
717
718 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
719
720 * frame.h (struct frame): Drop scroll_bottom_vpos
721 member becaue all real users are dead long ago.
722 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
723 * xdisp.c (redisplay_internal): Adjust user.
724
725 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
726
727 * nsmenu.m (showAtX:Y:for:): setLevel to
728 NSPopUpMenuWindowLevel (Bug#13998).
729
730 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
731
732 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
733 (ns_check_pending_open_menu): Declare.
734
735 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
736 (x_activate_menubar): Update the menu with title that matches
737 ns_get_pending_menu_title, and call
738 ns_check_pending_openmenu (Bug#12698).
739 (menuWillOpen:): New method.
740 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
741
742 * nsterm.m (menu_will_open_state, menu_mouse_point)
743 (menu_pending_title): New varaibles.
744 (ns_get_pending_menu_title, ns_check_menu_open)
745 (ns_check_pending_open_menu): New functions.
746
747 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
748
749 * indent.c (current_column_bol_cache): Remove leftover which is not
750 used in Fmove_to_column any more.
751 (current_column, scan_for_column): Adjust users.
752 * keyboard.c (last_point_position_buffer, last_point_position_window):
753 Remove leftovers which are not used for recording undo any more.
754 (command_loop_1, syms_of_keyboard): Adjust users.
755 * xdisp.c (last_max_ascent): Remove leftover which is not used in
756 redisplay_window any more.
757 (move_it_to): Adjust user.
758
759 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
760
761 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
762 Update dependencies.
763
764 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
765
766 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
767 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
768 forward references.
769
770 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
771
772 * window.h (struct window): Replace hchild, vchild and buffer slots
773 with the only contents slot. This is possible because each valid
774 window may have either the child window (in vertical or horizontal
775 combination) or buffer to display (for the leaf window). Using that,
776 a lof of operations to traverse and/or change window hierarchies may
777 be simplified. New member horizontal is used to distinguish between
778 horizontal and vertical combinations of internal windows.
779 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
780 (WINDOW_VERTICAL_COMBINATION_P): New macros.
781 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
782 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
783 Use contents slot, not buffer, where appropriate.
784 (wset_combination): New function.
785 (wset_buffer): Add eassert.
786 (Fframe_first_window): Simplify the loop reaching first window.
787 (Fwindow_buffer): Use WINDOW_LEAF_P.
788 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
789 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
790 (unshow_buffer): Convert initial debugging check to eassert.
791 (replace_window, recombine_windows, Fdelete_other_windows_internal)
792 (make_parent_window, window_resize_check, window_resize_apply)
793 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
794 (Fset_window_configuration, delete_all_child_windows, save_window_save):
795 Adjust to match struct window changes.
796 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
797 (mark_window_cursors_off, count_windows, get_leaf_windows)
798 (foreach_window_1): Simplify the loop.
799 * alloc.c (mark_object): Do not check for the leaf window because
800 internal windows has no glyph matrices anyway.
801 * dispnew.c (clear_window_matrices, showing_window_margins_p)
802 (allocate_matrices_for_window_redisplay, fake_current_matrices)
803 (allocate_matrices_for_frame_redisplay, free_window_matrices)
804 (build_frame_matrix_from_window_tree, mirror_make_current)
805 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
806 (update_window_tree, set_window_update_flags): Simplify the loop.
807 (sync_window_with_frame_matrix_rows): Enforce live window.
808 Use contents slot, not buffer, where appropriate.
809 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
810 and WINDOW_HORIZONTAL_COMBINATION_P.
811 (make_frame_visible_1): Simplify the loop.
812 Use contents slot, not buffer, where appropriate.
813 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
814 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
815 (expose_window_tree): Likewise.
816 Use contents slot, not buffer, where appropriate.
817 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
818 to avoid deleted windows. Use contents slot instead of buffer.
819 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
820 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
821 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
822 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
823
824 2013-03-28 Eli Zaretskii <eliz@gnu.org>
825
826 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
827 identify the reasons for assertion violations in bug#14062 and
828 similar ones.
829 (Fx_show_tip): Fix compilation error under
830 "--enable-check-lisp-object-type". (Bug#14073)
831
832 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
833 Reported by <rzl24ozi@gmail.com>.
834
835 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
836
837 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
838 start marker...
839 (unwind_with_echo_area_buffer): ...to restore it here.
840 This is needed to ensure that...
841 (redisplay_window): ...both window markers are valid here,
842 which is verified by eassert.
843 * editfns.c (save_excursion_save): Do not assume that
844 selected_window always displays the buffer.
845 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
846 Fix comment.
847
848 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
849
850 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
851 the upcase table.
852
853 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
854
855 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
856
857 2013-03-27 Eli Zaretskii <eliz@gnu.org>
858
859 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
860 since MinGW's w32api headers do. This avoids compiler warnings.
861
862 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
863 if already defined.
864
865 2013-03-26 Eli Zaretskii <eliz@gnu.org>
866
867 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
868
869 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
870
871 * gtkutil.c (style_changed_cb): Check if frame is live and an
872 X frame (Bug#14038).
873
874 2013-03-26 Eli Zaretskii <eliz@gnu.org>
875
876 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
877 Define only for _WIN32_WINNT less than 0x0500.
878 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
879 MinGW64.
880 Move inclusion of time.h before sys/time.h, so that MinGW64 could
881 see its own definitions of 'struct timeval' and 'struct timezone'.
882
883 Fix incompatibilities between MinGW.org and MinGW64 headers.
884 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
885
886 * w32.c (REPARSE_DATA_BUFFER): Guard with
887 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
888
889 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
890
891 * xterm.c: Include X11/XKBlib.h
892 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
893
894 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
895
896 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
897 written backwards.
898 * blockinput.h (input_blocked_p): Likewise.
899 * bytecode.c (exec_byte_code): Likewise.
900 * callproc.c (call_process_kill, call_process_cleanup)
901 (Fcall_process): Likewise.
902 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
903 (Fccl_execute_on_string): Likewise.
904 * character.c (string_escape_byte8): Likewise.
905 * charset.c (read_hex): Likewise.
906 * cm.c (calccost): Likewise.
907 * data.c (cons_to_unsigned): Likewise.
908 * dired.c (directory_files_internal, file_name_completion):
909 Likewise.
910 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
911 (sit_for): Likewise.
912 * doc.c (Fsubstitute_command_keys): Likewise.
913 * doprnt.c (doprnt): Likewise.
914 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
915 * emacsgtkfixed.c: Likewise.
916 * fileio.c (file_offset, Fwrite_region): Likewise.
917 * floatfns.c (Fexpt, fmod_float): Likewise.
918 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
919 Likewise.
920 * font.c (font_intern_prop): Likewise.
921 * frame.c (x_set_alpha): Likewise.
922 * gtkutil.c (get_utf8_string): Likewise.
923 * indent.c (check_display_width): Likewise.
924 * intervals.c (create_root_interval, rotate_right, rotate_left)
925 (split_interval_right, split_interval_left)
926 (adjust_intervals_for_insertion, delete_node)
927 (interval_deletion_adjustment, adjust_intervals_for_deletion)
928 (merge_interval_right, merge_interval_left, copy_intervals)
929 (set_intervals_multibyte_1): Likewise.
930 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
931 * keymap.c (Fkey_description): Likewise.
932 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
933 * lread.c (openp, read_integer, read1, string_to_number):
934 Likewise.
935 * menu.c (ensure_menu_items): Likewise.
936 * minibuf.c (read_minibuf_noninteractive): Likewise.
937 * print.c (printchar, strout): Likewise.
938 * process.c (create_process, Faccept_process_output)
939 (wait_reading_process_output, read_process_output, send_process)
940 (wait_reading_process_output): Likewise.
941 * profiler.c (make_log, handle_profiler_signal): Likewise.
942 * regex.c (re_exec): Likewise.
943 * regex.h: Likewise.
944 * search.c (looking_at_1, Freplace_match): Likewise.
945 * sysdep.c (get_child_status, procfs_ttyname)
946 (procfs_get_total_memory): Likewise.
947 * systime.h (EMACS_TIME_VALID_P): Likewise.
948 * term.c (dissociate_if_controlling_tty): Likewise.
949 * window.c (get_phys_cursor_glyph): Likewise.
950 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
951 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
952 Likewise.
953 * xfns.c (Fx_window_property): Likewise.
954 * xmenu.c (set_frame_menubar): Likewise.
955 * xselect.c (x_get_window_property, x_handle_dnd_message):
956 Likewise.
957 * xsmfns.c (smc_save_yourself_CB): Likewise.
958 * xterm.c (x_scroll_bar_set_handle): Likewise.
959
960 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
961
962 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
963 to be optional or nil. Adjust comment and convert it to docstring.
964 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
965 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
966
967 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
968
969 Static checking by GCC 4.8-20130319.
970 * image.c (gif_load): Assume pass < 3 to pacify GCC.
971 * process.c (Fset_process_datagram_address)
972 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
973 * xdisp.c (get_char_face_and_encoding):
974 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
975 (get_glyph_face_and_encoding): Prepare face before possibly using it.
976 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
977
978 2013-03-24 Ken Brown <kbrown@cornell.edu>
979
980 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
981 fix compilation on 64-bit Cygwin, where underscores are not
982 automatically prepended.
983
984 * w32term.c (w32_initialize): Silence compiler warning.
985
986 2013-03-23 Eli Zaretskii <eliz@gnu.org>
987
988 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
989 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
990 variables, to save and restore frame dimensions.
991 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
992 after returning from a 'fullscreen' configuration.
993 use SendMessage instead of PostMessage to send the SC_RESTORE message,
994 to avoid races between the main thread and the input thread.
995
996 * w32term.h (struct w32_output): New members normal_width,
997 normal_height, normal_top, normal_left, and prev_fsmode.
998 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
999 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
1000 members of a frame.
1001
1002 * w32term.c (w32fullscreen_hook): Record last value of the frame's
1003 'fullscreen' parameter. Always record previous width and height
1004 of the frame, except when switching out of maximized modes, so
1005 that they could be restored correctly, instead of resetting to the
1006 default frame dimensions. Send SC_RESTORE command to the frame,
1007 unless we are going to send SC_MAXIMIZE, to restore the frame
1008 resize hints in the mouse pointer shown by the window manager.
1009 (Bug#14032)
1010
1011 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
1012
1013 * lisp.h (get_frame_param): Adjust conditions for prototype
1014 declaration.
1015
1016 2013-03-22 Ken Brown <kbrown@cornell.edu>
1017
1018 * unexcw.c: Drop unneeded inclusion of w32common.h.
1019 (report_sheap_usage): Declare.
1020 (read_exe_header): Add magic numbers for x86_64.
1021 (fixup_executable): Fix printf format specifier for unsigned long
1022 argument.
1023
1024 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
1025
1026 * frame.h (struct frame): Put menu_bar_window under #ifdef
1027 because this member is not needed when X toolkit is in use.
1028 (fset_menu_bar_window):
1029 * dispnew.c (clear_current_matrices, clear_desired_matrices)
1030 (free_glyphs, update_frame):
1031 * xdisp.c (expose_frame): Likewise.
1032 (display_menu_bar): Likewise. Remove redundant eassert.
1033 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
1034 toolkit is in use.
1035
1036 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
1037
1038 Use functions and constants to manipulate Lisp_Save_Value objects.
1039 This replaces code that used macros and strings and token-pasting.
1040 The change makes the C source a bit easier to follow,
1041 and shrinks the Emacs executable a bit.
1042 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
1043 (make_save_value): Change 1st arg from string to enum. All callers
1044 changed.
1045 (INTX): Remove.
1046 (mark_object): Use if, not #if, for GC_MARK_STACK.
1047 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
1048 (XSAVE_OBJECT): Now functions, not macros.
1049 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
1050 the constant was never used.
1051 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
1052 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
1053 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
1054 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
1055 New constants.
1056 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
1057 type3 with a single member save_type. All uses changed.
1058 (save_type, set_save_pointer, set_save_integer): New functions.
1059 * print.c (PRINTX): Remove.
1060
1061 * alloc.c: Remove redundant static declarations.
1062
1063 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1064
1065 * window.h (struct window): Convert left_col, top_line, total_lines
1066 and total_cols from Lisp_Objects to integers. Adjust comments.
1067 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
1068 Remove.
1069 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
1070 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
1071 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
1072 Adjust users where appropriate.
1073
1074 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
1075
1076 * frame.h (struct frame): Drop resx and resy because the same data is
1077 available from window system-specific output context. Adjust users.
1078 (default_pixels_per_inch_x, default_pixels_per_inch_y):
1079 New functions to provide defaults when no window system available.
1080 (FRAME_RES_X, FRAME_RES_Y): New macros.
1081 (NUMVAL): Move from xdisp.c.
1082 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
1083 (Ffont_face_attributes, Fopen_font):
1084 * image.c (gs_load):
1085 * w32font.c (fill_in_logfont):
1086 * xdisp.c (calc_pixel_width_or_height):
1087 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
1088 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
1089
1090 2013-03-20 Kenichi Handa <handa@gnu.org>
1091
1092 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
1093 to 1 (temporary workaround until a bug related to ASCII
1094 optimization is fixed).
1095
1096 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
1097
1098 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
1099 Signal error if window is not internal. Adjust docstring.
1100 (delete_all_child_windows): Use combination_limit to save the buffer.
1101 (Fset_window_configuration): Adjust accordingly.
1102 * print.c (syms_of_print): Initialize debugging output not here...
1103 (init_print_once): ...but in a new function here.
1104 * lisp.h (init_print_once): Add prototype.
1105 * emacs.c (main): Add call to init_print_once. Adjust comments.
1106
1107 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
1108
1109 * window.c (window_resize_check, window_resize_apply)
1110 (window_from_coordinates, recombine_windows, set_window_buffer)
1111 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
1112 (Fsplit_window_internal, Fdelete_window_internal)
1113 (freeze_window_starts): Use bool for booleans.
1114 * window.h (window_frame_coordinates, resize_frame_windows)
1115 (freeze_window_starts, set_window_buffer): Adjust prototypes.
1116
1117 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
1118
1119 * dispnew.c (bitch_at_user): Use `user-error'.
1120
1121 2013-03-17 Ken Brown <kbrown@cornell.edu>
1122
1123 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
1124 as return type of image_background. (Bug#13981)
1125 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
1126
1127 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
1128
1129 * nsterm.m (updateFrameSize:): Change resize increments if needed.
1130 (ns_select): Don't return with result uninitialized.
1131
1132 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
1133 and getDirectory.
1134
1135 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
1136 New functions.
1137 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
1138 directories. If filename is nil, get directory name (Bug#13932).
1139 Use getFilename and getDirectory.
1140 (getFilename, getDirectory): New methods for EmacsSavePanel and
1141 EmacsOpenPanel.
1142 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
1143
1144 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
1145
1146 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1147
1148 2013-03-15 Kenichi Handa <handa@gnu.org>
1149
1150 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1151 (adjust_after_replace): Make it back to static. Delete the third
1152 arg text_at_gap_tail. Cancel the code for handling it.
1153
1154 * coding.h (struct coding_system): New member eol_seen.
1155
1156 * coding.c (detect_ascii): New function.
1157 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1158 when the source bytes are actually scanned. On detecting for
1159 coding_category_utf_8_auto, call detect_ascii instead of scanning
1160 source bytes directly.
1161 (produce_chars): Call insert_from_gap with the new arg 0.
1162 (encode_coding): Likewise.
1163 (decode_coding_gap): Control ASCII optimization by the variable
1164 disable_ascii_optimization instead of #ifndef .. #endif.
1165 Deccode EOL format according to coding->eol_seen.
1166 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1167 variable.
1168
1169 * lisp.h (adjust_after_replace): Cancel externing it.
1170 (insert_from_gap): Adjust prototype.
1171
1172 2013-03-15 Eli Zaretskii <eliz@gnu.org>
1173
1174 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1175 FULLSCREEN_MAXIMIZED. (Bug#13935)
1176
1177 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1178
1179 * region-cache.c (find_cache_boundary, move_cache_gap)
1180 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1181 Simplify debugging check and convert to eassert. Adjust comment.
1182 (pp_cache): Put under ENABLE_CHECKING.
1183
1184 2013-03-14 Eli Zaretskii <eliz@gnu.org>
1185
1186 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1187 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1188 and WM_ACTIVATEAPP.
1189 (w32fullscreen_hook): If the frame is visible, reset
1190 f->want_fullscreen flag after changing the frame size. If the
1191 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1192 (Bug#13953)
1193
1194 2013-03-13 Daniel Colascione <dancol@dancol.org>
1195
1196 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1197 too so that these builds can use Cygwin's file conversion
1198 functions. (We've been building and linking cygw32.o all along
1199 and just not using it.)
1200
1201 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1202
1203 File synchronization fixes (Bug#13944).
1204 * Makefile.in (LIB_FDATASYNC): New macro.
1205 (LIBES): Use it.
1206 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1207 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1208 Don't worry about HAVE_FSYNC, since a substitute fsync is
1209 available if the system lacks one.
1210 (Fwrite_regin): Retry fsync if interrupted.
1211
1212 2013-03-13 Eli Zaretskii <eliz@gnu.org>
1213
1214 * w32term.c (w32_read_socket): If the Emacs frame is being
1215 activated, call w32fullscreen_hook, to make sure the new frame
1216 dimensions are in effect. (Bug#13937)
1217
1218 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1219
1220 * xdisp.c (init_iterator): Simplify because both character and byte
1221 positions are either specified or -1. Add eassert. Adjust comment.
1222 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1223 character and byte positions can be obtained from marker.
1224
1225 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1226
1227 Static checking by Sun C 5.12.
1228 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1229 * bytecode.c (exec_byte_code):
1230 * dispnew.c (init_display):
1231 * eval.c (error):
1232 * fileio.c (Fsubstitute_in_file_name):
1233 * keyboard.c (Fevent_convert_list):
1234 * keymap.c (Fsingle_key_description):
1235 * term.c (maybe_fatal, fatal):
1236 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1237 * xsmfns.c (Fhandle_save_session):
1238 Omit unreachable code.
1239 * keymap.c (map_keymap_char_table_item): Cast void * to
1240 a function pointer type; the C Standard requires this.
1241
1242 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1243 Include <sys/param.h> unconditionally, as that works elsewhere and
1244 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1245 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1246 and FreeBSD now.
1247
1248 2013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1249
1250 * insdel.c (adjust_after_replace): Use bool for boolean.
1251
1252 2013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1253
1254 * keyboard.c: Move keyboard decoding to read_key_sequence.
1255 (decode_keyboard_code): Remove.
1256 (tty_read_avail_input): Don't try to decode input.
1257 (read_decoded_char): New function.
1258 (read_key_sequence): Use it.
1259
1260 2013-03-10 Daniel Colascione <dancol@dancol.org>
1261
1262 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1263 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1264 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1265 w32fns.c.
1266
1267 * w32term.c (construct_drag_n_drop): Use the above macros to make
1268 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1269
1270 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1271 properly display non-ASCII frame titles in cygw32 builds.
1272
1273 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1274 call ShellExecute in cygw32 builds.
1275
1276 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1277 common file dialog code.
1278
1279 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1280 can just use du like other systems.
1281
1282 * coding.c (from_unicode_buffer): Declare.
1283 * coding.c (from_unicode_buffer): Implement.
1284
1285 2013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1286
1287 * lread.c: Minor cleanup.
1288 (FROM_FILE_P): New macro.
1289 (skip_dyn_bytes, unreadchar, read1): Use it.
1290 (read_list): Consolidate duplicated code.
1291
1292 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1293
1294 2013-03-10 Eli Zaretskii <eliz@gnu.org>
1295
1296 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1297 (redisplay_internal, set_cursor_from_row, try_window)
1298 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1299 (display_line, notice_overwritten_cursor)
1300 (mouse_face_from_buffer_pos, note_mouse_highlight):
1301 Use MATRIX_ROW_DISPLAYS_TEXT_P.
1302 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
1303 (mouse_face_from_string_pos, fast_find_string_pos):
1304 Use MATRIX_ROW_VPOS.
1305
1306 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1307
1308 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1309
1310 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1311 MATRIX_MODE_LINE_ROW.
1312
1313 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1314
1315 2013-03-10 handa <handa@gnu.org>
1316
1317 * lisp.h (adjust_after_replace): Extern it.
1318
1319 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1320 case of detection for coding_category_utf_8_auto.
1321 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1322 Skip decoding if all bytes are ASCII.
1323
1324 * insdel.c (adjust_after_replace): Make it public. New arg
1325 text_at_gap_tail.
1326 (adjust_after_insert): Call adjust_after_replace with the new arg
1327 value 0.
1328
1329 2013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1330
1331 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1332 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1333 from Elisp via unread-command-events.
1334
1335 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1336 functions to mean "no change".
1337
1338 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1339
1340 region-cache.c, scroll.c, search.c: Use bool for booleans.
1341 * lisp.h (compile_pattern):
1342 * scroll.c (do_scrolling, do_direct_scrolling):
1343 * search.c (struct regexp_cache, compile_pattern_1)
1344 (compile_pattern, string_match_1, search_command)
1345 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1346 (search_regs_saved, Fregexp_quote):
1347 Use bool for boolean.
1348 * region-cache.c (region_cache_forward, region_cache_backward):
1349 Fix comments to match code: these functions return int, not boolean.
1350
1351 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1352
1353 * search.c (find_newline): Accept start and end byte positions
1354 as arguments and allow -1 if not known.
1355 (find_newline_no_quit): Likewise for start position.
1356 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1357 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1358 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
1359 * editfns.c (Fconstrain_to_field): Break long line.
1360 Adjust call to find_newline.
1361 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1362 Use DEC_BOTH to start next search from the previous buffer
1363 position, where appropriate.
1364 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1365 (get_visually_first_element, move_it_vertically_backward): Likewise.
1366 Obtain byte position from the display iterator, where appropriate.
1367
1368 2013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1369
1370 print.c, process.c: Use bool for booleans.
1371 * lisp.h (wait_reading_process_output):
1372 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1373 (strout, debug_output_compilation_hack, float_to_string, print)
1374 (print_object):
1375 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1376 (decode_status, status_message, create_process, create_pty)
1377 (Fmake_network_process, Fnetwork_interface_info)
1378 (wait_reading_process_output, read_process_output)
1379 (write_queue_push, write_queue_pop, process_send_signal)
1380 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1381 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1382 Use bool for booleans.
1383 * process.c (Fnetwork_interface_list): Remove unused local.
1384 (connect_counter): Now EMACS_INT, not int.
1385
1386 2013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1387
1388 * bidi.c (bidi_fetch_char): Swap first and second arguments
1389 to match other functions accepting character and byte positions.
1390 Adjust comment.
1391 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1392 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1393 when you need just to move to the previous buffer position.
1394 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1395
1396 2013-03-07 Eli Zaretskii <eliz@gnu.org>
1397
1398 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1399
1400 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1401
1402 Avoid character to byte conversions in motion subroutines.
1403 * indent.h (compute_motion, vmotion): Add byte position argument.
1404 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1405 Add eassert.
1406 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1407 Use list5 for return value.
1408 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1409 Adjust comments, style and calls to compute_motion.
1410 (Fvertical_motion): Adjust call to vmotion.
1411 * window.c (Fdelete_other_windows_internal): Record window start
1412 byte position and adjust call to vmotion.
1413 (window_scroll_line_based): Likewise with call to compute_motion.
1414 Use SET_PT_BOTH.
1415 (Frecenter): Adjust calls to vmotion.
1416
1417 2013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1418
1419 * lisp.h (list2i, list3i): New functions.
1420 (list4i): Move from window.c and make LISP_INLINE.
1421 * editfns.c (make_lisp_time):
1422 * fns.c (Flocale_info):
1423 * keyboard.c (parse_modifiers):
1424 * xterm.c (x_ewmh_activate_frame): Use list2i.
1425 * instel.c (signal_after_change):
1426 * nsfns.m (Fx_server_version, Fxw_color_values):
1427 * w32fns.c (Fxw_color_values, Fx_server_version):
1428 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1429 * fileio.c (Fvisited_file_modtime):
1430 * nsfns.m (Fns_display_usable_bounds):
1431 * w32.c (ltime): Use list4i.
1432
1433 2013-03-06 Eli Zaretskii <eliz@gnu.org>
1434
1435 * search.c (find_newline_no_quit): Rename from find_next_newline.
1436 Add commentary.
1437
1438 * lisp.h (find_newline_no_quit): Rename prototype.
1439
1440 * xdisp.c (back_to_previous_line_start)
1441 (forward_to_next_line_start, get_visually_first_element)
1442 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1443 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1444 * bidi.c (bidi_find_paragraph_start): Callers of
1445 find_newline_no_quit changed.
1446
1447 * msdos.c: Change encoding to cp850. (Bug#13879)
1448 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1449
1450 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1451
1452 Coding system support cleanup and minor refactoring.
1453 * coding.h (enum coding_result_code): Remove
1454 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1455 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1456 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1457 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1458 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1459 (decode_coding_region, encode_coding_region, decode_coding_string):
1460 Remove unused compatibility macros.
1461 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1462 (record_conversion_result): Adjust user.
1463 (syms_of_coding): Likewise.
1464 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1465 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1466 (decode_coding_object): Simplify since xrealloc never returns NULL.
1467 Add eassert.
1468
1469 2013-03-06 Paul Eggert <eggert@cs.ucla.edu>
1470
1471 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
1472 * sysdep.c (list_system_processes)
1473 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
1474 Make it a stub in this case; otherwise the build might fail,
1475 and this code hasn't been tested on such hosts anyway.
1476 Problem reported by Nelson H. F. Beebe in
1477 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1478 and analyzed by Jérémie Courrèges-Anglas in
1479 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
1480
1481 2013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1482
1483 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1484 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1485 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1486 * bidi.c (bidi_find_paragraph_start): Likewise.
1487 * indent.c (vmotion): Likewise.
1488
1489 2013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1490
1491 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1492 * filelock.c: Include <c-ctype.h>.
1493 (MAX_LFINFO): New top-level constant.
1494 (lock_info_type): Remove members pid, boot_time. Add members at,
1495 dot, colon. Change user member to be the entire buffer, not a
1496 pointer. This allows us to handle the case where a foreign
1497 pid or boot time exceeds the local range. All uses changed.
1498 (LINKS_MIGHT_NOT_WORK): New constant.
1499 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1500 (defined_WINDOWSNT): Remove.
1501 (MAKE_LOCK_NAME, file_in_lock_file_name):
1502 Always use .#FILE (not .#-FILE) for the file lock,
1503 even if it is a regular file.
1504 (rename_lock_file): New function.
1505 (create_lock_file): Use it.
1506 (create_lock_file, read_lock_data):
1507 Prefer a symbolic link for the lock file, falling back on a
1508 regular file if symlinks don't work. Do not try to create
1509 symlinks on MS-Windows, due to security hassles. Stick with
1510 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1511 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1512 host may be using a Windowsish file system, and cannot use
1513 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1514 doesn't work. Don't fail merely because of a symlink-contents
1515 length limit in the current file system; fall back on regular
1516 files. Increase the symlink contents length limit to 8 KiB, this
1517 should be big enough for any real use and doesn't crunch the
1518 stack.
1519 (create_lock_file, lock_file_1, read_lock_data):
1520 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1521 (lock_file_1): Return error number, not bool. All callers changed.
1522 (ELOOP): New macro, if not already defined.
1523 (read_lock_data): Return size of lock file contents, not Lisp object.
1524 All callers changed. Handle a race condition if some other process
1525 replaces a regular-file lock with a symlink lock or vice versa,
1526 while we're trying to read the lock.
1527 (current_lock_owner): Parse contents more carefully, to help avoid
1528 confusing a regular-file lock with some other application's use
1529 of the file. Check for lock file contents being too long, or
1530 not parsing correctly.
1531 (current_lock_owner, lock_file):
1532 Allow foreign pid and boot times that exceed the local range.
1533 (current_lock_owner, lock_if_free, lock_file):
1534 Simplify allocation of lock file contents.
1535 * w32.c (sys_rename_replace): New function, containing most of
1536 the contents of the old sys_rename.
1537 (sys_rename): Use it.
1538 (fchmod): New dummy function.
1539 * w32.h (sys_rename_replace, fchmod): New decls.
1540
1541 2013-03-05 Eli Zaretskii <eliz@gnu.org>
1542
1543 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1544 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1545 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1546 <dmantipov@yandex.ru>.
1547
1548 2013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1549
1550 * composite.c (get_composition_id, fill_gstring_header):
1551 Use make_uninit_vector where appropriate.
1552 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1553 * xselect.c (clean_local_selection_data): Likewise.
1554
1555 2013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1556
1557 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1558 * image.c (imagemagick_load_image): Calculate height and width
1559 after flattening the image, not before.
1560
1561 2013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1562
1563 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1564 * ftfont.c (ftfont_shape_by_flt): Likewise.
1565 * w32uniscribe.c (uniscribe_shape): Likewise.
1566
1567 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1568
1569 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1570 The old approach, which fell back on DIR/.#FILE.0 through
1571 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1572 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1573 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1574 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1575 because the locking mechanism was never reliable in that case).
1576 This patch fixes this and other bugs discovered by a code
1577 inspection that was prompted by
1578 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1579 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1580 to avoid interoperability problems between the MS-Windows and
1581 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1582 instances of Emacs now ignore each others' locks.
1583 * filelock.c (defined_WINDOWSNT): New constant.
1584 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1585 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1586 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1587 regular files on MS-Windows hosts.
1588 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1589 Use SAFE_ALLOCA to avoid problems with long file names.
1590 (MAX_LFINFO): Now a local constant, not a global macro.
1591 (IS_LOCK_FILE): Remove.
1592 (lock_file_1): Don't inspect errno if symlink call succeeds;
1593 that's not portable.
1594 (lock_file): Document that this function can return if lock
1595 creation fails.
1596 (lock_file): Don't access freed storage.
1597
1598 2013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1599
1600 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1601
1602 2013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1603
1604 * textprop.c: Use bool for booleans.
1605 (validate_interval_range, Fadd_text_properties)
1606 (Fremove_text_properties): Prefer bool to int when either works.
1607
1608 2013-03-02 Eli Zaretskii <eliz@gnu.org>
1609
1610 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1611 If the interval tree changes as a side effect of calling
1612 modify_region, re-do processing starting from the call to
1613 validate_interval_range. (Bug#13743)
1614
1615 2013-02-28 Eli Zaretskii <eliz@gnu.org>
1616
1617 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1618 (Bug#13546).
1619
1620 2013-02-27 Eli Zaretskii <eliz@gnu.org>
1621
1622 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1623 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1624 access to the lock file until it is written and closed.
1625 (Bug#13807)
1626
1627 2013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1628
1629 * callint.c (Qcall_interactively):
1630 * macros.c (Qexecute_kbd_macro):
1631 Now static.
1632
1633 2013-02-26 Bastien Guerry <bzg@gnu.org>
1634
1635 * window.c (Frecenter): Tiny docstring enhancement.
1636
1637 2013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1638
1639 Minor textprop integer cleanup.
1640 * intervals.h, textprop.c (add_text_properties_from_list):
1641 Return void, not int, since nobody uses the return value.
1642 * textprop.c (validate_plist, add_properties, remove_properties)
1643 (Fadd_text_properties):
1644 Don't assume list length fits in int.
1645 (interval_has_all_properties, interval_has_some_properties)
1646 (interval_has_some_properties_list, add_properties, remove_properties)
1647 (Fadd_text_properties, Fremove_text_properties)
1648 (Fremove_list_of_text_properties, text_property_stickiness):
1649 Use bool for booleans.
1650 (Fadd_text_properties, Fremove_text_properties):
1651 (Fremove_list_of_text_properties):
1652 Reindent do-while as per GNU style.
1653
1654 2013-02-25 Eli Zaretskii <eliz@gnu.org>
1655
1656 Implement CLASH_DETECTION for MS-Windows.
1657
1658 * filelock.c [WINDOWSNT]: Include w32.h.
1659 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1660 function of that name. Up-case the macro arguments.
1661 (IS_LOCK_FILE): New macro.
1662 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1663 (create_lock_file): New function, with body extracted from
1664 lock_file_1.
1665 [WINDOWSNT]: Implement lock files by writing a regular file with
1666 the lock information as its contents.
1667 (read_lock_data): New function, on Posix platforms just calls
1668 emacs_readlinkat.
1669 [WINDOWSNT]: Read the lock info from the file.
1670 (current_lock_owner): Call read_lock_data instead of calling
1671 emacs_readlinkat directly.
1672 (lock_file) [WINDOWSNT]: Run the file name through
1673 dostounix_filename.
1674
1675 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1676 just check if the process by that PID exists.
1677
1678 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1679 also present, as doing so will fail to error out if the file
1680 already exists.
1681
1682 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1683
1684 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1685 (Fremove_list_of_text_properties): Skip all of the intervals in
1686 the region between START and END that already have resp. don't
1687 have the requested properties, not just the first one.
1688 Add assertions that the loop afterwards always modifies the
1689 properties. (Bug#13743)
1690
1691 2013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1692
1693 * callint.c (Fcall_interactively): Use the right lexical environment
1694 for `interactive' specs (bug#13811).
1695 * eval.c (Feval): Accept a lexical environment.
1696
1697 2013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1698
1699 Simplify data_start configuration (Bug#13783).
1700 This is a followon simplification to the fix for Bug#13650.
1701 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1702 (START_FILES): Remove. All uses removed.
1703 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1704 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1705 (buildobj.h): Use it.
1706 ($(ALLOBJS)): Depend on globals.h.
1707 (temacs$(EXEEXT)): Use $(ALLOBJS).
1708 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1709 * deps.mk (vm-limit.o):
1710 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1711 Do not depend on mem-limits.h.
1712 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1713 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1714 [__GNUC__ && !ORDINARY_LINK]: Remove.
1715 * mem-limits.h, pre-crt0.c: Remove.
1716 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1717 * unexcoff.c (etext): New decl.
1718 (make_hdr): Use DATA_START instead of start_of_data.
1719 * vm-limit.c: Move most of mem-limits.h's contents here.
1720 (data_start): New decl. It's OK if this is approximate,
1721 so simplify-away some unnecessary exactness.
1722 (POINTER): Remove; all uses removed.
1723 (data_space_start): Now char *, to avoid casts.
1724 (exceeds_lisp_ptr): New function, replacing the old
1725 EXCEEDS_LISP_PTR macro. All uses changed.
1726 (check_memory_limits): Simplify and remove casts.
1727 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1728 (memory_warnings): Use data_start instead of start_of_data.
1729
1730 2013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1731
1732 * xdisp.c (set_message): Only check for debug-on-message if STRING
1733 is a string. (Bug#13797)
1734
1735 2013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1736
1737 Fix regression introduced by July 10 filelock.c patch.
1738 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1739 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1740 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1741 and diagnosed by Andreas Schwab in
1742 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1743
1744 2013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1745
1746 Assume C89 or better.
1747 * ralloc.c (SIZE, POINTER, NIL):
1748 * vm-limit.c (POINTER):
1749 Remove, replacing all uses with C89 equivalents. These old
1750 symbols were present only for porting to pre-C89 platforms.
1751
1752 2013-02-22 Claudio Bley <claudio.bley@gmail.com>
1753
1754 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1755 This avoids warning messages reported as part of Bug#13546.
1756
1757 2013-02-21 Ken Brown <kbrown@cornell.edu>
1758
1759 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1760
1761 2013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1762
1763 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1764
1765 * keyboard.c (Qcommand_execute): New var.
1766 (command_loop_1, read_char): Use it.
1767 (Fcommand_execute): Remove, replace by an Elisp implementation.
1768 (syms_of_keyboard): Adjust accordingly.
1769
1770 2013-02-19 Daniel Colascione <dancol@dancol.org>
1771
1772 * sheap.c (report_sheap_usage): Use message, not message1, so
1773 that we don't try to create a buffer while we're in the middle
1774 of dumping Emacs. Explain why.
1775
1776 2013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
1777
1778 * search.c (find_newline): Return byte position in bytepos.
1779 Adjust comment.
1780 (find_next_newline_no_quit, find_before_next_newline):
1781 Add bytepos argument.
1782 * lisp.h (find_newline, find_next_newline_no_quit)
1783 (find_before_next_newline): Adjust prototypes.
1784 * bidi.c (bidi_find_paragraph_start):
1785 * editfns.c (Fconstrain_to_field, Fline_end_position):
1786 * indent.c (compute_motion, vmotion):
1787 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1788 (get_visually_first_element, move_it_vertically_backward):
1789 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1790
1791 2013-02-19 Eli Zaretskii <eliz@gnu.org>
1792
1793 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1794 resources were not orderly released.
1795
1796 2013-02-17 Eli Zaretskii <eliz@gnu.org>
1797
1798 * xdisp.c (x_draw_vertical_border): For a window that is neither
1799 the leftmost nor the rightmost, redraw both the left and the right
1800 vertical borders. (Bug#13723)
1801
1802 2013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1803
1804 * xml.c (init_libxml2_functions):
1805 * sound.c (sound_warning):
1806 * sheap.c (report_sheap_usage):
1807 * process.c (wait_reading_process_output):
1808 * msdos.c (XMenuActivate):
1809 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1810 * keyboard.c (top_level_1):
1811 * editfns.c (Fmessage, Fmessage_box):
1812 * callint.c (Fcall_interactively):
1813 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1814
1815 2013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1816
1817 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
1818 * frame.c (syms_of_frame): ... to here.
1819
1820 2013-02-16 Eli Zaretskii <eliz@gnu.org>
1821
1822 * w32.c (sys_chown): Remove unused function.
1823
1824 * w32term.c <input_signal_count>: Declare 'volatile'
1825 unconditionally. (Bug#9066)
1826
1827 * w32.c (set_errno): Reset h_errno and don't set it to any other
1828 value. Set errno instead.
1829 (check_errno): Reset h_errno.
1830 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1831 (sys_gethostname, sys_getservbyname, sys_getpeername)
1832 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1833 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1834 h_errno.
1835 (sys_gethostbyname): Set h_errno only errors detected.
1836
1837 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1838
1839 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1840
1841 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1842
1843 * keyboard.c (read_char): Fix calculation of auto-save time out
1844 when auto-save-timeout is less than 4. (Bug#13720)
1845
1846 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
1847 time. Improve diagnostics in DebPrint. (Bug#13546)
1848
1849 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1850 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1851 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1852 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1853 make sure errno is set to an appropriate value. (Bug#13546)
1854 (socket_to_fd): Add assertion against indexing fd_info[] with a
1855 value that is out of bounds.
1856 (sys_accept): If fd is negative, do not set up the child_process
1857 structure for reading.
1858
1859 2013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1860
1861 * composite.c (fill_gstring_header): Remove useless prototype.
1862 Break long line.
1863 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1864 * print.c (PRINTDECLARE, print_object):
1865 * search.c (compile_pattern, fast_looking_at, search_buffer):
1866 (simple_search, boyer_moore, Freplace_match):
1867 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1868 (get_overlay_arrow_glyph_row, display_mode_element):
1869 (decode_mode_spec_coding, message3):
1870 * xfaces.c (face_at_string_position): Use bool for booleans.
1871 Adjust comments.
1872
1873 2013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1874
1875 Fix AIX port (Bug#13650).
1876 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1877 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1878 was #undeffed earlier, so it cannot be used as a macro here.
1879 Use the constant and not the macro.
1880
1881 2013-02-15 Eli Zaretskii <eliz@gnu.org>
1882
1883 * w32proc.c (new_child): If no vacant slots are found in
1884 child_procs[], make another pass looking for slots whose process
1885 has exited or died. (Bug#13546)
1886
1887 * w32.c (sys_pipe): When failing due to file descriptors above
1888 MAXDESC, set errno to EMFILE.
1889 (_sys_read_ahead): Update cp->status when failing to read serial
1890 communications input, so that the status doesn't stay at
1891 STATUS_READ_IN_PROGRESS. (Bug#13546)
1892
1893 2013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1894
1895 * gtkutil.c (tb_size_cb): New function.
1896 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1897
1898 2013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1899
1900 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1901 an event.
1902
1903 2013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1904
1905 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1906
1907 2013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1908
1909 * font.c (font_range): Add pos_byte argument. Adjust comment
1910 and break long line.
1911 * font.h (font_range): Adjust prototype.
1912 * composite.c (autocmp_chars): Pass byte position to font_range.
1913 Break long line. Remove useless prototype and format comment.
1914
1915 2013-02-13 Glenn Morris <rgm@gnu.org>
1916
1917 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1918
1919 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1920
1921 Improve AIX port some more (Bug#13650).
1922 With this, it should be as good as it was in 23.3, though it's
1923 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1924 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1925 * unexaix.c (start_of_text): Remove.
1926 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1927 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1928 (orig_load_scnptr, orig_data_scnptr):
1929 Now off_t, not long, since they are file offsets.
1930 (make_hdr): Use _data, not start_of_data ().
1931 This is the key part of the fix.
1932 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1933 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1934
1935 * pre-crt0.c (data_start): Initialize to 1.
1936 This ports to compilers that optimize the external declaration
1937 'int x = 0;' as if it were 'int x;' to shrink the executable.
1938
1939 Improve AIX port (Bug#13650).
1940 This doesn't fix the bug, but it makes progress: Emacs builds now.
1941 * unexaix.c: Include inttypes.h, stdarg.h.
1942 (report_error, report_error_1): Mark as _Noreturn.
1943 (report_error): Don't report the wrong errno.
1944 (report_error_1): Now varargs. All callers changed.
1945 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1946 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1947 (write_ptr): Use %p to print address rather than %lx and a cast
1948 to unsigned long. Grow buffer a bit, to be safer.
1949
1950 2013-02-13 Eli Zaretskii <eliz@gnu.org>
1951
1952 * bidi.c (bidi_resolve_neutral): After finding the next
1953 non-neutral character, accept NEUTRAL_ON type as well, because
1954 directional control characters, such as LRE and RLE, have their
1955 type converted to that by bidi_resolve_weak. This avoids aborts
1956 when LRE/RLE follows a run of neutrals.
1957 (bidi_move_to_visually_next): Assert that return value of
1958 bidi_peek_at_next_level is non-negative. Negative values will
1959 cause an infloop.
1960
1961 2013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1962
1963 Minor getenv-related fixes.
1964 * callproc.c (Fcall_process_region) [!DOS_NT]:
1965 Avoid unnecessary duplicate call to getenv.
1966 * callproc.c (init_callproc):
1967 * dispnew.c (init_display):
1968 * sysdep.c (sys_subshell):
1969 Omit unnecessary cast of getenv or egetenv.
1970
1971 2013-02-13 Juanma Barranquero <lekktu@gmail.com>
1972
1973 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1974 Update dependencies.
1975
1976 2013-02-12 Eli Zaretskii <eliz@gnu.org>
1977
1978 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1979 marker's position.
1980 (display_line): Set w->region_showing to the value of
1981 it->region_beg_charpos, not to -1. This fixes redisplay
1982 optimization when cursor is moved up after M->. (Bug#13623)
1983 (Bug#13626)
1984 (try_scrolling): Scroll text up more if point is too close to ZV
1985 and inside the scroll margin. This makes sure point is moved
1986 outside the scroll margin in these cases.
1987
1988 * window.h (struct window): region_showing can no longer be
1989 negative.
1990
1991 2013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1992
1993 Tune by using memchr and memrchr.
1994 * doc.c (Fsnarf_documentation):
1995 * fileio.c (Fsubstitute_in_file_name):
1996 * search.c (find_newline, scan_newline):
1997 * xdisp.c (pos_visible_p, display_count_lines):
1998 Use memchr and memrchr rather than scanning byte-by-byte.
1999 * search.c (find_newline): Rename from scan_buffer.
2000 Omit first arg TARGET, as it's always '\n'. All callers changed.
2001
2002 Clean up read_key_sequence a tiny bit more.
2003 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
2004 (read_key_sequence): Remove unused locals.
2005
2006 2013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
2007
2008 Clean up read_key_sequence a bit; reread active keymaps after first event.
2009 * keyboard.c (read_char, read_char_x_menu_prompt)
2010 (read_char_minibuf_menu_prompt):
2011 Replace nmaps+maps with a single `map' arg.
2012 (follow_key): Operate on a single map.
2013 (active_maps): New function.
2014 (test_undefined): Also return true for nil bindings.
2015 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
2016 a single (composed) keymap. Remember `first_event' to choose the right
2017 set of active keymaps. Recompute the set of keymaps after receiving
2018 the first event. Remove GOBBLE_FIRST_EVENT.
2019 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
2020 * keyboard.h (read_char): Update declaration.
2021 * lread.c (read_filtered_event): Adjust call to read_char.
2022
2023 2013-02-11 Eli Zaretskii <eliz@gnu.org>
2024
2025 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2026 Don't use the limitation on backwards movement when lines are truncated
2027 in the window. (Bug#13675)
2028
2029 2013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
2030
2031 * marker.c (set_marker_internal): If desired position is passed
2032 as a marker, avoid call to buf_charpos_to_bytepos.
2033 * window.c (Fset_window_point): Omit redundant type checking.
2034 (Fset_window_start): Likewise. Format comment.
2035 (window_scroll_pixel_based): Use set_marker_restricted_both
2036 with character and byte positions obtained from an iterator.
2037 (Fset_window_configuration): Use set_marker_restricted_both.
2038 * xdisp.c (message_dolog): Likewise.
2039
2040 2013-02-10 Eli Zaretskii <eliz@gnu.org>
2041
2042 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
2043 When text lines are longer than window's screen lines, don't move back
2044 too far. This speeds up some redisplay operations. (Bug#13675)
2045
2046 2013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
2047
2048 * syntax.c (scan_sexps_forward): Fix byte position calculation
2049 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
2050
2051 2013-02-10 Paul Eggert <eggert@cs.ucla.edu>
2052
2053 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
2054 that was not needed.
2055
2056 2013-02-09 Paul Eggert <eggert@cs.ucla.edu>
2057
2058 Minor hashing refactoring.
2059 * fns.c (SXHASH_REDUCE): Move to lisp.h.
2060 (sxhash_float): Return EMACS_UINT, for consistency with the other
2061 hash functions.
2062 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
2063 non-static inline function and therefore can't use static vars.
2064 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
2065 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
2066 with the other hash functions.
2067
2068 2013-02-09 Eli Zaretskii <eliz@gnu.org>
2069
2070 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
2071 XXXXXX part of the temporary file pattern is not downcased even
2072 when w32-downcase-file-names is non-nil. (Bug#13661)
2073
2074 * xdisp.c (decode_mode_spec): Remove handling of %t.
2075
2076 * msdos.c (careadlinkatcwd): Remove.
2077
2078 2013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
2079
2080 * lread.c (skip_dyn_bytes): New function (bug#12598).
2081 (read1): Use it. Use getc instead of READCHAR to read bytes.
2082 (load_each_byte): Remove. Update users.
2083
2084 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2085
2086 * search.c (scan_buffer): Calculate end byte position just once.
2087 (scan_newline): Do not recalculate start_byte.
2088 (search_command): Use eassert.
2089 * syntax.c (struct lisp_parse_state): New member location_byte.
2090 (scan_sexps_forward): Record from_byte and avoid redundant
2091 character to byte position calculation ...
2092 (Fparse_partial_sexp): ... here. Break too long line.
2093
2094 2013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
2095
2096 * lisp.h (make_uninit_vector): New function.
2097 * alloc.c (Fvector, Fmake_byte_code):
2098 * ccl.c (Fregister_ccl_program):
2099 * charset.c (Fdefine_charset_internal, define_charset_internal):
2100 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
2101 * composite.c (syms_of_composite):
2102 * font.c (Fquery_font, Ffont_info, syms_of_font):
2103 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
2104 * ftfont.c (ftfont_shape_by_flt):
2105 * indent.c (recompute_width_table):
2106 * nsselect.m (clean_local_selection_data):
2107 * syntax.c (init_syntax_once):
2108 * w32unsubscribe.c (uniscribe_shape):
2109 * window.c (Fcurrent_window_configuration):
2110 * xfaces.c (Fx_family_fonts):
2111 * xselect.c (selection_data_to_lisp_data): Use it.
2112
2113 2013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
2114
2115 * coding.c (Fdefine_coding_system_internal): Use AREF where
2116 argument is known to be a vector.
2117 * fns.c (Flocale_info): Likewise for ASET.
2118 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
2119 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
2120
2121 2013-02-05 Jan Djärv <jan.h.d@swipnet.se>
2122
2123 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
2124 height.
2125
2126 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
2127 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
2128 updateCollectionBehaviour.
2129
2130 * nsterm.m (NEW_STYLE_FS): Remove.
2131 (ns_last_use_native_fullscreen): New variable.
2132 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
2133 (x_set_window_size): Do not take title bar and tool bar into account
2134 if isFullscreen returns YES.
2135 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
2136 (check_native_fs): New function.
2137 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
2138 (ns_term_init): Remove NEW_STYLE_FS.
2139 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
2140 and tool bar if isFullscreen returns NO.
2141 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
2142 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
2143 with HAVE_NATIVE_FS.
2144 (window:willUseFullScreenPresentationOptions:): New method.
2145 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2146 Hide toolbar if not enabled (Bug#13444).
2147 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2148 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2149 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2150 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2151 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2152 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2153 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2154 (syms_of_nsterm): Add ns-use-native-fullscreen.
2155
2156 2013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2157
2158 * fileio.c (Qchoose_write_coding_system): Now static.
2159
2160 2013-02-04 Eli Zaretskii <eliz@gnu.org>
2161
2162 * xdisp.c (window_buffer_changed): region_showing can be negative,
2163 which still means region is being displayed.
2164 (redisplay_internal): Resurrect code that forced redisplay of the
2165 whole window when showing region and the mark has changed.
2166 Record the new mark position to allow redisplay optimizations.
2167 (display_line): If it->region_beg_charpos is non-zero, set the
2168 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2169
2170 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2171 not bitfield of 1 bit.
2172
2173 2013-02-03 Daniel Colascione <dancol@dancol.org>
2174
2175 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2176 daemon mode works on cygw32 when Emacs is installed and not just
2177 during development.
2178
2179 2013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2180
2181 Avoid file time stamp bug on MS-Windows (Bug#13149).
2182 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2183 as FAT32 doesn't update time stamps when truncating them.
2184 Also, check that a file time stamp is not a multiple of 100 ns;
2185 this should catch all instances of the problem on MS-Windows,
2186 as its native file system resolution is 100 ns or worse, and
2187 checking for a non-multiple of 100 ns should impose only a small
2188 overhead on systems with ns resolution.
2189
2190 2013-02-02 Eli Zaretskii <eliz@gnu.org>
2191
2192 Avoid encoding file names on MS-Windows when they need to be run
2193 through dostounix_filename.
2194 * w32.c (normalize_filename): Accept an additional argument
2195 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2196 downcase it even if w32-downcase-file-names is non-nil.
2197 (dostounix_filename): Accept an additional argument MULTIBYTE and
2198 pass it to normalize_filename.
2199 (emacs_root_dir): Adjust.
2200
2201 * msdos.h (dostounix_filename): Adjust prototype.
2202
2203 * w32.h (dostounix_filename): Adjust prototype.
2204
2205 * msdos.c (dostounix_filename): Accept an additional argument and
2206 ignore it.
2207 (init_environment): Adjust callers of dostounix_filename.
2208
2209 * fileio.c (Ffile_name_directory, file_name_as_directory)
2210 (directory_file_name, Fexpand_file_name)
2211 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2212 dostounix_filename.
2213 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2214 non-nil.
2215 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2216 variables, as egetenv is case-insensitive for DOS_NT.
2217
2218 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2219 with an encoded file name.
2220
2221 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2222 Adjust calls to dostounix_filename.
2223
2224 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2225
2226 * unexw32.c (unexec): Adjust call to dostounix_filename.
2227
2228 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2229
2230 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2231 dostounix_filename.
2232
2233 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2234 dostounix_filename.
2235
2236 * callproc.c (Fcall_process): Make sure program name in PATH and
2237 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2238 is passed to exec/spawnve, which fails unless the file-name
2239 encoding is UTF-8.
2240
2241 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2242 even if w32-quote-process-args is nil.
2243
2244 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2245
2246 Fix timestamp bug when write-region appends nothing (Bug#13149).
2247 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2248 the file's time stamp doesn't change if Emacs happens to write nothing
2249 to the file, and on a buggy file system this could cause Emacs to
2250 incorrectly infer that the file system doesn't have the bug.
2251 Avoid this problem by inhibiting the inference in this case.
2252
2253 2013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2254
2255 * window.h (struct window): Convert base_line_number, base_line_pos
2256 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2257 Convert region_showing member from Lisp_Object to bitfield.
2258 Remove sequence_number member. Adjust comments.
2259 * window.c (sequence_number): Remove.
2260 (make_window): Initialize column_number_displayed.
2261 * print.c (print_object): Follow the printed representation of
2262 frames and print window pointer to distinguish between windows.
2263 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2264 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2265 (wset_column_number_displayed, wset_region_showing): Remove.
2266 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2267 (try_scrolling, try_cursor_movement, redisplay_window)
2268 (try_window_reusing_current_matrix, try_window_id, display_line)
2269 (display_mode_lines, decode_mode_spec): Adjust users.
2270 * .gdbinit (pwinx): Do not print sequence_number.
2271
2272 2013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2273
2274 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2275 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2276 * dired.c: Include <fcntl.h>.
2277 (open_directory): New function, which uses open and fdopendir
2278 rather than opendir. DOS_NT platforms still use opendir, though.
2279 (directory_files_internal, file_name_completion): Use it.
2280 (file_attributes): New function, with most of the old Ffile_attributes.
2281 (directory_files_internal, Ffile_attributes): Use it.
2282 (file_attributes, file_name_completion_stat): First arg is now fd,
2283 not dir name. All uses changed. Use fstatat rather than lstat +
2284 stat.
2285 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2286 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2287 (emacs_readlinkat): New function, with much of the old
2288 Ffile_symlink_p, but with an fd argument for speed.
2289 It uses readlinkat rather than careadlinkatcwd, so that it
2290 need not assume the working directory.
2291 (Ffile_symlink_p): Use it.
2292 * filelock.c (current_lock_owner): Use emacs_readlinkat
2293 rather than emacs_readlink.
2294 * lisp.h (emacs_readlinkat): New decl.
2295 (READLINK_BUFSIZE, emacs_readlink): Remove.
2296 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2297 (emacs_norealloc_allocator, emacs_readlink): Remove.
2298 This stuff is moved to fileio.c.
2299 * w32.c (fstatat, readlinkat): New functions.
2300 (careadlinkat): Don't check that fd == AT_FDCWD.
2301 (careadlinkatcwd): Remove; no longer needed.
2302
2303 2013-01-31 Glenn Morris <rgm@gnu.org>
2304
2305 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
2306 (Fwrite_region): Update for new choose_write_coding_system args.
2307 Move the last piece of choose_write_coding_system here. (Bug#13522)
2308 (syms_of_fileio): Add choose-write-coding-system.
2309
2310 2013-01-30 Eli Zaretskii <eliz@gnu.org>
2311
2312 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2313 (sys_close): Zero out the flags for the file descriptor before
2314 closing it. (Bug#13546)
2315
2316 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
2317 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2318 Use CharNextExA and CharPrevExA to iterate over file names encoded in
2319 DBCS. (Bug#13553)
2320
2321 * w32.c (w32_get_long_filename, init_environment, readlink):
2322 Support file names encoded in DBCS codepages.
2323 (readlink): Use the current file-name-coding-system, not the ANSI
2324 codepage, to decode and handle targets of symlinks.
2325
2326 2013-01-28 Eli Zaretskii <eliz@gnu.org>
2327
2328 * w32.c (opendir): Now accepts a 'const char *'.
2329
2330 2013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2331
2332 Remove obsolete redisplay code. See the discussion at
2333 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2334 * dispnew.c (preemption_period, preemption_next_check): Remove.
2335 (Vredisplay_preemption_period): Likewise.
2336 (update_frame, update_single_window, update_window, update_frame_1):
2337 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2338 used, following the 2012-06-22 change.
2339
2340 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2341
2342 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2343
2344 2013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2345
2346 * font.c (num_fonts): Remove the leftover from old
2347 debugging code. Adjust comment style here and there.
2348 * insdel.c (insert_1): Remove.
2349 * lisp.h (insert_1): Remove prototype.
2350 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
2351
2352 2013-01-25 Eli Zaretskii <eliz@gnu.org>
2353
2354 * w32.c (max_filename_mbslen): New function.
2355 (normalize_filename, readdir): Use it to detect locales where ANSI
2356 encoding of file names uses a double-byte character set (DBCS).
2357 If a DBCS encoding is used, advance by characters using
2358 CharNextExA, instead of incrementing a 'char *' pointer.
2359 Use _mbslwr instead of _strlwr. (Bug#13515)
2360
2361 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2362 request of memory reservation to 1.7GB. (Bug#13065)
2363
2364 2013-01-25 Andreas Schwab <schwab@linux-m68k.org>
2365
2366 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2367 at check_extra_latin label. (Bug#13505)
2368
2369 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2370
2371 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2372 Avoid redundant calls to strlen.
2373
2374 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2375
2376 Drop async_visible and async_iconified fields of struct frame.
2377 This is possible because async input is gone; for details, see
2378 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2379 * frame.h (struct frame): Remove async_visible and async_iconified
2380 members, convert garbaged to unsigned bitfield. Adjust comments.
2381 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2382 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2383 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2384 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2385 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2386 * w32term.c: Ditto.
2387 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2388 properly. Likewise for obscured.
2389 * xterm.c: Ditto.
2390 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
2391 properly.
2392 * nsterm.m: Ditto.
2393 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2394
2395 2013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2396
2397 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2398 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2399
2400 2013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2401
2402 * xdisp.c (message2, message2_nolog): Remove functions.
2403 (message3, message3_nolog): Extract nbytes and multibyteness directly
2404 from the string. Change all callers.
2405 (message3_nolog): Don't set message_enable_multibyte since set_message
2406 will reset it anyway.
2407 (message1, message1_nolog): Use message3.
2408 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2409 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2410 (set_message): Drop all but the second arg, which has to be a string.
2411 (set_message_1): Simplify now that we know that a1 is NULL and the
2412 second arg is a string.
2413 * frame.h (struct frame): Remove `message_buf' field.
2414 Use glyphs_initialized_p instead.
2415 (FRAME_MESSAGE_BUF): Remove macro.
2416 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2417 * lisp.h (message2, message2_nolog): Remove declarations.
2418 (message3, message3_nolog): Update declarations.
2419 * keyboard.c (read_char_minibuf_menu_text)
2420 (read_char_minibuf_menu_width): Remove vars.
2421 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2422 to correctly handle multibyte strings.
2423 * frame.c (delete_frame): Don't free message_buf any more.
2424 * editfns.c (message_text, message_length): Remove vars.
2425 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2426 * fileio.c (auto_save_error): Use message3 instead of message2.
2427 * dispnew.c (adjust_frame_message_buffer): Remove function.
2428
2429 2013-01-23 Eli Zaretskii <eliz@gnu.org>
2430
2431 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2432 real estate used for the tool bar and the menu bar.
2433
2434 2013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2435
2436 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2437 hidden buffer is prepared to modification (Bug#13164).
2438
2439 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2440
2441 * window.h (struct window): Change window_end_valid member from
2442 Lisp_Object to a bitfield. Adjust comments.
2443 (wset_window_end_valid): Remove.
2444 * window.c (adjust_window_count): Clear window_end_valid.
2445 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2446 (Fwindow_line_height, set_window_buffer, Frecenter)
2447 (Fsplit_window_internal, Fdelete_other_windows_internal)
2448 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2449 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2450 * xdisp.c (check_window_end, reconsider_clip_changes)
2451 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2452 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2453 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2454
2455 2013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2456
2457 * xdisp.c (mark_window_display_accurate): Simplify the loop
2458 assuming that the only one of vchild, hchild or buffer window
2459 slots is non-nil. Call mark_window_display_accurate_1 for
2460 the leaf windows only.
2461 (mark_window_display_accurate_1): Always assume leaf window.
2462 Adjust comment.
2463
2464 2013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2465
2466 * emacs.c (Qkill_emacs_hook): Now static.
2467
2468 * fileio.c (Finsert_file_contents): Simplify.
2469 Remove unnecessary assignments and tests.
2470
2471 2013-01-21 Eli Zaretskii <eliz@gnu.org>
2472
2473 * w32.c (acl_set_file): Don't test for errors unless
2474 set_file_security returns FALSE. Avoids spurious errors when
2475 saving files.
2476
2477 2013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2478
2479 * fileio.c (Finsert_file_contents): Revert code introduced at
2480 2013-01-18 in favor of the simpler and generally better fix.
2481 Save stack space by removing 'buffer' and reusing 'read_buf'
2482 where appropriate.
2483
2484 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2485
2486 * lisp.h (eabs): Define unconditionally (Bug#13419).
2487 The old "#if !defined (eabs)" was an unnecessary revenant of back
2488 when this macro was called "abs". Document 'eabs' better.
2489
2490 2013-01-19 Glenn Morris <rgm@gnu.org>
2491
2492 * fns.c (Frandom): Doc fix.
2493
2494 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2495
2496 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2497 segfault when there are lots of overlays.
2498
2499 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
2500 when there are lots of overlays.
2501 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
2502 for the details and a way to reproduce.
2503
2504 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2505
2506 * fileio.c: Use O_APPEND to append.
2507 This corresponds better to the natural interpretation of "append",
2508 and avoids the need to open the output file twice, or to invoke
2509 lseek when APPEND is neither nil nor a number.
2510 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2511 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2512 file possibly twice, and lseeking to its end; this avoids the
2513 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2514 at the same time: the combination is never needed and apparently
2515 it doesn't work with DOS_NT.
2516
2517 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2518 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2519
2520 Allow floating-point file offsets.
2521 Problem reported by Vitalie Spinu in
2522 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2523 * fileio.c (emacs_lseek): Remove.
2524 (file_offset): New function.
2525 (Finsert_file_contents, Fwrite_region): Use it.
2526
2527 2013-01-19 Chong Yidong <cyd@gnu.org>
2528
2529 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2530 aborting on Fsignal (Bug#13289).
2531
2532 2013-01-19 Eli Zaretskii <eliz@gnu.org>
2533
2534 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2535 set_file_security as failure due to insufficient privileges.
2536 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2537 (fstat): Return owner and group like 'stat' and 'lstat' do.
2538
2539 2013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2540
2541 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2542 The bug was observed on Ubuntu operating inside a virtual machine,
2543 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2544 The workaround introduces a race condition on non-buggy hosts,
2545 but it's an unlikely race and anyway there's a nearly identical
2546 nearby race that can't be fixed.
2547 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2548 New static vars.
2549 (Fwrite_region): Test for file system time stamp bug.
2550 (init_fileio): New function.
2551 * lisp.h (init_fileio): Declare it.
2552 * emacs.c (main): Call it.
2553
2554 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2555 and make it more consistent with other stat-failure diagnostics.
2556
2557 2013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2558
2559 Fix crash when inserting data from non-regular files.
2560 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
2561 for the error description produced by valgrind.
2562 * fileio.c (read_non_regular): Rename to read_contents.
2563 Free Lisp_Save_Value object used to pass parameters.
2564 (read_non_regular_quit): Rename to read_contents_quit.
2565 (Finsert_file_contents): Redesign internal file reading loop to adjust
2566 gap and end positions after each read and so help make_gap to work
2567 properly. Do not signal an I/O error too early and so do not leave
2568 not yet decoded characters in a buffer, which was the reason of
2569 redisplay crash. Use list2 to build return value. Adjust comments.
2570
2571 2013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2572
2573 Close a race when statting and reading files (Bug#13149).
2574 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2575 This avoids a race if the file is renamed between stat and open.
2576 This race is not the problem originally noted in Bug#13149;
2577 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2578
2579 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2580
2581 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2582 objects, related functions and macros.
2583 (make_save_value): Adjust prototype.
2584 (make_save_pointer): New prototype.
2585 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2586 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2587 * alloc.c (format_save_value): Rename to make_save_value.
2588 (make_save_pointer): New function.
2589 (record_xmalloc): Use make_save_pointer.
2590 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2591 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2592 Change users of make_save_value to make_save_pointer.
2593 Likewise for format_save_value and make_save_value.
2594
2595 2013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2596
2597 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2598 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2599 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2600 debugging stubs.
2601
2602 2013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2603
2604 * alloc.c (free_save_value): Now static.
2605
2606 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2607
2608 * keymap.c (map_keymap_internal): Use format_save_value.
2609 (map_keymap_char_table_item): Adjust accordingly.
2610 * fileio.c (non_regular_fd, non_regular_inserted)
2611 (non_regular_nbytes): Remove.
2612 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2613 Use format_save_value to pass parameters to read_non_regular.
2614 (read_non_regular): Use XSAVE_ macros to extract parameters.
2615 Adjust comment.
2616 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2617 format_save_value.
2618 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2619
2620 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2621
2622 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2623 extraction from any Lisp_Save_Value slot. Add type checking.
2624 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2625 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2626 * xselect.c: All users changed.
2627
2628 2013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2629
2630 Some convenient bits to deal with Lisp_Save_Values.
2631 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2632 (allocate_misc): Remove prototype.
2633 (format_save_value): New prototype.
2634 * alloc.c (allocate_misc): Revert back to static.
2635 (format_save_value): New function to build Lisp_Save_Value
2636 object with the specified internal structure.
2637 (make_save_value): Reimplement using format_save_value.
2638 * editfns.c (save_excursion_save): Use format_save_value.
2639 (save_excursion_restore): Use XSAVE_OBJECT.
2640
2641 2013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2642
2643 Avoid needless casts with XSAVE_POINTER.
2644 * alloc.c (mark_object) [GC_MARK_STACK]:
2645 * dired.c (directory_files_internal_unwind):
2646 * fileio.c (do_auto_save_unwind):
2647 * gtkutil.c (pop_down_dialog):
2648 * keymap.c (map_keymap_char_table_item):
2649 * lread.c (load_unwind):
2650 * nsmenu.m (pop_down_menu):
2651 * print.c (print_object) [GC_MARK_STACK]:
2652 * xfns.c (clean_up_file_dialog):
2653 * xmenu.c (cleanup_widget_value_tree):
2654 Omit casts between XSAVE_POINTER and a pointer type.
2655
2656 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2657
2658 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2659 * eval.c (eval_sub): Protect `form' from being GCed before its
2660 car and cdr becomes protected with the backtrace entry.
2661
2662 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2663
2664 Make Lisp_Save_Value more versatile storage for up to four objects.
2665 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2666 (struct Lisp_Save_Value): New layout. Adjust comments.
2667 (XSAVE_POINTER): New macro.
2668 (XSAVE_INTEGER): Likewise.
2669 (allocate_misc): Add prototype.
2670 (free_misc): Likewise.
2671 * alloc.c (allocate_misc): Now global.
2672 (free_misc): Likewise. Adjust comment.
2673 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2674 (free_save_value): Likewise.
2675 (mark_object): Likewise.
2676 * editfns.c (save_excursion_save): Pack everything within
2677 Lisp_Save_Value and so avoid xmalloc.
2678 (save_excursion_restore): Adjust to match new layout. Use free_misc
2679 because we do not allocate extra memory any more. Add eassert.
2680 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2681 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2682 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2683 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2684 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2685
2686 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2687
2688 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2689 (nsfont_draw): Remove disabling of LCD smoothing.
2690 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2691 Bug#11484 with LCD smoothing on.
2692
2693 2013-01-13 Paul Eggert <eggert@cs.ucla.edu>
2694
2695 Fix SIGDANGER handlers, for AIX (Bug#13408).
2696 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2697 Move handlers here from emacs.c; they were out of place.
2698
2699 2013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2700
2701 * xterm.c (syms_of_xterm): Adjust documentation for
2702 scroll-bar-adjust-thumb-portion.
2703
2704 2012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
2705
2706 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2707 determine whether scroll bar thumb size should be adjusted or
2708 not. Use variable for MOTIF.
2709
2710 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2711 GTK.
2712
2713 2013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2714
2715 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2716 event is generated.
2717 (doCommandBySelector:): Set processingCompose to NO.
2718
2719 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2720 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2721 (nsfont_list_family): Add block/unblock_input calls.
2722 (nsfont_open): Move block_input earlier. Add unblock_input before early
2723 return.
2724 (nsfont_draw): Add block/unblock_input calls.
2725
2726 2013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2727
2728 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2729 for old_charpos and old_bytepos.
2730
2731 2013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2732
2733 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2734 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2735 Clear tzvalbuf_in_environ if this workaround is in effect.
2736 Problem and fix reported by Kazuhiro Ito.
2737
2738 2013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2739
2740 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2741 Fix ambiguous doc string cross-reference(s).
2742
2743 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2744 doc string cross-reference(s).
2745
2746 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2747 string cross-reference(s).
2748
2749 2013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2750
2751 Avoid unnecessary byte position calculation for the gap movement.
2752 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2753 anyway, all of them should use move_gap_both instead.
2754 * lisp.h (move_gap): Remove prototype.
2755 * insdel.c (move_gap): Remove.
2756 (move_gap_both): Add eassert.
2757 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2758 * xml.c (parse_region): Likewise.
2759
2760 2013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2761
2762 emacsclient -t should not suspend Emacs server (Bug#13387)
2763 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2764 New functions.
2765 * term.c (init_tty): Use them instead of rolling our own code.
2766 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2767 switches from 'signal' to 'pthread_sigmask', which is safer in
2768 multithreaded applications.
2769 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2770 which has already arranged for that.
2771 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2772 This is the main part of the bug fix.
2773
2774 2013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
2775
2776 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2777 x_last_font_name (Bug#13403).
2778
2779 2013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2780
2781 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2782 the type of per-buffer values where appropriate.
2783 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2784 predicate, which is how it's really used now. Adjust comment.
2785 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2786 * buffer.c (buffer_slot_type_mismatch): Remove.
2787 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2788 predicate. Adjust comment.
2789 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2790 fill-column, left-margin, tab-width, buffer-saved-size,
2791 left-margin-width, right-margin-width, left-fringe-width,
2792 right-fringe-width, scroll-bar-width and buffer-display-count.
2793 Use Qstringp for default-directory, buffer-file-name,
2794 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2795 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2796 line-spacing.
2797 * data.c (store_symval_forwarding): Adjust to call the predicate.
2798
2799 2013-01-09 Juanma Barranquero <lekktu@gmail.com>
2800
2801 * w32.c (get_name_and_id, acl_set_file):
2802 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2803
2804 2013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2805
2806 * lisp.h (make_gap_1): New prototype.
2807 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2808 gap size values.
2809 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2810 naming convention.
2811 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2812 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
2813 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2814 (make_gap_1): New function to adjust the gap of any buffer.
2815 * coding.c (coding_alloc_by_making_gap): Use it.
2816 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2817 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2818
2819 2013-01-08 Juri Linkov <juri@jurta.org>
2820
2821 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2822 of (supports :underline (:style wave)). (Bug#13000)
2823
2824 2013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2825
2826 * undo.c (Fprimitive_undo): Move to simple.el.
2827 (syms_of_undo): Remove declarations for Sprimitive_undo.
2828
2829 2013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2830
2831 * keyboard.c (echo_add_key): Rename from echo_add_char.
2832
2833 2013-01-06 Chong Yidong <cyd@gnu.org>
2834
2835 * keyboard.c (echo_add_char): New function, factored out from
2836 echo_char. Don't add a space if the previous echo string was
2837 empty (Bug#13255).
2838 (echo_char): Use it.
2839 (read_key_sequence): When echoing mock input, ensure that the
2840 trailing dash is properly added.
2841
2842 2013-01-05 Eli Zaretskii <eliz@gnu.org>
2843
2844 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2845 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
2846 digits for buffer positions, before misalignment starts.
2847 Display "0" for integer "object" field.
2848 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2849 Display the newline glyph more unambiguously.
2850
2851 2013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2852
2853 * nsterm.m (ns_draw_underwave):
2854 * w32term.c (w32_draw_underwave):
2855 * xterm.c (x_draw_underwave): Make underwave look more triangular
2856 and also degrade gracefully for small fonts. (Bug#13000)
2857
2858 * nsterm.m (ns_draw_text_decoration):
2859 * w32term.c (x_draw_glyph_string):
2860 * xterm.c (x_draw_glyph_string): Don't use previous underline
2861 thickness and position if previous underline type is underwave.
2862
2863 2013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2864
2865 * fileio.c (Ffile_acl): Undocument return format.
2866
2867 2013-01-02 Glenn Morris <rgm@gnu.org>
2868
2869 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2870
2871 2013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2872
2873 Simplify via eabs.
2874 * dired.c (file_name_completion):
2875 * doc.c (get_doc_string):
2876 * floatfns.c (round2):
2877 * font.c (font_score, font_delete_unmatched):
2878 * fringe.c (compute_fringe_widths):
2879 * lread.c (read_list):
2880 * minibuf.c (Ftry_completion):
2881 * term.c (tty_ins_del_lines):
2882 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2883 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2884
2885 2012-12-31 Eli Zaretskii <eliz@gnu.org>
2886
2887 * w32.c (unsetenv): Set up the string passed to _putenv
2888 correctly.
2889 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
2890 for the bug this caused.
2891
2892 2012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2893
2894 * coding.c (Qmac): Now static.
2895
2896 2012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2897
2898 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2899 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2900 handlebox_widget. Set toolbar_in_hbox to false/true, set
2901 toolbar_is_packed to true.
2902 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2903 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2904 Show all on TOOLBAR_TOP_WIDGET.
2905 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2906 by TOOLBAR_TOP_WIDGET.
2907 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2908 Check toolbar_is_packed.
2909 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2910 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2911 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2912 false.
2913 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2914 (xg_update_menubar): Update title only if
2915 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2916 (xg_update_submenu): Skip tearoff only if
2917 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2918 (xg_initialize): Initialize xg_detached_menus only if
2919 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2920
2921 * xterm.h (struct x_output): Surround handlebox_widget with
2922 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2923 toolbar_in_hbox is bool.
2924
2925 2012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2926
2927 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2928 (LIBS_GNUSTEP): Define.
2929 (LIBES): Add $(LIBS_GNUSTEP).
2930 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2931
2932 2012-12-30 Eli Zaretskii <eliz@gnu.org>
2933
2934 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2935 continuation glyph on a TTY with an indication of an empty line.
2936 (Bug#13277)
2937
2938 2012-12-29 Eli Zaretskii <eliz@gnu.org>
2939
2940 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2941 file's SELinux context or ACLs successfully set, nil otherwise.
2942 (Bug#13298)
2943 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
2944
2945 * w32proc.c (reader_thread): Avoid passing NULL handles to
2946 SetEvent and WaitForSingleObject.
2947
2948 2012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2949
2950 Port EXTERNALLY_VISIBLE to Clang 3.2.
2951 * conf_post.h (__has_attribute): New macro.
2952 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2953
2954 2012-12-27 Glenn Morris <rgm@gnu.org>
2955
2956 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2957 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2958
2959 2012-12-27 Eli Zaretskii <eliz@gnu.org>
2960
2961 * fileio.c (file_name_as_directory, directory_file_name):
2962 Accept an additional argument MULTIBYTE to indicate whether the input C
2963 came from a multibyte or a unibyte Lisp string; all callers
2964 adjusted. Don't assume the input string is always multibyte.
2965 (Bug#13262)
2966 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2967 don't ENCODE_FILE them, and return a unibyte string if the input
2968 was unibyte.
2969 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2970 don't assume the input strings will always be multibyte. If the
2971 input strings are multibyte, decode strings obtained from C
2972 library functions.
2973
2974 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2975
2976 * lisp.h (toplevel): Add two notices to the comment about
2977 defining a new Lisp data type.
2978 * print.c (print_object): If Lisp_Save_Value object's pointer
2979 is the address of a memory area containing Lisp_Objects, try
2980 to print them.
2981 * alloc.c (valid_lisp_object_p): Adjust comment.
2982
2983 2012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2984
2985 * keyboard.c (record_asynch_buffer_change): Initialize an event
2986 only if it's really needed.
2987 * frame.h (enum output_method): Remove output_mac member since
2988 it's a leftover from the deleted code.
2989 * frame.c (Fframep): Adjust user here ...
2990 * terminal.c (Fterminal_live_p): ... and here.
2991 * coding.c (Qmac): Now here because it's only used to denote
2992 end-of-line encoding type.
2993 (syms_of_coding): DEFSYM it.
2994 * frame.h (Qmac): Remove duplicated declaration.
2995
2996 2012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2997
2998 * window.c (select_window_1): Now static, since it's used only here.
2999
3000 2012-12-25 Eli Zaretskii <eliz@gnu.org>
3001
3002 * window.c (window_body_cols): Subtract display margins from the
3003 window body width on TTYs as well. See
3004 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
3005 for the original report.
3006
3007 2012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
3008
3009 * xdisp.c (redisplay_window): Remove inner local variable
3010 because the outer shadowed one has the same meaning.
3011 * xterm.h (struct x_output): Remove toolbar_detached member since it's
3012 set but never used.
3013 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
3014 (xg_create_tool_bar): Adjust users.
3015
3016 2012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
3017
3018 * buffer.h (BUF_COMPACT): New macro to follow the common style.
3019 * buffer.c (Fget_buffer_create): Use it to set compact field of
3020 struct buffer_text to avoid accessing an uninitialized value
3021 when compact_buffer is called for the first time.
3022 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
3023 (Fset_buffer_modified_p): Use buffer_window_count to check
3024 whether the buffer is displayed in some window.
3025 * xdisp.c (message_dolog): Likewise.
3026
3027 2012-12-23 Eli Zaretskii <eliz@gnu.org>
3028
3029 * w32.c (acl_set_file): If setting the file security descriptor
3030 fails, and the new DACL is identical to the existing one, silently
3031 return success. This fixes problems for users backing up their
3032 own files without having the necessary privileges for setting
3033 security descriptors.
3034
3035 * w32proc.c (reader_thread): Do not index fd_info[] with negative
3036 values.
3037 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
3038 after WaitForSingleObject returns normally. This expedites reader
3039 thread shutdown when delete_child triggers it.
3040 (reap_subprocess): More accurate commentary for why we call
3041 delete_child only when cp->fd is negative.
3042
3043 * w32.c (sys_close): Do not call delete_child on a subprocess
3044 whose handle is not yet closed. Instead, set its file descriptor
3045 to a negative value, so that reap_subprocess will call
3046 delete_child on that subprocess when its SIGCHLD arrives.
3047 This avoids closing handles used for communications between sys_select
3048 and reader_thread, which doesn't give sys_select a chance to
3049 notice that the process exited and invoke the SIGCHLD handler for
3050 it.
3051
3052 2012-12-23 Jan Djärv <jan.h.d@swipnet.se>
3053
3054 * nsfns.m (Fns_do_applescript): Run event loop until script has
3055 been executed (Bug#12969).
3056 (ns_run_ascript): Chech as_script for nil, set to nil after
3057 executing script.
3058
3059 2012-12-22 Martin Rudalics <rudalics@gmx.at>
3060
3061 * window.c (Fselect_window): Reword doc-string (Bug#13248).
3062
3063 2012-12-22 Eli Zaretskii <eliz@gnu.org>
3064
3065 * w32term.c (w32fullscreen_hook): New function.
3066 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
3067
3068 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3069
3070 * fileio.c (Finsert_file_contents): Doc fix.
3071
3072 * w32proc.c (new_child, delete_child, find_child_pid): For a
3073 subprocess, consider its slot being in use as long as its process
3074 handle (procinfo.hProcess) is not NULL. This avoids reusing the
3075 slot when a new process is started immediately after killing
3076 another one, without waiting enough time for the first process to
3077 be reaped and resources allocated for it be orderly freed.
3078 (Bug#13086)
3079 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
3080
3081 2012-12-21 Chong Yidong <cyd@gnu.org>
3082
3083 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
3084
3085 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
3086
3087 2012-12-21 Eli Zaretskii <eliz@gnu.org>
3088
3089 * w32.c (get_name_and_id): Always pass NULL as the first argument
3090 of lookup_account_sid. Avoids crashes with UNC file names that
3091 refer to DFS domains, not to specific machine names. (Bug#12621)
3092 Remove now unused argument FNAME; all callers changed.
3093 (get_file_owner_and_group): Remove now unused argument FNAME; all
3094 callers changed.
3095
3096 2012-12-21 Chong Yidong <cyd@gnu.org>
3097
3098 * editfns.c (Finsert_char): Since read-char-by-name now signals an
3099 error for invalid chars, don't check for a nil return value.
3100
3101 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3102
3103 Avoid calls to CHAR_TO_BYTE if byte position is known.
3104 * editfns.c (make_buffer_string_both): Use move_gap_both.
3105 (Fbuffer_string): Use make_buffer_string_both.
3106 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
3107 Adjust comment.
3108 (buf_bytepos_to_charpos): Likewise.
3109 (charpos_to_bytepos): Remove.
3110 * fileio.c (Finsert_file_contents): Use move_gap_both.
3111 * search.c (Freplace_match): Likewise.
3112 * process.c (process_send_region): Likewise. Use convenient
3113 names for byte positions.
3114 * lisp.h (charpos_to_bytepos): Remove prototype.
3115 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
3116 * insdel.c (move_gap): Likewise.
3117
3118 2012-12-20 Paul Eggert <eggert@cs.ucla.edu>
3119
3120 * xdisp.c (redisplay_internal): Remove now-unused local.
3121
3122 2012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
3123
3124 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
3125 (redisplay_internal): Don't bother selecting the frame to get the
3126 proper value of frame-local variables (bug#13225).
3127
3128 2012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
3129
3130 * textprop.c (set_text_properties_1): Do not allow NULL interval.
3131 Rename 4th argument since it may be buffer or string. Adjust comment.
3132 * intervals.c (graft_intervals_info_buffer): Find an interval here.
3133
3134 2012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
3135
3136 * coding.c (Fdetect_coding_region): Do not check start and end with
3137 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
3138 (code_convert_region): Likewise.
3139
3140 2012-12-18 Eli Zaretskii <eliz@gnu.org>
3141
3142 * w32.c (acl_get_file, acl_set_file): Run the file name through
3143 map_w32_filename, and resolve any symlinks in the file name, like
3144 Posix platforms do.
3145 (acl_set_file): Call revert_to_self, if any privileges were
3146 enabled.
3147
3148 2012-12-17 Juanma Barranquero <lekktu@gmail.com>
3149
3150 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3151 ($(BLD)/w32.$(O)): Update dependencies.
3152
3153 2012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3154
3155 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3156 propagate redisplay's scrolling (if any) to the right window.
3157 (redisplay_internal): Use ensure_selected_frame.
3158 (display_mode_lines): Complete last fix.
3159 * window.c (select_window_1): New func, extracted from select_window.
3160 (select_window): Use it.
3161 * window.h (select_window_1): Declare.
3162
3163 2012-12-17 Eli Zaretskii <eliz@gnu.org>
3164
3165 Emulate Posix ACL APIs on MS-Windows.
3166 * w32.c: Include sddl.h and sys/acl.h.
3167 (SDDL_REVISION_1): Define if not already defined.
3168 (g_b_init_get_security_descriptor_dacl)
3169 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3170 (g_b_init_is_valid_security_descriptor)
3171 (g_b_init_set_file_security): New static flags.
3172 (globals_of_w32): Initialize them to zero.
3173 (SetFileSecurity_Name): New string constant.
3174 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3175 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3176 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3177 (IsValidSecurityDescriptor_Proc): New typedefs.
3178 (get_file_security, get_security_descriptor_owner)
3179 (get_security_descriptor_group): Set errno to ENOTSUP.
3180 (set_file_security, get_security_descriptor_dacl)
3181 (is_valid_security_descriptor, convert_sd_to_sddl)
3182 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3183 (acl_free, acl_get_file, acl_set_file): New functions.
3184
3185 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3186
3187 2012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3188
3189 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3190 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3191 for some of that bug's symptoms can now cause Emacs to abort.
3192 Remove the workaround.
3193 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3194 The bug that caused SIGCHLD to get lost has been fixed, and the
3195 workaround for it can now cause Emacs to abort.
3196
3197 2012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3198
3199 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3200 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3201 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3202
3203 2012-12-16 Romain Francoise <romain@orebokech.com>
3204
3205 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3206 (Fcopy_file): Change last arg to `preserve_extended_attributes'
3207 and copy ACL entries of file in addition to SELinux context if set.
3208 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3209
3210 * Makefile.in (LIBACL_LIBS): New macro.
3211 (LIBES): Use it.
3212
3213 2012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3214
3215 * fileio.c (internal_delete_file): Use bool for boolean.
3216
3217 2012-12-15 Eli Zaretskii <eliz@gnu.org>
3218
3219 Fix bug #13079 on MS-Windows with temp files not being deleted.
3220 * w32.h (_child_process): New members input_file and
3221 pending_deletion.
3222 (register_child): First argument is now pid_t.
3223 (record_infile, record_pending_deletion): New prototypes.
3224
3225 * w32proc.c (new_child): Initialize input_file and
3226 pending_deletion members of the child.
3227 (delete_child): Delete the child's temporary input file, if any,
3228 that is pending deletion.
3229 (register_child): First argument is now pid_t.
3230 (record_infile, record_pending_deletion): New functions.
3231 (reap_subprocess): Fix a typo in DebPrint string.
3232 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3233
3234 * fileio.c (internal_delete_file): Return an int again: non-zero
3235 if delete-file succeeds, zero otherwise.
3236
3237 * lisp.h (internal_delete_file): Adjust prototype.
3238
3239 * callproc.c (Fcall_process): Don't overwrite infile with result
3240 of DECODE_FILE.
3241 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3242 asynchronous subprocess, record the name of the input file name,
3243 if any.
3244 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3245 delete the file, record it as pending deletion when the subprocess
3246 exits.
3247
3248 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3249
3250 * editfns.c [HAVE_PWD_H]: Include grp.h.
3251
3252 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3253
3254 2012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3255
3256 Fix permissions bugs with setgid directories etc. (Bug#13125)
3257 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3258 to mark it as a placeholder. The old value was often wrong.
3259 The only user of this attribute has been changed to use
3260 file-ownership-preserved-p instead, with its new group arg.
3261 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3262
3263 2012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3264
3265 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3266 Keep selected_window and selected_frame in sync.
3267
3268 2012-12-14 Eli Zaretskii <eliz@gnu.org>
3269
3270 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3271 try to get accurate owner and group information from NT file
3272 security APIs. This is to make most callers of 'stat' and
3273 'lstat', which don't need that information, much faster.
3274
3275 * dired.c (Ffile_attributes) [WINDOWSNT]:
3276 Set w32_stat_get_owner_group to a non-zero value, to request accurate
3277 owner and group information from 'lstat'.
3278
3279 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3280
3281 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3282 as that confuses set-auto-coding, so insist on the head-read
3283 returning the full 1024 bytes. Let lseek compute the tail offset;
3284 less work for us. Do not ignore I/O errors when reading the tail.
3285
3286 * xdisp.c: Minor style fixes.
3287 (init_iterator): Hoist assignment out of if-expression.
3288 (markpos_of_region): Callers now test for sign, not for -1.
3289
3290 2012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3291
3292 Minor redisplay optimization when the region length is zero.
3293 * xdisp.c (markpos_of_region): New function.
3294 (init_iterator): Do not highlight the region of zero length.
3295 (redisplay_window): Check whether the region is of non-zero length.
3296 (try_cursor_movement): Allow if the region length is zero.
3297 (try_window_reusing_current_matrix, try_window_id): Likewise.
3298
3299 2012-12-13 Eli Zaretskii <eliz@gnu.org>
3300
3301 * search.c (search_buffer): Check the inverse translations of each
3302 character in pattern when the buffer being searched is unibyte.
3303 (Bug#13084)
3304
3305 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3306
3307 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3308 files, fixing a regression from 24.2.
3309 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
3310
3311 2012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3312
3313 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3314 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3315 Remove unnecessary S_ISLNK test, as (contra the comments) this
3316 function can't copy symlinks. Improve quality of error message
3317 when attempting to copy files that are neither regular files nor
3318 directories.
3319
3320 2012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3321
3322 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3323 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3324 * window.c (Frecenter):
3325 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3326 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3327
3328 2012-12-12 Daniel Colascione <dancol@dancol.org>
3329
3330 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
3331 the dumped Emacs is not a sparse file, greatly improving Cygwin
3332 "make bootstrap" performance.
3333
3334 2012-12-11 Michael Albinus <michael.albinus@gmx.de>
3335
3336 * inotify.c (inotify_callback): Generate an Emacs event for every
3337 incoming inotify event.
3338
3339 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3340
3341 * xdisp.c (handle_face_prop): Fix logic of computing
3342 it->start_of_box_run_p.
3343 (append_space_for_newline): If the glyph row is R2L, reset the
3344 iterator's end_of_box_run_p flag before prepending the space glyph.
3345 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3346 iterator's start_of_box_run_p flag before prepending the stretch.
3347 (append_glyph, produce_image_glyph, append_composite_glyph)
3348 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3349 left_box_line_p and right_box_line_p flags of the glyph for R2L
3350 glyph rows. (Bug#13011)
3351
3352 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3353
3354 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3355 if changed buffer is not shown in a window.
3356 * insdel.c (prepare_to_modify_buffer): Likewise.
3357 * window.c (replace_buffer_in_windows_safely): Do nothing
3358 if buffer is not shown in a window.
3359 (Fforce_window_update): Likewise if string or buffer argument
3360 is passed.
3361
3362 2012-12-11 Eli Zaretskii <eliz@gnu.org>
3363
3364 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3365 encoded_file_name, which is what it is.
3366
3367 2012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3368
3369 Consistently use marker_position and marker_byte_position.
3370 * fringe.c (Ffringe_bitmaps_at_pos):
3371 * indent.c (Fvertical_motion):
3372 * insdel.c (prepare_to_modify_buffer):
3373 * keyboard.c (make_lispy_position):
3374 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3375 (window_scroll_pixel_based, displayed_window_lines)
3376 (Fset_window_configuration):
3377 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3378 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3379 Replace direct access to marker fields with calls
3380 to marker_position and/or marker_byte_position.
3381
3382 2012-12-11 Juanma Barranquero <lekktu@gmail.com>
3383
3384 * makefile.w32-in (SIG2STR_H): New macro.
3385 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3386 ($(BLD)/w32notify.$(O)): Update dependencies.
3387
3388 2012-12-10 Daniel Colascione <dancol@dancol.org>
3389
3390 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3391 Windows file notification functionality unless WINDOWSNT.
3392
3393 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3394 declarations.
3395
3396 * w32fns.c (cache_system_info): Initialize the global hinst
3397 variable here so various initialization calls DTRT.
3398
3399 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
3400 (hinst): Remove unneeded extern declaration.
3401 (_start): Remove initialization of above variables; remove
3402 initialization of hinst, as cache_system_info now does that.
3403
3404 * emacs.c (main): Call cache_system_info early in startup; we
3405 previously weren't calling it in Cygwin builds.
3406
3407 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3408 Teach the autoconf build system how to compile a Windows resource file
3409 and link it to Emacs.
3410
3411 2012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3412
3413 Per-buffer window counters.
3414 * buffer.h (struct buffer): New member window_count.
3415 (buffer_window_count): New function.
3416 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3417 Initialize window_count.
3418 (Fkill_buffer): Verify window_count for the buffer being killed.
3419 (modify_overlay): Do not force redisplay if buffer is not shown
3420 in any window.
3421 (init_buffer_once): Initialize window_count for buffer_defaults
3422 and buffer_local_symbols.
3423 * window.h (buffer_shared): Remove declaration.
3424 (wset_buffer): Convert from inline ...
3425 * window.c (wset_buffer): ... to an ordinary function.
3426 (adjust_window_count): New function.
3427 (make_parent_window): Use it.
3428 * xdisp.c (buffer_shared): Remove.
3429 (redisplay_internal, redisplay_window): Adjust users.
3430 (buffer_shared_and_changed): Use per-buffer window counter.
3431
3432 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3433
3434 Support for filesystem notifications on MS-Windows.
3435 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3436 and this is a TTY frame, signal the caller that keyboard input is
3437 available.
3438
3439 * w32xfns.c (drain_message_queue): Now returns an int: an
3440 indication whether any WM_EMACS_FILENOTIFY messages were found in
3441 the queue.
3442
3443 * w32inevt.c (handle_file_notifications): New function.
3444 (w32_console_read_socket): Call it to process file notifications.
3445
3446 * w32console.c (initialize_w32_display): Record the main thread ID
3447 in dwMainThreadId.
3448
3449 * deps.mk (inotify.o): New dependency list.
3450
3451 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3452
3453 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3454 (WM_EMACS_END): Bump value by 1.
3455 (notification_buffer_in_use, file_notifications)
3456 (notifications_size, notifications_desc): Declare.
3457 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3458 Add prototypes.
3459
3460 * w32term.c (lispy_file_action, queue_notifications): New functions.
3461 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3462 <Qrenamed_to>: New symbols.
3463 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3464
3465 * w32notify.c: New file, implements file event notifications for
3466 MS-Windows.
3467
3468 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3469 by posting it to the w32_read_socket queue.
3470
3471 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
3472
3473 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3474 (GLOBAL_SOURCES): Add w32notify.c
3475 ($(BLD)/w32notify.$(O)): New set of dependencies.
3476
3477 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3478
3479 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3480 Handle FILE_NOTIFY_EVENT.
3481 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3482 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3483 w32notify-handle-event by default.
3484
3485 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3486 syms_of_w32notify.
3487
3488 2012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3489
3490 Support for filesystem notifications on GNU/Linux via inotify.
3491 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
3492
3493 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3494
3495 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3496 (syms_of_keyboard): DEFSYM it.
3497 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3498 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3499 Qfile_inotify events.
3500 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3501 special-event-map to inotify-handle-event.
3502
3503 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3504
3505 * Makefile.in (base_obj): Add inotify.o.
3506
3507 * inotify.c: New file.
3508
3509 2012-12-10 Jan Djärv <jan.h.d@swipnet.se>
3510
3511 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3512
3513 2012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
3514
3515 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3516 DWORD_PTR, for compatibility with 64-bit builds.
3517
3518 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
3519 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3520 (system_process_attributes): Use SIZE_T rather than DWORD, for
3521 compatibility with 64-bit builds.
3522
3523 2012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
3524
3525 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3526
3527 2012-12-10 Eli Zaretskii <eliz@gnu.org>
3528
3529 * indent.c (Fvertical_motion): If a display string will be
3530 displayed on the left or the right margin, don't consider it as a
3531 factor in cursor positioning. (Bug#13108)
3532
3533 2012-12-10 Martin Rudalics <rudalics@gmx.at>
3534
3535 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3536
3537 2012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3538
3539 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3540 for string length.
3541
3542 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3543
3544 * w32.c (unsetenv): Return 0 if the input string is too long.
3545
3546 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3547
3548 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3549 * alloc.c (xputenv): New function.
3550 * dbusbind.c (Fdbus_init_bus):
3551 * emacs.c (main):
3552 * xterm.c (x_term_init):
3553 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3554 * editfns.c (initial_tz): Move static var decl up.
3555 (tzvalbuf_in_environ): New static var.
3556 (init_editfns): Initialize these two static vars.
3557 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3558 Save old TZ value on stack, if it's small.
3559 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3560 instead, use xputenv+unsetenv to set and restore TZ.
3561 (environbuf): Remove static var. All uses removed.
3562 (Fset_time_zone_rule): Do not save TZ and environ;
3563 no longer needed here.
3564 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3565 Move to inside set_time_zone_rule; they don't need file scope any more.
3566 (set_time_zone_rule): Maintain the TZ=value string separately.
3567 (syms_of_editfns): Don't initialize initial_tz;
3568 init_editfns now does it.
3569 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3570 * lisp.h (xputenv): New decl.
3571
3572 2012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3573
3574 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3575
3576 2012-12-08 Eli Zaretskii <eliz@gnu.org>
3577
3578 * w32.c (unsetenv, sys_putenv): New functions.
3579
3580 2012-12-08 Chong Yidong <cyd@gnu.org>
3581
3582 * editfns.c (Finsert_char): Make the error message more
3583 informative (Bug#12992).
3584
3585 2012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 Simplify get_lim_data.
3588 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3589 Remove USG and vlimit methods; no longer used these days.
3590 Add #error catchall just in case.
3591
3592 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3593 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3594 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3595 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3596 (deleted_pid_list, Fdelete_process, create_process)
3597 (record_child_status_change, handle_child_signal, deliver_child_signal)
3598 (init_process_emacs, syms_of_process):
3599 Assume SIGCHLD is defined.
3600 (parse_signal): Remove. All uses removed.
3601 (abbr_to_signal): New static function.
3602 (Fsignal_process): Use it to convert signal names to ints.
3603 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3604 kill (getpgrp (), ...).
3605 (emacs_sigaction_init): Assume SIGCHLD is defined.
3606 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3607 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3608 * syssignal.h (EMACS_KILLPG): Remove.
3609 All uses replaced by 'kill' with a negative pid.
3610 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3611 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3612
3613 2012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3614
3615 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3616 This will cause a production Emacs to dump core instead of
3617 infinite-looping.
3618
3619 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3620
3621 * frame.c (make_frame): Do not set window's buffer to t.
3622 * window.c (Fsplit_window_internal): Likewise. Previously it was
3623 used to indicate that the window is being set up. Now we use
3624 set_window_buffer for all new windows, so the condition in ...
3625 (Fset_window_buffer): ... is always true and can be removed.
3626
3627 2012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3628
3629 Convenient macro to check whether the buffer is hidden.
3630 * buffer.h (BUFFER_HIDDEN_P): New macro.
3631 * frame.c (make_frame): Use it. Adjust comment.
3632 * buffer.c (candidate_buffer): New function.
3633 (Fother_buffer, other_buffer_safely): Use it.
3634
3635 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3636
3637 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3638 if the child process is still running. Instead, exit the wait
3639 loop and return zero. (Bug#13086)
3640
3641 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3642
3643 * frame.h (x_char_width, x_char_height): Remove prototypes.
3644 * w32term.h (x_char_width, x_char_height): Likewise.
3645 * xfns.c (x_char_width, x_char_height): Remove.
3646 * w32fns.c (x_char_width, x_char_height): Likewise.
3647 * nsfns.c (x_char_width, x_char_height): Likewise.
3648 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3649 all window frames.
3650 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3651 * keyboard.c (command_loop_1): Remove prototype.
3652 (command_loop_2, top_level_1): Add static to match prototype.
3653
3654 2012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3655
3656 Fix a recently-introduced delete-process race condition.
3657 * callproc.c, process.h (record_kill_process):
3658 New function, containing part of the old call_process_kill.
3659 (call_process_kill): Use it.
3660 This does not change call_process_kill's behavior.
3661 * process.c (Fdelete_process): Use record_kill_process to fix a
3662 race condition that could cause Emacs to lose track of a child.
3663
3664 2012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3665
3666 Avoid code duplication between prev_frame and next_frame.
3667 * frame.c (candidate_frame): New function. Add comment.
3668 (prev_frame, next_frame): Use it. Adjust comment.
3669
3670 2012-12-06 Eli Zaretskii <eliz@gnu.org>
3671
3672 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3673 fails, signal an error instead of continuing with an empty
3674 string. (Bug#13079)
3675 Encode expanded temp file pattern before passing it to mkstemp or
3676 mktemp.
3677
3678 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3679 Encode the file name before passing it to dostounix_filename, in
3680 case it will downcase it (under w32-downcase-file-names).
3681 (Bug#12933)
3682
3683 2012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3684
3685 Minor call-process cleanups.
3686 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3687 at the same time as other platforms, to simplify analysis.
3688 No need for fd0_volatile since we have synch_process_fd.
3689 Avoid needless emacs_close; arg is always negative.
3690
3691 2012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3692
3693 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3694 processes.
3695
3696 2012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3697
3698 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3699 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3700 and mouse_face_hidden members to a bitfields.
3701 * frame.h (struct frame): Remove set-but-not-used space_width member.
3702 (FRAME_SPACE_WIDTH): Remove.
3703 * nsterm.m, w32term.c, xterm.c: Adjust users.
3704 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3705 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3706 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3707 members to a bitfields.
3708
3709 2012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3710
3711 Don't let call-process be a zombie factory (Bug#12980).
3712 Fixing this bug required some cleanup of the signal-handling code.
3713 As a side effect, this change also fixes a longstanding rare race
3714 condition whereby Emacs could mistakenly kill unrelated processes,
3715 and it fixes a bug where a second C-g does not kill a recalcitrant
3716 synchronous process in GNU/Linux and similar platforms.
3717 The patch should also fix the last vestiges of Bug#9488,
3718 a bug which has mostly been fixed on the trunk by other changes.
3719 * callproc.c, process.h (synch_process_alive, synch_process_death)
3720 (synch_process_termsig, sync_process_retcode):
3721 Remove. All uses removed, to simplify analysis and so that
3722 less consing is done inside critical sections.
3723 * callproc.c (call_process_exited): Remove. All uses replaced
3724 with !synch_process_pid.
3725 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3726 These take the role of what used to be in unwind-protect arg.
3727 All uses changed.
3728 (block_child_signal, unblock_child_signal):
3729 New functions, to avoid races that could kill innocent-victim processes.
3730 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3731 (call_process_kill): Record killed processes as deleted, so that
3732 zombies do not clutter up the system. Do this inside a critical
3733 section, to avoid a race that would allow the clutter.
3734 (call_process_cleanup): Fix code so that the second C-g works again
3735 on common platforms such as GNU/Linux.
3736 (Fcall_process): Create the child process in a critical section,
3737 to fix a race condition. If creating an asynchronous process,
3738 record it as deleted so that zombies do not clutter up the system.
3739 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3740 light of these changes. Omit unnecessary call to emacs_close
3741 before failure, as the unwind-protect code does that.
3742 * callproc.c (call_process_cleanup):
3743 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3744 * process.c (record_deleted_pid): New function, containing
3745 code refactored out of Fdelete_process.
3746 (Fdelete_process): Use it.
3747 (process_status_retrieved): Remove. All callers changed to use
3748 child_status_change.
3749 (record_child_status_change): Remove, folding its contents into ...
3750 (handle_child_signal): ... this signal handler. Now, this
3751 function is purely a handler for SIGCHLD, and is not called after
3752 a synchronous waitpid returns; the synchronous code is moved to
3753 wait_for_termination. There is no need to worry about reaping
3754 more than one child now.
3755 * sysdep.c (get_child_status, child_status_changed): New functions.
3756 (wait_for_termination): Now takes int * status and bool
3757 interruptible arguments, too. Do not record child status change;
3758 that's now the caller's responsibility. All callers changed.
3759 Reimplement in terms of get_child_status.
3760 (wait_for_termination_1, interruptible_wait_for_termination):
3761 Remove. All callers changed to use wait_for_termination.
3762 * syswait.h: Include <stdbool.h>, for bool.
3763 (record_child_status_change, interruptible_wait_for_termination):
3764 Remove decls.
3765 (record_deleted_pid, child_status_changed): New decls.
3766 (wait_for_termination): Adjust to API changes noted above.
3767
3768 * bytecode.c, lisp.h (Qbytecode): Remove.
3769 No longer needed after 2012-11-20 interactive-p changes.
3770
3771 2012-12-03 Eli Zaretskii <eliz@gnu.org>
3772
3773 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3774 the scroll margin, move point outside the margin. (Bug#13055)
3775
3776 2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3777
3778 * gtkutil.c (my_log_handler): New function.
3779 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3780
3781 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3782
3783 * lisp.h (modify_region): Rename to...
3784 (modify_region_1): ...new prototype.
3785 * textprop.c (modify_region): Now static. Adjust users.
3786 * insdel.c (modify_region): Rename to...
3787 (modify_region_1): ...new function to work with current buffer.
3788 Adjust comment and users. Use true and false for booleans.
3789
3790 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3791
3792 * alloc.c (free_save_value): New function.
3793 (safe_alloca_unwind): Use it.
3794 * lisp.h (free_save_value): New prototype.
3795 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3796 Add comment.
3797 (save_excursion_restore): Adjust to match saved data structure.
3798 Use free_save_value to offload some work from GC. Drop obsolete
3799 #if 0 code.
3800
3801 2012-12-03 Chong Yidong <cyd@gnu.org>
3802
3803 * fileio.c (Vauto_save_list_file_name): Doc fix.
3804
3805 2012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
3806
3807 * w32fns.c: Remove prototype of atof.
3808 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
3809 builds.
3810 (file_dialog_callback): Make it UINT_PTR.
3811
3812 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3813 with 64-bit builds.
3814
3815 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3816 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3817 defined.
3818
3819 2012-12-03 Glenn Morris <rgm@gnu.org>
3820
3821 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
3822
3823 2012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3824
3825 Fix xpalloc confusion after memory is exhausted.
3826 * alloc.c (xpalloc): Comment fix.
3827 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3828 and signals an error, do not clear charset_table_size, as
3829 charset_table is still valid.
3830 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3831
3832 Use execve to avoid need to munge environ (Bug#13054).
3833 * callproc.c (Fcall_process):
3834 * process.c (create_process):
3835 Don't save and restore environ; no longer needed.
3836 * callproc.c (child_setup):
3837 Use execve, not execvp, to preserve environ.
3838
3839 2012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3840
3841 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3842
3843 2012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3844
3845 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3846 display for sliced images (Bug#10500).
3847
3848 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3849
3850 2012-11-30 Juanma Barranquero <lekktu@gmail.com>
3851
3852 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3853 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3854
3855 2012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3856
3857 * xdisp.c (window_outdated): Remove eassert since it hits
3858 some suspicious corner cases (see Bug#13007 and Bug#13012).
3859 (mode_line_update_needed): New function.
3860 (redisplay_internal, redisplay_window): Use it.
3861 (ensure_selected_frame): New function.
3862 (redisplay_internal, unwind_redisplay): Use it.
3863 (redisplay_internal): Move comment about buffer_shared...
3864 (buffer_shared_and_changed): ...near to its real use.
3865
3866 2012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3867
3868 * callproc.c (Fcall_process): Don't misreport vfork failure.
3869
3870 2012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3871
3872 * callproc.c (Fcall_process): Fix vfork portability problems.
3873 Do not assume that fd[0], count, filefd, and save_environ survive
3874 vfork. Fix bug whereby wrong errno value could be reported for
3875 pipe failure. Some minor cleanups, too, as follows. Move buf and
3876 bufsize to the context where they're needed. Change new_argv to
3877 be of type char **, as this is more convenient and avoids casts.
3878 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3879 Now local constants, not macros.
3880
3881 2012-11-18 Kenichi Handa <handa@gnu.org>
3882
3883 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3884 for the variable "f".
3885
3886 2012-11-13 Kenichi Handa <handa@gnu.org>
3887
3888 * font.c (font_unparse_xlfd): Exclude special characters from the
3889 generating XLFD name.
3890
3891 2012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3892
3893 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3894 * dired.c (stat_uname, stat_gname):
3895 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3896
3897 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3898 * dired.c (directory_files_internal, file_name_completion):
3899 Assume EAGAIN and EINTR are defined.
3900
3901 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3902 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3903 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3904 * lread.c (readbyte_from_file): Assume EINTR is defined.
3905 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3906 Assume EIO and EAGAIN are defined.
3907 * unexcoff.c (write_segment): Assume EFAULT is defined.
3908
3909 2012-11-27 Eli Zaretskii <eliz@gnu.org>
3910
3911 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3912 (Bug#11964)
3913
3914 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3915 highlighting on the frame was cleared. Prevents assertion
3916 violations when repeatedly clicking on the "Top" link of the
3917 "bread-crumbs" in Info buffers.
3918
3919 2012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3920
3921 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3922
3923 2012-11-24 Ken Brown <kbrown@cornell.edu>
3924
3925 * keyboard.c (HAVE_MOUSE):
3926 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3927 were always defined.
3928
3929 2012-11-24 Eli Zaretskii <eliz@gnu.org>
3930
3931 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3932 between bpos_covered and bpos_max. This fixes cursor display when
3933 several display strings follow each other.
3934
3935 * .gdbinit (pgx): If the glyph's object is a string, display the
3936 pointer to string data, rather than the value of the string object
3937 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3938
3939 * indent.c (Fvertical_motion): If the starting position is covered
3940 by a display string, return to one position before that, to avoid
3941 overshooting it inside move_it_to. (Bug#12930)
3942
3943 2012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3944
3945 * frame.h (struct frame): Remove display_preempted member
3946 since all users are dead long ago.
3947 * nsterm.h (struct x_output): Use the only dummy member.
3948 * w32menu.c (pending_menu_activation): Remove since not
3949 really used.
3950 (set_frame_menubar): Adjust user.
3951 * w32term.h (struct x_output): Drop outdated #if 0 code.
3952 (struct w32_output): Use bitfields for explicit_parent,
3953 asked_for_visible and menubar_active members.
3954 Drop unused pending_menu_activation member.
3955 * xterm.h (struct x_output): Drop outdated #if 0 code.
3956 Use bitfields for explicit_parent, asked_for_visible,
3957 has_been_visible and net_wm_state_hidden_seen members.
3958
3959 2012-11-23 Eli Zaretskii <eliz@gnu.org>
3960
3961 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3962 of a literal "/". (Bug#12955)
3963 (gl-stamp): Invoke fc.exe directly, not through cmd.
3964
3965 2012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3966
3967 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3968 * dired.c: Assume HAVE_DIRENT_H.
3969 (NAMLEN): Remove, replacing with ...
3970 (dirent_namelen): New function. All uses changed. Use the GNU macro
3971 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3972 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3973 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3974 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3975 $(NT_INC)/dirent.h.
3976 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3977 * ndir.h: Rename to ../nt/inc/dirent.h.
3978 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3979 Do not include <dirent.h>; no longer needed.
3980 * w32.c: Include <dirent.h> rather than "ndir.h".
3981
3982 2012-11-23 Chong Yidong <cyd@gnu.org>
3983
3984 * xftfont.c (xftfont_open): Remove duplicate assignment.
3985
3986 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3987
3988 * alloc.c (Fgarbage_collect): Unblock input after clearing
3989 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3990 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3991 * msdos.c (IT_frame_up_to_date): Use it here...
3992 * w32term.c (w32_frame_up_to_date): ...here...
3993 * xterm.c (XTframe_up_to_date): ...and here...
3994 * nsterm.m (ns_frame_up_to_date): ...but not here.
3995 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3996 Adjust users.
3997 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3998 Do not check whether GC is in progress.
3999
4000 2012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
4001
4002 * xdisp.c (window_buffer_changed): New function.
4003 (update_menu_bar, update_tool_bar): Use it to
4004 simplify large 'if' statements.
4005 (redisplay_internal): Generalize commonly used
4006 'tail' and 'frame' local variables.
4007
4008 2012-11-22 Eli Zaretskii <eliz@gnu.org>
4009
4010 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
4011 with Windows system header.
4012
4013 2012-11-21 Paul Eggert <eggert@cs.ucla.edu>
4014
4015 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
4016 * alloc.c: Assume unistd.h exists.
4017 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
4018 * sysdep.c (get_current_dir_name): Assume getcwd exists.
4019 (getwd) [USG]: Remove; no longer needed.
4020 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
4021 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
4022 * w32.h (getcwd): Remove decl.
4023
4024 2012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
4025
4026 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
4027 Make it set selected_window as well.
4028 (update_tool_bar): Use it.
4029
4030 2012-11-21 Ken Brown <kbrown@cornell.edu>
4031
4032 * emacs.c (main): Set the G_SLICE environment variable for all
4033 Cygwin builds, not just GTK builds. See
4034 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
4035
4036 2012-11-21 Eli Zaretskii <eliz@gnu.org>
4037
4038 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
4039 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
4040 Define for the MSVC compiler.
4041
4042 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
4043
4044 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
4045 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
4046 dostounix_filename. Prevents crashes down the road, because
4047 dostounix_filename assumes it gets a unibyte string.
4048 Reported by Michel de Ruiter <michel@sentient.nl>, see
4049 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
4050
4051 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4052
4053 Conflate Qnil and Qunbound for `symbol-function'.
4054 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
4055 * lread.c (init_obarray): Set `function' fields to Qnil.
4056 * eval.c (Fcommandp): Ignore Qunbound.
4057 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
4058 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
4059 Test NILP rather than Qunbound.
4060 (Ffmakunbound): Set to Qnil.
4061 (Fsymbol_function): Never signal an error.
4062 (Finteractive_form): Ignore Qunbound.
4063
4064 2012-11-20 Paul Eggert <eggert@cs.ucla.edu>
4065
4066 * eval.c (interactive_p): Remove no-longer-used decl.
4067
4068 2012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
4069
4070 * xdisp.c (buffer_shared): Adjust comment.
4071 (buffer_shared_and_changed): New function.
4072 (prepare_menu_bars, redisplay_internal): Use it to
4073 decide whether all windows or frames should be updated.
4074 (window_outdated): New function.
4075 (text_outside_line_unchanged_p, redisplay_window): Use it.
4076 (redisplay_internal): Likewise. Fix indentation.
4077
4078 2012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
4079
4080 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
4081 (syms_of_eval): Remove corresponding defsubr.
4082 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
4083
4084 2012-11-19 Daniel Colascione <dancol@dancol.org>
4085
4086 * w32fns.c (Fx_file_dialog):
4087 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
4088 cygwin_convert_file_name*.
4089
4090 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
4091 Rename cygwin_convert_path* to cygwin_convert_file_name*.
4092
4093 2012-11-18 Paul Eggert <eggert@cs.ucla.edu>
4094
4095 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
4096
4097 2012-11-18 Eli Zaretskii <eliz@gnu.org>
4098
4099 * w32select.c: Include w32common.h before w32term.h, so that
4100 windows.h gets included before w32term.h uses some of its
4101 features, see below.
4102
4103 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
4104 New typedefs.
4105 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
4106 New prototypes.
4107 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
4108
4109 2012-11-18 Jan Djärv <jan.h.d@swipnet.se>
4110
4111 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
4112 (ns_select): Return at once if events are held (Bug#12834).
4113
4114 2012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
4115
4116 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
4117 Needed following 2012-10-20 change. (Bug#12902)
4118
4119 2012-11-18 Juanma Barranquero <lekktu@gmail.com>
4120
4121 * w32proc.c (waitpid): Remove unused label get_result.
4122
4123 2012-11-17 Juanma Barranquero <lekktu@gmail.com>
4124
4125 * makefile.w32-in (SYSWAIT_H): New macro.
4126 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
4127 ($(BLD)/sysdep.$(O)): Update dependencies.
4128
4129 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4130
4131 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
4132 * callproc.c (relocate_fd): Assume F_DUPFD.
4133 * emacs.c, term.c (O_RDWR): Remove.
4134 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
4135 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
4136 * nsterm.m: Assume <fcntl.h> exists.
4137 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
4138 (create_pty, Fmake_network_process, server_accept_connection)
4139 (wait_reading_process_output, init_process_emacs):
4140 Assume O_NONBLOCK.
4141 (wait_reading_process_output): Put in a special case for WINDOWSNT
4142 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
4143 It's not clear this is needed, but it's a more-conservative change.
4144 (create_process): Assume FD_CLOEXEC.
4145 (create_process, create_pty): Assume O_NOCTTY.
4146 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4147 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4148 Omit if not DOS_NT, since F_GETFL is not defined there.
4149 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4150 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4151 (O_NOCTTY): Remove.
4152 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4153 lack it, since gnulib guarantees this.
4154 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4155
4156 2012-11-17 Eli Zaretskii <eliz@gnu.org>
4157
4158 * w32.c (faccessat): Pretend that directories have the execute bit
4159 set. Emacs expects that, e.g., in files.el:cd-absolute.
4160
4161 * w32proc.c (create_child): Don't clip the PID of the child
4162 process to fit into an Emacs integer, as this is no longer a
4163 restriction.
4164 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4165 reaping only the process specified by PID argument, if that is
4166 positive. Use PID instead of dead_child to know which process to
4167 reap. Wait for the child to die only if WNOHANG is not in
4168 OPTIONS.
4169 (sys_select): Don't set dead_child.
4170
4171 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4172 as it is no longer needed.
4173
4174 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4175 no longer needed.
4176 (record_child_status_change): Remove the setting of
4177 record_at_most_one_child for the !WNOHANG case.
4178
4179 2012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4180
4181 Fix problems in ns port found by static checking.
4182 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4183 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4184 not to process group.
4185 (ns_select): Use emacs_write, not write, as that's more robust
4186 in the presence of signals.
4187 (fd_handler:): Check for read errors.
4188
4189 2012-11-16 Glenn Morris <rgm@gnu.org>
4190
4191 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4192
4193 2012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
4194
4195 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4196
4197 2012-11-16 Eli Zaretskii <eliz@gnu.org>
4198
4199 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4200 use the same value of thread handle.
4201 (start_timer_thread): If the timer thread exited (due to error),
4202 clean up by closing the two handles it used. Duplicate the caller
4203 thread's handle here, so it gets duplicated only once, when
4204 launching the timer thread. Set priority of the timer thread, not
4205 the caller thread.
4206 (getitimer): Don't duplicate the caller thread's handle here.
4207 (Bug#12832)
4208
4209 2012-11-16 Jan Djärv <jan.h.d@swipnet.se>
4210
4211 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4212 called (Bug#12834).
4213
4214 2012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4215
4216 Remove no-longer-used pty_max_bytes variable.
4217 * process.c (pty_max_bytes): Remove; unused.
4218 (send_process): Do not set it.
4219
4220 2012-11-15 Juanma Barranquero <lekktu@gmail.com>
4221
4222 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4223 Update dependencies.
4224
4225 2012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4226
4227 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4228 This follows up on the 2012-09-29 patch that removed indirection
4229 for the 'function' field. Reported by Sergey Vinokurov in
4230 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4231
4232 2012-11-14 Eli Zaretskii <eliz@gnu.org>
4233
4234 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4235 different name, as the MS runtime does not have such a function,
4236 and probably never will.) All callers changed. Ignore DIRFD
4237 value if PATH is an absolute file name, to match Posix spec
4238 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4239 symlinks.
4240
4241 2012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4242
4243 * xdisp.c (echo_area_display, redisplay_internal):
4244 Omit redundant check whether frame_garbaged is set.
4245
4246 2012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4247
4248 Use faccessat, not access, when checking file permissions (Bug#12632).
4249 This fixes a bug that has been present in Emacs since its creation.
4250 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4251 which must set some sort of record. (Torek's bug report was against
4252 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4253 same common flaw.) See Torek's Usenet posting
4254 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4255 Posted: Fri Apr 8 14:18:56 1983.
4256 * Makefile.in (LIB_EACCESS): New macro.
4257 (LIBES): Use it.
4258 * callproc.c (init_callproc):
4259 * charset.c (init_charset):
4260 * fileio.c (check_existing, check_executable, check_writable)
4261 (Ffile_readable_p):
4262 * lread.c (openp, load_path_check):
4263 * process.c (allocate_pty):
4264 * xrdb.c (file_p):
4265 Use effective UID when checking permissions, not real UID.
4266 * callproc.c (init_callproc):
4267 * charset.c (init_charset):
4268 * lread.c (load_path_check, init_lread):
4269 Test whether directories are accessible, not merely whether they exist.
4270 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4271 * fileio.c (check_existing, check_executable, check_writable)
4272 (Ffile_readable_p):
4273 Use symbolic names instead of integers for the flags, as they're
4274 portable now.
4275 (check_writable): New arg AMODE. All uses changed.
4276 Set errno on failure.
4277 (Ffile_readable_p): Use faccessat, not stat + open + close.
4278 (Ffile_writable_p): No need to call check_existing + check_writable.
4279 Just call check_writable and then look at errno. This saves a syscall.
4280 dir should never be nil; replace an unnecessary runtime check
4281 with an eassert. When checking the parent directory of a nonexistent
4282 file, check that the directory is searchable as well as writable, as
4283 we can't create files in unsearchable directories.
4284 (file_directory_p): New function, which uses 'stat' on most platforms
4285 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4286 (Ffile_directory_p, Fset_file_times): Use it.
4287 (file_accessible_directory_p): New function, which uses a single
4288 syscall for efficiency.
4289 (Ffile_accessible_directory_p): Use it.
4290 * xrdb.c (file_p): Use file_directory_p.
4291 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4292 * lread.c (openp): When opening a file, use fstat rather than
4293 stat, as that avoids a permissions race. When not opening a file,
4294 use file_directory_p rather than stat.
4295 (dir_warning): First arg is now a usage string, not a format.
4296 Use errno. All uses changed.
4297 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4298 that merely introduced a race.
4299 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4300 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4301 and similarly for the other O_* flags.
4302 * w32.c (sys_faccessat): Rename from sys_access and switch to
4303 faccessat's API. All uses changed.
4304 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4305 (magic_db): Rename from magic_file_p.
4306 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4307 char *, so that we don't have to test for file existence
4308 separately from opening the file for reading. This removes a race
4309 fixes a permission-checking problem, and simplifies the code.
4310 All uses changed.
4311 (file_p): Remove; no longer needed.
4312
4313 2012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4314
4315 Omit glyphs initialization at startup.
4316 * dispnew.c (glyphs_initialized_initially_p): Remove.
4317 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4318 (Fredraw_frame): Move actual code from here...
4319 (redraw_frame): ...to here. Add eassert. Adjust comment.
4320 (Fredraw_display): Use redraw_frame.
4321 * xdisp.c (clear_garbaged_frames): Likewise.
4322
4323 2012-11-13 Eli Zaretskii <eliz@gnu.org>
4324
4325 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4326 passed to pint2str and pint2hrstr to be at most the size of the
4327 frame's decode_mode_spec_buffer. This avoids crashes with very
4328 large values of FIELD_WIDTH argument to decode_mode_spec.
4329 (Bug#12867)
4330
4331 2012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4332
4333 Fix a race with verify-visited-file-modtime (Bug#12863).
4334 Since at least 1991 Emacs has ignored an mtime difference of no
4335 more than one second, but my guess is that this was to work around
4336 file system bugs that were fixed long ago. Since the race is
4337 causing problems now, let's remove that code.
4338 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4339 whose time stamp is off by no more than a second. Insist that the
4340 file time stamps match exactly.
4341
4342 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4343
4344 * frame.h (struct frame): Convert external_tool_bar member to
4345 1-bit unsigned bitfield.
4346 * termhooks.h (struct terminal): Remove mouse_moved member since
4347 all users are long dead. Adjust comment on mouse_position_hook.
4348
4349 2012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4350
4351 Simplify by using FOR_EACH_FRAME here and there.
4352 * frame.c (next_frame, prev_frame, other_visible_frames)
4353 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4354 * w32term.c (x_window_to_scroll_bar): Likewise.
4355 * window.c (window_list): Likewise.
4356 * xdisp.c (x_consider_frame_title): Likewise.
4357 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4358 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4359 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4360 * xmenu.c (menubar_id_to_frame): Likewise.
4361 * xselect.c (frame_for_x_selection): Likewise.
4362 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4363 (x_window_to_menu_bar): Likewise.
4364 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4365
4366 2012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4367
4368 * data.c (Qdefalias_fset_function): Now static.
4369
4370 Another tweak to vectorlike_header change.
4371 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4372 Remove, and replace all uses with ...
4373 (next_in_free_list, set_next_in_free_list):
4374 New functions, which respect C's aliasing rules better.
4375
4376 2012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4377
4378 * window.c (list4i): Rename from 'quad'. All uses changed.
4379 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4380
4381 2012-11-11 Juanma Barranquero <lekktu@gmail.com>
4382
4383 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4384 warning about mixing declarations and code in ISO C90.
4385
4386 2012-11-10 Martin Rudalics <rudalics@gmx.at>
4387
4388 * window.c (Fsplit_window_internal): Set combination limit of
4389 new parent window to t iff Vwindow_combination_limit is t;
4390 fixing a regression introduced with the change from 2012-09-22.
4391 (Fset_window_combination_limit): Fix doc-string.
4392
4393 2012-11-10 Eli Zaretskii <eliz@gnu.org>
4394
4395 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4396 amount when the scroll margins are too large. When scrolling
4397 backwards in the buffer, give up if cannot reach point or the
4398 scroll margin within a reasonable number of screen lines.
4399 Fixes point position in window under scroll-up/down-aggressively when
4400 point is positioned many lines beyond the window top/bottom.
4401 (Bug#12811)
4402
4403 * ralloc.c (relinquish): If real_morecore fails to return memory
4404 to the system, don't crash; instead, leave the last heap
4405 unchanged and return. (Bug#12774)
4406
4407 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4408
4409 * lisp.h (AUTOLOADP): New macro.
4410 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4411 * data.c (Ffset): Remove special ad-advice-info handling.
4412 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4413 (Fsubr_arity): CSE.
4414 (Finteractive_form): Simplify.
4415 (Fquo): Don't insist on having at least 2 arguments.
4416 (Qdefalias_fset_function): New var.
4417
4418 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4419
4420 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4421
4422 * nsfont.m (Qcondensed, Qexpanded): New variables.
4423 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4424 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4425
4426 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4427
4428 Fix recently introduced crash on MS-Windows (Bug#12839).
4429 * w32term.h (struct scroll_bar): Use convenient header.
4430 (SCROLL_BAR_VEC_SIZE): Remove.
4431 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4432
4433 2012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4434
4435 Tweak last vectorlike_header change.
4436 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4437 vectorlike object on the free list. This is introduced to avoid
4438 some (but not all) pointer casting and aliasing problems, see
4439 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4440 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4441 objects.
4442 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4443
4444 2012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4445
4446 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
4447 been removed, so remove them here also.
4448
4449 2012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4450
4451 * doc.c (Fdocumentation): Handle new property
4452 dynamic-docstring-function to replace the old ad-advice-info.
4453
4454 2012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4455
4456 * fns.c (Qeql, hashtest_eq): Now static.
4457
4458 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4459
4460 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4461 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4462 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4463 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4464
4465 2012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4466
4467 Use same hash function for hashfn_profiler as for hash_string etc.
4468 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4469 * lisp.h (sxhash_combine): New inline function, with the contents
4470 of the old SXHASH_COMBINE.
4471 * profiler.c (hashfn_profiler): Use it, instead of having a
4472 special hash function containing a comparison that always yields 1.
4473
4474 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4475
4476 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4477 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4478 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4479 Remove unused vars.
4480
4481 2012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4482
4483 * image.c (xpm_make_color_table_h): Fix compiler error because
4484 make_hash_table changed.
4485
4486 2012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
4487
4488 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4489
4490 2012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4491
4492 Use ad-hoc comparison function for the profiler's hash-tables.
4493 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4494 (make_log): Use them.
4495 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4496 call Fequal any more.
4497 (Ffunction_equal): New function.
4498 (cmpfn_profiler, hashfn_profiler): New functions.
4499 (syms_of_profiler): Initialize them.
4500 * lisp.h (struct hash_table_test): New struct.
4501 (struct Lisp_Hash_Table): Use it.
4502 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4503 * fns.c (make_hash_table): Take a struct to describe the test.
4504 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4505 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4506 (hash_lookup, hash_remove_from_table): Move assertion checking of
4507 hashfn result here. Check hash-equality before calling cmpfn.
4508 (Fmake_hash_table): Adjust call to make_hash_table.
4509 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4510 (syms_of_fns): Initialize them.
4511 * emacs.c (main): Move syms_of_fns earlier.
4512 * xterm.c (syms_of_xterm):
4513 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4514 * print.c (print_object): Adjust to new hash-table struct.
4515 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4516
4517 2012-11-08 Eli Zaretskii <eliz@gnu.org>
4518
4519 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4520 value of w32-scroll-lock-modifier is neither nil nor one of the
4521 known key modifiers. (Bug#12806)
4522
4523 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4524
4525 Shrink struct vectorlike_header to the only size field.
4526 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4527 Adjust comment.
4528 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4529 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4530 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4531 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4532 information from the vector header. Adjust comment.
4533 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4534 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4535 layout.
4536 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4537 (struct vectorlike_header): Remove next member. Adjust comment.
4538 (struct Lisp_Subr): Add convenient header. Adjust comment.
4539 (allocate_pseudovector): Adjust prototype.
4540 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4541 (sweep_string, lisp_malloc): Remove useless prototypes.
4542 (enum mem_type): Adjust comment.
4543 (NEXT_IN_FREE_LIST): New macro.
4544 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4545 (Fmake_bool_vector): Likewise.
4546 (struct large_vector): New type to represent allocation unit for
4547 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4548 (large_vectors): Change type to struct large_vector.
4549 (allocate_vector_from_block): Simplify.
4550 (PSEUDOVECTOR_NBYTES): Replace with...
4551 (vector_nbytes): ...new function. Adjust users.
4552 (sweep_vectors): Adjust processing of large vectors.
4553 (allocate_vectorlike): Likewise.
4554 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4555 Add easserts. Adjust XSETPVECTYPESIZE usage.
4556 (allocate_buffer): Use BUFFER_PVEC_INIT.
4557 (live_vector_p): Adjust to match large vector.
4558 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4559 * buffer.h (struct buffer): Add next member.
4560 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4561 New macros.
4562 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4563 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4564 (copy_hash_table): Adjust to match vector header change.
4565 * lread.c (defsubr): Use XSETPVECTYPE.
4566 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4567 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4568 (xvecsize): New command.
4569
4570 2012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4571
4572 * keyboard.c (event_to_kboard): Do not dereference
4573 frame_or_window field of SELECTION_REQUEST_EVENT
4574 and SELECTION_CLEAR_EVENT events (Bug#12814).
4575 * xterm.h (struct selection_input_event): Adjust comment.
4576
4577 2012-11-07 Eli Zaretskii <eliz@gnu.org>
4578
4579 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4580 such as Scroll Lock, if the respective keys are treated as
4581 function keys, not as modifiers. This avoids destroying non-ASCII
4582 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
4583
4584 2012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4585
4586 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4587
4588 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4589
4590 Restore some duplicate definitions (Bug#12814).
4591 This undoes part of the 2012-11-03 changes. Some people build
4592 with plain -g rather than with -g3, and they need the duplicate
4593 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4594 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4595 Define as macros, as well as as enums or as constants.
4596
4597 2012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4598
4599 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4600 to keypad keys (Bug#12816).
4601
4602 2012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4603
4604 Minor adjustments of recently-changed frame functions.
4605 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4606 known to be a frame (we're in the FRAMEP branch).
4607 * lisp.h (Qframep): Remove decl. frame.h declares this.
4608 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4609 since they're meant for Lisp fixnum values.
4610
4611 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4612
4613 * window.c (Fwindow_combination_limit): Revert to the only
4614 required argument and adjust docstring as suggested in
4615 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4616 by Martin Rudalics <rudalics@gmx.at>.
4617
4618 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4619
4620 Widely used frame validity and checking functions.
4621 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4622 * frame.c (decode_live_frame, decode_any_frame): New functions.
4623 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4624 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4625 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4626 (Fframe_pointer_visible_p): Use decode_any_frame.
4627 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4628 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4629 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4630 (Fframe_focus): Likewise. Allow zero number of arguments.
4631 Adjust docstring.
4632 (frame_buffer_list, frame_buffer_predicate): Remove.
4633 * lisp.h (frame_buffer_predicate): Remove prototype.
4634 * buffer.c (Fother_buffer): Use decode_any_frame.
4635 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4636 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4637 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4638 (Fclose_font, Ffont_info): Use decode_live_frame.
4639 * fontset.c (check_fontset_name): Likewise.
4640 * terminal.c (Fframe_terminal): Likewise.
4641 * w32fns.c (check_x_frame): Likewise.
4642 * window.c (Fminibuffer_window, Fwindow_at)
4643 (Fcurrent_window_configuration): Likewise.
4644 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4645 Likewise. Allow zero number of arguments. Adjust docstring.
4646 * dispnew.c (Fredraw_frame): Likewise.
4647 * xfaces.c (frame_or_selected_frame): Remove.
4648 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4649 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4650 (Fframe_face_alist): Use decode_live_frame.
4651 * xfns.c (check_x_frame): Likewise.
4652
4653 2012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4654
4655 * window.c (quad): New function.
4656 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4657 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4658 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4659 (Fwindow_line_height): Use it.
4660 (Fwindow_fringes): Use list3.
4661 (Fwindow_scroll_bars): Use list4.
4662 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4663 (Fwindow_combination_limit): Allow zero number of arguments.
4664
4665 2012-11-05 Eli Zaretskii <eliz@gnu.org>
4666
4667 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4668
4669 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
4670 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
4671 file descriptor 2 for standard error. (Bug#12805)
4672
4673 2012-11-05 Chong Yidong <cyd@gnu.org>
4674
4675 * process.c (wait_reading_process_output): Revert previous change.
4676
4677 2012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4678
4679 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4680 This removes code that has been obsolete since around 1990.
4681 * callproc.c (Fcall_process):
4682 * emacs.c (main):
4683 * process.c (create_process):
4684 * term.c (dissociate_if_controlling_tty):
4685 Assume setsid exists.
4686 * callproc.c (child_setup): Assume setpgid exists and behaves as
4687 per POSIX.1-1988 or later.
4688 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4689 * emacs.c (shut_down_emacs):
4690 * sysdep.c (sys_suspend, init_foreground_group):
4691 Assume getpgrp behaves as per POSIX.1-1998 or later.
4692 * msdos.c (setpgrp): Remove.
4693 (tcgetpgrp, setpgid, setsid): New functions.
4694 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4695 * term.c (no_controlling_tty): Remove; unused.
4696 * w32proc.c (setpgrp): Remove.
4697 (setsid, tcgetpgrp): New functions.
4698
4699 Simplify by assuming __fpending.
4700 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4701 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4702 Do not assume that __fpending's result fits in int.
4703
4704 2012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4705
4706 Remove EMACS_OUTQSIZE+sleep hack.
4707 * dispnew.c (update_frame_1): Remove hack for terminals slower
4708 than 2400 bps, which throttled Emacs by having it sleep.
4709 This code hasn't worked since at least 2007, when the multi-tty stuff
4710 was added, and anyway those old terminals are long dead.
4711 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4712 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4713
4714 Fix data-loss with --version (Bug#9574).
4715 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4716 as we can't assume that emacs_strerror is initialized, and strerror
4717 is good enough here.
4718 (main): Invoke atexit earlier, to catch earlier instances of
4719 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4720
4721 2012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4722
4723 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4724 (keyDown): Remap keypad keys to X11 virtual key codes.
4725
4726 2012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4727
4728 Fix data-loss with --batch (Bug#9574).
4729 * emacs.c: Include <close-stream.h>.
4730 (close_output_streams): New function.
4731 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4732 and handles errors appropriately.
4733 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4734 does that now.
4735
4736 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4737 The symptom is a diagnostic "GLib-WARNING **: In call to
4738 g_spawn_sync(), exit status of a child process was requested but
4739 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4740 waitpid(), so exit status can't be returned." The diagnostic
4741 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4742 The real bug is a race condition between Emacs and glib: Emacs
4743 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4744 so that glib can't find it. Work around the bug by invoking
4745 waitpid only on subprocesses that Emacs itself creates.
4746 * process.c (create_process, record_child_status_change):
4747 Don't use special value -1 in pid field, as the caller now must
4748 know the pid rather than having the callee infer it.
4749 The inference was sometimes incorrect anyway, due to another race.
4750 (create_process): Set new 'alive' member if child is created.
4751 (process_status_retrieved): New function.
4752 (record_child_status_change): Use it.
4753 Accept negative 1st argument, which means to wait for the
4754 processes that Emacs already knows about. Move special-case code
4755 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4756 processes that have already been waited for, by testing and
4757 clearing new 'alive' member.
4758 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4759 now does this internally.
4760 (handle_child_signal): Let record_child_status_change do all
4761 the work, since we do not want to reap all exited child processes,
4762 only the child processes that Emacs itself created.
4763 * process.h (Lisp_Process): New boolean member 'alive'.
4764
4765 Omit duplicate definitions no longer needed with gcc -g3.
4766 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4767 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4768 Define only as macros. There's no longer any need to also define
4769 these symbols as enums or as constants, since we now assume
4770 gcc -g3 when debugging.
4771
4772 2012-11-03 Eli Zaretskii <eliz@gnu.org>
4773
4774 * lisp.mk: Adjust comments to the fact that term/internal is now
4775 loaded from loadup.el.
4776
4777 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4778 (msdos_fatal_signal): New function.
4779 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4780 its argument list.
4781
4782 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4783 for GCC versions before 4.
4784 (emacs_raise): Define to call msdos_fatal_signal.
4785
4786 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4787 iterator when starting in the middle of a display or overlay
4788 string. (Bug#12745)
4789
4790 2012-11-03 Chong Yidong <cyd@gnu.org>
4791
4792 * process.c (wait_reading_process_output): Clean up the last
4793 change.
4794
4795 2012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4796
4797 * process.c (wait_reading_process_output): Avoid a race condition
4798 with SIGIO delivery (Bug#11536).
4799
4800 2012-11-03 Chong Yidong <cyd@gnu.org>
4801
4802 * buffer.c (cursor_type): Untabify docstring.
4803
4804 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4805
4806 * frame.h (struct frame): Drop can_have_scroll_bars member
4807 which is meaningless for a long time. Adjust comments.
4808 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4809 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4810
4811 2012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4812
4813 * window.c (decode_next_window_args): Update window arg after
4814 calling decode_live_window and so fix crash reported at
4815 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4816 by Juanma Barranquero <lekktu@gmail.com>.
4817 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4818 * font.c (Ffont_at): Likewise.
4819
4820 2012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4821
4822 * widget.c (resize_cb): New function.
4823 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4824 (EmacsFrameResize): Check if all is up to date before changing frame
4825 size.
4826
4827 2012-11-02 Eli Zaretskii <eliz@gnu.org>
4828
4829 Implement backtrace output for fatal errors on MS-Windows.
4830 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4831 (BACKTRACE_LIMIT_MAX): New macro.
4832 (w32_backtrace): New function.
4833 (emacs_abort): Use w32_backtrace when the user chooses not to
4834 attach a debugger. Update the text of the abort dialog.
4835
4836 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4837
4838 Window-related stuff cleanup here and there.
4839 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4840 Use decode_any_window.
4841 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4842 * xdisp.c (Fformat_mode_line): Likewise.
4843 * font.c (Ffont_at): Use decode_live_window.
4844 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4845 * window.c (decode_next_window_args): Likewise.
4846 (decode_any_window): Remove static.
4847 * window.h (decode_any_window): Add prototype.
4848 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4849 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4850 respectively.
4851
4852 2012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4853
4854 Remove pad from struct input_event.
4855 * termhooks.h (struct input_event): Remove padding field.
4856 Adjust comment.
4857 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4858 member is never cons for a long time. Adjust comment.
4859 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4860 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4861 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4862 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4863
4864 2012-11-01 Eli Zaretskii <eliz@gnu.org>
4865
4866 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4867
4868 2012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4869
4870 Fix crash when using Emacs as commit editor for git (Bug#12697).
4871 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4872 and it is configured in conf_post.h.
4873 (Fcall_process): Don't invoke both setsid and setpgid; the former
4874 is enough, if it exists.
4875 * callproc.c (Fcall_process, child_setup):
4876 * process.c (create_process): Use setpgid.
4877 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4878 for the real thing.
4879 * dispnew.c (init_display): Initialize the foreground group
4880 if we are running a tty display.
4881 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4882 * lisp.h (init_foreground_group): New decl.
4883 * sysdep.c (inherited_pgroup): New static var.
4884 (init_foreground_group, tcsetpgrp_without_stopping)
4885 (narrow_foreground_group, widen_foreground_group): New functions.
4886 (init_sys_modes): Narrow foreground group.
4887 (reset_sys_modes): Widen foreground group.
4888
4889 2012-10-31 Michael Albinus <michael.albinus@gmx.de>
4890
4891 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4892
4893 2012-10-31 Martin Rudalics <rudalics@gmx.at>
4894
4895 * minibuf.c (read_minibuf): Restore current buffer since
4896 choose_minibuf_frame calling Fset_frame_selected_window may
4897 change it (Bug#12766).
4898
4899 2012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4900
4901 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4902
4903 2012-10-30 Kenichi Handa <handa@gnu.org>
4904
4905 * font.c (Ffont_at): If WINDOW is specified and it is not
4906 displaying the current buffer, signal an error.
4907
4908 2012-10-29 Daniel Colascione <dancol@dancol.org>
4909
4910 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4911 In preparation for fixing bug#12739, move these functions from
4912 here...
4913
4914 * coding.h, coding.c: ... to here, and compile them only when
4915 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4916 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
4917
4918 2012-10-28 Eli Zaretskii <eliz@gnu.org>
4919
4920 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4921 (timer_loop, getitimer, setitimer): Use it instead of
4922 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4923 'clock'.
4924 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4925 literal 10000.
4926
4927 2012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4928
4929 * nsterm.m (NO_APPDEFINED_DATA): New define.
4930 (last_appdefined_event_data): New variable
4931 (last_appdefined_event): Remove.
4932 (ns_select): Initialize t from last_appdefined_event_data instead
4933 of [last_appdefined_event data1].
4934 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4935 remove last_appdefined_event (Bug#12698).
4936
4937 2012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4938
4939 * frame.c (x_set_font): Catch internal error.
4940
4941 2012-10-27 Eli Zaretskii <eliz@gnu.org>
4942
4943 Avoid overflow in w32 implementation of interval timers.
4944 When possible, for ITIMER_PROF count only times the main thread
4945 actually executes.
4946 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
4947 'volatile ULONGLONG' types. All the other data which was
4948 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
4949 (GetThreadTimes_Proc): New typedef.
4950 (w32_get_timer_time): New function, returns a suitable time value
4951 for the timer.
4952 (timer_loop): Enter critical section when accessing ULONGLONG
4953 values of the itimer_data struct, as these accesses are no longer
4954 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4955 Remove unused variable.
4956 (init_timers): Initialize s_pfn_Get_Thread_Times.
4957 (start_timer_thread): Don't assign itimer->caller_thread here.
4958 (getitimer): Assign itimer->caller_thread here.
4959 (setitimer): Always call getitimer to get the value of ticks_now.
4960 (sys_spawnve): Avoid compiler warning about format mismatch.
4961
4962 2012-10-26 Eli Zaretskii <eliz@gnu.org>
4963
4964 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4965 mouse movement events if the menu bar is active. This avoids
4966 producing a busy "hour-glass" cursor by Windows if the mouse
4967 pointer is positioned over a tooltip shown for some menu item.
4968
4969 2012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4970
4971 Don't assume process IDs fit in int.
4972 * emacs.c (shut_down_emacs) [!DOS_NT]:
4973 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4974 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4975 Use pid_t, not int, to store process IDs, as 'int'
4976 is not wide enough on a few platforms (e.g., AIX and IRIX).
4977
4978 2012-10-23 Kenichi Handa <handa@gnu.org>
4979
4980 The following change is to make face-font-rescale-alist work
4981 correctly for non-ASCII fonts.
4982
4983 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4984 (font_open_for_lface): Handle Vface_font_rescale_alist.
4985
4986 2012-10-23 Chong Yidong <cyd@gnu.org>
4987
4988 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4989
4990 2012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4991
4992 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4993 for screen font.
4994 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4995
4996 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4997 event (Bug#12681).
4998
4999 2012-10-21 Glenn Morris <rgm@gnu.org>
5000
5001 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
5002
5003 2012-10-20 Paul Eggert <eggert@cs.ucla.edu>
5004
5005 Port to OpenBSD 5.1.
5006 * frame.c (Fmouse_position, Fmouse_pixel_position):
5007 * xdisp.c (produce_stretch_glyph):
5008 Declare local vars only when they're needed.
5009 This is clearer and avoids a warning on OpenBSD about unused vars.
5010 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
5011 This is safer, and avoids OpenBSD warnings about unused vars.
5012 * keyboard.c (record_menu_key): Remove unnecessary decl.
5013 (poll_timer): Define only if POLL_FOR_INPUT is defined.
5014 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
5015 as our definition clashes with OpenBSD's.
5016 * xfaces.c (load_face_colors, check_lface_attrs)
5017 (get_lface_attributes_no_remap, get_lface_attributes)
5018 (lface_fully_specified_p, x_supports_face_attributes_p)
5019 (tty_supports_face_attributes_p, face_fontset, realize_face)
5020 (realize_x_face, realize_tty_face):
5021 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
5022 merely Lisp_Object *. This is more informative and avoids
5023 a warning on OpenBSD about accessing beyond an object's size.
5024
5025 2012-10-20 Chong Yidong <cyd@gnu.org>
5026
5027 * lread.c (Fload): Doc fix (Bug#12592).
5028
5029 2012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
5030
5031 * font.c (Ffont_at): Fix previous change.
5032
5033 2012-10-19 Eli Zaretskii <eliz@gnu.org>
5034
5035 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
5036 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
5037 for the reasons.
5038
5039 * alloc.c (NSTATICS): Decrease to 0x800.
5040
5041 2012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
5042
5043 * fns.c (Fnreverse): Include the problem element when signaling an
5044 error (bug#12677).
5045
5046 2012-10-18 Jan Djärv <jan.h.d@swipnet.se>
5047
5048 * nsterm.m (ns_select): Check writefds before call to
5049 FD_ISSET (Bug#12668).
5050
5051 2012-10-18 Daniel Colascione <dancol@dancol.org>
5052
5053 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
5054 (staticpro): If we run out of staticpro slots, die with an
5055 informative error instead of just calling emacs_abort.
5056
5057 2012-10-18 Martin Rudalics <rudalics@gmx.at>
5058
5059 Fix two flaws reported by Dmitry Antipov.
5060 * window.c (Ftemp_output_buffer_show): Remove.
5061 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
5062 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
5063
5064 2012-10-17 Eli Zaretskii <eliz@gnu.org>
5065
5066 * makefile.w32-in ($(BLD)/w32.$(O)):
5067 ($(BLD)/vm-limit.$(O)):
5068 ($(BLD)/term.$(O)):
5069 ($(BLD)/unexw32.$(O)):
5070 ($(BLD)/fileio.$(O)):
5071 ($(BLD)/dispnew.$(O)): Update dependencies.
5072
5073 * w32term.h (w32_initialize_display_info, initialize_w32_display):
5074 Add prototypes.
5075
5076 * w32proc.c: Include ctype.h.
5077
5078 * w32.h (init_environment, check_windows_init_file)
5079 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
5080 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
5081 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
5082 (sys_link): Add prototypes.
5083
5084 * w32.c: Include w32select.h.
5085 (sys_access, e_malloc, sys_select): Add prototypes.
5086 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
5087
5088 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
5089
5090 * unexw32.c: Include lisp.h and w32.h.
5091
5092 * term.c [WINDOWSNT]: Include w32term.h.
5093
5094 * process.c [WINDOWSNT]: Add prototype of sys_select.
5095
5096 * fileio.c [WINDOWSNT]: Include w32.h.
5097
5098 * dispnew.c [WINDOWSNT]: Include w32.h.
5099
5100 * cygw32.c (Fcygwin_convert_path_to_windows)
5101 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
5102 Lisp_Object values. (Bug#12661)
5103
5104 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
5105 to Lisp_Object. (Bug#12661)
5106
5107 2012-10-17 Kenichi Handa <handa@gnu.org>
5108
5109 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
5110 invalidate.
5111
5112 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5113
5114 * buffer.c (Fkill_buffer): When unchaining the marker,
5115 reset its buffer pointer to NULL (Bug#12652).
5116
5117 2012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
5118
5119 Do not verify indirection counters of killed buffers (Bug#12579).
5120 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
5121 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
5122
5123 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5124
5125 * alloc.c (Fmake_byte_code): Fix typo in comment.
5126 * print.c (print_interval): Define as static to match prototype.
5127 * indent.c (disptab_matches_widthtab, recompute_width_table):
5128 Convert to eassert.
5129
5130 2012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
5131
5132 * editfns.c (get_system_name): Remove.
5133 * lisp.h (get_system_name): Remove prototype.
5134 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
5135 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
5136
5137 2012-10-15 Daniel Colascione <dancol@dancol.org>
5138
5139 * dbusbind.c: Add comment explaining reason for previous change.
5140
5141 2012-10-15 Martin Rudalics <rudalics@gmx.at>
5142
5143 * window.c (Fwindow_end): Rewrite check whether cached position
5144 can be used (Bug#12600).
5145 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5146 Set windows_or_buffers_changed.
5147
5148 2012-10-15 Daniel Colascione <dancol@dancol.org>
5149
5150 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5151 enabled by undefining the symbol "interface", which the platform
5152 headers define to something incompatible.
5153
5154 2012-10-14 Daniel Colascione <dancol@dancol.org>
5155
5156 * image.c (init_tiff_functions, init_imagemagick_functions)
5157 (init_svg_functions): Fix cygw32 build break by using these
5158 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5159
5160 2012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5161
5162 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5163
5164 2012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5165
5166 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5167
5168 2012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5169
5170 * coding.c (detect_coding): Set coding->id before calling
5171 this->detector.
5172
5173 2012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5174
5175 * fileio.c: Formatting fixes.
5176
5177 2012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5178
5179 Fix some stat-related races.
5180 * fileio.c (Fwrite_region): Avoid race condition if a file is
5181 removed or renamed by some other process immediately after Emacs
5182 writes it but before Emacs stats it. Do not assume that stat (or
5183 fstat) succeeds.
5184 * image.c (slurp_file): Resolve the file name with fopen + fstat
5185 rather than stat + fopen.
5186 (pbm_read_file) [0]: Remove unused code with stat race.
5187 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5188 Remove ineffective code with stat race.
5189
5190 2012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5191
5192 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5193
5194 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5195
5196 * nsterm.m (hold_event_q): New static variable.
5197 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5198 ! q_event_ptr.
5199 (hold_event): New function.
5200 (ns_read_socket): If hold_event_q have events, store them and
5201 return (Bug#12384).
5202 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5203 is zero (Bug#12384).
5204
5205 2012-10-12 Juanma Barranquero <lekktu@gmail.com>
5206
5207 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5208
5209 2012-10-12 Eli Zaretskii <eliz@gnu.org>
5210
5211 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5212
5213 * fileio.c (check_existing): New function.
5214 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5215 instead of calling 'stat', when what's needed is to check whether
5216 a file exists. This avoids expensive system calls on MS-Windows.
5217 (Bug#12587)
5218
5219 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
5220
5221 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5222 determine whether a file exists and is not a directory.
5223
5224 * lisp.h (check_existing): Add prototype.
5225
5226 2012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5227
5228 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5229
5230 2012-10-12 Glenn Morris <rgm@gnu.org>
5231
5232 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5233
5234 2012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5235
5236 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5237
5238 * eval.c (Fautoload): Remember previous autoload status in load-history.
5239
5240 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5241
5242 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5243 * lread.c (load_each_byte, new_backquote_flag, readchar)
5244 (read_filtered_event, lisp_file_lexically_bound_p)
5245 (safe_to_load_version, Fload, complete_filename_p, openp)
5246 (build_load_history, readevalloop, read_escape, read1)
5247 (string_to_number, read_vector, read_list):
5248 * macros.c (Fstart_kbd_macro):
5249 * marker.c (CONSIDER):
5250 * menu.c (parse_single_submenu, digest_single_submenu)
5251 (find_and_return_menu_selection, Fx_popup_menu):
5252 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5253 (Ftry_completion):
5254 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5255 (ns_menu_show):
5256 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5257 (xmenu_show, xdialog_show):
5258 Use bool for booleans.
5259 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5260 as it's not a predicate. All uses changed. Omit unnecessary
5261 buffer termination.
5262
5263 2012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5264
5265 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5266 (save_excursion_restore): Do not restore mark if it was not saved.
5267
5268 2012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5269
5270 * marker.c (cached_modiff): EMACS_INT, not int.
5271
5272 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5273 instead of having a wrong decl.
5274 * nsmenu.m (waiting_for_input): Remove wrong decl.
5275
5276 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5277
5278 keyboard.c, keymap.c: Use bool for booleans.
5279 * dispnew.c (sit_for): Distinguish between 3-way display_option
5280 and boolean do_display.
5281 * keyboard.c (single_kboard, this_command_key_count_reset)
5282 (waiting_for_input, echoing, immediate_quit, input_pending)
5283 (interrupt_input, interrupts_deferred, pop_kboard)
5284 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5285 (command_loop_1, adjust_point_for_property)
5286 (safe_run_hooks_error, input_polling_used, read_char):
5287 (help_char_p, readable_events, kbd_buffer_events_waiting)
5288 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5289 (lucid_event_type_list_p, get_input_pending):
5290 (gobble_input, menu_separator_name_p, menu_bar_item)
5291 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5292 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5293 (keyremap_step, test_undefined, read_key_sequence)
5294 (detect_input_pending, detect_input_pending_ignore_squeezables)
5295 (detect_input_pending_run_timers, requeued_events_pending_p)
5296 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5297 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5298 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5299 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5300 (accessible_keymaps_1, Fkey_description, push_key_description):
5301 (shadow_lookup, struct where_is_internal_data)
5302 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5303 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5304 (describe_map, describe_vector):
5305 * menu.c (single_menu_item):
5306 * nsmenu.m (ns_update_menubar):
5307 * process.c (wait_reading_process_output):
5308 * search.c (scan_buffer, scan_newline):
5309 Use bool for boolean.
5310 * keyboard.c (timers_run, swallow_events)
5311 (detect_input_pending_run_timers):
5312 * process.c (wait_reading_process_output):
5313 Use unsigned for counter where wraparound-on-overflow is desired,
5314 since unsigned is guaranteed to have that behavior and signed is not.
5315 (read_char): Use ptrdiff_t for string length.
5316 (get_input_pending): Remove first argument, since it was always
5317 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5318 and behave as if it had that value. Return new value of
5319 input_pending. All callers changed.
5320 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5321 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5322 a string length.
5323 * keymap.c (push_key_description): Omit last arg, which was always 1.
5324 All callers changed.
5325
5326 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5327
5328 2012-10-10 Juanma Barranquero <lekktu@gmail.com>
5329
5330 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5331 ($(BLD)/term.$(O)): Update dependencies.
5332
5333 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5334
5335 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5336 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5337 initializer for PVEC_NORMAL_VECTOR.
5338
5339 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5340
5341 Clean out old termopts cruft.
5342 * termopts.h (flow_control, meta_key): Remove unused decls.
5343 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5344 Don't include termopts.h.
5345
5346 2012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5347
5348 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5349
5350 2012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5351
5352 * commands.h (immediate_quit): Remove duplicate decl.
5353
5354 2012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5355
5356 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5357 caching.
5358 (nsfont_open): Remove setting of Vfonts_in_cache.
5359 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5360
5361 2012-10-09 Eli Zaretskii <eliz@gnu.org>
5362
5363 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5364 match what GetLastError returns. Explain why the function is
5365 needed.
5366
5367 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5368 'is_tooltip_frame', to avoid confusion with its global namesake.
5369
5370 2012-10-08 Daniel Colascione <dancol@dancol.org>
5371
5372 * xdisp.c (start_hourglass): Call w32_note_current_window when
5373 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5374 build that caused Emacs to display the hourglass cursor forever.
5375
5376 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5377 which is broken under remote desktop, calculate the number of
5378 colors available for a display based on the display's number of
5379 planes and number of bits per pixel per plane. (bug#10397).
5380
5381 2012-10-08 Jan Djärv <jan.h.d@swipnet.se>
5382
5383 * nsfont.m (Vfonts_in_cache): New variable.
5384 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5385 are used. Add cached fonts to Vfonts_in_cache.
5386 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5387
5388 2012-10-08 Juanma Barranquero <lekktu@gmail.com>
5389
5390 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5391 in nt/config.nt.
5392 (FONT_H): Define after FRAME_H.
5393 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5394 Update dependencies.
5395
5396 * w32term.c: Remove leftover declaration of keyboard_codepage.
5397
5398 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5399
5400 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5401 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5402 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5403 (GLOBAL_SOURCES): Add cygw32.c.
5404 ($(BLD)/unexw32.$(O)):
5405 ($(BLD)/w32.$(O)):
5406 ($(BLD)/w32console.$(O)):
5407 ($(BLD)/w32fns.$(O)):
5408 ($(BLD)/w32heap.$(O)):
5409 ($(BLD)/w32menu.$(O)):
5410 ($(BLD)/w32proc.$(O)): Add w32common.h.
5411
5412 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5413 'const char *'.
5414 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5415
5416 2012-10-08 Daniel Colascione <dancol@dancol.org>
5417
5418 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5419 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5420 accidental message numbering hole. Change other messages to
5421 match.
5422
5423 * w32select.h (HAVE_W32SELECT): Remove.
5424
5425 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
5426 w32common.h instead of w32heap.h.
5427
5428 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5429 (get_allocation_unit, get_processor_type, get_w32_major_version)
5430 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5431 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5432 (OS_NT, os_subtype, cache_system_info): Move declarations to
5433 w32common.
5434
5435 * w32heap.c: Include w32common.h.
5436 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
5437 (w32_minor_version, w32_build_number, w32_subtype):
5438 Remove duplicate definitions.
5439
5440 * w32fns.c: Include w32common.h; include w32heap.h only in
5441 WINDOWSNT.
5442
5443 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5444 Use `report_file_error' instead of `error' in order to better
5445 inform users of what went wrong. Increase NTGUI_UNICODE file
5446 dialog box file name length to 32k, the maximum allowed by the NT
5447 kernel.
5448
5449 * w32common.h: New file.
5450 (ROUND_UP, ROUND_DOWN, get_page_size)
5451 (get_allocation_unit, get_processor_type, get_w32_major_version)
5452 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5453 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5454 (OS_NT, os_subtype, cache_system_info): Move here.
5455
5456 * unexw32.c, unexcw.c: Include w32common.h.
5457
5458 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5459 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5460 to call syms_of_w32select.
5461
5462 * cygw32.h: Remove obsolete EXFUN declarations.
5463
5464 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5465
5466 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5467 of w32inevt.o from SOME_MACHINE_OBJECTS.
5468
5469 2012-10-08 Daniel Colascione <dancol@dancol.org>
5470
5471 * image.c: Permanent fix for JPEG compilation issue --- limit
5472 jpeglib `boolean' redefinition to Cygwin builds.
5473
5474 2012-10-08 Eli Zaretskii <eliz@gnu.org>
5475
5476 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5477
5478 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5479 Cygwin.
5480
5481 2012-10-08 Daniel Colascione <dancol@dancol.org>
5482
5483 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5484 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5485 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5486 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5487 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5488 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5489 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5490 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5491 now a supported configuration.
5492
5493 * Makefile.in: consolidate image variables into LIBIMAGE; add
5494 W32_OBJ and W32_LIBS. Compile new files.
5495
5496 * conf_post.h:
5497 (_DebPrint) declare tracing facility for W32 debugging. We need
5498 to unify tracing later.
5499
5500 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5501 unconditional use of W32 Unicode functions. Cygwin runs only on
5502 100% Unicode operating systems.
5503
5504 * cygw32.c: New file. Define Cygwin-specific facilities.
5505 (Fcygwin_convert_path_to_windows)
5506 (Fcygwin_convert_path_from_windows): New user functions for
5507 accessing Cygwin path-munging routines.
5508
5509 * cygw32.h: New file.
5510 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5511 UTF-16LE strings temporarily inside non-Lisp-visible string
5512 objects.
5513
5514 (w32_strerror): Just what it says on the tin.
5515
5516 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5517 also run for Cygwin; both systems have the same problem with using
5518 GUI facilities in a forked child. Also call syms_of_cygw32,
5519 syms_of_w32select in correct places.
5520
5521 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5522 needs fork-then-exec for daemon launching.
5523
5524 * font.h: Include frame.h.
5525
5526 * image.c: Use the image library cache machinery only when we're
5527 compiling for native WINDOWSNT; Cygwin can use shared libraries
5528 like any other Unixlike system.
5529
5530 * keyboard.c: Clarify a comment regarding the input loop.
5531
5532 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5533 functions directly instead of trying to detect at runtime that our
5534 host operating system supports them. We make this change for two
5535 reasons: Cygwin lacks support for the multibyte character
5536 conversion functions used by the legacy menu code, and Cygwin
5537 never needs to rely on non-Unicode APIs.
5538
5539 * unexw32.c (hinst): Declare extern.
5540
5541 * w32.c: Change header order;
5542 (w32_strerror): Move to w32fns.c because we need it for
5543 non-WINDOWSNT builds.
5544
5545 * w32.h: Add #error macro to make sure we don't include w32.h for
5546 Cygwin builds. Remove w32select declarations.
5547
5548 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
5549 w32fns.c. w32console.c is WINDOWSNT-only.
5550
5551 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5552 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5553 POSIXy alternative.
5554 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5555 (w32_major_version, w32_minor_version, w32_build_number)
5556 (os_subtype, sound_type): Define here
5557 (w32_defined_color): Make color parameter const for consistency
5558 with other _defined_color functions.
5559 (w32_createwindow): Unconditionally call w32_init_class instead of
5560 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5561 through the code is complex and unnecessary because class
5562 registration is practically free.
5563 (w32_name_of_message): New EMACSDEBUG-only function.
5564 (Fset_message_beep): Move here
5565 (Fx_open_connection): Require that the display name for Windows be
5566 "w32" for consistency, emacsclient disambiguation, and maybe, one
5567 day, multi-window-system support.
5568 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5569 Cygwin files for W32 GUI facilities, since these clearly don't
5570 expect Cygwin names.
5571 (_DebPrint): Define.
5572 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5573 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5574 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5575 (w32_last_error): Remove.
5576
5577 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5578
5579 * w32heap.c (syspage_mask): Declare here.
5580 (cache_system_info): Remove.
5581
5582 * w32inevt.c (faked_key): Define globally, not statically.
5583 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5584 (w32_console_toggle_lock_key): Move to w32fns.c.
5585
5586 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5587
5588 * w32proc.c (_DebPrint): Move to w32fns.c.
5589 * w32select.c: Include string.h, stdio.h for Cygwin.
5590 * w32select.h: New File.
5591
5592 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5593 get_osfhandle.
5594 (w32_message_fd): New variable. Under Cygwin, holds the file
5595 descriptor the system used to tell us about pending thread
5596 messages.
5597
5598 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5599 that prevented compilation under non-WINDOWSNT systems.
5600
5601 (w32_initialize): Open /dev/windows and assign it to
5602 w32_message_fd. Provide w32 feature.
5603
5604 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5605 (WM_EMACS_INPUT_READY): add.
5606 (prepend_msg, w32_message_fd): Declare globally.
5607
5608 * w32xfns.c:
5609 (keyboard_handle): Use only when WINDOWSNT.
5610 (notify_msg_ready): New function. Posts a message to the main
5611 thread's message queue under CYGWIN, which wakes up the main
5612 thread from select(2) by making the /dev/windows file descriptor
5613 ready. Under WINDOWSNT, it sets an event the same way the old
5614 code did.
5615
5616 (post, prepend_msg): Actually call notify_msg_ready instead of
5617 setting the input event directly.
5618
5619 2012-10-07 Eli Zaretskii <eliz@gnu.org>
5620
5621 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5622 but it still has blocs in it, don't return it to the system,
5623 instead of aborting. (Bug#12402)
5624
5625 2012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5626
5627 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
5628
5629 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5630 MAC_OS_X_VERSION_10_6.
5631 (syms_of_nsterm): Remove comment about Panther and above for
5632 ns-antialias-text.
5633 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5634 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5635 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5636
5637 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5638 MAC_OS_X_VERSION_10_4.
5639
5640 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5641 MAC_OS_X_VERSION_10_2.
5642
5643 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5644
5645 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5646 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5647
5648 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5649 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
5650 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5651 Remove ns_in_resize check.
5652 (ns_clear_frame_area): Remove resize handle code.
5653
5654 * nsfns.m (ns_in_resize): Remove.
5655 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5656 Remove ns_in_resize check.
5657
5658 2012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5659
5660 Improve sys_siglist detection.
5661 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5662 defined as a macro, as is done in Solaris.
5663 (sys_siglist_entries): New macro.
5664 (save_strsignal): Use it.
5665 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5666 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5667
5668 2012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5669
5670 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5671 fullscreen/Fullscreen.
5672
5673 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5674 tobar_height is new.
5675
5676 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5677 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5678 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5679 (windowDidResize:): Check for correct window if old style fullscreen.
5680 Capitalize word in comment. Remove incorrect comment.
5681 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5682 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5683 error in drawing background.
5684 (toggleFullScreen:): Remove comment. Rearrange calls.
5685 Set toolbar values to zero, save old height in tobar_height.
5686 Restore tool bar height when leaving fullscreen.
5687 (canBecomeMainWindow): New function.
5688
5689 2012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5690
5691 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5692
5693 2012-10-05 Eli Zaretskii <eliz@gnu.org>
5694
5695 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5696
5697 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
5698 that time stamps of directories could also be changed.
5699 Don't request the too broad GENERIC_WRITE, only the more restrictive
5700 FILE_WRITE_ATTRIBUTES access rights.
5701
5702 * fileio.c (Fset_file_times): Special-case ignoring errors for
5703 directories only on MSDOS, not on MS-Windows.
5704
5705 2012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
5706
5707 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5708
5709 2012-10-04 Eli Zaretskii <eliz@gnu.org>
5710
5711 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5712 see whether CreateFile failed.
5713
5714 2012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5715
5716 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5717 to avoid similar races.
5718 * keyboard.c (pending_signals): Now bool, not int.
5719
5720 Port timers to OpenBSD, plus check for timer failures.
5721 OpenBSD problem reported by Han Boetes.
5722 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5723 and/or setitimer.
5724 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5725 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5726 like OpenBSD, which has timer_settime but does not declare it.
5727 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5728 whether to use itimerspec-related primitives. All uses of
5729 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5730
5731 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5732
5733 * profiler.c (handle_profiler_signal): Fix a malloc race
5734 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5735
5736 2012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5737
5738 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5739
5740 2012-10-02 Eli Zaretskii <eliz@gnu.org>
5741
5742 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5743 consistent with the change in return value of 'safe_strsignal'.
5744
5745 2012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5746
5747 Prefer plain 'static' to 'static inline' (Bug#12541).
5748 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5749 (bidi_set_sor_type, bidi_push_embedding_level)
5750 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5751 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5752 (bidi_cache_search, bidi_cache_ensure_space)
5753 (bidi_cache_iterator_state, bidi_cache_find)
5754 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5755 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5756 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5757 Now 'static', not 'static inline'.
5758
5759 Count overruns when profiling; change units to ns.
5760 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5761 Give extra weight to samples after overruns, to attempt to count
5762 the time more accurately.
5763 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5764 the underlying primitives nominally do ns.
5765 (Fprofiler_cpu_start): Document the change. Mention that
5766 the sampling intervals are only approximate.
5767
5768 2012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5769
5770 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5771
5772 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5773 case for the special 0 coding-system.
5774
5775 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5776 (Fmake_overlay): Remove redundant tests.
5777 (fix_start_end_in_overlays): Remove redundant recentering.
5778
5779 2012-10-02 Juanma Barranquero <lekktu@gmail.com>
5780
5781 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5782 Update dependencies.
5783
5784 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5785
5786 Fix a malloc race condition involving strsignal.
5787 A signal can arrive in the middle of a malloc, and Emacs's signal
5788 handler can invoke strsignal, which can invoke malloc, which is
5789 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5790 Fix it by altering the signal handler so that it does not invoke
5791 strsignal.
5792 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5793 * process.c (status_message): Use const pointer, in case strsignal
5794 is #defined to safe_strsignal.
5795 * sysdep.c (sys_siglist, init_signals): Always define and
5796 initialize a substitute sys_siglist if the system does not define
5797 one, even if HAVE_STRSIGNAL.
5798 (safe_strsignal): Rename from strsignal. Always define,
5799 using sys_siglist. Return a const pointer.
5800 * syssignal.h (safe_strsignal): New decl.
5801 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5802
5803 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5804
5805 * w32proc.c (timer_loop): Fix code that waits for timer
5806 expiration, to avoid high CPU usage.
5807
5808 2012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5809
5810 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5811 (sweep_weak_table): Remove redundant prototypes.
5812
5813 2012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5814
5815 * emacs.c: Move the inclusion of TERM_HEADER after including
5816 windows.h on WINDOWSNT. This avoids compilation problems with
5817 MSVC.
5818
5819 2012-10-01 Eli Zaretskii <eliz@gnu.org>
5820
5821 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5822 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5823 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5824 as the previous version used 'void *'.
5825
5826 * ralloc.c (ROUNDUP): Fix last change.
5827 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5828 'size_t'.
5829
5830 * w32proc.c <disable_itimers>: New static flag.
5831 (init_timers): Initialize it to zero, after creating the critical
5832 sections used by the timer threads.
5833 (term_timers): Set to 1 before deleting the critical sections.
5834 (getitimer, setitimer): If disable_itimers is non-zero, return an
5835 error indication without doing anything. Reported by Fabrice
5836 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
5837 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5838 return results.
5839 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5840 support timers.
5841
5842 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5843 term_ntproc after all the other bookkeeping, to get timers working
5844 as long as possible.
5845
5846 2012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5847
5848 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5849 Suggested by Juri Linkov in
5850 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5851
5852 Prefer plain 'static' to 'static inline' (Bug#12541).
5853 With static functions, modern compilers inline pretty well by
5854 themselves; advice from programmers often hurts as much as it helps.
5855 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5856 this change shrinks the text size of the Emacs executable by 1.1%
5857 without affecting CPU significantly in my benchmark.
5858 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5859 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5860 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5861 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5862 (bset_auto_fill_function, bset_auto_save_file_format)
5863 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5864 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5865 (bset_cache_long_line_scans, bset_case_fold_search)
5866 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5867 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5868 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5869 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5870 (bset_header_line_format, bset_indicate_buffer_boundaries)
5871 (bset_indicate_empty_lines, bset_invisibility_spec)
5872 (bset_left_fringe_width, bset_major_mode, bset_mark)
5873 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5874 (bset_name, bset_overwrite_mode, bset_pt_marker)
5875 (bset_right_fringe_width, bset_save_length)
5876 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5877 (bset_scroll_up_aggressively, bset_selective_display)
5878 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5879 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5880 (set_buffer_overlays_after):
5881 * category.c (bset_category_table):
5882 * charset.c (read_hex):
5883 * coding.c (produce_composition, produce_charset)
5884 (handle_composition_annotation, handle_charset_annotation)
5885 (char_encodable_p):
5886 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5887 (assign_row, set_frame_matrix_frame, make_current)
5888 (add_row_entry):
5889 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5890 * fns.c (maybe_resize_hash_table):
5891 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5892 * gmalloc.c (register_heapinfo):
5893 * image.c (lookup_image_type):
5894 * intervals.c (set_interval_object, set_interval_left)
5895 (set_interval_right, copy_interval_parent, rotate_right)
5896 (rotate_left, balance_possible_root_interval):
5897 * keyboard.c (kset_echo_string, kset_kbd_queue)
5898 (kset_keyboard_translate_table, kset_last_prefix_arg)
5899 (kset_last_repeatable_command, kset_local_function_key_map)
5900 (kset_overriding_terminal_local_map, kset_real_last_command)
5901 (kset_system_key_syms, clear_event, set_prop):
5902 * lread.c (digit_to_number):
5903 * marker.c (attach_marker, live_buffer, set_marker_internal):
5904 * nsterm.m (ns_compute_glyph_string_overhangs):
5905 * process.c (pset_buffer, pset_command)
5906 (pset_decode_coding_system, pset_decoding_buf)
5907 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5908 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5909 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5910 * syntax.c (bset_syntax_table, dec_bytepos):
5911 * terminal.c (tset_param_alist):
5912 * textprop.c (interval_has_some_properties)
5913 (interval_has_some_properties_list):
5914 * window.c (wset_combination_limit, wset_dedicated)
5915 (wset_display_table, wset_hchild, wset_left_fringe_width)
5916 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5917 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5918 (wset_right_fringe_width, wset_right_margin_cols)
5919 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5920 (wset_vertical_scroll_bar_type, wset_window_parameters):
5921 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5922 (wset_column_number_displayed, wset_region_showing)
5923 (window_box_edges, run_window_scroll_functions)
5924 (append_glyph_string_lists, prepend_glyph_string_lists)
5925 (append_glyph_string, set_glyph_string_background_width)
5926 (append_glyph, append_composite_glyph)
5927 (take_vertical_position_into_account):
5928 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5929 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5930 (lface_hash, lface_same_font_attributes_p, lookup_face):
5931 * xml.c (libxml2_loaded_p):
5932 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5933 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5934 Now 'static', not 'static inline'.
5935
5936 * bidi.c: Tune.
5937 (bidi_copy_it): Do the whole copy with a single memcpy.
5938 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5939
5940 Revert the FOLLOW-SYMLINKS change for file-attributes.
5941 Doing it right would require several changes to Tramp, and there's
5942 not enough time to get that tested before the freeze today.
5943 * dired.c (directory_files_internal, Ffile_attributes):
5944 Undo last change.
5945
5946 * frame.c (x_report_frame_params): Port better to wider ints.
5947 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5948 or that pointers can be printed in 15 decimal digits.
5949 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5950
5951 2012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5952
5953 Support x64 build on MS-Windows.
5954 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5955 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5956 compatibility with x64.
5957 (x_get_focus_frame): Add prototype.
5958
5959 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5960 defining an XRectangle structure.
5961
5962 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5963 arithmetics for compatibility with x64.
5964
5965 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5966 compatibility with x64.
5967
5968 * w32heap.h: Adjust prototypes and declarations.
5969
5970 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5971 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5972 DWORD, long, and unsigned long, for compatibility with x64.
5973 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5974 (sbrk): Argument is now of type ptrdiff_t.
5975
5976 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5977 less than 0x0500.
5978 (w32_msg_pump): Use WPARAM type for 'result'.
5979
5980 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5981 architecture.
5982 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5983 compatibility with x64.
5984
5985 * vm-limit.c (lim_data): Now size_t.
5986 (check_memory_limits): Adjust prototypes of real_morecore and
5987 __morecore to receive argument of type ptrdiff_t. Use size_t for
5988 five_percent and data_size.
5989
5990 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5991 variables, for compatibility with x64.
5992 (rva_to_section, offset_to_section, relocate_offset)
5993 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5994 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5995 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5996 for compatibility with x64.
5997
5998 * sysdep.c (STDERR_FILENO): Define if not already defined.
5999
6000 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
6001 (__morecore): Argument type is now ptrdiff_t.
6002 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
6003 (relinquish): Use ptrdiff_t type for 'excess'.
6004 (r_alloc_sbrk): Argument type is now ptrdiff_t.
6005
6006 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
6007 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
6008 instead of a literal number.
6009
6010 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
6011 (min): Define only if not already defined.
6012
6013 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
6014 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
6015 hosts.
6016
6017 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
6018 'bitmaps' is a pointer.
6019
6020 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
6021
6022 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
6023
6024 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6025
6026 file-attributes has a new optional arg FOLLOW-SYMLINKS.
6027 * dired.c (directory_files_internal, Ffile_attributes):
6028 New arg follow_symlinks. All uses changed.
6029
6030 2012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
6031
6032 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
6033
6034 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6035
6036 Support atimers and CPU profiler via profile.c on MS-Windows.
6037 * w32proc.c (sig_mask, crit_sig): New static variables.
6038 (sys_signal): Support SIGALRM and SIGPROF.
6039 (sigemptyset, sigaddset, sigfillset, sigprocmask)
6040 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
6041 sigfillset, and sigprocmask are no longer no-ops.
6042 (sigismember): New function.
6043 (struct itimer_data): New definition.
6044 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
6045 (crit_prof): New static variables.
6046 (MAX_SINGLE_SLEEP): New definition.
6047 (timer_loop, stop_timer_thread, term_timers, init_timers)
6048 (start_timer_thread, getitimer, setitimer): New functions.
6049 (alarm): No longer a no-op, calls setitimer.
6050
6051 * w32.c (term_ntproc): Call term_timers.
6052 (init_ntproc): Make sure all signals are unblocked at startup, to
6053 erase any traces of dumping. Call init_timers.
6054
6055 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
6056 Windows-specific code to display the hourglass mouse pointer is no
6057 longer used.
6058 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
6059 to hourglass timer expiration.
6060 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
6061 Remove, no longer used.
6062 (w32_note_current_window, show_hourglass, hide_hourglass):
6063 New functions, in support of hourglass cursor display similar to other
6064 window systems.
6065 (syms_of_w32fns): Don't initialize hourglass_timer.
6066
6067 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
6068 WINDOWSNT as well.
6069 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
6070
6071 * w32.h (init_timers, term_timers): Add prototypes.
6072
6073 2012-09-30 Kenichi Handa <handa@gnu.org>
6074
6075 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
6076 to the buffer relocation which may be caused by ccl_driver.
6077
6078 2012-09-30 Jan Djärv <jan.h.d@swipnet.se>
6079
6080 * xfns.c (Fx_file_dialog): Update comment.
6081
6082 * w32fns.c (Fx_file_dialog): Update comment.
6083
6084 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
6085 Initialize panel name field if OSX >= 10.6.
6086
6087 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
6088
6089 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
6090
6091 * nsterm.m (NEW_STYLE_FS): New define.
6092 (ns_fullscreen_hook, windowWillEnterFullScreen)
6093 (windowDidEnterFullScreen, windowWillExitFullScreen)
6094 (windowDidExitFullScreen, toggleFullScreen, handleFS)
6095 (setFSValue): New functions.
6096 (EmacsFSWindow): New implementation.
6097 (canBecomeKeyWindow): New function for EmacsFSWindow.
6098 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
6099 (dealloc): Release nonfs_window if in fullscreen.
6100 (updateFrameSize:): Call windowDidMove to update top/left.
6101 (windowWillResize:toSize:): Check if frame is still maximized.
6102 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
6103 next_maximized, maximized_width, maximized_height and nonfs_window.
6104 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
6105 tbar_height.
6106 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
6107 fullscreen. Set maximized_width/height. Act on next_maximized.
6108
6109 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
6110 (EmacsView): Add variables for fullscreen.
6111 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
6112 (EmacsFSWindow): New interface for fullscreen.
6113
6114 2012-09-30 Juanma Barranquero <lekktu@gmail.com>
6115
6116 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6117
6118 2012-09-30 Chong Yidong <cyd@gnu.org>
6119
6120 * fns.c (Frandom): Doc fix.
6121
6122 2012-09-30 Martin Rudalics <rudalics@gmx.at>
6123
6124 * window.c (Vwindow_combination_limit): New default value.
6125 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
6126
6127 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6128
6129 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
6130 Suggested by Eli Zaretskii in
6131 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
6132
6133 2012-09-30 Eli Zaretskii <eliz@gnu.org>
6134
6135 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
6136 HAVE_TIMER_SETTIME is defined.
6137
6138 2012-09-30 Paul Eggert <eggert@cs.ucla.edu>
6139
6140 Profiler improvements: more-accurate timers, overflow checks.
6141 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
6142 signal.h, setjmp.h. Include systime.h instead.
6143 (saturated_add): New function.
6144 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
6145 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6146 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6147 New static vars.
6148 (enum profiler_cpu_running): New enum.
6149 (profiler_cpu_running): Now of that enum type, not bool.
6150 All uses changed to store the new value.
6151 (handle_profiler_signal): Rename from sigprof_handler_1,
6152 for consistency with other handlers. Do not check whether
6153 cpu_log is a hash-table if garbage collecting, since it
6154 doesn't matter in that case.
6155 (deliver_profiler_signal): Rename from sigprof_handler,
6156 for consistency with other handlers.
6157 (setup_cpu_timer): New function, with much of what used to be in
6158 Fprofiler_cpu_start. Check for out-of-range argument.
6159 Prefer timer_settime if available, and prefer
6160 thread cputime clocks, then process cputime clocks, then
6161 monotonic clocks, to the old realtime clock. Use make_timeval
6162 to round more-correctly when falling back to setitimer.
6163 (Fprofiler_cpu_start): Use it.
6164 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6165 Don't assume that passing NULL as the 2nd argument of setitimer
6166 is the same as passing a pointer to all-zero storage.
6167 Ignore SIGPROF afterwards.
6168 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6169 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6170 non-fatal signal handlers. Ignore SIGPROF on startup.
6171 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6172 in profiler.c, since sysdep.c now uses it.
6173
6174 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6175 Suggested by Eli Zaretskii in
6176 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6177
6178 2012-09-29 Juanma Barranquero <lekktu@gmail.com>
6179
6180 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6181
6182 2012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6183
6184 * lisp.h (struct backtrace): Remove indirection for `function' field.
6185 * xdisp.c (redisplay_internal):
6186 * profiler.c (record_backtrace, sigprof_handler_1):
6187 * alloc.c (Fgarbage_collect):
6188 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6189 (Fbacktrace_frame): Adjust accordingly.
6190
6191 2012-09-28 Glenn Morris <rgm@gnu.org>
6192
6193 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6194 (Frun_hook_with_args_until_failure): Doc fixes.
6195
6196 2012-09-28 Eli Zaretskii <eliz@gnu.org>
6197
6198 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6199 Qautomatic_redisplay and change the symbol name. All users changed.
6200
6201 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6202
6203 * profiler.c (sigprof_handler): Fix race condition.
6204
6205 2012-09-28 Glenn Morris <rgm@gnu.org>
6206
6207 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6208
6209 2012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6210
6211 Check more robustly for timer_settime.
6212 * Makefile.in (LIB_TIMER_TIME): New macro.
6213 (LIBES): Add it.
6214 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6215 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6216 call timer_settime.
6217
6218 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6219
6220 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6221
6222 2012-09-26 Juanma Barranquero <lekktu@gmail.com>
6223
6224 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6225
6226 2012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6227
6228 * character.h (MAYBE_UNIFY_CHAR): Remove.
6229 * charset.c, charset.h (maybe_unify_char): Now static.
6230 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6231 Since this stuff is now private to charset.c, there's no need for
6232 a public macro and no need to inline by hand.
6233
6234 2012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6235 Stefan Monnier <monnier@iro.umontreal.ca>
6236 Juanma Barranquero <lekktu@gmail.com>
6237
6238 * profiler.c: New file.
6239 * Makefile.in (base_obj): Add profiler.o.
6240 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6241 ($(BLD)/profiler.$(O)): New target.
6242 * emacs.c (main): Call syms_of_profiler.
6243 * alloc.c (Qautomatic_gc): New constant.
6244 (MALLOC_PROBE): New macro.
6245 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6246 (total_bytes_of_live_objects): New function.
6247 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6248 Call malloc_probe for the memory profiler.
6249 (syms_of_alloc): Define Qautomatic_gc.
6250 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6251 race condition.
6252 (struct backtrace): Move definition...
6253 * lisp.h (struct backtrace): ..here.
6254 (Qautomatic_gc, profiler_memory_running): Declare vars.
6255 (malloc_probe, syms_of_profiler): Declare functions.
6256 * xdisp.c (Qautomatic_redisplay): New constant.
6257 (redisplay_internal): Record itself in backtrace_list.
6258 (syms_of_xdisp): Define Qautomatic_redisplay.
6259
6260 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6261 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6262
6263 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6264
6265 2012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6266
6267 Prefer POSIX timers if available.
6268 They avoid a race if the timer is too close to the current time.
6269 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6270 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
6271 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
6272
6273 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6274
6275 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6276 CHAR_STRING_ADVANCE.
6277 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6278 STRING_CHAR_ADVANCE.
6279
6280 2012-09-25 Juanma Barranquero <lekktu@gmail.com>
6281
6282 Move Vlibrary_cache to emacs.c and reset before dumping.
6283
6284 * lisp.h (reset_image_types): Declare.
6285 [WINDOWSNT] (Vlibrary_cache): Declare.
6286
6287 * image.c (reset_image_types): New function.
6288
6289 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6290 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6291 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6292
6293 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6294 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6295
6296 * w32.h (Vlibrary_cache): Do not declare.
6297
6298 2012-09-25 Eli Zaretskii <eliz@gnu.org>
6299
6300 * w32proc.c (sys_signal): Handle all signals defined by the
6301 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6302 handlers for signals supported by Windows. Don't override
6303 term_ntproc as the handler for SIGABRT.
6304 (sigaction): Rewrite to call sys_signal instead of duplicating its
6305 code.
6306 (sys_kill): Improve commentary.
6307
6308 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6309 consistency with a signature of a signal handler. All callers
6310 changed.
6311 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6312 install term_ntproc as a signal handler for SIGABRT, as that
6313 should be done by the dumped Emacs.
6314
6315 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6316
6317 * w32select.c (term_w32select): Protect against repeated
6318 invocation by setting clipboard_owner to NULL after calling
6319 DestroyWindow.
6320
6321 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6322 and term_ntproc to their modified signatures.
6323
6324 * character.c (char_string, string_char): Remove calls to
6325 MAYBE_UNIFY_CHAR. See the discussion starting at
6326 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6327 for the details.
6328
6329 2012-09-25 Chong Yidong <cyd@gnu.org>
6330
6331 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6332
6333 2012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6334
6335 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6336 when encountering an unknown bytecode.
6337
6338 2012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6339
6340 image.c, indent.c: Use bool for booleans.
6341 * dispextern.h (struct image_type): Members valid_p, load, init
6342 now return bool, not int. All uses changed.
6343 * image.c: Omit unnecessary static decls.
6344 (x_create_bitmap_mask, x_build_heuristic_mask):
6345 Return void, not int, since callers don't care about the return value.
6346 (x_create_bitmap_mask, define_image_type, valid_image_p)
6347 (struct image_keyword, parse_image_spec, image_spec_value)
6348 (check_image_size, image_background)
6349 (image_background_transparent, x_clear_image_1)
6350 (postprocess_image, lookup_image, x_check_image_size)
6351 (x_create_x_image_and_pixmap, xbm_image_p)
6352 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6353 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6354 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6355 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6356 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6357 (png_image_p, init_png_functions, png_load_body, png_load)
6358 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6359 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6360 (init_gif_functions, gif_load, imagemagick_image_p)
6361 (imagemagick_load_image, imagemagick_load, svg_image_p)
6362 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6363 (gs_load):
6364 * nsimage.m (ns_load_image):
6365 * nsterm.m (ns_defined_color):
6366 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6367 * xfns.c (x_defined_color):
6368 * xterm.c (x_alloc_lighter_color_for_widget)
6369 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6370 (x_alloc_lighter_color):
6371 * indent.c (disptab_matches_widthtab, current_column)
6372 (scan_for_column, string_display_width, indented_beyond_p)
6373 (compute_motion, vmotion, Fvertical_motion):
6374 Use bool for booleans.
6375
6376 2012-09-24 Chong Yidong <cyd@gnu.org>
6377
6378 * chartab.c (Fset_char_table_default): Obsolete function removed.
6379
6380 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6381
6382 Move pid_t related decls out of lisp.h.
6383 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6384 (interruptible_wait_for_termination):
6385 Move these decls from lisp.h to syswait.h, since they use pid_t.
6386 Needed on FreeBSD; see Herbert J. Skuhra in
6387 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6388 * callproc.c: Include syswait.h.
6389
6390 gnutls.c, gtkutil.c: Use bool for boolean.
6391 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6392 (emacs_gnutls_handle_error):
6393 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6394 (xg_hide_tooltip, xg_create_frame_widgets)
6395 (create_dialog, xg_uses_old_file_dialog)
6396 (xg_get_file_with_chooser, xg_get_file_with_selection)
6397 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6398 (xg_item_label_same_p, xg_update_menubar)
6399 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6400 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6401 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6402 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6403 (update_frame_tool_bar, free_frame_tool_bar):
6404 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6405 * nsmenu.m (ns_update_menubar):
6406 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6407 * xfns.c (Fx_show_tip) [USE_GTK]:
6408 Use bool for boolean.
6409 * gtkutil.c (xg_update_frame_menubar):
6410 * xmenu.c (update_frame_menubar):
6411 Return void, not int, since caller ignores return value.
6412 * gtkutil.c (xg_change_toolbar_position):
6413 Return void, not 1.
6414
6415 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6416
6417 * makefile.w32-in (BLOCKINPUT_H): Remove.
6418 (SYSSIGNAL_H): New macro.
6419 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6420 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6421 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6422 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6423 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6424 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6425 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6426 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6427 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6428 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6429 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6430 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6431 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6432 ($(BLD)/w32xfns.$(O)): Update dependencies.
6433
6434 2012-09-23 Eli Zaretskii <eliz@gnu.org>
6435
6436 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6437 fatal_error_backtrace.
6438
6439 * w32proc.c (sys_kill): Undo last change: don't do anything when
6440 invoked to deliver SIGABRT to our own process. This is now
6441 handled by emacs_raise.
6442
6443 2012-09-23 Juanma Barranquero <lekktu@gmail.com>
6444
6445 * w32term.c (w32_read_socket): Remove leftover reference to
6446 interrupt_input_pending.
6447
6448 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6449
6450 Do not use SA_NODEFER.
6451 Problem reported by Dani Moncayo in
6452 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6453 * alloc.c (die):
6454 * sysdep.c (emacs_abort): Do not reset signal handler.
6455 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6456 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6457 wanted even on POSIXish hosts, and it doesn't work on Windows.
6458
6459 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6460
6461 * xterm.c (x_term_init): Call fixup_locale before and after calling
6462 gtk_init (Bug#12392).
6463
6464 2012-09-23 Chong Yidong <cyd@gnu.org>
6465
6466 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6467 Vdynamic_library_alist.
6468
6469 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6470 (Fgnutls_available_p): Caller changed.
6471
6472 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6473 (Flibxml_parse_xml_region): Likewise.
6474
6475 * dispextern.h (struct image_type): Remove arg from init function.
6476
6477 * image.c (Finit_image_library, lookup_image_type)
6478 (define_image_type): Remove now-unneeded second arg.
6479 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6480 (init_tiff_functions, init_gif_functions, init_svg_functions):
6481 Arglist and w32_delayed_load calling convention changed.
6482 (gs_type): Remove init_gs_functions; there is no such function.
6483 (valid_image_p, make_image): Fix caller to lookup_image_type.
6484
6485 2012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6486
6487 Simplify and avoid signal-handling races (Bug#12471).
6488 * alloc.c (die):
6489 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6490 Avoid recursive loop if there's a fatal error in the function itself.
6491 * atimer.c (pending_atimers):
6492 * blockinput.h: Don't include "atimer.h"; no longer needed.
6493 (interrupt_input_pending): Remove. All uses removed.
6494 pending_signals now counts both atimers and ordinary interrupts.
6495 This is less racy than having three separate pending-signal flags.
6496 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6497 (input_blocked_p):
6498 Rename from their upper-case counterparts BLOCK_INPUT,
6499 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6500 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6501 This makes it easier to access volatile variables more accurately.
6502 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6503 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6504 that's more reliable if the code is buggy and sets
6505 interrupt_input_blocked to a negative value. All uses changed.
6506 * atimer.c (deliver_alarm_signal):
6507 Remove. No need to deliver this to the parent; any thread can
6508 handle this signal now. All uses replaced by underlying handler.
6509 * atimer.c (turn_on_atimers):
6510 * dispnew.c (handle_window_change_signal):
6511 * emacs.c (handle_danger_signal):
6512 * keyboard.c (kbd_buffer_get_event):
6513 Don't reestablish signal handler; not needed with sigaction.
6514 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6515 (UNBLOCK_INPUT_TO):
6516 Rework to avoid unnecessary accesses to volatile variables.
6517 (UNBLOCK_INPUT_TO): Now a function.
6518 (totally_unblock_input, unblock_input): New decls.
6519 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6520 (init_data): Remove. Necessary stuff now done in init_signal.
6521 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6522 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6523 (fatal_error_code): Remove; no longer needed.
6524 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6525 it doesn't always backtrace. All uses changed. No need to reset
6526 signal to default, since sigaction and/or die does that for us now.
6527 Use emacs_raise (FOO), not kill (getpid (), FOO).
6528 (main): Check more-accurately whether we're dumping.
6529 Move fatal-error setup to sysdep.c
6530 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6531 * gtkutil.c (xg_get_file_name, xg_get_font):
6532 Remove no-longer-needed signal-mask manipulation.
6533 * keyboard.c, process.c (POLL_FOR_INPUT):
6534 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6535 * keyboard.c (read_avail_input): Remove.
6536 All uses replaced by gobble_input.
6537 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6538 (kbd_buffer_store_event_hold, gobble_input):
6539 (record_asynch_buffer_change) [USABLE_SIGIO]:
6540 (store_user_signal_events):
6541 No need to mess with signal mask.
6542 (gobble_input): If blocking input and there are terminals, simply
6543 set pending_signals to 1 and return. All hooks changed to not
6544 worry about whether input is blocked.
6545 (process_pending_signals): Clear pending_signals before processing
6546 them, in case a signal comes in while we're processing.
6547 By convention callers now test pending_signals before calling us.
6548 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6549 New functions, to support changes to blockinput.h.
6550 (handle_input_available_signal): Now extern.
6551 (reinvoke_input_signal): Remove. All uses replaced by
6552 handle_async_input.
6553 (quit_count): Now volatile, since a signal handler uses it.
6554 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6555 All callers changed. Block SIGINT only if not already blocked.
6556 Clear sigmask reliably, even if Fsignal returns, which it can.
6557 Omit unnecessary accesses to volatile var.
6558 (quit_throw_to_read_char): No need to restore sigmask.
6559 * keyboard.c (gobble_input, handle_user_signal):
6560 * process.c (wait_reading_process_output):
6561 Call signal-handling code rather than killing ourselves.
6562 * lisp.h: Include <float.h>, for...
6563 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6564 (pending_signals): Now volatile.
6565 (syms_of_data): Now const if IEEE floating point.
6566 (handle_input_available_signal) [USABLE_SIGIO]:
6567 (terminate_due_to_signal, record_child_status_change): New decls.
6568 * process.c (create_process): Avoid disaster if memory is exhausted
6569 while we're processing a vfork, by tightening the critical section
6570 around the vfork.
6571 (send_process_frame, process_sent_to, handle_pipe_signal)
6572 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6573 ignores SIGPIPE.
6574 (send_process): No need for setjmp/longjmp any more, since the
6575 SIGPIPE stuff is now gone. Instead, report an error if errno
6576 is EPIPE.
6577 (record_child_status_change): Now extern. PID and W are now args.
6578 Return void, not bool. All callers changed.
6579 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6580 Remove. All uses removed. This bug should be fixed now in a
6581 different way.
6582 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6583 and record the child status change directly. This avoids the
6584 need to futz with the signal mask.
6585 (process_fatal_action): Move here from emacs.c.
6586 (emacs_sigaction_flags): New function, containing
6587 much of what used to be in emacs_sigaction_init.
6588 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6589 caught by emacs, to make races less likely.
6590 (deliver_process_signal): Rename from handle_on_main_thread.
6591 All uses changed.
6592 (BACKTRACE_LIMIT_MAX): Now at top level.
6593 (thread_backtrace_buffer, threadback_backtrace_pointers):
6594 New static vars.
6595 (deliver_thread_signal, deliver_fatal_thread_signal):
6596 New functions, for more-accurate delivery of thread-specific signals.
6597 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6598 (deliver_arith_signal): Handle in this thread, not
6599 in the main thread, since it's triggered by this thread.
6600 (maybe_fatal_sig): New function.
6601 (init_signals): New arg DUMPING so that we can be more accurate
6602 about whether we're dumping. Caller changed.
6603 Treat thread-specific signals differently from process-general signals.
6604 Block all signals while handling fatal error; that's safer.
6605 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6606 on IEEE hosts.
6607 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6608 Ignore SIGPIPE unless batch.
6609 (emacs_backtrace): Output backtrace for the appropriate thread,
6610 which is not necessarily the main thread.
6611 * syssignal.h: Include <stdbool.h>.
6612 (emacs_raise): New macro.
6613 * xterm.c (x_connection_signal): Remove; no longer needed
6614 now that we use sigaction.
6615 (x_connection_closed): No need to mess with sigmask now.
6616 (x_initialize): No need to reset SIGPIPE handler here, since
6617 init_signals does this for us now.
6618
6619 2012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6620
6621 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
6622 background rect may be larger (Bug#12245).
6623
6624 2012-09-23 Chong Yidong <cyd@gnu.org>
6625
6626 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6627
6628 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6629
6630 * .gdbinit: Just stop at fatal_error_backtrace.
6631 See Stefan Monnier's request in
6632 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6633 Remove no-longer-used query of system type.
6634
6635 2012-09-22 Chong Yidong <cyd@gnu.org>
6636
6637 * search.c (Freplace_match): Doc fix (Bug#12325).
6638
6639 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6640
6641 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6642 (Fline_end_position): Doc fix.
6643
6644 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6645
6646 2012-09-22 Chong Yidong <cyd@gnu.org>
6647
6648 * dispextern.h (struct image_type): Add new slot, storing a type
6649 initialization function.
6650
6651 * image.c (define_image_type): Call the image initializer function
6652 if it is defined. Arguments and return value changed.
6653 (valid_image_p, make_image): Callers changed.
6654 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
6655 (gif_type, imagemagick_type, svg_type, gs_type):
6656 Add initialization functions.
6657 (Finit_image_library): Call lookup_image_type.
6658 (CHECK_LIB_AVAILABLE): Macro deleted.
6659 (lookup_image_type): Call define_image_type here, rather than via
6660 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6661 (syms_of_image): Move define_image_type calls for xbm_type and
6662 pbm_type to lookup_image_type.
6663
6664 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6665
6666 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6667 'idle_timers' from here ...
6668 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6669 lists, to avoid infloops when the timer does something stupid,
6670 like reinvoke itself with the same or smaller time-out.
6671 (Bug#12447)
6672
6673 2012-09-22 Martin Rudalics <rudalics@gmx.at>
6674
6675 * window.c (Fsplit_window_internal): Handle only Qt value of
6676 Vwindow_combination_limit separately.
6677 (Qtemp_buffer_resize): New symbol.
6678 (Vwindow_combination_limit): New default value.
6679 Rewrite doc-string.
6680
6681 2012-09-22 Eli Zaretskii <eliz@gnu.org>
6682
6683 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6684 the new overlay string. (Bug#10159)
6685
6686 2012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6687
6688 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6689 or that fprintf is async-signal-safe. POSIX doesn't require
6690 either assumption.
6691
6692 2012-09-22 Chong Yidong <cyd@gnu.org>
6693
6694 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6695 (Bug#8207).
6696
6697 2012-09-22 Kenichi Handa <handa@gnu.org>
6698
6699 * composite.c (composition_reseat_it): Handle the case that a
6700 grapheme cluster is not covered by a single font (Bug#12352).
6701
6702 2012-09-21 Chong Yidong <cyd@gnu.org>
6703
6704 * image.c (define_image_type): Avoid adding duplicate types to
6705 image_types (Bug#12463). Suggested by Jörg Walter.
6706
6707 2012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6708
6709 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6710 (print_load_command_name): Add case LC_DATA_IN_CODE.
6711 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6712
6713 2012-09-21 Glenn Morris <rgm@gnu.org>
6714
6715 * eval.c (Frun_hook_with_args_until_success)
6716 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6717
6718 2012-09-21 Andreas Schwab <schwab@linux-m68k.org>
6719
6720 * fileio.c (Ffile_selinux_context): Only call freecon when
6721 lgetfilecon succeeded.
6722 (Fset_file_selinux_context): Likewise. (Bug#12444)
6723
6724 2012-09-21 Eli Zaretskii <eliz@gnu.org>
6725
6726 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6727 reordering, locate the cursor by calling set_cursor_from_row; if
6728 that fails, clear the desired glyph matrix before returning a
6729 failure indication to the caller. Fixes leaving garbled display
6730 when fast scrolling with a down-key. (Bug#12403)
6731 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6732 scrolling through multibyte text.
6733
6734 2012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6735
6736 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6737 calling mark_vectorlike since that's the one that marks the window.
6738 (mark_discard_killed_buffers): Mark the final cdr.
6739 * window.h (struct window): Move prev/next_buffers to the
6740 non-standard fields.
6741 * window.c (make_window): Initialize prev/next_buffers manually.
6742
6743 2012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6744
6745 Omit unused arg EXPECTED from socket hooks.
6746 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6747 * nsterm.m (ns_term_init):
6748 * termhooks.h (struct terminal.read_socket_hook):
6749 * w32inevt.c (w32_console_read_socket):
6750 * w32term.c (w32_read_socket):
6751 * xterm.c (XTread_socket):
6752 Omit unused arg EXPECTED. All callers changed.
6753 (store_user_signal_events): Return void, not int, since callers no
6754 longer care about the return value. All uses changed.
6755
6756 2012-09-20 Juanma Barranquero <lekktu@gmail.com>
6757
6758 * w32gui.h (XParseGeometry): Do not declare.
6759
6760 2012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6761
6762 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
6763 Ignore 'expected'. See Eli Zaretskii in
6764 <http://bugs.gnu.org/12471#8> (last line).
6765
6766 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6767 (XParseGeometry): Now static. Substitute extremal values for
6768 values that are out of range.
6769
6770 2012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6771
6772 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6773
6774 * nsfns.m (XParseGeometry): Remove.
6775 (Fx_create_frame): Call x_set_offset to correctly interpret
6776 top_pos in geometry.
6777
6778 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
6779 (Fx_parse_geometry): If there is a space in string, call
6780 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6781
6782 2012-09-17 Eli Zaretskii <eliz@gnu.org>
6783
6784 * search.c (scan_buffer): Use character positions in calls to
6785 region_cache_forward and region_cache_backward, not byte
6786 positions. (Bug#12196)
6787
6788 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6789 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6790
6791 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6792 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6793 emacs_blocked_malloc, now deleted.
6794
6795 2012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6796
6797 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6798 The workaround was for improving performance on Solaris 2.4, but
6799 is getting in the way now. Emacs will still work if someone is
6800 still running Solaris 2.4 in a museum somewhere; Sun dropped
6801 support for Solaris 2.4 in 2003.
6802 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6803 * process.c (create_process) [HAVE_WORKING_VFORK]:
6804 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6805 since Emacs no longer uses vfork on that platform.
6806
6807 2012-09-17 Glenn Morris <rgm@gnu.org>
6808
6809 * emacs.c: Use COPYRIGHT.
6810
6811 2012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6812
6813 Remove configure's --without-sync-input option (Bug#12450).
6814 When auditing signal-handling in preparation for cleaning it up,
6815 I found that SYNC_INPUT has race conditions and would be a real
6816 pain to fix. Since it's an undocumented and deprecated
6817 configure-time option, now seems like a good time to remove it.
6818 Also see <http://bugs.gnu.org/11080#16>.
6819 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6820 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6821 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6822 (malloc_hysteresis):
6823 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6824 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6825 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6826 (dont_register_blocks, bytes_used_when_reconsidered)
6827 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6828 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6829 [!SYSTEM_MALLOC && !SYNC_INPUT]:
6830 Remove. All uses removed.
6831 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6832 implementation, one that depends on whether the new macro
6833 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6834 is defined.
6835 * atimer.c (run_timers, handle_alarm_signal):
6836 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6837 (handle_async_input, process_pending_signals)
6838 (handle_input_available_signal, init_keyboard):
6839 * nsterm.m (ns_read_socket):
6840 * process.c (wait_reading_process_output):
6841 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6842 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6843 (emacs_write):
6844 * xterm.c (XTread_socket):
6845 Assume SYNC_INPUT.
6846 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6847 * eval.c (handling_signal): Remove. All uses removed.
6848 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6849 All uses replaced with the SYNC_INPUT version.
6850 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6851 Remove decls.
6852 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6853 Now static.
6854
6855 * font.c (Ffont_shape_gstring): Remove unused local.
6856
6857 2012-09-16 Glenn Morris <rgm@gnu.org>
6858
6859 * Makefile.in (clean): No longer run nextstep's clean.
6860
6861 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6862 (ns_frag): Remove.
6863 (ns-app): Move here from ns.mk, and simplify.
6864 (clean): Simplify nextstep entry.
6865 * ns.mk: Remove file.
6866
6867 2012-09-17 Kenichi Handa <handa@gnu.org>
6868
6869 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6870 not covert the last few charactes.
6871
6872 2012-09-16 Kenichi Handa <handa@gnu.org>
6873
6874 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6875 here, but just check the validity of glyphs in the glyph-string.
6876
6877 2012-09-16 Martin Rudalics <rudalics@gmx.at>
6878
6879 * window.c (Fwindow_parameter, Fset_window_parameter):
6880 Accept any window as argument (Bug#12452).
6881
6882 2012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6883
6884 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6885 to ns_term_init to avoid memory leak.
6886
6887 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6888 explicit retain/release.
6889 (ns_term_init): Only allow one display. Initialize outerpool and
6890 ns_*_types.
6891
6892 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6893
6894 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6895 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6896 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6897 the Microsoft problem in a different way, by altering ../nt/config.nt.
6898
6899 2012-09-15 Eli Zaretskii <eliz@gnu.org>
6900
6901 * w32xfns.c:
6902 * w32uniscribe.c:
6903 * w32term.c:
6904 * w32select.c:
6905 * w32reg.c:
6906 * w32proc.c:
6907 * w32menu.c:
6908 * w32inevt.c:
6909 * w32heap.c:
6910 * w32font.c:
6911 * w32fns.c:
6912 * w32console.c:
6913 * w32.c:
6914 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6915 by lisp.h. This completes removal of setjmp.h inclusion
6916 erroneously announced in the previous commit. (Bug#12446)
6917
6918 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6919 more accurate.
6920
6921 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6922 not defined as a macro. The latter happens on MS-Windows.
6923 (Bug#12446)
6924
6925 2012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6926
6927 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6928 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
6929 Some instances of '#include <setjmp.h>' removed, if the
6930 only reason for the instance was because "lisp.h" was included.
6931 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6932 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6933 and _longjmp with the new symbols. Emacs already uses _setjmp if
6934 available, so this change affects only POSIXish hosts that have
6935 sigsetjmp but not _setjmp, such as some versions of Solaris and
6936 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6937 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6938 (png_load_body) [HAVE_PNG]:
6939 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6940 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6941 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6942 since PNG requires jmp_buf. This is the only exception to the
6943 general rule that we now use sys_setjmp and sys_longjmp.
6944 This exception is OK since this code does not change the signal
6945 mask or longjmp out of a signal handler.
6946
6947 2012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6948
6949 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6950 Include "syssignal.h", for 'main_thread'.
6951
6952 2012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6953
6954 Avoid out-of-range marker position (Bug#12426).
6955 * insdel.c (replace_range, replace_range_2):
6956 Adjust markers before overlays, as suggested by comments.
6957 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6958 Remove redundant check before calling offset_intervals.
6959
6960 2012-09-14 Martin Rudalics <rudalics@gmx.at>
6961
6962 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6963 current buffer (Bug#12387).
6964
6965 2012-09-14 Juanma Barranquero <lekktu@gmail.com>
6966
6967 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6968
6969 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6970
6971 Use a more backwards-compatible timer format (Bug#12430).
6972 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6973 vector element, not from the 4th, since PSECS is now at the end.
6974 (Fcurrent_idle_time): Doc fix.
6975
6976 2012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6977
6978 Function to mark objects and remove killed buffers at once.
6979 * alloc.c (discard_killed_buffers): Rename to ...
6980 (mark_discard_killed buffers) ... new name. Add marking
6981 of remaining objects. Fix comment. Adjust users.
6982 (mark_object): Do not touch frame buffer lists here.
6983 * frame.c (delete_frame): Reset frame buffer lists here.
6984
6985 2012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6986
6987 Better workaround for GNOME bug when --enable-gcc-warnings.
6988 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6989 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6990 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6991
6992 Simplify SIGIO usage (Bug#12408).
6993 The code that dealt with SIGIO was crufty and confusing, e.g., it
6994 played tricks like "#undef SIGIO" but these tricks were not used
6995 consistently. Simplify mostly by not #undeffing standard symbols,
6996 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6997 or not as we please) rather than "defined SIGIO" (standard symbol
6998 that we probably shouldn't #undef).
6999 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
7000 Modules that need it can include it.
7001 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
7002 * dispextern.h (ignore_sigio): New decl.
7003 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
7004 unconditionally, since it's now a no-op if !USABLE_SIGIO.
7005 * emacs.c (shut_down_emacs):
7006 * keyboard.c (kbd_buffer_store_event_hold):
7007 Use ignore_sigio rather than invoking 'signal' directly.
7008 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
7009 for FIONREAD.
7010 (FIONREAD, SIGIO): Do not #undef.
7011 (tty_read_avail_input): Use #error rather than a syntax error.
7012 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
7013 for I_PIPE, used by SETUP_SLAVE_PTY.
7014 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
7015 * sysdep.c (croak): Remove; no longer needed. This bit of
7016 temporary code, with Fred N. Fish's comment that it's temporary,
7017 has been in Emacs since at least 1992!
7018 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
7019 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
7020 * syssignal.h (croak): Remove decl.
7021 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
7022 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
7023 now that we're termios-only.
7024 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
7025 * term.c (dissociate_if_controlling_tty): Use #error rather than
7026 a run-time error.
7027
7028 Work around GCC and GNOME bugs when --enable-gcc-warnings.
7029 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
7030 to work around GNOME bug 683906.
7031 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
7032 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
7033 This works around GCC bug 54561.
7034
7035 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7036
7037 More fixes for 'volatile' and setjmp/longjmp.
7038 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
7039 * image.c (struct png_load_context) [HAVE_PNG]: New type.
7040 (png_load_body) [HAVE_PNG]:
7041 (jpeg_load_body) [HAVE_JPEG]:
7042 New function, with most of the old parent function's body.
7043 (png_load) [HAVE_PNG]:
7044 (jpeg_load) [HAVE_JPEG]:
7045 Invoke the new function, to avoid longjmp munging our locals.
7046 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
7047 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
7048 longjmp is passed 2, as the C standard doesn't guarantee this.
7049 Instead, store the failure code into mgr->failure_code.
7050
7051 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7052
7053 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
7054 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
7055 (syms_of_keyboard): Remove support for unread-command-char.
7056
7057 2012-09-12 Eli Zaretskii <eliz@gnu.org>
7058
7059 * w32proc.c (sys_kill): If PID is our process ID and the signal is
7060 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
7061 violation. (Bug#12426)
7062
7063 2012-09-12 Paul Eggert <eggert@cs.ucla.edu>
7064
7065 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
7066
7067 2012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
7068
7069 * eval.c: Add `inhibit-debugger'.
7070 (Qinhibit_debugger): New symbol.
7071 (call_debugger): Bind it instead of Qdebug_on_error.
7072 (maybe_call_debugger): Test Vinhibit_debugger.
7073 (syms_of_eval): Define inhibit-debugger.
7074 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
7075 (syms_of_xdisp): Remove inhibit-debug-on-message.
7076
7077 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7078
7079 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
7080 If a nonvolatile local variable is written before a _longjmp to
7081 the frame containing the variable, and is read after the _longjmp,
7082 the value read is indeterminate. Some local variables of type
7083 'struct handler' and 'struct catchtag' are used in this way, so
7084 mark each of their slots as volatile if the slot can be set before
7085 _longjmp and read afterwards.
7086 * lisp.h (struct handler): var and chosen_clause are now volatile.
7087 (struct catchtag): val, next, and pdlcount are now volatile.
7088
7089 * bidi.c (bidi_push_it, bidi_pop_it):
7090 * fns.c (copy_hash_table):
7091 * image.c (define_image_type):
7092 * keyboard.c (kbd_buffer_store_event_hold):
7093 * process.c (Fprocess_send_eof):
7094 * xfaces.c (x_create_gc) [HAVE_NS]:
7095 * xgselect.c (xg_select):
7096 Prefer assignment to memcpy when either will do.
7097
7098 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
7099 Use pointer-to-a-pointer to simplify and avoid a NILP check each
7100 time an item is removed. No need to mark this function 'inline';
7101 the compiler knows better than we do.
7102
7103 2012-09-11 Jan Djärv <jan.h.d@swipnet.se>
7104
7105 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
7106 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
7107 to change_frame_size (Bug#12388).
7108 (windowDidResize:): Pass YES to updateFrameSize.
7109
7110 * nsterm.h: Add delay parameter to updateFrameSize.
7111
7112 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7113
7114 Discard killed buffers from deleted window and frame objects.
7115 This reduces an amount of references to killed buffers and
7116 helps GC to reclaim them faster.
7117 * alloc.c (discard_killed_buffers): New function.
7118 (mark_object): Use it for deleted windows and frames.
7119 (mark_object): If symbol's value is set up for a killed buffer
7120 or deleted frame, restore its global binding.
7121 * data.c (swap_in_global_binding): Add GC notice.
7122 (swap_in_symval_forwarding): Use convenient set_blv_where.
7123 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
7124 * window.h: ... to here.
7125
7126 2012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
7127
7128 Convenient macro to check whether the buffer is live.
7129 * buffer.h (BUFFER_LIVE_P): New macro.
7130 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
7131 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
7132
7133 2012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7134
7135 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
7136 composition cases (Bug#12364).
7137
7138 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
7139 overhang of succeeding glyphs overlapping box cursor.
7140
7141 * w32term.c (x_draw_glyph_string): Likewise.
7142
7143 2012-09-11 Paul Eggert <eggert@cs.ucla.edu>
7144
7145 Simplify, document, and port floating-point (Bug#12381).
7146 The porting part of this patch fixes bugs on non-IEEE platforms
7147 with frexp, ldexp, logb.
7148 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7149 Now static.
7150 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7151 support, by removing commented-out code and briefly listing the
7152 C89 functions excluded. The commented-out stuff was confusing
7153 maintenance, e.g., we thought we needed cbrt but it was commented out.
7154 (logb): Remove decl; no longer needed.
7155 (isfinite): New macro, if not already supplied.
7156 (isnan): Don't replace any existing macro.
7157 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7158 are present on all C89 platforms.
7159 (Ffrexp): Do not special-case zero, as frexp does the right thing
7160 for that case.
7161 (Flogb): Do not use logb, as it doesn't have the desired meaning
7162 on hosts that use non-base-2 floating point. Instead, stick with
7163 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7164 frexp, to avoid getting an unspecified result.
7165
7166 * xdisp.c (Qinhibit_debug_on_message): Now static.
7167
7168 2012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7169
7170 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7171 NSBezierPath (Bug#12131).
7172
7173 2012-09-10 Chong Yidong <cyd@gnu.org>
7174
7175 * fns.c (Fdelq, Fdelete): Doc fix.
7176
7177 2012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7178
7179 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7180 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7181
7182 2012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7183
7184 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7185 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7186 Use it.
7187
7188 2012-09-09 Eli Zaretskii <eliz@gnu.org>
7189
7190 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7191 left fringe if the window has a left margin. This avoids leaving
7192 traces of the cursor because its leftmost pixel is not drawn over.
7193
7194 * dispnew.c (update_window_line): When the left margin area of a
7195 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7196 that screen line. (Bug#12277)
7197
7198 2012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7199
7200 Assume C89 or later for math functions (Bug#12381).
7201 This simplifies the code, and makes it a bit smaller and faster,
7202 and (most important) makes it easier to clean up signal handling
7203 since we can stop worring about floating-point exceptions in
7204 library code. That was a problem before C89, but the problem
7205 went away many years ago on all practical Emacs targets.
7206 * data.c, image.c, lread.c, print.c:
7207 Don't include <math.h>; no longer needed.
7208 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7209 might be autoconfigured, as that never happens.
7210 * data.c (fmod):
7211 * doprnt.c (DBL_MAX_10_EXP):
7212 * print.c (DBL_DIG):
7213 Remove. C89 or later always defines these.
7214 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7215 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7216 (arith_error, domain_error, domain_error2):
7217 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7218 no longer needed -- we simply return what C returns. All uses removed.
7219 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7220 the wrapped code.
7221 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7222 Remove. All uses expanded, as these macros are no longer used
7223 more than once and are now more trouble than they're worth.
7224 (Ftan): Use tan, not sin / cos.
7225 (Flogb): Assume C89 frexp.
7226 (fmod_float): Assume C89 fmod.
7227 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7228 (init_floatfns): Remove. All uses removed.
7229
7230 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7231
7232 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7233 compositeToPoint for OSX < 10.6 (Bug#12390).
7234
7235 2012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7236
7237 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7238 This produces more-accurate results.
7239
7240 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7241
7242 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7243 changes (Bug#12088).
7244
7245 2012-09-08 Chong Yidong <cyd@gnu.org>
7246
7247 * syntax.c (Fstring_to_syntax): Doc fix.
7248
7249 2012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7250
7251 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7252 in the internal border.
7253 (x_set_window_size): Remove static variables and their usage.
7254 (ns_redraw_scroll_bars): Fix NSTRACE arg.
7255 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7256 Remove fringe/internal border adjustment (Bug#11052).
7257 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7258 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7259 (ns_fix_rect_ibw): Remove.
7260 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7261 (ns_dumpglyphs_box_or_relief): Ditto.
7262 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7263 adjustment.
7264 (ns_dumpglyphs_image): Ditto.
7265 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
7266 border adjustment.
7267 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7268 their usage. Add fringe_extended_p and its use as in other terms.
7269 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7270 scroll bar was removed.
7271 (updateFrameSize): New function.
7272 (windowDidResize): Move code to updateFrameSize and call it.
7273
7274 * nsterm.h (EmacsView): Add updateFrameSize.
7275
7276 2012-09-07 Chong Yidong <cyd@gnu.org>
7277
7278 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7279
7280 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7281
7282 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7283
7284 More signal-handler cleanup (Bug#12327).
7285 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7286 Problem introduced when merging patches. Noted by Eli Zaretskii in
7287 <http://bugs.gnu.org/12327#67>.
7288 * floatfns.c: Comment fix.
7289 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7290 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7291 and anyway the declaration is harmless even if SIGDANGER is not defined.
7292 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7293 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7294 source files not surprisingly expected syssignal.h to define, or
7295 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7296 Include <sys/ioctl.h>, for FIONREAD.
7297 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7298 This eliminates a problem whereby other files mysteriously had
7299 to include "syssignal.h" before including "systty.h" if they
7300 wanted to use "#ifdef SIGIO".
7301
7302 2012-09-07 Eli Zaretskii <eliz@gnu.org>
7303
7304 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7305
7306 * w32.c (sigemptyset): Empty the set.
7307 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7308
7309 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7310
7311 2012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7312
7313 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7314 (mark_object): Likewise for frame objects.
7315
7316 2012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7317
7318 * syssignal.h (handle_on_main_thread): Always declare,
7319 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7320 This ports to platforms without HAVE_PTHREAD.
7321
7322 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7323
7324 Signal-handler cleanup (Bug#12327).
7325 Emacs's signal handlers were written in the old 4.2BSD style with
7326 sigblock and sigmask and so forth, and this led to some
7327 inefficiencies and confusion. Rewrite these to use
7328 pthread_sigmask etc. without copying signal sets around. Also,
7329 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7330 'signal', and instead use functions that do not attempt to take
7331 over the system name space. This patch causes Emacs's text
7332 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7333 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7334 Do not include <signal.h> or "syssignal.h", as these
7335 modules do not use signals.
7336 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7337 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7338 Do not include <signal.h>, as "syssignal.h" does that for us now.
7339 * atimer.c (sigmask_atimers): New function.
7340 (block_atimers, unblock_atimers): New functions,
7341 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7342 All uses replaced.
7343 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7344 no longer needed here.
7345 * emacs.c (main): Inspect existing signal handler with sigaction,
7346 so that there's no need to block and unblock SIGHUP.
7347 * sysdep.c (struct save_signal): New member 'action', replacing
7348 old member 'handler'.
7349 (save_signal_handlers, restore_signal_handlers):
7350 Use sigaction instead of 'signal' to save and restore.
7351 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7352 New function. All users of 'signal' modified to use set_sighandler
7353 if they're writeonly, and to use sys_signal if they're read+write.
7354 (emacs_sigaction_init, forwarded_signal): New functions.
7355 (sys_signal): Remove. All uses replaced by calls to sigaction
7356 and emacs_sigaction_init, or by direct calls to 'signal'.
7357 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7358 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7359 all uses replaced by pthread_sigmask etc. calls.
7360 * syssignal.h: Include <signal.h>.
7361 (emacs_sigaction_init, forwarded_signal): New decls.
7362 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7363 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7364 (sigmask, sys_sigmask): Remove; no longer needed.
7365 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7366 (sigblock, sigunblock, sigfree):
7367 (sigsetmask) [!defined sigsetmask]:
7368 Remove. All uses replaced by pthread_sigmask.
7369 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7370 no longer need to be replaced, and its typical old uses
7371 are now done via emacs_sigaction_init and sigaction.
7372 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7373 (sys_sigdel): Remove; unused.
7374 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7375
7376 2012-09-06 Eli Zaretskii <eliz@gnu.org>
7377
7378 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7379 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7380
7381 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7382
7383 Explicitly mark buffer_defaults and buffer_local_symbols.
7384 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7385 mark_local_symbols here.
7386 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7387 since special buffers aren't marked here any more.
7388 (allocate_buffer): Chain new buffer with all_buffers here...
7389 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7390 not here.
7391 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7392 (syms_of_buffer): Remove staticpro of the above.
7393 (init_buffer_once): Set names for buffer_defaults and
7394 buffer_local_symbols.
7395
7396 2012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7397
7398 Use bool for booleans in font-related modules.
7399 * font.c (font_intern_prop, font_style_to_value)
7400 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7401 (generate_otf_features, font_check_otf_features, font_check_otf)
7402 (font_match_p, font_list_entities, font_at):
7403 * fontset.c (fontset_id_valid_p, reorder_font_vector
7404 (fontset_find_font, Fset_fontset_font)
7405 (face_suitable_for_char_p) [0]:
7406 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7407 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7408 (m17n_flt_initialized, ftfont_shape_by_flt):
7409 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7410 * nsfont.m (nsfont_draw):
7411 * w32font.c (w32font_draw):
7412 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7413 Use bool for booleans.
7414 * font.h: Adjust to above API changes.
7415 (struct font, struct font_driver, struct font_driver_list):
7416 Use bool for booleans.
7417 (struct font): Remove useless member encoding_type.
7418 All users removed.
7419 * fontset.c, xftfont.c: Omit unnecessary static decls.
7420
7421 2012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7422
7423 * alloc.c (mark_object): Revert window marking code
7424 since it's unsafe for the Fset_window_configuration.
7425
7426 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7427
7428 Fix race conditions with signal handlers and errno (Bug#12327).
7429 Be more systematic about preserving errno whenever a signal
7430 handler returns, even if it's not in the main thread. Do this by
7431 renaming signal handlers to distinguish between signal delivery
7432 and signal handling. All uses changed.
7433 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7434 * data.c (deliver_arith_signal): Rename from arith_error.
7435 * dispnew.c (deliver_window_change_signal): Rename from
7436 window_change_signal.
7437 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7438 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7439 * keyboard.c (deliver_input_available_signal): Rename from
7440 input_available_signal.
7441 (deliver_user_signal): Rename from handle_user_signal.
7442 (deliver_interrupt_signal): Rename from interrupt_signal.
7443 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7444 (deliver_child_signal): Rename from sigchld_handler.
7445 * atimer.c (handle_alarm_signal):
7446 * data.c (handle_arith_signal):
7447 * dispnew.c (handle_window_change_signal):
7448 * emacs.c (handle_fatal_signal, handle_danger_signal):
7449 * keyboard.c (handle_input_available_signal):
7450 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7451 * process.c (handle_pipe_signal, handle_child_signal):
7452 New functions, with the actual signal-handling code taken from the
7453 original respective signal handlers, sans the sporadic attempts to
7454 preserve errno, since that's now done by handle_on_main_thread.
7455 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7456 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7457 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7458 Move to sysdep.c.
7459 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7460 Move initialization of main_thread to sysdep.c's init_signals.
7461 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7462 our usage, and simplifies the mainline code.
7463 (record_child_status_change): New static function, as a helper
7464 for handle_child_signal, and with most of the old child handler's
7465 contents.
7466 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7467 (handle_child_signal): Use the above.
7468 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7469 Moved here from emacs.c.
7470 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7471 code moved here from emacs.c's main function.
7472 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
7473 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7474 This lets callers save and restore errno properly.
7475
7476 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7477
7478 Remove redundant or unused things here and there.
7479 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7480 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7481 * editfns.c (Fcompare_buffer_substrings): Likewise.
7482 * frame.h (struct terminal, struct font_driver_list):
7483 Remove redundant declarations.
7484 * window.h (Qleft, Qright): Likewise.
7485
7486 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7487
7488 Do not mark objects from deleted buffers, windows and frames.
7489 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7490 (mark_object): Likewise for windows and frames.
7491
7492 2012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7493
7494 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7495 buffer_defaults and buffer_local_symbols as valid objects.
7496 Return special value to denote them.
7497
7498 2012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7499
7500 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7501 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7502 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7503 (file_name_absolute_p, Fsubstitute_in_file_name):
7504 (check_executable, check_writable, Ffile_accessible_directory_p)
7505 (Fset_file_selinux_context, Fdefault_file_modes)
7506 (Finsert_file_contents, choose_write_coding_system)
7507 (Fwrite_region, build_annotations, a_write, e_write)
7508 (Fdo_auto_save):
7509 * filelock.c (boot_time_initialized, get_boot_time)
7510 (get_boot_time_1, lock_file_1, within_one_second):
7511 * floatfns.c (in_float):
7512 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7513 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7514 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7515 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7516 * window.c (compare_window_configurations):
7517 Use bool for booleans.
7518 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7519 (Fdefault_file_modes): Now mode_t, not int, for modes.
7520 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7521 (internal_delete_file): Now returns void, not a (boolean) int,
7522 since nobody was looking at the return value.
7523 * lisp.h, window.h: Adjust to above API changes.
7524
7525 * xdisp.c (set_message): Simplify and reindent last change.
7526
7527 2012-09-05 Juanma Barranquero <lekktu@gmail.com>
7528
7529 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7530
7531 2012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7532
7533 * eval.c (call_debugger): Make the function non-static so that we
7534 can call it from set_message.
7535
7536 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7537 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7538
7539 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7540
7541 Give more-useful info on a fatal error (Bug#12328).
7542 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7543 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7544 of doing the work ourselves.
7545 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7546 do most of the work.
7547 (fatal_error_backtrace): New function, taken from the guts
7548 of the old fatal_error_signal, but with a new option to output
7549 a backtrace.
7550 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7551 info about the signal than just its number.
7552 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7553 * sysdep.c: Include <execinfo.h>
7554 (emacs_backtrace): New function, taken partly from the previous
7555 code of the 'die' function.
7556 (emacs_abort): Call fatal_error_backtrace rather than abort.
7557
7558 2012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7559
7560 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7561 eager (load-time) macro-expansion.
7562 * lisp.mk (lisp): Add macroexp.
7563
7564 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7565
7566 Simplify redefinition of 'abort' (Bug#12316).
7567 Do not try to redefine the 'abort' function. Instead, redo
7568 the code so that it calls 'emacs_abort' rather than 'abort'.
7569 This removes the need for the NO_ABORT configure-time macro
7570 and makes it easier to change the abort code to do a backtrace.
7571 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7572 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7573 Remove; sysdep.c's emacs_abort now takes its place.
7574 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7575 'abort' changed to use 'emacs_abort'.
7576 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7577 (abort) [!defined abort]: Rename to ...
7578 (emacs_abort): ... new name.
7579 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7580 the place of the old 'abort' in emacs.c.
7581 * w32.c, w32fns.c (abort): Do not #undef.
7582 * w32.c (emacs_abort): Rename from w32_abort.
7583
7584 2012-09-04 Eli Zaretskii <eliz@gnu.org>
7585
7586 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7587 offsets[j].dv, since the y axis of the screen coordinates points
7588 down, while the y axis of the font definition coordinates points
7589 up. This fixes display of Arabic diacritics such as KASRA and
7590 KASRATAN. (Bug#11860)
7591
7592 2012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7593
7594 Be more systematic about _setjmp vs setjmp.
7595 * alloc.c (test_setjmp, mark_stack):
7596 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7597 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7598 (png_load, my_error_exit, jpeg_load):
7599 * process.c (send_process_trap, send_process):
7600 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7601 The underscored versions are up to 30x faster on some hosts.
7602 Formerly, the code used setjmp+longjmp sometimes and
7603 _setjmp+_longjmp at other times, with no particular reason to
7604 prefer setjmp+longjmp.
7605
7606 2012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7607
7608 Fix minor problem found by static checking.
7609 * buffer.c (Fdelete_all_overlays): Return nil.
7610
7611 2012-09-03 Martin Rudalics <rudalics@gmx.at>
7612
7613 * buffer.c (Fdelete_all_overlays): New function.
7614
7615 2012-09-03 Chong Yidong <cyd@gnu.org>
7616
7617 * gtkutil.c: Add extern decl for Qxft.
7618
7619 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7620
7621 * emacs.c, eval.c: Use bool for boolean.
7622 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7623 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7624 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7625 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7626 (main, decode_env_path, Fdaemon_initialized):
7627 * eval.c (call_debugger, Finteractive_p, interactive_p):
7628 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7629 (maybe_call_debugger, Fbacktrace):
7630 * process.c (read_process_output, exec_sentinel):
7631 Use bool for booleans.
7632 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7633 All callers changed.
7634 * eval.c (interactive_p): Omit always-true boolean argument
7635 EXCLUDE_SUBRS_P. All callers changed.
7636 * dispextern.h, lisp.h: Reflect above API changes.
7637 * firstfile.c (dummy): Use the address of 'main', whose signature
7638 won't change, instead of the address of 'initialize', whose
7639 signature just changed from int to bool.
7640 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7641 * msdos.c (fatal_error_in_progress): ... from here.
7642 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7643 of incrementing it.
7644 (redisplay_internal, unwind_redisplay): Simply clear
7645 REDISPLAYING_P when unwinding, instead of saving its previous,
7646 always-false value and then restoring it.
7647
7648 Clean up some extern decls.
7649 Mostly, this hoists extern decls out of .c files and into .h files.
7650 That way, we're more likely to catch errors if the interfaces change.
7651 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7652 declare xg_mark_data.
7653 * dispextern.h (x_frame_parm_handlers):
7654 * font.h (Qxft):
7655 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7656 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7657 (Qultra_bold, Qoblique, Qitalic):
7658 Move extern decl here from .c file.
7659 * alloc.c (xg_mark_data) [USE_GTK]:
7660 * doc.c (Qclosure):
7661 * eval.c (Qlexical_binding):
7662 * fns.c (time) [!HAVE_UNISTD_H]:
7663 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7664 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7665 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7666 * lread.c (Qinternal_interpreter_environment):
7667 * minibuf.c (Qbuffer):
7668 * process.c (QCfamily, QCfilter):
7669 * widget.c (free_frame_faces):
7670 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7671 * xfont.c (x_clear_errors):
7672 * xterm.c (x_frame_parm_handlers):
7673 Remove now-redundant extern decls.
7674 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7675 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7676 Now static.
7677 * xfaces.c: Remove unnecessary static decls.
7678 * xterm.c (updating_frame): Remove decl of nonexistent object.
7679
7680 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7681 when building globals.h, as the objects that are not built on
7682 this host are not needed to compile C files on this host.
7683
7684 2012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7685
7686 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7687
7688 * frame.h: Add missing prototype for x_wm_set_size_hint.
7689
7690 2012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7691
7692 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7693 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7694 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7695 (Fsubstitute_command_keys):
7696 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7697 (save_excursion_save, save_excursion_restore)
7698 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7699 (format_time_string, general_insert_function)
7700 (make_buffer_string, make_buffer_string_both)
7701 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7702 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7703 (copy_text, insert_1, insert_1_both, insert_from_string)
7704 (insert_from_string_before_markers, insert_from_string_1)
7705 (insert_from_buffer, insert_from_buffer_1, replace_range)
7706 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7707 (del_range_2, modify_region):
7708 * intervals.c (intervals_equal, balance_possible_root_interval)
7709 (adjust_intervals_for_insertion, merge_properties_sticky)
7710 (graft_intervals_into_buffer, lookup_char_property)
7711 (adjust_for_invis_intang, set_point_both)
7712 (get_property_and_range, compare_string_intervals)
7713 (set_intervals_multibyte_1, set_intervals_multibyte):
7714 * keyboard.c (decode_timer):
7715 Use bool for boolean.
7716 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7717 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7718
7719 2012-09-02 Chong Yidong <cyd@gnu.org>
7720
7721 * keymap.c (push_key_description): Print M-TAB as C-M-i
7722 (Bug#11758).
7723
7724 2012-09-02 Juanma Barranquero <lekktu@gmail.com>
7725
7726 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7727 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7728 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7729 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7730 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7731 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7732 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7733
7734 2012-09-01 Eli Zaretskii <eliz@gnu.org>
7735
7736 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7737 more than one grapheme cluster passed to the shaper: compute the
7738 offset adjustment values separately for each cluster. (Bug#11860)
7739
7740 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7741 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7742 about implicit conversions from integer to pointer.
7743
7744 2012-09-01 Daniel Colascione <dancol@dancol.org>
7745
7746 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7747 system used too early.
7748
7749 2012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7750
7751 Better seed support for (random).
7752 * emacs.c (main): Call init_random.
7753 * fns.c (Frandom): Set the seed from a string argument, if given.
7754 Remove long-obsolete Gentzel cruft.
7755 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7756 (init_random): New function.
7757
7758 2012-09-01 Daniel Colascione <dancol@dancol.org>
7759
7760 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7761 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7762 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7763 x_wm_set_size_hint, x_query_colors, x_real_positions,
7764 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7765 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7766 all of which have been moved to common code.
7767
7768 * xfaces.c: Include TERM_HEADER instead of listing all possible
7769 window-system headers.
7770
7771 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7772 to match header.
7773
7774 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7775 directly accessing frame internals.
7776
7777 * w32font.h: Include font.h. Define syms_of_w32font and
7778 globals_of_w32font.
7779
7780 * process.c: Include TERM_HEADER instead of listing all possible
7781 window-system headers.
7782
7783 * nsterm.h: Remove declarations now in frame.h.
7784 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
7785
7786 * menu.c: Include TERM_HEADER instead of listing all possible
7787 window-system headers.
7788
7789 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7790 window system.
7791
7792 * keyboard.c: Include TERM_HEADER instead of listing all possible
7793 window-system headers.
7794
7795 * image.c: Include TERM_HEADER instead of listing all possible
7796 window-system headers. Declare Vlibrary_cache when compiling for
7797 Windows.
7798
7799 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7800 window system declarations.
7801
7802 * frame.h: Move common functions here: set_frame_menubar,
7803 x_set_window_size, x_sync, x_get_focus_frame,
7804 x_set_mouse_position, x_set_mouse_pixel_position,
7805 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7806 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7807 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7808 x_activate_menubar, x_real_positions, x_bitmap_icon,
7809 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7810 and x_query_colors.
7811
7812 * frame.c: Include TERM_HEADER instead of listing all possible
7813 window-system headers.
7814
7815 * font.c: Include TERM_HEADER instead of listing all possible
7816 window-system headers.
7817
7818 * emacs.c: Include TERM_HEADER.
7819
7820 * dispnew.c: Include TERM_HEADER instead of listing all possible
7821 window-system headers.
7822
7823 * ccl.h: Include character.h.
7824
7825 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7826 the current window system; include in list of objects to link into
7827 Emacs.
7828
7829 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7830
7831 Remove mark_ttys function and fix tty_display_info initialization.
7832 * lisp.h (mark_ttys): Remove prototype.
7833 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7834 to mark_ttys because all possible values of 'top_frame' slot are
7835 the frames which are reachable from Vframe_list.
7836 * term.c (mark_ttys): Remove.
7837 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7838
7839 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7840
7841 Change struct frame bitfields from unsigned char to unsigned.
7842 * frame.h (struct frame): Change type of 'display_preempted',
7843 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7844 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7845 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7846 bitfields from unsigned char to unsigned.
7847
7848 2012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7849
7850 Remove unused member of struct x_output and struct w32_output.
7851 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7852 * w32term.h (struct w32_output): Likewise.
7853
7854 2012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7855
7856 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7857 does not become zero (Bug#12234).
7858
7859 2012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7860
7861 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7862 for GCC 4.7.1 x86-64.
7863
7864 2012-08-30 Glenn Morris <rgm@gnu.org>
7865
7866 * lread.c (init_lread): For out-of-tree builds, only add the
7867 source directory's site-lisp dir to the load-path if it exists,
7868 consistent with in-tree builds. (Bug#12302)
7869
7870 2012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7871
7872 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
7873 button_values to NULL. Call setStykeMask so dialogs get a close button.
7874 (windowShouldClose:): Set window_closed.
7875 (dealloc): New member, free button_values.
7876 (process_dialog:): Make member function. Remove window argument,
7877 replace window with self. Count buttons and allocate and store values
7878 in button_values.
7879 (addButton:value:row:): value is int with the name tag. Call setTag
7880 with tag. Remove return self, declare return value as void.
7881 (addString:row:): Remove return self, declare return value as void.
7882 (addSplit): Remove return self, declare return value as void.
7883 (clicked:): Remove return self, declare return value as void.
7884 Set dialog_return to button_values[seltag]. Code formatting change.
7885 (initFromContents:isQuestion:): Adjust call to process_dialog.
7886 Code formatting change.
7887 (timeout_handler:): Set timer_fired to YES.
7888 (runDialogAt:): Set timer_fired to NO.
7889 Handle click on close button as quit.
7890
7891 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7892 Add window_closed and button_values. Add void as return value for
7893 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7894 Add process_dialog as new member.
7895
7896 2012-08-28 Eli Zaretskii <eliz@gnu.org>
7897
7898 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7899 is not one of the heaps we manage. (Bug#12242)
7900
7901 2012-08-28 Glenn Morris <rgm@gnu.org>
7902
7903 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7904
7905 2012-08-28 Martin Rudalics <rudalics@gmx.at>
7906
7907 * window.c (Fset_window_configuration): Remove handling of
7908 auto-buffer-name window parameter. Install revision of reverted
7909 fix.
7910
7911 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7912
7913 Do not allow to set major mode for a dead buffer.
7914 * buffer.c (Fset_buffer_major_mode): Signal an error
7915 if the buffer is dead.
7916 (Fother_buffer, other_buffer_safely): Remove redundant
7917 nested declaration.
7918
7919 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7920
7921 Always use set_buffer_if_live to restore original buffer at unwind.
7922 * buffer.h (record_unwind_current_buffer): New function.
7923 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7924 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7925 * undo.c, window.c: Adjust users.
7926 * buffer.c (set_buffer_if_live): Fix comment.
7927
7928 2012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7929
7930 Fix usage of set_buffer_internal.
7931 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7932 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7933 * coding.c (decode_coding): Omit redundant test.
7934 * fileio.c (decide_coding_unwind): Likewise.
7935 * fns.c (secure_hash): Likewise.
7936 * insdel.c (modify_region): Likewise.
7937 * keyboard.c (command_loop_1): Likewise.
7938 * print.c (PRINTFINISH): Likewise.
7939 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7940
7941 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7942
7943 * dispnew.c: Use bool for boolean.
7944 (frame_garbaged, display_completed, delayed_size_change)
7945 (fonts_changed_p, add_window_display_history)
7946 (add_frame_display_history, verify_row_hash)
7947 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7948 (row_equal_p, realloc_glyph_pool)
7949 (allocate_matrices_for_frame_redisplay)
7950 (showing_window_margins_p)
7951 (adjust_frame_glyphs_for_frame_redisplay)
7952 (build_frame_matrix_from_leaf_window, make_current)
7953 (mirrored_line_dance, mirror_line_dance, update_frame)
7954 (update_window_tree, update_single_window)
7955 (check_current_matrix_flags, update_window, update_text_area)
7956 (update_window_line, set_window_update_flags, scrolling_window)
7957 (update_frame_1, scrolling, buffer_posn_from_coords)
7958 (do_pending_window_change, change_frame_size)
7959 (change_frame_size_1, sit_for):
7960 Use bool for boolean.
7961 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7962 and remove last int (actually boolean) argument, which was always 0.
7963 All callers changed.
7964 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7965 * dispextern.h (struct composition_it): Use bool for boolean.
7966 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7967 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7968 * dired.c (file_name_completion):
7969 Use bool for boolean. (This was missed in an earlier change.)
7970
7971 2012-08-27 Martin Rudalics <rudalics@gmx.at>
7972
7973 * window.c (Fset_window_configuration): Revert first part of
7974 last change.
7975
7976 2012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7977
7978 * nsterm.h (NSPanel): New class variable dialog_return.
7979
7980 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7981 Initialize dialog_return.
7982 (windowShouldClose:): Use stop instead of stopModalWithCode.
7983 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7984 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7985 event.
7986 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7987 modal loop returns.
7988
7989 2012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7990
7991 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7992 * composite.c (find_composition, composition_gstring_p)
7993 (composition_reseat_it, find_automatic_composition):
7994 * data.c (let_shadows_buffer_binding_p)
7995 (let_shadows_global_binding_p, set_internal, make_blv)
7996 (Fmake_variable_buffer_local, Fmake_local_variable)
7997 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7998 (cons_to_signed, arith_driver):
7999 * dbusbind.c (xd_in_read_queued_messages):
8000 * dired.c (directory_files_internal, file_name_completion):
8001 Use bool for booleans.
8002 * dired.c (file_name_completion):
8003 * process.h (fd_callback):
8004 Omit int (actually boolean) argument. It wasn't being used.
8005 All uses changed.
8006 * composite.h, lisp.h: Reflect above API changes.
8007
8008 * cmds.c, coding.c: Use bool for booleans.
8009 * cmds.c (move_point, Fself_insert_command):
8010 * coding.h (struct composition status, struct coding_system):
8011 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
8012 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
8013 (emacs_mule_char, decode_coding_emacs_mule)
8014 (encode_coding_emacs_mule, detect_coding_iso_2022)
8015 (decode_coding_iso_2022, encode_invocation_designation)
8016 (encode_designation_at_bol, encode_coding_iso_2022)
8017 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
8018 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
8019 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
8020 (encode_coding_raw_text, detect_coding_charset)
8021 (decode_coding_charset, encode_coding_charset, detect_eol)
8022 (detect_coding, get_translation_table, produce_chars)
8023 (consume_chars, reused_workbuf_in_use)
8024 (make_conversion_work_buffer, code_conversion_save)
8025 (decode_coding_object, encode_coding_object)
8026 (detect_coding_system, char_encodable_p)
8027 (Funencodable_char_position, code_convert_region)
8028 (code_convert_string, code_convert_string_norecord)
8029 (Fset_coding_system_priority):
8030 * fileio.c (Finsert_file_contents):
8031 Use bool for booleans.
8032 * coding.h, lisp.h: Reflect above API changes.
8033 * coding.c: Remove unnecessary static function decls.
8034 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
8035 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
8036 not a boolean 'int', since callers never look at the return value.
8037 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
8038 * coding.h (decoding_buffer_size, encoding_buffer_size)
8039 (emacs_mule_string_char): Remove unused extern decls.
8040 (struct iso_2022_spec, struct coding_system):
8041 Use 'unsigned int : 1' for boolean fields, since there's more than one.
8042 (struct emacs_mule_spec): Remove unused field 'full_support'.
8043 All initializations removed.
8044 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
8045
8046 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8047
8048 Fix spare memory change (Bug#12286).
8049 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
8050 (valid_lisp_object_p): Likewise.
8051
8052 2012-08-27 Martin Rudalics <rudalics@gmx.at>
8053
8054 * window.c (Fset_window_configuration): Record any window's old
8055 buffer if it's replaced (see Bug#8789). If the new current
8056 buffer doesn't appear in the selected window, go to its old
8057 point (Bug#12208).
8058
8059 2012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
8060
8061 Special MEM_TYPE_SPARE to denote reserved memory.
8062 * alloc.c (enum mem_type): New memory type.
8063 (refill_memory_reserve): Use new type for spare memory.
8064 This prevents live_cons_p and live_string_p from incorrect
8065 detection of uninitialized objects from spare memory as live.
8066
8067 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
8068
8069 Spelling fixes.
8070 * Makefile.in (.PHONY): versioclean -> versionclean.
8071
8072 Remove unused external symbols.
8073 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
8074 * window.c (Qwindow_valid_p, decode_valid_window):
8075 Now static, not extern.
8076 * data.c (Qinterval): Remove; unused.
8077 (syms_of_data): Do not define 'interval'.
8078 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
8079 * window.h (decode_valid_window):
8080 Remove decls.
8081
8082 * character.c, charset.c, chartab.c: Use bool for booleans.
8083 * character.c (lisp_string_width, string_count_byte8)
8084 (string_escape_byte8):
8085 * charset.c (charset_map_loaded, load_charset_map, read_hex):
8086 (load_charset_map_from_file, map_charset_chars)
8087 (Fdefine_charset_internal, define_charset_internal)
8088 (Fdeclare_equiv_charset, find_charsets_in_text)
8089 (Ffind_charset_region, char_charset, Fiso_charset):
8090 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
8091 (sub_char_table_set, sub_char_table_set_range)
8092 (char_table_set_range, optimize_sub_char_table)
8093 (map_sub_char_table):
8094 Use bool for boolean.
8095 * character.c (str_to_unibyte): Omit last boolean argument; it was
8096 always 0. All callers changed.
8097 * character.h, charset.h: Adjust to match previous changes.
8098 * character.h (char_printable_p): Remove decl of nonexistent function.
8099 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
8100 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
8101 are all boolean, so make them single-bit bitfields.
8102
8103 * lisp.h (ASET): Remove attempt to detect side effects.
8104 It was meant to be temporary and it often doesn't work,
8105 because when IDX has side effects the behavior of IDX==IDX
8106 is undefined. See Stefan Monnier in
8107 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8108
8109 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8110
8111 * lisp.h (functionp): New function (extracted from Ffunctionp).
8112 (FUNCTIONP): Use it.
8113 * eval.c (Ffunctionp): Use it.
8114
8115 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8116
8117 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
8118 as that's faster and simpler than static storage. Don't bother
8119 with the g_main_context_query overhead if g_main_context_pending
8120 says no events are pending.
8121 (gfds, gfds_size): Remove these static vars.
8122 (xgselect_initialize): Remove; no longer needed.
8123 All uses and decls removed.
8124
8125 * emacs.c (fatal_error_signal_hook): Remove.
8126 All uses removed. This leftover from old code was always 0.
8127
8128 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
8129 * casefiddle.c (casify_object, casify_region):
8130 * casetab.c (set_case_table):
8131 * category.c, category.h (word_boundary_p):
8132 * category.h (CHAR_HAS_CATEGORY):
8133 Use bool for booleans, instead of int.
8134
8135 2012-08-25 Eli Zaretskii <eliz@gnu.org>
8136
8137 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
8138
8139 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
8140
8141 On assertion failure, print backtrace if available.
8142 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
8143 (die) [ENABLE_CHECKING]: Print a backtrace if available.
8144 * Makefile.in (LIB_EXECINFO): New macro.
8145 (LIBES): Use it.
8146
8147 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8148 * bytecode.c (exec_byte_code):
8149 * callint.c (check_mark, Fcall_interactively):
8150 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8151 (getenv_internal, sync_process_alive, call_process_exited):
8152 * lisp.h (USE_SAFE_ALLOCA):
8153 Use bool for booleans, instead of int.
8154 * lisp.h, process.h: Adjust prototypes to match above changes.
8155 * callint.c (Fcall_interactively): Don't assume the mark's
8156 offset fits in 'int'.
8157
8158 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8159
8160 * buffer.c, buffer.h: Use bool for boolean.
8161 * buffer.c (reset_buffer_local_variables)
8162 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8163 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8164 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8165 (overlay_touches_p, overlay_strings, Foverlay_put)
8166 (report_overlay_modification, call_overlay_mod_hooks):
8167 (mmap_enlarge, mmap_set_vars):
8168 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8169 Use bool for booleans, instead of int.
8170 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8171 since the 1-or-0 return value is always ignored anyway.
8172 (mmap_initialized_p):
8173 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8174 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8175
8176 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8177
8178 * bidi.c: Use bool for boolean.
8179 This is a bit more readable, and makes the text segment of bidi.o
8180 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8181 Presumably it's faster too.
8182 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8183 Now bool.
8184 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8185 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8186 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8187 (bidi_explicit_dir_char, bidi_level_of_next_char)
8188 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8189 Use bool for booleans, instead of int.
8190 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8191 (bidi_unshelve_cache): Adjust decls to match code.
8192
8193 2012-08-23 Martin Rudalics <rudalics@gmx.at>
8194
8195 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8196 argument.
8197
8198 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8199
8200 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8201 * atimer.h: Include <stdbool.h>.
8202
8203 2012-08-22 Dan Nicolaescu <dann@gnu.org>
8204
8205 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8206 compile time tests instead of run time tests on systems that do
8207 not use them.
8208 (FRAME_MAC_P): Remove leftover from deleted code.
8209 * frame.c (syms_of_frame): Remove leftover from deleted code.
8210
8211 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8212
8213 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8214
8215 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8216
8217 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8218 Otherwise, the compiler complains about (A?B:C) where B is void
8219 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
8220 (fontset_add): Return void, for FONTSET_ADD.
8221
8222 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8223
8224 * alloc.c: Use bool for booleans.
8225 (gc_in_progress, abort_on_gc)
8226 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8227 (dont_register_blocks) [GC_MALLOC_CHECK]:
8228 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8229 (check_string_bytes, make_specified_string, memory_full)
8230 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8231 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8232 (mark_stack, valid_pointer_p, make_pure_string)
8233 (Fgarbage_collect, survives_gc_p, gc_sweep):
8234 Use bool for booleans, instead of int.
8235 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8236 Remove unused local.
8237 * alloc.c (PURE_POINTER_P):
8238 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8239 * editfns.c (Fformat):
8240 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8241 (Fdo_auto_save):
8242 * fns.c (sweep_weak_table):
8243 * lisp.h (suppress_checking, push_message, survives_gc_p)
8244 (make_pure_string, gc_in_progress, abort_on_gc):
8245 * lread.c (readchar, read1):
8246 * print.c (Fprin1_to_string):
8247 * xdisp.c (push_message):
8248 Use bool for booleans affected directly or indirectly by
8249 alloc.c's changes.
8250
8251 Make recently-introduced setters macros.
8252 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8253 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8254 (set_fontset_default, set_fontset_fallback): Rename from their
8255 upper-case counterparts, and make them functions rather than macros.
8256 This is more consistent with the other recently-introduced setters.
8257 These don't need to be inline, since they're local.
8258
8259 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8260
8261 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8262 the loop (Bug#12247).
8263
8264 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8265
8266 * lisp.h (vcopy): Use memcpy rather than our own loop.
8267 This fixes a performance regression introduced by the recent
8268 addition of vcopy. This means 'vcopy' will need to be modified
8269 for a copying collector, but that's OK. Also, tighten the
8270 checking in the assertion.
8271
8272 2012-08-21 Eli Zaretskii <eliz@gnu.org>
8273
8274 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8275 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8276 non-base glyph for the width of the base character, according to
8277 what x_draw_composite_glyph_string_foreground expects.
8278 Generate WADJUST value according to composition_gstring_width's
8279 expectations, to produce correct width of the composed character.
8280 Reverse the sign of the DU offset produced by ScriptPlace.
8281
8282 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8283
8284 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8285
8286 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8287
8288 Avoid direct writes to contents member of struct Lisp_Vector.
8289 * lisp.h (vcopy): New function to copy data into vector.
8290 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8291 * fns.c (Ffillarray): Use ASET.
8292 * keyboard.c (timer_check_2): Use AREF and ASET.
8293 (append_tool_bar_item, Frecent_keys): Use vcopy.
8294 * lread.c (read_vector): Use ASET.
8295 * msdos.c (Frecent_doskeys): Use vcopy.
8296 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8297 (Finternal_merge_in_global_face): Use ASET and vcopy.
8298 * xfont.c (xfont_list_pattern): Likewise.
8299
8300 2012-08-21 Martin Rudalics <rudalics@gmx.at>
8301
8302 * window.c (Fwindow_point): For the selected window always return
8303 the position of its buffer's point.
8304 (Fset_window_point): For the selected window always go in its
8305 buffer to the specified position.
8306
8307 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8308
8309 Setter macros for fontsets.
8310 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8311 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8312 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8313 Adjust users.
8314
8315 2012-08-20 Glenn Morris <rgm@gnu.org>
8316
8317 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8318 Don't assume that `ln -f' works.
8319
8320 2012-08-20 Eli Zaretskii <eliz@gnu.org>
8321
8322 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8323 and later about non-assignments with no effect. See discussion at
8324 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8325 details.
8326
8327 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8328
8329 Inline setter functions for Lisp_Objects slots of struct specbinding.
8330 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8331 Adjust users.
8332
8333 2012-08-20 Martin Rudalics <rudalics@gmx.at>
8334
8335 * window.c (select_window): Always make selected window's buffer
8336 current.
8337
8338 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8339
8340 Use AREF and ASET for docstrings of category tables.
8341 * category.h (CATEGORY_DOCSTRING): Use AREF.
8342 (SET_CATEGORY_DOCSTRING): Use ASET.
8343 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8344
8345 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8346
8347 Inline setter functions for hash table members.
8348 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8349 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8350 (set_hash_key_and_value, set_hash_index, set_hash_next)
8351 (set_hash_hash): New functions.
8352 * charset.c, fns.c: Adjust users.
8353
8354 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8355
8356 Inline getter and setter functions for per-buffer values.
8357 * buffer.h (per_buffer_default, set_per_buffer_default)
8358 (per_buffer_value, set_per_buffer_value): New functions.
8359 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8360 * buffer.c, data.c: Adjust users.
8361
8362 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
8363
8364 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8365
8366 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8367
8368 Rely on <config.h> + <unistd.h> to declare 'environ',
8369 as gnulib does this if the system doesn't.
8370 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
8371 Remove declaration. MS-Windows declares it on stdlib.h which is
8372 included by conf_post.h.
8373 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8374 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8375 * vm-limit.c: Include <unistd.h>, for 'environ'.
8376
8377 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8378 (start_of_data): Remove decl; mem-limits.h provides it.
8379
8380 * xdisp.c (handle_invisible_prop): Make it a bit faster
8381 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8382
8383 2012-08-19 Chong Yidong <cyd@gnu.org>
8384
8385 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8386 ends (Bug#3874).
8387
8388 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8389
8390 * .gdbinit: Use call instead of set when calling a function in the
8391 inferior.
8392
8393 * data.c (set_internal): Don't use set_blv_found.
8394 (Fkill_local_variable): Likewise.
8395
8396 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8397
8398 * nsfont.m (ns_ascii_average_width): Ensure the string
8399 ascii_printable is initialized with a null-terminated character
8400 array. Otherwise, it can contain undesired extra characters.
8401
8402 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8403
8404 port new setting code to Sun C 5.8 2005/10/13
8405 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8406 Return void, not Lisp_Object. Otherwise, the compiler
8407 complains about (A?B:C) where B is void and C is Lisp_Object
8408 when compiling CHAR_TABLE_SET, due to the recent change to
8409 the API of sub_char_table_set_contents.
8410
8411 2012-08-18 Chong Yidong <cyd@gnu.org>
8412
8413 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8414 for the string case (Bug#3874).
8415
8416 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8417
8418 * buffer.h (BSET): Remove (Bug#12215).
8419 Replace all uses with calls to new setter functions.
8420 (bset_bidi_paragraph_direction, bset_case_canon_table)
8421 (bset_case_eqv_table, bset_directory, bset_display_count)
8422 (bset_display_time, bset_downcase_table)
8423 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8424 (bset_last_selected_window, bset_local_var_alist)
8425 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8426 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8427 (bset_width_table):
8428 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8429 (bset_auto_fill_function, bset_auto_save_file_format)
8430 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8431 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8432 (bset_cache_long_line_scans, bset_case_fold_search)
8433 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8434 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8435 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8436 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8437 (bset_header_line_format, bset_indicate_buffer_boundaries)
8438 (bset_indicate_empty_lines, bset_invisibility_spec)
8439 (bset_left_fringe_width, bset_major_mode, bset_mark)
8440 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8441 (bset_name, bset_overwrite_mode, bset_pt_marker)
8442 (bset_right_fringe_width, bset_save_length)
8443 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8444 (bset_scroll_up_aggressively, bset_selective_display)
8445 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8446 (bset_word_wrap, bset_zv_marker):
8447 * category.c (bset_category_table):
8448 * syntax.c (bset_syntax_table):
8449 New setter functions.
8450
8451 * process.h (PSET): Remove (Bug#12215).
8452 Replace all uses with calls to new setter functions.
8453 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8454 (PROCESS_INLINE): New macro.
8455 (pset_childp): New setter function.
8456 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8457 * process.c (PROCESS_INLINE):
8458 Define to EXTERN_INLINE, so that the corresponding functions
8459 are compiled into code.
8460 (pset_buffer, pset_command, pset_decode_coding_system)
8461 (pset_decoding_buf, pset_encode_coding_system)
8462 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8463 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8464 (pset_type, pset_write_queue): New setter functions.
8465
8466 * window.h (WSET): Remove (Bug#12215).
8467 Replace all uses with calls to new setter functions.
8468 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8469 (WINDOW_INLINE): New macro.
8470 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8471 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8472 (wset_total_lines, wset_vertical_scroll_bar)
8473 (wset_window_end_pos, wset_window_end_valid)
8474 (wset_window_end_vpos): New setter functions.
8475 * window.c (WINDOW_INLINE):
8476 Define to EXTERN_INLINE, so that the corresponding functions
8477 are compiled into code.
8478 (wset_combination_limit, wset_dedicated, wset_display_table)
8479 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8480 (wset_new_normal, wset_new_total, wset_next_buffers)
8481 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8482 (wset_prev_buffers, wset_right_fringe_width)
8483 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8484 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8485 (wset_window_parameters):
8486 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8487 (wset_column_number_displayed, wset_region_showing):
8488 New setter functions.
8489
8490 * termhooks.h (TSET): Remove (Bug#12215).
8491 Replace all uses with calls to new setter functions.
8492 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8493 (TERMHOOKS_INLINE): New macro.
8494 (tset_charset_list, tset_selection_alist): New setter functions.
8495 * terminal.c (TERMHOOKS_INLINE):
8496 Define to EXTERN_INLINE, so that the corresponding functions
8497 are compiled into code.
8498 (tset_param_alist): New setter function.
8499
8500 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8501
8502 * keyboard.h (KSET): Remove (Bug#12215).
8503 Replace all uses with calls to new setter functions.
8504 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8505 (KEYBOARD_INLINE): New macro.
8506 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8507 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8508 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8509 New setter functions.
8510 * keyboard.c (KEYBOARD_INLINE):
8511 Define to EXTERN_INLINE, so that the corresponding functions
8512 are compiled into code.
8513 (kset_echo_string, kset_kbd_queue)
8514 (kset_keyboard_translate_table, kset_last_prefix_arg)
8515 (kset_last_repeatable_command, kset_local_function_key_map)
8516 (kset_overriding_terminal_local_map, kset_real_last_command)
8517 (kset_system_key_syms): New setter functions.
8518
8519 * frame.h (FSET): Remove (Bug#12215).
8520 Replace all uses with calls to new setter functions.
8521 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8522 (FRAME_INLINE): New macro.
8523 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8524 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8525 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8526 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8527 (fset_param_alist, fset_root_window, fset_scroll_bars)
8528 (fset_selected_window, fset_title, fset_tool_bar_items)
8529 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8530 * frame.c (FRAME_INLINE):
8531 Define to EXTERN_INLINE, so that the corresponding functions
8532 are compiled into code.
8533 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8534
8535 A few more naming-convention fixes for getters and setters.
8536 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8537 and rename from buffer_overlays_set_before.
8538 (set_buffer_overlays_after): Move here from buffer.h, and rename
8539 from buffer_overlays_set_after.
8540 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8541 All uses changed.
8542 (set_buffer_intervals): Rename from buffer_set_intervals.
8543 * intervals.c (set_interval_object): Move here from intervals.h,
8544 and rename from interval_set_object.
8545 (set_interval_left): Move here from intervals.h, and rename from
8546 interval_set_left.
8547 (set_interval_right): Move here from intervals.h, and rename from
8548 interval_set_right.
8549 (copy_interval_parent): Move here from intervals.h, and rename from
8550 interval_copy_parent.
8551 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8552 (set_interval_plist): Rename from interval_set_plist.
8553 Return void, not Lisp_Object, since no caller uses the result.
8554 * lisp.h (string_intervals): Rename from string_get_intervals.
8555 (set_string_intervals): Rename from string_set_intervals.
8556
8557 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8558 (set_char_table_contents): Rename from char_table_set_contents.
8559 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
8560 All uses changed. See the end of
8561 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8562
8563 * lisp.h (CSET): Remove (Bug#12215).
8564 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8565 (set_char_table_purpose): New functions,
8566 replacing CSET. All uses changed. For example, replace
8567 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
8568 "set_char_table_parent (char_table, parent);".
8569 The old version was confusing because it used the same name
8570 'parent' for two different things.
8571
8572 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8573
8574 Functions to get and set Lisp_Object fields of buffer-local variables.
8575 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8576 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8577 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8578 * data.c, eval.c, frame.c: Adjust users.
8579
8580 2012-08-17 Chong Yidong <cyd@gnu.org>
8581
8582 * xfaces.c (merge_face_vectors): If the target font specfies a
8583 font spec, make the font's attributes take precedence over
8584 directly-specified attributes.
8585 (merge_face_ref): Recognize :font.
8586
8587 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8588
8589 Do not use memcpy for copying intervals.
8590 * intervals.c (reproduce_interval): New function.
8591 (reproduce_tree, reproduce_tree_obj): Use it.
8592 (reproduce_tree_obj): Remove prototype.
8593
8594 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8595
8596 * lisp.h (duration_to_sec_usec): Remove unused decl.
8597
8598 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8599
8600 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8601 to an allocated instance of NSString, not to the class itself.
8602
8603 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
8604
8605 * makefile.w32-in (C_CTYPE_H): New macro.
8606 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8607 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8608 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8609
8610 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8611
8612 Use ASCII tests for character types.
8613 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8614 * xfns.c, xterm.c:
8615 Don't include <ctype.h>; was not needed.
8616 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8617 * sysdep.c, xfaces.c:
8618 Include <c-ctype.h> instead of <ctype.h>.
8619 * nsterm.m: Include <c-ctype.h>.
8620 * charset.c (read_hex):
8621 * doc.c (Fsnarf_documentation):
8622 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8623 (DRIVE_LETTER) [DOS_NT]:
8624 (Ffile_name_directory, Fexpand_file_name)
8625 (Fsubstitute_in_file_name):
8626 * font.c (font_parse_xlfd, font_parse_fcname):
8627 * frame.c (x_set_font_backend):
8628 * gtkutil.c (xg_get_font):
8629 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8630 * nsimage.m (hexchar):
8631 * nsterm.m (ns_xlfd_to_fontname):
8632 * sysdep.c (system_process_attributes):
8633 * xfaces.c (hash_string_case_insensitive):
8634 Use C-locale tests instead of locale-specific tests for character
8635 types, since we want the ASCII interpretation here, not the
8636 interpretation suitable for whatever happens to be the current locale.
8637
8638 2012-08-16 Martin Rudalics <rudalics@gmx.at>
8639
8640 Consistently check windows for validity/liveness
8641 (Bug#11984, Bug#12025, Bug#12026).
8642 * lisp.h (CHECK_VALID_WINDOW): New macro.
8643 * window.c (decode_window): Rename to decode_live_window.
8644 (decode_valid_window, Fwindow_valid_p): New functions.
8645 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8646 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8647 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8648 (Fwindow_prev_sibling, Fwindow_combination_limit)
8649 (Fset_window_combination_limit, Fwindow_use_time)
8650 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8651 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8652 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8653 (Fwindow_hscroll, Fset_window_hscroll)
8654 (Fwindow_redisplay_end_trigger)
8655 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8656 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8657 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8658 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8659 (Fwindow_end, Fset_window_point, Fset_window_start)
8660 (Fpos_visible_in_window_p, Fwindow_line_height)
8661 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8662 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8663 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8664 (Fset_window_parameter, Fwindow_display_table)
8665 (Fset_window_display_table, Fdelete_other_windows_internal)
8666 (Fset_window_buffer, Fset_window_new_total)
8667 (Fset_window_new_normal, Fdelete_window_internal)
8668 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8669 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8670 (Fwindow_scroll_bars): Check whether argument window is a valid or
8671 live window. Update doc-strings.
8672 (syms_of_window): New symbol Qwindow_valid_p.
8673 * keyboard.c (Fposn_at_x_y): Check whether argument
8674 frame_or_window denotes a valid window.
8675
8676 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8677
8678 Fix previous char table change.
8679 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8680 * chartab.c (optimize_sub_char_table): Likewise.
8681
8682 2012-08-16 Chong Yidong <cyd@gnu.org>
8683
8684 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8685
8686 * xfont.c (xfont_open):
8687 * xftfont.c (xftfont_open): Set the font's max_width field.
8688
8689 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8690 min_width to space_width and average_width to the average over
8691 printable ASCII characters.
8692 (ns_char_width): Code cleanup.
8693 (ns_ascii_average_width): New utility function.
8694
8695 * font.h (struct font): Update comments.
8696
8697 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8698
8699 Simple interface to set Lisp_Object fields of character tables.
8700 * lisp.h (CSET): New macro.
8701 (char_table_set_extras, char_table_set_contents)
8702 (sub_char_table_set_contents): New function.
8703 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8704 * syntax.c: Adjust users.
8705
8706 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8707
8708 * eval.c (eval_sub): Bind lexical-binding.
8709 * lread.c (Qlexical_binding): Make non-static.
8710
8711 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8712
8713 * nsmenu.m (popupSession): Remove.
8714 (pop_down_menu): Remove endModalSession.
8715 (timeout_handler:): New method.
8716 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8717 Call runModalForWindow. Check timer_fired when it returns.
8718 If not set, cancel timer and break out of loop.
8719 Otherwise loop again, with a new timeout.
8720
8721 * nsterm.m: Include fcntl.h if present.
8722 (fd_entry, t_readfds, inNsSelect): Remove.
8723 (select_writefds, select_valid, select_timeout, selfds)
8724 (select_mutex, apploopnr): Add.
8725 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8726 Otherwise call kbd_buffer_store_event.
8727 (ns_send_appdefined): Remove release of fd_entry.
8728 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8729 Increment and decrement apploopnr.
8730 (ns_select): If no file descriptors, just do a NSTimer.
8731 Otherwise copy read/write masks and start select thread (fd_handler).
8732 Start main loop and wait for application defined event.
8733 Inform select thread to stop selecting after main loop is exited.
8734 (ns_term_init): Create selfds pipe and set non-blocking.
8735 Initialize select_mutex. Start the select thread (fd_handler).
8736 (fd_handler:): Loop forever, wait for info from the main thread
8737 to either start or stop selecting. When select returns, send
8738 and appdefined event.
8739 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8740 If not call kbd_buffer_store_event.
8741
8742 * nsterm.h (EmacsApp): fd_handler takes id argument.
8743 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8744
8745 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8746
8747 2012-08-15 Eli Zaretskii <eliz@gnu.org>
8748
8749 * region-cache.c (move_cache_gap): Update gap_len using the actual
8750 growth of the boundaries array. Do not change cache_len.
8751 (Bug#12196)
8752
8753 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8754
8755 Generalize and cleanup font subsystem checks.
8756 * font.h (FONT_DEBUG, font_assert): Remove.
8757 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8758 Change font_assert to eassert. Use eassert where appropriate.
8759
8760 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8761
8762 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8763
8764 2012-08-15 Chong Yidong <cyd@gnu.org>
8765
8766 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8767 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8768 extract the font descriptor instead of just the font name.
8769 In that case, return a font spec instead of a string.
8770 (x_last_font_name): Move to this file from xfns.c.
8771
8772 * xfns.c (Fx_select_font): The return value can also be a font
8773 spec. Move x_last_font_name management to gtkutil.c.
8774
8775 * xfaces.c: Make font weight and style symbols non-static.
8776
8777 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8778
8779 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8780 (bug#12117).
8781
8782 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8783
8784 * alloc.c (Fgarbage_collect): Use plural form consistently.
8785
8786 2012-08-14 Eli Zaretskii <eliz@gnu.org>
8787
8788 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8789 iteration through the command loop. Fixes a problem whereby mouse
8790 movements are ignored until the first mouse click.
8791
8792 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8793
8794 Use bool, not int, for Lisp booleans.
8795 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8796 makes Emacs a bit smaller and presumably a bit faster.
8797 * lisp.h: Include <stdbool.h>.
8798 (struct Lisp_Boolfwd, defvar_bool):
8799 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8800 * regex.c [!emacs]: Include <stdbool.h>.
8801 (false, true): Remove; <stdbool.h> does this for us now.
8802
8803 2012-08-14 Chong Yidong <cyd@gnu.org>
8804
8805 * character.c (Fcharacterp): Doc fix (Bug#12076).
8806
8807 * data.c (Findirect_variable): Doc fix (Bug#11040).
8808
8809 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8810
8811 * editfns.c (Fformat): Doc fix (Bug#12059).
8812 (Fsave_current_buffer): Doc fix (Bug#11542).
8813
8814 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8815
8816 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8817 (bug#12022).
8818
8819 2012-08-14 Martin Rudalics <rudalics@gmx.at>
8820
8821 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8822 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8823 * minibuf.c (choose_minibuf_frame, read_minibuf):
8824 * w32fns.c (x_create_tip_frame):
8825 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8826 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8827
8828 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8829
8830 * intervals.c (offset_intervals): Remove obsolete comment.
8831
8832 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8833
8834 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8835
8836 2012-08-14 Gergely Risko <gergely@risko.hu>
8837
8838 * coding.c (decode_coding): Record buffer modification before
8839 disabling undo_list (Bug#11773).
8840
8841 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8842
8843 Revert and cleanup some recent overlay changes.
8844 * buffer.h (enum overlay_type): Remove.
8845 (buffer_get_overlays, buffer_set_overlays): Likewise.
8846 (buffer_set_overlays_before, buffer_set_overlays_after):
8847 New function. Adjust users.
8848 (unchain_both): Add eassert.
8849
8850 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8851
8852 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8853
8854 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8855
8856 * gtkutil.c (xg_mark_data): Don't assume C99.
8857
8858 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8859
8860 * gtkutil.c (xg_frame_tb_info): New struct.
8861 (TB_INFO_KEY): New define.
8862 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8863 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8864 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8865 if not present.
8866 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
8867 is up to date. Otherwise store new data.
8868 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8869
8870 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8871
8872 Use KSET for write access to Lisp_Object members of struct kboard.
8873 * keyboard.h (KSET): New macro.
8874 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8875 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8876 * xterm.c: Adjust users.
8877
8878 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8879
8880 Use BSET for write access to Lisp_Object members of struct buffer.
8881 * buffer.h (BSET): New macro.
8882 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8883 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8884 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8885 * window.c, xdisp.c, xfns.c: Adjust users.
8886
8887 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8888
8889 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8890
8891 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8892
8893 * nsterm.m (not_in_argv): New function.
8894 (application:openFile, application:openTempFile:):
8895 (application:openFileWithoutUI:, application:openFiles:): Open file
8896 if not_in_argv returns non-zero (bug#12171).
8897
8898 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
8899 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8900 Define for Gtk+ versions less than 3.2.
8901 (xg_get_font_name): Use those functions/macros here.
8902 Reported by Frans Oilinki <moilinki@gmail.com>.
8903
8904 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8905
8906 * unexmacosx.c (copy_data_segment): Copy initialized data in
8907 statically linked libraries from input file rather than memory.
8908
8909 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8910 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8911 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8912
8913 2012-08-10 Glenn Morris <rgm@gnu.org>
8914
8915 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8916 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8917
8918 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8919
8920 Fix last change to allow compilation with low optimization levels.
8921 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8922 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8923
8924 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8925
8926 Use common inline syntax in intervals.h.
8927 * intervals.h (INTERVALS_INLINE): New macro.
8928 Change all users from LISP_INLINE.
8929
8930 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8931
8932 Define Qnone once for all platforms.
8933 * frame.c (Qnone): Define here.
8934 (syms_of_frame): DEFSYM it.
8935 * lisp.h (Qnone): New declaration.
8936 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8937 * xfns.c: Remove duplication. Adjust users.
8938
8939 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8940
8941 Remove unused macros from intervals.h.
8942 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8943 * intervals.c: Adjust comment.
8944
8945 2012-08-10 Eli Zaretskii <eliz@gnu.org>
8946
8947 * w32fns.c <w32_unicode_gui>: New static variable.
8948 (globals_of_w32fns): Initialize it according to os_subtype.
8949 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8950 testing os_subtype.
8951
8952 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
8953 Eli Zaretskii <eliz@gnu.org>
8954
8955 Fix bug #10299 with Unicode characters sent by customized
8956 keyboards created by MSKLC.
8957 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8958 (w32_init_class): Use it to initialize the Emacs class with either
8959 ANSI or Unicode API calls.
8960 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8961 later.
8962 (w32_wnd_proc): If the character code sent by WM_CHAR or
8963 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8964 original message. Call DefWindowProcW on NT and later.
8965
8966 2012-08-10 Glenn Morris <rgm@gnu.org>
8967
8968 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8969
8970 * lisp.h (DIRECTORY_SEP): Let configure set it.
8971
8972 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8973
8974 Use TSET for write access to Lisp_Object slots of struct terminal.
8975 * termhooks.h (TSET): New macro.
8976 * coding.c, terminal.c, xselect.c: Adjust users.
8977
8978 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8979
8980 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8981 the failing expression, include them in the error message.
8982 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8983 * lisp.h (internal_condition_case_n): Update declaration.
8984
8985 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8986
8987 Inline functions to examine and change buffer overlays.
8988 * buffer.c (unchain_both): New function.
8989 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8990 (buffer_has_overlays): New function.
8991 (enum overlay_type): New enum.
8992 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8993 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8994
8995 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8996
8997 Inline functions to examine and change buffer intervals.
8998 * alloc.c (mark_interval_tree): Remove.
8999 (MARK_INTERVAL_TREE): Simplify.
9000 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
9001 * intervals.c (buffer_balance_intervals): New function.
9002 (graft_intervals_into_buffer): Adjust indentation.
9003 (set_intervals_multibyte): Simplify.
9004 * buffer.h (BUF_INTERVALS): Remove.
9005 (buffer_get_intervals, buffer_set_intervals): New function.
9006 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
9007 * intervals.c, textprop.c: Adjust users.
9008
9009 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9010
9011 Inline functions to examine and change string intervals.
9012 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
9013 (string_get_intervals, string_set_intervals): New function.
9014 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9015 * lread.c, print.c, textprop.c: Adjust users.
9016
9017 2012-08-08 Glenn Morris <rgm@gnu.org>
9018
9019 * lisp.mk (lisp): Remove language/persian.elc.
9020
9021 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9022
9023 Cleanup intervals.
9024 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
9025 (NULL_INTERVAL_P): Likewise. Adjust users.
9026 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
9027 Adjust comment. Move under #if 0.
9028 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
9029 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
9030
9031 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
9032
9033 Check total length of intervals with eassert.
9034 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
9035 * intervals.c: Change all users to eassert.
9036
9037 2012-08-07 Eli Zaretskii <eliz@gnu.org>
9038
9039 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
9040 Rename fields to match removal of FGET and WGET and disuse of
9041 INTERNAL_FIELD in Lisp_Cons.
9042
9043 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9044
9045 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
9046 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
9047 name since all xname users are fixed long time ago. Do not
9048 use INTERNAL_FIELD.
9049 (set_symbol_name, set_symbol_function, set_symbol_plist):
9050 (set_symbol_next, set_overlay_plist): New function.
9051 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
9052 (struct Lisp_Overlay): Likewise.
9053 (CVAR, MVAR, SVAR): Remove.
9054 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
9055 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
9056 * xterm.c: Adjust users.
9057 * .gdbinit: Change to use name field of struct Lisp_Symbol
9058 where appropriate.
9059
9060 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9061
9062 Basic functions to set Lisp_Object and pointer slots of intervals.
9063 * intervals.h (interval_set_parent, interval_set_object):
9064 (interval_set_left, interval_set_right, interval_set_plist):
9065 (interval_copy_parent): New function.
9066 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
9067 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
9068 Adjust indentation.
9069 (INTERVAL_SIZE): Remove. Adjust users.
9070 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
9071
9072 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9073
9074 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
9075 * process.h (PGET): Remove.
9076 (struct Lisp_Process): Do not use INTERNAL_FIELD.
9077 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9078
9079 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9080
9081 Drop WGET and revert read access to Lisp_Objects slots of struct window.
9082 * window.h (WGET): Remove.
9083 (struct window): Do not use INTERNAL_FIELD.
9084 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9085 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9086 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9087 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9088 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9089 Adjust users.
9090
9091 2012-08-07 Chong Yidong <cyd@gnu.org>
9092
9093 * window.c (Fwindow_edges, Fwindow_pixel_edges)
9094 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
9095 (Fdelete_window_internal): Signal an error if the window is not on
9096 a live frame (Bug#12025).
9097
9098 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
9099
9100 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
9101 * frame.h (FGET): Remove.
9102 (struct frame): Do not use INTERNAL_FIELD.
9103 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9104 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9105 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9106 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9107
9108 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
9109
9110 * w32.c: Silence compiler warnings.
9111 (map_w32_filename): Remove unused variable `is_fat'.
9112 (chase_symlinks): Add parentheses around expression.
9113
9114 2012-08-06 Glenn Morris <rgm@gnu.org>
9115
9116 * sysdep.c: Respect BROKEN_GETWD.
9117
9118 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
9119 Let configure handle it.
9120 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
9121
9122 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9123
9124 Use GCALIGNMENT where appropriate.
9125 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
9126 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
9127 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
9128
9129 2012-08-06 Eli Zaretskii <eliz@gnu.org>
9130
9131 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
9132 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
9133
9134 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
9135
9136 * buffer.h (struct buffer): Revert `indirections' to a simple int;
9137 that should be sufficient for everyone.
9138
9139 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9140
9141 * keyboard.c (timer_check_2): Add break so timer_check returns next
9142 timeout.
9143
9144 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9145
9146 Fix Windows build errors introduced after converting to WGET and WSET.
9147 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9148 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9149
9150 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9151
9152 * nsterm.m (ns_frame_rehighlight): Use FSET.
9153
9154 * nsmenu.m (ns_update_menubar): Use FSET.
9155
9156 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9157
9158 Separate read and write access to Lisp_Object slots of Lisp_Process.
9159 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9160 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9161
9162 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9163
9164 Separate read and write access to Lisp_Object slots of struct window.
9165 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9166 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9167 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9168 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9169 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9170 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9171 Adjust users.
9172
9173 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9174
9175 Fix Windows build errors introduced after converting to FGET and FSET.
9176 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9177 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9178 (w32_judge_scroll_bars): Change to use FSET.
9179 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9180
9181 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9182
9183 Fix replacement typo.
9184 * window.c (replace_window): Set root_window instead of
9185 selected_window. This fixes a total window subsystem
9186 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9187
9188 2012-08-06 Glenn Morris <rgm@gnu.org>
9189
9190 * lisp.mk (lisp): Add language/persian.elc.
9191
9192 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9193
9194 Separate read and write access to Lisp_Object slots of struct frame.
9195 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9196 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9197 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9198 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9199 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9200
9201 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9202
9203 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9204
9205 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9206
9207 Generalize common compile-time constants.
9208 * lisp.h (header_size, bool_header_size, word_size): Now here.
9209 (struct Lisp_Vector): Add comment.
9210 (struct Lisp_Bool_Vector): Move up to define handy constants.
9211 (VECSIZE, PSEUDOVECSIZE): Simplify.
9212 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9213 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9214 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9215 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9216 * xfont.c, xmenu.c: Use word_size where appropriate.
9217
9218 2012-08-05 Lawrence Mitchell <wence@gmx.li>
9219
9220 * search.c (Freplace_match): Treat \? in the replacement text
9221 literally (Bug#8161).
9222
9223 2012-08-05 Chong Yidong <cyd@gnu.org>
9224
9225 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9226 * frame.c (Vdelete_frame_functions):
9227 * emacs.c (Vkill_emacs_hook): Doc fix.
9228
9229 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9230
9231 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9232 --with-x-toolkit=no builds.
9233 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9234
9235 2012-08-04 Chong Yidong <cyd@gnu.org>
9236
9237 * syntax.c (Fmodify_syntax_entry): Doc fix.
9238
9239 2012-08-04 Eli Zaretskii <eliz@gnu.org>
9240
9241 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9242 * w32.c (init_environment): Change the default values of many
9243 environment variables in dflt_envvars[] to NULL, to avoid pushing
9244 them into environment when they were not already defined.
9245 Remove the code that deletes site-lisp subdirectories from the default
9246 value of EMACSLOADPATH, as it is no longer needed.
9247 (check_windows_init_file): Now external, not static.
9248 Use Vload_path as is, without adding anything, as this function is now
9249 called when Vload_path is already set up.
9250
9251 * w32.h (check_windows_init_file): Add prototype.
9252
9253 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9254 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9255 compatibility with Posix platforms.
9256 (main): Move the call to check_windows_init_file to here from
9257 w32.c.
9258 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9259 any, in the DEFALT argument into the root of the Emacs build or
9260 installation tree, as appropriate.
9261
9262 * callproc.c (init_callproc_1): Call decode_env_path instead of
9263 doing its equivalent by hand.
9264 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9265 the code that sets Vexec_path run on MS-Windows.
9266
9267 * lread.c (init_lread): Add comments to #ifdef's.
9268
9269 * msdos.c (dos_set_window_size, IT_update_begin)
9270 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9271 instead of direct references.
9272
9273 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9274
9275 Export DEFAULT_REHASH_* to GDB.
9276 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9277 Now constants, not macros.
9278
9279 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9280
9281 Remove unnecessary casts involving pointers.
9282 These casts are no longer needed now that we assume C89 or later,
9283 since they involve casting to or from void *.
9284 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9285 (make_pure_float, make_pure_vector):
9286 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9287 * macros.c (Fstart_kbd_macro):
9288 * menu.c (find_and_return_menu_selection):
9289 * minibuf.c (read_minibuf_noninteractive):
9290 * sysdep.c (closedir):
9291 * xdisp.c (x_produce_glyphs):
9292 * xfaces.c (compare_fonts_by_sort_order):
9293 * xfns.c (x_real_positions, select_visual):
9294 * xselect.c (x_stop_queuing_selection_requests)
9295 (x_get_window_property, x_get_window_property_as_lisp_data):
9296 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9297 Remove unnecessary pointer casts.
9298 * alloc.c (record_xmalloc): New function.
9299 * lisp.h (record_xmalloc): New decl.
9300 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9301 more like a function. This is because the pointer cast is not
9302 needed. All uses changed.
9303 * print.c (print_string, print_error_message): Avoid length recalc.
9304
9305 Improve fix for macroexp crash with debugging (Bug#12118).
9306 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9307 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9308 not supposed to be invoked from the garbage collector.
9309 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9310 (gc_aset): New function, which is like ASET but can be
9311 used in the garbage collector.
9312 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9313 (set_hash_index): Use it instead of ASET.
9314
9315 2012-08-03 Eli Zaretskii <eliz@gnu.org>
9316
9317 Support symlinks on latest versions of MS-Windows.
9318 * w32.c: Include winioctl.h and aclapi.h.
9319 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9320 (revert_to_self): Forward declarations of static functions.
9321 <static BOOL g_b_init_get_security_info>:
9322 <g_b_init_create_symbolic_link>: New static flags.
9323 (globals_of_w32): Initialize them to zero.
9324 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9325 (map_w32_filename): Improve commentary. Simplify switch.
9326 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9327 headers (most versions of MinGW w32api don't).
9328 (get_security_info, create_symbolic_link)
9329 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9330 New functions.
9331 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9332 in the argument file name.
9333 (sys_access): Call unc_volume_file_attributes only if
9334 GetFileAttributes fails with network-related error codes.
9335 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9336 have the required privileges.
9337 (get_file_security_desc_by_name): Rename from
9338 get_file_security_desc.
9339 (stat_worker): New function, with most of the guts of 'stat', and
9340 with addition of handling of symlinks and support for 'lstat'.
9341 If possible, get file's attributes and security information by
9342 handle, not by name. Produce S_IFLNK bit for symlinks, when
9343 called from 'lstat'.
9344 (stat, lstat): New functions, call 'stat_worker'.
9345 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9346 symlinks when the underlying filesystem supports them.
9347
9348 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9349
9350 Fix macroexp crash on Windows with debugging (Bug#12118).
9351 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9352 checking subscripts; problem introduced with the recent
9353 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9354 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9355 since it's used in non-static inline functions now.
9356
9357 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9358 Don't assume buffer size fits in 'int'. Remove unused local.
9359
9360 Use C99-style 'extern inline' if available.
9361 * buffer.h (BUFFER_INLINE):
9362 * category.h (CATEGORY_INLINE):
9363 * character.h (CHARACTER_INLINE):
9364 * charset.h (CHARSET_INLINE):
9365 * composite.h (COMPOSITE_INLINE):
9366 * dispextern.h (DISPEXTERN_INLINE):
9367 * lisp.h (LISP_INLINE):
9368 * systime.h (SYSTIME_INLINE):
9369 New macro, replacing 'static inline' in this header.
9370 * buffer.h, category.h, character.h, charset.h, composite.h:
9371 * dispextern.h, lisp.h, systime.h:
9372 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9373 * alloc.c (LISP_INLINE):
9374 * buffer.c (BUFFER_INLINE):
9375 * category.c (CATEGORY_INLINE):
9376 * character.c (CHARACTER_INLINE):
9377 * charset.c (CHARSET_INLINE):
9378 * composite.c (COMPOSITE_INLINE):
9379 * dispnew.c (DISPEXTERN_INLINE):
9380 * sysdep.c (SYSTIME_INLINE):
9381 Define to EXTERN_INLINE, so that the corresponding functions
9382 are compiled into code.
9383 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9384 (INLINE_HEADER_END): New macros.
9385 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9386 since it's used in non-static inline functions now.
9387 (VALMASK) [!USE_LSB_TAG]: Likewise.
9388
9389 2012-08-02 Glenn Morris <rgm@gnu.org>
9390
9391 * s/: Remove empty directory.
9392
9393 * s/ms-w32.h: Move to ../nt/inc.
9394 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9395 Update for new ms-w32.h location.
9396
9397 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9398
9399 Port to Solaris 8.
9400 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9401
9402 2012-08-02 Glenn Morris <rgm@gnu.org>
9403
9404 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9405 hard-coding the path separator.
9406
9407 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9408
9409 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9410 This how ASET and AREF are supposed to work, and makes
9411 it easier to think about future improvements. See
9412 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9413 * charset.h (set_charset_attr): New function.
9414 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9415 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9416 (aref_addr): New function. All uses of &AREF(...) changed.
9417 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9418 (set_hash_index): New functions. All lvalue-style uses of
9419 HASH_KEY etc. changed.
9420 * keyboard.c (set_prop): New function. All lvalue-style uses
9421 of PROP changed.
9422
9423 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9424
9425 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9426 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
9427 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
9428 * nsfns.m (ns_set_name_as_filename): Likewise.
9429 * nsmenu.m (ns_update_menubar): Likewise.
9430 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9431
9432 2012-08-01 Eli Zaretskii <eliz@gnu.org>
9433
9434 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9435 Adapt to latest changes in field names of the corresponding Lisp
9436 objects.
9437
9438 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9439
9440 2012-08-01 Glenn Morris <rgm@gnu.org>
9441
9442 * s/msdos.h: Remove file.
9443 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9444 * Makefile.in (S_FILE): Remove.
9445 (config_h): Remove S_FILE.
9446
9447 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9448
9449 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9450 Remove; moved to nt/config.nt.
9451
9452 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9453
9454 Use INTERNAL_FIELD for conses and overlays.
9455 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9456 Remove obsolete comment.
9457 (MVAR): New macro.
9458 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9459 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9460
9461 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9462
9463 Use INTERNAL_FIELD for symbols.
9464 * lisp.h (SVAR): New macro. Adjust users.
9465 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9466 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9467
9468 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9469
9470 Use INTERNAL_FIELD for processes.
9471 * process.h (PVAR): New macro. Adjust style.
9472 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9473 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9474
9475 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9476
9477 Use INTERNAL_FIELD for windows.
9478 * window.h (WVAR): New macro.
9479 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9480 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9481 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9482 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9483 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9484 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9485
9486 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9487
9488 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9489
9490 2012-08-01 Glenn Morris <rgm@gnu.org>
9491
9492 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9493 Move to configure.ac.
9494
9495 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
9496
9497 * makefile.w32-in (CONFIG_H): Update dependencies.
9498 (CONF_POST_H): New macro.
9499
9500 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9501
9502 2012-07-31 Glenn Morris <rgm@gnu.org>
9503
9504 * Makefile.in (S_FILE): No longer set by configure.
9505
9506 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9507 is available.
9508 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9509
9510 * process.h (NULL_DEVICE):
9511 * emacs.c (SEPCHAR):
9512 * editfns.c (USER_FULL_NAME): Let configure set them.
9513
9514 * s/README, s/template.h: Remove files.
9515
9516 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9517
9518 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9519 Move to configure.ac.
9520
9521 2012-07-31 Eli Zaretskii <eliz@gnu.org>
9522
9523 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9524 resulting renaming of 'struct frame' members.
9525
9526 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9527
9528 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9529 after introduction of FVAR.
9530
9531 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9532
9533 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9534
9535 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9536 instead of compositeToPoint.
9537 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9538
9539 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
9540
9541 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9542
9543 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9544 * lisp.h (INTERNAL_FIELD): New macro.
9545 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
9546 (BVAR): Change to use INTERNAL_FIELD.
9547 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9548 (KVAR): Change to use INTERNAL_FIELD.
9549 * frame.h (FVAR): New macro.
9550 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
9551 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9552 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9553 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9554 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9555
9556 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9557
9558 Miscellaneous fixes for non-default X toolkits.
9559 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9560 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9561 Move under #ifdef USE_LUCID.
9562 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9563 definition and usage to avoid warnings.
9564
9565 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9566
9567 * nsterm.m (openFiles): Fix previous checkin.
9568
9569 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9570
9571 * indent.c (compute_motion): Remove unused local.
9572
9573 2012-07-31 Glenn Morris <rgm@gnu.org>
9574
9575 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9576
9577 * conf_post.h [USG5_4]:
9578 Move remaining contents of s/usg5-4-common.h here.
9579 * s/usg5-4-common.h: Remove file.
9580
9581 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9582 * s/irix6-5.h: Remove file.
9583
9584 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9585 * s/darwin.h: Remove file.
9586
9587 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9588 * s/hpux10-20.h: Remove file, which is now empty.
9589
9590 2012-07-30 Glenn Morris <rgm@gnu.org>
9591
9592 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9593 * Makefile.in (config_h): Add conf_post.h.
9594 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9595
9596 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9597
9598 * nsterm.m (ns_do_open_file): New variable.
9599 (ns_term_init): Set ns_do_open_file to YES after run returns.
9600 (openFile, openTempFile, openFileWithoutUI, openFiles):
9601 Open files only if ns_do_open_file.
9602
9603 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9604
9605 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9606 This no-op macro hasn't been needed for many years.
9607 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9608
9609 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9610 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9611 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9612 gdb_make_enums_visible.
9613 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9614 (DIRECTORY_SEP): Now a constant, not a macro.
9615
9616 2012-07-30 Eli Zaretskii <eliz@gnu.org>
9617
9618 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9619 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9620
9621 * w32term.c <w32_keyboard_codepage>: Renamed from
9622 keyboard_codepage and now external. All users changed.
9623
9624 * w32term.h: Add declaration of w32_keyboard_codepage.
9625
9626 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9627 the codepage to translate keys to Unicode. If this argument is
9628 -1, use the value returned by GetConsoleCP. All callers changed.
9629
9630 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9631
9632 Update .PHONY listings in makefiles.
9633 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9634 bootstrap-clean, distclean, maintainer-clean, versioclean,
9635 extraclean, frc.
9636
9637 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9638 This is a bit clearer. Fix some commentary typos.
9639
9640 2012-07-30 Glenn Morris <rgm@gnu.org>
9641
9642 * s/netbsd.h: Let configure include signal.h if needed.
9643 Remove file, which is now empty.
9644
9645 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9646 Let configure set them.
9647 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9648 No more need to undefine.
9649
9650 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9651
9652 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9653 non-single-byte char when adding meta modifier. (Bug#12090)
9654
9655 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9656
9657 Convert safe_call to use variable number of arguments.
9658 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9659 (safe_call2): Fix comment.
9660 * lisp.h (safe_call): Adjust prototype.
9661 * coding.c (encode_coding_object): Change to use safe_call2.
9662 * xfaces.c (merge_face_heights): Change to use safe_call1.
9663
9664 2012-07-30 Glenn Morris <rgm@gnu.org>
9665
9666 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
9667 does that unconditionally. Remove file, which is now empty.
9668
9669 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9670 Remove empty files.
9671
9672 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9673
9674 Export to GDB most of lisp.h's remaining object-like macros.
9675 * lisp.h (min, max): Move earlier, because they're used earlier now.
9676 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9677 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9678 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9679 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9680 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9681 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9682 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9683 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9684 Now constants, for GDB. They need not be macros.
9685 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9686 Now constants, for GDB, as well as macros, for static initializers.
9687 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9688 Move to after the definition of struct Lisp_Char_Table,
9689 since the former now needs that type defined.
9690 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9691 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9692 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9693 New enums, for gdb_make_enums_visible.
9694 (GLYPH_MODE_LINE_FACE): Remove; unused.
9695 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
9696 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9697 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9698 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9699 enum maxargs, enum MAX_ALLOCA.
9700 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9701 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9702 no longer needed, now that they are done in lisp.h.
9703
9704 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9705
9706 Cleanup string bytes checking.
9707 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9708 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9709 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9710 (check_sblock, compact_small_strings): Simplify.
9711
9712 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9713
9714 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9715 These macros are confusing and no longer need to be defined, as
9716 the enum values now suffice. All uses replaced with definiens.
9717 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9718
9719 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
9720
9721 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9722 ($(BLD)/w32console.$(O)): Update dependencies.
9723
9724 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9725
9726 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9727 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9728 time. Adjust users.
9729 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9730
9731 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9732
9733 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9734 setting sitelisp (Bug#12010).
9735
9736 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9737
9738 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
9739
9740 * w32heap.c (cache_system_info):
9741 * w32.c (sys_rename):
9742 * w32proc.c (find_child_console, sys_kill): All users changed.
9743
9744 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9745
9746 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9747
9748 2012-07-29 Eli Zaretskii <eliz@gnu.org>
9749
9750 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9751
9752 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9753
9754 Cleanup statistics calculation in Fgarbage_collect.
9755 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9756 Fix zombies percentage calculation. Simplify elapsed time calculation.
9757
9758 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9759
9760 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9761 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9762 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9763 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9764 (replace_range, replace_range_2, del_range_2): Change to eassert.
9765 * marker.c (byte_char_debug_check): Adjust style.
9766
9767 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9768
9769 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9770 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9771 long-ago-commented-out code that talks about "WIN32".
9772 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9773 All uses changed.
9774
9775 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9776
9777 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9778 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9779 Simplify by using alignof.
9780 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9781 * lisp.h: Include <stdalign.h>.
9782 (GCALIGNMENT): New macro and constant.
9783 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9784 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9785 (stdalign): New macro, if not already defined.
9786
9787 2012-07-28 Eli Zaretskii <eliz@gnu.org>
9788
9789 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9790 * w32inevt.c: Include w32inevt.h.
9791 (w32_read_console_input): New inline function, calls either
9792 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9793 w32_console_unicode_input.
9794 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9795 (w32_kbd_patch_key, key_event): Use the codepage returned by
9796 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9797 (key_event): use uChar.UnicodeChar only if
9798 w32_console_unicode_input is non-zero.
9799
9800 * w32console.c: Include w32heap.h.
9801 <w32_console_unicode_input>: New global variable.
9802 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9803 family of Windows, zero otherwise.
9804
9805 * w32inevt.h: Declare w32_console_unicode_input.
9806
9807 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9808 --without-x. (Bug#11742)
9809
9810 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9811
9812 Adjust GDB to reflect pvec_type changes (Bug#12036).
9813 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
9814 2012-07-04 changes to pseudovector representation.
9815 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
9816
9817 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
9818
9819 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9820 bus address.
9821 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9822
9823 2012-07-27 Eli Zaretskii <eliz@gnu.org>
9824
9825 * alloc.c (listn): Fix the order the arguments are consed onto the
9826 list.
9827
9828 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9829 enumeration constants, as PURE and HEAP are too general, and clash
9830 with other headers and sources, such as gmalloc.c and the
9831 MS-Windows system headers. All users changed.
9832
9833 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9834
9835 Revert last save_excursion_save and save_excursion_restore changes.
9836 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9837 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9838
9839 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9840
9841 Fix recently-introduced typos in Windows port.
9842 Reported by Martin Rudalics <rudalics@gmx.at>.
9843 * w32.c (init_environment): Replace comma with semicolon.
9844 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
9845
9846 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9847
9848 Improve GDB symbol export (Bug#12036).
9849 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9850 arms of an 'if', not using conditional expressions; otherwise GDB
9851 complains about the types in the unevaluated arm when the argument
9852 is an integer literal.
9853 (xgetint): Simplify expression.
9854 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9855 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9856 Zaretskii in <http://bugs.gnu.org/12036#13>.
9857 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9858 needed now that we have gdb_make_enums_visible.
9859 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9860 (enum enum_USE_LSB_TAG):
9861 New enum types, packaging up enums that need to be exported to GDB.
9862
9863 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9864
9865 Utility function to make a list from specified amount of objects.
9866 * lisp.h (enum constype): New datatype.
9867 (listn): New prototype.
9868 * alloc.c (listn): New function.
9869 (Fmemory_use_count, syms_of_alloc): Use it.
9870 * buffer.c (syms_of_buffer): Likewise.
9871 * callint.c (syms_of_callint): Likewise.
9872 * charset.c (define_charset_internal): Likewise.
9873 * coding.c (syms_of_coding): Likewise.
9874 * keymap.c (syms_of_keymap): Likewise.
9875 * search.c (syms_of_search): Likewise.
9876 * syntax.c (syms_of_syntax): Likewise.
9877 * w32.c (init_environment): Likewise.
9878 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9879 * xdisp.c (syms_of_xdisp): Likewise.
9880 * xfns.c (syms_of_xfns): Likewise.
9881
9882 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9883
9884 Fast save_excursion_save and save_excursion_restore.
9885 * lisp.h (struct Lisp_Excursion): New data type.
9886 (PVEC_EXCURSION): New pseudovector type.
9887 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9888 to deal with it. Adjust comments.
9889 (init_marker, attach_marker): New prototype.
9890 (unchain_marker): Adjust prototype.
9891 * marker.c (attach_marker): Change to global.
9892 (init_marker): New function.
9893 * alloc.c (Fmake_marker, build_marker): Use it.
9894 (build_marker): More easserts.
9895 (mark_object): Handle struct Lisp_Excursion.
9896 * editfns.c (save_excursion_save, save_excursion_restore):
9897 Reimplement to use struct Lisp_Excursion. Add comments.
9898
9899 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9900
9901 Fix export of symbols to GDB (Bug#12036).
9902 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9903 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9904 emacs.c, as this is a more-suitable home. Had this been done earlier
9905 the fix for 12036 would have avoided some of the problems noted in
9906 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9907 would have been more obvious.
9908 * emacs.c: Do not include <verify.h>; no longer needed.
9909 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
9910 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9911 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9912 Remove; now done in lisp.h.
9913 * lisp.h (PUBLISH_TO_GDB): New macro.
9914 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9915 (DATA_SEG_BITS): Use it.
9916 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9917 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9918 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9919 not be usable in #if. This simplifies things.
9920
9921 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
9922
9923 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9924
9925 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9926
9927 Simplify export of symbols to GDB (Bug#12036).
9928 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9929 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9930 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9931 Adjust to changes in lisp.h and emacs.c, by using
9932 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9933 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9934 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9935 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9936 instead of gdb_valbits.
9937 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9938 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9939 instead of gdb_array_mark_flag.
9940 (xboolvector): Get size from $->size, not $->header.size.
9941 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9942 (xreload, hook-run, hookpost-run): Remove.
9943 * emacs.c: Include <verify.h>.
9944 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9945 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9946 Remove.
9947 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9948 (gdb_USE_LSB_TAG): New enum constants.
9949 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9950 Also define these as enum constants, so they're visible to GDB.
9951 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9952 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9953 as constants, so they're visible to GDB.
9954 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9955 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9956 Now enum constants, not macros, so they're visible to GDB.
9957 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9958 more convenient now. All uses changed.
9959 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9960 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9961
9962 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9963
9964 Explicitly free restriction data that are not needed anymore.
9965 * editfns.c (save_restriction_restore): Free restriction data.
9966
9967 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9968
9969 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9970 add argument, tune behavior, and adjust all callers.
9971
9972 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9973
9974 Use typedef for EMACS_INT, EMACS_UINT.
9975 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9976 than macros. This simplifies debugging in the usual case, since
9977 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9978 and it allows expressions involving EMACS_INT casts.
9979 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9980
9981 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9982
9983 * nsterm.m (ns_read_socket): Return early if there is a modal
9984 window (Bug#12043).
9985
9986 2012-07-25 Martin Rudalics <rudalics@gmx.at>
9987
9988 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9989 that FOCUS-FRAME can be omitted.
9990
9991 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9992
9993 Adjust buffer text indirection counters at the end of Fkill_buffer.
9994 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9995 buffer is definitely dead. This should really fix an issue reported
9996 by Christoph Scholtes again. (Bug#12007).
9997 (init_buffer_once): Initialize indirection counters of
9998 buffer_defaults and buffer_local_symbols (for sanity and safety).
9999
10000 2012-07-24 Eli Zaretskii <eliz@gnu.org>
10001
10002 * xdisp.c (init_iterator): Don't compute dimensions of truncation
10003 and continuation glyphs on tooltip frames, leave them at zero.
10004 Avoids continued lines in tooltips. (Bug#11832)
10005
10006 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
10007
10008 Simplify copy_overlay.
10009 * buffer.c (copy_overlay): Simplify. Use build_marker.
10010 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
10011
10012 2012-07-23 Eli Zaretskii <eliz@gnu.org>
10013
10014 * print.c (print_object): Don't crash when a frame's name is nil
10015 or invalid. (Bug#12025)
10016
10017 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
10018 it signals an error when a tooltip frame is being created.
10019
10020 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10021
10022 Cleanup miscellaneous objects allocation and initialization.
10023 * alloc.c (allocate_misc): Change to static. Add argument to
10024 specify the subtype. Adjust comment and users.
10025 (build_overlay): New function.
10026 * buffer.c (copy_overlays, Fmake_overlay): Use it.
10027 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
10028 (allocate_misc): Remove prototype.
10029 (build_overlay): Add prototype.
10030
10031 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
10032
10033 Swap buffer text indirection counters in Fbuffer_swap_text.
10034 * buffer.c (Fbuffer_swap_text): Swap indirections too.
10035 This avoids crash reported by Christoph Scholtes at
10036 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
10037
10038 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
10039
10040 * nsmenu.m (Popdown_data): New struct.
10041 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
10042 free Popdown_data.
10043 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
10044 (initWithContentRect): Make imgView and contentView non-static
10045 and autorelease them. Also autorelease img and matrix (Bug#12005).
10046 (dealloc): Remove (Bug#12005).
10047
10048 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10049
10050 Adjust consing_since_gc when objects are explicitly freed.
10051 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
10052 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
10053 (free_cons, free_misc): Subtract object size from consing_since_gc.
10054
10055 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
10056
10057 Simplify and cleanup markers positioning code.
10058 * marker.c (attach_marker): More useful eassert.
10059 (live_buffer, set_marker_internal): New function.
10060 (Fset_marker, set_marker_restricted): Use set_marker_internal.
10061 (set_marker_both, set_marker_restricted_both): Use live_buffer.
10062
10063 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
10064
10065 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
10066 as it's limited by the amount of memory, not by INT_MAX.
10067
10068 2012-07-21 Eli Zaretskii <eliz@gnu.org>
10069
10070 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
10071 in special-event-map. See the discussion at
10072 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
10073 for the reasons.
10074
10075 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
10076 info.dwItemData. Fixes crashes on 64-bit Windows.
10077 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
10078
10079 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
10080
10081 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
10082 (conversationIdentifier): Return value is NSInteger.
10083 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
10084
10085 2012-07-21 Chong Yidong <cyd@gnu.org>
10086
10087 * window.c (decode_any_window): Signal an error if the window is
10088 on a dead frame (Bug#11984).
10089
10090 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10091
10092 Add indirection counting to speed up Fkill_buffer.
10093 * buffer.h (struct buffer): New member.
10094 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
10095 (Fmake_indirect_buffer): Set indirection counter to -1, increment
10096 base buffer indirection counter.
10097 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
10098 (Fkill_buffer): Adjust indirection counters as needed, don't walk
10099 through buffer list if indirection counter is 0.
10100
10101 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10102
10103 Extend the value returned by Fgarbage_collect with heap statistics.
10104 * alloc.c (Qheap): New symbol.
10105 (syms_of_alloc): DEFSYM it.
10106 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
10107 (Fmemory_free): Remove.
10108 (syms_of_alloc): Don't defsubr it.
10109 * buffer.c (Fcompact_buffer): Remove.
10110 (syms_of_buffer): Don't defsubr it.
10111
10112 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10113
10114 Make maybe_gc inline.
10115 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
10116 * lisp.h (consing_since_gc, gc_relative_threshold)
10117 (memory_full_cons_threshold): Revert declaration.
10118 (maybe_gc): Remove prototype, define as inline.
10119 * alloc.c: Remove old commented-out code.
10120 (consing_since_gc, gc_relative_threshold)
10121 (memory_full_cons_threshold): Revert to global.
10122 (maybe_gc): Remove.
10123
10124 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10125
10126 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
10127 * lisp.h (build_unibyte_string): New function.
10128 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
10129 * sysdep.c, w32fns.c, xfns.c: Use it.
10130 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
10131 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
10132 Adjust users accordingly.
10133 * font.h (font_open_by_name): Adjust prototype.
10134
10135 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
10136
10137 Cleanup calls to Fgarbage_collect.
10138 * lisp.h (maybe_gc): New prototype.
10139 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10140 Remove declarations.
10141 * alloc.c (maybe_gc): New function.
10142 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
10143 Make them static.
10144 * bytecode.c (MAYBE_GC): Use maybe_gc.
10145 * eval.c (eval_sub, Ffuncall): Likewise.
10146 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10147 to avoid dependency from auto-save feature.
10148
10149 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10150
10151 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10152 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10153 'for_each_per_buffer_object_at'.
10154 All uses changed. It's better to use upper-case for macros that
10155 cannot be implemented as functions, to give the reader a clue
10156 that they're special.
10157
10158 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10159
10160 * alloc.c (Fgarbage_collect): Tweak docstring.
10161
10162 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10163
10164 Tweak the value returned from Fgarbage_collect again.
10165 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10166 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10167 Adjust documentation.
10168 (total_vector_bytes): Rename to total_vector_slots, adjust
10169 accounting.
10170 (total_free_vector_bytes): Rename to total_free_vector_slots,
10171 adjust accounting.
10172 (Qstring_bytes, Qvector_slots): New symbols.
10173 (syms_of_alloc): DEFSYM them.
10174
10175 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10176
10177 Buffer compaction primitive which may be used from Lisp.
10178 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10179 (syms_of_buffer): Register Fcompact_buffer.
10180 * alloc.c (Fgarbage_collect): Use compact_buffer.
10181 * buffer.h (compact_buffer): New prototype.
10182 (struct buffer_text): New member.
10183
10184 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10185
10186 New macro to iterate over all buffers, miscellaneous cleanups.
10187 * lisp.h (all_buffers): Remove declaration.
10188 * buffer.h (all_buffers): Add declaration, with comment.
10189 (for_each_buffer): New macro.
10190 * alloc.c (Fgarbage_collect, mark_object): Use it.
10191 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10192 (init_buffer): Likewise.
10193 * data.c (Fset_default): Likewise.
10194 * coding.c (code_conversion_restore): Remove redundant check
10195 for dead buffer.
10196 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10197
10198 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10199
10200 Fix bug that created negative-length intervals.
10201 * intervals.c (merge_interval_right, merge_interval_left):
10202 Do not zero out this interval if it is absorbed by its children,
10203 as this interval's total length doesn't change in that case. See
10204 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10205
10206 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10207
10208 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10209 when invoking (make-bool-vector N t) and N is a positive
10210 multiple of 8 -- the last 8 bits were mistakenly cleared.
10211
10212 Remove some struct layout assumptions in bool vectors.
10213 * alloc.c (bool_header_size): New constant.
10214 (header_size, word_size): Move earlier, as they're now used earlier.
10215 Use 'word_size' in a few more places, where it's appropriate.
10216 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10217 padding before the data member of a bool vector.
10218 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10219 than doing the check by hand with an abort ().
10220
10221 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10222
10223 * eval.c (Fdefvar): Don't check constants since we only set the var if
10224 it's not yet defined anyway (bug#11904).
10225
10226 * lisp.h (last_undo_boundary): Declare new var.
10227 * keyboard.c (command_loop_1): Set it.
10228 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10229 were auto-added by the command loop (bug#11774).
10230
10231 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10232
10233 * w32font.c (Qsymbol): Remove local definition.
10234 (syms_of_w32font): Don't DEFSYM it.
10235
10236 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10237
10238 Fix sweep_vectors to handle large bool vectors correctly.
10239 * alloc.c (sweep_vectors): Account total_vector_bytes for
10240 bool vectors larger than VBLOCK_BYTES_MAX.
10241
10242 2012-07-18 Chong Yidong <cyd@gnu.org>
10243
10244 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10245 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10246
10247 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10248
10249 Return more descriptive data from Fgarbage_collect.
10250 Suggested by Stefan Monnier in
10251 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10252 * alloc.c (bounded_number): New function.
10253 (total_buffers, total_vectors): New variable.
10254 (total_string_size): Rename to total_string_bytes, adjust users.
10255 (total_vector_size): Rename to total_vector_bytes, adjust users.
10256 (sweep_vectors): Account total_vectors and total_vector_bytes.
10257 (Fgarbage_collect): New return value. Adjust documentation.
10258 (gc_sweep): Account total_buffers.
10259 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10260 (VECTOR_SIZE): Remove.
10261 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10262 (Qinterval, Qmisc): New symbols.
10263 (syms_of_data): Initialize them.
10264 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10265 (Qcons, Qbuffer): New declarations.
10266
10267 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10268
10269 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10270 Round up, not down. Improve doc.
10271
10272 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10273
10274 Restore old code in allocate_string_data to avoid Faset breakage.
10275 Reported by Julien Danjou <julien@danjou.info> in
10276 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10277 * alloc.c (allocate_string_data): Restore old code with minor
10278 adjustments, fix comment to explain this subtle issue.
10279
10280 2012-07-17 Eli Zaretskii <eliz@gnu.org>
10281
10282 Remove FILE_SYSTEM_CASE.
10283 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10284
10285 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10286 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10287 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10288 call-process-region passes it through expand-file-name.
10289
10290 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10291
10292 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10293
10294 Fix crash when creating indirect buffer (Bug#11917)
10295 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10296 Don't handle unbound variables specially if non-zero.
10297 (Fbuffer_local_variables): Pass zero.
10298 (clone_per_buffer_values): Pass non-zero.
10299
10300 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10301
10302 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10303 to make the loop interruptible.
10304
10305 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10306
10307 * gnutls.c (emacs_gnutls_handshake): Only retry if
10308 GNUTLS_E_INTERRUPTED.
10309
10310 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10311
10312 Cleanup and convert miscellaneous checks to eassert.
10313 * alloc.c (mark_interval): Fix comment, partially rephrase
10314 old comment from intervals.h (see below).
10315 * intervals.c (find_interval, adjust_intervals_for_insertion)
10316 (delete_interval, adjust_intervals_for_deletion)
10317 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10318 Convert to eassert.
10319 (adjust_intervals_for_insertion, make_new_interval):
10320 Remove obsolete and unused code.
10321 * intervals.h (struct interval): Remove obsolete comment.
10322 * textprotp.c (erase_properties): Remove unused code.
10323 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10324 (Fremove_list_of_text_properties): Convert to eassert.
10325
10326 2012-07-17 Chong Yidong <cyd@gnu.org>
10327
10328 * editfns.c (Finsert_char): Doc fix.
10329
10330 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10331
10332 Fix previous change to make Fmemory_free always accurate.
10333 * alloc.c (make_interval): Update total_free_intervals.
10334 (make_float): Likewise for total_free_floats.
10335 (free_cons, Fcons): Likewise for total_free_conses.
10336 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10337 Likewise for total_free_vector_bytes.
10338 (Fmake_symbol): Likewise for total_free_symbols.
10339 (bytes_free): Remove.
10340
10341 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10342
10343 Simple free memory accounting feature.
10344 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10345 (sweep_vectors): Accumulate size of free vectors.
10346 (Fgarbage_collect): Setup bytes_free.
10347 (Fmemory_free): New function.
10348 (syms_of_alloc): Register it.
10349
10350 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10351
10352 Cleanup overlays checking.
10353 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10354 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10355 eassert and OVERLAYP.
10356 (sort_overlays): Change to use OVERLAYP.
10357
10358 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10359
10360 * editfns.c (Finsert_char): Make it interactive, and make the
10361 second arg optional. Copy interactive spec and docstring from
10362 ucs-insert.
10363
10364 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10365
10366 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10367 Unlike the other wrapped functions, fabs has an unspecified
10368 effect on errno.
10369
10370 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10371
10372 * nsterm.m (keyDown): Interpret flags without left/right bits
10373 as the left key (Bug#11670).
10374
10375 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10376
10377 Remove empty and useless init functions.
10378 * lisp.h (init_character_once, init_fns, init_image)
10379 (init_filelock, init_sound): Remove prototype.
10380 * character.c (init_character_once): Remove.
10381 * filelock.c (init_filelock): Likewise.
10382 * fns.c (init_fns): Likewise.
10383 * image.c (init_image): Likewise.
10384 * sound.c (init_sound): Likewise.
10385 * emacs.c (main): Adjust accordingly.
10386
10387 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10388
10389 * gtkutil.h: Tiny cleanups.
10390 (use_old_gtk_file_dialog): Remove useless declaration.
10391 (xg_uses_old_file_dialog): Add suggested const attribute.
10392
10393 2012-07-15 Eli Zaretskii <eliz@gnu.org>
10394
10395 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10396 (bidi_paragraph_init): Use it to limit search forward for a strong
10397 directional character in abnormally large paragraphs full of
10398 neutral or weak characters. (Bug#11943)
10399
10400 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10401
10402 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10403 the toolbar (Bug#9451).
10404 (xg_make_tool_item): Give the widget event box a transparent
10405 background.
10406
10407 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10408
10409 Cleanup basic allocation variables and functions.
10410 * alloc.c (ignore_warnings, init_intervals, init_float)
10411 (init_cons, init_symbol, init_marker): Remove.
10412 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10413 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10414 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10415 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10416 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10417 (staticidx, init_alloc_once, init_strings, free_ablock):
10418 Remove redundant initialization.
10419 * fns.c (init_weak_hash_tables): Remove.
10420 * lisp.h (init_weak_hash_tables): Remove prototype.
10421
10422 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10423
10424 Use zero_vector where appropriate.
10425 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10426 accordingly.
10427 * lisp.h (zero_vector): New declaration.
10428 * font.c (null_vector): Remove.
10429 (syms_of_font): Remove initialization and staticpro.
10430 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10431 * keymap.c (Faccessible_keymaps): Likewise.
10432
10433 2012-07-15 Leo Liu <sdl.web@gmail.com>
10434
10435 * fringe.c: Fix typo in comments.
10436
10437 2012-07-14 Leo Liu <sdl.web@gmail.com>
10438
10439 * fringe.c: Add a new bitmap exclamation-mark.
10440
10441 2012-07-14 Eli Zaretskii <eliz@gnu.org>
10442
10443 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10444
10445 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10446 (HAVE_MENUS): Don't define, defined by editing config.in with
10447 msdos/sed2v2.inp.
10448 (GMALLOC_INHIBIT_VALLOC): Don't define.
10449 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10450
10451 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
10452
10453 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10454
10455 2012-07-14 Glenn Morris <rgm@gnu.org>
10456
10457 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10458 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10459 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10460
10461 2012-07-13 Glenn Morris <rgm@gnu.org>
10462
10463 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10464
10465 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10466 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10467
10468 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10469
10470 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10471 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10472 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10473 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10474 where appropriate.
10475 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10476 as boolean expression.
10477 (x_set_window_size): Remove unused variable toolbar.
10478 (ns_get_color_default, ns_mod_to_lisp): Remove.
10479 (ns_mouse_position): Remove unused variables xchar and ychar.
10480 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10481 (ns_set_vertical_scroll_bar): Remove unused variable count.
10482 (ns_delete_terminal): Remove unused variable i.
10483 (ns_term_init): Remove unused variables r, g and b.
10484 (mouseDown): Remove unused variable window.
10485 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10486 (initFrameFromEmacs): Remove unused variable vbextra.
10487 (mouseEntered): Remove unused variables p and dpyinfo.
10488 (mouseExited): Remove unused variables p and r.
10489 (ns_define_frame_cursor, ns_clear_frame_area)
10490 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10491 (menuDown): Assign [sender tag] to variable and cast the variable.
10492
10493 * nsterm.h (menuDown): Add id as type to argument sender.
10494 (ns_display_info_for_name): Add Lisp_Object argument.
10495 (ns_term_init): Add Lisp_Object argument.
10496 (ns_map_event_to_object): Add void argument.
10497 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10498 prototype with arguments and only declare if __OBJC__.
10499 (nxatoms_of_nsselect): Add void argument.
10500 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10501 (ns_alloc_autorelease_pool): Add void argument.
10502 (ns_release_autorelease_pool): Add void* argument.
10503 (ns_get_defaults_value): Add const char* argument.
10504
10505 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10506 (initFromContents): Use SSDATA where appropriate.
10507 (ns_update_menubar): Add braces to ambigous if-else.
10508 (initWithTitle): Put () around assignment in if statement.
10509 (ns_menu_show): Remove unused variables window and keymap.
10510 (update_frame_tool_bar): Remove unused variable selected_p.
10511 (initWithContentRect): Remove unused variable this_cmd_name.
10512
10513 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10514 appropriate.
10515 (setXBMColor): Remove unused variable len.
10516 (setPixmapData): Put () around assignment in loop statement.
10517
10518 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10519 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10520 where appropriate.
10521 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10522 around assignment in loop statement.
10523 (nsfont_open): Remove unused variable i.
10524 (nsfont_open): Remove unused variable len.
10525 (nsfont_draw): Remove unused variable cs.
10526
10527 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10528 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10529 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10530 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10531 (Fns_font_name, Fns_perform_service)
10532 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10533 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10534 (ns_set_name): Remove unused variable view.
10535 (x_set_menu_bar_lines): Remove unused variable olines.
10536 (x_set_tool_bar_lines): Remove unused variable root_window.
10537 (Fns_list_colors): Put () around assignment in while statement.
10538 (Fns_perform_service): Remove unused variable len.
10539 (Fns_display_usable_bounds): Remove unused variable top.
10540 (syms_of_nsfns): Remove unused variable i.
10541
10542 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10543 memcpy (Bug#11907).
10544
10545 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
10546
10547 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10548 and free it with DestroyExceptionInfo (Bug#11558).
10549
10550 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
10551
10552 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10553 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10554 Set here, not in nt/config.nt.
10555
10556 2012-07-13 Eli Zaretskii <eliz@gnu.org>
10557
10558 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10559 cursor overflow into the last glyph on display line when the right
10560 fringe is off. (Bug#11832)
10561
10562 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10563
10564 * xdisp.c (produce_special_glyphs): Now static.
10565 * dispextern.h (produce_special_glyphs): Remove decl.
10566
10567 2012-07-13 Glenn Morris <rgm@gnu.org>
10568
10569 * s/bsd-common.h, s/cygwin.h: Remove empty files.
10570 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10571
10572 * s/usg5-4-common.h (USG, USG5):
10573 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10574 * s/sol2-6.h (SOLARIS2):
10575 * s/irix6-5.h (IRIX6_5):
10576 * s/hpux10-20.h (USG, USG5, HPUX):
10577 * s/gnu-linux.h (USG, GNU_LINUX):
10578 * s/freebsd.h (BSD_SYSTEM):
10579 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10580 * s/cygwin.h (CYGWIN):
10581 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10582 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10583
10584 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
10585
10586 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
10587
10588 2012-07-13 Glenn Morris <rgm@gnu.org>
10589
10590 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10591
10592 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10593
10594 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10595 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10596
10597 2012-07-12 Glenn Morris <rgm@gnu.org>
10598
10599 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
10600
10601 * process.c (init_process_emacs): Rename from init_process.
10602 The old name is also the name of a Mach system call.
10603 * lisp.h, emacs.c: Update for this name change.
10604 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10605 longer needed.
10606
10607 2012-07-12 Eli Zaretskii <eliz@gnu.org>
10608
10609 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10610 memmove call that removes glyphs covered by the left truncation
10611 glyph. Improve commentary.
10612 (display_line): Fix display of continuation glyphs on GUI frames
10613 when the right fringe is turned off and variable-size fonts are
10614 used in the window. Move the code that appends a stretch glyph to
10615 produce_special_glyphs, so that it could be used for truncation
10616 and continuation glyphs alike.
10617 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10618 glyph of a suitably computed width, to align the special glyphs at
10619 the window margin. Code moved from display_line. (Bug#11832)
10620
10621 2012-07-12 Glenn Morris <rgm@gnu.org>
10622
10623 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10624
10625 * s/gnu-linux.h, s/hpux10-20.h:
10626 Do not unconditionally define HAVE_XRMSETDATABASE.
10627
10628 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10629
10630 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10631
10632 Fix typos that broke OS X build.
10633 Reported by Randal L. Schwartz in
10634 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10635 * nsterm.m (ns_timeout): Add missing local decl.
10636 (ns_get_color): snprintf -> sprintf, to fix typo.
10637
10638 2012-07-12 Glenn Morris <rgm@gnu.org>
10639
10640 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10641 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10642 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10643 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10644
10645 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10646 Move PTY_OPEN to configure.
10647
10648 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10649 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10650 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10651
10652 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10653
10654 Use empty_unibyte_string where applicable.
10655 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10656 * lread.c (read1): Likewise.
10657 * xsettings.c (syms_of_xsettings): Likewise.
10658
10659 2012-07-12 Glenn Morris <rgm@gnu.org>
10660
10661 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10662 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
10663 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10664 * s/hpux10-20.h (RUN_TIME_REMAP):
10665 * s/bsd-common.h (TABDLY): Move to configure.
10666
10667 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10668
10669 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10670
10671 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
10672 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
10673
10674 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
10675
10676 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10677 * s/template.h: Move NARROWPROTO to configure.
10678
10679 2012-07-11 Glenn Morris <rgm@gnu.org>
10680
10681 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10682 unused since 2011-01-17 change to systty.h.
10683
10684 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10685 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10686 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10687
10688 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10689
10690 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10691
10692 2012-07-11 Glenn Morris <rgm@gnu.org>
10693
10694 * s/darwin.h, s/gnu-linux.h, s/template.h:
10695 Move INTERRUPT_INPUT to configure.
10696
10697 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10698
10699 Minor adjustments to interning code.
10700 * lisp.h (intern, intern_c_string): Redefine as static inline
10701 wrappers for intern_1 and intern_c_string_1, respectively.
10702 (intern_1, intern_c_string_1): Rename prototypes.
10703 * lread.c (intern_1, intern_c_string_1, oblookup):
10704 Simplify Vobarray checking.
10705 * font.c (font_intern_prop): Likewise. Adjust comment.
10706 * w32font.c (intern_font_name): Likewise.
10707
10708 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10709
10710 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10711
10712 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10713 of Fcar/Fcdr if possible.
10714 * font.c (check_otf_features): Likewise.
10715 * fontset.c (Fnew_fontset): Likewise.
10716 * gnutls.c (Fgnutls_boot): Likewise.
10717 * minibuf.c (read_minibuf): Likewise.
10718 * msdos.c (IT_set_frame_parameters): Likewise.
10719 * xmenu.c (Fx_popup_dialog): Likewise.
10720 * w32menu.c (Fx_popup_dialog): Likewise.
10721
10722 2012-07-11 Glenn Morris <rgm@gnu.org>
10723
10724 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10725 since nothing has defined it on these platforms.
10726
10727 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10728 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10729
10730 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10731 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10732 Move CLASH_DETECTION to configure.
10733
10734 * s/gnu.h: Remove file, which is now empty.
10735
10736 * s/gnu.h, s/gnu-linux.h:
10737 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10738
10739 2012-07-11 John Wiegley <johnw@newartisans.com>
10740
10741 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10742 function attribute, so we only use it if it exists in the
10743 compiler.
10744
10745 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10746
10747 Avoid call to strlen in fast_c_string_match_ignore_case.
10748 * search.c (fast_c_string_match_ignore_case): Change to use
10749 length argument. Adjust users accordingly.
10750 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10751
10752 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10753
10754 Assume mkdir, rmdir.
10755 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10756 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10757
10758 Assume rename.
10759 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10760
10761 Assume perror.
10762 * s/hpux10-20.h (HAVE_PERROR): Remove.
10763 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10764 Remove dummy definition, as this problem was obsolete long ago.
10765
10766 Assume strerror.
10767 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10768
10769 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10770
10771 Avoid calls to strlen in font processing functions.
10772 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
10773 (font_open_by_name): Change to use length argument.
10774 Adjust users accordingly.
10775 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10776 Adjust prototypes.
10777 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10778 Change to return ptrdiff_t.
10779 (xfont_list_pattern, xfont_match): Use length returned by
10780 xfont_decode_coding_xlfd.
10781 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10782
10783 2012-07-11 Glenn Morris <rgm@gnu.org>
10784
10785 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10786 Move DONT_REOPEN_PTY to configure.
10787
10788 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10789 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10790
10791 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10792
10793 Remove "#define unix" that is no longer needed (Bug#11905).
10794 * s/aix4-2.h (unix): Remove; no longer needed.
10795
10796 EMACS_TIME simplification (Bug#11875).
10797 This replaces macros (which typically do not work in GDB)
10798 with functions, typedefs and enums, making the code easier to debug.
10799 The functional style also makes code easier to read and maintain.
10800 * systime.h: Include <sys/time.h> on all hosts, not just if
10801 WINDOWSNT, since 'struct timeval' is needed in general.
10802 (EMACS_TIME): Now a typedef, not a macro.
10803 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10804 not macros.
10805 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10806 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10807 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10808 (EMACS_TIME_LE): Now functions, not macros.
10809 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10810 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10811 which are not functions. All uses rewritten to use:
10812 (make_emacs_time): New function.
10813 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10814 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10815 not functions. All uses rewritten to use the following, respectively:
10816 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10817 (add_emacs_time, sub_emacs_time): New functions.
10818 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
10819 * fileio.c (Fcopy_file):
10820 * xterm.c (XTflash): Get the current time closer to when it's used.
10821 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10822
10823 * bytecode.c (targets): Suppress -Woverride-init warnings.
10824
10825 Simplify by avoiding confusing use of strncpy etc.
10826 * doc.c (Fsnarf_documentation):
10827 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10828 * frame.c (Fmake_terminal_frame):
10829 * gtkutil.c (get_utf8_string):
10830 * lread.c (openp):
10831 * nsmenu.m (ns_update_menubar):
10832 * regex.c (regerror):
10833 Prefer memcpy to strncpy and strncat when either will do.
10834 * fileio.c (Fsubstitute_in_file_name):
10835 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10836 (menu_separator_name_p):
10837 * nsmenu.m (ns_update_menubar):
10838 Prefer memcmp to strncmp when either will do.
10839 * nsterm.m: Include <ftoastr.h>.
10840 (ns_get_color):
10841 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10842 Prefer snprintf to strncpy.
10843 * nsterm.m (ns_term_init):
10844 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10845 * nsterm.m (ns_term_init):
10846 Avoid the need for strncpy, by using build_string or
10847 make_unibyte_string directly. Use dtoastr, not snprintf.
10848 * process.c (Fmake_network_process): Diagnose service names that
10849 are too long, rather than silently truncating them or creating
10850 non-null-terminated names.
10851 (Fnetwork_interface_info): Likewise, for interface names.
10852 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10853 Prefer sprintf to strncat.
10854 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10855 Prefer vsnprintf to vsprintf + strncpy.
10856
10857 2012-07-10 Glenn Morris <rgm@gnu.org>
10858
10859 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10860 Clarify fallback case.
10861
10862 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10863
10864 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10865 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10866 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
10867 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
10868 where argument type is known to be a Lisp_Cons.
10869
10870 2012-07-10 Tom Tromey <tromey@redhat.com>
10871
10872 * bytecode.c (BYTE_CODE_THREADED): New macro.
10873 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10874 (enum byte_code_op): New type.
10875 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10876 (exec_byte_code): Use them. Use token threading when applicable.
10877
10878 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10879
10880 Optimize pure C strings initialization.
10881 * lisp.h (make_pure_string): Fix prototype.
10882 (build_pure_c_string): New function, defined as static inline. This
10883 provides a better opportunity to optimize away calls to strlen when
10884 the function is called with compile-time constant argument.
10885 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10886 argument, adjust users accordingly. Use build_pure_c_string where
10887 appropriate.
10888 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10889 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10890 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10891
10892 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10893
10894 Avoid calls to strlen in miscellaneous functions.
10895 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10896 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10897 * lread.c (openp): Likewise.
10898
10899 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10900
10901 Avoid calls to strlen in path processing functions.
10902 * fileio.c (file_name_as_directory): Add comment. Change to add
10903 srclen argument and return the length of result. Adjust users
10904 accordingly.
10905 (directory_file_name): Fix comment. Change to add srclen argument,
10906 swap 1st and 2nd arguments to obey the common convention.
10907 Adjust users accordingly.
10908 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10909
10910 2012-07-10 Glenn Morris <rgm@gnu.org>
10911
10912 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10913 Move PENDING_OUTPUT_COUNT definition to configure.
10914
10915 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10916 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10917 * s/gnu.h (DATA_START): Move definitions to configure.
10918
10919 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10920 We include usg5-4-common.h, which defines them both.
10921
10922 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10923 O_RDONLY already includes it).
10924
10925 Stop ns builds setting the EMACSLOADPATH environment variable.
10926 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10927 Now it does not set EMACSLOADPATH, just returns the load-path string.
10928 * nsterm.h: Update accordingly.
10929 * lread.c [HAVE_NS]: Include nsterm.h.
10930 (init_lread) [HAVE_NS]: Use ns_load_path.
10931 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10932
10933 2012-07-09 Glenn Morris <rgm@gnu.org>
10934
10935 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10936 since the included bsd-common.h does so.
10937
10938 Stop ns builds setting the EMACSPATH environment variable.
10939 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10940 (ns_init_paths): Do not set EMACSPATH.
10941 * nsterm.h (ns_exec_path): Add it.
10942 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10943 Use ns_exec_path.
10944
10945 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10946
10947 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10948
10949 * process.c (wait_reading_process_output): 'waitchannels' was unset
10950 when read_kbd || !NILP (wait_for_cell); fix this.
10951
10952 Add GCC-style 'const' attribute to functions that can use it.
10953 * character.h (char_resolve_modifier_mask):
10954 * keyboard.h (make_ctrl_char):
10955 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10956 (init_character_once, next_almost_prime, init_fns, init_image)
10957 (flush_pending_output, init_sound):
10958 * mem-limits.h (start_of_data):
10959 * menu.h (finish_menu_items):
10960 Add ATTRIBUTE_CONST.
10961 * emacs.c (DEFINE_DUMMY_FUNCTION):
10962 Declare the dummy function with ATTRIBUTE_CONST.
10963 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10964 Add decls with ATTRIBUTE_CONST.
10965
10966 Minor improvements to make_formatted_string.
10967 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10968 where int is good enough, as vsprintf returns an int.
10969 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10970
10971 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10972
10973 Use make_formatted_string to avoid double length calculation.
10974 * lisp.h (make_formatted_string): New prototype.
10975 * alloc.c (make_formatted_string): New function.
10976 * buffer.c (Fgenerate_new_buffer_name): Use it.
10977 * dbusbind.c (syms_of_dbusbind): Likewise.
10978 * editfns.c (Fcurrent_time_zone): Likewise.
10979 * filelock.c (get_boot_time): Likewise.
10980 * frame.c (make_terminal_frame, set_term_frame_name)
10981 (x_report_frame_params): Likewise.
10982 * image.c (gs_load): Likewise.
10983 * minibuf.c (get_minibuffer): Likewise.
10984 * msdos.c (dos_set_window_size): Likewise.
10985 * process.c (make_process): Likewise.
10986 * xdisp.c (ensure_echo_area_buffers): Likewise.
10987 * xsettings.c (apply_xft_settings): Likewise.
10988
10989 2012-07-09 Glenn Morris <rgm@gnu.org>
10990
10991 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10992 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10993 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10994 * nsterm.h (ns_etc_directory): Add it.
10995 * callproc.c [HAVE_NS]: Include nsterm.h.
10996 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10997
10998 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10999
11000 Move marker debugging code under MARKER_DEBUG.
11001 * marker.c (MARKER_DEBUG): Move marker debugging code under
11002 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
11003 for bootstrap with --enable-checking (~3x slowdown reported
11004 by Juanma Barranquero <lekktu@gmail.com>).
11005 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
11006
11007 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
11008
11009 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
11010 See <http://bugs.gnu.org/11825#29>.
11011
11012 2012-07-08 Eli Zaretskii <eliz@gnu.org>
11013
11014 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
11015 has no font, use the frame's font. (Bug#11813)
11016 (display_line): Add commentary about displaying truncation glyphs
11017 on GUI frames.
11018 (produce_special_glyphs): Move here from term.c.
11019
11020 * term.c (produce_special_glyphs): Move to xdisp.c.
11021
11022 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
11023 section.
11024
11025 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
11026
11027 * xdisp.c (display_line): Avoid warning about implicit declaration
11028 of FRAME_FONT.
11029
11030 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
11031
11032 * lisp.h: Remove empty conditional.
11033
11034 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11035
11036 * lread.c (load_path_check): Now static.
11037
11038 Fix some minor --with-ns problems found by static checking.
11039 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
11040 (x_set_font) [!HAVE_X_WINDOWS]:
11041 * image.c (xpm_load_image) [HAVE_NS]:
11042 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
11043 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
11044 Remove unused local.
11045 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
11046 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
11047 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
11048 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
11049 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
11050 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
11051 Fix pointer signedness problem.
11052 * xfaces.c (FRAME_X_FONT_TABLE):
11053 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
11054
11055 2012-07-07 Glenn Morris <rgm@gnu.org>
11056
11057 * lread.c (load_path_check): New function, split from init_lread.
11058 (init_lread): Reorganize. Motivation:
11059 If EMACSLOADPATH is set, check/warn about that rather than the
11060 defaults, which we are not going to use. Hence we can remove
11061 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
11062 Don't warn if site-lisp directories are missing.
11063 If not installed, start from a blank load-path, since
11064 PATH_LOADSEARCH refers to the eventual installation directories.
11065
11066 2012-07-07 Eli Zaretskii <eliz@gnu.org>
11067
11068 Support truncation and continuation glyphs on GUI frames, when
11069 fringes are disabled. (Bug#11832)
11070 * xdisp.c (init_iterator): Get dimensions of truncation and
11071 continuation glyphs even if on GUI frames.
11072 Adjust it->last_visible_x on GUI frames when the left or right fringes,
11073 or both, are absent.
11074 (start_display, move_it_in_display_line_to): Handle the case of a
11075 GUI frame without a fringe to display continuation or truncation
11076 glyphs.
11077 (insert_left_trunc_glyphs): Support GUI frames: make sure
11078 truncation glyphs overwrite enough glyphs from the current line to
11079 have sufficient space in pixels.
11080 (display_line): Support truncation and continuation glyphs on GUI
11081 frames. If some spare pixels are left on the line after inserting
11082 the truncation glyphs, fill that space with a stretch glyph of a
11083 suitably computed width.
11084
11085 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
11086 produce_glyphs, to support GUI sessions.
11087
11088 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
11089
11090 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
11091
11092 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
11093
11094 Do not require float-time's arg to fit in time_t (Bug#11825).
11095 This works better on hosts where time_t is unsigned, and where
11096 float-time is applied to the (negative) difference between two times.
11097 * editfns.c (decode_time_components): Last arg is now double *,
11098 not int *, and means to store all the result as a double, without
11099 worrying about whether the seconds part fits in time_t.
11100 All callers changed.
11101 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
11102 All callers changed.
11103 (Ffloat_time): Do not fail merely because the specified time falls
11104 outside of time_t range.
11105
11106 2012-07-07 Glenn Morris <rgm@gnu.org>
11107
11108 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
11109 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
11110 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
11111
11112 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
11113
11114 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
11115 Update dependencies.
11116
11117 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
11118
11119 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11120
11121 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
11122 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
11123 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
11124 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
11125 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
11126 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
11127
11128 * xfont.c (compare_font_names): Redo to omit the need for casts.
11129
11130 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
11131
11132 * xfns.c (Fx_change_window_property): Doc fix.
11133 * w32fns.c (Fx_change_window_property): Doc fix.
11134
11135 * w32fns.c (Fx_window_property): Accept the same arguments as the
11136 X Windows version. Doc fix.
11137 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
11138
11139 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
11140 Eli Zaretskii <eliz@gnu.org>
11141
11142 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
11143 Windows-specific code from nt/config.nt moved here.
11144 Obsolete settings removed.
11145
11146 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11147
11148 * process.c: Avoid unnecessary calls to gettime.
11149 (wait_reading_process_output): Don't get the time of day
11150 when gobbling data immediately and not waiting, as there's no need
11151 for it in that case. This removes a FIXME.
11152
11153 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11154
11155 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11156 is defined (Bug#11768).
11157
11158 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11159
11160 Fix marker debugging code.
11161 * marker.c (byte_char_debug_check): Do not perform the check
11162 if buffer is not multibyte.
11163 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11164 Call byte_char_debug_check with correct arguments.
11165
11166 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11167
11168 Compile marker debugging code only if ENABLE_CHECKING is defined.
11169 * marker.c (byte_char_debug_check, count_markers):
11170 Use only if ENABLE_CHECKING is defined.
11171 (byte_debug_flag): Remove.
11172 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11173 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11174
11175 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11176
11177 Avoid code repetition in marker-related functions.
11178 * marker.c (attach_marker): New function.
11179 (Fset_marker, set_marker_restricted, set_marker_both)
11180 (set_marker_restricted_both): Use it.
11181 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11182 Consistently rename charno to charpos.
11183 (marker_position): Add eassert.
11184 (marker_byte_position): Convert to eassert.
11185
11186 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11187
11188 Simplify list operations in unchain_overlay and unchain_marker.
11189 * buffer.c (unchain_overlay): Simplify. Add comment.
11190 * marker.c (unchain_marker): Simplify. Fix comments.
11191
11192 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11193
11194 Introduce fast path for the widely used marker operation.
11195 * alloc.c (build_marker): New function.
11196 * lisp.h (build_marker): New prototype.
11197 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11198 * composite.c (autocmp_chars): Likewise.
11199 * editfns.c (buildmark): Remove.
11200 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11201 (save_restriction_save): Use build_marker.
11202 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11203 * window.c (save_window_save): Likewise.
11204
11205 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11206
11207 Do not use Fdelete_overlay in delete_all_overlays
11208 to avoid redundant calls to unchain_overlay.
11209 * buffer.c (drop_overlay): New function.
11210 (delete_all_overlays, Fdelete_overlay): Use it.
11211 * minibuf.c (get_minibuffer): Fix comment.
11212
11213 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11214
11215 Port to OpenBSD 5.1 amd64.
11216 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11217 This is needed for OpenBSD, and should be harmless on all BSD systems.
11218 Also, include <sys/sysctl.h>, as it should be available on all
11219 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11220 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11221 use p_pid member, not kp_proc.pid.
11222
11223 2012-07-06 Glenn Morris <rgm@gnu.org>
11224
11225 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11226
11227 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11228
11229 More xmalloc and related cleanup.
11230 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11231 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11232 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11233 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11234 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11235 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11236 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11237 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11238 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11239 * xterm.c:
11240 Omit needless casts involving void * pointers and allocation.
11241 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11242 as the former is more robust if P's type is changed.
11243 Prefer xzalloc to xmalloc + memset 0.
11244 Simplify malloc-or-realloc to realloc.
11245 Don't worry about xmalloc returning a null pointer.
11246 Prefer xstrdup to xmalloc + strcpy.
11247 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11248 growing it.
11249 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11250 alloca of a constant.
11251
11252 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11253
11254 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11255 hscroll is larger than the line width. Fixes long and futile
11256 looping inside extend_face_to_end_of_line (on a TTY) producing
11257 glyphs that are not needed and thrown away.
11258
11259 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11260
11261 * marker.c (set_marker_restricted_both): Simplify by using
11262 clip_to_bounds.
11263
11264 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11265
11266 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11267
11268 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11269
11270 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11271 not defined (Bug#11768).
11272 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11273 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11274 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11275 followed by gtk_box_set_homogeneous (Bug#11768).
11276 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
11277 (update_theme_scrollbar_width, xg_create_scroll_bar):
11278 Use gtk_scrollbar_new (Bug#11768).
11279 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11280 (is_box_type): New function (Bug#11768).
11281 (xg_tool_item_stale_p): Call is_box_type.
11282 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
11283 with default display (Bug#11768).
11284
11285 2012-07-05 Eli Zaretskii <eliz@gnu.org>
11286
11287 * xdisp.c (window_hscroll_limited): New function.
11288 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11289 coordinates when window's hscroll is set to insanely large
11290 values. (Bug#11857)
11291
11292 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
11293
11294 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11295 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11296
11297 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11298
11299 Cleanup xmalloc.
11300 * lisp.h (xzalloc): New prototype. Omit needless casts.
11301 * alloc.c (xzalloc): New function. Omit needless casts.
11302 * charset.c: Omit needless casts. Convert all calls to
11303 xmalloc with following memset to xzalloc.
11304 * dispnew.c: Likewise.
11305 * fringe.c: Likewise.
11306 * image.c: Likewise.
11307 * sound.c: Likewise.
11308 * term.c: Likewise.
11309 * w32fns.c: Likewise.
11310 * w32font.c: Likewise.
11311 * w32term.c: Likewise.
11312 * xfaces.c: Likewise.
11313 * xfns.c: Likewise.
11314 * xterm.c: Likewise.
11315 * atimer.c: Omit needless casts.
11316 * buffer.c: Likewise.
11317 * callproc.c: Likewise.
11318 * ccl.c: Likewise.
11319 * coding.c: Likewise.
11320 * composite.c: Likewise.
11321 * doc.c: Likewise.
11322 * doprnt.c: Likewise.
11323 * editfns.c: Likewise.
11324 * emacs.c: Likewise.
11325 * eval.c: Likewise.
11326 * filelock.c: Likewise.
11327 * fns.c: Likewise.
11328 * gtkutil.c: Likewise.
11329 * keyboard.c: Likewise.
11330 * lisp.h: Likewise.
11331 * lread.c: Likewise.
11332 * minibuf.c: Likewise.
11333 * msdos.c: Likewise.
11334 * print.c: Likewise.
11335 * process.c: Likewise.
11336 * region-cache.c: Likewise.
11337 * search.c: Likewise.
11338 * sysdep.c: Likewise.
11339 * termcap.c: Likewise.
11340 * terminal.c: Likewise.
11341 * tparam.c: Likewise.
11342 * w16select.c: Likewise.
11343 * w32.c: Likewise.
11344 * w32reg.c: Likewise.
11345 * w32select.c: Likewise.
11346 * w32uniscribe.c: Likewise.
11347 * widget.c: Likewise.
11348 * xdisp.c: Likewise.
11349 * xmenu.c: Likewise.
11350 * xrdb.c: Likewise.
11351 * xselect.c: Likewise.
11352
11353 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11354
11355 * fileio.c (time_error_value): Check the right error number.
11356 Problem reported by Troels Nielsen in
11357 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11358
11359 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11360
11361 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11362 This should be fixed in a better way; see Eli Zaretskii in
11363 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11364 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11365
11366 * fileio.c (time_error_value): Rename from special_mtime.
11367 The old name's problems were noted by Eli Zaretskii in
11368 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11369
11370 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11371 This variable's comment says Emacs needs at least one GDB-visible
11372 symbol of type enum pvec_type, to work around GDB problems.
11373 The symbol's value doesn't matter.
11374
11375 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11376 that causes compilation to fail on pre-C99 compilers.
11377
11378 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
11379
11380 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11381 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11382
11383 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11384
11385 * buffer.c (init_buffer_once): Fix initialization of
11386 headers for buffer_defaults and buffer_local_symbols.
11387 Reported by Juanma Barranquero <lekktu@gmail.com>.
11388
11389 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11390
11391 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11392 * lisp.h (enum pvec_type): Use fewer bits.
11393 (PSEUDOVECTOR_SIZE_BITS): New constant.
11394 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11395 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11396 change in pvec_type.
11397 (PSEUDOVECTOR_TYPEP): New macro.
11398 (TYPED_PSEUDOVECTORP): Use it.
11399 * fns.c (internal_equal): Adapt code to extract pvectype.
11400 * emacs.c (gdb_pvec_type): Update type.
11401 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11402 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11403 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11404 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11405 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11406 abusing vector->header.next.nbytes.
11407 (live_vector_p): Use PVEC_TYPE.
11408 (mark_object): Adapt code to extract pvectype. Use switch.
11409
11410 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11411
11412 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11413 Tighten new eassert a bit.
11414
11415 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11416
11417 Fix compilation with --enable-gcc-warnings and -O1
11418 optimization level.
11419 * doprnt.c (doprnt): Change type of tem to int, initialize
11420 to avoid compiler warning. Add eassert.
11421 * search.c (simple_search): Initialize match_byte to avoid
11422 compiler warning. Add eassert.
11423
11424 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11425
11426 Avoid weird behavior with large horizontal scrolls.
11427 Without this change, for example, large hscroll values would
11428 mess up Emacs's display on Fedora 15 x86, presumably due to
11429 overflows in int calculations in the display code.
11430 Also, if buffers had long lines, Emacs would freeze.
11431 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11432 (set_window_hscroll): New function, containing the old guts of
11433 Fset_window_hscroll. Return the clipped value.
11434 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11435 This avoids the need to check against PTRDIFF_MAX.
11436
11437 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11438
11439 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11440
11441 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11442
11443 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11444
11445 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11446 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11447 since GCC 4.4.6 issues a bogus warning for them.
11448
11449 Fix bugs in file timestamp newness comparisons.
11450 * fileio.c (Ffile_newer_than_file_p):
11451 * lread.c (Fload): Use full timestamp resolution of files,
11452 not just the 1-second resolution, so that files that are only
11453 slightly newer still count as newer.
11454 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11455 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11456
11457 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11458
11459 * fileio.c: Improve handling of file time marker. (Bug#11852)
11460 (special_mtime): New function.
11461 (Finsert_file_contents, Fverify_visited_file_modtime):
11462 Use it to set special mtime values consistently.
11463
11464 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11465
11466 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11467 marker for non-existing file. (Bug#11852)
11468
11469 2012-07-03 Glenn Morris <rgm@gnu.org>
11470
11471 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11472 and did not make it into globals.h).
11473
11474 2012-07-03 Tom Tromey <tromey@redhat.com>
11475
11476 * window.c (Fset_window_margins, Fset_window_fringes)
11477 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11478 * textprop.c (Fprevious_property_change): No longer static.
11479 * syntax.c (Fsyntax_table_p): No longer static.
11480 * process.c (Fget_process, Fprocess_datagram_address): No longer
11481 static.
11482 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11483 * keyboard.c (Fcommand_execute): No longer static.
11484 Remove EXFUN.
11485 * insdel.c (Fcombine_after_change_execute): No longer static.
11486 * image.c (Finit_image_library): No longer static.
11487 * fileio.c (Fmake_symbolic_link): No longer static.
11488 * eval.c (Ffetch_bytecode): No longer static.
11489 * editfns.c (Fuser_full_name): No longer static.
11490 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11491 No longer static.
11492 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11493 static.
11494 * dired.c (Ffile_attributes): No longer static.
11495 * composite.c (Fcomposition_get_gstring): No longer static.
11496 * callproc.c (Fgetenv_internal): No longer static.
11497
11498 * ccl.h: Remove EXFUNs.
11499 * buffer.h: Remove EXFUNs.
11500 * dispextern.h: Remove EXFUNs.
11501 * intervals.h: Remove EXFUNs.
11502 * fontset.h: Remove EXFUN.
11503 * font.h: Remove EXFUNs.
11504 * dosfns.c (system_process_attributes): Remove EXFUN.
11505 * keymap.h: Remove EXFUNs.
11506 * lisp.h: Remove EXFUNs.
11507 * w32term.h: Remove EXFUNs.
11508 * window.h: Remove EXFUNs.
11509 * xsettings.h: Remove EXFUN.
11510 * xterm.h: Remove EXFUN.
11511
11512 2012-07-03 Glenn Morris <rgm@gnu.org>
11513
11514 * lisp.h (Frandom): Make it visible to C.
11515 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11516 buffer for invisible buffers. (Bug#1229)
11517
11518 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11519
11520 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11521 values which aren't power of 2.
11522 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
11523 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
11524 accordingly.
11525
11526 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11527
11528 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11529
11530 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11531
11532 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11533
11534 * alloc.c (allocate_vector_block): Remove redundant
11535 calls to mallopt if DOUG_LEA_MALLOC is defined.
11536 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11537 avoid calls to mallopt if zero_vector is returned.
11538
11539 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11540
11541 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11542 is enabled, avoid dereferencing NULL current_sblock if
11543 running undumped.
11544
11545 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11546
11547 Cleanup basic buffer management.
11548 * buffer.h (struct buffer): Change layout to use generic vector
11549 marking code. Fix some comments. Change type of 'clip_changed'
11550 to bitfield. Remove unused #ifndef old.
11551 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11552 (GET_OVERLAYS_AT): Fix indentation.
11553 (for_each_per_buffer_object_at): New macro.
11554 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11555 (Fbuffer_local_variables): Use it.
11556 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11557 * alloc.c (allocate_buffer): Adjust to match new layout of
11558 struct buffer. Fix comment.
11559 (mark_overlay): New function.
11560 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11561 Lisp area of struct buffer.
11562 (mark_object): Use it. Adjust marking of misc objects
11563 and related comments.
11564
11565 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11566
11567 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11568 wrapper that is not needed because the wrapped code is a no-op (zero
11569 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11570 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11571
11572 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11573
11574 * alloc.c (mark_buffer): Simplify. Remove prototype.
11575 (mark_object): Add comment. Reorganize marking of vector-like
11576 objects. Use CHECK_LIVE for all vector-like objects except buffers
11577 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11578 Avoid redundant calls to mark_vectorlike for bool vectors.
11579
11580 2012-06-30 Glenn Morris <rgm@gnu.org>
11581
11582 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11583
11584 * epaths.in (PATH_SITELOADSEARCH): New.
11585 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11586 This is rather than relying on --enable-locallisppath elements
11587 having "site-lisp" in their names. (Bug#10208#25, 11658)
11588
11589 2012-06-30 Eli Zaretskii <eliz@gnu.org>
11590
11591 * w32proc.c (sys_select): Accept and ignore one more argument.
11592
11593 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11594
11595 * sysselect.h [DOS_NT]: Don't include sys/select.h.
11596 (pselect) [!MS_DOS]: Redirect to sys_select.
11597
11598 * sysdep.c: Don't include dos.h and dosfns.h.
11599
11600 * process.c (sys_select):
11601 * msdos.c (sys_select): Accept one more argument and ignore it.
11602
11603 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11604 adapt data types and code to that.
11605
11606 * dosfns.c:
11607 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11608 which clashes with the gnulib function of the same name.
11609
11610 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11611
11612 * font.c (font_style_to_value, font_style_symbolic)
11613 (font_prop_validate_style): Add type checks for values in
11614 font_style_table.
11615
11616 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11617 argument.
11618 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11619 uses.
11620
11621 2012-06-29 Eli Zaretskii <eliz@gnu.org>
11622
11623 * xdisp.c (try_window_id): Undo last change.
11624
11625 * w32.c (getwd): Adjust commentary about startup_dir.
11626 (init_environment): Always call sys_access, even in non-MSVC
11627 builds. Don't chdir to the directory of the Emacs executable.
11628 This undoes code from 1997 which was justified by the need to
11629 "avoid conflicts when removing and renaming directories". But its
11630 downside was that every relative file name was being interpreted
11631 relative to the directory of the Emacs executable, which can never
11632 be TRT. In particular, it broke sys_access when called with
11633 relative file names.
11634 (sys_access): Map GetLastError to errno.
11635
11636 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11637
11638 * window.h (struct window): Change type of 'fringes_outside_margins'
11639 to bitfield. Fix comment. Adjust users accordingly.
11640 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
11641 Adjust comment.
11642 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11643 to ptrdiff_t.
11644
11645 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
11646
11647 * gnutls.c (emacs_gnutls_handshake):
11648 Add QUIT to make the loop interruptible.
11649
11650 2012-06-29 Glenn Morris <rgm@gnu.org>
11651
11652 * charset.c (init_charset): Make lack of etc/charsets fatal.
11653
11654 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11655
11656 * editfns.c (region_limit): Fix type mismatch.
11657
11658 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11659
11660 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11661 undefined. Convert from xassert to eassert.
11662 * nsmenu.m: Convert from xassert to eassert.
11663 * nsterm.m: Likewise.
11664
11665 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11666
11667 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11668
11669 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11670
11671 Avoid integer overflow on scroll-left and scroll-right.
11672 * window.c (HSCROLL_MAX): New macro.
11673 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11674 overflow when requested scroll falls outside ptrdiff_t range.
11675
11676 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11677
11678 * window.h (struct window): Change type of 'hscroll',
11679 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11680 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11681 Adjust users accordingly.
11682 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11683 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11684 from EMACS_INT to ptrdiff_t.
11685 (make_window): Omit redundant initialization.
11686
11687 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
11688
11689 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11690
11691 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11692
11693 * window.h (struct window): Change type of 'use_time' and
11694 'sequence_number' from Lisp_Object to int.
11695 * frame.c (make_frame): Adjust users accordingly.
11696 * print.c (print_object): Likewise.
11697 * window.c (select_window, Fwindow_use_time, make_parent_window)
11698 (make_window): Likewise.
11699
11700 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11701
11702 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11703 enabled with --enable-checking=[all,glyphs] configure option.
11704 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11705 adjust comments accordingly.
11706 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11707 undefined, adjust comments accordingly.
11708 * image.c: Likewise.
11709 * scroll.c: Likewise.
11710 * w32fns.c: Likewise.
11711 * w32term.c: Likewise.
11712 * xdisp.c: Likewise.
11713 * xfaces.c: Likewise.
11714 * xfns.c: Likewise.
11715 * xterm.c: Likewise.
11716
11717 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11718
11719 Generalize run-time debugging checks.
11720 * dispextern.h (XASSERTS): Remove.
11721 * fontset.c (xassert): Remove.
11722 Convert from xassert to eassert.
11723 * alloc.c: Convert from xassert to eassert.
11724 * bidi.c: Likewise.
11725 * dispnew.c: Likewise.
11726 * fns.c: Likewise.
11727 * fringe.c: Likewise.
11728 * ftfont.c: Likewise.
11729 * gtkutil.c: Likewise.
11730 * image.c: Likewise.
11731 * keyboard.c: Likewise.
11732 * menu.c: Likewise.
11733 * process.c: Likewise.
11734 * scroll.c: Likewise.
11735 * sound.c: Likewise.
11736 * term.c: Likewise.
11737 * w32console.c: Likewise.
11738 * w32fns.c: Likewise.
11739 * w32term.c: Likewise.
11740 * window.c: Likewise.
11741 * xdisp.c: Likewise.
11742 * xfaces.c: Likewise.
11743 * xfns.c: Likewise.
11744 * xselect.c: Likewise.
11745 * xterm.c: Likewise.
11746
11747 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11748
11749 * fns.c (maybe_resize_hash_table): Output message when growing the
11750 purify-hashtable.
11751
11752 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11753
11754 * alloc.c (allocate_string_data): Remove dead code.
11755 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11756 avoid GCC warning about unused macro.
11757
11758 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11759
11760 * alloc.c (allocate_string): Omit intervals initialization.
11761 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11762 as in make_pure_string and make_pure_c_string.
11763
11764 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11765
11766 * alloc.c (allocate_string): Fix last change.
11767
11768 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11769
11770 * alloc.c (allocate_string): Remove two redundant calls
11771 to memset, add explicit initialization where appropriate.
11772
11773 2012-06-27 Glenn Morris <rgm@gnu.org>
11774
11775 * lisp.mk (lisp): Remove paths.elc.
11776
11777 2012-06-27 Chong Yidong <cyd@gnu.org>
11778
11779 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11780
11781 2012-06-26 John Wiegley <johnw@newartisans.com>
11782
11783 * unexmacosx.c (copy_data_segment): Add two section names used
11784 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11785
11786 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11787 when building with Clang.
11788
11789 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11790
11791 * eval.c (Fapply): Allow calling it with a single argument.
11792
11793 2012-06-26 Eli Zaretskii <eliz@gnu.org>
11794
11795 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11796 _stricmp and _strnicmp.
11797 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11798
11799 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11800
11801 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11802 allocated window.
11803 (allocate_process): Likewise for new process.
11804 (allocate_terminal): Change to use offsetof.
11805 (allocate_frame): Likewise.
11806 * frame.c (make_frame): Omit redundant initialization.
11807 * window.c (make_parent_window): Use memset.
11808 (make_window): Omit redundant initialization.
11809 * process.c (make_process): Omit redundant initialization.
11810 * terminal.c (create_terminal): Likewise.
11811
11812 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11813
11814 * term.c (delete_tty): Remove redundant call to memset.
11815
11816 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11817
11818 * alloc.c: Remove build_string.
11819 * lisp.h: Define build_string as static inline. This provides
11820 a better opportunity to optimize away calls to strlen when the
11821 function is called with compile-time constant argument.
11822 * image.c (imagemagick_error): Convert to build_string.
11823 * w32proc.c (sys_spawnve): Likewise.
11824 * xterm.c (x_term_init): Likewise.
11825
11826 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11827
11828 Use sprintf return value instead of invoking strlen on result.
11829 In the old days this wasn't portable, since some sprintf
11830 implementations returned char *. But they died out years ago and
11831 Emacs already assumes sprintf returns int.
11832 Similarly for float_to_string.
11833 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11834 * ccl.c (ccl_driver):
11835 * character.c (string_escape_byte8):
11836 * data.c (Fnumber_to_string):
11837 * doprnt.c (doprnt):
11838 * print.c (print_object):
11839 * xdisp.c (message_dolog):
11840 * xfns.c (syms_of_xfns):
11841 Use sprintf or float_to_string result to avoid need to call strlen.
11842 * data.c (Fnumber_to_string):
11843 Use make_unibyte_string, since the string must be ASCII.
11844 * lisp.h, print.c (float_to_string): Now returns int length.
11845 * term.c (produce_glyphless_glyph):
11846 Use sprintf result rather than recomputing it.
11847
11848 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11849 * Makefile.in (ALL_CFLAGS):
11850 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11851 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11852
11853 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11854
11855 * dispextern.h (xstrcasecmp): Define to library function
11856 strcasecmp if available.
11857 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11858
11859 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11860
11861 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11862 Avoid comma operator.
11863 * menu.c (push_submenu_start, push_submenu_end)
11864 (push_left_right_boundary, push_menu_pane): Likewise.
11865 * msdos.c (dos_rawgetc): Likewise.
11866
11867 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11868
11869 * xfns.c (xic_create_fontsetname): Remove redundant calls
11870 to memset.
11871
11872 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11873
11874 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11875 sprintf already null-terminates its output.
11876
11877 * xfns.c (x_window): Remove redundant cast.
11878
11879 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11880
11881 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11882 `const char *' to `char *' to avoid compiler warning.
11883
11884 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11885
11886 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11887 instead of truncating it to 63 (admittedly a generous limit).
11888
11889 * process.c: Fix spelling and caps in comments.
11890
11891 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11892
11893 * emacs.c (setpgrp): Remove definition, unused.
11894 * sysdep.c (setpgrp): Remove definition, not used in this file.
11895
11896 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
11897
11898 * makefile.w32-in: Update dependencies.
11899
11900 2012-06-24 Eli Zaretskii <eliz@gnu.org>
11901
11902 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11903 (SYSTIME_H): Add nt/inc/sys/time.h.
11904
11905 * systime.h [WINDOWSNT]: Include sys/time.h.
11906
11907 * s/ms-w32.h (struct timespec): Definition moved from
11908 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11909
11910 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11911
11912 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11913 * buffer.h (buffer_slot_type_mismatch):
11914 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11915 * eval.c (unwind_to_catch):
11916 * image.c (my_png_error, my_error_exit):
11917 * keyboard.c (quit_throw_to_read_char, user_error)
11918 (Fexit_recursive_edit, Fabort_recursive_edit):
11919 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11920 (wrong_type_argument, buffer_overflow, __executable_start)
11921 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11922 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11923 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11924 (fatal):
11925 (child_setup) [!DOS_NT]:
11926 * lread.c (end_of_file_error, invalid_syntax):
11927 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11928 * puresize.h (pure_write_error):
11929 * search.c (matcher_overflow):
11930 * sound.c (sound_perror, alsa_sound_perror):
11931 * sysdep.c, syssignal.h (croak):
11932 * term.c (maybe_fatal, vfatal):
11933 * textprop.c (text_read_only):
11934 * undo.c (user_error):
11935 * unexmacosx.c (unexec_error):
11936 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11937 Use _Noreturn rather than NO_RETURN.
11938 No need for separate decl merely because of _Noreturn.
11939 * sound.c (sound_warning, parse_sound):
11940 Remove unnecessary forward decls.
11941
11942 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11943
11944 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11945 * lisp.h (WAIT_READING_MAX): New macro.
11946 * dispnew.c (Fsleep_for, sit_for):
11947 * keyboard.c (kbd_buffer_get_event):
11948 * process.c (Faccept_process_output):
11949 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11950 This improves on the previous patch, which introduced a bug
11951 when time_t is unsigned and as wide as intmax_t.
11952 See <http://bugs.gnu.org/9000#51>.
11953
11954 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11955
11956 * dispnew.c (sit_for, Fsleep_for):
11957 * keyboard.c (kbd_buffer_get_event):
11958 * process.c (Faccept_process_output): Avoid compiler warnings when
11959 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11960
11961 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
11962
11963 * makefile.w32-in: Update dependencies.
11964
11965 * w32.c (ltime): Add return type and declare static.
11966 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11967
11968 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11969
11970 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11971 Privately reported by Herbert J. Skuhra.
11972 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11973 All uses changed.
11974 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11975 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11976
11977 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11978
11979 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11980 last argument of make_unibyte_string.
11981
11982 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11983 language ID in the event parameters.
11984
11985 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11986 event.code, not the obscure "character set ID".
11987
11988 2012-06-23 Chong Yidong <cyd@gnu.org>
11989
11990 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11991
11992 2012-06-23 Eli Zaretskii <eliz@gnu.org>
11993
11994 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11995 * w32.c (fdutimens): New function.
11996
11997 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11998
11999 * s/ms-w32.h (pselect): Redirect to sys_select.
12000
12001 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
12002
12003 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
12004 in the logic of incrementing and decrementing the value of
12005 use_relocatable_buffers.
12006
12007 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
12008
12009 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
12010 Privately reported by Herbert J. Skuhra.
12011 [__FreeBSD__]: Remove "*/" typo after "#include".
12012 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
12013 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
12014 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
12015 Don't assume EMACS_TIME and struct timeval are the same type.
12016
12017 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
12018
12019 Support higher-resolution time stamps (Bug#9000).
12020 The time stamps are only nanosecond-resolution at the C level,
12021 since that's the best that any real-world system supports now.
12022 But they are picosecond-resolution at the Lisp level, as that's
12023 easy, and leaves room for future OS improvements.
12024
12025 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
12026 (LIBES): Use it.
12027
12028 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
12029 Don't get current time unless it's needed.
12030
12031 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
12032 now provides it if it's absent.
12033 (start_atimer): Port to higher-res time stamps.
12034 Check for time stamp overflow. Don't get current time more
12035 often than is needed.
12036
12037 * buffer.h (struct buffer): Buffer modtime now has high resolution.
12038 Include systime.h, not time.h.
12039 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
12040
12041 * dired.c: Include stat-time.h.
12042 (Ffile-attributes): File times now have higher resolution.
12043
12044 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
12045 (struct image): Timestamp now has higher resolution.
12046
12047 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
12048 has at least microseconds now. All uses removed.
12049 (update_frame, update_single_window, update_window, update_frame_1)
12050 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
12051 (duration_to_sec_usec): Remove; no longer needed.
12052
12053 * editfns.c (time_overflow): Now extern.
12054 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
12055 (float-time, Fformat_time_string, Fcurrent_time_string)
12056 (Fcurrent_time_zone): Accept and generate higher-resolution
12057 time stamps.
12058 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
12059 (decode_time_components, lisp_seconds_argument): New functions.
12060 (make_time): Now static.
12061 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
12062 Report an error if the time is invalid, rather than having the caller
12063 do that.
12064
12065 * fileio.c: Include <stat-time.h>
12066 (Fcopy_file): Copy higher-resolution time stamps.
12067 Prefer to set the time stamp via a file descriptor if that works.
12068 (Fset_file_times, Finsert_file_contents, Fwrite_region)
12069 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
12070 (Fvisited_file_modtime, Fset_visited_file_modtime):
12071 Support higher-resolution time stamps.
12072
12073 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
12074
12075 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
12076
12077 * image.c (prepare_image_for_display, clear_image_cache)
12078 (lookup_image): Port to higer-resolution time stamps.
12079
12080 * keyboard.c (start_polling, bind_polling_period):
12081 Check for time stamp overflow.
12082 (read_char, kbd_buffer_get_event, timer_start_idle)
12083 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
12084 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
12085 Port to higher-resolution time stamps. Do not assume time_t is signed.
12086 (decode_timer): New function. Timers are now vectors of length 9,
12087 not 8, to accommodate the picosecond component.
12088 (timer_check_2): Use it.
12089
12090 * nsterm.m (select_timeout, timeval_subtract): Remove.
12091 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
12092 as they're a bit more accurate and handle overflow better.
12093 (ns_select): Change prototype to be compatible with pselect.
12094 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
12095 * nsterm.h (ns_select): Adjust prototype.
12096
12097 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
12098 us-resolution time stamps.
12099 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
12100
12101 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
12102
12103 * lisp.h (time_overflow): New decl.
12104 (wait_reading_process_output): First arg is now intmax_t, not int,
12105 to accommodate larger waits.
12106
12107 * process.h (struct Lisp_Process.read_output_delay):
12108 Now counts nanoseconds, not microseconds.
12109 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
12110 EMACS_HAS_USECS.
12111 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
12112 (wait_reading_process_output):
12113 Port to ns-resolution time stamps.
12114 (Faccept_process_output, wait_reading_process_output):
12115 Check for time stamp overflow. Do not assume time_t is signed.
12116 (select_wrapper): Remove; we now use pselect.
12117 (Fprocess_attributes): Now generates ns-resolution time stamps.
12118
12119 * sysdep.c: Include utimens.h. Don't include utime.h
12120 or worry about struct utimbuf; gnulib does that for us now.
12121 (gettimeofday): Remove; gnulib provides a substitute.
12122 (make_timeval): New function.
12123 (set_file_times): Now sets ns-resolution time stamps.
12124 New arg FD; all uses changed.
12125 (time_from_jiffies, ltime_from_jiffies, get_up_time)
12126 (system_process_attributes):
12127 Now returns ns-resolution time stamp. All uses changed.
12128 Check for time stamp overflow.
12129
12130 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
12131 provides a substitute now.
12132
12133 * systime.h: Include timespec.h rather than sys/time.h and time.h,
12134 since it guarantees struct timespec.
12135 (EMACS_TIME): Now struct timespec, so that we can support
12136 ns-resolution time stamps.
12137 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
12138 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
12139 (EMACS_USECS): Remove.
12140 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
12141 so multiply the arg by 1000 before storing it.
12142 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
12143 New macros.
12144 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
12145 Port to ns-resolution time stamps.
12146 (EMACS_TIME_NEG_P): Remove; replaced by....
12147 (EMACS_TIME_SIGN): New macro.
12148 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12149 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12150 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12151 (make_timeval, make_lisp_time, decode_time_components): New decls.
12152 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12153 that it mishandled time_t overflow. You can't compare by subtracting!
12154 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12155 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12156
12157 * term.c: Include <sys/time.h>.
12158 (timeval_to_Time): New function, for proper overflow wraparound.
12159 (term_mouse_position, term_mouse_click): Use it.
12160
12161 * undo.c (record_first_change): Support higher-resolution time stamps
12162 in the undo buffer.
12163 (Fprimitive_undo): Use them when restoring time stamps.
12164
12165 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12166 (w32_get_internal_run_time):
12167 Port to higher-resolution Emacs time stamps.
12168 (ltime): Now accepts single 64-bit integer, as that's more convenient
12169 for callers.
12170
12171 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12172
12173 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12174 for compatibility with pselect. Support ns-resolution time stamps.
12175
12176 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12177
12178 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12179 Check for time stamp overflow, and support ns-resolution time stamps.
12180
12181 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12182 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12183 (timeval_subtract): Remove; no longer needed.
12184 (XTflash, XTring_bell, x_wait_for_event):
12185 Port to ns-resolution time stamps. Don't assume time_t is signed.
12186
12187 2012-06-22 Chong Yidong <cyd@gnu.org>
12188
12189 * xdisp.c (x_consider_frame_title): Revert last change.
12190
12191 2012-06-22 Eli Zaretskii <eliz@gnu.org>
12192
12193 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12194 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12195 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12196 staticidx goes up to 1597 out of 1600 = 0x640.)
12197
12198 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12199
12200 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12201 Otherwise, the umask might be mistakenly 0 while handling input signals.
12202
12203 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12204
12205 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12206
12207 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12208
12209 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12210 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12211 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12212 access to `contents' member of Lisp_Vector objects with AREF and ASET
12213 where appropriate.
12214
12215 2012-06-19 Chong Yidong <cyd@gnu.org>
12216
12217 * frame.c (delete_frame): When selecting a frame on a different
12218 text terminal, do not alter the terminal's top-frame.
12219
12220 * xdisp.c (format_mode_line_unwind_data): Record the target
12221 frame's selected window and its terminal's top-frame.
12222 (unwind_format_mode_line): Restore them.
12223 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12224 Callers changed.
12225 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12226 since tty frames can be explicitly named.
12227 (prepare_menu_bars): Likewise.
12228
12229 * term.c (Ftty_top_frame): New function.
12230
12231 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12232
12233 Port byte-code-meter to modern targets.
12234 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12235 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
12236 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
12237 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12238 (METER_1, METER_2): Simplify.
12239
12240 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12241
12242 * data.c (Fdefalias): Return `symbol' (bug#11686).
12243
12244 2012-06-18 Martin Rudalics <rudalics@gmx.at>
12245
12246 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
12247 gets killed during executing of this function (Bug#11665).
12248 Try to always return Qt when the buffer has been actually killed.
12249 (Vkill_buffer_query_functions): In doc-string say that functions
12250 run by this hook should not change the current buffer.
12251
12252 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12253
12254 Fix recently-introduced process.c problems found by static checking.
12255 * process.c (write_queue_push, write_queue_pop, send_process):
12256 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12257 (write_queue_pop): Fix pointer signedness problem.
12258 (send_process): Remove unused local.
12259
12260 2012-06-17 Chong Yidong <cyd@gnu.org>
12261
12262 * xdisp.c (redisplay_internal): No need to redisplay terminal
12263 frames that are not on top.
12264
12265 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
12266
12267 * process.c (make_process): Initialize write_queue.
12268 (write_queue_push, write_queue_pop): New functions.
12269 (send_process): Use them to maintain correct ordering of process
12270 writes (Bug#10815).
12271
12272 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12273
12274 * lisp.h (eassert): Assume C89 or later.
12275 This removes the need for CHECK.
12276 (CHECK): Remove. Its comments about always evaluating its
12277 argument were confusing, as 'eassert' typically does not evaluate
12278 its argument.
12279
12280 * coding.c (produce_chars): Use ptrdiff_t, not int.
12281
12282 * xterm.c (x_draw_underwave): Check for integer overflow.
12283 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12284
12285 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
12286
12287 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12288 referenced (Bug#11583).
12289
12290 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12291
12292 Implement wave-style variant of underlining.
12293 * dispextern.h (face_underline_type): New enum.
12294 (face): Add field for underline type.
12295 * nsterm.m (ns_draw_underwave): New function.
12296 (ns_draw_text_decoration): Use it.
12297 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12298 New functions.
12299 (x_draw_glyph_string): Use them.
12300 * xfaces.c (Qline, Qwave): New Lisp objects.
12301 (check_lface_attrs, merge_face_ref)
12302 (Finternal_set_lisp_face_attribute, realize_x_face):
12303 Handle wave-style underline face attributes.
12304 * xterm.c (x_draw_underwave): New function.
12305 (x_draw_glyph_string): Use it.
12306
12307 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
12308
12309 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12310 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12311 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12312 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12313 ($(BLD)/w32select.$(O)): Update dependencies.
12314
12315 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12316
12317 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12318 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12319 * character.c (_fetch_multibyte_char_p): Remove.
12320 * alloc.c: Include "character.h" before "buffer.h".
12321 * bidi.c: Likewise.
12322 * buffer.c: Likewise.
12323 * bytecode.c: Likewise.
12324 * callint.c: Likewise.
12325 * callproc.c: Likewise.
12326 * casefiddle.c: Likewise.
12327 * casetab.c: Likewise.
12328 * category.c: Likewise.
12329 * cmds.c: Likewise.
12330 * coding.c: Likewise.
12331 * composite.c: Likewise.
12332 * dired.c: Likewise.
12333 * dispnew.c: Likewise.
12334 * doc.c: Likewise.
12335 * dosfns.c: Likewise.
12336 * editfns.c: Likewise.
12337 * emacs.c: Likewise.
12338 * fileio.c: Likewise.
12339 * filelock.c: Likewise.
12340 * font.c: Likewise.
12341 * fontset.c: Likewise.
12342 * fringe.c: Likewise.
12343 * indent.c: Likewise.
12344 * insdel.c: Likewise.
12345 * intervals.c: Likewise.
12346 * keyboard.c: Likewise.
12347 * keymap.c: Likewise.
12348 * lread.c: Likewise.
12349 * macros.c: Likewise.
12350 * marker.c: Likewise.
12351 * minibuf.c: Likewise.
12352 * nsfns.m: Likewise.
12353 * nsmenu.m: Likewise.
12354 * print.c: Likewise.
12355 * process.c: Likewise.
12356 * regex.c: Likewise.
12357 * region-cache.c: Likewise.
12358 * search.c: Likewise.
12359 * syntax.c: Likewise.
12360 * term.c: Likewise.
12361 * textprop.c: Likewise.
12362 * undo.c: Likewise.
12363 * unexsol.c: Likewise.
12364 * w16select.c: Likewise.
12365 * w32fns.c: Likewise.
12366 * w32menu.c: Likewise.
12367 * window.c: Likewise.
12368 * xdisp.c: Likewise.
12369 * xfns.c: Likewise.
12370 * xmenu.c: Likewise.
12371 * xml.c: Likewise.
12372 * xselect.c: Likewise.
12373
12374 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12375
12376 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12377 If all the glyphs of the glyph row came from strings, and we have no
12378 cursor positioning clues, put the cursor on the first glyph of the
12379 row.
12380 (handle_face_prop): Use chunk-relative overlay string index when
12381 indexing into it->string_overlays array. (Bug#11653)
12382 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12383 the rightmost. (Bug#11720)
12384
12385 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12386
12387 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12388 (CATEGORY_MEMBER): Enforce 1/0 value.
12389 * category.c (_temp_category_set): Remove.
12390
12391 2012-06-16 Eli Zaretskii <eliz@gnu.org>
12392
12393 * window.c (Fdelete_other_windows_internal)
12394 (Fdelete_window_internal): Don't access frame's mouse highlight
12395 info of the initial frame. (Bug#11677)
12396
12397 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12398
12399 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12400 Assume USE_2_TAGS_FOR_INTS.
12401 (xreload): Adjust $tagmask width to match recent lisp.h change.
12402
12403 Simplify lisp.h in minor ways that should not affect code.
12404 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12405 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12406 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12407 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12408 (INTTYPEBITS): New macro, for clarity.
12409 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
12410 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12411 Simplify now that USE_LSB_TAG is always defined.
12412 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12413 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12414
12415 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
12416
12417 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12418
12419 2012-06-13 Glenn Morris <rgm@gnu.org>
12420
12421 * s/bsd-common.h (BSD4_3):
12422 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12423
12424 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12425
12426 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12427 instead of union.
12428 (XLI, XIL): Define.
12429 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12430 Use them.
12431 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
12432 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
12433 * alloc.c (widen_to_Lisp_Object): Remove.
12434 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12435 * frame.c (delete_frame): Remove outdated comment.
12436 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12437 USE_LISP_UNION_TYPE.
12438 (Fw32_unregister_hot_key): Likewise.
12439 (Fw32_toggle_lock_key): Likewise.
12440 * w32menu.c (add_menu_item): Likewise.
12441 (w32_menu_display_help): Use XIL instead of checking
12442 USE_LISP_UNION_TYPE.
12443 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12444 (init_heap): Likewise.
12445 * w32term.c (w32_read_socket): Update comment.
12446
12447 2012-06-13 Glenn Morris <rgm@gnu.org>
12448
12449 * s/usg5-4-common.h, src/s/unixware.h:
12450 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12451
12452 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12453
12454 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12455
12456 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12457 * alloc.c (make_number) [!defined make_number]:
12458 Remove, as lisp.h always defines this now.
12459 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12460 (roundup_size): Verify that it is a power of 2.
12461 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12462 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12463 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12464 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12465 USE_LSB_TAG now is always defined to be either 0 or 1.
12466 All uses changed.
12467 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12468 code works fine either way, and efficiency is not a concern here,
12469 as the union type is for debugging, not for production.
12470 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12471 Use an inline function on all platforms when using the union type,
12472 since this is simpler and 'static inline' can be used portably
12473 within Emacs now.
12474 (LISP_INITIALLY_ZERO): New macro.
12475 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12476 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12477
12478 2012-06-12 Glenn Morris <rgm@gnu.org>
12479
12480 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12481
12482 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
12483
12484 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12485 Move BROKEN_SIGIO to configure.
12486
12487 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12488 Move NO_TERMIO to configure.
12489
12490 2012-06-12 Chong Yidong <cyd@gnu.org>
12491
12492 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12493 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12494 MagickExportImagePixels is undefined.
12495
12496 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12497
12498 * image.c (imagemagick_load_image): Remove unused label.
12499
12500 2012-06-11 Glenn Morris <rgm@gnu.org>
12501
12502 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12503 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12504 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12505 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12506
12507 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12508
12509 * alloc.c (make_byte_code): New function.
12510 (Fmake_byte_code): Use it. Don't purify here.
12511 * lread.c (read1): Use it as well to avoid extra allocation.
12512
12513 2012-06-11 Chong Yidong <cyd@gnu.org>
12514
12515 * image.c (imagemagick_load_image): Implement transparency.
12516
12517 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12518
12519 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12520 account for preceding backslashes. (Bug#11663)
12521
12522 2012-06-09 Chong Yidong <cyd@gnu.org>
12523
12524 * term.c: Support italics in capable terminals (Bug#9652).
12525 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12526 (turn_on_face): Output using TS_enter_italic_mode if available.
12527 Don't handle unused blinking and alt-charset cases.
12528 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12529 and tty_alt_charset_p cases.
12530 (tty_capable_p, init_tty): Support italics.
12531
12532 * termchar.h (struct tty_display_info): Add field for italics.
12533 Remove unused blink field.
12534
12535 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12536 Handle slant.
12537
12538 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12539 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12540 tty_alt_charset_p. Add tty_italic_p.
12541
12542 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
12543
12544 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12545 dbus_type_is_basic if available.
12546 (xd_extract_signed, xd_extract_unsigned): Rename from
12547 extract_signed and extract_unsigned, respectively. Adapt callers.
12548
12549 2012-06-09 Chong Yidong <cyd@gnu.org>
12550
12551 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12552
12553 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12554 case (Bug#9752).
12555
12556 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12557
12558 * xdisp.c (vmessage): Treat frame message as multibyte.
12559 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12560 would generate the diagnostic "Making \302\247 buffer-local while
12561 let-bound!".
12562
12563 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12564
12565 * dispnew.c (showing_window_margins_p): Undo last change, which
12566 was done due to an inadvertent commit.
12567 (adjust_frame_glyphs_for_frame_redisplay): Do call
12568 showing_window_margins_p.
12569
12570 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12571
12572 * eval.c (Fmake_var_non_special): New primitive.
12573 (syms_of_eval): Defsubr it.
12574 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12575
12576 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
12577
12578 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12579 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12580
12581 2012-06-08 Eli Zaretskii <eliz@gnu.org>
12582
12583 * alloc.c (allocate_vectorlike): Fix last change.
12584
12585 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12586
12587 Block-based vector allocation of small vectors.
12588 * lisp.h (struct vectorlike_header): New field `nbytes',
12589 adjust comment accordingly.
12590 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
12591 to denote vector blocks. Adjust users (live_vector_p,
12592 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12593 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
12594 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12595 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12596 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
12597 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12598 (roundup_size): New constant.
12599 (struct vector_block): New data type.
12600 (vector_blocks, vector_free_lists, zero_vector): New variables.
12601 (all_vectors): Rename to `large_vectors'.
12602 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12603 (sweep_vectors): New functions.
12604 (allocate_vectorlike): Return `zero_vector' as the only vector of
12605 0 items. Allocate new vector from block if vector size is less than
12606 or equal to VBLOCK_BYTES_MAX.
12607 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12608 (init_alloc_once): Add call to init_vectors.
12609
12610 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12611
12612 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12613
12614 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12615
12616 * doprnt.c (doprnt): Truncate multibyte char correctly.
12617 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12618 would mishandle a string argument "Xc" if X was a multibyte
12619 character of length 2: it would truncate after X's first byte
12620 rather than including all of X.
12621
12622 2012-06-06 Chong Yidong <cyd@gnu.org>
12623
12624 * buffer.c (word_wrap): Doc fix.
12625
12626 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12627
12628 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12629
12630 2012-06-03 Glenn Morris <rgm@gnu.org>
12631
12632 * xdisp.c (tool-bar-style): Doc fix.
12633
12634 2012-06-03 Ulrich Müller <ulm@gentoo.org>
12635
12636 * Makefile.in (PAXCTL): Define.
12637 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12638 binary via PaX flags if the paxctl utility is available.
12639 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12640 Restore PaX flags to their default. (Bug#11398)
12641
12642 2012-06-03 Chong Yidong <cyd@gnu.org>
12643
12644 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12645 buffer (Bug#11226).
12646
12647 2012-06-03 Chong Yidong <cyd@gnu.org>
12648
12649 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12650 (note_mode_line_or_margin_highlight): If there is no help echo,
12651 use mode-line-default-help-echo. Handle the case where the mouse
12652 position is past the end of the mode line string.
12653
12654 * buffer.c (buffer_local_value_1): New function, split from
12655 Fbuffer_local_value; can return Qunbound.
12656 (Fbuffer_local_value): Use it.
12657 (Vmode_line_format): Docstring tweaks.
12658
12659 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12660
12661 * sysdep.c (system_process_attributes): Improve comment.
12662
12663 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12664
12665 * keyboard.c: Export real-this-command to Elisp.
12666 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12667 and DEFVAR it. Update all users.
12668
12669 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12670
12671 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12672
12673 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12674 Convert pctcpu and pctmem to Lisp float properly.
12675 Let the compiler fold better, as 100.0/0x8000 is exact.
12676
12677 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12678
12679 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12680 cons_block.
12681
12682 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12683
12684 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12685
12686 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12687
12688 For a 'struct window', replace some Lisp_Object fields to
12689 bitfields where appropriate, remove unused fields.
12690 * window.h (struct window): Remove unused 'last_mark_x' and
12691 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
12692 change its type from Lisp_Object to bitfield.
12693 Change type of 'force_start', 'optional_new_start',
12694 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
12695 fields from Lisp_Object to bitfield. Adjust users accordingly.
12696
12697 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12698
12699 Pacify gcc -Wdouble-precision when using Xaw.
12700 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12701 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12702 Use 'float' consistently, rather than 'float' in most places
12703 and 'double' in a couple of places.
12704
12705 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12706
12707 * xdisp.c (handle_stop): Detect whether we have overlay strings
12708 loaded by testing it->current.overlay_string_index to be
12709 non-negative, instead of checking whether n_overlay_strings is
12710 positive. (Bug#11587)
12711
12712 2012-05-31 Chong Yidong <cyd@gnu.org>
12713
12714 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12715
12716 * doc.c (Fsubstitute_command_keys): Doc fix.
12717
12718 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12719
12720 * search.c (search_buffer): Remove calls to
12721 r_alloc_inhibit_buffer_relocation, as it is now called by
12722 maybe_unify_char, which was the cause of relocation of buffer text
12723 in bug#11519.
12724
12725 2012-05-31 Eli Zaretskii <eliz@gnu.org>
12726
12727 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12728 for the duration of call to load_charset, to avoid problems with
12729 callers of maybe_unify_char that access buffer text through C
12730 pointers.
12731
12732 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12733 decrement the inhibition flag, instead of just setting or
12734 resetting it.
12735
12736 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12737
12738 Remove obsolete '#define static' cruft.
12739 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12740 This #undef was "temporary" in 2000; it is no longer needed
12741 now that '#define static' has gone away.
12742 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12743 (gray_bitmap_bits): Remove; no longer needed.
12744 All uses replaced with definiens.
12745 * xterm.c: Include "bitmaps/gray.xbm".
12746
12747 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12748
12749 Clean up __executable_start, monstartup when --enable-profiling.
12750 The following changes affect the code only when profiling.
12751 * dispnew.c (__executable_start): Rename from safe_bcopy.
12752 Define only on platforms that need it.
12753 * emacs.c: Include <sys/gmon.h> when profiling.
12754 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12755 (__executable_start): Remove decl, since lisp.h does it now.
12756 (safe_bcopy): Remove decl; no longer has that name.
12757 (main): Coalesce #if into single bit of code, for simplicity.
12758 Cast pointers to uintptr_t, since standard libraries want integers
12759 and not pointers.
12760 * lisp.h (__executable_start): New decl.
12761
12762 2012-05-31 Glenn Morris <rgm@gnu.org>
12763
12764 * image.c (Fimagemagick_types): Doc fix.
12765
12766 2012-05-30 Jim Meyering <meyering@redhat.com>
12767
12768 * callproc.c (Fcall_process_region): Include directory component
12769 in mkstemp error message (Bug#11586).
12770
12771 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12772
12773 * alloc.c, lisp.h (make_pure_vector): Now static.
12774
12775 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12776
12777 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12778 Move to byte-run.el.
12779 (Fautoload): Do the hash-doc more carefully.
12780 * data.c (Fdefalias): Purify definition, except for keymaps.
12781 (Qdefun): Move from eval.c.
12782 * lisp.h (Qdefun): Remove.
12783 * lread.c (read1): Tiny simplification.
12784
12785 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
12786
12787 Do not create empty overlays with the evaporate property (Bug#9642).
12788 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12789 Bug#9642, but explicitly check that the buffer the overlay would
12790 be moved to is live and rearrange lines to make sure that errors
12791 will not put the overlay in an inconsistent state.
12792 (Fdelete_overlay): Cosmetics.
12793
12794 2012-05-28 Eli Zaretskii <eliz@gnu.org>
12795
12796 * w32term.c (my_bring_window_to_top): New function.
12797 (x_raise_frame): Use handle returned by DeferWindowPos, which
12798 could be different from the original one.
12799 Call my_bring_window_to_top instead of my_set_foreground_window.
12800 (Bug#11513)
12801
12802 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12803 by calling BringWindowToTop.
12804
12805 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12806 (WM_EMACS_END): Increase by one.
12807
12808 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12809
12810 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12811 This avoids undefined behavior that might cause the eassert
12812 to not catch an out-of-range value.
12813
12814 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
12815
12816 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12817 Update dependencies.
12818
12819 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12820
12821 * bidi.c (bidi_mirror_char): Fix last change.
12822
12823 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12824
12825 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12826 when referring to sectname field in printf format.
12827
12828 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12829
12830 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12831 Only r_alloc_inhibit_buffer_relocation needed to be added;
12832 the others were already declared.
12833
12834 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12835 before checking whether it's out of range. Put the check inside
12836 eassert. See
12837 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12838
12839 2012-05-27 Ken Brown <kbrown@cornell.edu>
12840
12841 * callproc.c (Fcall_process): Restore a line that was accidentally
12842 commented out in the 2011-02-13 change (bug#11547).
12843
12844 2012-05-27 Eli Zaretskii <eliz@gnu.org>
12845
12846 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12847 defined on ralloc.c.
12848
12849 * buffer.c [REL_ALLOC]: Remove prototypes of
12850 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12851 they are now on lisp.h.
12852
12853 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12854
12855 * search.c (search_buffer): Use it to inhibit relocation of buffer
12856 text while re_search_2 is doing its job, because re_search_2 is
12857 passed C pointers to buffer text. (Bug#11519)
12858
12859 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12860 Update value to 24.
12861
12862 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12863 state after an additional call to move_it_in_display_line_to, keep
12864 the values of it->max_ascent and it->max_descent found for the
12865 entire line.
12866 (pos_visible_p): Revert the comparison against bottom_y to what it
12867 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12868 (Bug#11464)
12869
12870 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12871
12872 Fix coding-related core dumps with gcc -ftrapv.
12873 The code was computing A - B, where A and B are pointers, and B is
12874 random garbage. This can lead to core dumps on platforms that
12875 have special pointer registers, and it also leads to core dumps on
12876 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12877 A - B only when B is initialized properly.
12878 * coding.c (coding_set_source, coding_set_destination): Return void.
12879 (coding_change_source, coding_change_destinations): New functions,
12880 with the old behaviors of coding_set_source and coding_set_destination.
12881 All callers that need an offset changed to use these new functions.
12882
12883 2012-05-26 Glenn Morris <rgm@gnu.org>
12884
12885 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12886
12887 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12888
12889 Extend mouse support on W32 text-mode console.
12890 * xdisp.c (draw_row_with_mouse_face):
12891 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
12892
12893 * w32console.c: Include window.h.
12894 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12895 New functions.
12896 (initialize_w32_display): Initialize mouse-highlight data.
12897
12898 * w32inevt.c: Include termchar.h and window.h.
12899 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12900 moves, call note_mouse_highlight. If help_echo changed, call
12901 gen_help_event to produce help-echo message in the echo area.
12902 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12903 highlight info.
12904
12905 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12906
12907 * lread.c (read1): Simplify slightly to avoid an overflow warning
12908 with GCC 4.7.0 on x86-64.
12909
12910 2012-05-26 Eli Zaretskii <eliz@gnu.org>
12911
12912 * bidi.c (bidi_mirror_char): Revert last change: an int is
12913 definitely wide enough here.
12914
12915 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
12916
12917 Fix integer width and related bugs (Bug#9874).
12918 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
12919 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12920 (string_bytes, check_sblock, allocate_string_data):
12921 (compact_small_strings, Fmake_bool_vector, make_string)
12922 (make_unibyte_string, make_multibyte_string)
12923 (make_string_from_bytes, make_specified_string)
12924 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12925 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12926 (mark_vectorlike):
12927 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12928 (allocate_pseudovector):
12929 Use int, not EMACS_INT, where int is wide enough.
12930 (inhibit_garbage_collection, Fgarbage_collect):
12931 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12932 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12933 int might not be wide enough.
12934 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12935 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12936 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12937 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12938 (bidi_level_of_next_char, bidi_move_to_visually_next):
12939 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12940 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12941 (Fkill_buffer, Fset_buffer_major_mode)
12942 (advance_to_char_boundary, Fbuffer_swap_text)
12943 (Fset_buffer_multibyte, overlays_at, overlays_in)
12944 (overlay_touches_p, struct sortvec, record_overlay_string)
12945 (overlay_strings, recenter_overlay_lists)
12946 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12947 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12948 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12949 (Foverlay_recenter, last_overlay_modification_hooks_used)
12950 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12951 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12952 (validate_region): Omit unnecessary test for b <= e,
12953 since that's guaranteed by the previous test.
12954 (adjust_overlays_for_delete): Avoid pos + length overflow.
12955 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12956 (report_overlay_modification):
12957 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12958 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12959 Omit pointer cast, which isn't needed anyway, and doesn't work
12960 after the EMACS_INT -> ptrdiff_t change.
12961 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
12962 * buffer.h: Adjust decls to match defn changes elsewhere.
12963 (struct buffer_text, struct buffer):
12964 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12965 Use EMACS_INT, not int, where int might not be wide enough.
12966 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12967 not int, to avoid needless 32-bit limit on 64-bit hosts.
12968 (exec_byte_code): Use tighter memory-full test, one that checks
12969 for alloca overflow. Don't compute the address of the object just
12970 before an array, as that's not portable. Use EMACS_INT, not
12971 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
12972 * callint.c (Fcall_interactively):
12973 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12974 * callproc.c (call_process_kill, Fcall_process):
12975 Don't assume pid_t fits into an Emacs fixnum.
12976 (call_process_cleanup, Fcall_process, child_setup):
12977 Don't assume pid_t fits into int.
12978 (call_process_cleanup, Fcall_process, delete_temp_file)
12979 (Fcall_process_region):
12980 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12981 (Fcall_process): Simplify handling of volatile integers.
12982 Use int, not EMACS_INT, where int will do.
12983 * casefiddle.c (casify_object, casify_region, operate_on_word)
12984 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12986 (casify_object): Avoid integer overflow when overallocating buffer.
12987 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
12988 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
12989 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12990 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12991 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12992 integers are now checked earlier. All uses replaced with XINT.
12993 (ccl_driver):
12994 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12995 For CCL_MapSingle, check that content and value are in int range.
12996 (ccl_driver, Fregister_code_conversion_map):
12997 Check that Vcode_version_map_vector is a vector.
12998 (resolve_symbol_ccl_program): Check that vector header is in range.
12999 Always copy the vector, so that we can check its contents reliably
13000 now rather than having to recheck each instruction as it's being
13001 executed. Check that vector words fit in 'int'.
13002 (ccl_get_compiled_code, Fregister_ccl_program)
13003 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
13004 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
13005 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
13006 contents are in range.
13007 (Fccl_execute_on_string): Check that status is in range.
13008 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
13009 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
13010 Accept and return EMACS_INT, not int, because callers can pass values
13011 out of 'int' range.
13012 (c_string_width, strwidth, lisp_string_width, chars_in_text)
13013 (multibyte_chars_in_text, parse_str_as_multibyte)
13014 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
13015 (str_as_unibyte, str_to_unibyte, string_count_byte8)
13016 (string_escape_byte8, Fget_byte):
13017 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13018 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
13019 avoid mishandling large integers.
13020 * character.h: Adjust decls to match defn changes elsewhere.
13021 * charset.c (load_charset_map_from_file, find_charsets_in_text)
13022 (Ffind_charset_region):
13023 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13024 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
13025 (load_charset_map_from_vector, Fdefine_charset_internal):
13026 Don't assume fixnum fits in int.
13027 (load_charset_map_from_vector, Fmap_charset_chars):
13028 Remove now-unnecessary CHECK_NATNUMs.
13029 (Fdefine_charset_internal): Check ranges here, more carefully.
13030 Don't rely on undefined behavior with signed left shift overflow.
13031 Don't assume unsigned int fits into fixnum, or that fixnum fits
13032 into unsigned int. Don't require max_code to be a valid fixnum;
13033 that's not true for gb10830 4-byte on a 32-bit host. Allow
13034 invalid_code to be a cons, for the same reason. Require code_offset
13035 to be a character. Avoid int overflow if max_char is close
13036 to INT_MAX.
13037 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
13038 this is intended anyway and avoids some undefined behavior.
13039 (load_charset_map): Pass unsigned, not int, as 2nd arg of
13040 INDEX_TO_CODE_POINT, as that's what it expects.
13041 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
13042 * charset.h (DECODE_CHAR): Return int, not unsigned;
13043 this is what was intended anyway, and it avoids undefined behavior.
13044 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
13045 integer-overflow issues.
13046 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
13047 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
13048 where the argument is EMACS_INT, and this behavior is not intended.
13049 * chartab.c (Fmake_char_table, Fset_char_table_range)
13050 (uniprop_get_decoder, uniprop_get_encoder):
13051 Don't assume fixnum fits in int.
13052 * cmds.c (move_point): New function, that does the gist of
13053 Fforward_char and Fbackward_char, but does so while checking
13054 for integer overflow more accurately.
13055 (Fforward_char, Fbackward_char): Use it.
13056 (Fforward_line, Fend_of_line, internal_self_insert)
13057 (internal_self_insert):
13058 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13059 Fix a FIXME, by checking for integer overflow when calculating
13060 target_clm and actual_clm.
13061 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
13062 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
13063 (ASSURE_DESTINATION, coding_alloc_by_realloc)
13064 (coding_alloc_by_making_gap, alloc_destination)
13065 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
13066 (encode_coding_utf_16, detect_coding_emacs_mule)
13067 (decode_coding_emacs_mule, encode_coding_emacs_mule)
13068 (detect_coding_iso_2022, decode_coding_iso_2022)
13069 (encode_invocation_designation, encode_designation_at_bol)
13070 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
13071 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
13072 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
13073 (encode_coding_ccl, encode_coding_raw_text)
13074 (detect_coding_charset, decode_coding_charset)
13075 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
13076 (produce_composition, produce_charset, produce_annotation)
13077 (decode_coding, handle_composition_annotation)
13078 (handle_charset_annotation, consume_chars, decode_coding_gap)
13079 (decode_coding_object, encode_coding_object, detect_coding_system)
13080 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
13081 (code_convert_region, code_convert_string)
13082 (Fdefine_coding_system_internal)
13083 (coding_set_source, coding_set_destination):
13084 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13085 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
13086 (Fdefine_coding_system_internal):
13087 Don't assume fixnums fit in int.
13088 (decode_coding_gap, decode_coding_object, encode_coding_object)
13089 (Fread_coding_system, Fdetect_coding_region)
13090 (Funencodable_char_position, Fcheck_coding_systems_region)
13091 (get_translation, handle_composition_annotation, consume_chars):
13092 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13093 (consume_chars): Rewrite to not calculate an address outside buffer.
13094 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
13095 Don't access memory outside of the args array.
13096 (Fdefine_coding_system_internal): Check for charset-id overflow.
13097 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
13098 result of ENCODE_CHAR.
13099 * coding.h: Adjust decls to match defn changes elsewhere.
13100 (struct coding_system):
13101 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13102 * composite.c (get_composition_id, find_composition)
13103 (run_composition_function, update_compositions)
13104 (compose_text, composition_gstring_put_cache)
13105 (composition_gstring_p, composition_gstring_width)
13106 (fill_gstring_header, fill_gstring_body, autocmp_chars)
13107 (composition_compute_stop_pos, composition_reseat_it)
13108 (composition_update_it, struct position_record)
13109 (find_automatic_composition, composition_adjust_point)
13110 (Fcomposition_get_gstring, Ffind_composition_internal):
13111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13112 (update_compositions):
13113 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13114 * composite.h: Adjust decls to match defn changes elsewhere.
13115 (struct composition):
13116 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13117 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
13118 Do not attempt to compute the address of the object just before a
13119 buffer; this is not portable.
13120 (Faref, Faset):
13121 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13122 (Faset): Use int, not EMACS_INT, where int is wide enough.
13123 (Fstring_to_number): Don't assume fixnums fit in int.
13124 (Frem): Don't assume arg is nonnegative.
13125 * dbusbind.c (xd_append_arg): Check for integers out of range.
13126 (Fdbus_call_method): Don't overflow the timeout int.
13127 (extract_signed, extract_unsigned): New functions.
13128 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
13129 (xd_get_connection_references): Return ptrdiff_t, not int.
13130 All uses changed.
13131 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
13132 (xd_read_message_1):
13133 Use int, not unsigned, where the dbus API uses int.
13134 (Fdbus_message_internal): Don't overflow mtype.
13135 (syms_of_dbusbind): Allocate right-sized buffer for integers.
13136 * dired.c (directory_files_internal, file_name_completion, scmp)
13137 (file_name_completion_stat):
13138 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13139 (file_name_completion): Don't overflow matchcount.
13140 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
13141 * dispextern.h: Adjust decls to match defn changes elsewhere.
13142 (struct text_pos, struct glyph, struct bidi_saved_info)
13143 (struct bidi_string_data, struct bidi_it, struct composition_it)
13144 (struct it):
13145 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13146 (struct display_pos, struct composition_it, struct it):
13147 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13148 * dispnew.c (increment_matrix_positions)
13149 (increment_row_positions, mode_line_string)
13150 (marginal_area_string):
13151 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13152 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
13153 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13154 (duration_to_sec_usec): New function, to check for overflow better.
13155 (Fsleep_for, sit_for): Use it.
13156 * doc.c (get_doc_string, store_function_docstring):
13157 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13158 (get_doc_string, Fsnarf_documentation):
13159 Use int, not EMACS_INT, where int is wide enough.
13160 (get_doc_string):
13161 Use SAFE_ALLOCA, not alloca.
13162 Check for overflow when converting EMACS_INT to off_t.
13163 * doprnt.c (doprnt):
13164 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13165 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13166 Don't assume uid_t fits into fixnum.
13167 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13168 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13169 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13170 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13171 (general_insert_function)
13172 (Finsert_char, make_buffer_string, make_buffer_string_both)
13173 (update_buffer_properties, Fbuffer_substring)
13174 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13175 (Fsubst_char_in_region, check_translation)
13176 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13177 (transpose_markers, Ftranspose_regions):
13178 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13179 (clip_to_bounds): Move to lisp.h as an inline function).
13180 (Fconstrain_to_field): Don't assume integers are nonnegative.
13181 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13182 (Fsubst_char_in_region, Fsave_restriction):
13183 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13184 (Femacs_pid): Don't assume pid_t fits into fixnum.
13185 (lo_time): Use int, not EMACS_INT, when int suffices.
13186 (lisp_time_argument): Check for usec out of range.
13187 (Fencode_time): Don't assume fixnum fits in int.
13188 (Fuser_login_name, Fuser_full_name): Signal an error
13189 if a uid argument is out of range, rather than relying on
13190 undefined behavior.
13191 (Fformat_time_string): Remove now-unnecessary check.
13192 lisp_time_argument checks for out-of-range usec now.
13193 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
13194 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13195 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13196 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13197 (init_cmdargs, Fdump_emacs):
13198 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13199 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13200 the bottom (typically) 32 bits of the fixnum.
13201 * eval.c (specpdl_size, call_debugger):
13202 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13203 (when_entered_debugger, Fbacktrace_debug):
13204 Don't assume fixnum can fit in int.
13205 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13206 the object just before a buffer; this is not portable.
13207 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13208 (grow_specpdl, unbind_to):
13209 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13210 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13211 (grow_specpdl): Simplify allocation by using xpalloc.
13212 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
13213 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13214 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13215 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13216 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13217 (a_write, e_write):
13218 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13219 (Fcopy_file, non_regular_nbytes, read_non_regular)
13220 (Finsert_file_contents):
13221 Use int, not EMACS_INT, where int is wide enough.
13222 (READ_BUF_SIZE): Verify that it fits in int.
13223 (Finsert_file_contents): Check that counts are in proper range,
13224 rather than assuming fixnums fit into ptrdiff_t etc.
13225 Don't assume fixnums fit into int.
13226 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
13227 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13228 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
13229 (string_char_to_byte, string_byte_to_char)
13230 (string_make_multibyte, string_to_multibyte)
13231 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13232 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13233 (substring_both, Fdelete, internal_equal, Ffillarray)
13234 (Fclear_string, mapcar1)
13235 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13236 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13237 (larger_vector, make_hash_table, maybe_resize_hash_table)
13238 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13239 (Fmaphash, secure_hash):
13240 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13241 (concat): Check for string index and length overflow.
13242 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13243 (Frequire):
13244 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13245 (larger_vector): New API (vec, incr_min, size_max) replaces old
13246 one (vec, new_size, init). This catches size overflow.
13247 INIT was removed because it was always Qnil.
13248 All callers changed.
13249 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13250 the upper bound on a hash table index size.
13251 (make_hash_table, maybe_resize_hash_table): Use it.
13252 (secure_hash): Computer start_byte and end_byte only after
13253 they're known to be in ptrdiff_t range.
13254 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13255 (Ffont_get_glyphs, Ffont_at):
13256 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13257 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13258 (Flist_fonts, Fopen_font):
13259 Don't assume fixnum can fit in int.
13260 (check_gstring): Don't assume index can fit in int.
13261 (font_match_p): Check that fixnum is a character, not a nonnegative
13262 fixnum, since the later code needs to stuff it into an int.
13263 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13264 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13265 conversion overflow issues.
13266 (Fopen_font): Check for integer out of range.
13267 (Ffont_get_glyphs): Don't assume index can fit in int.
13268 * font.h: Adjust decls to match defn changes elsewhere.
13269 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13270 integer overflow.
13271 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13272 printmax_t, where ptrdiff_t is wide enough.
13273 (Finternal_char_font):
13274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13275 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13276 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13277 (Fset_frame_position, x_set_frame_parameters)
13278 (x_set_line_spacing, x_set_border_width)
13279 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13280 Check that fixnums are in proper range for system types.
13281 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13282 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13283 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13284 Use SAFE_ALLOCA_LISP, not alloca.
13285 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13286 intptr_t is wide enough.
13287 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13288 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13289 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13290 Check for fixnum out of range.
13291 * ftfont.c (ftfont_list): Don't assume index fits in int.
13292 Check that fixnums are in proper range for system types.
13293 (ftfont_shape_by_flt):
13294 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13295 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13296 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13297 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13298 Check that fixnums are in proper range for system types.
13299 * gnutls.h: Adjust decls to match defn changes elsewhere.
13300 * gtkutil.c (xg_dialog_run):
13301 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13302 (update_frame_tool_bar):
13303 Check that fixnums are in proper range for system types.
13304 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
13305 (lookup_image): Check that fixnums are in range for system types.
13306 * indent.c (last_known_column, last_known_column_point):
13307 (current_column_bol_cache):
13308 (skip_invisible, current_column, check_display_width):
13309 (check_display_width, scan_for_column, current_column_1)
13310 (Findent_to, Fcurrent_indentation, position_indentation)
13311 (indented_beyond_p, Fmove_to_column, compute_motion):
13312 (Fcompute_motion, Fvertical_motion):
13313 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13314 (last_known_column_modified): Use EMACS_INT, not int.
13315 (check_display_width):
13316 (Fcompute_motion):
13317 Check that fixnums and floats are in proper range for system types.
13318 (compute_motion): Don't assume index or fixnum fits in int.
13319 (compute_motion, Fcompute_motion):
13320 Use int, not EMACS_INT, when it is wide enough.
13321 (vmotion): Omit local var start_hpos that is always 0; that way
13322 we don't need to worry about overflow in expressions involving it.
13323 * indent.h: Adjust decls to match defn changes elsewhere.
13324 (struct position):
13325 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13326 Use int, not EMACS_INT, where int is wide enough.
13327 Remove unused members ovstring_chars_done and tab_offset;
13328 all uses removed.
13329 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13330 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13331 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13332 (make_gap, copy_text, insert, insert_and_inherit)
13333 (insert_before_markers, insert_before_markers_and_inherit)
13334 (insert_1, count_combining_before, count_combining_after)
13335 (insert_1_both, insert_from_string)
13336 (insert_from_string_before_markers, insert_from_string_1)
13337 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13338 (adjust_after_replace, adjust_after_insert, replace_range)
13339 (replace_range_2, del_range, del_range_1, del_range_byte)
13340 (del_range_both, del_range_2, modify_region)
13341 (prepare_to_modify_buffer, signal_before_change)
13342 (signal_after_change, Fcombine_after_change_execute):
13343 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13344 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13345 (balance_an_interval, split_interval_right, split_interval_left)
13346 (find_interval, next_interval, update_interval)
13347 (adjust_intervals_for_insertion, delete_node, delete_interval)
13348 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13349 (static_offset_intervals, offset_intervals)
13350 (merge_interval_right, merge_interval_left, make_new_interval)
13351 (graft_intervals_into_buffer, temp_set_point_both)
13352 (temp_set_point, set_point, adjust_for_invis_intang)
13353 (set_point_both, move_if_not_intangible, get_property_and_range)
13354 (get_local_map, copy_intervals, copy_intervals_to_string)
13355 (compare_string_intervals, set_intervals_multibyte_1):
13356 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13357 * intervals.h: Adjust decls to match defn changes elsewhere.
13358 (struct interval):
13359 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13360 * keyboard.c (this_command_key_count, this_single_command_key_start)
13361 (before_command_key_count, before_command_echo_length, echo_now)
13362 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13363 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13364 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13365 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13366 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13367 (last_non_minibuf_size, last_point_position, echo_truncate)
13368 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13369 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13370 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13371 (stuff_buffered_input):
13372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13373 (last_auto_save, command_loop_1, read_char):
13374 Use EMACS_INT, not int, to avoid integer overflow.
13375 (record_char): Avoid overflow in total_keys computation.
13376 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13377 * keyboard.h: Adjust decls to match defn changes elsewhere.
13378 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13379 (Fkey_description, Fdescribe_vector, Flookup_key):
13380 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13381 (click_position): New function, to check that positions are in range.
13382 (Fcurrent_active_maps):
13383 (describe_command):
13384 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13385 (Faccessible_keymaps, Fkey_description):
13386 (preferred_sequence_p):
13387 Don't assume fixnum can fit into int.
13388 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13389 Check for integer overflow in size calculations.
13390 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13391 avoid mishandling large integers.
13392 * lisp.h: Adjust decls to match defn changes elsewhere.
13393 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13394 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13395 (struct Lisp_Marker):
13396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13397 (clip_to_bounds): Now an inline function, moved here from editfns.c.
13398 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13399 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13400 All callers changed.
13401 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13402 Assume the arg has valid form, since it always does.
13403 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13404 unsigned integer system type.
13405 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13406 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13407 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13408 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13409 (duration_to_sec_usec): New decl.
13410 * lread.c (read_from_string_index, read_from_string_index_byte)
13411 (read_from_string_limit, readchar, unreadchar, openp)
13412 (read_internal_start, read1, oblookup):
13413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13414 (Fload, readevalloop, Feval_buffer, Feval_region):
13415 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13416 (openp): Check for out-of-range argument to 'access'.
13417 (read1): Use int, not EMACS_INT, where int is wide enough.
13418 Don't assume fixnum fits into int.
13419 Fix off-by-one error that can read outside a buffer.
13420 (read_filtered_event): Use duration_to_sec_usec
13421 to do proper overflow checking on durations.
13422 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13423 in size calculation.
13424 (Fexecute_kbd_macro):
13425 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13426 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13427 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13428 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13429 (set_marker_both, set_marker_restricted_both, marker_position)
13430 (marker_byte_position, Fbuffer_has_markers_at):
13431 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13432 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
13433 * menu.c (ensure_menu_items): Rename from grow_menu_items.
13434 It now merely ensures that the menu is large enough, without
13435 necessarily growing it, as this avoids some integer overflow issues.
13436 All callers changed.
13437 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13438 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13439 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13440 Use SAFE_ALLOCA_LISP, not alloca.
13441 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13442 to EMACS_INT. Check that fixnums are in proper range for system types.
13443 * minibuf.c (minibuf_prompt_width, string_to_object)
13444 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13445 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13446 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13447 (get_minibuffer, read_minibuf_unwind):
13448 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13449 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13450 this simplifies overflow checking. All callers changed.
13451 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13452 (Ftest_completion):
13453 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13454 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13455 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13456 Check that fixnums are in proper range for system types.
13457 (Fx_create_frame, Fx_show_tip):
13458 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13459 * nsfont.m (ns_findfonts, nsfont_list_family):
13460 Don't assume fixnum fits in long.
13461 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13462 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13463 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13464 wide enough.
13465 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
13466 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13467 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13468 (PRINTDECLARE, PRINTPREPARE):
13469 (strout, print_string):
13470 (print, print_preprocess, print_check_string_charset_prop)
13471 (print_object):
13472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13473 (PRINTDECLARE):
13474 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13475 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13476 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
13477 (printchar, strout): Use xpalloc to catch size calculation overflow.
13478 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
13479 (print_error_message): Use SAFE_ALLOCA, not alloca.
13480 (print_object): Use int, not EMACS_INT, where int is wide enough.
13481 (print_depth, new_backquote_output, print_number_index):
13482 Use ptrdiff_t, not int, where int might not be wide enough.
13483 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13484 (Fset_process_window_size, Fformat_network_address)
13485 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
13486 (sigchld_handler):
13487 Check that fixnums are in proper range for system types.
13488 (Fsignal_process): Simplify by avoiding a goto.
13489 Check for process-ids out of pid_t range rather than relying on
13490 undefined behavior.
13491 (process_tick, update_tick): Use EMACS_INT, not int.
13492 (Fformat_network_address, read_process_output, send_process)
13493 (Fprocess_send_region, status_notify):
13494 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13495 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13496 (wait_reading_process_output, read_process_output, exec_sentinel):
13497 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13498 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13499 (Faccept_process_output): Use duration_to_sec_usec to do proper
13500 overflow checking on durations.
13501 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13502 Don't assume pid_t fits in int.
13503 * process.h (struct Lisp_Process): Members tick and update_tick
13504 are now of type EMACS_INT, not int.
13505 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13506 configured --with-wide-int.
13507 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13508 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13509 * search.c (looking_at_1, string_match_1):
13510 (fast_string_match, fast_c_string_match_ignore_case)
13511 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13512 (scan_newline, find_before_next_newline, search_command)
13513 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13514 (set_search_regs, wordify):
13515 (Freplace_match):
13516 (Fmatch_data):
13517 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13518 (string_match_1, search_buffer, set_search_regs):
13519 (Fmatch_data):
13520 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13521 (wordify): Check for overflow in size calculation.
13522 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13523 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13524 Check that fixnums are in proper range for system types.
13525 * sound.c (struct sound_device)
13526 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13527 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13528 (Fplay_sound_internal):
13529 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13530 * syntax.c (struct lisp_parse_state, find_start_modiff)
13531 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13532 (Fparse_partial_sexp):
13533 Don't assume fixnums can fit in int.
13534 (struct lisp_parse_state, find_start_pos, find_start_value)
13535 (find_start_value_byte, find_start_begv)
13536 (update_syntax_table, char_quoted, dec_bytepos)
13537 (find_defun_start, prev_char_comend_first, back_comment):
13538 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13539 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13540 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13541 (Finternal_describe_syntax_value): Check that match_lisp is a
13542 character, not an integer, since the code stuffs it into int.
13543 (scan_words, scan_sexps_forward):
13544 Check that fixnums are in proper range for system types.
13545 (Fforward_word):
13546 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13547 (scan_sexps_forward):
13548 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13549 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13550 * syntax.h: Adjust decls to match defn changes elsewhere.
13551 (struct gl_state_s):
13552 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13553 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13554 MOST_POSITIVE_FIXNUM.
13555 * sysdep.c (wait_for_termination_1, wait_for_termination)
13556 (interruptible_wait_for_termination, mkdir):
13557 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13558 (emacs_read, emacs_write):
13559 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13560 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13561 and double all fit in int.
13562 * term.c (set_tty_color_mode):
13563 Check that fixnums are in proper range for system types.
13564 * termhooks.h (struct input_event):
13565 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13566 * textprop.c (validate_interval_range, interval_of)
13567 (Fadd_text_properties, set_text_properties_1)
13568 (Fremove_text_properties, Fremove_list_of_text_properties)
13569 (Ftext_property_any, Ftext_property_not_all)
13570 (copy_text_properties, text_property_list, extend_property_ranges)
13571 (verify_interval_modification):
13572 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13573 (Fnext_single_char_property_change)
13574 (Fprevious_single_char_property_change):
13575 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13576 (copy_text_properties):
13577 Check for integer overflow in index calculation.
13578 * undo.c (last_boundary_position, record_point, record_insert)
13579 (record_delete, record_marker_adjustment, record_change)
13580 (record_property_change):
13581 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13582 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13583 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13584 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13585 (Fx_hide_tip, Fx_file_dialog):
13586 * w32menu.c (set_frame_menubar):
13587 Use ptrdiff_t, not int, for consistency with rest of code.
13588 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13589 (select_window, Fdelete_other_windows_internal)
13590 (window_scroll_pixel_based, window_scroll_line_based)
13591 (Frecenter, Fset_window_configuration):
13592 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13593 (Fset_window_hscroll, run_window_configuration_change_hook)
13594 (set_window_buffer, temp_output_buffer_show, scroll_command)
13595 (Fscroll_other_window, Frecenter):
13596 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13597 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13598 Don't assume fixnum fits in int.
13599 (Fset_window_scroll_bars):
13600 Check that fixnums are in proper range for system types.
13601 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13602 (string_pos, c_string_pos, number_of_chars, init_iterator)
13603 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13604 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13605 (compute_display_string_end, handle_face_prop)
13606 (face_before_or_after_it_pos, handle_invisible_prop)
13607 (handle_display_prop, handle_display_spec, handle_single_display_spec)
13608 (display_prop_intangible_p, string_buffer_position_lim)
13609 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13610 (get_overlay_strings_1, get_overlay_strings)
13611 (iterate_out_of_display_property, forward_to_next_line_start)
13612 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13613 (get_next_display_element, set_iterator_to_next)
13614 (get_visually_first_element, compute_stop_pos_backwards)
13615 (handle_stop_backwards, next_element_from_buffer)
13616 (move_it_in_display_line_to, move_it_in_display_line)
13617 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13618 (add_to_log, message_dolog, message_log_check_duplicate)
13619 (message2, message2_nolog, message3, message3_nolog
13620 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13621 (current_message_1, truncate_echo_area, truncate_message_1)
13622 (set_message, set_message_1, store_mode_line_noprop)
13623 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13624 (text_outside_line_unchanged_p, check_point_in_composition)
13625 (reconsider_clip_changes)
13626 (redisplay_internal, set_cursor_from_row, try_scrolling)
13627 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13628 (redisplay_window, find_last_unchanged_at_beg_row)
13629 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13630 (trailing_whitespace_p, find_row_edges, display_line)
13631 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13632 (display_mode_element, store_mode_line_string)
13633 (pint2str, pint2hrstr, decode_mode_spec)
13634 (display_count_lines, display_string, draw_glyphs)
13635 (x_produce_glyphs, x_insert_glyphs)
13636 (rows_from_pos_range, mouse_face_from_buffer_pos)
13637 (fast_find_string_pos, mouse_face_from_string_pos)
13638 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13639 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13640 (safe_call, init_from_display_pos, handle_fontified_prop)
13641 (handle_single_display_spec, load_overlay_strings)
13642 (with_echo_area_buffer, setup_echo_area_for_printing)
13643 (display_echo_area, echo_area_display)
13644 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13645 (update_tool_bar, hscroll_window_tree, redisplay_internal)
13646 (redisplay_window, dump_glyph_row, display_mode_line)
13647 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
13648 (handle_display_spec, display_prop_string_p):
13649 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13650 (handle_single_display_spec, build_desired_tool_bar_string)
13651 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13652 (get_specified_cursor_type):
13653 Check that fixnums are in proper range for system types.
13654 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13655 (Flookup_image_map):
13656 Don't assume fixnums fit in int.
13657 (compare_overlay_entries):
13658 Avoid mishandling comparisons due to subtraction overflow.
13659 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13660 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13661 (handle_tool_bar_click):
13662 Use int, not unsigned, since we prefer signed and the signedness
13663 doesn't matter here.
13664 (get_next_display_element, next_element_from_display_vector):
13665 Use int, not EMACS_INT, when int is wide enough.
13666 (start_hourglass): Use duration_to_sec_usec to do proper
13667 overflow checking on durations.
13668 * xfaces.c (Fbitmap_spec_p):
13669 Check that fixnums are in proper range for system types.
13670 (compare_fonts_by_sort_order):
13671 Avoid mishandling comparisons due to subtraction overflow.
13672 (Fx_family_fonts, realize_basic_faces):
13673 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13674 (Fx_family_fonts):
13675 Don't assume fixnum fits in int.
13676 Use SAFE_ALLOCA_LISP, not alloca.
13677 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13678 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13679 (face_at_buffer_position, face_for_overlay_string)
13680 (face_at_string_position):
13681 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13682 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13683 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13684 (Fx_show_tip):
13685 Check that fixnums are in proper range for system types.
13686 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13687 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13688 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13689 (Fx_change_window_property): Don't assume fixnums fit in int.
13690 * xfont.c (xfont_chars_supported):
13691 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13692 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13693 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13694 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13695 * xml.c (parse_region):
13696 * xrdb.c (magic_file_p):
13697 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13698 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13699 (x_get_local_selection, x_reply_selection_request)
13700 (x_handle_selection_request, wait_for_property_change):
13701 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13702 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13703 short is wide enough.
13704 (x_send_client_event): Don't assume fixnum fits in int.
13705 * xterm.c (x_x_to_emacs_modifiers):
13706 Don't assume EMACS_INT overflows nicely into int.
13707 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13708 may come from Lisp.
13709 (handle_one_xevent): NATNUMP can eval its arg twice.
13710 (x_connection_closed):
13711 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13712 * xterm.h: Adjust decls to match defn changes elsewhere.
13713 (struct scroll_bar): Use struct vectorlike_header
13714 rather than rolling our own approximation.
13715 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13716
13717 2012-05-25 Glenn Morris <rgm@gnu.org>
13718
13719 * lisp.mk (lisp): Update for more files being compiled now.
13720
13721 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13722
13723 * lread.c: Remove `read_pure' which makes no difference.
13724 (read_pure): Remove var.
13725 (unreadpure): Remove function.
13726 (readevalloop): Don't call read_list with -1 flag.
13727 (read1, read_vector): Don't test read_pure any more.
13728 (read_list): Simplify.
13729
13730 * fileio.c, character.h: Minor style tweaks.
13731
13732 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13733
13734 * window.h (clip_changed): Remove useless declaration.
13735
13736 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
13737
13738 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13739 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13740
13741 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13742
13743 Remove src/m/*.
13744 This directory predates autoconf and is no longer needed nowadays.
13745 Move its few remaining bits of functionality to where they're needed.
13746 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13747 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13748 * m/template.h: Remove.
13749 * Makefile.in (M_FILE): Remove. All uses removed.
13750 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13751 * lisp.h (USE_LSB_TAG):
13752 * mem-limits.h (EXCEEDS_LISP_PTR):
13753 Use VAL_MAX, not VALBITS, in #if.
13754 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13755 (EMACS_UINT): Define unconditionally now.
13756 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13757 (BITS_PER_EMACS_INT): New constants, replacing
13758 what used to be in config.h, but not useful in #if.
13759 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13760 define them any more.
13761 (VAL_MAX): New macro.
13762 (VALMASK): Use it.
13763 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13764 BITS_PER_EMACS_INT, in #if.
13765 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13766 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13767 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13768 * s/ms-w32.h (DATA_START):
13769 Move here from removed file m/intel386.h.
13770 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13771 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13772
13773 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13774
13775 Assume C89 or later.
13776 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13777 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13778 (xrealloc):
13779 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13780 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13781 * textprop.c, tparam.c (NULL): Remove.
13782 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13783 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13784 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13785 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13786 * xterm.c (input_signal_count): Assume volatile works.
13787
13788 2012-05-21 Ken Brown <kbrown@cornell.edu>
13789
13790 * xgselect.c (xg_select): Fix first argument in call to 'select'
13791 (bug#11508).
13792
13793 2012-05-20 Ken Brown <kbrown@cornell.edu>
13794
13795 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
13796 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
13797
13798 2012-05-19 Ken Brown <kbrown@cornell.edu>
13799
13800 * xfns.c (x_in_use): Remove `static' qualifier.
13801 * xterm.h (x_in_use): Declare.
13802 * xgselect.c: Include xterm.h.
13803 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13804 and `display_arg' (bug#9754).
13805
13806 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13807
13808 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13809
13810 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13811 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13812
13813 2012-05-18 Eli Zaretskii <eliz@gnu.org>
13814
13815 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13816
13817 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
13818 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
13819
13820 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13821 reference to image_cache->refcount.
13822 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13823
13824 2012-05-17 Juri Linkov <juri@jurta.org>
13825
13826 * search.c (Fword_search_regexp, Fword_search_backward)
13827 (Fword_search_forward, Fword_search_backward_lax)
13828 (Fword_search_forward_lax): Move functions to isearch.el
13829 (bug#10145, bug#11381).
13830
13831 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13832
13833 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13834
13835 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13836
13837 * lread.c (init_obarray): Declare Qt and Qnil as special.
13838
13839 2012-05-14 Glenn Morris <rgm@gnu.org>
13840
13841 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
13842 Put "libexec" before "bin", for the sake of init_callproc_1.
13843
13844 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13845
13846 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13847
13848 * unexaix.c: Port to more-recent AIX compilers.
13849 (report_error, report_error_1, make_hdr, copy_sym)
13850 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13851 Make arguments const char *, not char *, to avoid violations of C
13852 standard and to fix some AIX warnings reported by Gilles Pion.
13853
13854 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13855
13856 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13857 already have overlays loaded.
13858 (handle_single_display_spec): Before returning without displaying
13859 fringe bitmap, synchronize the bidi iterator with the main display
13860 iterator, by calling iterate_out_of_display_property.
13861 (iterate_out_of_display_property): Detect buffer iteration by
13862 testing that it->string is a Lisp string.
13863 (get_next_display_element): When the current object is exhausted,
13864 and there's something on it->stack, call set_iterator_to_next to
13865 proceed with what's on the stack, instead of returning zero.
13866 (set_iterator_to_next): If called at the end of a Lisp string,
13867 proceed to consider_string_end without incrementing string
13868 position. Don't increment display vector index past the end of
13869 the display vector. (Bug#11417)
13870 (pos_visible_p): Don't report a position visible when move_it_to
13871 stopped at the last line of window, which happens to be scanned
13872 backwards by the bidi iteration. (Bug#11464)
13873
13874 2012-05-14 Eli Zaretskii <eliz@gnu.org>
13875
13876 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13877 and right-margin display specs even if the spec is invalid or we
13878 are on a TTY, and thus unable to display on the fringes.
13879 That's because the text with the property will not be displayed anyway,
13880 so we need to signal to the caller that this is a "replacing"
13881 display spec. This fixes display when the spec is invalid or we
13882 are on a TTY.
13883
13884 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13885
13886 * unexaix.c (make_hdr): Fix typo in prototype.
13887 This bug broke the build on AIX. Problem reported by Gilles Pion.
13888
13889 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
13890
13891 * keyboard.c (kbd_buffer_get_event): Read special events also in
13892 batch mode. (Bug#11415)
13893
13894 2012-05-12 Glenn Morris <rgm@gnu.org>
13895
13896 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13897
13898 2012-05-12 Eli Zaretskii <eliz@gnu.org>
13899
13900 * lisp.mk (lisp): Add newcomment.elc.
13901
13902 2012-05-12 Glenn Morris <rgm@gnu.org>
13903
13904 * Makefile.in (MKDIR_P): New, set by configure.
13905 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13906
13907 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13908
13909 Remove unused function hourglass_started.
13910 * dispextern.h (hourglass_started):
13911 * w32fns.c (hourglass_started):
13912 * xdisp.c (hourglass_started): Remove.
13913
13914 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
13915
13916 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13917 Update dependencies.
13918
13919 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13920
13921 * xgselect.c (xg_select): Put maxfds+1 into a var.
13922 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13923
13924 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13925
13926 2012-05-10 Dave Abrahams <dave@boostpro.com>
13927
13928 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13929 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13930
13931 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
13932
13933 * dbusbind.c (xd_registered_buses): New internal Lisp object.
13934 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
13935 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13936 Initialize xd_registered_buses.
13937
13938 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13939
13940 Untag more efficiently if USE_LSB_TAG.
13941 This is based on a proposal by YAMAMOTO Mitsuharu in
13942 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13943 For an admittedly artificial (nth 8000 longlist) benchmark on
13944 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13945 Emacs's overall text size by 1%.
13946 * lisp.h (XUNTAG): New macro.
13947 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13948 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13949 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13950 * eval.c (Fautoload):
13951 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13952 * frame.h (XFRAME): Use XUNTAG.
13953
13954 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13955 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13956 Remove unportable assumptions about print widths of types like
13957 dbus_uint32_t.
13958 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13959 intptr_t when converting between pointer and integer, to avoid GCC
13960 warnings about wrong width.
13961
13962 2012-05-09 Eli Zaretskii <eliz@gnu.org>
13963
13964 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13965 stack for each reader_thread, instead of defaulting to 8MB
13966 determined by the linker. This avoids failures in creating
13967 subprocesses on Windows 7, see the discussion in this thread:
13968 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13969
13970 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13971
13972 Fix up display of the *Minibuf-0* buffer in the mini window.
13973 * keyboard.c (read_char): Don't clear the echo area if there's no
13974 message to clear.
13975 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
13976 contents of *Minibuf-0*) if there's no message displayed in its stead.
13977
13978 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
13979
13980 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13981 batch mode.
13982
13983 2012-05-06 Chong Yidong <cyd@gnu.org>
13984
13985 * lisp.mk (lisp): Update.
13986
13987 2012-05-05 Jim Meyering <meyering@redhat.com>
13988
13989 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13990
13991 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13992
13993 * data.c (PUT_ERROR): New macro.
13994 (syms_of_data): Use it. Add new error type `user-error'.
13995 * undo.c (user_error): New function.
13996 (Fprimitive_undo): Use it.
13997 * print.c (print_error_message): Adjust print style for `user-error'.
13998 * keyboard.c (user_error): New function.
13999 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
14000
14001 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
14002
14003 Do not limit current-time-string to years 1000..9999.
14004 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
14005 (Fcurrent_time_string): Support any year that is supported by the
14006 underlying localtime representation. Don't use asctime, as it
14007 has undefined behavior for years outside the range -999..9999.
14008
14009 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
14010
14011 Fix race conditions involving setenv, gmtime, localtime, asctime.
14012 Without this fix, interrupts could mess up code that uses these
14013 nonreentrant functions, since setting TZ invalidates existing
14014 tm_zone or tzname values, and since most of these functions return
14015 pointers to static storage.
14016 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
14017 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
14018 Grow the critical sections to include not just invoking
14019 localtime/gmtime, but also accessing these functions' results
14020 including their tm_zone values if any, and any related TZ setting.
14021 (format_time_string): Last arg is now struct tm *, not struct tm **,
14022 so that the struct tm is saved in the critical section.
14023 All callers changed. Simplify allocation of initial buffer, partly
14024 motivated by the fact that memory allocation needs to be outside
14025 the critical section.
14026
14027 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
14028
14029 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
14030 with RESET_INTERVAL.
14031
14032 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
14033 Remove duplicated buffer name initialization.
14034
14035 2012-05-02 Jim Meyering <jim@meyering.net>
14036
14037 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
14038
14039 * xfns.c (x_window): Use xstrdup (Bug#11375).
14040
14041 2012-05-02 Eli Zaretskii <eliz@gnu.org>
14042
14043 * xdisp.c (pos_visible_p): If already at a newline from the
14044 display string before the 'while' loop, don't walk back the glyphs
14045 from it3.glyph_row. Solves assertion violation when the display
14046 string begins with a newline (egg.el). (Bug#11367)
14047
14048 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
14049
14050 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
14051 Move to simple.el.
14052
14053 2012-05-01 Glenn Morris <rgm@gnu.org>
14054
14055 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
14056 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
14057 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
14058 All were removed before 23.1.
14059
14060 * dispnew.c: Remove HAVE_LIBNCURSES test;
14061 it is always true on relevant platforms.
14062
14063 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
14064 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
14065
14066 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
14067
14068 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
14069
14070 * .gdbinit (xpr): Remove checks for no longer existing misc types.
14071 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
14072 Remove.
14073
14074 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
14075
14076 Do not avoid creating empty evaporating overlays (Bug#9642).
14077 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
14078 That is, do not delete an evaporating overlay if it becomes
14079 empty after its bounds are adjusted to fit within its buffer.
14080 This fix caused other problems, and I'm reverting it until we get
14081 to the bottom of them.
14082
14083 2012-04-27 Chong Yidong <cyd@gnu.org>
14084
14085 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
14086
14087 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14088
14089 * xdisp.c (pos_visible_p): If the window start position is beyond
14090 ZV, start the display from buffer beginning. Prevents assertion
14091 violation in init_iterator when the minibuffer window is scrolled
14092 via the scroll bar.
14093
14094 * window.c (window_scroll_pixel_based): Likewise.
14095
14096 2012-04-27 Chong Yidong <cyd@gnu.org>
14097
14098 * keymap.c (where_is_internal): Doc fix (Bug#10872).
14099
14100 2012-04-27 Glenn Morris <rgm@gnu.org>
14101
14102 * fileio.c (Fcopy_file, Fset_file_selinux_context):
14103 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
14104
14105 2012-04-27 Eli Zaretskii <eliz@gnu.org>
14106
14107 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
14108 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
14109
14110 2012-04-26 Eli Zaretskii <eliz@gnu.org>
14111
14112 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
14113 display element, check also the underlying string or buffer
14114 character. (Bug#11341)
14115
14116 * w32menu.c: Include w32heap.h.
14117 (add_menu_item): If the call to AppendMenuW (via
14118 unicode_append_menu) fails, disable Unicode menus only if we are
14119 running on Windows 9X/Me.
14120
14121 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
14122
14123 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
14124 (xgetint): Add missing shift for LSB tags.
14125
14126 2012-04-24 Martin Rudalics <rudalics@gmx.at>
14127
14128 * keyboard.c (read_char): Don't wipe echo area for select window
14129 events: These might get delayed via `mouse-autoselect-window'
14130 (Bug#11304).
14131
14132 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
14133
14134 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
14135 manipulation of :loaded-from data.
14136
14137 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
14138
14139 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
14140 now a cons (bug#11311).
14141
14142 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
14143
14144 Do not create empty overlays with the evaporate property (Bug#9642).
14145 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14146 if it becomes empty after its bounds are adjusted to fit within
14147 its buffer. Without this fix, in a nonempty buffer (let ((o
14148 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14149 yields an empty overlay that has the evaporate property, which is
14150 not supposed to happen.
14151
14152 Fix minor GTK3 problems found by static checking.
14153 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14154 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14155 (struct _EmacsFixedClass, emacs_fixed_get_type):
14156 Move decls here from emacsgtkfixed.h, since they needn't be public.
14157 (emacs_fixed_get_type): Now static.
14158 (emacs_fixed_class_init): Omit unused local.
14159 (emacs_fixed_child_type): Remove; unused.
14160 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14161 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14162 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14163 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14164 (EMACS_FIXED_GET_CLASS): Remove; unused.
14165 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14166
14167 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14168 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14169
14170 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14171
14172 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
14173 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
14174 (__malloc_size_t, __malloc_ptrdiff_t):
14175 Remove. All uses removed, replaced by the definiens if needed,
14176 since we can assume C89 or better now.
14177 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14178 (protect_malloc_state, align, get_contiguous_space)
14179 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14180 (malloc_atfork_handler_child, malloc_enable_thread)
14181 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14182 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14183 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14184 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14185 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14186 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14187 Define using prototypes, not old style.
14188 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14189 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14190 (align): Don't assume that signed integer overflow wraps around.
14191 Omit unused local var.
14192 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14193 (_free_internal_nolock, memalign, mallochook, reallochook):
14194 Omit no-longer-needed casts.
14195 (valloc): Use getpagesize, not __getpagesize.
14196 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14197 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14198
14199 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14200
14201 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
14202
14203 Move functions from C to Lisp. Make non-blocking method calls
14204 the default. Implement further D-Bus standard interfaces.
14205
14206 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14207 (QCdbus_request_name_allow_replacement)
14208 (QCdbus_request_name_replace_existing)
14209 (QCdbus_request_name_do_not_queue)
14210 (QCdbus_request_name_reply_primary_owner)
14211 (QCdbus_request_name_reply_in_queue)
14212 (QCdbus_request_name_reply_exists)
14213 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14214 (QCdbus_registered_serial, QCdbus_registered_method)
14215 (QCdbus_registered_signal): New Lisp objects.
14216 (XD_DEBUG_MESSAGE): Use sizeof.
14217 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14218 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14219 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14220 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14221 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14222 (xd_signature, xd_append_arg): Allow float for integer types.
14223 (xd_get_connection_references): New function.
14224 (xd_get_connection_address): Rename from xd_initialize.
14225 Return cached address.
14226 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14227 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14228 level.
14229 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
14230 Return number of refcounts.
14231 (Fdbus_get_unique_name): Make stronger parameter check.
14232 (Fdbus_message_internal): New defun.
14233 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14234 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14235 (Fdbus_send_signal, Fdbus_register_service)
14236 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14237 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14238 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14239 (Vdbus_compiled_version, Vdbus_runtime_version)
14240 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14241 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14242 (Vdbus_message_type_signal): New defvars.
14243 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14244 Adapt docstring.
14245
14246 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14247
14248 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14249 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14250 Do not assume ptrdiff_t is the same width as 'int'.
14251
14252 * alloc.c: Handle unusual debugging option combinations.
14253 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14254 since the two debugging options are incompatible.
14255 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14256 is defined.
14257 (mem_init, mem_insert, mem_insert_fixup):
14258 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14259 (NEED_MEM_INSERT): Remove; no longer needed.
14260
14261 2012-04-22 Leo Liu <sdl.web@gmail.com>
14262
14263 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14264
14265 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14266
14267 * sysdep.c [__FreeBSD__]: Minor cleanups.
14268 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14269 Use Emacs indenting style more consistently. Avoid some casts.
14270 Use 'double' consistently rather than mixing 'float' and 'double'.
14271
14272 2012-04-21 Eduard Wiebe <usenet@pusto.de>
14273
14274 * sysdep.c (list_system_processes, system_process_attributes):
14275 Add implementation for FreeBSD (Bug#5243).
14276
14277 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14278
14279 * lisp.mk (lisp): Update.
14280
14281 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14282
14283 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14284 It is never used otherwise.
14285
14286 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14287
14288 * print.c (print_preprocess): Only check print_depth if print-circle
14289 is nil.
14290 (print_object): Check for cycles even when print-circle is nil and
14291 print-gensym is t, but only check print_depth if print-circle is nil.
14292
14293 2012-04-20 Chong Yidong <cyd@gnu.org>
14294
14295 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14296 set the status to "failed" and ensure that sentinel is run.
14297
14298 2012-04-20 Glenn Morris <rgm@gnu.org>
14299
14300 * process.c (Fset_process_inherit_coding_system_flag)
14301 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
14302 (Fmake_network_process, Fmake_serial_process): Doc fix.
14303
14304 2012-04-20 Eli Zaretskii <eliz@gnu.org>
14305
14306 * xdisp.c (string_buffer_position_lim): Limit starting position to
14307 BEGV.
14308 (set_cursor_from_row): If called for a mode-line or header-line
14309 row, return zero immediately.
14310 (try_cursor_movement): If inside continuation line, don't back up
14311 farther than the first row after the header line, if any.
14312 Don't consider the header-line row as "partially visible", even if
14313 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14314
14315 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14316
14317 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14318 (bug#11238).
14319
14320 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
14321 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
14322
14323 configure: new option --enable-gcc-warnings (Bug#11207)
14324 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14325 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14326 (ALL_CFLAGS): Use new macros rather than old.
14327 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14328 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14329 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14330 -Wunused-result, -Wunused-variable. This should go away once
14331 the Emacs and Gnulib regex code is merged.
14332 (xmalloc, xrealloc): Now static.
14333
14334 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14335
14336 * dired.c (Fsystem_groups): Remove unused local.
14337
14338 2012-04-17 Glenn Morris <rgm@gnu.org>
14339
14340 * dired.c (Fsystem_users): Doc fix.
14341
14342 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14343
14344 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14345 (syms_of_dired): Add them.
14346
14347 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14348
14349 Fix minor alloc.c problems found by static checking.
14350 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14351 New extern decls, to avoid calling undeclared functions.
14352 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14353 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14354 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14355 (NEED_MEM_INSERT): New macro.
14356 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
14357 Remove one incorrect comment and fix another.
14358
14359 Fix minor ralloc.c problems found by static checking.
14360 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14361 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14362 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14363 (r_alloc_sbrk): Now static.
14364
14365 Improve ralloc.c interface checking.
14366 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14367 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14368 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14369 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14370 [REL_ALLOC]: ... to here, to check interface.
14371 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14372 Remove decls. This fixes an "It stinks!".
14373
14374 * alloc.c (which_symbols): Fix alignment issue / type clash.
14375
14376 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14377
14378 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14379 (struct Lisp_Misc_Any): Likewise.
14380 (struct Lisp_Free): Likewise.
14381 * alloc.c (union aligned_Lisp_Symbol): Define.
14382 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14383 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14384 (union aligned_Lisp_Misc): Define.
14385 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14386 aligned_Lisp_Misc instead of union Lisp_Misc.
14387 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
14388
14389 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14390
14391 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14392 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14393 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14394 * s/netbsd.h, s/sol2-6.h:
14395 Remove definition of GC_MARK_STACK, since the default now works.
14396 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14397 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14398 no longer the default.
14399 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14400
14401 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
14402
14403 * lread.c (lisp_file_lexically_bound_p):
14404 Fix hang at ";-*-\n" (bug#11238).
14405
14406 2012-04-14 Eli Zaretskii <eliz@gnu.org>
14407
14408 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14409 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14410
14411 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14412
14413 * nsterm.m (constrainFrameRect): Always constrain when there is only
14414 one screen (Bug#10962).
14415
14416 2012-04-13 Ken Brown <kbrown@cornell.edu>
14417
14418 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14419
14420 2012-04-13 Reuben Thomas <rrt@sc3d.org>
14421
14422 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14423
14424 2012-04-11 Daniel Colascione <dancol@dancol.org>
14425
14426 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14427 against is gone. It's better to use vfork now so that when Cygwin
14428 gains a new, working vfork, we use it automatically (bug#10398).
14429
14430 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14431
14432 * window.c (save_window_save): Obey window-point-insertion-type.
14433
14434 2012-04-11 Glenn Morris <rgm@gnu.org>
14435
14436 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14437
14438 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14439
14440 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14441
14442 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
14443
14444 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14445 (force_quit_count): New var.
14446 (handle_interrupt): Use it.
14447
14448 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
14449
14450 * w32.c (w32_delayed_load): Record the full path of the library
14451 being loaded (bug#10424).
14452
14453 2012-04-09 Glenn Morris <rgm@gnu.org>
14454
14455 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14456 not just in the obarray, before snarfing them. (Bug#11036)
14457
14458 * Makefile.in ($(leimdir)/leim-list.el):
14459 Pass EMACS rather than BUILT_EMACS.
14460
14461 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14462
14463 * process.c (make_process):
14464 * process.h: Add integer `gnutls_handshakes_tried' member to
14465 process struct.
14466
14467 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14468 Add convenience `GNUTLS_LOG2i' macro.
14469
14470 * gnutls.c (gnutls_log_function2i): Convenience log function.
14471 (emacs_gnutls_read): Use new log functions,
14472 `gnutls_handshakes_tried' process member, and
14473 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14474 attempts per process (connection).
14475
14476 2012-04-09 Chong Yidong <cyd@gnu.org>
14477
14478 * eval.c (Fuser_variable_p, user_variable_p_eh)
14479 (lisp_indirect_variable): Functions deleted.
14480 (Fdefvar): Caller changed.
14481
14482 * callint.c (Finteractive, Fcall_interactively):
14483 * minibuf.c (Fread_variable): Callers changed.
14484
14485 2012-04-09 Eli Zaretskii <eliz@gnu.org>
14486
14487 * xdisp.c (set_cursor_from_row): If the display string appears in
14488 the buffer at position that is closer to point than the position
14489 after the display string, display the cursor on the first glyph of
14490 the display string. Fixes cursor display when a 'display' text
14491 property immediately follows invisible text. (Bug#11094)
14492
14493 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14494
14495 composite.c: use 'double' consistently
14496 * composite.c (get_composition_id): Use 'double' consistently
14497 instead of converting 'float' to 'double' and vice versa; this is
14498 easier to understand and avoids a GCC warning.
14499
14500 2012-04-09 Glenn Morris <rgm@gnu.org>
14501
14502 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14503 preparation for dumping it with emacs. (Bug#4789)
14504 (leimdir): New variable.
14505 ($(leimdir)/leim-list.el): New rule.
14506 (emacs$(EXEEXT)): Depend on leim-list.el.
14507
14508 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14509 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14510 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14511
14512 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14513
14514 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14515 proper alignment.
14516
14517 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
14518
14519 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14520 Remove unused local variable.
14521
14522 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14523
14524 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14525 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14526 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14527 objects, as mark_maybe_pointer will catch them otherwise.
14528 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14529 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14530
14531 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14532
14533 Fix typo that broke non-Windows builds.
14534 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14535
14536 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14537
14538 Support building on MS-Windows with libxml2.
14539
14540 * makefile.w32-in (OBJ2): Add xml.$(O).
14541 (GLOBAL_SOURCES): Add xml.c.
14542 ($(BLD)/xml.$(O)): New dependency list.
14543
14544 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14545 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14546 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14547 [!WINDOWSNT]: New macros.
14548 (init_libxml2_functions, libxml2_loaded_p): New functions.
14549 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14550 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14551 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14552 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14553 linked in).
14554 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14555 Call init_libxml2_functions before calling libxml2 functions.
14556 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14557
14558 * emacs.c: Don't include libxml/parser.h.
14559 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14560 xmlCleanupParser directly.
14561
14562 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14563
14564 2012-04-07 Eli Zaretskii <eliz@gnu.org>
14565
14566 * indent.c (Fvertical_motion): If there is a display string at
14567 point, use it.vpos to compute how many lines to backtrack after
14568 move_it_to point. (Bug#11133)
14569
14570 2012-04-06 Eli Zaretskii <eliz@gnu.org>
14571
14572 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14573 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14574 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14575 macros related to unification of CJK characters. For the details,
14576 see the discussion following the message here:
14577 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14578
14579 2012-04-04 Chong Yidong <cyd@gnu.org>
14580
14581 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14582
14583 2012-04-01 Eli Zaretskii <eliz@gnu.org>
14584
14585 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14586 instead of alloca. (Bug#11138)
14587
14588 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14589
14590 * w32menu.c (is_simple_dialog): Properly check lisp types.
14591 (Bug#11141)
14592
14593 2012-03-31 Eli Zaretskii <eliz@gnu.org>
14594
14595 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14596 position we get to after a call to move_it_to fails the
14597 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14598 only if we wind up in a string from display property. (Bug#11063)
14599
14600 * window.c (Fdelete_other_windows_internal): Invalidate the row
14601 and column information about mouse highlight, so that redisplay
14602 restores it after reallocating the glyph matrices. (Bug#7464)
14603
14604 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14605 string comes from a `display' text property, use the buffer
14606 position of that property as if we actually saw that position in
14607 the row's glyphs.
14608 (move_it_by_lines): Remove the assertion that
14609 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14610 violated when there's a before-string at the beginning of a line.
14611 (Bug#11063)
14612
14613 2012-03-30 Eli Zaretskii <eliz@gnu.org>
14614
14615 * xdisp.c (append_space_for_newline): If the default face was
14616 remapped, use the remapped face for the appended newline.
14617 (extend_face_to_end_of_line): Use the remapped default face for
14618 extending the face to the end of the line.
14619 (display_line): Call extend_face_to_end_of_line when the default
14620 face was remapped. (Bug#11068)
14621
14622 2012-03-29 Eli Zaretskii <eliz@gnu.org>
14623
14624 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14625
14626 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14627
14628 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14629
14630 2012-03-27 Glenn Morris <rgm@gnu.org>
14631
14632 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14633 Doc fixes.
14634
14635 2012-03-26 Kenichi Handa <handa@m17n.org>
14636
14637 * dispextern.h (struct glyph): Fix previous change. Change the
14638 bit length of glyphless.ch to 25 (Bug#11082).
14639
14640 2012-03-26 Chong Yidong <cyd@gnu.org>
14641
14642 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14643 (command_loop_1): Use it; inhibit selection update for
14644 handle-select-window too (Bug#8996).
14645
14646 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14647
14648 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
14649
14650 2012-03-25 Kenichi Handa <handa@m17n.org>
14651
14652 * dispextern.h (struct glyph): Change the bit length of
14653 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14654
14655 2012-03-24 Eli Zaretskii <eliz@gnu.org>
14656
14657 * s/ms-w32.h (tzname): Include time.h before redirecting to
14658 _tzname. Fixes the MSVC build. (Bug#9960)
14659
14660 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14661
14662 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14663 characters.
14664
14665 * xterm.c (XTread_socket): Only modify handling_signal if
14666 !SYNC_INPUT. (Bug#11080)
14667
14668 2012-03-23 Eli Zaretskii <eliz@gnu.org>
14669
14670 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14671 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14672 when fetching a multibyte character consumes more bytes than
14673 CHAR_BYTES returns, due to unification of CJK characters in
14674 string_char. (Bug#11073)
14675
14676 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14677
14678 * process.c (wait_reading_process_output): Handle pty disconnect
14679 by refraining from sending oneself a SIGCHLD (bug#10933).
14680
14681 2012-03-22 Chong Yidong <cyd@gnu.org>
14682
14683 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14684
14685 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
14686 Mark string as coming from a prefix property.
14687 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14688 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14689
14690 2012-03-21 Chong Yidong <cyd@gnu.org>
14691
14692 * xfaces.c (Vface_remapping_alist): Doc fix.
14693
14694 2012-03-20 Eli Zaretskii <eliz@gnu.org>
14695
14696 * w32proc.c (Fw32_set_console_codepage)
14697 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14698 Doc fixes.
14699
14700 2012-03-20 Chong Yidong <cyd@gnu.org>
14701
14702 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14703 to reflect default non-nil value of redisplay-dont-pause.
14704
14705 2012-03-19 Kenichi Handa <handa@m17n.org>
14706
14707 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14708 it fit in a valid range (Bug#11003).
14709
14710 2012-03-18 Eli Zaretskii <eliz@gnu.org>
14711
14712 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14713 that is not from display property, accept the row as a "cursor
14714 row" if one of the string's character has a non-nil `cursor'
14715 property. Fixes cursor positioning when there are newlines in
14716 overlay strings, e.g. in icomplete.el. (Bug#11035)
14717
14718 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14719
14720 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14721
14722 2012-03-12 Chong Yidong <cyd@gnu.org>
14723
14724 * eval.c (inhibit_lisp_code): Rename from
14725 inhibit_window_configuration_change_hook; move from window.c.
14726
14727 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14728 * window.c (run_window_configuration_change_hook)
14729 (syms_of_window): Callers changed.
14730
14731 2012-03-11 Chong Yidong <cyd@gnu.org>
14732
14733 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14734
14735 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14736
14737 2012-03-10 Chong Yidong <cyd@gnu.org>
14738
14739 * frame.c (other_visible_frames): Don't assume the selected frame
14740 is visible (Bug#10955).
14741
14742 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14743
14744 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14745
14746 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14747
14748 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14749 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14750 zero (Bug#10954).
14751
14752 2012-03-03 Glenn Morris <rgm@gnu.org>
14753
14754 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
14755
14756 2012-03-02 Eli Zaretskii <eliz@gnu.org>
14757
14758 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14759 position past the first glyph_row that ends at ZV. (Bug#10902)
14760 (redisplay_window, next_element_from_string): Fix typos in
14761 comments.
14762 (redisplay_window): Pass to move_it_vertically the margin in
14763 pixels, not in screen lines.
14764
14765 2012-03-02 Glenn Morris <rgm@gnu.org>
14766
14767 * buffer.c (buffer-list-update-hook): Doc fix.
14768
14769 2012-02-29 Eli Zaretskii <eliz@gnu.org>
14770
14771 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14772 push_it before setting up the iterator for the first overlay
14773 string, even if we have an empty string loaded.
14774 (next_overlay_string): If there's an empty string on the iterator
14775 stack, pop the stack. (Bug#10903)
14776
14777 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14778
14779 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14780 Suggested by Stefan Monnier in
14781 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14782 * alloc.c (widen_to_Lisp_Object): New static function.
14783 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14784 and widening them to Lisp_Objects. This would work even if
14785 USE_LSB_TAG is defined and wide integers are used, which might
14786 happen in a future version of Emacs.
14787
14788 2012-02-25 Chong Yidong <cyd@gnu.org>
14789
14790 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14791 Doc fix.
14792
14793 * xselect.c (Fx_selection_exists_p): Doc fix.
14794 (x_clipboard_manager_save_all): Print an informative message
14795 before saving to clipboard manager.
14796
14797 2012-02-24 Chong Yidong <cyd@gnu.org>
14798
14799 * keyboard.c (process_special_events): Handle all X selection
14800 requests in kbd_buffer, not just the next one (Bug#8869).
14801
14802 2012-02-23 Chong Yidong <cyd@gnu.org>
14803
14804 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14805 call when setting menu-bar-lines and tool-bar-lines parameters.
14806 (unwind_create_frame_1): New helper function.
14807
14808 * window.c (inhibit_window_configuration_change_hook): New var.
14809 (run_window_configuration_change_hook): Obey it.
14810 (syms_of_window): Initialize it.
14811
14812 2012-02-22 Chong Yidong <cyd@gnu.org>
14813
14814 * xterm.c (x_draw_image_relief): Add missing type check for
14815 Vtool_bar_button_margin (Bug#10743).
14816
14817 2012-02-21 Chong Yidong <cyd@gnu.org>
14818
14819 * fileio.c (Vfile_name_handler_alist): Doc fix.
14820
14821 * buffer.c (Fget_file_buffer): Protect against invalid file
14822 handler return value.
14823
14824 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14825
14826 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14827 when computing $valmask.
14828
14829 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14830 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14831 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14832 It's useless in that case, and it can cause problems on hosts
14833 that allocate halves of EMACS_INT values separately.
14834 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14835 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14836 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14837 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14838 it avoids undefined behavior on hosts where shifting right by more
14839 than the word width has undefined behavior.
14840
14841 2012-02-19 Chong Yidong <cyd@gnu.org>
14842
14843 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14844 (Funhandled_file_name_directory, Ffile_name_as_directory)
14845 (Fdirectory_file_name, Fexpand_file_name)
14846 (Fsubstitute_in_file_name): Protect against invalid file handler
14847 return values (Bug#10845).
14848
14849 2012-02-18 Eli Zaretskii <eliz@gnu.org>
14850
14851 * .gdbinit (pitx): Fix incorrect references to fields of the
14852 iterator stack.
14853
14854 2012-02-17 Chong Yidong <cyd@gnu.org>
14855
14856 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14857
14858 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14859
14860 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14861 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14862
14863 2012-02-15 Chong Yidong <cyd@gnu.org>
14864
14865 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14866 marked as special. Also, starting docstrings with * is obsolete.
14867
14868 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14869
14870 * gnutls.c (emacs_gnutls_write): Fix last change.
14871
14872 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14873
14874 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14875 send_process.
14876
14877 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14878
14879 * keymap.c (Fsingle_key_description): Handle char ranges.
14880
14881 2012-02-12 Chong Yidong <cyd@gnu.org>
14882
14883 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14884 as that creates a dangerous corner case.
14885
14886 * window.c (Fdelete_window_internal): Invalidate the mouse
14887 highlight (Bug#9904).
14888
14889 2012-02-12 Glenn Morris <rgm@gnu.org>
14890
14891 * xselect.c (Fx_own_selection_internal)
14892 (Fx_get_selection_internal, Fx_disown_selection_internal)
14893 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14894 * nsselect.m (Fx_own_selection_internal)
14895 (Fx_disown_selection_internal, Fx_selection_exists_p)
14896 (Fx_selection_owner_p, Fx_get_selection_internal):
14897 Sync docs and argument specs with the xselect.c versions.
14898
14899 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14900
14901 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14902
14903 2012-02-11 Eli Zaretskii <eliz@gnu.org>
14904
14905 * w32select.c (Fx_selection_exists_p): Sync doc string and
14906 argument list with xselect.c. (Bug#10783)
14907
14908 * w16select.c (Fx_selection_exists_p): Sync doc string and
14909 argument list with xselect.c. (Bug#10783)
14910
14911 2012-02-10 Glenn Morris <rgm@gnu.org>
14912
14913 * fns.c (Fsecure_hash): Doc fix.
14914
14915 2012-02-09 Kenichi Handa <handa@m17n.org>
14916
14917 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14918
14919 2012-02-07 Chong Yidong <cyd@gnu.org>
14920
14921 * buffer.c (Fbuffer_local_variables)
14922 (buffer_lisp_local_variables): Handle unbound vars correctly;
14923 don't let Qunbound leak into Lisp.
14924
14925 2012-02-07 Glenn Morris <rgm@gnu.org>
14926
14927 * image.c (Fimagemagick_types): Doc fix.
14928
14929 * image.c (imagemagick-render-type): Change it from a lisp object
14930 to an integer. Move the doc here from the lisp manual.
14931 Treat all values not equal to 0 the same.
14932
14933 2012-02-06 Chong Yidong <cyd@gnu.org>
14934
14935 * doc.c (store_function_docstring): Avoid applying docstring of
14936 alias to base function (Bug#2603).
14937
14938 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14939
14940 * .gdbinit (pp1, pv1): Remove redundant defines.
14941 (pr): Use pp.
14942
14943 2012-02-04 Chong Yidong <cyd@gnu.org>
14944
14945 * nsterm.m: Declare a global (Bug#10694).
14946
14947 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14948
14949 * w32.c (get_emacs_configuration_options):
14950 Include --enable-checking, if specified, in the return value.
14951
14952 2012-02-04 Martin Rudalics <rudalics@gmx.at>
14953
14954 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14955 after rounding frame sizes. (Bug#9723)
14956
14957 2012-02-04 Eli Zaretskii <eliz@gnu.org>
14958
14959 * keyboard.c (adjust_point_for_property): Don't position point
14960 before BEGV. (Bug#10696)
14961
14962 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14963
14964 Handle overflow when computing char display width (Bug#9496).
14965 * character.c (char_width): Return EMACS_INT, not int.
14966 (char_width, c_string_width): Check for overflow when
14967 computing the width; this is possible now that individual
14968 characters can have unbounded width. Problem introduced
14969 by merge from Emacs 23 on 2012-01-19.
14970
14971 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
14972
14973 * dbusbind.c (Fdbus_register_method): Mention the return value
14974 :ignore in the docstring.
14975
14976 2012-02-02 Glenn Morris <rgm@gnu.org>
14977
14978 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14979
14980 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14981 Unconditionally set to t. (Bug#10673)
14982 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14983 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14984 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14985
14986 2012-02-02 Kenichi Handa <handa@m17n.org>
14987
14988 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14989 0, do not call append_composite_glyph.
14990
14991 2012-02-02 Kenichi Handa <handa@m17n.org>
14992
14993 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14994 NULL (Bug#6988).
14995 (x_produce_glyphs): If the component of a composition is a null
14996 string, set it->pixel_width to 1 to avoid zero-width glyph.
14997
14998 2012-02-01 Eli Zaretskii <eliz@gnu.org>
14999
15000 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
15001 first 2 arguments are identical. This makes inserting large
15002 output from a subprocess an order of magnitude faster on
15003 MS-Windows, where all sbrk'ed memory is always contiguous.
15004
15005 2012-01-31 Glenn Morris <rgm@gnu.org>
15006
15007 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
15008 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
15009 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
15010
15011 2012-01-29 Glenn Morris <rgm@gnu.org>
15012
15013 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
15014
15015 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
15016
15017 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
15018
15019 2012-01-28 Chong Yidong <cyd@gnu.org>
15020
15021 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
15022
15023 2012-01-26 Chong Yidong <cyd@gnu.org>
15024
15025 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
15026
15027 * search.c (Fsearch_forward, Fsearch_backward): Document negative
15028 repeat counts (Bug#10507).
15029
15030 2012-01-26 Glenn Morris <rgm@gnu.org>
15031
15032 * lread.c (syms_of_lread): Doc fix.
15033
15034 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
15035
15036 * coding.c (encode_designation_at_bol): Change return value to
15037 EMACS_INT.
15038
15039 2012-01-25 Chong Yidong <cyd@gnu.org>
15040
15041 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
15042
15043 2012-01-21 Chong Yidong <cyd@gnu.org>
15044
15045 * floatfns.c (Fcopysign): Make the second argument non-optional,
15046 since nil is not allowed anyway.
15047
15048 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
15049
15050 * process.c (read_process_output): Use p instead of XPROCESS (proc).
15051 (send_process): Likewise.
15052
15053 2012-01-19 Martin Rudalics <rudalics@gmx.at>
15054
15055 * window.c (save_window_save, Fcurrent_window_configuration)
15056 (Vwindow_persistent_parameters): Do not use Qstate.
15057 Rewrite doc-strings.
15058
15059 2012-01-19 Kenichi Handa <handa@m17n.org>
15060
15061 * character.c (char_width): New function.
15062 (Fchar_width, c_string_width, lisp_string_width):
15063 Use char_width (Bug#9496).
15064
15065 2012-01-16 Martin Rudalics <rudalics@gmx.at>
15066
15067 * window.c (Vwindow_persistent_parameters): New variable.
15068 (Fset_window_configuration, save_window_save): Handle persistent
15069 window parameters.
15070
15071 2012-01-14 Eli Zaretskii <eliz@gnu.org>
15072
15073 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
15074 thrashing the stack of the thread. (Bug#9087)
15075
15076 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
15077
15078 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
15079
15080 2012-01-11 Eli Zaretskii <eliz@gnu.org>
15081
15082 * xdisp.c (rows_from_pos_range): Handle the case where the
15083 highlight ends on a newline. (Bug#10464)
15084 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
15085 he end column for display of highlight that ends on a newline
15086 before a R2L line.
15087
15088 2012-01-11 Glenn Morris <rgm@gnu.org>
15089
15090 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
15091 from load-path also when installation-directory is nil. (Bug#10208)
15092
15093 2012-01-10 Glenn Morris <rgm@gnu.org>
15094
15095 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
15096
15097 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
15098 Update template values to be closer to their typical values these days.
15099
15100 2012-01-09 Eli Zaretskii <eliz@gnu.org>
15101
15102 * xdisp.c (rows_from_pos_range): Accept additional argument
15103 DISP_STRING, and accept any glyph in a row whose object is that
15104 string as eligible for mouse highlight. Fixes mouse highlight of
15105 display strings from overlays. (Bug#10464)
15106
15107 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
15108
15109 emacs: fix an auto-save permissions race condition (Bug#10400)
15110 * fileio.c (auto_saving_dir_umask): New static var.
15111 (Fmake_directory_internal): Use it.
15112 (do_auto_save_make_dir): Set it, instead of invoking chmod after
15113 creating the directory. The old code temporarily assigns
15114 too-generous permissions to the directory.
15115 (do_auto_save_eh): Clear it.
15116 (Fdo_auto_save): Catch all errors, not just file errors, so
15117 that the var is always cleared.
15118
15119 2012-01-07 Eli Zaretskii <eliz@gnu.org>
15120
15121 * search.c (scan_buffer): Pass character positions to
15122 know_region_cache, not byte positions. (Bug#6540)
15123
15124 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
15125
15126 * w32.c (sys_rename): Report EXDEV when rename of a directory
15127 fails because the target is on another logical disk. (Bug#10284)
15128
15129 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
15130
15131 * xterm.c (x_embed_request_focus): New function.
15132
15133 * xterm.h: Add prototype.
15134
15135 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
15136
15137 2012-01-05 Glenn Morris <rgm@gnu.org>
15138
15139 * emacs.c (emacs_copyright): Update short copyright year to 2012.
15140
15141 2012-01-01 Eli Zaretskii <eliz@gnu.org>
15142
15143 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
15144 Load gnutls_transport_set_lowat only if GnuTLS version is below
15145 2.11.1.
15146 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15147 GnuTLS versions below 2.11.1.
15148
15149 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15150
15151 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15152 to the doc string advising against its use for altering the way
15153 windows are scrolled.
15154
15155 2011-12-28 Kenichi Handa <handa@m17n.org>
15156
15157 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15158 coding-system ASCII compatible only when it does not produce BOM
15159 on encoding (Bug#10383).
15160
15161 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15162
15163 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15164 can scroll.
15165 (create_and_show_popup_menu): Always use menu_position_func for
15166 Gtk3 (Bug#10361).
15167
15168 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15169
15170 * callint.c (Fcall_interactively): Don't truncate prompt string.
15171
15172 2011-12-23 Eli Zaretskii <eliz@gnu.org>
15173
15174 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15175 property that ends at ZV, so that the bidi iteration could be
15176 resumed from there (after widening). (Bug#10360)
15177
15178 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15179
15180 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15181
15182 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15183
15184 * nsterm.m (x_free_frame_resources):
15185 Release f->output_data.ns->miniimage.
15186 (ns_index_color): Fix indentation. Do not retain
15187 color_table->colors[i].
15188
15189 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15190 before returning.
15191
15192 * nsfns.m (x_set_background_color): Assign return value from
15193 ns_index_color to face-background instead of NSColor*.
15194 (ns_implicitly_set_icon_type): Fix indentation.
15195 Change assignment in for loop to comparison.
15196
15197 * emacs.c (ns_pool): New variable.
15198 (main): Assign ns_pool.
15199 (Fkill_emacs): Call ns_release_autorelease_pool.
15200
15201 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15202 autorelease fdesc, release fdAttrs and tdict.
15203 (ns_get_covering_families): Release charset.
15204 (ns_findfonts): Release NSFontDescriptor created with new.
15205 (ns_uni_to_glyphs): Fix indentation.
15206 (setString): Release attrStr before assigning new value.
15207
15208 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15209
15210 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15211 and NS_IMPL_COCOA.
15212 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15213 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15214
15215 2011-12-18 David Reitter <reitter@cmu.edu>
15216
15217 * nsterm.m (ns_term_init): Subscribe for notifications
15218 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15219 to method trackingNotification in EmacsMenu.
15220
15221 * nsmenu.m (trackingMenu): New variable.
15222 (trackingNotification): New method (from Aquamacs).
15223 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
15224 from Aquamacs (Bug#7030).
15225
15226 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15227
15228 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15229 (symbol_to_nsstring): Fix indentation.
15230 (ns_symbol_to_pb): New function.
15231 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15232 (Fns_rotate_cut_buffers_internal): Remove.
15233 (Fns_store_selection_internal): Rename from
15234 Fns_store_cut_buffer_internal.
15235 (ns_get_foreign_selection, Fx_own_selection_internal)
15236 (Fx_disown_selection_internal, Fx_selection_exists_p)
15237 (Fns_get_selection_internal, Fns_store_selection_internal):
15238 Use ns_symbol_to_pb and check if return value is nil.
15239 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15240 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
15241 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15242 renamed to Sns_store_selection_internal.
15243 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15244 and remove this function.
15245 (ns_handle_selection_clear): Remove, never used.
15246 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15247 here.
15248
15249 2011-12-17 Ken Brown <kbrown@cornell.edu>
15250
15251 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15252 GID is unknown (Bug#10257).
15253
15254 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15255
15256 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15257 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15258 which caused a build failure on GNU/Linux IA-64. This problem was
15259 introduced by my 2011-10-07 patch.
15260
15261 2011-12-15 Juri Linkov <juri@jurta.org>
15262
15263 * image.c (imagemagick_error): New function. (Bug#10112)
15264 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15265 Use `imagemagick_error' where ImageMagick functions return
15266 `MagickFalse'.
15267 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15268 proper order.
15269
15270 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15271
15272 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15273 fill background (Bug#8992).
15274
15275 2011-12-13 Martin Rudalics <rudalics@gmx.at>
15276
15277 * window.c (Vwindow_combination_resize)
15278 (Vwindow_combination_limit): Use t instead of non-nil in
15279 doc-strings.
15280 (Vrecenter_redisplay): Add first sentence of doc-string on
15281 separate line.
15282 (Frecenter): Fix doc-string typo.
15283
15284 2011-12-11 Kenichi Handa <handa@m17n.org>
15285
15286 * coding.c (Funencodable_char_position): Pay attention to the
15287 buffer text relocation (Bug#9389).
15288
15289 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15290
15291 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15292 gtk_init (Bug#10100).
15293
15294 2011-12-10 Eli Zaretskii <eliz@gnu.org>
15295
15296 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15297 IT->string is nil. (Bug#10263)
15298
15299 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15300
15301 * nsterm.h (x_free_frame_resources): Declare.
15302
15303 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15304 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15305
15306 * nsterm.h (ns_get_defaults_value): Declare.
15307
15308 * nsterm.m (ns_default): Call ns_get_defaults_value.
15309
15310 2011-12-09 Eli Zaretskii <eliz@gnu.org>
15311
15312 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15313 (Bug#10170)
15314
15315 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15316
15317 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15318 that where the value of an _OBJC_* symbol points to is in the .bss
15319 section (Bug#10240).
15320
15321 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15322
15323 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
15324 after the loop to call ccl_driver at least once (Bug#8619).
15325
15326 2011-12-08 Kenichi Handa <handa@m17n.org>
15327
15328 * ftfont.c (get_adstyle_property): Fix previous change
15329 (Bug#10233).
15330
15331 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
15332
15333 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15334 dirs from the default value of EMACSLOADPATH (bug#10208).
15335
15336 2011-12-07 Glenn Morris <rgm@gnu.org>
15337
15338 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15339 installation and source directories as well. (Bug#10208)
15340
15341 2011-12-06 Chong Yidong <cyd@gnu.org>
15342
15343 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15344
15345 2011-12-06 Glenn Morris <rgm@gnu.org>
15346
15347 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15348 as an error, not just -1. (Bug#10217)
15349
15350 2011-12-05 Chong Yidong <cyd@gnu.org>
15351
15352 * keyboard.c (process_special_events): New function.
15353 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15354
15355 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15356
15357 * coding.c (encode_designation_at_bol): Don't use uninitialized
15358 local variable (Bug#9318).
15359
15360 2011-12-05 Kenichi Handa <handa@m17n.org>
15361
15362 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15363 return Qnil (Bug#8046, Bug#10193).
15364
15365 2011-12-05 Kenichi Handa <handa@m17n.org>
15366
15367 * coding.c (encode_designation_at_bol): New args charbuf_end and
15368 dst. Return the number of produced bytes. Callers changed.
15369 (coding_set_source): Return how many bytes coding->source was
15370 relocated.
15371 (coding_set_destination): Return how many bytes
15372 coding->destination was relocated.
15373 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
15374 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
15375
15376 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15377
15378 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15379 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15380 macro (Bug#9318).
15381
15382 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15383
15384 The following changes are to fix Bug#9318.
15385
15386 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
15387 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15388 (encode_coding_iso_2022, encode_coding_sjis)
15389 (encode_coding_big5, encode_coding_charset): Use the above macros.
15390
15391 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
15392
15393 * lisp.h (process_quit_flag): Fix external declaration.
15394
15395 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15396
15397 Don't macro-inline non-performance-critical code.
15398 * eval.c (process_quit_flag): New function.
15399 * lisp.h (QUIT): Use it.
15400
15401 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15402
15403 * nsfns.m (get_geometry_from_preferences): New function.
15404 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15405
15406 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15407
15408 * emacs.c (Qkill_emacs): Define.
15409 (syms_of_emacs): Initialize it.
15410 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15411 Qquit_flag to `kill-emacs' instead.
15412 (quit_throw_to_read_char): Add parameter `from_signal'.
15413 All callers changed. Call Fkill_emacs if requested and safe.
15414 * lisp.h (QUIT): Call Fkill_emacs if requested.
15415
15416 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15417
15418 * widget.c (update_wm_hints): Return if wmshell is null.
15419 (widget_update_wm_size_hints): New function.
15420
15421 * widget.h (widget_update_wm_size_hints): Declare.
15422
15423 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15424 widget_update_wm_size_hints (Bug#10104).
15425
15426 2011-12-03 Eli Zaretskii <eliz@gnu.org>
15427
15428 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15429 before a newline, prepare the bidi iterator for consuming the
15430 newline, and keep the current paragraph direction. (Bug#10183)
15431 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
15432
15433 2011-12-02 Juri Linkov <juri@jurta.org>
15434
15435 * search.c (Fword_search_regexp): New Lisp function created from
15436 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15437 (Fword_search_backward, Fword_search_forward)
15438 (Fword_search_backward_lax, Fword_search_forward_lax):
15439 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15440 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15441
15442 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15443
15444 * fileio.c (Finsert_file_contents): Move after-change-function call
15445 to before the "handled:" label, since all "goto handled" appear in
15446 cases where the *-change-functions have already been properly called
15447 (bug#10117).
15448
15449 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15450
15451 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15452 waiting for input. (Bug#10169)
15453
15454 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15455
15456 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15457 verifies glyph row's hash code--we have just reallocated the
15458 glyphs, so their contents can be complete garbage. (Bug#10164)
15459
15460 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
15461
15462 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15463
15464 2011-11-30 Eli Zaretskii <eliz@gnu.org>
15465
15466 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15467 attributes are tested _before_ calling verify_row_hash, to protect
15468 against GCC re-ordering of the tests. (Bug#10164)
15469
15470 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15471
15472 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15473
15474 * xterm.c (handle_one_xevent): Only set async_visible and friends
15475 if net_wm_state_hidden_seen is non-zero (Bug#10002)
15476 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
15477 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15478
15479 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15480
15481 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15482 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15483 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15484 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15485 All uses changed to use GCPRO1 etc.
15486 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15487 Revert to old implementation (i.e., before 2011-03-11).
15488
15489 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15490
15491 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15492 of scroll runs so as to avoid assigning disabled bogus rows and
15493 unnecessary graphics copy operations.
15494
15495 2011-11-27 Eli Zaretskii <eliz@gnu.org>
15496
15497 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15498 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15499 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15500 (malloc, free, realloc, calloc): Redirect to e_* only when
15501 compiling Emacs.
15502
15503 * lisp.h (GCTYPEBITS): Move before first use.
15504 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15505 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15506 this macro definition.
15507
15508 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15509 _MSC_VER.
15510
15511 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15512
15513 * gtkutil.c (xg_create_frame_widgets):
15514 Call gtk_window_set_has_resize_grip (FALSE) if that function is
15515 present with Gtk+ 2.0.
15516
15517 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15518
15519 * fileio.c (Finsert_file_contents): Undo previous change; see
15520 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15521
15522 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15523
15524 Rename locals to avoid shadowing.
15525 * fileio.c (Finsert_file_contents):
15526 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15527 * process.c (wait_reading_process_output):
15528 Rename inner 'proc' to 'p' to avoid shadowing.
15529 Indent for consistency with usual Emacs style.
15530
15531 2011-11-25 Eli Zaretskii <eliz@gnu.org>
15532
15533 * xdisp.c (redisplay_window): If cursor row is not fully visible
15534 after recentering, and scroll-conservatively is set to a large
15535 number, scroll window by a few more lines to make the cursor fully
15536 visible and out of scroll-margin. (Bug#10105)
15537 (start_display): Don't move to the next line if the display should
15538 start at a newline that is part of a display vector or an overlay
15539 string. (Bug#10119)
15540
15541 2011-11-24 Juri Linkov <juri@jurta.org>
15542
15543 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15544 after the `MagickPingImage' call. (Bug#10112)
15545
15546 2011-11-23 Chong Yidong <cyd@gnu.org>
15547
15548 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15549
15550 2011-11-23 Martin Rudalics <rudalics@gmx.at>
15551
15552 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15553 making another buffer current. (Bug#10114)
15554
15555 2011-11-23 Glenn Morris <rgm@gnu.org>
15556
15557 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15558
15559 2011-11-23 Chong Yidong <cyd@gnu.org>
15560
15561 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15562 using it (Bug#5984).
15563
15564 2011-11-22 Eli Zaretskii <eliz@gnu.org>
15565
15566 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15567 and header-lines, as they don't have one computed for them.
15568 (Bug#10098)
15569
15570 * .gdbinit (prow): Make displayed values more self-explaining.
15571 Add row's hash code.
15572
15573 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15574
15575 * process.c (wait_reading_process_output): Fix asynchrounous
15576 GnuTLS socket handling on some versions of the GnuTLS library.
15577 (wait_reading_process_output): Add comment and URL.
15578
15579 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15580
15581 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15582
15583 2011-11-21 Chong Yidong <cyd@gnu.org>
15584
15585 * window.c (Fnext_window, Fprevious_window): Doc fix.
15586
15587 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15588
15589 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15590
15591 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15592
15593 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15594
15595 2011-11-20 Martin Rudalics <rudalics@gmx.at>
15596
15597 * window.c (Fset_window_combination_limit): Rename argument
15598 STATUS to LIMIT.
15599 (Vwindow_combination_limit): Remove "status" from doc-string.
15600
15601 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15602
15603 * m/ibms390.h: Remove.
15604 * m/ibms390x.h: Don't include "ibms390.h".
15605
15606 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15607
15608 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15609 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15610
15611 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
15612
15613 * casetab.c (Fset_case_table):
15614 * charset.c (Fcharset_after): Fix typos.
15615
15616 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
15617
15618 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15619 Otherwise, valgrind does not work on some platforms.
15620 Problem reported by Andreas Schwab in
15621 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15622 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15623 is set, removing the need for VIRT_ADDRESS_VARIES.
15624 (PURE_P): Use a more-efficient implementation that needs just one
15625 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15626 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15627 to 4 (xorl, subq, cmpq, setbe).
15628 * alloc.c (pure): Always extern now, since that's the
15629 VIRT_ADDR_VARIES behavior.
15630 (PURE_POINTER_P): Use a single comparison, not two, for
15631 consistency with the new puresize.h.
15632 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15633 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15634 Remove VIRT_ADDR_VARIES no longer needed.
15635
15636 2011-11-19 Eli Zaretskii <eliz@gnu.org>
15637
15638 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15639 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15640 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15641 behave as if the cursor position were at the window margin.
15642
15643 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15644 and the cursor position is out of bounds, behave as if the cursor
15645 position were at the window margin. (Bug#10075)
15646
15647 2011-11-18 Chong Yidong <cyd@gnu.org>
15648
15649 * window.c (Fwindow_combination_limit): Make first argument
15650 non-optional, since it is meaningless for live windows like the
15651 selected window.
15652
15653 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15654
15655 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15656
15657 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15658
15659 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15660 (graft_intervals_into_buffer): Simplify.
15661
15662 2011-11-18 Eli Zaretskii <eliz@gnu.org>
15663
15664 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15665 hash values of the two rows.
15666 (copy_row_except_pointers): Preserve the used[] arrays and the
15667 hash values of the two rows. (Bug#10035)
15668 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
15669
15670 * xdisp.c (row_hash): New function, body extracted from
15671 compute_line_metrics.
15672 (compute_line_metrics): Call row_hash, instead of computing the
15673 hash code inline.
15674
15675 * dispnew.c (verify_row_hash): Call row_hash for computing the
15676 hash code of a row, instead of duplicating code from xdisp.c.
15677
15678 * dispextern.h (row_hash): Add prototype.
15679
15680 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15681
15682 * frame.c (delete_frame): Don't delete the terminal when the last
15683 X frame is closed if emacs is built with GTK toolkit.
15684
15685 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
15686
15687 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15688
15689 2011-11-17 Martin Rudalics <rudalics@gmx.at>
15690
15691 * window.c (Vwindow_splits): Rename to
15692 Vwindow_combination_resize. Suggested by Juri Linkov.
15693 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15694 of Vwindow_splits.
15695
15696 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
15697
15698 * nsfns.m (Fns_font_name):
15699 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
15700
15701 2011-11-16 Martin Rudalics <rudalics@gmx.at>
15702
15703 * window.h (window): Rename slot "nest" to "combination_limit".
15704 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15705 (Fset_window_nest): Rename to Fset_window_combination_limit.
15706 (Vwindow_nest): Rename to Vwindow_combination_limit.
15707 (recombine_windows, make_parent_window, make_window)
15708 (Fsplit_window_internal, saved_window)
15709 (Fset_window_configuration, save_window_save): Rename all
15710 occurrences of window_nest to window_combination_limit.
15711
15712 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
15713
15714 * image.c (imagemagick_load_image): Fix typo.
15715
15716 2011-11-14 Eli Zaretskii <eliz@gnu.org>
15717
15718 * xdisp.c (display_line): Move the call to
15719 highlight_trailing_whitespace before the call to
15720 compute_line_metrics, since the latter needs to see the final
15721 faces of all the glyphs to compute ROW's hash value.
15722 Fixes assertion violations in row_equal_p. (Bug#10035)
15723
15724 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
15725
15726 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15727 just return (bug#10044).
15728
15729 2011-11-12 Eli Zaretskii <eliz@gnu.org>
15730
15731 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15732 with user-defined heap size. Bump the default size of the temacs
15733 heap to 27MB, to avoid memory warning when running temacs.
15734 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15735
15736 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15737 current_matrix and desired_matrix. (Bug#9990)
15738 (verify_row_hash) [XASSERTS]: New function.
15739 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15740 that the hash value of glyph rows is correct.
15741
15742 2011-11-12 Martin Rudalics <rudalics@gmx.at>
15743
15744 * window.h (window): Remove splits slot.
15745 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15746 (Fdelete_other_windows_internal, make_parent_window)
15747 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15748 (Fset_window_configuration, save_window_save): Don't deal with
15749 split status of windows.
15750 (saved_window): Remove splits slot.
15751 (Vwindow_splits): Rewrite doc-string.
15752
15753 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15754
15755 * xfns.c (unwind_create_frame):
15756 * nsfns.m (unwind_create_frame):
15757 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15758 Vframe_list (Bug#9999).
15759
15760 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15761
15762 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
15763
15764 2011-11-11 Kenichi Handa <handa@m17n.org>
15765
15766 * callproc.c (Fcall_process): Set the member dst_multibyte of
15767 process_coding.
15768
15769 2011-11-11 Johan Bockgård <bojohan@gnu.org>
15770
15771 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15772 avoid a crash (bug#9496).
15773
15774 2011-11-09 Chong Yidong <cyd@gnu.org>
15775
15776 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15777 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15778
15779 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15780
15781 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15782
15783 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15784
15785 Avoid some portability problems by eschewing 'extern inline' functions.
15786 The trivial performance wins aren't worth the portability hassles; see
15787 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15788 et seq.
15789 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15790 (window_box_width, window_box_left, window_box_left_offset)
15791 (window_box_right, window_box_right_offset): Undo previous change,
15792 by removing the "extern"s.
15793 * intervals.c (adjust_intervals_for_insertion)
15794 (adjust_intervals_for_deletion): Undo previous change,
15795 making these static again.
15796 (offset_intervals, temp_set_point_both, temp_set_point)
15797 (copy_intervals_to_string): No longer inline.
15798 * xdisp.c (window_text_bottom_y, window_box_width)
15799 (window_box_height, window_box_left_offset)
15800 (window_box_right_offset, window_box_left, window_box_right)
15801 (window_box): No longer inline.
15802
15803 2011-11-08 Chong Yidong <cyd@gnu.org>
15804
15805 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
15806 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15807 Signal an error if not a live window.
15808 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15809 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15810
15811 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
15812
15813 * lisp.h (syms_of_abbrev): Remove declaration.
15814 Reported by CHENG Gao <chenggao@royau.me>.
15815
15816 2011-11-07 Eli Zaretskii <eliz@gnu.org>
15817
15818 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15819 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15820 of temacs in GUI mode.
15821
15822 2011-11-07 Martin Rudalics <rudalics@gmx.at>
15823
15824 * window.h: Declare delete_all_child_windows instead of
15825 delete_all_subwindows.
15826 * window.c (Fwindow_nest, Fset_window_nest)
15827 (Fset_window_new_total, Fset_window_new_normal)
15828 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15829 (delete_all_subwindows): Rename to delete_all_child_windows.
15830 (Fdelete_other_windows_internal, Fset_window_configuration):
15831 Call delete_all_child_windows instead of delete_all_subwindows.
15832 * frame.c (delete_frame): Call delete_all_child_windows instead
15833 of delete_all_subwindows.
15834
15835 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15836
15837 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15838 This is also needed for porting to any host where GC_MARK_STACK is
15839 not GC_MAKE_GCPROS_NOOPS.
15840 (which_symbols): Use it.
15841
15842 2011-11-07 Kenichi Handa <handa@m17n.org>
15843
15844 * coding.c (coding_set_destination): Check coding->src_pos only
15845 when coding->src_object is a buffer (bug#9910).
15846
15847 * process.c (send_process): Set the member src_multibyte of coding
15848 to 0 (bug#9911) when sending a unibyte text.
15849
15850 * callproc.c (Fcall_process): Set the member src_multibyte of
15851 process_coding to 0 (bug#9912).
15852
15853 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15854
15855 * xmenu.c (cleanup_widget_value_tree): New function.
15856 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15857 calling free_menubar_widget_value_tree directly (Bug#9830).
15858
15859 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15860
15861 Fix some portability problems with 'inline'.
15862 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15863 (window_box_width, window_box_left, window_box_left_offset)
15864 (window_box_right, window_box_right_offset): Declare extern.
15865 Otherwise, these inline functions do not conform to C99 and
15866 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15867 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15868 * intervals.c (adjust_intervals_for_insertion)
15869 (adjust_intervals_for_deletion): Now extern, because otherwise the
15870 extern inline functions 'offset_intervals' couldn't refer to it.
15871 (static_offset_intervals): Remove.
15872 (offset_intervals): Rewrite using the old contents of
15873 static_offset_intervals. The old version didn't conform to C99
15874 because an extern inline function contained a reference to an
15875 identifier with static linkage.
15876
15877 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15878
15879 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15880 GC.
15881
15882 2011-11-06 Eli Zaretskii <eliz@gnu.org>
15883
15884 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15885 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15886 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15887 return Qleft_to_right.
15888
15889 2011-11-06 Chong Yidong <cyd@gnu.org>
15890
15891 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15892 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15893 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15894 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15895 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15896 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15897 (Fwindow_vscroll): Doc fix.
15898 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15899 argument, since it makes no sense to pass a live window and for
15900 consistency with window-child.
15901
15902 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15903
15904 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15905 support MSVC.
15906
15907 2011-11-05 Jason Rumney <jasonr@gnu.org>
15908
15909 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15910 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15911 fonts (Bug#6029).
15912 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15913 bitwise arithmetic preventing use of unicode-sip and non-truetype
15914 opentype fonts.
15915
15916 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15917
15918 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15919 "emacs"-only part.
15920
15921 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15922 initialization code to keep similarity to xfns.c after changes
15923 from 2011-11-05.
15924
15925 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15926
15927 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15928 (unwind_create_frame): New function (Bug#9943).
15929 (Fx_create_frame): Restructure code to be more similar to the one in
15930 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15931 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15932 Move terminal->reference_count++ just before making the frame official
15933 (Bug#9943).
15934
15935 * nsterm.m (x_free_frame_resources): New function.
15936 (x_destroy_window): Move code to x_free_frame_resources.
15937
15938 * xfns.c (unwind_create_frame): Fix comment.
15939 (Fx_create_frame, x_create_tip_frame):
15940 Move terminal->reference_count++ just before making the frame
15941 official. Move initialization of image_cache_refcount and
15942 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15943
15944 2011-11-05 Eli Zaretskii <eliz@gnu.org>
15945
15946 Support MSVC build with newer versions of Visual Studio.
15947 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15948 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15949 nt/gmake.defs.
15950
15951 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15952 which are not supported by MSVC.
15953 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15954 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15955 bitfields.
15956 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15957 types in bitfields.
15958 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15959
15960 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15961
15962 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
15963
15964 Support MSVC build with newer versions of Visual Studio.
15965 * w32.c: Don't include w32api.h for MSVC.
15966 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15967
15968 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15969 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15970 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15971 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15972 e_* cousins.
15973 (alloca) [_MSC_VER]: Define to _alloca.
15974
15975 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15976
15977 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15978
15979 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15980
15981 * xdisp.c (note_mouse_highlight): If either of
15982 previous/next-single-property-change returns nil, treat that as
15983 the beginning or the end of the buffer. (Bug#9955)
15984
15985 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15986
15987 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
15988 label is not null (Bug#9951).
15989 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15990 may be NULL.
15991
15992 2011-11-04 Eli Zaretskii <eliz@gnu.org>
15993
15994 * window.c (Fwindow_body_size): Mention in the doc string that the
15995 return value is in frame's canonical units. (Bug#9949)
15996
15997 2011-11-03 Eli Zaretskii <eliz@gnu.org>
15998
15999 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
16000
16001 * w32fns.c (unwind_create_frame): If needed, free the glyph
16002 matrices of the partially constructed frame. (Bug#9943)
16003 * xfns.c (unwind_create_frame): Likewise.
16004
16005 2011-11-01 Eli Zaretskii <eliz@gnu.org>
16006
16007 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
16008 Don't stop backward scan on the continuation glyph, even though
16009 its CHARPOS is positive.
16010 (mouse_face_from_buffer_pos, note_mouse_highlight):
16011 Rename cover_string to disp_string.
16012
16013 2011-11-01 Martin Rudalics <rudalics@gmx.at>
16014
16015 * window.c (temp_output_buffer_show): Don't use
16016 Vtemp_buffer_show_specifiers.
16017 (Vtemp_buffer_show_specifiers): Remove unused variable.
16018
16019 2011-10-30 Eli Zaretskii <eliz@gnu.org>
16020
16021 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
16022 past the beginning of the current glyph matrix.
16023
16024 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
16025
16026 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
16027 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
16028 HAVE_GTK3 (Bug#9869).
16029
16030 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
16031 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
16032
16033 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
16034
16035 * xterm.c: Declare x_handle_net_wm_state to return int.
16036 (handle_one_xevent): Check if we are iconified but don't have
16037 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
16038 (get_current_wm_state): Return non-zero if not hidden,
16039 check for _NET_WM_STATE_HIDDEN (Bug#9893).
16040 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
16041 (x_handle_net_wm_state): Return what get_current_wm_state returns.
16042 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
16043
16044 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
16045
16046 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
16047 so that this new function doesn't get optimized away by a
16048 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
16049
16050 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16051
16052 * frame.h (MOUSE_HL_INFO): Remove excess parens.
16053
16054 2011-10-29 Eli Zaretskii <eliz@gnu.org>
16055
16056 Fix the `xbytecode' command.
16057 * .gdbinit (xprintbytestr): New command.
16058 (xwhichsymbols): Rename from `which'; all callers changed.
16059 (xbytecode): Print the byte-code string as well.
16060
16061 2011-10-29 Kim Storm <storm@cua.dk>
16062
16063 * alloc.c (which_symbols): New function.
16064
16065 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
16066
16067 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
16068 line. (Bug#9903)
16069
16070 2011-10-29 Glenn Morris <rgm@gnu.org>
16071
16072 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
16073 Not clear what it was for, and it causes various bugs. (Bug#9839)
16074
16075 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16076
16077 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
16078 possible random value that matches one of those tested as
16079 condition to clear the mouse face.
16080
16081 2011-10-28 Chong Yidong <cyd@gnu.org>
16082
16083 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
16084
16085 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
16086
16087 * window.c (make_window): Initialize phys_cursor_on_p.
16088
16089 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
16090
16091 * lisp.h (struct Lisp_Symbol): Update comments.
16092
16093 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
16094
16095 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
16096
16097 2011-10-28 Eli Zaretskii <eliz@gnu.org>
16098
16099 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
16100 <oslsachem@gmail.com> for helping to debug this.
16101
16102 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
16103 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
16104 (g_b_init_get_glyph_outline_w): New static variables.
16105 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
16106 (GetGlyphOutlineW_Proc): New typedefs.
16107 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
16108 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
16109 New functions.
16110 (w32font_open_internal, compute_metrics):
16111 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
16112 instead of calling the "wide" APIs directly.
16113
16114 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
16115
16116 * w32.h (syms_of_w32font): Add prototype.
16117
16118 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16119
16120 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
16121 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
16122 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
16123 (Fmove_to_window_line): Doc fix.
16124
16125 2011-10-27 Chong Yidong <cyd@gnu.org>
16126
16127 * process.c (make_process): Set gnutls_state to NULL.
16128
16129 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
16130 non-NULL, regardless of GNUTLS_INITSTAGE.
16131 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
16132 an error. Set process slots as soon as we allocate them.
16133
16134 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
16135
16136 2011-10-27 Chong Yidong <cyd@gnu.org>
16137
16138 * gnutls.c (emacs_gnutls_deinit): New function.
16139 Deallocate credentials structures as well as calling gnutls_deinit.
16140 (Fgnutls_deinit, Fgnutls_boot): Use it.
16141
16142 * process.c (make_process): Initialize GnuTLS credentials to NULL.
16143 (deactivate_process): Call emacs_gnutls_deinit.
16144
16145 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
16146
16147 * image.c (x_create_x_image_and_pixmap):
16148 * w32.c (sys_rename, w32_delayed_load):
16149 * w32font.c (fill_in_logfont):
16150 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16151
16152 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
16153
16154 * w32fns.c (w32_default_color_map): New function,
16155 extracted from Fw32_default_color_map.
16156 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
16157
16158 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16159
16160 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16161
16162 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16163
16164 * keyboard.c (test_undefined): New function (bug#9751).
16165 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16166
16167 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16168
16169 * sysdep.c (init_sys_modes): Fix the check for the controlling
16170 terminal (Bug#6649).
16171
16172 2011-10-20 Eli Zaretskii <eliz@gnu.org>
16173
16174 * dispextern.h (struct bidi_it): New member next_en_type.
16175
16176 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16177 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16178 current character, check also for next_en_type being WEAK_EN.
16179 (bidi_resolve_weak): Don't enter the expensive loop if the current
16180 position is before next_en_pos. Record the bidi type of the first
16181 non-ET, non-BN character we find, in addition to its position.
16182 (bidi_level_of_next_char): Invalidate next_en_type when
16183 next_en_pos is over-stepped.
16184
16185 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16186
16187 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16188 * editfns.c: Rewrite current-time-zone so that it invokes
16189 the equivalent of (format-time-string "%Z") to get the time zone name.
16190 This fixes a bug when the time zone name contains characters that
16191 need converting from the system time locale to Emacs internal format.
16192 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16193 that patch fixed format-time-string to do the conversion, but
16194 I forgot to fix current-time-zone.
16195 (format_time_string): New function, containing most of
16196 what Fformat_time_string used to contain.
16197 (Fformat_time_string): Rewrite in terms of format_time_string.
16198 This doesn't change this function's behavior.
16199 (current-time-zone): Rewrite to use format_time_string.
16200 This fixes the bug reported by Michael Schierl in
16201 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16202 Jason Rumney's 2007-06-07 change worked around this bug, but
16203 didn't fix it.
16204 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16205
16206 2011-10-19 Eli Zaretskii <eliz@gnu.org>
16207
16208 * xdisp.c (start_display): If the character at POS is displayed
16209 via a display vector, reset IT->current.dpvec_index to zero.
16210 (try_window_reusing_current_matrix): If a line ends in a display
16211 vector or the next line starts in a display vector, continue
16212 redrawing the window even though the character position of
16213 start_row was reached.
16214 (Bug#9771, part 2)
16215
16216 2011-10-18 Chong Yidong <cyd@gnu.org>
16217
16218 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16219 with nobreak-char-display too.
16220
16221 2011-10-18 Eli Zaretskii <eliz@gnu.org>
16222
16223 Fix part 3 of bug#9771.
16224 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16225 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16226 non-neutral characters if the current character is a paragraph
16227 separator (a.k.a. Newline). This avoids running the same
16228 expensive loop twice, once when we consume the preceding newline
16229 and the other time when the line actually needs to be displayed.
16230 Avoid the loop when we see neutrals on the base embedding level
16231 following a character whose directionality is the same as the
16232 paragraph's. This avoids running the expensive loop when a line
16233 ends in a long sequence of neutrals, like control characters.
16234 Add assertion against STRONG_AL type. Slightly rearrange code
16235 that determines the type of a neutral given the first non-neutral
16236 that follows it.
16237 (bidi_level_of_next_char): Set next_en_pos to zero when
16238 invalidating its info.
16239
16240 2011-10-17 Eli Zaretskii <eliz@gnu.org>
16241
16242 * xdisp.c (push_display_prop): Determine whether to record string
16243 or buffer position by IT->string, not by IT->method. Allow
16244 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
16245 (move_it_vertically_backward): Don't look for character position
16246 immediately after the newline when in a continuation line.
16247 (Bug#9771, part 1)
16248
16249 2011-10-15 Martin Rudalics <rudalics@gmx.at>
16250
16251 * window.c (coordinates_in_window): Rewrite and delabelize
16252 vertical border check. (Bug#5357) (Bug#9618)
16253
16254 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16255
16256 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16257 errors in XSetWindowBorder (bug#9310).
16258
16259 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16260
16261 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16262 avoid crash when xmalloc overrun checking is enabled.
16263
16264 2011-10-13 Eli Zaretskii <eliz@gnu.org>
16265
16266 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16267 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16268 cursor motion with <left> and <right> arrow keys.
16269
16270 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16271 some callers set that themselves.
16272
16273 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16274
16275 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16276 display string and the previous row comes from the same string and
16277 is empty. (Bug#9739) (Bug#9738)
16278
16279 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16280
16281 * doc.c (get_doc_string): Encode file name (bug#9735).
16282
16283 2011-10-12 Eli Zaretskii <eliz@gnu.org>
16284
16285 * bidi.c (bidi_level_of_next_char):
16286 * xdisp.c (get_visually_first_element): Remove old incorrect
16287 comments regarding the Unicode Line Separator character.
16288
16289 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16290
16291 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16292
16293 * alloc.c (Fgc_status): Do not access beyond zombies array
16294 boundary if nzombies > MAX_ZOMBIES.
16295 * alloc.c (dump_zombies): Add missing format specifier.
16296
16297 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16298
16299 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16300 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16301
16302 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16303 Some packages use them to denote characters with modifiers.
16304
16305 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16306
16307 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16308 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16309 matching a pp-number. Rename parameter var to var1.
16310
16311 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16312
16313 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16314
16315 2011-10-08 Glenn Morris <rgm@gnu.org>
16316
16317 * callint.c (Fcall_interactively): Give a more explicit error for the
16318 'c' case with a non-character input. (Bug#8479)
16319
16320 2011-10-08 Eli Zaretskii <eliz@gnu.org>
16321
16322 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16323 lines.
16324 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16325 lines that are hscrolled on the left.
16326
16327 * dispnew.c (buffer_posn_from_coords): Account for a possible
16328 presence of header-line. (Bug#4426)
16329
16330 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16331
16332 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16333 Don't advertise functionality which we discourage or doesn't work.
16334
16335 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16336
16337 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16338 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16339 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16340 this makes Emacs dump core during garbage collection on rare
16341 occasions. sizeof is obviously inferior to offsetof here, so
16342 stick with offsetof.
16343 (GC_POINTER_ALIGNMENT): New macro.
16344 (mark_memory): Omit 3rd (offset) arg; caller changed.
16345 Don't assume EMACS_INT alignment is the same as pointer alignment.
16346
16347 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16348
16349 * keyboard.c (read_key_sequence_remapped): New var.
16350 (read_key_sequence): Compute remapping in the right buffer.
16351 (command_loop_1): Use read_key_sequence's remapping directly.
16352
16353 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16354
16355 * dired.c (file_name_completion): Don't expand file name.
16356 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16357 before checking file name handler.
16358
16359 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16360 they've been requested explicitly (bug#9591).
16361
16362 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
16363
16364 * keymap.c (Fsingle_key_description): Use make_specified_string
16365 instead of build_string to build string from push_key_description.
16366 (Bug#5193)
16367
16368 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16369
16370 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16371 This fixes a Y2038 bug on 64-bit hosts.
16372 * buffer.c (reset_buffer):
16373 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16374 (Fclear_buffer_auto_save_failure):
16375 Use 0, not -1, to represent an unset failure time, since time_t
16376 might not be signed.
16377
16378 Remove dependency on glibc malloc internals.
16379 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16380 Move back here from lisp.h, but with their new implementations.
16381 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16382 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16383 * charset.c (charset_table_init): New static var.
16384 (syms_of_charset): Use it instead of xmalloc. This removes a
16385 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16386 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16387 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16388 Move back to alloc.c.
16389 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16390 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16391
16392 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16393
16394 * nsterm.m (windowDidResize): Call x_set_window_size only when
16395 ns_in_resize is true. Otherwise set pixelwidth/height and
16396 call change_frame_size (Bug#9628).
16397
16398 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16399
16400 Port --enable-checking=all to Fedora 14 x86-64.
16401 * charset.c (syms_of_charset): Also account for glibc malloc's
16402 internal overhead when calculating the initial malloc maximum.
16403
16404 Port --enable-checking=all to Fedora 14 x86.
16405 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16406 Move to lisp.h.
16407 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16408 (overrun_check_realloc, overrun_check_free):
16409 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16410 That way, xmalloc returns a properly-aligned pointer even if
16411 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16412 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16413 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16414 into account when calculating the initial malloc maximum.
16415 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16416 Move here from alloc.c, so that charset.c can use it too.
16417 Properly align; the old code wasn't right for common 32-bit hosts
16418 when configured with --enable-checking=all.
16419 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16420 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16421
16422 2011-09-29 Eli Zaretskii <eliz@gnu.org>
16423
16424 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
16425 use EDOM.
16426
16427 2011-09-28 Eli Zaretskii <eliz@gnu.org>
16428
16429 * xdisp.c (compute_display_string_end): If there's no display
16430 string at CHARPOS, return -1.
16431
16432 * bidi.c (bidi_fetch_char): When compute_display_string_end
16433 returns a negative value, treat the character as a normal
16434 character not covered by a display string. (Bug#9624)
16435
16436 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
16437
16438 * lread.c (Fread_from_string): Fix typo in docstring.
16439
16440 2011-09-27 Eli Zaretskii <eliz@gnu.org>
16441
16442 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16443 newline, reseat the iterator instead of bidi-iterating there one
16444 character at a time. (Bug#9610)
16445 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16446 TO_CHARPOS if the bidi iterator is at base embedding level.
16447
16448 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16449
16450 * lread.c (readevalloop): Use correct code for NBSP.
16451 (read1): Likewise. (Bug#9608)
16452
16453 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
16454
16455 * dbusbind.c (Fdbus_register_signal): When service is not
16456 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16457
16458 2011-09-25 Glenn Morris <rgm@gnu.org>
16459
16460 * buffer.c (truncate-lines): Doc fix.
16461
16462 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
16463
16464 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16465 (Fset_window_next_buffers): Doc fix.
16466
16467 2011-09-24 Glenn Morris <rgm@gnu.org>
16468
16469 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16470
16471 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16472
16473 Fix minor problems found by static checking.
16474 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
16475 * indent.c (Fvertical_motion): Fix == vs = typo.
16476
16477 2011-09-24 Eli Zaretskii <eliz@gnu.org>
16478
16479 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16480 Default value is now t. Doc fix.
16481
16482 * indent.c (Fvertical_motion): Compute and apply the overshoot
16483 logic when moving up, not only when moving down. Fix the
16484 confusing name and values of the it_overshoot_expected variable;
16485 logic changes accordingly. (Bug#9254) (Bug#9549)
16486
16487 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16488 CHARPOS is covered by a display string which includes newlines.
16489 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16490 is covered by a display string with embedded newlines.
16491
16492 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
16493
16494 * dbusbind.c (Fdbus_register_signal): Add match rule to
16495 Vdbus_registered_objects_table. (Bug#9581)
16496 (Fdbus_register_method, Vdbus_registered_objects_table):
16497 Fix docstring.
16498
16499 2011-09-24 Jim Meyering <meyering@redhat.com>
16500
16501 do not ignore write error for any output size
16502 The previous change was incomplete.
16503 While it makes emacs --batch detect the vast majority of stdout
16504 write failures, errors were still ignored whenever the output size is
16505 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16506 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16507 && echo FAIL: ignored write error
16508 FAIL: ignored write error
16509 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16510 && echo FAIL: ignored write error
16511 FAIL: ignored write error
16512 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16513
16514 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16515
16516 * emacs.c (Fkill_emacs): In noninteractive mode exit
16517 non-successfully if a write error occurred on stdout. (Bug#9574)
16518
16519 2011-09-21 Eli Zaretskii <eliz@gnu.org>
16520
16521 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16522 the xassert test.
16523
16524 * dispextern.h (struct it): Update the comment documenting what
16525 can it->OBJECT be.
16526
16527 2011-09-20 Eli Zaretskii <eliz@gnu.org>
16528
16529 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16530 a display string, extend search for cursor position to end of row.
16531 (find_row_edges): If the row ends in a newline from a display
16532 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16533 Handle the case of a display string with multiple newlines.
16534 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16535 non-empty line. Fixes confusing cursor motion with arrow keys at
16536 the beginning of a line that starts with whitespace.
16537
16538 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16539
16540 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16541 (bug#9493).
16542
16543 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
16544
16545 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16546 boolean (Bug#9154).
16547
16548 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16549
16550 * xdisp.c (display_line): Record maximum and minimum buffer
16551 positions even if no glyphs were produced (e.g., by a zero-width
16552 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16553 buffer positions that will be removed from the glyph row because
16554 they don't fit.
16555 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16556 column is beyond frame width: don't subtract 1 "pixel" when
16557 computing width of the stretch.
16558 (reseat_at_next_visible_line_start): Undo the change made on
16559 2011-09-17 that saved paragraph information and restored it after
16560 the call to `reseat'. (Bug#9545)
16561
16562 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16563
16564 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16565 and turn window cursor on if cleared (Bug#9415).
16566
16567 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
16568
16569 * search.c (boyer_moore): Take unibyte characters from pattern
16570 literally. (Bug#9458)
16571
16572 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16573
16574 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16575
16576 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16577
16578 Fix minor problem found by static checking.
16579 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16580 initialized, to pacify gcc -Wuninitialized.
16581
16582 * fileio.c: Report proper errno when syscall falls.
16583 (Finsert_file_contents): Save and restore errno,
16584 so that report_file_error outputs the correct diagnostic.
16585 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16586
16587 2011-09-18 Eli Zaretskii <eliz@gnu.org>
16588
16589 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16590
16591 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16592
16593 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16594 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16595
16596 2011-09-17 Eli Zaretskii <eliz@gnu.org>
16597
16598 * xdisp.c (reseat_at_next_visible_line_start): Keep information
16599 about the current paragraph and restore it after the call to reseat.
16600
16601 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16602 (bidi_find_paragraph_start): Search back for paragraph beginning
16603 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16604 (bidi_move_to_visually_next): Only trigger paragraph-related
16605 computations when the last character is a newline or at EOB, not
16606 just any NEUTRAL_B. (Bug#9470)
16607
16608 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16609 truncated lines if point is covered by a display string. (Bug#9524)
16610
16611 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16612
16613 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16614 (cons_to_x_long): New function.
16615 (lisp_data_to_selection_data): Use it. Correct the test for
16616 short-versus-long data; it was negated. Break out of vector
16617 loop, for efficiency, when a long datum is discovered.
16618
16619 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16620
16621 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16622
16623 2011-09-16 Eli Zaretskii <eliz@gnu.org>
16624
16625 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16626 GCC PR/17406) by declaring this function with external scope.
16627
16628 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16629
16630 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16631 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16632
16633 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16634
16635 * editfns.c (Fformat): Correctly handle text properties on "%%".
16636
16637 2011-09-15 Eli Zaretskii <eliz@gnu.org>
16638
16639 * xterm.c (x_draw_composite_glyph_string_foreground):
16640 * w32term.c (x_draw_composite_glyph_string_foreground):
16641 * term.c (encode_terminal_code):
16642 * composite.c (composition_update_it, get_composition_id):
16643 * xdisp.c (get_next_display_element)
16644 (fill_composite_glyph_string): Add comments about special meaning
16645 of TAB characters in a composition.
16646
16647 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16648
16649 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
16650 This occurs when processing a multibyte format.
16651 Problem reported by Wolfgang Jenker.
16652
16653 2011-09-15 Johan Bockgård <bojohan@gnu.org>
16654
16655 * xdisp.c (try_cursor_movement): Only check for exact match if
16656 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16657
16658 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16659
16660 Remove unused external symbols.
16661 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16662 * xdisp.c (calc_pixel_width_or_height): Now static.
16663 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16664 * indent.c (check_display_width):
16665 * w32term.c: Fix comment to match code.
16666 * xterm.c, xterm.h (x_catching_errors): Remove.
16667
16668 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16669
16670 * xselect.c: Use signed conversions more consistently (Bug#9498).
16671 (selection_data_to_lisp_data): Assume incoming selection data are
16672 signed integers, not unsigned. This is to be consistent with
16673 outgoing selection data, which was modified to use signed integers
16674 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16675 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16676 expects long, not unsigned long.
16677
16678 2011-09-14 Eli Zaretskii <eliz@gnu.org>
16679
16680 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16681 computation of loop end. Reported by Johan Bockgård
16682 <bojohan@gnu.org>.
16683
16684 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
16685
16686 * frame.c (Fother_visible_frames_p): Function deleted.
16687
16688 2011-09-12 Eli Zaretskii <eliz@gnu.org>
16689
16690 * indent.c (compute_motion): Process display vector front to back
16691 rather than the other way around. (Bug#2496)
16692
16693 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16694
16695 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16696
16697 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
16698
16699 * minibuf.c (Fread_from_minibuffer): Doc fix.
16700
16701 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16702
16703 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16704 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16705
16706 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16707
16708 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16709 value for non-existent files.
16710
16711 2011-09-11 Eli Zaretskii <eliz@gnu.org>
16712
16713 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16714 set its "size" to -1. This will set the modtime_size field of
16715 the corresponding buffer to -1, which is what
16716 verify-visited-file-modtime expects for files that do not exist.
16717 (Bug#9139)
16718
16719 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16720
16721 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16722 here ...
16723 * lisp.h: ... from here. push_key_description is no longer
16724 defined in keyboard.c, so its declaration should not be in
16725 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16726 logically belongs with push_key_description.
16727
16728 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16729
16730 * buffer.h: Include <sys/types.h> instead of <time.h>.
16731 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16732 Problem reported by Herbert J. Skuhra.
16733
16734 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16735
16736 * xml.c (parse_region): Make the parsing work for
16737 non-comment-starting XML files again (bug#9144).
16738
16739 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16740
16741 * image.c (gif_load): Fix calculation of bottom and right corner.
16742 (Bug#9468)
16743
16744 2011-09-10 Eli Zaretskii <eliz@gnu.org>
16745
16746 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16747 redisplay in small windows.
16748
16749 2011-09-09 Eli Zaretskii <eliz@gnu.org>
16750
16751 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16752
16753 2011-09-08 Martin Rudalics <rudalics@gmx.at>
16754
16755 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16756 Operate on live windows only.
16757
16758 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
16759
16760 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16761
16762 2011-09-07 Eli Zaretskii <eliz@gnu.org>
16763
16764 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16765 only under bidi iteration.
16766
16767 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16768
16769 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16770
16771 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16772
16773 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16774 Without this fix, the command to link temacs failed due to an
16775 undefined symbol __builtin_isnan. This is because
16776 /usr/include/iso/math_c99.h #defines isnan(x) to
16777 __builtin_isnan(x), but the bundled gcc, which identifies itself
16778 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16779 a __builtin_isnan.
16780 * floatfns.c (isnan): #undef, and then #define to a clone of
16781 what's in data.c.
16782 (Fisnan): Always define, since it's always available now.
16783 (syms_of_floatfns): Always define isnan at the Lisp level.
16784
16785 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16786
16787 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16788
16789 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16790
16791 * fileio.c: Fix bugs with large file offsets (Bug#9428).
16792 The previous code assumed that file offsets (off_t values) fit in
16793 EMACS_INT variables, which is not true on typical 32-bit hosts.
16794 The code messed up by falsely reporting buffer overflow in cases
16795 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16796 when "big" contains more than 2**29 bytes, even though this
16797 inserts just one byte and does not overflow the buffer.
16798 (Finsert_file_contents): Store file offsets as off_t
16799 values, not as EMACS_INT values. Check for overflow when
16800 converting between EMACS_INT and off_t. When checking for
16801 buffer overflow or for overlap, take the offsets into account.
16802 Don't use EMACS_INT for small values where int suffices.
16803 When checking for overlap, fix a typo: ZV was used where
16804 ZV_BYTE was intended.
16805 (Fwrite_region): Don't assume off_t fits into 'long'.
16806 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16807
16808 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
16809
16810 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16811
16812 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16813
16814 sprintf-related integer and memory overflow issues (Bug#9412).
16815
16816 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
16817 (esprintf, exprintf, evxprintf): New functions.
16818 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
16819 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
16820 (modify_event_symbol): Do not assume that the length of
16821 name_alist_or_stem is safe to alloca and fits in int.
16822 (Fexecute_extended_command): Likewise for function name and binding.
16823 (Frecursion_depth): Wrap around reliably on integer overflow.
16824 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16825 since some callers pass EMACS_INT values.
16826 (Fsingle_key_description): Don't crash if symbol name contains more
16827 than MAX_ALLOCA bytes.
16828 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16829 (get_minibuffer): Arg is now EMACS_INT, not int.
16830 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
16831 (esprintf, exprintf, evxprintf): New decls.
16832 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16833
16834 * dbusbind.c (signature_cat): New function.
16835 (xd_signature, Fdbus_register_signal):
16836 Do not overrun buffer; instead, report string overflow.
16837
16838 * dispnew.c (add_window_display_history): Don't overrun buffer.
16839 Truncate instead; this is OK since it's just a log.
16840
16841 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16842 even if the time zone offset is outlandishly large.
16843 Don't mishandle offset == INT_MIN.
16844
16845 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16846 when creating daemon; the previous buffer-overflow check was incorrect.
16847
16848 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16849 which has the guts of the old verror function.
16850
16851 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16852 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16853
16854 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16855 (font_unparse_xlfd): Don't blindly alloca long strings.
16856 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
16857 fits in int, when using sprintf. Use single snprintf to count
16858 length of string rather than counting it via multiple sprintfs;
16859 that's simpler and more reliable.
16860 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16861 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16862 sprintf, in case result does not fit in int.
16863
16864 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16865 (fontset_from_font): Print it.
16866
16867 * frame.c (tty_frame_count): Now printmax_t, not int.
16868 (make_terminal_frame, set_term_frame_name): Print it.
16869 (x_report_frame_params): In X, window IDs are unsigned long,
16870 not signed long, so print them as unsigned.
16871 (validate_x_resource_name): Check for implausibly long names,
16872 and don't assume name length fits in 'int'.
16873 (x_get_resource_string): Don't blindly alloca invocation name;
16874 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16875 not fit in int.
16876
16877 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16878 (xg_check_special_colors, xg_set_geometry):
16879 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16880
16881 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16882 Use esprintf, not sprintf, in case result does not fit in int.
16883
16884 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16885 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16886 it as a large positive number.
16887 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16888 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16889
16890 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16891 in case result does not fit in int.
16892
16893 * print.c (float_to_string): Detect width overflow more reliably.
16894 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16895 buffer overrun. Don't assume list length fits in 'int'. Treat
16896 print length of 0 as 0, not as infinity; to be consistent with other
16897 uses of print length in this function. Don't overflow print length
16898 index. Don't assume hash table size fits in 'long', or that
16899 vectorlike size fits in 'unsigned long'.
16900
16901 * process.c (make_process): Use printmax_t, not int, to format
16902 process-name gensyms.
16903
16904 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16905
16906 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16907 to avoid potential buffer overrun.
16908
16909 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16910 if X resource line is longer than 512 bytes.
16911
16912 * xfns.c (x_window): Make sprintf buffer a bit bigger
16913 to avoid potential buffer overrun.
16914
16915 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16916
16917 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16918
16919 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16920
16921 Integer overflow fixes for scrolling, etc.
16922 Without these, Emacs silently mishandles large integers sometimes.
16923 For example, "C-u 4294967297 M-x recenter" was treated as if
16924 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16925
16926 * xdisp.c (try_window_id): Check Emacs fixnum range before
16927 converting to 'int'.
16928
16929 * window.c (window_scroll_line_based, Frecenter):
16930 Check that an Emacs fixnum is in range before assigning it to 'int'.
16931 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16932 values converted from Emacs fixnums.
16933 (Frecenter): Don't wrap around a line count if it is out of 'int'
16934 range; instead, treat it as an extreme value.
16935 (Fset_window_configuration, compare_window_configurations):
16936 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16937
16938 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16939 that can exceed INT_MAX. Check that EMACS_INT value is in range
16940 before assigning it to the (possibly-narrower) index.
16941 (match_limit): Don't assume that a fixnum can fit in 'int'.
16942
16943 * print.c (print_object): Use ptrdiff_t, not int, for index that can
16944 exceed INT_MAX.
16945
16946 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
16947 (Fvertical_motion): Don't wrap around LINES values that don't fit
16948 in 'int'. Instead, treat them as extreme values. This is good
16949 enough for windows, which can't have more than INT_MAX lines anyway.
16950
16951 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16952
16953 * Require libxml/parser.h to avoid compilation warning.
16954
16955 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16956
16957 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16958 since this reportedly can destroy thread storage.
16959
16960 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
16961
16962 * syntax.c (find_defun_start): Update all cache variables if
16963 exiting early (Bug#9401).
16964
16965 2011-08-30 Eli Zaretskii <eliz@gnu.org>
16966
16967 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16968
16969 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16970 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16971 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16972
16973 * term.c (tty_append_glyph): New function.
16974 (produce_stretch_glyph): Static function and its prototype deleted.
16975
16976 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16977 Add prototypes.
16978
16979 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16980
16981 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16982 when checking :margin (Bug#9390).
16983 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
16984 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
16985 so that the name doesn't mislead. All uses changed.
16986
16987 2011-08-28 Johan Bockgård <bojohan@gnu.org>
16988
16989 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16990 set_tty_hooks.
16991
16992 2011-08-27 Eli Zaretskii <eliz@gnu.org>
16993
16994 * xdisp.c (move_it_to): Don't bail out early when reaching
16995 position beyond to_charpos, if we are scanning backwards.
16996 (move_it_vertically_backward): When DY == 0, make sure we get to
16997 the first character in the line after the newline.
16998
16999 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
17000
17001 * ccl.c: Improve and simplify overflow checking (Bug#9196).
17002 (ccl_driver): Do not generate an out-of-range pointer.
17003 (Fccl_execute_on_string): Remove unnecessary check for
17004 integer overflow, noted by Stefan Monnier in
17005 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
17006 Remove a FIXME that didn't need fixing.
17007 Simplify the newly-introduced buffer reallocation code.
17008
17009 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
17010
17011 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
17012
17013 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
17014
17015 Integer and memory overflow issues (Bug#9196).
17016
17017 * doc.c (get_doc_string): Rework so that
17018 get_doc_string_buffer_size is the actual buffer size, rather than
17019 being 1 less than the actual buffer size; this makes xpalloc more
17020 convenient.
17021
17022 * image.c (x_allocate_bitmap_record, cache_image):
17023 * xselect.c (Fx_register_dnd_atom):
17024 Simplify previous changes by using xpalloc.
17025
17026 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
17027 since either will do and ptrdiff_t is convenient with xpalloc.
17028
17029 * charset.c (charset_table_size)
17030 (struct charset_sort_data.priority): Now ptrdiff_t.
17031 (charset_compare): Don't overflow if priorities differ greatly.
17032 (Fsort_charsets): Don't assume list length fits in int.
17033 Check for size-calculation overflow when allocating sort data.
17034 (syms_of_charset): Allocate an initial charset table that is
17035 just under 64 KiB, to avoid problems with glibc malloc and mmap.
17036
17037 * cmds.c (internal_self_insert): Check for size-calculation overflow.
17038
17039 * composite.h (struct composition.glyph_len): Now int, not unsigned.
17040 The actual value is always <= INT_MAX, and leaving it unsigned made
17041 overflow checking harder.
17042
17043 * dispextern.h (struct glyph_matrix.rows_allocated)
17044 (struct face_cache.size): Now ptrdiff_t, for convenience in use
17045 with xpalloc. The values are still always <= INT_MAX.
17046
17047 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
17048
17049 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
17050 (SAFE_NALLOCA): New macro.
17051
17052 * region-cache.c (struct boundary.pos, find_cache_boundary)
17053 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
17054 (set_cache_region, invalidate_region_cache)
17055 (revalidate_region_cache, know_region_cache, region_cache_forward)
17056 (region_cache_backward, pp_cache):
17057 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
17058 so that ptrdiff_t * can be passed to xpalloc.
17059 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
17060 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
17061 (pp_cache): Don't assume cache_len fits in int.
17062 * region-cache.h: Adjust extern decls to match.
17063
17064 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
17065 EMACS_INT, since either will do, for xpalloc.
17066
17067 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
17068 (xnmalloc, xnrealloc, xpalloc): New functions.
17069
17070 * bidi.c (bidi_shelve_header_size): New constant.
17071 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
17072 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
17073
17074 * bidi.c (bidi_cache_shrink):
17075 * buffer.c (overlays_at, overlays_in, record_overlay_string)
17076 (overlay_strings):
17077 Don't update size of array until after memory allocation succeeds,
17078 because xmalloc/xrealloc may not return.
17079 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
17080 now that we have proper integer overflow checking.
17081 (record_overlay_string, overlay_strings): Catch overflows when
17082 calculating size of overlay_str_buf.
17083
17084 * callproc.c (Fcall_process): Check for size overflow when
17085 calculating size of args2.
17086 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
17087 Normally we prefer signed values, but sticking with ptrdiff_t would
17088 require adding more-complicated checks.
17089
17090 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
17091 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
17092 Redo buffer-overflow calculations to avoid integer overflow.
17093 Add a FIXME comment where memory seems to be over-allocated.
17094
17095 * character.c (Fstring): Check for size-calculation overflow.
17096
17097 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
17098 unnecessary integer overflow. Check for size overflow.
17099 (encode_coding_object): Don't update size until xmalloc succeeds.
17100
17101 * composite.c (get_composition_id): Check for overflow in glyph
17102 length calculations.
17103
17104 Integer and memory overflow fixes for display code.
17105 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
17106 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
17107 (scrolling_window): Check for overflow in size calculations.
17108 (line_draw_cost, realloc_glyph_pool, add_row_entry):
17109 Don't assume glyph table len fits in int.
17110 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
17111 (row_table_size): Now ptrdiff_t, not int.
17112 (scrolling_window): Avoid overflow in size calculations.
17113 Don't update size until allocation succeeds.
17114 * fns.c (concat): Check for overflow in size calculations.
17115 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
17116 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17117 (NEXT_ALMOST_PRIME_LIMIT): New constant.
17118
17119 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
17120 (get_doc_string): Check for size calculation overflow.
17121 Don't update size until allocation succeeds.
17122 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
17123 EMACS_INT, where ptrdiff_t will do.
17124 (Fsubstitute_command_keys): Check for string overflow.
17125
17126 * editfns.c (set_time_zone_rule): Don't assume environment length
17127 fits in int.
17128 (message_length): Now ptrdiff_t, not int.
17129 (Fmessage_box): Don't update size until allocation succeeds.
17130 Don't assume message length fits in int.
17131 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
17132
17133 * emacs.c (main): Do not reallocate argv, since there is a null at
17134 the end that can be overwritten, and this way there's no need to
17135 worry about size-calculation overflow.
17136 (sort_args): Check for size-calculation overflow.
17137
17138 * eval.c (init_eval_once, grow_specpdl): Don't update size until
17139 alloc succeeds.
17140 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
17141
17142 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
17143 (x_set_scroll_bar_width, x_figure_window_size):
17144 Check for integer overflow.
17145 (x_set_alpha): Do not assume XINT fits in int.
17146
17147 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17148 This is for the members text_lines, text_cols, total_lines, total_cols,
17149 where the system imposes an 'int' limit.
17150
17151 * fringe.c (Fdefine_fringe_bitmap):
17152 Don't update size until alloc works.
17153
17154 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17155 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17156
17157 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17158 Check for size-calculation overflow.
17159 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17160 do, as we prefer signed integers.
17161 (id_to_widget.max_size, id_to_widget.used)
17162 (xg_store_widget_in_map, xg_remove_widget_from_map)
17163 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17164 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17165 Use and return ptrdiff_t, not int.
17166 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17167 * gtkutil.h: Change prototypes to match the above.
17168
17169 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17170 are duplicate now that they've been promoted to lisp.h.
17171 (x_allocate_bitmap_record, x_alloc_image_color)
17172 (make_image_cache, cache_image, xpm_load):
17173 Don't update size until alloc is done.
17174 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17175 (x_detect_edges):
17176 Check for size calculation overflow.
17177 (ct_colors_allocated_max): New constant.
17178 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17179 overflow.
17180
17181 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17182 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17183 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17184 Use ptrdiff_t, not int, to count maps.
17185 (read_char_minibuf_menu_prompt): Check for overflow in size
17186 calculations. Don't update size until allocation succeeds.
17187 Redo calculations to avoid overflow.
17188 * keyboard.h: Change prototypes to match the above.
17189
17190 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17191 to count maps.
17192 (current_minor_maps): Check for size calculation overflow.
17193 * keymap.h: Change prototypes to match the above.
17194
17195 * lread.c (read1, init_obarray): Don't update size until alloc done.
17196
17197 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17198 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17199
17200 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17201 Now ptrdiff_t, not int.
17202 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17203 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17204
17205 * process.c (Fnetwork_interface_list): Check for overflow
17206 in size calculation.
17207
17208 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17209
17210 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17211 overflow. Don't bother calling xmalloc when xrealloc will do.
17212
17213 * search.c (Freplace_match): Check for size calculation overflow.
17214 (Fset_match_data): Don't assume list lengths fit in 'int'.
17215
17216 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17217 for command line length. Do not attempt to address one before the
17218 beginning of an array, as that's not portable.
17219
17220 * term.c (max_frame_lines): Remove; unused.
17221 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17222 not int.
17223 (encode_terminal_code, calculate_costs): Check for size
17224 calculation overflow.
17225 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17226 table lengths and related sizes. Don't update size until alloc
17227 done. Redo calculations to avoid overflow.
17228 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17229
17230 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17231 subtracting pointers.
17232 (gobble_line): Check for overflow more carefully. Don't update size
17233 until alloc done.
17234
17235 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17236 Don't update size until alloc done.
17237 Redo size calculations to avoid overflow.
17238 Check for size calculation overflow.
17239 (main) [DEBUG]: Fix typo in invoking tparam1.
17240
17241 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17242 Use ptrdiff_t, not int, for sizes.
17243 (store_mode_line_noprop_char): Don't update size until alloc done.
17244
17245 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17246 Use ptrdiff_t, not int, for sizes.
17247 (Finternal_make_lisp_face, cache_face):
17248 Check for size calculation overflow.
17249 (cache_face): Treat size calculation overflows as if they were
17250 memory exhaustion (the usual treatment), rather than aborting.
17251
17252 * xfns.c (x_encode_text, x_set_name_internal)
17253 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17254 sizes, since they can exceed INT_MAX in size. Check for size
17255 calculation overflow.
17256
17257 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17258 (xg_select): Check for size calculation overflow.
17259 Don't update size until alloc done.
17260
17261 * xrdb.c (get_environ_db): Don't assume path length fits in int,
17262 as sprintf is limited to int lengths.
17263
17264 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17265 (X_LONG_MIN): New macros.
17266 Use them to make the following changes clearer.
17267 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17268 This change doesn't affect the value now, but it may help remind
17269 future maintainers not to raise the value too much later.
17270 (SELECTION_QUANTUM): Remove, replacing with ...
17271 (selection_quantum): ... new function, which avoids overflow.
17272 All uses changed.
17273 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17274 assumption that selection length fits in 'int'.
17275 (x_reply_selection_request, x_handle_selection_request)
17276 (x_get_window_property, receive_incremental_selection)
17277 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17278 (lisp_data_to_selection_data, clean_local_selection_data):
17279 Use ptrdiff_t, not int, to record length of selection.
17280 (x_reply_selection_request, x_get_window_property)
17281 (receive_incremental_selection, x_property_data_to_lisp):
17282 Redo calculations to avoid overflow.
17283 (x_reply_selection_request): When sending hint, ceiling it at
17284 X_LONG_MAX rather than relying on wraparound overflow to send
17285 something.
17286 (x_get_window_property, receive_incremental_selection)
17287 (lisp_data_to_selection_data, x_property_data_to_lisp):
17288 Check for size-calculation overflow.
17289 (x_get_window_property, receive_incremental_selection)
17290 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17291 Don't store size until memory allocation succeeds.
17292 (x_get_window_property): Plug memory leak on memory exhaustion.
17293 Don't double-block input; malloc is safe here. Don't assume 2**34
17294 - 4 fits in unsigned long. Add an xassert to check
17295 XGetWindowProperty overflow. Be more careful about overflow
17296 calculations, and distinguish size from memory overflow better.
17297 (receive_incremental_selection): When tracing, don't assume
17298 unsigned int is less than INT_MAX.
17299 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17300 harmful) conversions of unsigned short to int.
17301 (lisp_data_to_selection_data): Don't assume that integers
17302 in the range -65535 through -1 fit in an X unsigned short.
17303 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17304 result parameters unless successful. Rely on cons_to_unsigned
17305 to report problems with elements; the old code wasn't right anyway.
17306 (x_check_property_data): Check for int overflow; we cannot use
17307 a wider type due to X limits.
17308 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17309
17310 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
17311
17312 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17313 (x_term_init): Check for size calculation overflow.
17314 (x_color_cells): Don't store size until memory allocation succeeds.
17315 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
17316 Don't assume alloca size is less than MAX_ALLOCA.
17317 (x_term_init): Don't assume length fits in int (sprintf is limited
17318 to int size).
17319
17320 Use ptrdiff_t for composition IDs.
17321 * character.c (lisp_string_width):
17322 * composite.c (composition_table_size, n_compositions)
17323 (get_composition_id, composition_gstring_from_id):
17324 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17325 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17326 * window.c (Frecenter):
17327 Use ptrdiff_t, not int, for composition IDs.
17328 * composite.c (get_composition_id): Check for integer overflow.
17329 * composite.h: Adjust prototypes to match the above changes.
17330
17331 Use ptrdiff_t for hash table indexes.
17332 * category.c (hash_get_category_set):
17333 * ccl.c (ccl_driver):
17334 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17335 * coding.c (coding_system_charset_list, detect_coding_system):
17336 * coding.h (struct coding_system.id):
17337 * composite.c (get_composition_id, gstring_lookup_cache):
17338 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17339 * image.c (xpm_get_color_table_h):
17340 * lisp.h (hash_lookup, hash_put):
17341 * minibuf.c (Ftest_completion):
17342 Use ptrdiff_t for hash table indexes, not int (which is too
17343 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17344 32-bit --with-wide-int hosts).
17345
17346 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17347 Add a FIXME comment about memory leaks.
17348 (syms_of_charset): Don't assume xmalloc returns.
17349
17350 Don't assume that stated character widths fit in int.
17351 * character.c (Fchar_width, c_string_width, lisp_string_width):
17352 * character.h (CHAR_WIDTH):
17353 * indent.c (MULTIBYTE_BYTES_WIDTH):
17354 Use sanitize_char_width to avoid undefined and/or bad behavior
17355 with outlandish widths.
17356 * character.h (sanitize_tab_width): Rename from sanitize_width,
17357 now that we have two such functions. All uses changed.
17358 (sanitize_char_width): New inline function.
17359
17360 Don't assume that tab-width fits in int.
17361 * character.h (sanitize_width): New inline function.
17362 (SANE_TAB_WIDTH): New macro.
17363 (ASCII_CHAR_WIDTH): Use it.
17364 * indent.c (sane_tab_width): Remove. All uses replaced by
17365 SANE_TAB_WIDTH (current_buffer).
17366 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17367
17368 * fileio.c: Integer overflow issues with file modes.
17369 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17370
17371 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17372 Remove unreachable code.
17373 (read_hex, load_charset_map_from_file): Check for integer overflow.
17374
17375 * xterm.c: Don't go over XClientMessageEvent limit.
17376 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17377 (x_send_scroll_bar_event): Likewise. Check that the size does not
17378 exceed limits imposed by XClientMessageEvent, as well as the usual
17379 ptrdiff_t and size_t limits.
17380
17381 * keyboard.c: Overflow, signedness and related fixes.
17382 (make_lispy_movement): Use same integer type in forward decl
17383 that is used in the definition.
17384 (read_key_sequence, keyremap_step):
17385 Change bufsize argument back to int, undoing my 2011-03-30 change.
17386 We prefer signed types, and int is wide enough here.
17387 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17388 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17389 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17390 length, not size_t. Use ptrdiff_t for index, not int.
17391 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17392 possibility of integer overflow.
17393
17394 Overflow, signedness and related fixes for images.
17395
17396 * dispextern.h (struct it.stack[0].u.image.image_id)
17397 (struct_it.image_id, struct image.id, struct image_cache.size)
17398 (struct image_cache.used, struct image_cache.ref_count):
17399 * gtkutil.c (update_frame_tool_bar):
17400 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17401 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17402 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17403 * nsmenu.m (update_frame_tool_bar):
17404 * xdisp.c (calc_pixel_width_or_height):
17405 * xfns.c (image_cache_refcount):
17406 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17407 on typical 64-bit hosts.
17408
17409 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17410 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17411 Omit unnecessary casts to int.
17412 (parse_image_spec): Check that integers fall into 'int' range
17413 when the callers expect that.
17414 (image_ascent): Redo ascent calculation to avoid int overflow.
17415 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17416 (lookup_image): Remove unnecessary tests.
17417 (xbm_image_p): Locals are now of int, not EMACS_INT,
17418 since parse_image_check makes sure they fit into int.
17419 (png_load, gif_load, svg_load_image):
17420 Prefer int to unsigned where either will do.
17421 (tiff_handler): New function, combining the cores of the
17422 old tiff_error_handler and tiff_warning_handler.
17423 This function is rewritten to use vsnprintf and thereby avoid
17424 stack buffer overflows. It uses only the features of vsnprintf
17425 that are common to both POSIX and native Microsoft.
17426 (tiff_error_handler, tiff_warning_handler): Use it.
17427 (tiff_load, gif_load, imagemagick_load_image):
17428 Don't assume :index value fits in 'int'.
17429 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17430 (imagemagick_load_image): Check that crop parameters fit into
17431 the integer types that MagickCropImage accepts. Don't assume
17432 Vimagemagick_render_type has a nonnegative value. Don't assume
17433 size_t fits in 'long'.
17434 (gs_load): Use printmax_t to print the widest integers possible.
17435 Check for integer overflow when computing image height and width.
17436
17437 2011-08-26 Eli Zaretskii <eliz@gnu.org>
17438
17439 * xdisp.c (redisplay_window): Don't force window start if point
17440 will be invisible in the resulting window. (Bug#9324)
17441
17442 2011-08-25 Eli Zaretskii <eliz@gnu.org>
17443
17444 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17445 the display spec is of the form `(space ...)'.
17446 (handle_display_spec): Return the value returned by
17447 handle_single_display_spec, not just 1 or zero.
17448 (handle_single_display_spec): If the display spec is of the form
17449 `(space ...)', and specifies display in the text area, return 2
17450 rather than 1.
17451 (try_cursor_movement): Check for the need to scroll more
17452 accurately, and prefer exact match for point under bidi.
17453 Don't advance `row' beyond the last row of the window.
17454
17455 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17456 into disp_prop; all users changed.
17457
17458 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17459 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17460 for the text covered by the display property.
17461
17462 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
17463
17464 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17465 Change return value to nil.
17466 (Frecord_buffer): Delete unused function.
17467
17468 2011-08-24 Eli Zaretskii <eliz@gnu.org>
17469
17470 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17471 buffers, return left-to-right.
17472 (set_cursor_from_row): Consider candidate row a win if its glyph
17473 represents a newline and point is on that newline. Fixes cursor
17474 positioning on the newline at EOL of R2L text within L2R
17475 paragraph, and vice versa.
17476 (try_cursor_movement): Check continued rows, in addition to
17477 continuation rows. Fixes unwarranted scroll when point enters a
17478 continued line of R2L text within an L2R paragraph, or vice versa.
17479 (cursor_row_p): Consider the case of point being equal to
17480 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17481 from the end of a short line to the beginning of a continued line
17482 of R2L text within L2R paragraph.
17483 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17484 composed characters.
17485
17486 * bidi.c (bidi_check_type): Use xassert.
17487 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17488 members.
17489
17490 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17491
17492 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17493 a character.
17494
17495 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
17496
17497 * nsfont.m (ns_otf_to_script): Fix typo.
17498
17499 2011-08-22 Kenichi Handa <handa@m17n.org>
17500
17501 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17502 extra slot even if the purpose is char-code-property-table.
17503
17504 2011-08-23 Eli Zaretskii <eliz@gnu.org>
17505
17506 * xdisp.c (redisplay_window): When computing centering_position,
17507 account for the height of the header line. (Bug#8874)
17508
17509 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17510 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17511 candidate is selected by the mouse, and that candidate has a
17512 composed character under the mouse.
17513
17514 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17515 coordinates reported by pos-visible-in-window-p for a composed
17516 character in column zero.
17517
17518 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17519
17520 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17521
17522 2011-08-22 Eli Zaretskii <eliz@gnu.org>
17523
17524 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17525 consider it a hit if to_charpos is anywhere in the range of the
17526 composed buffer positions.
17527
17528 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
17529
17530 * image.c (gif_load): Don't assume that each subimage has the same
17531 dimensions as the base image. Handle disposal method that is
17532 "undefined" by the gif spec (Bug#9335).
17533
17534 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
17535
17536 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
17537 (Fcondition_case): Document `debug' symbol in error handler.
17538
17539 2011-08-19 Eli Zaretskii <eliz@gnu.org>
17540
17541 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17542 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17543 from an Org mode buffer to a Speedbar frame.
17544
17545 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17546 a composition, take its buffer position from IT->cmp_it.charpos.
17547 Fixes cursor positioning at the beginning of a line that begins
17548 with a composed character.
17549
17550 2011-08-18 Eli Zaretskii <eliz@gnu.org>
17551
17552 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17553 character bidirectional type, use STRONG_L instead. Fixes crashes
17554 in a buffer produced by `describe-categories'.
17555
17556 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17557 members before the level stack, so they would be saved and
17558 restored when copying iterator state. Fixes incorrect reordering
17559 around TABs covered by display properties.
17560
17561 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17562
17563 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
17564
17565 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
17566
17567 * eval.c (internal_condition_case, internal_condition_case_1)
17568 (internal_condition_case_2, internal_condition_case_n):
17569 Remove unnecessary aborts (Bug#9081).
17570
17571 2011-08-17 Eli Zaretskii <eliz@gnu.org>
17572
17573 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17574 has no `load' handler, try opening the file locally. (Bug#9311)
17575
17576 2011-08-16 Ken Brown <kbrown@cornell.edu>
17577
17578 * gmalloc.c: Expand comment.
17579
17580 2011-08-16 Eli Zaretskii <eliz@gnu.org>
17581
17582 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17583 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17584
17585 2011-08-16 Ken Brown <kbrown@cornell.edu>
17586
17587 Fix memory allocation problems in Cygwin build (Bug#9273).
17588
17589 * unexcw.c ( __malloc_initialized): Declare external variable.
17590 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17591
17592 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17593 New variables.
17594 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17595 dumped emacs.
17596 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17597 in the static heap.
17598 [CYGWIN] (special_realloc): New function.
17599 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17600 requests to realloc storage in the static heap.
17601
17602 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17603
17604 * bidi.c (bidi_initialize): Remove unused local.
17605
17606 2011-08-15 Eli Zaretskii <eliz@gnu.org>
17607
17608 * bidimirror.h:
17609 * biditype.h: Remove file.
17610 * makefile.w32-in ($(BLD)/bidi.$(O)):
17611 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
17612
17613 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17614
17615 * chartab.c: Improve commentary for the uniprop_table API.
17616
17617 * bidi.c (bidi_paragraph_init): Support zero value of
17618 bidi_ignore_explicit_marks_for_paragraph_level.
17619 (bidi_initialize): Use uniprop_table instead of including
17620 biditype.h and bidimirror.h.
17621
17622 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17623 coordinates of the iterator when restoring from ppos_it.
17624 (Bug#9296)
17625
17626 2011-08-14 Kenichi Handa <handa@m17n.org>
17627
17628 * process.c (create_process): Call setup_process_coding_systems
17629 after the pid of the process is set to -1 (Bug#8162).
17630
17631 2011-08-14 Eli Zaretskii <eliz@gnu.org>
17632
17633 * xdisp.c (move_it_in_display_line_to): Don't invoke
17634 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17635 ppos_it. Fixes vertical cursor motion when line beginning is
17636 covered by an image. (Bug#9296)
17637
17638 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17639
17640 * nsterm.h (ns_run_ascript): Declare.
17641 (NSAPP_DATA2_RUNASSCRIPT): Define.
17642
17643 * nsfns.m (as_script, as_result, as_status): New static variables.
17644 (ns_run_ascript): New function.
17645 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
17646 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17647 the event loop. Get status from as_status (Bug#7276).
17648
17649 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17650 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17651 the event loop (Bug#7276).
17652
17653 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17654
17655 * gnutls.c (QCgnutls_bootprop_priority)
17656 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17657 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17658 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17659 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17660 (QCgnutls_bootprop_verify_hostname_error)
17661 (QCgnutls_bootprop_callbacks_verify): Rename from
17662 Qgnutls_bootprop_..., all uses changed.
17663
17664 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17665 uses changed.
17666
17667 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17668
17669 * xfaces.c (Qframe_set_background_mode): Now static.
17670 * dispextern.h (Qframe_set_background_mode): Remove decl.
17671
17672 * process.c (Fnetwork_interface_info): Declare local only if needed.
17673
17674 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17675
17676 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17677 (Fnetwork_interface_list): Allocate in increments of bytes instead
17678 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17679 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17680 sockaddr.
17681 (struct ifflag_def): notrailers is smart on OSX.
17682 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17683 Get hardware address with getifaddrs if available.
17684
17685 2011-08-12 Eli Zaretskii <eliz@gnu.org>
17686
17687 * xdisp.c (iterate_out_of_display_property): xassert that
17688 IT->position is set to within IT->object's boundaries. Break from
17689 the loop as soon as EOB is reached; avoids infloops in redisplay
17690 when IT->position is set up wrongly due to some bug.
17691 Set IT->current to match the bidi iterator unconditionally.
17692 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17693 entry. Force push_it to save on the stack the current
17694 buffer/string position, to be restored by pop_it. Fix flags in
17695 the iterator structure wrt the object coming from a display
17696 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17697 properties. (Bug#9284)
17698
17699 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
17700
17701 * fontset.c (fontset_get_font_group): Add proper type checks.
17702 (Bug#9172)
17703
17704 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
17705
17706 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17707 and LC_VERSION_MIN_MACOSX.
17708 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17709 (dump_it) [LC_FUNCTION_STARTS]: Use it.
17710
17711 2011-08-08 Eli Zaretskii <eliz@gnu.org>
17712
17713 * xdisp.c (forward_to_next_line_start): Allow to use the
17714 no-display-properties-and-no-overlays under bidi display.
17715 Set disp_pos in the bidi iterator to avoid searches for display
17716 properties and overlays.
17717
17718 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
17719
17720 * editfns.c (Fset_time_zone_rule): Document relationship with the
17721 setenv function.
17722
17723 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17724 the font entity extracted from the cache (Bug#8109).
17725
17726 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
17727
17728 * composite.c (autocmp_chars): Don't reset point. That is done by
17729 restore_point_unwind (Bug#5984).
17730
17731 2011-08-07 Juri Linkov <juri@jurta.org>
17732
17733 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17734 to show the arg `TIME' instead of `TIMEVAL'.
17735
17736 2011-08-06 Eli Zaretskii <eliz@gnu.org>
17737
17738 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17739 display property strides EOL and includes a newline, as in
17740 longlines-mode. (Bug#9254)
17741 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17742 word-wrap under bidirectional display. (Bug#9224)
17743
17744 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17745 is non-zero, even if the data buffer is NULL. Fixes a crash in
17746 vertical-motion with longlines-mode. (Bug#9254)
17747
17748 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17749
17750 * bidi.c <bidi_cache_total_alloc>: Now static.
17751 (bidi_initialize): Initialize bidi_cache_total_alloc.
17752
17753 * xdisp.c (display_line): Release buffer allocated for shelved bidi
17754 cache. (Bug#9221)
17755
17756 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17757 amount allocated this far in `bidi_cache_total_alloc'.
17758 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17759 non-zero, only free the data buffer without restoring the cache
17760 contents. All callers changed.
17761
17762 * dispextern.h (bidi_unshelve_cache): Update prototype.
17763
17764 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17765 (move_it_in_display_line, move_it_to)
17766 (move_it_vertically_backward, move_it_by_lines): Replace the call
17767 to xfree to an equivalent call to bidi_unshelve_cache.
17768 (move_it_in_display_line_to): Fix logic of returning
17769 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
17770
17771 2011-08-05 Eli Zaretskii <eliz@gnu.org>
17772
17773 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17774 came from a string character with a `cursor' property. (Bug#9229)
17775
17776 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17777
17778 * Makefile.in (LIB_PTHREAD): New variable.
17779 (LIBES): Add LIB_PTHREAD (Bug#9216).
17780
17781 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17782 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17783
17784 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17785
17786 * regex.c (re_iswctype): Remove some redundant boolean conversions.
17787
17788 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17789
17790 * xterm.c (x_find_topmost_parent): New function.
17791 (x_set_frame_alpha): Find topmost parent window with
17792 x_find_topmost_parent and set the property there also (bug#9181).
17793 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17794
17795 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17796
17797 * callproc.c (Fcall_process): Avoid vfork clobbering
17798 the local vars buffer, coding_systems, current_dir.
17799
17800 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17801
17802 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17803
17804 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17805
17806 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17807 so that it is not optimized away.
17808
17809 * xdisp.c (compute_display_string_pos): Remove unused local.
17810
17811 2011-08-02 Eli Zaretskii <eliz@gnu.org>
17812
17813 Fix slow cursor motion and scrolling in large buffers with
17814 selective display, like Org Mode buffers. (Bug#9218)
17815
17816 * dispextern.h (struct bidi_it): New member disp_prop_p.
17817
17818 * xdisp.c: Remove one-slot cache of display string positions.
17819 (compute_display_string_pos): Accept an additional argument
17820 DISP_PROP_P; callers changed. Scan at most 5K characters forward
17821 for a display string or property. If found, set DISP_PROP_P
17822 non-zero.
17823
17824 * bidi.c (bidi_fetch_char): Accept an additional argument
17825 DISP_PROP_P, and pass it to compute_display_string_pos.
17826 Only handle text covered by a display string if DISP_PROP_P is returned
17827 non-zero. All callers of bidi_fetch_char changed.
17828
17829 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17830
17831 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17832
17833 2010-12-03 Don March <don@ohspite.net>
17834
17835 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17836 last character M-[char] is translated to ESC [char] (bug#7541).
17837
17838 2011-08-02 Kenichi Handa <handa@m17n.org>
17839
17840 * lisp.h (uniprop_table): Extern it.
17841
17842 * chartab.c (uniprop_table): Make it non-static.
17843
17844 2011-08-01 Eli Zaretskii <eliz@gnu.org>
17845
17846 * xdisp.c (forward_to_next_line_start): Accept additional argument
17847 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17848 on the newline.
17849 (reseat_at_next_visible_line_start): Use the bidi iterator state
17850 returned by forward_to_next_line_start to restore the state of
17851 it->bidi_it after backing up to previous newline. (Bug#9212)
17852
17853 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17854
17855 * regex.c (re_comp): Protoize.
17856 (re_exec): Fix return type.
17857 (regexec): Fix type of `ret'. (Bug#9203)
17858
17859 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17860
17861 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17862 This is needed if max-image-size is a floating-point number.
17863
17864 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17865
17866 * print.c (print_object): Print empty symbol as ##.
17867
17868 * lread.c (read1): Read ## as empty symbol.
17869
17870 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17871
17872 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17873 setting frame foreground color (Bug#9175).
17874 (x_set_background_color): Likewise.
17875
17876 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17877 contents (Bug#9176).
17878 (EmacsTooltip -init): Remove bezels and add shadows to
17879 tooltip windows.
17880
17881 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17882 or scroll bar (Bug#8470).
17883
17884 * nsfont.m (nsfont_open): Remove assignment to voffset and
17885 unnecessary vars hshink, expand, hd, full_height, min_height.
17886 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17887
17888 * nsterm.h (nsfont_info): Remove voffset field.
17889
17890 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17891
17892 Implement strike-through and overline on NextStep (Bug#8863).
17893
17894 * nsfont.m (nsfont_open): Use underline position provided by font,
17895 instead of hard-coded value of 2.
17896 (nsfont_draw): Call ns_draw_text_decoration instead.
17897
17898 * nsterm.h: Add declaration for ns_draw_text_decoration.
17899
17900 * nsterm.m (ns_draw_text_decoration): New function for drawing
17901 underline, overline, and strike-through.
17902 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17903 ns_draw_text_decoration. Change treatment of cursor drawing to
17904 accommodate underlining, etc.
17905
17906 2011-07-28 Eli Zaretskii <eliz@gnu.org>
17907
17908 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17909 default.
17910
17911 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17912
17913 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17914 Without this fix, if a signal arrives just after memory fills up,
17915 'malloc' might be invoked reentrantly.
17916
17917 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17918 In other words, assume that every image size is allowed, on non-X
17919 hosts. This assumption is probably wrong, but it lets Emacs compile.
17920
17921 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17922
17923 * regex.c (re_iswctype): Convert return values to boolean.
17924
17925 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17926
17927 * xdisp.c (compute_display_string_pos): Don't use cached display
17928 string position if the buffer had its restriction changed.
17929 (Bug#9184)
17930
17931 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17932
17933 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17934
17935 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17936
17937 Integer signedness and overflow and related fixes. (Bug#9079)
17938
17939 * bidi.c: Integer size and overflow fixes.
17940 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17941 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17942 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17943 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17944 (bidi_find_other_level_edge):
17945 Use ptrdiff_t instead of EMACS_INT where either will do.
17946 This works better on 32-bit hosts configured --with-wide-int.
17947 (bidi_cache_ensure_space): Check for size-calculation overflow.
17948 Use % rather than repeated addition, for better worst-case speed.
17949 Don't set bidi_cache_size until after xrealloc returns, because it
17950 might not return.
17951 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
17952 (bidi_cache_ensure_space): Also check that the bidi cache size
17953 does not exceed that of the largest Lisp string or buffer. See Eli
17954 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
17955
17956 * alloc.c (__malloc_size_t): Remove.
17957 All uses replaced by size_t. See Andreas Schwab's note
17958 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17959
17960 * image.c: Improve checking for integer overflow.
17961 (check_image_size): Assume that f is nonnull, since
17962 it is always nonnull in practice. This is one less thing to
17963 worry about when checking for integer overflow later.
17964 (x_check_image_size): New function, which checks for integer
17965 overflow issues inside X.
17966 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17967 This removes the need for a memory_full check.
17968 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17969 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17970 (xbm_read_bitmap_data): Change locals back to 'int', since
17971 their values must fit in 'int'.
17972 (xpm_load_image, png_load, tiff_load):
17973 Invoke x_create_x_image_and_pixmap earlier,
17974 to avoid much needless work if the image is too large.
17975 (tiff_load): Treat overly large images as if
17976 x_create_x_image_and_pixmap failed, not as malloc failures.
17977 (gs_load): Use x_check_image_size.
17978
17979 * gtkutil.c: Omit integer casts.
17980 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17981 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17982
17983 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17984
17985 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17986 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17987 would wrongly return t on a 64-bit host.
17988
17989 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17990 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17991 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17992 and therefore cause GCC to emit a bogus diagnostic in some cases.
17993
17994 * image.c: Integer signedness and overflow and related fixes.
17995 This is not an exhaustive set of fixes, but it's time to
17996 record what I've got.
17997 (lookup_pixel_color, check_image_size): Remove redundant decls.
17998 (check_image_size): Don't assume that arbitrary EMACS_INT values
17999 fit in 'int', or that arbitrary 'double' values fit in 'int'.
18000 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
18001 (tiff_load, imagemagick_load_image):
18002 Check for overflow in size calculations.
18003 (x_create_x_image_and_pixmap): Remove unnecessary test for
18004 xmalloc returning NULL; that can't happen.
18005 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
18006 (xpm_color_bucket): Use better integer hashing function.
18007 (xpm_cache_color): Don't possibly over-allocate memory.
18008 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
18009 (gif_memory_source):
18010 Use ptrdiff_t, not int or size_t, to record sizes.
18011 (png_load): Don't assume values greater than 2**31 fit in 'int'.
18012 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
18013 either works, as we prefer signed integers.
18014 (tiff_read_from_memory, tiff_write_from_memory):
18015 Return tsize_t, not size_t, since that's what the TIFF API wants.
18016 (tiff_read_from_memory): Don't fail simply because the read would
18017 go past EOF; instead, return a short read.
18018 (tiff_load): Omit no-longer-needed casts.
18019 (Fimagemagick_types): Don't assume size fits into 'int'.
18020
18021 Improve hashing quality when configured --with-wide-int.
18022 * fns.c (hash_string): New function, taken from sxhash_string.
18023 Do not discard information about ASCII character case; this
18024 discarding is no longer needed.
18025 (sxhash-string): Use it. Change sig to match it. Caller changed.
18026 * lisp.h: Declare it.
18027 * lread.c (hash_string): Remove, since we now use fns.c's version.
18028 The fns.c version returns a wider integer if --with-wide-int is
18029 specified, so this should help the quality of the hashing a bit.
18030
18031 * emacs.c: Integer overflow minor fix.
18032 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
18033 Define only if GNU_LINUX.
18034 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
18035
18036 * dispnew.c: Integer signedness and overflow fixes.
18037 Remove unnecessary forward decls, that were a maintenance hassle.
18038 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
18039 All uses changed.
18040 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
18041 (scrolling_window): Use ptrdiff_t, not int, for byte count.
18042 (prepare_desired_row, line_draw_cost):
18043 Use int, not unsigned, where either works.
18044 (save_current_matrix, restore_current_matrix):
18045 Use ptrdiff_t, not size_t, where either works.
18046 (init_display): Check for overflow more accurately, and without
18047 relying on undefined behavior.
18048
18049 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
18050 Remove, replacing with the new symbols in lisp.h. All uses changed.
18051 * fileio.c (make_temp_name):
18052 * filelock.c (lock_file_1, lock_file):
18053 * xdisp.c (message_dolog):
18054 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
18055 Use pMd etc. instead.
18056 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
18057 replacing the pWIDE etc. symbols removed from editfns.c.
18058
18059 * keyboard.h (num_input_events): Now uintmax_t.
18060 This is (very slightly) less likely to mess up due to wraparound.
18061 All uses changed.
18062
18063 * buffer.c: Integer signedness fixes.
18064 (alloc_buffer_text, enlarge_buffer_text):
18065 Use ptrdiff_t rather than size_t when either will do, as we prefer
18066 signed integers.
18067
18068 * alloc.c: Integer signedness and overflow fixes.
18069 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
18070 (__malloc_size_t): Default to size_t, not to int.
18071 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
18072 (Fgarbage_collect, mark_object_loop_halt, mark_object):
18073 Prefer ptrdiff_t to size_t when either would do, as we prefer
18074 signed integers.
18075 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
18076 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
18077 Now const. Initialize with values that are in range even if char
18078 is signed.
18079 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
18080 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
18081 These functions do the right thing with sizes > 2**32.
18082 (check_depth): Now ptrdiff_t, not int.
18083 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
18084 Adjust to new way of storing sizes. Check for size overflow bugs
18085 in rest of code.
18086 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
18087 slightly wrong anyway, as it missed one instance of
18088 XMALLOC_OVERRUN_CHECK_OVERHEAD.
18089 (refill_memory_reserve): Omit needless cast to size_t.
18090 (mark_object_loop_halt): Mark as externally visible.
18091
18092 * xselect.c: Integer signedness and overflow fixes.
18093 (Fx_register_dnd_atom, x_handle_dnd_message):
18094 Use ptrdiff_t, not size_t, since we prefer signed.
18095 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
18096 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
18097 x_dnd_atoms_size and x_dnd_atoms_length.
18098
18099 * doprnt.c: Prefer signed to unsigned when either works.
18100 * eval.c (verror):
18101 * doprnt.c (doprnt):
18102 * lisp.h (doprnt):
18103 * xdisp.c (vmessage):
18104 Use ptrdiff_t, not size_t, when using or implementing doprnt,
18105 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
18106 prefer signed arithmetic to avoid comparison confusion.
18107 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
18108 but is a bit tricky.
18109
18110 Assume freestanding C89 headers, string.h, stdlib.h.
18111 * data.c, doprnt.c, floatfns.c, print.c:
18112 Include float.h unconditionally.
18113 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
18114 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
18115 * regex.c: Likewise for stddef.h, string.h.
18116 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
18117 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
18118 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
18119 (STDC_HEADERS): Remove obsolete defines.
18120 * sysdep.c: Include limits.h unconditionally.
18121
18122 Assume support for memcmp, memcpy, memmove, memset.
18123 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
18124 * regex.c (memcmp, memcpy):
18125 Remove; we assume C89 now.
18126
18127 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
18128 (__malloc_safe_bcopy): Remove; no longer needed.
18129
18130 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
18131 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
18132 well either way, and we prefer signed to unsigned.
18133
18134 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
18135
18136 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
18137 closes the connection while we're reading (bug#9182).
18138
18139 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
18140
18141 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
18142 are specified (Bug#9168).
18143
18144 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
18145
18146 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18147 Found by GCC static checking and --with-wide-int on a 32-bit host.
18148
18149 2011-07-25 Eli Zaretskii <eliz@gnu.org>
18150
18151 * xdisp.c (compute_display_string_pos): Fix logic of caching
18152 previous display string position. Initialize cached_prev_pos to
18153 -1. Fixes slow-down at the beginning of a buffer.
18154
18155 2011-07-24 Eli Zaretskii <eliz@gnu.org>
18156
18157 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18158 for attrs[LFACE_FONTSET_INDEX].
18159
18160 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18161
18162 * xml.c (parse_region): Remove unused local
18163 that was recently introduced.
18164
18165 2011-07-23 Eli Zaretskii <eliz@gnu.org>
18166
18167 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18168 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18169
18170 * xdisp.c (move_it_in_display_line_to): Record the best matching
18171 position for TO_CHARPOS while scanning the line, and restore it on
18172 exit if none of the characters scanned was an exact match.
18173 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
18174 when exact match is impossible due to invisible text, and the
18175 lines are truncated.
18176
18177 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18178
18179 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18180 for OSX >= 10.7.
18181
18182 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18183
18184 Fix a significant slow-down of cursor motion with C-n, C-p,
18185 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18186 auto-repeat under bidi redisplay in fontified buffers.
18187 * xdisp.c (compute_stop_pos_backwards): New function.
18188 (next_element_from_buffer): Call compute_stop_pos_backwards to
18189 find a suitable prev_stop when we find ourselves before
18190 base_level_stop.
18191 (reseat): Don't look for prev_stop, as that could mean a very long
18192 run.
18193 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18194 <cached_disp_overlay_modiff>: Cache for last found display string
18195 position.
18196 (compute_display_string_pos): Return the cached position if asked
18197 about the same buffer in the same area of character positions, and
18198 the buffer wasn't changed since the time the display string
18199 position was cached.
18200
18201 2011-07-22 Eli Zaretskii <eliz@gnu.org>
18202
18203 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18204 is an integer, which is important for empty lines. (Bug#9149)
18205
18206 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
18207
18208 * frame.c (Fmodify_frame_parameters): In tty case, update the
18209 default face if necessary (Bug#4238).
18210
18211 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
18212
18213 * editfns.c (Fstring_to_char): No need to explain what a character
18214 is in the docstring (Bug#6576).
18215
18216 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18217
18218 * xml.c (parse_region): Make sure we always return a tree.
18219
18220 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18221
18222 * xml.c (parse_region): If a document contains only comments,
18223 return that, too.
18224
18225 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18226
18227 * xml.c (make_dom): Return comments, too.
18228
18229 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18230
18231 Port to OpenBSD.
18232 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18233 and the surrounding thread.
18234 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18235 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18236 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18237 timer goes off.
18238 * s/openbsd.h (BROKEN_SIGIO): Define.
18239 * unexelf.c (unexec) [__OpenBSD__]:
18240 Don't update the .mdebug section of the Alpha COFF symbol table.
18241
18242 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18243
18244 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18245 (bug#8460).
18246
18247 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18248
18249 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18250 This fixes some race conditions on the permissions of any newly
18251 created file.
18252
18253 * alloc.c (valid_pointer_p): Use pipe, not open.
18254 This fixes some permissions issues when debugging.
18255
18256 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18257 If fchown fails to set both uid and gid, try to set just gid,
18258 as that is sometimes allowed. Adjust the file's mode to eliminate
18259 setuid or setgid bits that are inappropriate if fchown fails.
18260
18261 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18262
18263 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18264 to compare Lisp_Objects.
18265 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18266 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18267 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18268
18269 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18270
18271 * lread.c (read_integer): Unread even EOF character.
18272 (read1): Likewise. Properly record start position of symbol.
18273
18274 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18275 symbol character follows.
18276
18277 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18278
18279 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18280 This works around a problem with the previous change to Fcopy_file.
18281 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18282 and without this change, GCC might complain about discarding
18283 fchown's return value.
18284
18285 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
18286
18287 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18288
18289 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18290
18291 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18292
18293 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18294
18295 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18296 it's used from the C level.
18297
18298 * process.c: Use the same condition for POLL_FOR_INPUT in both
18299 keyboard.c and process.c (bug#1858).
18300
18301 2011-07-09 Lawrence Mitchell <wence@gmx.li>
18302
18303 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18304 (Fgnutls_boot): Use it.
18305
18306 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18307
18308 * doc.c (Fsubstitute_command_keys): Revert last change.
18309
18310 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18311
18312 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18313 quotes the next character, and doesn't affect other longer
18314 sequences (bug#8935).
18315
18316 * lread.c (syms_of_lread): Clarify that is isn't only
18317 `eval-buffer' and `eval-defun' that's affected by
18318 `lexical-binding' (bug#8460).
18319
18320 2011-07-15 Eli Zaretskii <eliz@gnu.org>
18321
18322 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
18323 bidi redisplay when a line includes both an image and is truncated.
18324
18325 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18326
18327 Fix minor problems found by static checking.
18328 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18329 (elsz): Now a signed constant, not a size_t var. We prefer signed
18330 types to unsigned, to avoid integer comparison confusion. Without
18331 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18332 "cannot optimize loop, the loop counter may overflow", a symptom
18333 of the confusion.
18334 * indent.c (Fvertical_motion): Mark locals as initialized.
18335 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18336
18337 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18338
18339 * search.c (Fre_search_backward): Mention `case-fold-search' in
18340 all the re_search_* functions (bug#8138).
18341
18342 * keyboard.c (Fopen_dribble_file): Document when the file is
18343 closed (bug#8056).
18344
18345 2011-07-14 Eli Zaretskii <eliz@gnu.org>
18346
18347 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18348 bidi_cache_idx.
18349
18350 Support bidi reordering of display and overlay strings.
18351 * xdisp.c (compute_display_string_pos)
18352 (compute_display_string_end): Accept additional argument STRING.
18353 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18354 (reseat_to_string): Initialize bidi_it->string.s and
18355 bidi_it->string.schars.
18356 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
18357 NULL (avoids a crash in bidi_paragraph_init).
18358 Initialize itb.string.lstring.
18359 (init_iterator): Call bidi_init_it only of a valid
18360 buffer position was specified. Initialize paragraph_embedding to
18361 L2R.
18362 (reseat_to_string): Initialize the bidi iterator.
18363 (display_string): If we need to ignore text properties of
18364 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18365 original value of -1 will not work with bidi.)
18366 (compute_display_string_pos): First arg is now struct
18367 `text_pos *'; all callers changed. Support display properties on
18368 Lisp strings.
18369 (compute_display_string_end): Support display properties on Lisp
18370 strings.
18371 (init_iterator, reseat_1, reseat_to_string): Initialize the
18372 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18373 when iterating on a string not from display properties).
18374 (compute_display_string_pos, compute_display_string_end):
18375 Fix calculation of the object to scan. Fixes an error when using
18376 arrow keys.
18377 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
18378 base_level_stop; instead, set base_level_stop to BEGV.
18379 Fixes crashes in vertical-motion.
18380 (next_element_from_buffer): Improve commentary for when
18381 the iterator is before prev_stop.
18382 (init_iterator): Initialize bidi_p from the default value of
18383 bidi-display-reordering, not from buffer-local value. Use the
18384 buffer-local value only if initializing for buffer iteration.
18385 (handle_invisible_prop): Support invisible properties on strings
18386 that are being bidi-reordered.
18387 (set_iterator_to_next): Support bidi reordering of C strings and
18388 Lisp strings.
18389 (next_element_from_string): Support bidi reordering of Lisp
18390 strings.
18391 (handle_stop_backwards): Support Lisp strings as well.
18392 (display_string): Support display of R2L glyph rows.
18393 Use IT_STRING_CHARPOS when displaying from a Lisp string.
18394 (init_iterator): Don't initialize it->bidi_p for strings
18395 here.
18396 (reseat_to_string): Initialize it->bidi_p for strings here.
18397 (next_element_from_string, next_element_from_c_string)
18398 (next_element_from_buffer): Add xassert's for correspondence
18399 between IT's object being iterated and it->bidi_it.string
18400 structure.
18401 (face_before_or_after_it_pos): Support bidi iteration.
18402 (next_element_from_c_string): Handle the case of the first string
18403 character that is not the first one in the visual order.
18404 (get_visually_first_element): New function, refactored from common
18405 parts of next_element_from_buffer, next_element_from_string, and
18406 next_element_from_c_string.
18407 (tool_bar_lines_needed, redisplay_tool_bar)
18408 (display_menu_bar): Force left-to-right direction. Add a FIXME
18409 comment for making that be controlled by a user option.
18410 (push_it, pop_it): Save and restore the state of the
18411 bidi iterator. Save and restore the bidi_p flag.
18412 (pop_it): Iterate out of display property for string iteration as
18413 well.
18414 (iterate_out_of_display_property): Support iteration over strings.
18415 (handle_single_display_spec): Set up it->bidi_it for iteration
18416 over a display string, and call bidi_init_it.
18417 (handle_single_display_spec, next_overlay_string)
18418 (get_overlay_strings_1, push_display_prop): Set up the bidi
18419 iterator for displaying display or overlay strings.
18420 (forward_to_next_line_start): Don't use the shortcut if
18421 bidi-iterating.
18422 (back_to_previous_visible_line_start): If handle_display_prop
18423 pushed the iterator stack, restore the internal state of the bidi
18424 iterator by calling bidi_pop_it same number of times.
18425 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18426 and we are bidi-iterating, don't decrement the iterator position;
18427 instead, set the first_elt flag in the bidi iterator, to produce
18428 the same effect.
18429 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18430 (push_display_prop): xassert that we are iterating a buffer.
18431 (push_it, pop_it): Save and restore paragraph_embedding member.
18432 (handle_single_display_spec, next_overlay_string)
18433 (get_overlay_strings_1, reseat_1, reseat_to_string)
18434 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18435 correctly. Don't assume unibyte strings are not bidi-reordered.
18436 (compute_display_string_pos)
18437 (compute_display_string_end): Fix handling the case of C string.
18438 (push_it, pop_it): Save and restore from_disp_prop_p.
18439 (handle_single_display_spec, push_display_prop): Set the
18440 from_disp_prop_p flag.
18441 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18442 (pop_it): Call iterate_out_of_display_property only if we are
18443 popping after iteration over a string that came from a display
18444 property. Fix a typo in popping stretch info. Add an assertion
18445 for verifying that the iterator position is in sync with the bidi
18446 iterator.
18447 (handle_single_display_spec, get_overlay_strings_1)
18448 (push_display_prop): Fix initialization of paragraph direction for
18449 string when that of the parent object is not yet determined.
18450 (reseat_1): Call bidi_init_it to resync the bidi
18451 iterator with IT's position. (Bug#7616)
18452 (find_row_edges): If ROW->start.pos gives position
18453 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18454 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18455 Reset the from_disp_prop_p flag.
18456 (SAVE_IT, RESTORE_IT): New macros.
18457 (pos_visible_p, face_before_or_after_it_pos)
18458 (back_to_previous_visible_line_start)
18459 (move_it_in_display_line_to, move_it_in_display_line)
18460 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18461 (try_scrolling, redisplay_window, display_line): Use them when
18462 saving a temporary copy of the iterator and restoring it back.
18463 (back_to_previous_visible_line_start, reseat_1)
18464 (init_iterator): Empty the bidi cache "stack".
18465 (move_it_in_display_line_to): If iterator ended up at
18466 EOL, but we never saw any buffer positions smaller than
18467 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18468 motion in bidi-reordered lines.
18469 (move_it_in_display_line_to): Record prev_method and prev_pos
18470 immediately before the call to set_iterator_to_next. Fixes cursor
18471 motion in bidi-reordered lines with stretch glyphs and strings
18472 displayed in margins. (Bug#8133) (Bug#8867)
18473 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18474 TO_CHARPOS.
18475 (pos_visible_p): Support positions in bidi-reordered lines.
18476 Save and restore bidi cache.
18477
18478 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18479 (bidi_paragraph_info): Delete unused struct.
18480 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18481 (bidi_cache_start): New variable.
18482 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18483 to zero.
18484 (bidi_cache_fetch_state, bidi_cache_search)
18485 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18486 (bidi_cache_find, bidi_peek_at_next_level)
18487 (bidi_level_of_next_char, bidi_find_other_level_edge)
18488 (bidi_move_to_visually_next): Compare cache index with
18489 bidi_cache_start rather than with zero.
18490 (bidi_fetch_char): Accept new argument STRING; all callers
18491 changed. Support iteration over a string. Support strings with
18492 display properties. Support unibyte strings. Fix the type of
18493 `len' according to what STRING_CHAR_AND_LENGTH expects.
18494 (bidi_paragraph_init, bidi_resolve_explicit_1)
18495 (bidi_resolve_explicit, bidi_resolve_weak)
18496 (bidi_level_of_next_char, bidi_move_to_visually_next):
18497 Support iteration over a string.
18498 (bidi_set_sor_type, bidi_resolve_explicit_1)
18499 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18500 can now be zero (for strings); special values 0 and -1 were
18501 changed to -1 and -2, respectively.
18502 (bidi_char_at_pos): New function.
18503 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18504 Call it instead of FETCH_MULTIBYTE_CHAR.
18505 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18506 initialized to valid values.
18507 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18508 values.
18509 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18510 the test for valid cached positions. Fix the logic for looking up
18511 the sentinel state in the cache. GCPRO the Lisp string we are
18512 iterating.
18513 (bidi_push_it, bidi_pop_it): New functions.
18514 (bidi_initialize): Initialize the bidi cache start stack pointer.
18515 (bidi_cache_ensure_space): New function, refactored from part of
18516 bidi_cache_iterator_state. Don't assume the required size is just
18517 one BIDI_CACHE_CHUNK away.
18518 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18519 (bidi_count_bytes, bidi_char_at_pos): New functions.
18520 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18521 always valid if bidi_cache_idx is valid.
18522 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18523 is valid if it's going to be used.
18524 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18525 (bidi_cache_fetch_state, bidi_cache_search)
18526 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18527 (bidi_cache_iterator_state, bidi_cache_find)
18528 (bidi_find_other_level_edge, bidi_cache_start_stack):
18529 All variables related to cache indices are now EMACS_INT.
18530
18531 * dispextern.h (struct bidi_string_data): New structure.
18532 (struct bidi_it): New member `string'. Make flag members be 1-bit
18533 fields, and put them last in the struct.
18534 (compute_display_string_pos, compute_display_string_end):
18535 Update prototypes.
18536 (bidi_push_it, bidi_pop_it): Add prototypes.
18537 (struct iterator_stack_entry): New members bidi_p,
18538 paragraph_embedding, and from_disp_prop_p.
18539 (struct it): Member bidi_p is now a bit field 1 bit wide.
18540 (bidi_shelve_cache, bidi_unshelve_cache):
18541 Declare prototypes.
18542
18543 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18544 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18545 and vector-like objects.
18546
18547 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18548 cache around display iteration.
18549
18550 * window.c (Fwindow_end, window_scroll_pixel_based)
18551 (displayed_window_lines, Frecenter): Save and restore the bidi
18552 cache around display iteration.
18553
18554 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18555
18556 * editfns.c (Fdelete_region): Clarify the use of the named
18557 parameters (bug#6788).
18558
18559 2011-07-14 Martin Rudalics <rudalics@gmx.at>
18560
18561 * indent.c (Fvertical_motion): Set and restore w->pointm when
18562 saving and restoring the window's buffer (Bug#9006).
18563
18564 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18565
18566 * editfns.c (Fstring_to_char): Clarify just what is returned
18567 (bug#6576). Text by Eli Zaretskii.
18568
18569 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
18570
18571 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18572
18573 2011-07-13 Eli Zaretskii <eliz@gnu.org>
18574
18575 * buffer.c (mmap_find): Fix a typo.
18576
18577 2011-07-13 Johan Bockgård <bojohan@gnu.org>
18578
18579 Fix execution of x selection hooks.
18580 * xselect.c (Qx_lost_selection_functions)
18581 (Qx_sent_selection_functions): New vars.
18582 (syms_of_xselect): DEFSYM them.
18583 (x_handle_selection_request): Pass Qx_sent_selection_functions
18584 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18585 (x_handle_selection_clear,x_clear_frame_selections):
18586 Pass Qx_lost_selection_functions rather than
18587 Vx_lost_selection_functions to Frun_hook_with_args.
18588
18589 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18590
18591 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
18592 The old code sometimes used this field without initializing it.
18593
18594 * alloc.c (gc_sweep): Don't read past end of array.
18595 In theory, the old code could also have corrupted Emacs internals,
18596 though it'd be very unlikely.
18597
18598 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18599
18600 * character.c (Fcharacterp): Don't advertise optional ignored
18601 argument. (Bug#4026)
18602
18603 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18604
18605 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18606 key" (bug#4257).
18607
18608 * window.c (Fset_window_start): Doc fix (bug#4199).
18609 (Fset_window_hscroll): Ditto.
18610
18611 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18612
18613 Fix minor new problems caught by GCC 4.6.1.
18614 * term.c (init_tty): Remove unused local.
18615 * xsettings.c (store_monospaced_changed): Define this function only
18616 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
18617 not used otherwise.
18618
18619 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
18620
18621 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18622
18623 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18624
18625 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18626 are the mini-buffer and the echo area (bug#3320).
18627
18628 * term.c (init_tty): Remove support for supdup, c10 and perq
18629 terminals, which are no longer supported (bug#1482).
18630
18631 2011-07-10 Johan Bockgård <bojohan@gnu.org>
18632
18633 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18634
18635 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18636
18637 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18638 for non-popups (Bug#3642).
18639
18640 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18641
18642 * alloc.c (reset_malloc_hooks): Protoize.
18643 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
18644 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18645 * cm.c (losecursor): Likewise.
18646 * data.c (fmod): Likewise.
18647 * dispnew.c (swap_glyphs_in_rows): Likewise.
18648 * emacs.c (memory_warning_signal): Likewise.
18649 * floatfns.c (float_error): Likewise.
18650 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18651 (otf_open, font_otf_capability, generate_otf_features)
18652 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18653 Likewise.
18654 * image.c (pbm_read_file): Likewise.
18655 * indent.c (string_display_width): Likewise.
18656 * intervals.c (check_for_interval, search_for_interval)
18657 (inc_interval_count, count_intervals, root_interval)
18658 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18659 * lread.c (defalias): Likewise.
18660 * ralloc.c (r_alloc_check): Likewise.
18661 * regex.c (set_image_of_range_1, set_image_of_range)
18662 (regex_grow_registers): Likewise.
18663 * sysdep.c (strerror): Likewise.
18664 * termcap.c (valid_filename_p, tprint, main): Likewise.
18665 * tparam.c (main): Likewise.
18666 * unexhp9k800.c (run_time_remap, save_data_space)
18667 (update_file_ptrs, read_header, write_header, calculate_checksum)
18668 (copy_file, copy_rest, display_header): Likewise.
18669 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18670 Likewise.
18671 * xdisp.c (check_it): Likewise.
18672 * xfaces.c (register_color, unregister_color, unregister_colors):
18673 Likewise.
18674 * xfns.c (print_fontset_result): Likewise.
18675 * xrdb.c (member, fatal, main): Likewise.
18676
18677 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18678
18679 Fix minor problems found by static checking (Bug#9031).
18680 * chartab.c (char_table_set_range, map_sub_char_table):
18681 Remove unused locals.
18682 (uniprop_table): Now static.
18683 * composite.c (_work_char): Remove unused static var.
18684
18685 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
18686
18687 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18688
18689 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18690
18691 * gtkutil.c (qttip_cb): Remove code without function.
18692
18693 2011-07-09 Eli Zaretskii <eliz@gnu.org>
18694
18695 * w32.c (pthread_sigmask): New stub.
18696
18697 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
18698
18699 Use pthread_sigmask, not sigprocmask (Bug#9010).
18700 sigprocmask is portable only for single-threaded applications, and
18701 Emacs can be multi-threaded when it uses GTK.
18702 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18703 (LIBES): Use it.
18704 * callproc.c (Fcall_process):
18705 * process.c (create_process):
18706 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18707 Use pthread_sigmask, not sigprocmask.
18708
18709 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18710
18711 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18712 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18713 wrong (Bug#8591).
18714
18715 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18716
18717 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18718 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18719 (xg_hide_tooltip): Fix comment.
18720
18721 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18722 in registerServicesMenuSendTypes.
18723 (validRequestorForSendType): Don't check ns_return_types.
18724
18725 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18726 ns_return_type.
18727
18728 2011-07-08 Jason Rumney <jasonr@gnu.org>
18729
18730 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18731 SH_SHOW for hidden windows (Bug#5482).
18732
18733 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18734 frame struct members of non-existent frames (Bug#6284).
18735
18736 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18737
18738 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18739 variable firstTime not needed on OSX >= 10.6.
18740 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18741 >= 10.5. Use setKnobProportion, setDoubleValue.
18742
18743 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18744 (MAC_OS_X_VERSION_10_5): Define if not defined.
18745 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18746 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18747 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18748
18749 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
18750 cString and lossyCString on OSX >= 10.4.
18751
18752 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
18753 sizeToFit on OSX >= 10.2.
18754
18755 * nsimage.m (allocInitFromFile): Don't use deprecated method
18756 bestRepresentationForDevice on OSX >= 10.6.
18757
18758 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18759 to avoid warning.
18760
18761 * emacs.c: Declare unexec_init_emacs_zone.
18762
18763 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18764
18765 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18766
18767 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18768 on svcsMenu (Bug#8842).
18769
18770 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18771 ns_return_types.
18772 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18773
18774 * nsterm.m (QUTF8_STRING): Declare.
18775 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18776 (validRequestorForSendType): Return type is (id).
18777 Change indexOfObjectIdenticalTo to indexOfObject.
18778 Check if we have local selection before returning self (Bug#8842).
18779 (writeSelectionToPasteboard): Put local selection into paste board
18780 if we have a local selection (Bug#8842).
18781 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18782
18783 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18784 (ns_get_local_selection): Declare.
18785
18786 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18787
18788 * keymap.c (describe_map_tree): Don't insert a double newline at
18789 the end of the buffer (bug#1169) and return whether we inserted
18790 something.
18791
18792 * callint.c (Fcall_interactively): Change "reading args" to
18793 "providing args" to try to clarify what it does (bug#1010).
18794
18795 2011-07-07 Kenichi Handa <handa@m17n.org>
18796
18797 * composite.c (composition_compute_stop_pos): Ignore a static
18798 composition starting before CHARPOS (Bug#8915).
18799
18800 * xdisp.c (handle_composition_prop): Likewise.
18801
18802 2011-07-07 Eli Zaretskii <eliz@gnu.org>
18803
18804 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18805 (Bug#9015)
18806
18807 2011-07-07 Kenichi Handa <handa@m17n.org>
18808
18809 * character.h (unicode_category_t): New enum type.
18810
18811 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18812 (Qchar_code_property_table): New variable.
18813 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18814 (UNIPROP_COMPRESSED_FORM_P): New macros.
18815 (char_table_ascii): Uncompress the compressed values.
18816 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18817 Uncompress the compressed values.
18818 (sub_char_table_ref_and_range): Likewise.
18819 (char_table_ref_and_range): Uncompress the compressed values.
18820 (sub_char_table_set): New arg is_uniprop. Callers changed.
18821 Uncompress the compressed values.
18822 (sub_char_table_set_range): Args changed. Callers changed.
18823 (char_table_set_range): Adjuted for the above change.
18824 (map_sub_char_table): Delete args default_val and parent. Add arg
18825 top. Give decoded values to a Lisp function.
18826 (map_char_table): Adjust for the above change. Give decoded
18827 values to a Lisp function. Gcpro more variables.
18828 (uniprop_table_uncompress)
18829 (uniprop_decode_value_run_length): New functions.
18830 (uniprop_decoder, uniprop_decoder_count): New variables.
18831 (uniprop_get_decoder, uniprop_encode_value_character)
18832 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18833 New functions.
18834 (uniprop_encoder, uniprop_encoder_count): New variables.
18835 (uniprop_get_encoder, uniprop_table)
18836 (Funicode_property_table_internal, Fget_unicode_property_internal)
18837 (Fput_unicode_property_internal): New functions.
18838 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18839 Sunicode_property_table_internal, Sget_unicode_property_internal,
18840 and Sput_unicode_property_internal. Defvar_lisp
18841 char-code-property-alist.
18842
18843 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
18844 Vunicode_category_table.
18845
18846 * font.c (font_range): Adjust for the change of
18847 Vunicode_category_table.
18848
18849 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18850
18851 * m/iris4d.h: Remove file, move contents ...
18852 * s/irix6-5.h: ... here.
18853
18854 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18855
18856 Remove unportable assumption about struct layout (Bug#8884).
18857 * alloc.c (mark_buffer):
18858 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18859 (clone_per_buffer_values): Don't assume that
18860 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18861 This isn't true in general, and it's particularly not true
18862 if Emacs is configured with --with-wide-int.
18863 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18864 New macros, used in the buffer.c change.
18865
18866 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18867
18868 * xsettings.c: Use both GConf and GSettings if both are available.
18869 (store_config_changed_event): Add comment.
18870 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18871 (store_tool_bar_style_changed): New functions.
18872 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
18873 (struct xsettings): Move font inside HAVE_XFT.
18874 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
18875 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
18876 Move inside HAVE_XFT.
18877 (something_changed_gsettingsCB): Rename from something_changedCB.
18878 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18879 also.
18880 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
18881 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
18882 (something_changed_gconfCB): Rename from something_changedCB.
18883 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18884 (parse_settings): Move check for font inside HAVE_XFT.
18885 (read_settings, apply_xft_settings): Add comment.
18886 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18887 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18888 call store_font_name_changed.
18889 (xft_settings_event): Add comment.
18890 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18891 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18892 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18893 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18894 (xsettings_initialize): Call init_gsettings last.
18895 (xsettings_get_system_font, xsettings_get_system_normal_font):
18896 Add comment.
18897
18898 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18899
18900 Random fixes. E.g., (random) never returned negative values.
18901 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18902 subseconds part to the entropy, as that's a bit more random.
18903 Prefer signed to unsigned, since the signedness doesn't matter and
18904 in general we prefer signed. When given a limit, use a
18905 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18906 latter isn't right if USE_2_TAGS_FOR_INTS.
18907 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18908 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18909
18910 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18911
18912 * textprop.c (text_property_stickiness):
18913 Obey Vtext_property_default_nonsticky.
18914 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18915 * w32fns.c (syms_of_w32fns):
18916 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18917
18918 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18919
18920 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18921 This is more efficient than Ffile_directory_p and avoids a minor race.
18922
18923 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18924
18925 * buffer.c (Foverlay_put): Say what the return value is
18926 (bug#7835).
18927
18928 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18929 is a directory before asking whether to use the file name
18930 (bug#7564).
18931 (barf_or_query_if_file_exists): Make the "File is a directory"
18932 error be more correct.
18933
18934 * fns.c (Frequire): Remove the mention of the .gz files, since
18935 that's installation-specific, but keep the mention of
18936 `get-load-suffixes'.
18937
18938 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18939
18940 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18941 Report string overflow if the output is too long.
18942
18943 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
18944
18945 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18946 (syms_of_gnutls): Remove duplicate DEFSYM for
18947 Qgnutls_bootprop_verify_hostname_error, an error for
18948 Qgnutls_bootprop_verify_error (which is no longer used).
18949
18950 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18951 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18952 Also (re)move comments that are misplaced or no longer relevant.
18953
18954 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18955
18956 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18957
18958 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
18959
18960 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18961 and background color parameters if they have been changed.
18962
18963 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18964
18965 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18966
18967 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18968
18969 * xsettings.c (SYSTEM_FONT): Define only when used.
18970 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18971
18972 * keymap.c (access_keymap_1): Now static.
18973
18974 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
18975
18976 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18977 leave any prefix arg for the up event (Bug#1586).
18978
18979 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18980
18981 * lread.c (syms_of_lread): Mention single symbols defined by
18982 `defvar' or `defconst' (bug#7154).
18983
18984 * fns.c (Frequire): Mention .el.gz files (bug#7314).
18985 (Frequire): Mention get-load-suffixes.
18986
18987 2011-07-02 Martin Rudalics <rudalics@gmx.at>
18988
18989 * window.h (window): Remove clone_number slot.
18990 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18991 Remove.
18992 (make_parent_window, make_window, saved_window)
18993 (Fset_window_configuration, save_window_save): Don't deal with
18994 clone numbers.
18995 * buffer.c (Qclone_number): Remove declaration.
18996 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18997
18998 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18999
19000 Add multiple inheritance to keymaps.
19001 * keymap.c (Fmake_composed_keymap): New function.
19002 (Fset_keymap_parent): Simplify.
19003 (fix_submap_inheritance): Remove.
19004 (access_keymap_1): New function extracted from access_keymap to handle
19005 embedded parents and handle lists of maps.
19006 (access_keymap): Use it.
19007 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
19008 (Fcopy_keymap): Handle embedded parents.
19009 (Fcommand_remapping, define_as_prefix): Simplify.
19010 (Fkey_binding): Simplify.
19011 (syms_of_keymap): Move minibuffer-local-completion-map,
19012 minibuffer-local-filename-completion-map,
19013 minibuffer-local-must-match-map, and
19014 minibuffer-local-filename-must-match-map to Elisp.
19015 (syms_of_keymap): Defsubr make-composed-keymap.
19016 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
19017 (parse_menu_item): Trivial simplification.
19018
19019 2011-07-01 Glenn Morris <rgm@gnu.org>
19020
19021 * Makefile.in (SETTINGS_LIBS): Fix typo.
19022
19023 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
19024
19025 * coding.c (Fencode_coding_string): Record the last coding system
19026 used, as the function doc string says (bug#8738).
19027
19028 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
19029
19030 * xsettings.c (store_monospaced_changed): Take new font as arg and
19031 check for change against current_mono_font.
19032 (EMACS_TYPE_SETTINGS): Remove this and related defines.
19033 (emacs_settings_constructor, emacs_settings_get_property)
19034 (emacs_settings_set_property, emacs_settings_class_init)
19035 (emacs_settings_init, gsettings_obj): Remove.
19036 (something_changedCB): New function for HAVE_GSETTINGS.
19037 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
19038 with value as argument.
19039 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
19040 g_settings_new (Bug#8967). Do not create gsettings_obj.
19041 Remove calls to g_settings_bind. Connect something_changedCB to
19042 "changed".
19043
19044 * xgselect.c: Add defined (HAVE_GSETTINGS).
19045 (xgselect_initialize): Ditto.
19046
19047 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
19048 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
19049 xg_select.
19050
19051 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
19052
19053 * eval.c (struct backtrace): Simplify and port the data structure.
19054 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
19055 signed bit field, as this assumption is not portable and it makes
19056 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
19057 "char debug_on_exit : 1" as this is not portable either; instead,
19058 use the portable "unsigned int debug_on_exit : 1". Remove unused
19059 member evalargs. Remove obsolete comments about cc bombing out.
19060
19061 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
19062
19063 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
19064 Let HAVE_GSETTINGS override HAVE_GCONF.
19065 (store_monospaced_changed): New function.
19066 (EMACS_SETTINGS): A new type derived from GObject to handle
19067 GSettings notifications.
19068 (emacs_settings_constructor, emacs_settings_get_property)
19069 (emacs_settings_set_property, emacs_settings_class_init):
19070 New functions.
19071 (gsettings_client, gsettings_obj): New variables.
19072 (GSETTINGS_SCHEMA): New define.
19073 (something_changedCB): Call store_monospaced_changed.
19074 (init_gsettings): New function.
19075 (xsettings_initialize): Call init_gsettings.
19076 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
19077 to NULL.
19078
19079 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
19080 GCONF_CFLAGS/LIBS.
19081
19082 2011-06-29 Martin Rudalics <rudalics@gmx.at>
19083
19084 * window.c (resize_root_window, grow_mini_window)
19085 (shrink_mini_window): Rename Qresize_root_window to
19086 Qwindow_resize_root_window and Qresize_root_window_vertically to
19087 Qwindow_resize_root_window_vertically.
19088
19089 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
19090
19091 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
19092
19093 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
19094
19095 * makefile.w32-in: Redesign dependencies so they reflect more
19096 clearly which files are directly included by each source file,
19097 and not through other includes.
19098
19099 2011-06-27 Martin Rudalics <rudalics@gmx.at>
19100
19101 * buffer.c (Qclone_number): Declare static and DEFSYM it.
19102 (sort_overlays, overlay_strings): When an overlay's clone number
19103 matches the window's clone number process the overlay even if
19104 the overlay's window property doesn't match the current window.
19105
19106 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
19107 (Fwindow_hchild): Rename to Fwindow_left_child.
19108 (Fwindow_next): Rename to Fwindow_next_sibling.
19109 (Fwindow_prev): Rename to Fwindow_prev_sibling.
19110 (resize_window_check): Rename to window_resize_check.
19111 (resize_window_apply): Rename to window_resize_apply.
19112 (Fresize_window_apply): Rename to Fwindow_resize_apply.
19113 (Fdelete_other_windows_internal, resize_frame_windows)
19114 (Fsplit_window_internal, Fdelete_window_internal)
19115 (grow_mini_window, shrink_mini_window)
19116 (Fresize_mini_window_internal): Fix callers accordingly.
19117
19118 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
19119
19120 * emacsgtkfixed.h: State that this is only used with Gtk+3.
19121 (emacs_fixed_set_min_size): Remove.
19122 (emacs_fixed_new): Take frame as argument.
19123
19124 * emacsgtkfixed.c: State that this is only used with Gtk+3.
19125 (_EmacsFixedPrivate): Remove minwidth/height.
19126 Add struct frame *f.
19127 (emacs_fixed_init): Initialize priv->f.
19128 (get_parent_class, emacs_fixed_set_min_size): Remove.
19129 (emacs_fixed_new): Set priv->f to argument.
19130 (emacs_fixed_get_preferred_width)
19131 (emacs_fixed_get_preferred_height): Use min_width/height from
19132 frames size_hint to set minimum and natural (Bug#8919).
19133 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
19134 and use min_width/height from frames size_hint to set
19135 min_width/height (Bug#8919).
19136
19137 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
19138 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
19139 Fix indentation.
19140
19141 2011-06-26 Eli Zaretskii <eliz@gnu.org>
19142
19143 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
19144 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
19145 called at ZV.
19146
19147 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
19148
19149 * process.c (wait_reading_process_output): Bypass select if
19150 waiting for a cell while ignoring keyboard input, and input is
19151 pending. Suggested by Jan Djärv (Bug#8869).
19152
19153 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19154
19155 Use gnulib's dup2 module instead of rolling our own.
19156 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19157
19158 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19159
19160 * dispnew.c (scrolling_window): Before scrolling, turn off a
19161 mouse-highlight in the window being scrolled.
19162
19163 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
19164
19165 Move DEFSYM to lisp.h and use everywhere.
19166
19167 * character.h (DEFSYM): Move declaration...
19168 * lisp.h (DEFSYM): ...here.
19169
19170 * gnutls.c:
19171 * minibuf.c:
19172 * w32menu.c:
19173 * w32proc.c:
19174 * w32select.c: Don't include character.h.
19175
19176 * alloc.c (syms_of_alloc):
19177 * buffer.c (syms_of_buffer):
19178 * bytecode.c (syms_of_bytecode):
19179 * callint.c (syms_of_callint):
19180 * casefiddle.c (syms_of_casefiddle):
19181 * casetab.c (init_casetab_once):
19182 * category.c (init_category_once, syms_of_category):
19183 * ccl.c (syms_of_ccl):
19184 * cmds.c (syms_of_cmds):
19185 * composite.c (syms_of_composite):
19186 * dbusbind.c (syms_of_dbusbind):
19187 * dired.c (syms_of_dired):
19188 * dispnew.c (syms_of_display):
19189 * doc.c (syms_of_doc):
19190 * editfns.c (syms_of_editfns):
19191 * emacs.c (syms_of_emacs):
19192 * eval.c (syms_of_eval):
19193 * fileio.c (syms_of_fileio):
19194 * fns.c (syms_of_fns):
19195 * frame.c (syms_of_frame):
19196 * fringe.c (syms_of_fringe):
19197 * insdel.c (syms_of_insdel):
19198 * keymap.c (syms_of_keymap):
19199 * lread.c (init_obarray, syms_of_lread):
19200 * macros.c (syms_of_macros):
19201 * msdos.c (syms_of_msdos):
19202 * print.c (syms_of_print):
19203 * process.c (syms_of_process):
19204 * search.c (syms_of_search):
19205 * sound.c (syms_of_sound):
19206 * syntax.c (init_syntax_once, syms_of_syntax):
19207 * terminal.c (syms_of_terminal):
19208 * textprop.c (syms_of_textprop):
19209 * undo.c (syms_of_undo):
19210 * w32.c (globals_of_w32):
19211 * window.c (syms_of_window):
19212 * xdisp.c (syms_of_xdisp):
19213 * xfaces.c (syms_of_xfaces):
19214 * xfns.c (syms_of_xfns):
19215 * xmenu.c (syms_of_xmenu):
19216 * xsettings.c (syms_of_xsettings):
19217 * xterm.c (syms_of_xterm): Use DEFSYM.
19218
19219 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19220
19221 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
19222
19223 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19224
19225 Integer and buffer overflow fixes (Bug#8873).
19226
19227 * print.c (printchar, strout): Check for string overflow.
19228 (PRINTPREPARE, printchar, strout):
19229 Don't set size unless allocation succeeds.
19230
19231 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19232 for sizes. Check for string overflow more accurately.
19233 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19234
19235 * macros.c: Integer and buffer overflow fixes.
19236 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19237 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19238 Use ptrdiff_t, not int, for sizes.
19239 Don't increment bufsize until after realloc succeeds.
19240 Check for size-calculation overflow.
19241 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19242
19243 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19244
19245 * lread.c: Integer overflow fixes.
19246 (read_integer): Radix is now EMACS_INT, not int,
19247 to improve quality of diagnostics for out-of-range radices.
19248 Calculate buffer size correctly for out-of-range radices.
19249 (read1): Check for integer overflow in radices, and in
19250 read-circle numbers.
19251 (read_escape): Avoid int overflow.
19252 (Fload, openp, read_buffer_size, read1)
19253 (substitute_object_recurse, read_vector, read_list, map_obarray):
19254 Use ptrdiff_t, not int, for sizes.
19255 (read1): Use EMACS_INT, not int, for sizes.
19256 Check for size overflow.
19257
19258 * image.c (cache_image): Check for size arithmetic overflow.
19259
19260 * lread.c: Integer overflow issues.
19261 (saved_doc_string_size, saved_doc_string_length)
19262 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19263 Now ptrdiff_t, not int.
19264 (read1): Don't assume doc string length fits in int. Check for
19265 out-of-range doc string lengths.
19266 (read_list): Don't assume file position fits in int.
19267 (read_escape): Check for hex character overflow.
19268
19269 2011-06-22 Leo Liu <sdl.web@gmail.com>
19270
19271 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19272 Move to minibuffer.el.
19273
19274 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19275
19276 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
19277 The following patches are for when GLYPH_DEBUG && !XASSERT.
19278 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19279 * dispnew.c (flush_stdout):
19280 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19281 Mark as externally visible.
19282 * dispnew.c (check_window_matrix_pointers): Now static.
19283 * dispnew.c (window_to_frame_vpos):
19284 * xfns.c (unwind_create_frame):
19285 * xterm.c (x_check_font): Remove unused local.
19286 * scroll.c (CHECK_BOUNDS):
19287 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19288 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19289 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19290 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19291 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19292 Now static.
19293 (debug_method_add): Use va_list and vsprintf rather than relying
19294 on undefined behavior with wrong number of arguments.
19295 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19296 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19297 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19298 since we're not interested in debugging glyphs with old libraries.
19299 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19300 GCC 4.6.0's static checking.
19301
19302 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19303
19304 Integer overflow and signedness fixes (Bug#8873).
19305 A few related buffer overrun fixes, too.
19306
19307 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19308
19309 * dispextern.h (struct face.stipple):
19310 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19311 (x_bitmap_mask, x_allocate_bitmap_record)
19312 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19313 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19314 (x_create_bitmap_from_xpm_data):
19315 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19316 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19317 (.bitmaps_last):
19318 * xfaces.c (load_pixmap):
19319 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19320 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19321 (.bitmaps_last, struct x_output.icon_bitmap):
19322 Use ptrdiff_t, not int, for bitmap indexes.
19323 (x_allocate_bitmap_record): Check for size overflow.
19324 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19325
19326 Use ptrdiff_t, not int, for overlay counts.
19327 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19328 * editfns.c (overlays_around, get_pos_property):
19329 * textprop.c (get_char_property_and_overlay):
19330 * xdisp.c (next_overlay_change, note_mouse_highlight):
19331 * xfaces.c (face_at_buffer_position):
19332 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19333 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19334 (Fnext_overlay_change, Fprevious_overlay_change)
19335 (mouse_face_overlay_overlaps, Foverlays_in):
19336 Use ptrdiff_t, not int, for sizes.
19337 (overlays_at, overlays_in): Check for size-calculation overflow.
19338
19339 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19340
19341 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19342 (x_session_initialize): Do not assume string length fits in int.
19343
19344 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19345 This is unlikely, but can occur if DPI is outlandish.
19346
19347 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
19348 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19349
19350 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19351 * xrdb.c (magic_file_p, search_magic_path):
19352 Omit last arg SUFFIX; it was always 0. All callers changed.
19353 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19354
19355 * xfont.c (xfont_match): Avoid need for strlen.
19356
19357 * xfns.c: Don't assume strlen fits in int.
19358 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19359
19360 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19361 not unsigned long, as we prefer signed integers. All callers changed.
19362 Detect integer overflow in repeat count.
19363 (message_dolog): Don't assume print length fits in 39 bytes.
19364 (display_mode_element): Don't assume strlen fits in int.
19365
19366 * termcap.c: Don't assume sizes fit in int and never overflow.
19367 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19368 (gobble_line): Check for size-calculation overflow.
19369
19370 * minibuf.c (Fread_buffer):
19371 * lread.c (intern, intern_c_string):
19372 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19373 Don't assume string length fits in int.
19374
19375 * keyboard.c (parse_tool_bar_item):
19376 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19377
19378 * font.c: Don't assume string length fits in int.
19379 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19380 Use ptrdiff_t, not int.
19381 (font_intern_prop): Don't assume string length fits in int.
19382 Don't assume integer property fits in fixnum.
19383 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
19384
19385 * filelock.c: Fix some buffer overrun and integer overflow issues.
19386 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
19387 Reformulate so as not to need the command string.
19388 Invoke gzip -cd rather than gunzip, as it's more portable.
19389 (lock_info_type, lock_file_1, lock_file):
19390 Don't assume pid_t and time_t fit in unsigned long.
19391 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19392 (current_lock_owner): Prefer signed type for sizes.
19393 Use memcpy, not strncpy, where memcpy is what is really wanted.
19394 Don't assume (via atoi) that time_t and pid_t fit in int.
19395 Check for time_t and/or pid_t out of range, e.g., via a network share.
19396 Don't alloca where an auto var works fine.
19397
19398 * fileio.c: Fix some integer overflow issues.
19399 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19400 Don't assume string length fits in int.
19401 (directory_file_name): Don't assume string length fits in long.
19402 (make_temp_name): Don't assume pid fits in int, or that its print
19403 length is less than 20.
19404
19405 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19406
19407 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19408
19409 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19410
19411 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19412 We prefer signed integers, even for size calculations.
19413
19414 * emacs.c: Don't assume string length fits in 'int'.
19415 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19416 (main): Don't invoke strlen when not needed.
19417
19418 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19419 (XD_DEBUG_MESSAGE): Don't waste a byte.
19420
19421 * callproc.c (getenv_internal_1, getenv_internal)
19422 (Fgetenv_internal):
19423 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19424
19425 * lread.c (invalid_syntax): Omit length argument.
19426 All uses changed. This doesn't fix a bug, but it simplifies the
19427 code away from its former Hollerith-constant appearance, and it's
19428 one less 'int' to worry about when looking at integer-overflow issues.
19429 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
19430
19431 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19432 This didn't break anything, but it didn't help either.
19433 It's confusing to put a bogus integer in a place where the actual
19434 value does not matter.
19435 (LIST_END_P): Remove unused macro and its bogus comment.
19436 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
19437
19438 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19439 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19440 implementation.
19441 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19442 We prefer signed types, and the value cannot exceed the EMACS_INT
19443 range anyway (because otherwise the length would not be representable).
19444 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19445 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19446 This avoids a GCC warning when WIDE_EMACS_INT.
19447
19448 * indent.c (sane_tab_width): New function.
19449 (current_column, scan_for_column, Findent_to, position_indentation)
19450 (compute_motion): Use it. This is just for clarity.
19451 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
19452
19453 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
19454
19455 * lisp.h (lint_assume): New macro.
19456 * composite.c (composition_gstring_put_cache):
19457 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19458
19459 * editfns.c, insdel.c:
19460 Omit unnecessary forward decls, to simplify future changes.
19461
19462 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19463
19464 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19465
19466 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
19467 Use much-faster test for byte-length change.
19468 Don't assume string byte-length fits in 'int'.
19469 Check that character arg fits in 'int'.
19470 (mapcar1): Declare byte as byte, for clarity.
19471
19472 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19473
19474 * fns.c (concat): Catch string overflow earlier.
19475 Do not rely on integer wraparound.
19476
19477 * dispextern.h (struct it.overlay_strings_charpos)
19478 (struct it.selective): Now EMACS_INT, not int.
19479 * xdisp.c (forward_to_next_line_start)
19480 (back_to_previous_visible_line_start)
19481 (reseat_at_next_visible_line_start, next_element_from_buffer):
19482 Don't arbitrarily truncate the value of 'selective' to int.
19483
19484 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19485
19486 * composite.c: Don't truncate sizes to 'int'.
19487 (composition_gstring_p, composition_reseat_it)
19488 (composition_adjust_point): Use EMACS_INT, not int.
19489 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19490 not EMACS_UINT, for indexes.
19491
19492 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19493
19494 * buffer.c: Include <verify.h>.
19495 (struct sortvec.priority, struct sortstr.priority):
19496 Now EMACS_INT, not int.
19497 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
19498 (struct sortstr.size, record_overlay_string)
19499 (struct sortstrlist.size, struct sortlist.used):
19500 Don't truncate size to int.
19501 (record_overlay_string): Check for size-calculation overflow.
19502 (init_buffer_once): Check at compile-time, not run-time.
19503
19504 2011-06-22 Jim Meyering <meyering@redhat.com>
19505
19506 Don't leak an XBM-image-sized buffer
19507 * image.c (xbm_load): Free the image buffer after using it.
19508
19509 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19510
19511 Port to Sun C.
19512 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19513 that Sun C diagnosed.
19514 * fns.c (secure_hash): Fix pointer signedness issue.
19515 * intervals.c (static_offset_intervals): New function.
19516 (offset_intervals): Use it.
19517
19518 2011-06-21 Leo Liu <sdl.web@gmail.com>
19519
19520 * deps.mk (fns.o):
19521 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19522 sha512.h.
19523
19524 * fns.c (secure_hash): Rename from crypto_hash_function and change
19525 the first arg to accept symbols.
19526 (Fsecure_hash): New primitive.
19527 (syms_of_fns): New symbols.
19528
19529 2011-06-20 Deniz Dogan <deniz@dogan.se>
19530
19531 * process.c (Fset_process_buffer): Clarify return value in
19532 docstring.
19533
19534 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
19535
19536 * dispnew.c (add_window_display_history): Use BVAR.
19537
19538 * xdisp.c (debug_method_add): Use BVAR.
19539 (check_window_end, dump_glyph_matrix, dump_glyph)
19540 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19541
19542 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19543 Likewise.
19544
19545 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19546 check till after the cache is created in init_frame_faces.
19547
19548 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19549
19550 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19551
19552 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19553
19554 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19555 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19556 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19557
19558 Improve buffer-overflow checking (Bug#8873).
19559 * fileio.c (Finsert_file_contents):
19560 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19561 Remove the old (too-loose) buffer overflow checks.
19562 They weren't needed, since make_gap checks for buffer overflow.
19563 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19564 The old code merely checked for Emacs fixnum overflow, and relied
19565 on undefined (wraparound) behavior. The new code avoids undefined
19566 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19567
19568 * editfns.c (Finsert_char): Don't dump core with very negative counts.
19569 Tune. Don't use wider integers than needed. Don't use alloca.
19570 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
19571
19572 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19573
19574 * insdel.c, lisp.h (buffer_overflow): New function.
19575 (insert_from_buffer_1, replace_range, replace_range_2):
19576 * insdel.c (make_gap_larger):
19577 * editfns.c (Finsert_char):
19578 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19579
19580 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19581
19582 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19583
19584 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
19585
19586 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19587 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19588
19589 * fileio.c: Don't assume EMACS_INT fits in off_t.
19590 (emacs_lseek): New static function.
19591 (Finsert_file_contents, Fwrite_region): Use it.
19592 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19593
19594 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19595
19596 * fns.c: Don't overflow int when computing a list length.
19597 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19598 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19599 truncation on 64-bit hosts. Check for QUIT every
19600 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19601 faster and is responsive enough.
19602 (Flength): Report an error instead of overflowing an integer.
19603 (Fsafe_length): Return a float if the value is not representable
19604 as a fixnum. This shouldn't happen except in contrived situations.
19605 (Fnthcdr, Fsort): Don't assume list length fits in int.
19606 (Fcopy_sequence): Don't assume vector length fits in int.
19607
19608 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19609 (header_size, word_size): New constants.
19610 (allocate_vectorlike): Don't check size overflow here.
19611 (allocate_vector): Check it here instead, since this is the only
19612 caller of allocate_vectorlike that could cause overflow.
19613 Check that the new vector's length is representable as a fixnum.
19614
19615 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19616 The previous code was bogus. For example, next_almost_prime (32)
19617 returned 39, which is undesirable as it is a multiple of 3; and
19618 next_almost_prime (24) returned 25, which is a multiple of 5 so
19619 why was the code bothering to check for multiples of 7?
19620
19621 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19622
19623 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19624
19625 Variadic C functions now count arguments with ptrdiff_t.
19626 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19627 Back then I didn't know that the Emacs coding style prefers signed int.
19628 Also, in the meantime I found a few more instances where arguments
19629 were being counted with int, which may truncate counts on 64-bit
19630 machines, or EMACS_INT, which may be unnecessarily wide.
19631 * lisp.h (struct Lisp_Subr.function.aMANY)
19632 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19633 Arg counts are now ptrdiff_t, not size_t.
19634 All variadic functions and their callers changed accordingly.
19635 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19636 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19637 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19638 * callint.c (Fcall_interactively): Check arg count for overflow,
19639 to avoid potential buffer overrun. Use signed char, not 'int',
19640 for 'varies' array, so that we needn't bother to check its size
19641 calculation for overflow.
19642 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19643 * eval.c (apply_lambda):
19644 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19645 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19646 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19647
19648 * callint.c (Fcall_interactively): Don't use index var as event count.
19649
19650 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19651 * mem-limits.h (SIZE): Remove; no longer used.
19652
19653 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
19654
19655 Remove unnecessary casts.
19656 * xterm.c (x_term_init):
19657 * xfns.c (x_set_border_pixel):
19658 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19659 These aren't needed now that we assume ANSI C.
19660
19661 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19662 It's more likely to cause problems (due to unsigned overflow)
19663 than to cure them.
19664
19665 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19666
19667 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19668
19669 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19670
19671 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19672
19673 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19674
19675 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19676
19677 GLYPH_CODE_FACE returns EMACS_INT, not int.
19678 * dispextern.h (merge_faces):
19679 * xfaces.c (merge_faces):
19680 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19681 Don't assume EMACS_INT fits in int.
19682
19683 * character.h (CHAR_VALID_P): Remove unused parameter.
19684 * fontset.c, lisp.h, xdisp.c: All uses changed.
19685
19686 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19687
19688 * fns.c (concat): Minor tuning based on overflow analysis.
19689 This doesn't fix any bugs. Use int to hold character, instead
19690 of constantly refetching from Emacs object. Use XFASTINT, not
19691 XINT, for value known to be a character. Don't bother comparing
19692 a single byte to 0400, as it's always less.
19693
19694 * floatfns.c (Fexpt):
19695 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19696
19697 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19698 for characters.
19699
19700 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19701
19702 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19703 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19704 incorrectly succeed when S was a string, because 4294967386 was
19705 truncated before it was used.
19706
19707 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19708 Otherwise, an out-of-range integer could cause undefined behavior
19709 on a 64-bit host.
19710
19711 * composite.c: Use int, not EMACS_INT, for characters.
19712 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19713 EMACS_INT, for values that are known to be in character range.
19714 This doesn't fix any bugs but is the usual style inside Emacs and
19715 may generate better code on 32-bit machines.
19716
19717 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19718 This is for reasons similar to the recent CHAR_STRING fix.
19719 * charset.c (Fencode_char): Check that character arg is actually
19720 a character. Pass an int to ENCODE_CHAR.
19721 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19722 wider than 'int', as a compile-time check to prevent future regressions
19723 in this area.
19724
19725 * character.c (char_string): Remove unnecessary casts.
19726
19727 Make sure a 64-bit char is never passed to CHAR_STRING.
19728 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19729 by silently ignoring the top 32 bits, allowing some values
19730 that were far too large to be valid characters.
19731 * character.h: Include <verify.h>.
19732 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19733 arguments are no wider than unsigned, as a compile-time check
19734 to prevent future regressions in this area.
19735 * data.c (Faset):
19736 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
19737 (Fsubst_char_in_region):
19738 * fns.c (concat):
19739 * xdisp.c (decode_mode_spec_coding):
19740 Adjust to CHAR_STRING's new requirement.
19741 * editfns.c (Finsert_char, Fsubst_char_in_region):
19742 * fns.c (concat): Check that character args are actually
19743 characters. Without this test, these functions did the wrong
19744 thing with wildly out-of-range values on 64-bit hosts.
19745
19746 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19747 These casts should not be needed on 32-bit hosts, either.
19748 * keyboard.c (read_char):
19749 * lread.c (Fload): Remove casts to unsigned.
19750
19751 * lisp.h (UNSIGNED_CMP): New macro.
19752 This fixes comparison bugs on 64-bit hosts.
19753 (ASCII_CHAR_P): Use it.
19754 * casefiddle.c (casify_object):
19755 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
19756 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19757 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19758 * dispextern.h (FACE_FROM_ID):
19759 * keyboard.c (read_char): Use UNSIGNED_CMP.
19760
19761 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19762 not to EMACS_INT, to avoid GCC warning.
19763
19764 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19765
19766 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19767 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19768 isn't needed on 32-bit machines.
19769
19770 * buffer.c (Fgenerate_new_buffer_name):
19771 Use EMACS_INT for count, not int.
19772 (advance_to_char_boundary): Return EMACS_INT, not int.
19773
19774 * data.c (Qcompiled_function): Now static.
19775
19776 * window.c (window_body_lines): Now static.
19777
19778 * image.c (gif_load): Rename local to avoid shadowing.
19779
19780 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19781 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19782 * alloc.c (make_save_value): Integer argument is now of type
19783 ptrdiff_t, not int.
19784 (mark_object): Use ptrdiff_t, not int.
19785 * lisp.h (pD): New macro.
19786 * print.c (print_object): Use it.
19787
19788 * alloc.c: Use EMACS_INT, not int, to count objects.
19789 (total_conses, total_markers, total_symbols, total_vector_size)
19790 (total_free_conses, total_free_markers, total_free_symbols)
19791 (total_free_floats, total_floats, total_free_intervals)
19792 (total_intervals, total_strings, total_free_strings):
19793 Now EMACS_INT, not int. All uses changed.
19794 (Fgarbage_collect): Compute overall total using a double, so that
19795 integer overflow is less likely to be a problem. Check for overflow
19796 when converting back to an integer.
19797 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19798 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19799 These were 'int' variables that could overflow on 64-bit hosts;
19800 they were never used, so remove them instead of repairing them.
19801 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
19802 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19803 Previously, this ceilinged at INT_MAX, but that doesn't work on
19804 64-bit machines.
19805 (allocate_pseudovector): Don't use EMACS_INT when int would do.
19806
19807 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
19808 (allocate_vectorlike): Check for ptrdiff_t overflow.
19809 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19810 when a (possibly-narrower) signed value would do just as well.
19811 We prefer using signed arithmetic, to avoid comparison confusion.
19812
19813 * alloc.c: Catch some string size overflows that we were missing.
19814 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19815 for convenience in STRING_BYTES_MAX.
19816 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19817 The definition here is exact; the one in lisp.h was approximate.
19818 (allocate_string_data): Check for string overflow. This catches
19819 some instances we weren't catching before. Also, it catches
19820 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19821 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19822 and ptrdiff_t and EMACS_INT are both 64 bits.
19823
19824 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19825 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
19826 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
19827
19828 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19829
19830 * alloc.c (Fmake_string): Check for out-of-range init.
19831
19832 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19833
19834 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19835
19836 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19837
19838 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19839 xg_get_default_scrollbar_width.
19840
19841 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19842 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19843 (style_changed_cb): Call update_theme_scrollbar_width and call
19844 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19845 all frames (Bug#8505).
19846 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19847 Call gtk_window_set_resizable if HAVE_GTK3.
19848 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19849 and height if HAVE_GTK3 (Bug#8505).
19850 (scroll_bar_width_for_theme): New variable.
19851 (update_theme_scrollbar_width): New function.
19852 (xg_get_default_scrollbar_width): Move code to
19853 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19854 (xg_initialize): Call update_theme_scrollbar_width.
19855
19856 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19857
19858 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19859
19860 2011-06-12 Martin Rudalics <rudalics@gmx.at>
19861
19862 * frame.c (make_frame): Call other_buffer_safely instead of
19863 other_buffer.
19864
19865 * window.c (temp_output_buffer_show): Call display_buffer with
19866 second argument Vtemp_buffer_show_specifiers and reset latter
19867 immediately after the call.
19868 (Vtemp_buffer_show_specifiers): New variable.
19869 (auto_window_vscroll_p, next_screen_context_lines)
19870 (Vscroll_preserve_screen_position): Remove leading asterisks from
19871 doc-strings.
19872
19873 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
19874
19875 Fix minor problems found by GCC 4.6.0 static checking.
19876 * buffer.c (Qclone_number): Remove for now, as it's unused.
19877 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19878 (record_buffer): Remove unused local.
19879 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19880 (set_frame_buffer_list): Remove; unused.
19881 * frame.h (other_visible_frames): Remove decl.
19882 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19883 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19884 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19885 if HAVE_GPM.
19886 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19887 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19888 Define only if HAVE_GPM.
19889 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19890 (update_hints_inhibit): Remove; never set. All uses removed.
19891 * widgetprv.h (emacsFrameClassRec): Remove decl.
19892 * window.c (delete_deletable_window): Now returns void, since it
19893 wasn't returning anything.
19894 (compare_window_configurations): Remove unused locals.
19895 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19896 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
19897 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19898 the same widths as pointers. This follows up on the 2011-05-06 patch.
19899 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19900 * xterm.h: Likewise.
19901 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19902
19903 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
19904
19905 * makefile.w32-in: Update dependencies.
19906 (LISP_H): Add lib/intprops.h.
19907
19908 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19909
19910 * image.c (gif_load): Add animation frame delay to the metadata.
19911 (syms_of_image): Use DEFSYM. New symbol `delay'.
19912
19913 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19914
19915 * window.c (delete_deletable_window): Re-add.
19916 (Fset_window_configuration): Rewrite to handle dead buffers and
19917 consequently deletable windows.
19918 (window_tree, Fwindow_tree): Remove. Supply functionality in
19919 window.el.
19920 (compare_window_configurations): Simplify code.
19921
19922 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19923
19924 * image.c (imagemagick_load_image): Fix type mismatch.
19925 (Fimagemagick_types): Likewise.
19926
19927 * window.h (replace_buffer_in_windows): Declare.
19928
19929 2011-06-11 Martin Rudalics <rudalics@gmx.at>
19930
19931 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19932 Qclone_number. Remove external declaration of Qdelete_window.
19933 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19934 code.
19935 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19936 Run Qbuffer_list_update_hook if allowed.
19937 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19938 buffer list implementation.
19939 (other_buffer_safely): New function.
19940 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19941 calls to replace_buffer_in_windows and
19942 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19943 if allowed.
19944 (record_buffer): Inhibit quitting and rewrite using quittable
19945 functions. Run Qbuffer_list_update_hook if allowed.
19946 (Frecord_buffer, Funrecord_buffer): New functions.
19947 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19948 Move switch-to-buffer to window.el.
19949 (bury-buffer): Move to window.el.
19950 (Vbuffer_list_update_hook): New variable.
19951
19952 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19953 section.
19954
19955 * window.h (resize_frame_windows): Move up in code.
19956 (Fwindow_frame): Remove EXFUN.
19957 (replace_buffer_in_all_windows): Remove prototype.
19958 (replace_buffer_in_windows_safely): Add prototype.
19959
19960 * window.c: Declare Qdelete_window static again. Move down
19961 declaration of select_count.
19962 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19963 (Fother_window): Move to window.el.
19964 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19965 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19966 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19967 window.el.
19968 (replace_buffer_in_windows): Implement by calling
19969 Qreplace_buffer_in_windows.
19970 (replace_buffer_in_all_windows): Remove with some functionality
19971 moved into replace_buffer_in_windows_safely.
19972 (replace_buffer_in_windows_safely): New function.
19973 (select_window_norecord, select_frame_norecord): Move in front
19974 of run_window_configuration_change_hook. Remove now obsolete
19975 declarations.
19976 (Fset_window_buffer): Rewrite doc-string.
19977 Call Qrecord_window_buffer.
19978 (keys_of_window): Move binding for other-window to window.el.
19979
19980 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
19981
19982 * dispextern.h (struct image): Replace data member, whose int_val
19983 and ptr_val fields were not used by anything, with a single
19984 lisp_val object.
19985
19986 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19987 (gif_clear_image, gif_load, imagemagick_load_image)
19988 (gs_clear_image, gs_load): Callers changed.
19989
19990 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19991
19992 * buffer.h: Include <time.h>, for time_t.
19993 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19994
19995 Fix minor problems found by static checking.
19996
19997 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19998
19999 Make identifiers static if they are not used in other modules.
20000 * data.c (Qcompiled_function, Qframe, Qvector):
20001 * image.c (QimageMagick, Qsvg):
20002 * minibuf.c (Qmetadata):
20003 * window.c (resize_window_check, resize_root_window): Now static.
20004 * window.h (resize_window_check, resize_root_window): Remove decls.
20005
20006 * window.c (window_deletion_count, delete_deletable_window):
20007 Remove; unused.
20008 (window_body_lines): Now static.
20009 (Fdelete_other_windows_internal): Mark vars as initialized.
20010 Make sure 'resize_failed' is initialized.
20011 (run_window_configuration_change_hook): Rename local to avoid shadowing.
20012 (resize_window_apply): Remove unused local.
20013 * window.h (delete_deletable_window): Remove decl.
20014
20015 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
20016 (imagemagick_load_image): Fix pointer signedness problem by changing
20017 last arg from unsigned char * to char *. All uses changed.
20018 Also, fix a local for similar reasons.
20019 Remove unused locals. Remove locals to avoid shadowing.
20020 (fn_rsvg_handle_free): Remove; unused.
20021 (svg_load, svg_load_image): Fix pointer signedness problem.
20022 (imagemagick_load_image): Don't use garbage pointer image_wand.
20023
20024 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
20025
20026 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
20027
20028 * image.c (gif_load): Fix omitted cast error introduced by
20029 2011-06-06 change.
20030
20031 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20032
20033 * window.h (resize_proportionally, orig_total_lines)
20034 (orig_top_line): Remove from window structure.
20035 (set_window_height, set_window_width, change_window_heights)
20036 (Fdelete_window): Remove prototypes.
20037 (resize_frame_windows): Remove duplicate declaration.
20038
20039 2011-06-10 Eli Zaretskii <eliz@gnu.org>
20040
20041 * window.h (resize_frame_windows, resize_window_check)
20042 (delete_deletable_window, resize_root_window)
20043 (resize_frame_windows): Declare prototypes.
20044
20045 * window.c (resize_window_apply): Make definition be "static" to
20046 match the prototype.
20047
20048 2011-06-10 Martin Rudalics <rudalics@gmx.at>
20049
20050 * window.c: Remove declarations of Qwindow_size_fixed,
20051 window_min_size_1, window_min_size_2, window_min_size,
20052 size_window, window_fixed_size_p, enlarge_window, delete_window.
20053 Remove static from declaration of Qdelete_window, it's
20054 temporarily needed by Fbury_buffer.
20055 (replace_window): Don't assign orig_top_line and
20056 orig_total_lines.
20057 (Fdelete_window, delete_window): Remove. Window deletion is
20058 handled by window.el.
20059 (window_loop): Remove DELETE_OTHER_WINDOWS case.
20060 Replace Fdelete_window calls with calls to Qdelete_window.
20061 (Fdelete_other_windows): Remove. Deleting other windows is
20062 handled by window.el.
20063 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
20064 handled in window.el.
20065 (window_min_size_2, window_min_size_1, window_min_size): Remove.
20066 Window minimum sizes are handled in window.el.
20067 (shrink_windows, size_window, set_window_height)
20068 (set_window_width, change_window_heights, window_height)
20069 (window_width, CURBEG, CURSIZE, enlarge_window)
20070 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
20071 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
20072 handled in window.el.
20073 (make_dummy_parent): Rename to make_parent_window and give it a
20074 second argument horflag.
20075 (make_window): Don't set resize_proportionally any more.
20076 (Fsplit_window): Remove. Windows are split in window.el.
20077 (save_restore_action, save_restore_orig_size)
20078 (shrink_window_lowest_first, save_restore_orig_size): Remove.
20079 Resize mini windows in window.el.
20080 (grow_mini_window, shrink_mini_window): Implement by calling
20081 Qresize_root_window_vertically, resize_window_check and
20082 resize_window_apply.
20083 (saved_window, Fset_window_configuration, save_window_save):
20084 Do not handle orig_top_line, orig_total_lines, and
20085 resize_proportionally.
20086 (window_min_height, window_min_width): Move to window.el.
20087 (keys_of_window): Move bindings for delete-other-windows,
20088 split-window, delete-window and enlarge-window to window.el.
20089
20090 * buffer.c: Temporarily extern Qdelete_window.
20091 (Fbury_buffer): Temporarily call Qdelete_window instead of
20092 Fdelete_window (Fbury_buffer will move to window.el soon).
20093
20094 * frame.c (set_menu_bar_lines_1): Remove code handling
20095 orig_top_line and orig_total_lines.
20096
20097 * dispnew.c (adjust_frame_glyphs_initially): Don't use
20098 set_window_height but set heights directly.
20099 (change_frame_size_1): Use resize_frame_windows.
20100
20101 * xdisp.c (init_xdisp): Don't use set_window_height but set
20102 heights directly.
20103
20104 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
20105 Use resize_frame_windows instead of change_window_heights and run
20106 run_window_configuration_change_hook.
20107
20108 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
20109 instead of change_window_heights and run
20110 run_window_configuration_change_hook.
20111
20112 2011-06-09 Martin Rudalics <rudalics@gmx.at>
20113
20114 * window.c (replace_window): Rename second argument REPLACEMENT to
20115 NEW. New third argument SETFLAG. Rewrite.
20116 (delete_window, make_dummy_parent): Call replace_window with
20117 third argument 1.
20118 (window_list_1): Move down in code.
20119 (run_window_configuration_change_hook): Move set_buffer part
20120 before select_frame_norecord part in order to unwind correctly.
20121 Rename count1 to count.
20122 (recombine_windows, delete_deletable_window, resize_root_window)
20123 (Fdelete_other_windows_internal)
20124 (Frun_window_configuration_change_hook, make_parent_window)
20125 (resize_window_check, resize_window_apply, Fresize_window_apply)
20126 (resize_frame_windows, Fsplit_window_internal)
20127 (Fdelete_window_internal, Fresize_mini_window_internal):
20128 New functions.
20129 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
20130
20131 2011-06-08 Martin Rudalics <rudalics@gmx.at>
20132
20133 * window.h (window): Add some new members to window structure -
20134 normal_lines, normal_cols, new_total, new_normal, clone_number,
20135 splits, nest, prev_buffers, next_buffers.
20136 (WINDOW_TOTAL_SIZE): Move here from window.c.
20137 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
20138
20139 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
20140 Remove.
20141 (make_dummy_parent): Set new members of windows structure.
20142 (make_window): Move down in code. Handle new members of window
20143 structure.
20144 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
20145 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20146 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20147 (Fset_window_prev_buffers, Fwindow_next_buffers)
20148 (Fset_window_next_buffers, Fset_window_clone_number):
20149 New functions.
20150 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20151 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20152 Doc-string fixes.
20153 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20154 Argument WINDOW can be now internal window too.
20155 (Fwindow_use_time): Move up in code.
20156 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20157 Rewrite doc-string.
20158 (Fset_window_configuration, saved_window)
20159 (Fcurrent_window_configuration, save_window_save): Handle new
20160 members of window structure.
20161 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20162 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20163 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20164 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20165 Qget_mru_window, Qresize_root_window,
20166 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20167 Qauto_buffer_name; staticpro them.
20168
20169 2011-06-07 Martin Rudalics <rudalics@gmx.at>
20170
20171 * window.c (Fwindow_total_size, Fwindow_left_column)
20172 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20173 (Fwindow_list_1): New functions.
20174 (window_box_text_cols): Replace with window_body_cols.
20175 (Fwindow_width, Fscroll_left, Fscroll_right):
20176 Use window_body_cols instead of window_box_text_cols.
20177 (delete_window, Fset_window_configuration):
20178 Call delete_all_subwindows with window as argument.
20179 (delete_all_subwindows): Take a window as argument and not a
20180 structure. Rewrite.
20181 (window_loop): Remove handling of GET_LRU_WINDOW and
20182 GET_LARGEST_WINDOW.
20183 (Fget_lru_window, Fget_largest_window): Move to window.el.
20184
20185 * window.h: Extern window_body_cols instead of
20186 window_box_text_cols. delete_all_subwindows now takes a
20187 Lisp_Object as argument.
20188
20189 * indent.c (compute_motion, Fcompute_motion):
20190 Use window_body_cols instead of window_box_text_cols.
20191
20192 * frame.c (delete_frame): Call delete_all_subwindows with root
20193 window as argument.
20194
20195 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20196
20197 * fns.c (Fputhash): Document return value.
20198
20199 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
20200
20201 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20202
20203 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20204
20205 Cons<->int and similar integer overflow fixes (Bug#8794).
20206
20207 Check for overflow when converting integer to cons and back.
20208 * charset.c (Fdefine_charset_internal, Fdecode_char):
20209 Use cons_to_unsigned to catch overflow.
20210 (Fencode_char): Use INTEGER_TO_CONS.
20211 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20212 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20213 * data.c (long_to_cons, cons_to_long): Remove.
20214 (cons_to_unsigned, cons_to_signed): New functions.
20215 These signal an error for invalid or out-of-range values.
20216 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20217 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20218 * font.c (Ffont_variation_glyphs):
20219 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20220 * lisp.h: Include <intprops.h>.
20221 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20222 (cons_to_signed, cons_to_unsigned): New decls.
20223 (long_to_cons, cons_to_long): Remove decls.
20224 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20225 (Fprimitive_undo): Use CONS_TO_INTEGER.
20226 * xfns.c (Fx_window_property): Likewise.
20227 * xselect.c: Include <limits.h>.
20228 (x_own_selection, selection_data_to_lisp_data):
20229 Use INTEGER_TO_CONS.
20230 (x_handle_selection_request, x_handle_selection_clear)
20231 (x_get_foreign_selection, Fx_disown_selection_internal)
20232 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20233 (lisp_data_to_selection_data): Use cons_to_unsigned.
20234 (x_fill_property_data): Use cons_to_signed.
20235 Report values out of range.
20236
20237 Check for buffer and string overflow more precisely.
20238 * buffer.h (BUF_BYTES_MAX): New macro.
20239 * lisp.h (STRING_BYTES_MAX): New macro.
20240 * alloc.c (Fmake_string):
20241 * character.c (string_escape_byte8):
20242 * coding.c (coding_alloc_by_realloc):
20243 * doprnt.c (doprnt):
20244 * editfns.c (Fformat):
20245 * eval.c (verror):
20246 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20247 since they may not be the same number.
20248 * editfns.c (Finsert_char):
20249 * fileio.c (Finsert_file_contents):
20250 Likewise for BUF_BYTES_MAX.
20251
20252 * image.c: Use ptrdiff_t, not int, for sizes.
20253 (slurp_file): Switch from int to ptrdiff_t.
20254 All uses changed.
20255 (slurp_file): Check that file size fits in both size_t (for
20256 malloc) and ptrdiff_t (for sanity and safety).
20257
20258 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20259 if b->modtime has its maximal value.
20260
20261 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20262
20263 Don't assume time_t can fit into int.
20264 * buffer.h (struct buffer.modtime): Now time_t, not int.
20265 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20266 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20267
20268 Minor fixes for signed vs unsigned integers.
20269 * character.h (MAYBE_UNIFY_CHAR):
20270 * charset.c (maybe_unify_char):
20271 * keyboard.c (read_char, reorder_modifiers):
20272 XINT -> XFASTINT, since the integer must be nonnegative.
20273 * ftfont.c (ftfont_spec_pattern):
20274 * keymap.c (access_keymap, silly_event_symbol_error):
20275 XUINT -> XFASTINT, since the integer must be nonnegative.
20276 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20277 since it makes no difference and we prefer signed.
20278 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20279 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20280 nonnegative.
20281
20282 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20283
20284 * window.h (Fwindow_frame): Declare.
20285
20286 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20287
20288 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20289 (SPARE_MEMORY): Always define.
20290 (LARGE_REQUEST): Remove.
20291 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20292
20293 2011-06-06 Martin Rudalics <rudalics@gmx.at>
20294
20295 * lisp.h: Move EXFUNS for Fframe_root_window,
20296 Fframe_first_window and Fset_frame_selected_window to window.h.
20297
20298 * window.h: Move EXFUNS for Fframe_root_window,
20299 Fframe_first_window and Fset_frame_selected_window here from
20300 lisp.h.
20301
20302 * frame.c (Fwindow_frame, Fframe_first_window)
20303 (Fframe_root_window, Fframe_selected_window)
20304 (Fset_frame_selected_window): Move to window.c.
20305 (Factive_minibuffer_window): Move to minibuf.c.
20306 (Fother_visible_frames_p): New function.
20307
20308 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20309
20310 * window.c (decode_window, decode_any_window): Move up in code.
20311 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20312 (inhibit_frame_unsplittable): Remove unused variable.
20313 (Fwindow_buffer): Move up and rewrite doc-string.
20314 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20315 (Fwindow_prev): New functions.
20316 (Fwindow_frame): Move here from frame.c. Accept any window as
20317 argument.
20318 (Fframe_root_window, Fframe_first_window)
20319 (Fframe_selected_window): Move here from frame.c. Accept frame
20320 or arbitrary window as argument. Update doc-strings.
20321 (Fminibuffer_window): Move up in code.
20322 (Fwindow_minibuffer_p): Move up in code and simplify.
20323 (Fset_frame_selected_window): Move here from frame.c.
20324 Marginal rewrite.
20325 (Fselected_window, select_window, Fselect_window): Move up in
20326 code. Minor doc-string fixes.
20327
20328 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20329
20330 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20331 Do not assume that spare memory exists; that assumption is valid
20332 only if SYSTEM_MALLOC.
20333 (LARGE_REQUEST): New macro, so that the issue of large requests
20334 is separated from the issue of spare memory.
20335
20336 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20337
20338 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20339 format. (Bug#8806)
20340
20341 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20342
20343 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20344 before statements.
20345
20346 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20347
20348 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20349
20350 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20351
20352 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20353 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20354
20355 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
20356
20357 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20358
20359 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
20360
20361 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20362 (x_clipboard_manager_save): Add return value.
20363 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20364 New error handlers.
20365 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20366 Obey Vx_select_enable_clipboard_manager. Catch errors in
20367 x_clipboard_manager_save (Bug#8779).
20368 (Vx_select_enable_clipboard_manager): New variable.
20369 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
20370
20371 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
20372
20373 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20374
20375 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20376
20377 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20378 in the current matrix if keep_current_p is non-zero.
20379
20380 2011-06-04 Eli Zaretskii <eliz@gnu.org>
20381
20382 * bidi.c (bidi_level_of_next_char): Fix last change.
20383
20384 2011-06-03 Eli Zaretskii <eliz@gnu.org>
20385
20386 Support bidi reordering of text covered by display properties.
20387
20388 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20389 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20390 (bidi_cache_search, bidi_cache_iterator_state)
20391 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
20392 (bidi_level_of_next_char, bidi_move_to_visually_next):
20393 Support character positions inside a run of characters covered by a
20394 display string.
20395 (bidi_paragraph_init, bidi_resolve_explicit_1)
20396 (bidi_level_of_next_char): Call bidi_fetch_char and
20397 bidi_fetch_char_advance instead of FETCH_CHAR and
20398 FETCH_CHAR_ADVANCE.
20399 (bidi_init_it): Initialize new members.
20400 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20401 definitions.
20402 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20403 instead of using explicit *_CHAR codes.
20404 (bidi_resolve_explicit, bidi_resolve_weak):
20405 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
20406 bidirectional text is supported only in multibyte buffers.
20407 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20408 it to initialize the frame_window_p member of struct bidi_it.
20409 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20410 (bidi_resolve_explicit, bidi_resolve_weak)
20411 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20412 bidi_it->nchars is non-positive.
20413 (bidi_level_of_next_char): Don't try to lookup the cache for the
20414 next/previous character if nothing is cached there yet, or if we
20415 were just reseat()'ed to a new position.
20416
20417 * xdisp.c (set_cursor_from_row): Set start and stop points
20418 according to the row's direction when priming the loop that looks
20419 for the glyph on which to display cursor.
20420 (single_display_spec_intangible_p): Function deleted.
20421 (display_prop_intangible_p): Reimplement to call
20422 handle_display_spec instead of single_display_spec_intangible_p.
20423 Accept 3 additional arguments needed by handle_display_spec.
20424 This fixes incorrect cursor motion across display property with complex
20425 values: lists, `(when COND...)' forms, etc.
20426 (single_display_spec_string_p): Support property values that are
20427 lists with the argument STRING its top-level element.
20428 (display_prop_string_p): Fix the condition for processing a
20429 property that is a list to be consistent with handle_display_spec.
20430 (handle_display_spec): New function, refactored from the
20431 last portion of handle_display_prop.
20432 (compute_display_string_pos): Accept additional argument
20433 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20434 value of a `display' property is a "replacing spec".
20435 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20436 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20437 the display property, but just return a value indicating whether
20438 the display property will replace the characters it covers.
20439 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20440 frame_window_p members of struct bidi_it.
20441 (compute_display_string_pos, compute_display_string_end):
20442 New functions.
20443 (push_it): Accept second argument POSITION, where pop_it should
20444 jump to continue iteration.
20445 (reseat_1): Initialize bidi_it.disp_pos.
20446
20447 * keyboard.c (adjust_point_for_property): Adjust the call to
20448 display_prop_intangible_p to its new signature.
20449
20450 * dispextern.h (struct bidi_it): New member frame_window_p.
20451 (bidi_init_it): Update prototypes.
20452 (display_prop_intangible_p): Update prototype.
20453 (compute_display_string_pos, compute_display_string_end):
20454 Declare prototypes.
20455 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20456 EMACS_INT.
20457
20458 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
20459
20460 Malloc failure behavior now depends on size of allocation.
20461 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20462 * lisp.h: Change signatures accordingly.
20463 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20464 All callers changed. (Bug#8762)
20465
20466 * gnutls.c: Use Emacs's memory allocators.
20467 Without this change, the gnutls library would invoke malloc etc.
20468 directly, which causes problems on non-SYNC_INPUT hosts, and which
20469 runs afoul of improving memory_full behavior. (Bug#8761)
20470 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20471 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20472 xfree instead of the default malloc, realloc, free.
20473 (Fgnutls_boot): No need to check for memory allocation failure,
20474 since xmalloc does that for us.
20475
20476 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
20477 * category.c (hash_get_category_set):
20478 * ccl.c (ccl_driver):
20479 * charset.c (Fdefine_charset_internal):
20480 * charset.h (struct charset.hash_index):
20481 * composite.c (get_composition_id, gstring_lookup_cache)
20482 (composition_gstring_put_cache):
20483 * composite.h (struct composition.hash_index):
20484 * dispextern.h (struct image.hash):
20485 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20486 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20487 (hashfn_equal, hashfn_user_defined, make_hash_table)
20488 (maybe_resize_hash_table, hash_lookup, hash_put)
20489 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20490 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20491 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20492 * image.c (make_image, search_image_cache, lookup_image)
20493 (xpm_put_color_table_h):
20494 * lisp.h (struct Lisp_Hash_Table):
20495 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
20496 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
20497 for hashes and hash indexes, instead of 'unsigned' and 'int'.
20498 * alloc.c (allocate_vectorlike):
20499 Check for overflow in vector size calculations.
20500 * ccl.c (ccl_driver):
20501 Check for overflow when converting EMACS_INT to int.
20502 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20503 need to be updated by these changes.
20504 * fns.c (make_hash_table, maybe_resize_hash_table):
20505 Check for integer overflow with large hash tables.
20506 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20507 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20508 (SXHASH_REDUCE): New macro.
20509 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20510 Use it instead of discarding useful hash info with large hash values.
20511 (sxhash_float): New function.
20512 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20513 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
20514 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20515 Rewrite to use FIXNUM_BITS, as this simplifies things.
20516 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20517 Adjust signatures to match updated version of code.
20518 (consing_since_gc): Now EMACS_INT, since a single hash table can
20519 use more than INT_MAX bytes.
20520
20521 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20522
20523 Make it possible to build with GCC-4.6+ -O2 -flto.
20524
20525 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20526
20527 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20528
20529 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20530 Call minibuffer-inactive-mode.
20531
20532 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
20533
20534 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20535 Update dependencies.
20536
20537 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20538
20539 * data.c (init_data): Remove code for UTS, this system is not
20540 supported anymore.
20541
20542 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20543
20544 Don't force ./temacs to start in terminal mode.
20545
20546 * frame.c (make_initial_frame): Initialize faces in all cases, not
20547 only when CANNOT_DUMP is defined.
20548 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20549
20550 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20551
20552 * dispnew.c (add_window_display_history): Use const for the string
20553 pointer. Remove declaration, not needed.
20554
20555 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20556
20557 Use 'inline', not 'INLINE'.
20558 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
20559 * alloc.c, fontset.c (INLINE): Remove.
20560 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20561 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20562 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20563 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20564 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20565
20566 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20567
20568 Make it possible to run ./temacs.
20569
20570 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20571 syms_of_callproc does the same thing. Remove test for
20572 "initialized", do it in the caller.
20573 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20574
20575 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20576
20577 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20578 (read_minibuf): Use get_minibuffer.
20579 (syms_of_minibuf): Use DEFSYM.
20580 (Qmetadata): New var.
20581 * data.c (Qbuffer): Don't make it static.
20582 (syms_of_data): Use DEFSYM.
20583
20584 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20585
20586 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20587 (CCL_CODE_MIN): New macro.
20588
20589 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20590
20591 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20592
20593 * eval.c (Qdebug): Now static.
20594 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20595 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20596 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20597
20598 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20599
20600 * image.c: Various fixes to ImageMagick code comments.
20601 (Fimagemagick_types): Doc fix.
20602
20603 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20604
20605 Minor fixes prompted by GCC 4.6.0 warnings.
20606
20607 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20608
20609 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20610 (x_clipboard_manager_save_all): Move extern decl to ...
20611 * xterm.h: ... here, so that it can be checked for consistency.
20612
20613 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
20614
20615 * xselect.c (x_clipboard_manager_save_frame)
20616 (x_clipboard_manager_save_all): New functions.
20617 (Fx_clipboard_manager_save): Lisp function deleted.
20618
20619 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20620 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20621
20622 * xterm.h: Update prototype.
20623
20624 2011-05-28 William Xu <william.xwl@gmail.com>
20625
20626 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20627 exiting (Bug#8239).
20628
20629 2011-05-28 Jim Meyering <meyering@redhat.com>
20630
20631 Avoid a sign-extension bug in crypto_hash_function.
20632 * fns.c (to_uchar): Define.
20633 (crypto_hash_function): Use it to convert some newly-signed
20634 variables to unsigned, to avoid sign-extension bugs. For example,
20635 without this change, (md5 "truc") would evaluate to
20636 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20637 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
20638 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
20639
20640 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20641
20642 Integer overflow fixes.
20643
20644 * dbusbind.c: Serial number integer overflow fixes.
20645 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
20646 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20647 to hold a serial number that is too large for a fixnum.
20648 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20649 Check for serial numbers out of range. Decode any serial number
20650 that was so large that it became a float. (Bug#8722)
20651
20652 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20653 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20654 Use XFASTINT rather than XUINT when numbers are nonnegative.
20655 (xd_append_arg, Fdbus_method_return_internal):
20656 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20657 arguments, check that Lisp number is nonnegative, rather than
20658 silently wrapping negative numbers around. (Bug#8722)
20659 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
20660 (Bug#8722)
20661
20662 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20663
20664 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20665
20666 ccl: Add integer overflow checks.
20667 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20668 (IN_INT_RANGE): New macros.
20669 (ccl_driver): Use them to check for integer overflow when
20670 decoding a CCL program. Many of the new checks are whether XINT (x)
20671 fits in int; it doesn't always, on 64-bit hosts. The new version
20672 doesn't catch all possible integer overflows, but it's an
20673 improvement. (Bug#8719)
20674
20675 * alloc.c (make_event_array): Use XINT, not XUINT.
20676 There's no need for unsigned here.
20677
20678 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20679 This follows up to the 2011-05-06 change that substituted uintptr_t
20680 for EMACS_INT. This case wasn't caught back then.
20681
20682 Rework Fformat to avoid integer overflow issues.
20683 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20684 now (part of C89). Include <verify.h>.
20685 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20686 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20687 (Fformat): Avoid the prepass trying to compute sizes; it was only
20688 approximate and thus did not catch overflow reliably. Instead, walk
20689 through the format just once, formatting and computing sizes as we go,
20690 checking for integer overflow at every step, and allocating a larger
20691 buffer as needed. Keep track separately whether the format is
20692 multibyte. Keep only the most-recently calculated precision, rather
20693 than them all. Record whether each argument has been converted to
20694 string. Use EMACS_INT, not int, for byte and char and arg counts.
20695 Support field widths and precisions larger than INT_MAX. Avoid
20696 sprintf's undefined behavior with conversion specifications such as %#d
20697 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20698 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20699 formatting out-of-range floating point numbers with int
20700 formats. (Bug#8668)
20701
20702 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20703
20704 * data.c: Avoid integer truncation in expressions involving floats.
20705 * data.c: Include <intprops.h>.
20706 (arith_driver): When there's an integer overflow in an expression
20707 involving floating point, convert the integers to floating point
20708 so that the resulting value does not suffer from catastrophic
20709 integer truncation. For example, on a 64-bit host (* 4
20710 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20711 Do not rely on undefined behavior after integer overflow.
20712
20713 merge count_size_as_multibyte, parse_str_to_multibyte
20714 * character.c, character.h (count_size_as_multibyte):
20715 Rename from parse_str_to_multibyte; all uses changed.
20716 Check for integer overflow.
20717 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20718 since it's now a duplicate of the other. This is more of
20719 a character than a buffer op, so better that it's in character.c.
20720 * fns.c, print.c: Adjust to above changes.
20721
20722 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20723
20724 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20725
20726 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20727
20728 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20729 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20730 (x_clipboard_manager_save): Now static.
20731 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20732
20733 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20734 (crypto_hash_function): Now static.
20735 Fix pointer signedness problems. Avoid unnecessary initializations.
20736
20737 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
20738
20739 * termhooks.h (Vselection_alist): Make it terminal-local.
20740
20741 * terminal.c (create_terminal): Initialize it.
20742
20743 * xselect.c: Support for clipboard managers.
20744 (Vselection_alist): Move to termhooks.h as terminal-local var.
20745 (LOCAL_SELECTION): New macro.
20746 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20747 (symbol_to_x_atom): Remove gratuitous arg.
20748 (x_handle_selection_request, lisp_data_to_selection_data)
20749 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
20750 (x_own_selection, x_get_local_selection, x_convert_selection):
20751 New arg, specifying work frame. Use terminal-local Vselection_alist.
20752 (some_frame_on_display): Delete unused function.
20753 (Fx_own_selection_internal, Fx_get_selection_internal)
20754 (Fx_disown_selection_internal, Fx_selection_owner_p)
20755 (Fx_selection_exists_p): New optional frame arg.
20756 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20757 (x_handle_selection_clear): Don't treat other terminals with the
20758 same keyboard specially. Use the terminal-local Vselection_alist.
20759 (x_clear_frame_selections): Use Frun_hook_with_args.
20760
20761 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20762
20763 * xterm.h: Add support for those atoms.
20764
20765 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
20766
20767 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20768 (converted_selections, conversion_fail_tag): New global variables.
20769 (x_selection_request_lisp_error): Free the above.
20770 (x_get_local_selection): Remove unnecessary code.
20771 (x_reply_selection_request): Args changed; handle arbitrary array
20772 of converted selections stored in converted_selections.
20773 Separate the XChangeProperty and SelectionNotify steps.
20774 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20775 (x_convert_selection): New function.
20776 (x_handle_selection_event): Simplify.
20777 (x_get_foreign_selection): Don't ignore incoming requests while
20778 waiting for an answer; this will fail when we implement
20779 SAVE_TARGETS, and seems unnecessary anyway.
20780 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20781 (Vx_sent_selection_functions): Doc fix.
20782
20783 2011-05-26 Leo Liu <sdl.web@gmail.com>
20784
20785 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20786
20787 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20788
20789 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20790
20791 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20792 for fringe update if it has periodic bitmap.
20793 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
20794 and fringe_bitmap_periodic_p.
20795
20796 * fringe.c (get_fringe_bitmap_data): New function.
20797 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20798 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20799 row. Mark glyph row for fringe update if periodicity changed.
20800
20801 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20802 for fringe update unless it has periodic bitmap.
20803
20804 2011-05-25 Kenichi Handa <handa@m17n.org>
20805
20806 * xdisp.c (get_next_display_element): Set correct it->face_id for
20807 a static composition.
20808
20809 2011-05-24 Leo Liu <sdl.web@gmail.com>
20810
20811 * deps.mk (fns.o):
20812 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20813
20814 * fns.c (crypto_hash_function, Fsha1): New function.
20815 (Fmd5): Use crypto_hash_function.
20816 (syms_of_fns): Add Ssha1.
20817
20818 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20819
20820 * gnutls.c: Remove unused macros.
20821 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20822 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20823 Remove macros that are defined and never used.
20824 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20825
20826 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20827
20828 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20829 (Fx_get_selection_internal): Minor cleanup.
20830 (Fx_own_selection_internal): Rename arguments for consistency with
20831 select.el.
20832
20833 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20834
20835 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20836
20837 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
20838
20839 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20840
20841 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20842
20843 * dispnew.c (scrolling_window): Don't exclude the case that the
20844 last enabled row in the desired matrix touches the bottom boundary.
20845
20846 2011-05-21 Glenn Morris <rgm@gnu.org>
20847
20848 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
20849 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20850 and add some more files.
20851
20852 2011-05-20 Eli Zaretskii <eliz@gnu.org>
20853
20854 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20855 report_file_error introduced by the change from 2011-05-07.
20856
20857 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20858
20859 * systime.h (Time): Define only if emacs is defined.
20860 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20861 where the include path doesn't have X11/X.h by default. See
20862 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20863
20864 2011-05-20 Kenichi Handa <handa@m17n.org>
20865
20866 * composite.c (find_automatic_composition): Fix previous change.
20867
20868 2011-05-20 Glenn Morris <rgm@gnu.org>
20869
20870 * lisp.mk: New file, split from Makefile.in.
20871 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20872 (shortlisp): Remove.
20873 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20874
20875 2011-05-19 Glenn Morris <rgm@gnu.org>
20876
20877 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20878 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20879 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20880 (lisp): Set the order to that of loadup.el.
20881 (shortlisp): Make it a copy of $lisp.
20882 (SOME_MACHINE_LISP): Remove.
20883 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20884 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20885
20886 2011-05-18 Kenichi Handa <handa@m17n.org>
20887
20888 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20889 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20890 (find_automatic_composition): Mostly rewrite for efficiency.
20891
20892 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
20893
20894 * makefile.w32-in: Update dependencies.
20895
20896 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20897
20898 * menu.c: Include limits.h (fixes the MS-Windows build broken by
20899 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
20900
20901 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
20902
20903 Fix some integer overflow issues, such as string length overflow.
20904
20905 * insdel.c (count_size_as_multibyte): Check for string overflow.
20906
20907 * character.c (lisp_string_width): Check for string overflow.
20908 Use EMACS_INT, not int, for string indexes and lengths; in
20909 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20910 the resulting string length overflows an EMACS_INT; instead,
20911 report a string overflow if no precision given. When checking for
20912 precision exhaustion, use a check that cannot possibly have
20913 integer overflow. (Bug#8675)
20914 * character.h (lisp_string_width): Adjust to new signature.
20915
20916 * alloc.c (string_overflow): New function.
20917 (Fmake_string): Use it. This doesn't change behavior, but saves
20918 a few bytes and will simplify future changes.
20919 * character.c (string_escape_byte8): Likewise.
20920 * lisp.h (string_overflow): New decl.
20921
20922 Fixups, following up to the user-interface timestamp change.
20923 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20924 for UI timestamps, instead of unsigned long.
20925 * msdos.c (mouse_get_pos): Likewise.
20926 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
20927 * w32gui.h (Time): Define by including "systime.h" rather than by
20928 declaring it ourselves. (Bug#8664)
20929
20930 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20931 * image.c (clear_image_cache): Likewise.
20932
20933 * term.c (term_mouse_position): Don't assume time_t wraparound.
20934
20935 Be more systematic about user-interface timestamps.
20936 Before, the code sometimes used 'Time', sometimes 'unsigned long',
20937 and sometimes 'EMACS_UINT', to represent these timestamps.
20938 This change causes it to use 'Time' uniformly, as that's what X uses.
20939 This makes the code easier to follow, and makes it easier to catch
20940 integer overflow bugs such as Bug#8664.
20941 * frame.c (Fmouse_position, Fmouse_pixel_position):
20942 Use Time, not unsigned long, for user-interface timestamps.
20943 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20944 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20945 * keyboard.h (last_event_timestamp): Likewise.
20946 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20947 * menu.h (xmenu_show): Likewise.
20948 * term.c (term_mouse_position): Likewise.
20949 * termhooks.h (struct input_event.timestamp): Likewise.
20950 (struct terminal.mouse_position_hook): Likewise.
20951 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20952 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20953 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20954 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20955 what it was before.
20956 * menu.h, termhooks.h: Include "systime.h", for Time.
20957
20958 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20959 Don't assume that the difference between two unsigned long values
20960 can fit into an integer. At this point, we know button_down_time
20961 <= event->timestamp, so the difference must be nonnegative, so
20962 there's no need to cast the result if double-click-time is
20963 nonnegative, as it should be; check that it's nonnegative, just in
20964 case. This bug is triggered when events are more than 2**31 ms
20965 apart (about 25 days). (Bug#8664)
20966
20967 * xselect.c (last_event_timestamp): Remove duplicate decl.
20968 (x_own_selection): Remove needless cast to unsigned long.
20969
20970 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20971 that always fit in int. Use a sentinel instead of a counter, to
20972 avoid a temp and to allay GCC's concerns about possible int overflow.
20973 * frame.h (struct frame): Use int for menu_bar_items_used
20974 instead of EMACS_INT, since it always fits in int.
20975
20976 * menu.c (grow_menu_items): Check for int overflow.
20977
20978 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20979
20980 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20981 Before, the code was not consistent. These values cannot exceed
20982 2**31 - 1 so there's no need to make them unsigned.
20983 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20984 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20985 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20986 as modifiers.
20987 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20988
20989 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20990 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20991 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20992 presumably because the widths might not match.
20993
20994 * window.c (size_window): Avoid needless test at loop start.
20995
20996 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20997
20998 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20999
21000 2011-05-12 Drew Adams <drew.adams@oracle.com>
21001
21002 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
21003
21004 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
21005
21006 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
21007 `width' to `bar_area_x' and `bar_area_width', respectively.
21008 (x_scroll_run): Take account of fringe background extension.
21009
21010 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
21011 Rename local vars `left' and `width' to `bar_area_x' and
21012 `bar_area_width', respectively.
21013 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
21014 background extension.
21015
21016 2011-05-10 Jim Meyering <meyering@redhat.com>
21017
21018 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
21019
21020 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
21021
21022 * image.c (Finit_image_library): Return t for built-in image types,
21023 like pbm and xbm. (Bug#8640)
21024
21025 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
21026
21027 * w32menu.c (set_frame_menubar): Fix submenu allocation.
21028
21029 2011-05-07 Eli Zaretskii <eliz@gnu.org>
21030
21031 * w32console.c (Fset_screen_color): Doc fix.
21032 (Fget_screen_color): New function.
21033 (syms_of_ntterm): Defsubr it.
21034
21035 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
21036 unlink the temporary file if Fcall_process didn't create it in the
21037 first place.
21038 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
21039 child process will be redirected to a file specified with `:file'.
21040 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
21041 cue to call_process_cleanup not to close that handle.
21042
21043 2011-05-07 Ben Key <bkey76@gmail.com>
21044
21045 * makefile.w32-in: The bootstrap-temacs rule now makes use of
21046 one of two shell specific rules, either bootstrap-temacs-CMD or
21047 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
21048 to the previous implementation of the bootstrap-temacs rule.
21049 The bootstrap-temacs-CMD rule is similar to the previous
21050 implementation of the bootstrap-temacs rule except that it
21051 makes use of the ESC_CFLAGS variable instead of the CFLAGS
21052 variable.
21053
21054 These changes, along with some changes to nt/configure.bat,
21055 nt/gmake.defs, and nt/nmake.defs, are required to extend my
21056 earlier fix to add support for --cflags and --ldflags options
21057 that include quotes so that it works whether make uses cmd or
21058 sh as the shell.
21059
21060 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
21061
21062 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
21063 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
21064 is a constant.
21065 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
21066 a string. Handle both cases.
21067 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
21068 (Fdbus_register_method): Use Qinvalid_function.
21069
21070 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21071
21072 * makefile.w32-in: Update dependencies.
21073 (LISP_H): Add inttypes.h and stdin.h.
21074 (PROCESS_H): Add unistd.h.
21075
21076 2011-05-06 Eli Zaretskii <eliz@gnu.org>
21077
21078 * lread.c: Include limits.h (fixes the MS-Windows build broken by
21079 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
21080
21081 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
21082
21083 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
21084
21085 * term.c (vfatal): Remove stray call to va_end.
21086 It's not needed and the C Standard doesn't allow it here anyway.
21087
21088 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
21089 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
21090
21091 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
21092 bytes.
21093
21094 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
21095
21096 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
21097
21098 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
21099
21100 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
21101
21102 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
21103
21104 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
21105 * charset.c (Fdefine_charset_internal): Don't initialize
21106 charset.code_space[15]. The value was garbage, on hosts with
21107 32-bit int (Bug#8600).
21108
21109 * lread.c (read_integer): Be more consistent with string-to-number.
21110 Use string_to_number to do the actual conversion; this avoids
21111 rounding errors and fixes some other screwups. Without this fix,
21112 for example, #x1fffffffffffffff was misread as -2305843009213693952.
21113 (digit_to_number): Move earlier, for benefit of read_integer.
21114 Return -1 if the digit is out of range for the base, -2 if it is
21115 not a digit in any supported base. (Bug#8602)
21116
21117 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
21118
21119 * dispnew.c (scrolling_window): Return 1 if we scrolled,
21120 to match comment at start of function. This also removes a
21121 GCC warning about overflow in a 32+64-bit port.
21122
21123 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
21124
21125 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
21126 Reported by Stefan Monnier in
21127 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
21128 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21129 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
21130
21131 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
21132 (EMACS_UINTPTR): Likewise, with uintptr_t.
21133
21134 * lisp.h: Prefer 64-bit EMACS_INT if available.
21135 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
21136 on 32-bit hosts that have 64-bit int, so that they can access
21137 large files.
21138 However, temporarily disable this change unless the temporary
21139 symbol WIDE_EMACS_INT is defined.
21140
21141 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
21142
21143 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
21144 This removes an assumption that EMACS_INT and long are the same
21145 width as pointers. The assumption is true for Emacs porting targets
21146 now, but we want to make other targets possible.
21147 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21148 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21149 In the rest of the code, change types of integers that hold casted
21150 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21151 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21152 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21153 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21154 No need to cast type when ORing.
21155 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21156 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21157 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21158 assume EMACS_INT is the same width as char *.
21159 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21160 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21161 Remove no-longer-needed casts.
21162 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21163 (xg_tool_bar_help_callback, xg_make_tool_item):
21164 Use EMACS_INTPTR to hold an integer
21165 that will be cast to void *; this can avoid a GCC warning
21166 if EMACS_INT is not the same width as void *.
21167 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21168 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21169 (current_message_1, set_message_1):
21170 Use a local to convert to proper width without a cast.
21171 * xmenu.c (dialog_selection_callback): Likewise.
21172
21173 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21174 Also, don't assume VALBITS / RAND_BITS is less than 5,
21175 and don't rely on undefined behavior when shifting a 1 left into
21176 the sign bit.
21177 * lisp.h (get_random): Change signature to match.
21178
21179 * lread.c (hash_string): Use size_t, not int, for hash computation.
21180 Normally we prefer signed values; but hashing is special, because
21181 it's better to use unsigned division on hash table sizes so that
21182 the remainder is nonnegative. Also, size_t is the natural width
21183 for hashing into memory. The previous code used 'int', which doesn't
21184 retain enough info to hash well into very large tables.
21185 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21186
21187 * dbusbind.c: Don't possibly lose pointer info when converting.
21188 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21189 Use XPNTR rather than XHASH, so that the high-order bits of
21190 the pointer aren't lost when converting through void *.
21191
21192 * eval.c (Fautoload): Don't double-shift a pointer.
21193
21194 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21195
21196 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
21197
21198 * gnutls.c (DEF_GNUTLS_FN):
21199 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21200
21201 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21202
21203 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21204 marker. (Bug#8610)
21205
21206 2011-05-05 Eli Zaretskii <eliz@gnu.org>
21207
21208 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21209 New version that can reserve upto 2GB of heap space.
21210
21211 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
21212
21213 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21214
21215 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21216
21217 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21218 `gnutls_certificate_set_x509_key_file'.
21219
21220 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
21221
21222 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21223 Update dependencies.
21224
21225 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21226
21227 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21228 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21229 Remove unused parameter `fildes'.
21230 * process.c (read_process_output, send_process): Don't pass it.
21231
21232 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21233
21234 Fix previous change: the library cache is defined in w32.c.
21235 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21236 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21237
21238 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
21239
21240 Implement dynamic loading of GnuTLS on Windows.
21241
21242 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21243 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21244 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21245 Declare.
21246
21247 * gnutls.c (Qgnutls_dll): Define.
21248 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21249 (gnutls_*): Declare function pointers.
21250 (init_gnutls_functions): New function to initialize function pointers.
21251 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21252 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21253 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21254 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21255 (emacs_gnutls_write, emacs_gnutls_read)
21256 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21257 (Fgnutls_available_p): New function.
21258 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21259 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21260 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21261
21262 * image.c: Include w32.h.
21263 (Vimage_type_cache): Delete.
21264 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21265 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21266 (w32_delayed_load): Move to w32.c.
21267
21268 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21269
21270 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21271 (w32_delayed_load): Move from image.c. When loading a library, record
21272 its filename in the :loaded-from property of the library id.
21273 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21274 Initialize and staticpro them.
21275 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21276
21277 * process.c: Include lisp.h before w32.h, not after.
21278 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21279 instead of gnutls_record_check_pending.
21280
21281 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21282
21283 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21284
21285 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21286 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21287 as passed in.
21288
21289 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21290
21291 * xterm.c (x_set_frame_alpha): Do not set property on anything
21292 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21293
21294 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21295
21296 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21297
21298 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
21299
21300 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21301 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21302 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21303 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21304 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21305 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21306 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21307 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21308 (Qgnutls_bootprop_callbacks_verify): Make static.
21309
21310 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21311
21312 * callproc.c: Indentation fixup.
21313
21314 * sysdep.c (wait_for_termination_1): Make static.
21315 (wait_for_termination, interruptible_wait_for_termination):
21316 Move after wait_for_termination_1.
21317
21318 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21319
21320 * sysdep.c (interruptible_wait_for_termination): New function
21321 which is like wait_for_termination, but allows keyboard
21322 interruptions.
21323
21324 * callproc.c (Fcall_process): Add (:file "file") as an option for
21325 the STDOUT buffer.
21326 (Fcall_process_region): Ditto.
21327
21328 2011-04-30 Eli Zaretskii <eliz@gnu.org>
21329
21330 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21331 rather than `XVECTOR (FOO)->size'.
21332
21333 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21334 inttypes.h, as a gnulib replacement is used if it not available in
21335 system headers.
21336
21337 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21338
21339 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21340 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21341 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21342
21343 * coding.c (coding_alloc_by_realloc): Error out if destination
21344 will grow beyond MOST_POSITIVE_FIXNUM.
21345 (decode_coding_emacs_mule): Abort if there isn't enough place in
21346 charbuf for the composition carryover bytes. Reserve an extra
21347 space for up to 2 characters produced in a loop.
21348 (decode_coding_iso_2022): Abort if there isn't enough place in
21349 charbuf for the composition carryover bytes.
21350
21351 2011-04-21 Eli Zaretskii <eliz@gnu.org>
21352
21353 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21354 aborting when %lld or %lll format is passed.
21355 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21356 %llo or %llx format is passed. (Bug#8545)
21357
21358 * window.c (window_scroll_line_based): Use a marker instead of
21359 simple variables to record original value of point. (Bug#7952)
21360
21361 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21362 produced by %s or %c overflows available buffer space. (Bug#8545)
21363
21364 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21365
21366 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
21367 (SIZE_MAX): Move defn after all includes, as they might #define it.
21368
21369 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21370
21371 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21372
21373 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21374
21375 * keyboard.c (Qdelayed_warnings_hook): Define.
21376 (command_loop_1): Run `delayed-warnings-hook'
21377 if Vdelayed_warnings_list is non-nil.
21378 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21379 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21380
21381 2011-04-28 Eli Zaretskii <eliz@gnu.org>
21382
21383 * doprnt.c (doprnt): Don't return value smaller than the buffer
21384 size if the message was truncated. (Bug#8545).
21385
21386 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
21387
21388 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21389 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21390
21391 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21392
21393 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21394
21395 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
21396
21397 * makefile.w32-in: Update dependencies.
21398
21399 2011-04-27 Eli Zaretskii <eliz@gnu.org>
21400
21401 Improve `doprnt' and its usage. (Bug#8545)
21402 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21403 `format_end'. Remove support for %l as a conversion specifier.
21404 Don't use xrealloc. Improve diagnostics when the %l size modifier
21405 is used. Update the commentary.
21406
21407 * eval.c (verror): Simplify calculation of size_t.
21408
21409 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21410 messages.
21411
21412 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21413
21414 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21415 change.
21416
21417 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21418
21419 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21420 This makes this file independent of the recent pseudovector change.
21421
21422 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
21423
21424 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21425
21426 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
21427 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
21428 Remove unused local.
21429 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
21430
21431 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
21432 GCC 4.6.0 optimizes based on type-based alias analysis.
21433 For example, if b is of type struct buffer * and v of type struct
21434 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21435 != &v->size, and therefore "v->size = 1; b->size = 2; return
21436 v->size;" must therefore return 1. This assumption is incorrect
21437 for Emacs, since it type-puns struct Lisp_Vector * with many other
21438 types. To fix this problem, this patch adds a new type struct
21439 vectorlike_header that documents the constraints on layout of vectors
21440 and pseudovectors, and helps optimizing compilers not get fooled
21441 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21442 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
21443 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21444 the size member.
21445 (XSETPVECTYPE): Rewrite in terms of new macro.
21446 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21447 This is a bit clearer, and further avoids the possibility of
21448 undesirable aliasing.
21449 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
21450 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
21451 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21452 since Lisp_Subr is a special case (no "next" field).
21453 (ASIZE): Now uses header.size rather than size.
21454 All previous uses of XVECTOR (foo)->size replaced to use this macro,
21455 to avoid the hassle of writing XVECTOR (foo)->header.size.
21456 (struct vectorlike_header): New type.
21457 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21458 object, to help avoid aliasing.
21459 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21460 (SUBRP): Likewise, since Lisp_Subr is a special case.
21461 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21462 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21463 (struct Lisp_Hash_Table): Combine first two members into a single
21464 struct vectorlike_header member. All uses of "size" and "next" members
21465 changed to be "header.size" and "header.next".
21466 * buffer.h (struct buffer): Likewise.
21467 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21468 * frame.h (struct frame): Likewise.
21469 * process.h (struct Lisp_Process): Likewise.
21470 * termhooks.h (struct terminal): Likewise.
21471 * window.c (struct save_window_data, struct saved_window): Likewise.
21472 * window.h (struct window): Likewise.
21473 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21474 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21475 * buffer.c (init_buffer_once): Likewise.
21476 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21477 special case.
21478 * process.c (Fformat_network_address): Use local var for size,
21479 for brevity.
21480
21481 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21482
21483 Make the Lisp reader and string-to-float more consistent (Bug#8525)
21484 * data.c (atof): Remove decl; no longer used or needed.
21485 (digit_to_number): Move to lread.c.
21486 (Fstring_to_number): Use new string_to_number function, to be
21487 consistent with how the Lisp reader treats infinities and NaNs.
21488 Do not assume that floating-point numbers represent EMACS_INT
21489 without losing information; this is not true on most 64-bit hosts.
21490 Avoid double-rounding errors, by insisting on integers when
21491 parsing non-base-10 numbers, as the documentation specifies.
21492 * lisp.h (string_to_number): New decl, replacing ...
21493 (isfloat_string): Remove.
21494 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
21495 (read1): Do not accept +. and -. as integers; this
21496 appears to have been a coding error. Similarly, do not accept
21497 strings like +-1e0 as floating point numbers. Do not report
21498 overflow for integer overflows unless the base is not 10 which
21499 means we have no simple and reliable way to continue.
21500 Break out the floating-point parsing into a new
21501 function string_to_number, so that Fstring_to_number parses
21502 floating point numbers consistently with the Lisp reader.
21503 (digit_to_number): Move here from data.c. Make it static inline.
21504 (E_CHAR, EXP_INT): Remove, replacing with ...
21505 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21506 (string_to_number): New function, replacing isfloat_string.
21507 This function checks for valid syntax and produces the resulting
21508 Lisp float number too. Rework it so that string-to-number
21509 no longer mishandles examples like "1.0e+". Use strtoumax,
21510 so that overflow for non-base-10 numbers is reported only when
21511 there's no portable and simple way to convert to floating point.
21512
21513 * textprop.c (set_text_properties_1): Rewrite for clarity,
21514 and to avoid GCC warning about integer overflow.
21515
21516 * intervals.h (struct interval): Use EMACS_INT for members
21517 where EMACS_UINT might cause problems. See
21518 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21519 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21520 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21521 All uses changed.
21522 (offset_intervals): Tell GCC not to worry about length overflow
21523 when negating a negative length.
21524
21525 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21526 (overrun_check_free): Likewise.
21527
21528 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21529 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21530 word size.
21531
21532 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21533 (gnutls_make_error): Rename local to avoid shadowing.
21534 (gnutls_emacs_global_deinit): ifdef out; not used.
21535 (Fgnutls_boot): Use const for pointer to readonly storage.
21536 Comment out unused local. Fix pointer signedness problems.
21537
21538 * lread.c (openp): Don't stuff size_t into an 'int'.
21539 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21540 about possible signed overflow.
21541
21542 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21543 (GDK_KEY_g): Don't define if already defined.
21544 (xg_prepare_tooltip): Avoid pointer signedness problem.
21545 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21546
21547 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21548 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21549
21550 * xfns.c (Fx_window_property): Simplify a bit,
21551 to make a bit faster and to avoid GCC 4.6.0 warning.
21552 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21553
21554 * fns.c (internal_equal): Don't assume size_t fits in int.
21555
21556 * alloc.c (compact_small_strings): Tighten assertion a little.
21557
21558 Replace pEd with more-general pI, and fix some printf arg casts.
21559 * lisp.h (pI): New macro, generalizing old pEd macro to other
21560 conversion specifiers. For example, use "...%"pI"d..." rather
21561 than "...%"pEd"...".
21562 (pEd): Remove. All uses replaced with similar uses of pI.
21563 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
21564 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21565 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21566 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21567 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21568 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21569 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21570 64-bit hosts.
21571 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21572 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21573 * print.c (safe_debug_print, print_object): Likewise.
21574 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21575 to int.
21576 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21577 avoiding the 0 flag, which is not portable.
21578 * process.c (Fmake_network_process): Use pI to avoid cast.
21579 * region-cache.c (pp_cache): Likewise.
21580 * xdisp.c (decode_mode_spec): Likewise.
21581 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21582 behavior on 64-bit hosts with printf arg.
21583 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
21584 (x_stop_queuing_selection_requests): Likewise.
21585 (x_get_window_property): Don't truncate byte count to an 'int'
21586 when tracing.
21587
21588 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21589 here, since it parses constructs like leading '-' and spaces,
21590 which are not wanted; and it overflows with large numbers.
21591 Instead, simply match F[0-9]+, which is what is wanted anyway.
21592
21593 * alloc.c: Remove unportable assumptions about struct layout.
21594 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21595 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21596 (allocate_vectorlike, make_pure_vector): Use the new macros,
21597 plus offsetof, to remove unportable assumptions about struct layout.
21598 These assumptions hold on all porting targets that I know of, but
21599 they are not guaranteed, they're easy to remove, and removing them
21600 makes further changes easier.
21601
21602 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21603 This doesn't fix a bug but makes the code clearer.
21604 (string_overrun_cookie): Now const. Use initializers that
21605 don't formally overflow signed char, to avoid warnings.
21606 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21607 can cause Emacs to crash when string overrun checking is enabled.
21608 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21609 multiple of sizeof (EMACS_INT); it need not be, if
21610 alignof(EMACS_INT) < sizeof (EMACS_INT).
21611 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
21612
21613 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
21614
21615 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21616
21617 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21618
21619 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
21620 supposed to be handshaking. (Bug#8556)
21621 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21622
21623 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
21624
21625 * lisp.h (Qdebug): List symbol.
21626 * eval.c (Qdebug): Restore global linkage.
21627 * keyboard.c (debug-on-event): New variable.
21628 (handle_user_signal): Break into debugger when debug-on-event
21629 matches the current signal symbol.
21630
21631 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21632
21633 * alloc.c (check_sblock, check_string_bytes)
21634 (check_string_free_list): Convert to standard C.
21635
21636 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21637
21638 * w32.c (emacs_gnutls_push): Fix typo.
21639
21640 2011-04-25 Eli Zaretskii <eliz@gnu.org>
21641
21642 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21643 "cast to pointer from integer of different size".
21644
21645 Improve doprnt and its use in verror. (Bug#8545)
21646 * doprnt.c (doprnt): Document the set of format control sequences
21647 supported by the function. Use SAFE_ALLOCA instead of always
21648 using `alloca'.
21649
21650 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21651 is one byte too soon. Don't use xrealloc; instead xfree and
21652 xmalloc anew.
21653
21654 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21655
21656 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21657 callbacks stage.
21658
21659 * gnutls.c: Renamed global_initialized to
21660 gnutls_global_initialized. Added internals for the
21661 :verify-hostname-error, :verify-error, and :verify-flags
21662 parameters of `gnutls-boot' and documented those parameters in the
21663 docstring. Start callback support.
21664 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21665 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21666 on error. Return error code.
21667 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21668 (emacs_gnutls_read): Likewise.
21669 (Fgnutls_boot): Return handshake error code.
21670 (emacs_gnutls_handle_error): New function.
21671 (wsaerror_to_errno): Likewise.
21672
21673 * w32.h (emacs_gnutls_pull): Add prototype.
21674 (emacs_gnutls_push): Likewise.
21675
21676 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21677 (emacs_gnutls_push): Likewise.
21678
21679 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21680
21681 * process.c (wait_reading_process_output): Check if GnuTLS
21682 buffered some data internally if no FDs are set for TLS
21683 connections.
21684
21685 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21686 (LIBS): Link to USER_LIBS.
21687 ($(BLD)/gnutls.$(0)): New target.
21688
21689 2011-04-24 Eli Zaretskii <eliz@gnu.org>
21690
21691 * xdisp.c (handle_single_display_spec): Rename the
21692 display_replaced_before_p argument into display_replaced_p, to
21693 make it consistent with the commentary. Fix typos in the
21694 commentary.
21695
21696 * textprop.c (syms_of_textprop): Remove dead code.
21697 (copy_text_properties): Delete obsolete commentary about an
21698 interface that was deleted long ago. Fix typos in the description
21699 of arguments.
21700
21701 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21702 to changes in oldXMenu/XMenu.h from 2011-04-16.
21703 <menu_help_message, prev_menu_help_message>: Constify.
21704 (IT_menu_make_room): menu->help_text is now `const char **';
21705 adjust.
21706
21707 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21708 to changes in oldXMenu/XMenu.h from 2011-04-16.
21709 (struct XMenu): Declare `help_text' `const char **'.
21710
21711 * xfaces.c <Qunspecified>: Make extern again.
21712
21713 * syntax.c: Include sys/types.h before including regex.h, as
21714 required by POSIX.
21715
21716 * doc.c (get_doc_string): Improve the format passed to `error'.
21717
21718 * doprnt.c (doprnt): Improve commentary.
21719
21720 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21721
21722 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21723 them with etags.
21724
21725 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21726 changes in globals.h immediately force recompilation.
21727 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21728 $(CURDIR)/s/ms-w32.h.
21729 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
21730
21731 * character.c (Fchar_direction): Function deleted.
21732 (syms_of_character): Don't defsubr it.
21733 <char-direction-table>: Deleted.
21734
21735 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21736
21737 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21738 * doprnt.c: Include limits.h.
21739 (SIZE_MAX): New macro.
21740 (doprnt): Return a size_t value. 2nd arg is now size_t.
21741 Many local variables are now size_t instead of int or unsigned.
21742 Improve overflow protection. Support `l' modifier for integer
21743 conversions. Support %l conversion. Don't assume an EMACS_INT
21744 argument for integer conversions and for %c.
21745
21746 * lisp.h (doprnt): Restore prototype.
21747
21748 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21749 $(SRC)/character.h.
21750
21751 * Makefile.in (base_obj): Add back doprnt.o.
21752
21753 * deps.mk (doprnt.o): Add back prerequisites.
21754 (callint.o): Depend on character.h.
21755
21756 * eval.c (internal_lisp_condition_case): Include the handler
21757 representation in the error message.
21758 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21759 when breaking from the loop.
21760
21761 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21762
21763 * callint.c (Fcall_interactively): When displaying error message
21764 about invalid control letter, pass the character's codepoint, not
21765 a pointer to its multibyte form. Improve display of the character
21766 in octal and display also its hex code.
21767
21768 * character.c (char_string): Use %x to display the (unsigned)
21769 codepoint of an invalid character, to avoid displaying a bogus
21770 negative value.
21771
21772 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21773 `error', not SYMBOL_NAME itself.
21774
21775 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21776 character arguments to `error'.
21777
21778 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21779 to `error' in error message about FINAL_CHAR argument. Make sure
21780 FINAL_CHAR is a character, and use %c when it is passed as
21781 argument to `error'.
21782
21783 2011-04-23 Eli Zaretskii <eliz@gnu.org>
21784
21785 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21786
21787 * w32.c: Include <time.h>.
21788 (sys_localtime): New function.
21789
21790 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
21791
21792 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21793
21794 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
21795
21796 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
21797
21798 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21799 zombies (Bug#8467).
21800
21801 2011-04-19 Eli Zaretskii <eliz@gnu.org>
21802
21803 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21804 gl_state.e_property when gl_state.object is Qt.
21805
21806 * insdel.c (make_gap_larger): Remove limitation of buffer size
21807 to <= INT_MAX.
21808
21809 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
21810
21811 * xdisp.c (lookup_glyphless_char_display)
21812 (produce_glyphless_glyph): Handle cons cell entry in
21813 glyphless-char-display.
21814 (Vglyphless_char_display): Document it.
21815
21816 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21817 glyphless-char-display.
21818
21819 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
21820
21821 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21822
21823 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21824
21825 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21826 definition for no-X builds.
21827
21828 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
21829
21830 Static checks with GCC 4.6.0 and non-default toolkits.
21831
21832 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21833
21834 * process.c (keyboard_bit_set): Define only if SIGIO.
21835 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21836 (send_process): Repair possible setjmp clobbering.
21837
21838 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21839
21840 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21841
21842 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21843
21844 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21845 Define only if needed.
21846
21847 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21848 by pacifying GCC about it. Maybe it's time to retire it?
21849 * xfaces.c (USG, __TIMEVAL__): Likewise.
21850
21851 * dispextern.h (struct redisplay_interface): Rename param
21852 to avoid shadowing.
21853 * termhooks.h (struct terminal): Likewise.
21854 * xterm.c (xembed_send_message): Likewise.
21855
21856 * insdel.c (make_gap_smaller): Define only if
21857 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21858
21859 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21860 it.
21861
21862 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21863 so that we aren't warned about unused symbols.
21864
21865 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21866
21867 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
21868
21869 * xfns.c (x_real_positions): Mark locals as initialized.
21870
21871 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21872
21873 * xterm.c: Fix problems found by static analysis with other toolkits.
21874 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
21875 (x_dispatch_event): Declare static if USE_GTK, and
21876 define if USE_GTK || USE_X_TOOLKIT.
21877 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
21878 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
21879 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21880 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
21881
21882 * xmenu.c (menu_help_callback): Pointer type fixes.
21883 Use const pointers when pointing at readonly data. Avoid pointer
21884 signedness clashes.
21885 (FALSE): Remove unused macro.
21886 (update_frame_menubar): Remove unused decl.
21887
21888 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21889
21890 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21891 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21892 (single_menu_item): Rename local to avoid shadowing.
21893
21894 * keyboard.c (make_lispy_event): Remove unused local var.
21895
21896 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21897 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21898
21899 * bitmaps: Change bitmaps from unsigned char back to the X11
21900 compatible char. Avoid the old compiler warnings about
21901 out-of-range initializers by using, for example, '\xab' rather
21902 than 0xab.
21903
21904 * xgselect.c (xgselect_initialize): Check vs interface
21905 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21906
21907 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21908
21909 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21910 to read-only memory.
21911
21912 * fns.c (vector): Remove; this old hack is no longer needed.
21913
21914 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
21915 Remove unused var.
21916 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
21917
21918 * xrdb.c (x_load_resources): Omit unused local.
21919
21920 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
21921 (x_window): Rename locals to avoid shadowing.
21922 (USG): Use the kludged USG macro, to pacify gcc.
21923
21924 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
21925 (x_term_init): Remove local to avoid shadowing.
21926
21927 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
21928
21929 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21930 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21931
21932 2011-04-16 Eli Zaretskii <eliz@gnu.org>
21933
21934 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21935
21936 Fix regex.c, syntax.c and friends for buffers > 2GB.
21937 * syntax.h (struct gl_state_s): Declare character position members
21938 EMACS_INT.
21939
21940 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21941
21942 * textprop.c (verify_interval_modification, interval_of):
21943 Declare arguments EMACS_INT.
21944
21945 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21946 EMACS_INT.
21947
21948 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21949
21950 * indent.c (Fvertical_motion): Local variable it_start is now
21951 EMACS_INT.
21952
21953 * regex.c (re_match, re_match_2, re_match_2_internal)
21954 (bcmp_translate, regcomp, regexec, print_double_string)
21955 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21956 (re_compile_pattern, re_exec): Declare arguments and local
21957 variables `size_t' and `ssize_t' and return values `regoff_t', as
21958 appropriate.
21959 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21960 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21961 <compile_stack_type>: `size' and `avail' are now `size_t'.
21962
21963 * regex.h <regoff_t>: Use ssize_t, not int.
21964 (re_search, re_search_2, re_match, re_match_2): Arguments that
21965 specify buffer/string position and length are now ssize_t and
21966 size_t. Return type is regoff_t.
21967
21968 2011-04-16 Ben Key <bkey76@gmail.com>
21969
21970 * nsfont.m: Fixed bugs in ns_get_family and
21971 ns_descriptor_to_entity that were caused by using free to
21972 deallocate memory blocks that were allocated by xmalloc (via
21973 xstrdup). This caused Emacs to crash when compiled with
21974 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21975 --enable-checking=xmallocoverrun). xfree is now used to
21976 deallocate these memory blocks.
21977
21978 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
21979
21980 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21981
21982 emacs_write: Accept and return EMACS_INT for sizes.
21983 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21984 et seq.
21985 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21986 Accept and return EMACS_INT.
21987 (emacs_gnutls_write): Return the number of bytes written on
21988 partial writes.
21989 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
21990 (emacs_read, emacs_write): Remove check for negative size, as the
21991 Emacs source code has been audited now.
21992 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21993 (emacs_read, emacs_write): Use it.
21994 * process.c (send_process): Adjust to the new signatures of
21995 emacs_write and emacs_gnutls_write. Do not attempt to store
21996 a byte offset into an 'int'; it might overflow.
21997 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
21998
21999 * sound.c: Don't assume sizes fit in 'int'.
22000 (struct sound_device.period_size, alsa_period_size):
22001 Return EMACS_INT, not int.
22002 (struct sound_device.write, vox_write, alsa_write):
22003 Accept EMACS_INT, not int.
22004 (wav_play, au_play): Use EMACS_INT to store sizes and to
22005 record read return values.
22006
22007 2011-04-15 Ben Key <bkey76@gmail.com>
22008
22009 * keyboard.c (Qundefined): Don't declare static since it is used
22010 in nsfns.m.
22011 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
22012 static since they are used in nsfont.m.
22013
22014 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
22015
22016 * process.c (Qprocessp): Don't declare static.
22017 * lisp.h (Qprocessp): Declare again.
22018
22019 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
22020
22021 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
22022
22023 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
22024
22025 Improve C-level modularity by making more things 'static'.
22026
22027 Don't publish debugger-only interfaces to other modules.
22028 * lisp.h (safe_debug_print, debug_output_compilation_hack):
22029 (verify_bytepos, count_markers): Move decls to the only modules
22030 that need them.
22031 * region-cache.h (pp_cache): Likewise.
22032 * window.h (check_all_windows): Likewise.
22033 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
22034
22035 * sysdep.c (croak): Now static, if
22036 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
22037 * syssignal.h (croak): Declare only if not static.
22038
22039 * alloc.c (refill_memory_reserve): Now static if
22040 !defined REL_ALLOC || defined SYSTEM_MALLOC.
22041 * lisp.h (refill_memory_reserve): Declare only if not static.
22042
22043 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
22044 Define only if USE_LUCID.
22045
22046 * xrdb.c (x_customization_string, x_rm_string): Now static.
22047
22048 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
22049 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
22050
22051 * xdisp.c (draw_row_with_mouse_face): Now static.
22052 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
22053
22054 * window.h (check_all_windows): Mark externally visible.
22055
22056 * window.c (window_deletion_count): Now static.
22057
22058 * undo.c: Make symbols static if they're not exported.
22059 (last_undo_buffer, last_boundary_position, pending_boundary):
22060 Now static.
22061
22062 * textprop.c (interval_insert_behind_hooks): Now static.
22063 (interval_insert_in_front_hooks): Likewise.
22064
22065 * term.c: Make symbols static if they're not exported.
22066 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
22067 (max_frame_lines, tty_set_terminal_modes):
22068 (tty_reset_terminal_modes, tty_turn_off_highlight):
22069 (get_tty_terminal): Now static.
22070 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
22071 * termhooks.h (term_mouse_moveto): Do not declare if
22072 HAVE_WINDOW_SYSTEM.
22073 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
22074 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
22075
22076 * sysdep.c: Make symbols static if they're not exported.
22077 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
22078 Now static.
22079 (sigprocmask_set, full_mask): Remove; unused.
22080 (wait_debugging): Mark as visible.
22081 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
22082 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
22083
22084 * syntax.c (syntax_temp): Define only if !__GNUC__.
22085
22086 * sound.c (current_sound_device, current_sound): Now static.
22087
22088 * search.c (searchbufs, searchbuf_head): Now static.
22089
22090 * scroll.c (scroll_cost): Remove; unused.
22091 * dispextern.h (scroll_cost): Remove decl.
22092
22093 * region-cache.h (pp_cache): Mark as externally visible.
22094
22095 * process.c: Make symbols static if they're not exported.
22096 (process_tick, update_tick, create_process, chan_process):
22097 (Vprocess_alist, proc_buffered_char, datagram_access):
22098 (fd_callback_data, send_process_frame, process_sent_to): Now static.
22099 (deactivate_process): Mark defn as static, as well as decl.
22100 * lisp.h (create_process): Remove decl.
22101 * process.h (chan_process, Vprocess_alist): Remove decls.
22102
22103 * print.c: Make symbols static if they're not exported.
22104 (print_depth, new_backquote_output, being_printed, print_buffer):
22105 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
22106 (print_interval, print_number_index, initial_stderr_stream):
22107 Now static.
22108 * lisp.h (Fprinc): Remove decl.
22109 (debug_output_compilation_hack): Mark as externally visible.
22110
22111 * sysdep.c (croak): Move decl from here to syssignal.h.
22112 * syssignal.h (croak): Put it here, so the API can be checked when
22113 'croak' is called from dissociate_if_controlling_tty.
22114
22115 * minibuf.c: Make symbols static if they're not exported.
22116 (minibuf_save_list, choose_minibuf_frame): Now static.
22117 * lisp.h (choose_minibuf_frame): Remove decl.
22118
22119 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
22120
22121 * lread.c: Make symbols static if they're not exported.
22122 (read_objects, initial_obarray, oblookup_last_bucket_number):
22123 Now static.
22124 (make_symbol): Remove; unused.
22125 * lisp.h (initial_obarray, make_symbol): Remove decls.
22126
22127 * keyboard.c: Make symbols static if they're not exported.
22128 (single_kboard, recent_keys_index, total_keys, recent_keys):
22129 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
22130 (this_single_command_key_start, echoing, last_auto_save):
22131 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
22132 (command_loop, echo_now, keyboard_init_hook, help_char_p):
22133 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
22134 (Vlispy_mouse_stem, double_click_count):
22135 Now static.
22136 (force_auto_save_soon): Define only if SIGDANGER.
22137 (ignore_mouse_drag_p): Now static if
22138 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
22139 (print_help): Remove; unused.
22140 (stop_character, last_timer_event): Mark as externally visible.
22141 * keyboard.h (ignore_mouse_drag_p): Declare only if
22142 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
22143 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
22144 * lisp.h (echoing): Remove decl.
22145 (force_auto_save_soon): Declare only if SIGDANGER.
22146 * xdisp.c (redisplay_window): Simplify code, to make it more
22147 obvious that ignore_mouse_drag_p is not accessed if !defined
22148 USE_GTK && !defined HAVE_NS.
22149
22150 * intervals.c: Make symbols static if they're not exported.
22151 (merge_properties_sticky, merge_interval_right, delete_interval):
22152 Now static.
22153 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22154
22155 * insdel.c: Make symbols static if they're not exported.
22156 However, leave prepare_to_modify_buffer alone. It's never
22157 called from outside this function, but that appears to be a bug.
22158 (combine_after_change_list, combine_after_change_buffer):
22159 (adjust_after_replace, signal_before_change): Now static.
22160 (adjust_after_replace_noundo): Remove; unused.
22161 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
22162 (signal_before_change): Remove decls.
22163
22164 * indent.c (val_compute_motion, val_vmotion): Now static.
22165
22166 * image.c: Make symbols static if they're not exported.
22167 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22168 if USE_GTK.
22169 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22170 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22171
22172 * fringe.c (standard_bitmaps): Now static.
22173 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22174
22175 * frame.c: Make symbols static if they're not exported.
22176 (x_report_frame_params, make_terminal_frame): Now static.
22177 (get_frame_param): Now static, unless HAVE_NS.
22178 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22179 (x_get_resource_string): Remove; not used.
22180 * frame.h (make_terminal_frame, x_report_frame_params):
22181 (x_get_resource_string); Remove decls.
22182 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22183 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22184
22185 * font.c, fontset.c: Make symbols static if they're not exported.
22186 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22187 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22188 * font.c (font_close_object): Now static.
22189 * font.h (font_close_object): Remove.
22190 * fontset.c (FONTSET_OBJLIST): Remove.
22191 (free_realized_fontset) #if-0 the body, which does nothing.
22192 (face_suitable_for_char_p): #if-0, as it's never called.
22193 * fontset.h (face_suitable_for_char_p): Remove decl.
22194 * xfaces.c (face_at_string_position):
22195 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
22196 since 0 is always ASCII.
22197
22198 * fns.c (weak_hash_tables): Now static.
22199
22200 * fileio.c: Make symbols static if they're not exported.
22201 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22202 (Vwrite_region_annotation_buffers): Now static.
22203
22204 * eval.c: Make symbols static if they're not exported.
22205 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22206 * lisp.h (backtrace_list): Remove decl.
22207
22208 * emacs.c: Make symbols static if they're not exported.
22209 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22210 (fatal_error_code, fatal_error_signal_hook, standard_args):
22211 Now static.
22212 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22213 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22214 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22215 * lisp.h (fatal_error_signal_hook): Remove decl.
22216 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22217
22218 * editfns.c: Move a (normally-unused) function to its only use.
22219 * editfns.c, lisp.h (get_operating_system_release): Remove.
22220 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22221 worth the hassle of breaking this out.
22222
22223 * xterm.c: Make symbols static if they're not exported.
22224 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22225 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22226 (x_destroy_window, x_delete_display):
22227 Now static.
22228 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22229 (x_mouse_leave): Remove; unused.
22230 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22231 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22232 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22233 Remove decls.
22234 (x_mouse_leave): Declare only if WINDOWSNT.
22235 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22236 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22237 USE_X_TOOLKIT.
22238
22239 * ftxfont.c: Make symbols static if they're not exported.
22240 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22241 HAVE_FREETYPE.
22242 * font.h (ftxfont_driver): Likewise.
22243
22244 * xfns.c: Make symbols static if they're not exported.
22245 (x_last_font_name, x_display_info_for_name):
22246 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22247 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22248 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22249 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22250 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22251 (last_show_tip_args): Now static.
22252 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22253 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22254 (x_screen_planes): Remove; unused.
22255 * dispextern.h (x_screen_planes): Remove decl.
22256
22257 * dispnew.c: Make symbols static if they're not exported.
22258 * dispextern.h (redraw_garbaged_frames, scrolling):
22259 (increment_row_positions): Remove.
22260 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22261 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22262 Now static.
22263 (redraw_garbaged_frames): Remove; unused.
22264
22265 * xfaces.c: Make symbols static if they're not exported.
22266 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22267 Remove decls.
22268 * xterm.h (defined_color): Remove decls.
22269 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22270 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22271 (menu_face_changed_default, defined_color, free_realized_face):
22272 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22273 (ascii_face_of_lisp_face): Remove; unused.
22274
22275 * xdisp.c: Make symbols static if they're not exported.
22276 * dispextern.h (scratch_glyph_row, window_box_edges):
22277 (glyph_to_pixel_coords, set_cursor_from_row):
22278 (get_next_display_element, set_iterator_to_next):
22279 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22280 (show_mouse_face): Remove decls
22281 * frame.h (message_buf_print): Likewise.
22282 * lisp.h (pop_message, set_message, check_point_in_composition):
22283 Likewise.
22284 * xterm.h (set_vertical_scroll_bar): Likewise.
22285 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22286 (message_buf_print, scratch_glyph_row, displayed_buffer):
22287 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22288 (get_next_display_element, show_mouse_face, window_box_edges):
22289 (frame_to_window_pixel_xy, check_point_in_composition):
22290 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22291 (glyph_to_pixel_coords): Remove; unused.
22292
22293 * dired.c (file_name_completion): Now static.
22294
22295 * dbusbind.c (xd_in_read_queued_messages): Now static.
22296
22297 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22298 * data.c (circular_list_error): Remove.
22299
22300 * commands.h (last_point_position, last_point_position_buffer):
22301 (last_point_position_window): Remove decls.
22302 * keyboard.c: Make these variables static.
22303
22304 * coding.h (coding, code_convert_region, encode_coding_gap):
22305 Remove decls.
22306 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22307 (iso_code_class, detect_coding, code_convert_region): Now static.
22308 (encode_coding_gap): Remove; unused.
22309
22310 * chartab.c (chartab_chars, chartab_bits): Now static.
22311
22312 * charset.h (charset_iso_8859_1): Remove decl.
22313 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22314 Now static.
22315
22316 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22317 * ccl.c (Vccl_program_table): Now static.
22318 (check_ccl_update): Remove; unused.
22319
22320 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22321 * category.h: ... from here.
22322 * category.c (check_category_table, set_category_set): Now static.
22323
22324 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22325 * lisp.h: Remove these decls.
22326
22327 * buffer.c (buffer_count): Remove unused var.
22328
22329 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22330 so that it's not optimized away.
22331 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22332 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22333 exported only to the debugger.
22334
22335 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
22336 * atimer.h (run_all_atimers): Remove; not exported.
22337
22338 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22339 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22340 was inaccessible from Lisp.
22341 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22342 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22343
22344 alloc.c: Import and export fewer symbols, and remove unused items.
22345 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22346 is defined.
22347 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22348 it's not optimized away by whole-program optimization.
22349 (message_enable_multibyte, free_misc): Remove.
22350 (catchlist, handlerlist, mark_backtrace):
22351 Declare only if BYTE_MARK_STACK.
22352 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22353 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22354 (message_enable_multibyte): Remove decl.
22355 (free_misc, interval_free_list, float_block, float_block_index):
22356 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22357 (cons_free_list, last_marked_index):
22358 Now static.
22359 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22360 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22361 (mark_backtrace): Define only if BYTE_MARK_STACK.
22362 * xdisp.c (message_enable_multibyte): Now static.
22363
22364 Declare Lisp_Object Q* variables to be 'static' if not exported.
22365 This makes it easier for human readers (and static analyzers)
22366 to see whether these variables are used from other modules.
22367 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22368 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22369 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22370 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22371 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22372 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22373 * xmenu.c, xselect.c:
22374 Declare Q* vars static if they are not used in other modules.
22375 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22376 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22377 Remove decls of unexported vars.
22378 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22379
22380 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22381
22382 Make Emacs functions such as Fatom 'static' by default.
22383 This makes it easier for human readers (and static analyzers)
22384 to see whether these functions can be called from other modules.
22385 DEFUN now defines a static function. To make the function external
22386 so that it can be used in other C modules, use the new macro DEFUE.
22387 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22388 (Finit_image_library):
22389 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22390 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22391 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22392 Remove decls, since these functions are now static.
22393 (Funintern, Fget_internal_run_time): New decls, since these functions
22394 were already external.
22395
22396 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22397 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22398 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22399 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22400 * keyboard.c, keymap.c, lread.c:
22401 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22402 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22403 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22404 Mark functions with DEFUE instead of DEFUN,
22405 if they are used in other modules.
22406 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22407 decls for now-static functions.
22408 * buffer.h (Fdelete_overlay): Remove decl.
22409 * callproc.c (Fgetenv_internal): Mark as internal.
22410 * composite.c (Fremove_list_of_text_properties): Remove decl.
22411 (Fcomposition_get_gstring): New forward static decl.
22412 * composite.h (Fcomposite_get_gstring): Remove decl.
22413 * dired.c (Ffile_attributes): New forward static decl.
22414 * doc.c (Fdocumntation_property): New forward static decl.
22415 * eval.c (Ffetch_bytecode): New forward static decl.
22416 (Funintern): Remove extern decl; now in .h file where it belongs.
22417 * fileio.c (Fmake_symbolic_link): New forward static decl.
22418 * image.c (Finit_image_library): New forward static decl.
22419 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22420 * intervals.h (Fprevious_property_change):
22421 (Fremove_list_of_text_properties): Remove decls.
22422 * keyboard.c (Fthis_command_keys): Remove decl.
22423 (Fcommand_execute): New forward static decl.
22424 * keymap.c (Flookup_key): New forward static decl.
22425 (Fcopy_keymap): Now static.
22426 * keymap.h (Flookup_key): Remove decl.
22427 * process.c (Fget_process): New forward static decl.
22428 (Fprocess_datagram_address): Mark as internal.
22429 * syntax.c (Fsyntax_table_p): New forward static decl.
22430 (skip_chars): Remove duplicate decl.
22431 * textprop.c (Fprevious_property_change): New forward static decl.
22432 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22433 Now internal.
22434 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22435 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22436
22437 * editfns.c (Fformat): Remove unreachable code.
22438
22439 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22440
22441 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22442 change. (Bug#8496)
22443
22444 2011-04-13 Eli Zaretskii <eliz@gnu.org>
22445
22446 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22447 when at ZV. (Bug#8487)
22448
22449 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22450
22451 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22452 (Bug#8437)
22453 * keyboard.c (parse_tool_bar_item): Likewise.
22454 * sound.c (sound_cleanup, alsa_close): Likewise.
22455 * termcap.c (tgetent): Likewise.
22456 * xfns.c (x_default_font_parameter): Likewise.
22457 * xsettings.c (read_and_apply_settings): Likewise.
22458
22459 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22460 (overrun_check_free): Protoize.
22461
22462 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22463
22464 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22465 since callers should never pass a negative size.
22466 Change the signature to match that of plain 'read' and 'write'; see
22467 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22468 * lisp.h: Update prototypes of emacs_write and emacs_read.
22469
22470 2011-04-11 Eli Zaretskii <eliz@gnu.org>
22471
22472 * xdisp.c (redisplay_window): Don't try to determine the character
22473 position of the scroll margin if the window start point w->startp
22474 is outside the buffer's accessible region. (Bug#8468)
22475
22476 2011-04-10 Eli Zaretskii <eliz@gnu.org>
22477
22478 Fix write-region and its subroutines for buffers > 2GB.
22479 * fileio.c (a_write, e_write): Modify declaration of arguments and
22480 local variables to support buffers larger than 2GB.
22481 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22482
22483 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22484 argument, local variables, and return value.
22485
22486 * lisp.h: Update prototypes of emacs_write and emacs_read.
22487
22488 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22489
22490 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
22491
22492 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22493
22494 Fix more problems found by GCC 4.6.0's static checks.
22495
22496 * xdisp.c (vmessage): Use a better test for character truncation.
22497
22498 * charset.c (load_charset_map): <, not <=, for optimization,
22499 and to avoid potential problems with integer overflow.
22500 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
22501 * casetab.c (set_identity, shuffle): Likewise.
22502 * editfns.c (Fformat): Likewise.
22503 * syntax.c (skip_chars): Likewise.
22504
22505 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22506 This also lets GCC 4.6.0 generate slightly better loop code.
22507
22508 * callint.c (Fcall_interactively): <, not <=, for optimization.
22509 (Fcall_interactively): Count the number of arguments produced,
22510 not the number of arguments given. This is simpler and lets GCC
22511 4.6.0 generate slightly better code.
22512
22513 * ftfont.c: Distingish more carefully between FcChar8 and char.
22514 The previous code passed unsigned char * to a functions like
22515 strlen and xstrcasecmp that expect char *, which does not
22516 conform to the C standard.
22517 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22518 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22519 char * when the C standard requires it.
22520
22521 * keyboard.c (read_char): Remove unused var.
22522
22523 * eval.c: Port to Windows vsnprintf (Bug#8435).
22524 Include <limits.h>.
22525 (SIZE_MAX): Define if the headers do not.
22526 (verror): Do not give up if vsnprintf returns a negative count.
22527 Instead, grow the buffer. This ports to Windows vsnprintf, which
22528 does not conform to C99. Problem reported by Eli Zaretskii.
22529 Also, simplify the allocation scheme, by avoiding the need for
22530 calling realloc, and removing the ALLOCATED variable.
22531
22532 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22533
22534 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22535 But keep the doprint source code for now, as we might revamp it
22536 and use it again (Bug#8435).
22537 * lisp.h (doprnt): Remove.
22538 * Makefile.in (base_obj): Remove doprnt.o.
22539 * deps.mk (doprnt.o): Remove.
22540
22541 error: Print 32- and 64-bit integers portably (Bug#8435).
22542 Without this change, on typical 64-bit hosts error ("...%d...", N)
22543 was used to print both 32- and 64-bit integers N, which relied on
22544 undefined behavior.
22545 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
22546 * lisp.h (error, verror): Mark as printf-like functions.
22547 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22548 Report overflow in size calculations when allocating printf buffer.
22549 Do not truncate output string at its first null byte.
22550 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22551 Truncate the output at a character boundary, since vsnprintf does not
22552 do that.
22553 * charset.c (check_iso_charset_parameter): Convert internal
22554 character to string before calling 'error', since %c now has the
22555 printf meaning.
22556 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22557 overflow when computing char to be passed to 'error'. Do not
22558 pass Lisp_Object to 'error'; pass the integer instead.
22559 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22560 formatted with plain %d.
22561
22562 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22563
22564 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22565
22566 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22567
22568 * xterm.c (x_catch_errors): Remove duplicate declaration.
22569
22570 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22571
22572 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22573
22574 2011-04-10 Jim Meyering <meyering@redhat.com>
22575
22576 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22577 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22578 return ssize_t not "int", and use size_t as the buffer length.
22579 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22580 * gnutls.h: Update declarations.
22581 * process.c (read_process_output): Use ssize_t, to match.
22582 (send_process): Likewise.
22583
22584 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22585
22586 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22587
22588 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
22589
22590 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22591 Use unsigned char, to match FcChar8 type definition.
22592
22593 * xterm.c (handle_one_xevent):
22594 * xmenu.c (create_and_show_popup_menu):
22595 * xselect.c (x_decline_selection_request)
22596 (x_reply_selection_request): Avoid type-punned deref of X events.
22597
22598 2011-04-09 Eli Zaretskii <eliz@gnu.org>
22599
22600 Fix some uses of `int' instead of EMACS_INT.
22601 * search.c (string_match_1, fast_string_match)
22602 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22603 (scan_buffer, find_next_newline_no_quit)
22604 (find_before_next_newline, search_command, Freplace_match)
22605 (Fmatch_data): Make some `int' variables be EMACS_INT.
22606
22607 * xdisp.c (display_count_lines): 3rd argument and return value now
22608 EMACS_INT. All callers changed.
22609 (pint2hrstr): Last argument is now EMACS_INT.
22610
22611 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22612 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22613 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22614 (decode_coding_utf_16, decode_coding_emacs_mule)
22615 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22616 (decode_coding_ccl, decode_coding_charset)
22617 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22618 (decode_coding_iso_2022, decode_coding_emacs_mule)
22619 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22620 <char_offset, last_offset>: Declare EMACS_INT.
22621 (encode_coding_utf_8, encode_coding_utf_16)
22622 (encode_coding_emacs_mule, encode_invocation_designation)
22623 (encode_designation_at_bol, encode_coding_iso_2022)
22624 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22625 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22626 Declare EMACS_INT.
22627 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22628 (encode_invocation_designation): Last argument P_NCHARS is now
22629 EMACS_INT.
22630 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22631 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22632
22633 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22634 All users changed.
22635
22636 * ccl.c (Fccl_execute_on_string): Declare some variables
22637 EMACS_INT.
22638
22639 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
22640
22641 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22642
22643 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22644
22645 * process.c (Fformat_network_address): Doc fix.
22646
22647 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22648
22649 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
22650
22651 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
22652
22653 * keyboard.c (read_char): Call Lisp function help-form-show,
22654 instead of using internal_with_output_to_temp_buffer.
22655 (Qhelp_form_show): New var.
22656 (syms_of_keyboard): Use DEFSYM macro.
22657
22658 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22659
22660 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22661
22662 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
22663
22664 * process.c (Flist_processes): Remove to Lisp.
22665 (list_processes_1): Delete.
22666
22667 2011-04-06 Eli Zaretskii <eliz@gnu.org>
22668
22669 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22670
22671 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22672
22673 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
22674
22675 Fix more problems found by GCC 4.6.0's static checks.
22676
22677 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22678
22679 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22680
22681 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
22682
22683 * xdisp.c (vmessage): Mark as a printf-like function.
22684
22685 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22686
22687 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22688
22689 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22690 printf-like functions.
22691 (tiff_load): Add casts to remove these marks before passing them
22692 to system-supplied API.
22693
22694 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22695
22696 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22697 This avoids several warnings with gcc -Wstrict-overflow.
22698 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22699 directly, rather than having caller test rule sign. This avoids
22700 some unnecessary tests.
22701 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22702 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22703 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
22704
22705 * xfont.c (xfont_text_extents): Remove var that was set but not used.
22706 (xfont_open): Avoid unnecessary tests.
22707
22708 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22709
22710 * composite.h, composite.c (composition_gstring_put_cache):
22711 Use EMACS_INT, not int, for length.
22712
22713 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22714 breaking out part of COMPOSITION_DECODE_RULE.
22715 (COMPOSITION_DECODE_RULE): Use it.
22716 * composite.c (get_composition_id): Remove unused local vars,
22717 by using the new macro.
22718
22719 * textprop.c (set_text_properties_1): Change while to do-while,
22720 since the condition is always true at first.
22721
22722 * intervals.c (graft_intervals_into_buffer): Mark var as used.
22723 (interval_deletion_adjustment): Return unsigned value.
22724 All uses changed.
22725
22726 * process.c (list_processes_1, create_pty, read_process_output):
22727 (exec_sentinel): Remove vars that were set but not used.
22728 (create_pty): Remove unnecessary "volatile"s.
22729 (Fnetwork_interface_info): Avoid possibility of int overflow.
22730 (read_process_output): Do adaptive read buffering even if carryover.
22731 (read_process_output): Simplify nbytes computation if buffered.
22732
22733 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22734
22735 * syntax.c (scan_words): Remove var that was set but not used.
22736 (update_syntax_table): Use unsigned instead of int.
22737
22738 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
22739 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
22740 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
22741
22742 * print.c (print_error_message): Avoid int overflow.
22743
22744 * font.c (font_list_entities): Redo for clarity,
22745 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22746
22747 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
22748 (font_score): Avoid potential overflow in diff calculation.
22749
22750 * fns.c (substring_both): Remove var that is set but not used.
22751 (sxhash): Redo loop for clarity and to avoid wraparound warning.
22752
22753 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22754
22755 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22756 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22757 can always succeed if overflow has undefined behavior.
22758
22759 * search.c (boyer_moore, wordify): Remove vars set but not used.
22760 (wordify): Omit three unnecessary tests.
22761
22762 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22763 All callers changed. This avoids the need for an unused var.
22764
22765 * casefiddle.c (casify_region): Remove var that is set but not used.
22766
22767 * dired.c (file_name_completion): Remove var that is set but not used.
22768
22769 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22770
22771 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
22772 (Finsert_file_contents): Remove unnecessary code checking fd.
22773
22774 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22775 Check for integer overflow on size calculations.
22776
22777 * buffer.c (Fprevious_overlay_change): Remove var that is set
22778 but not used.
22779
22780 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22781 Remove vars that are set but not used.
22782 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
22783 (timer_check_2): Mark vars as initialized.
22784
22785 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22786
22787 * image.c (lookup_image): Remove var that is set but not used.
22788 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
22789
22790 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22791 that are set but not used.
22792
22793 * xfns.c (make_invisible_cursor): Don't return garbage
22794 if XCreateBitmapFromData fails (Bug#8410).
22795
22796 * xselect.c (x_get_local_selection, x_handle_property_notify):
22797 Remove vars that are set but not used.
22798
22799 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
22800 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
22801
22802 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22803 Remove var that is set but not used.
22804 (scroll_bar_windows_size): Now size_t, not int.
22805 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22806 Check for overflow.
22807
22808 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22809 (map_tty_color) [!defined MSDOS]: Likewise.
22810
22811 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22812
22813 * coding.c: Remove vars that are set but not used.
22814 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22815 All callers changed.
22816 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22817 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22818 (decode_coding_charset): Remove vars that are set but not used.
22819
22820 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22821 that is set but not used.
22822
22823 * print.c (print_object): Remove var that is set but not used.
22824
22825 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
22826 The gnulib version avoids calling malloc in the usual case,
22827 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22828 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22829 * filelock.c (current_lock_owner): Likewise.
22830 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22831 * sysdep.c: Include allocator.h, careadlinkat.h.
22832 (emacs_no_realloc_allocator): New static constant.
22833 (emacs_readlink): New function.
22834 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22835 ../lib/careadlinkat.h.
22836
22837 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22838
22839 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22840 first non-nil return value).
22841
22842 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22843
22844 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22845 if not defined (Bug#8403).
22846
22847 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22848
22849 * xdisp.c (display_count_lines): Remove parameter `start',
22850 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22851 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22852 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22853 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22854 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22855 and thereabouts. All callers changed.
22856 (get_per_char_metric): Remove parameter `f', unused since
22857 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22858
22859 2011-04-02 Jim Meyering <meyering@redhat.com>
22860
22861 do not dereference NULL upon failed strdup
22862 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22863 (ns_get_family): Likewise.
22864
22865 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
22866
22867 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22868
22869 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22870
22871 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22872 later (Bug#8403).
22873
22874 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22875
22876 Add lexical binding.
22877
22878 * window.c (Ftemp_output_buffer_show): New fun.
22879 (Fsave_window_excursion):
22880 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22881
22882 * lread.c (lisp_file_lexically_bound_p): New function.
22883 (Fload): Bind Qlexical_binding.
22884 (readevalloop): Remove `evalfun' arg.
22885 Bind Qinternal_interpreter_environment.
22886 (Feval_buffer): Bind Qlexical_binding.
22887 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22888 Mark as dynamic.
22889 (syms_of_lread): Declare `lexical-binding'.
22890
22891 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22892
22893 * keyboard.c (eval_dyn): New fun.
22894 (menu_item_eval_property): Use it.
22895
22896 * image.c (parse_image_spec): Use Ffunctionp.
22897
22898 * fns.c (concat, mapcar1): Accept byte-code-functions.
22899
22900 * eval.c (Fsetq): Handle lexical vars.
22901 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22902 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22903 (FletX, Flet): Obey lexical binding.
22904 (Fcommandp): Handle closures.
22905 (Feval): New `lexical' arg.
22906 (eval_sub): New function extracted from Feval. Use it almost
22907 everywhere where Feval was used. Look up vars in lexical env.
22908 Handle closures.
22909 (Ffunctionp): Move from subr.el.
22910 (Ffuncall): Handle closures.
22911 (apply_lambda): Remove `eval_flags'.
22912 (funcall_lambda): Handle closures and new byte-code-functions.
22913 (Fspecial_variable_p): New function.
22914 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22915 but without exporting it to Lisp.
22916
22917 * doc.c (Fdocumentation, store_function_docstring):
22918 * data.c (Finteractive_form): Handle closures.
22919
22920 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22921 interactive spec.
22922
22923 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22924 New byte-codes.
22925 (exec_byte_code): New function extracted from Fbyte_code to handle new
22926 calling convention for byte-code-functions. Add new byte-codes.
22927
22928 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
22929
22930 * alloc.c (Fmake_symbol): Init new `declared_special' field.
22931
22932 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22933
22934 * xdisp.c (redisplay_internal): Fix prototype.
22935
22936 2011-03-31 Eli Zaretskii <eliz@gnu.org>
22937
22938 * xdisp.c (SCROLL_LIMIT): New macro.
22939 (try_scrolling): Use it when setting scroll_limit.
22940 Limit scrolling to 100 screen lines.
22941 (redisplay_window): Even when falling back on "recentering",
22942 position point in the window according to scroll-conservatively,
22943 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22944
22945 (try_scrolling): When point is above the window, allow searching
22946 as far as scroll_max, or one screenful, to compute vertical
22947 distance from PT to the scroll margin position. This prevents
22948 try_scrolling from unnecessarily failing when
22949 scroll-conservatively is set to a value slightly larger than the
22950 window height. Clean up the case of PT below the margin at bottom
22951 of window: scroll_max can no longer be INT_MAX. When aggressive
22952 scrolling is in use, don't let point enter the opposite scroll
22953 margin as result of the scroll.
22954 (syms_of_xdisp) <scroll-conservatively>: Document the
22955 threshold of 100 lines for never-recentering scrolling.
22956
22957 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
22958
22959 * dispextern.h (move_it_by_lines):
22960 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22961 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22962 (message_log_check_duplicate): Remove parameters `prev_bol' and
22963 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22964 (redisplay_internal): Remove parameter `preserve_echo_area',
22965 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22966
22967 * indent.c (Fvertical_motion):
22968 * window.c (window_scroll_pixel_based, Frecenter):
22969 Don't pass `need_y_p' to `move_it_by_lines'.
22970
22971 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22972
22973 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22974 steal a few bits to be more compact.
22975 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22976 Remove unneeded casts.
22977
22978 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22979
22980 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22981
22982 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22983 binding" message (bug#7967).
22984
22985 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22986
22987 Fix more problems found by GCC 4.6.0's static checks.
22988
22989 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22990 Remove unused local var.
22991
22992 * editfns.c (Fmessage_box): Remove unused local var.
22993
22994 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22995 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22996 Omit unused local vars.
22997 * window.c (shrink_windows): Omit unused local var.
22998 * menu.c (digest_single_submenu): Omit unused local var.
22999 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
23000 Omit unused local var.
23001
23002 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
23003 Don't assume string length fits in int.
23004 (keyremap_step, read_key_sequence): Use size_t for sizes.
23005 (read_key_sequence): Don't check last_real_key_start redundantly.
23006
23007 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
23008 instead of alloca (Bug#8344).
23009
23010 * eval.c (Fbacktrace): Don't assume nargs fits in int.
23011 (Fbacktrace_frame): Don't assume nframes fits in int.
23012
23013 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
23014
23015 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
23016 concerns.
23017
23018 * term.c (produce_glyphless_glyph): Remove unnecessary test.
23019
23020 * cm.c (calccost): Turn while-do into do-while, for clarity.
23021
23022 * keyboard.c (syms_of_keyboard): Use the same style as later
23023 in this function when indexing through an array. This also
23024 works around GCC bug 48267.
23025
23026 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
23027
23028 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
23029
23030 * chartab.c (sub_char_table_ref_and_range): Redo for slight
23031 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
23032
23033 * keyboard.c, keyboard.h (num_input_events): Now size_t.
23034 This avoids undefined behavior on integer overflow, and is a bit
23035 more convenient anyway since it is compared to a size_t variable.
23036
23037 Variadic C functions now count arguments with size_t, not int.
23038 This avoids an unnecessary limitation on 64-bit machines, which
23039 caused (substring ...) to crash on large vectors (Bug#8344).
23040 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
23041 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
23042 All variadic functions and their callers changed accordingly.
23043 (struct gcpro.nvars): Now size_t, not int. All uses changed.
23044 * data.c (arith_driver, float_arith_driver): Likewise.
23045 * editfns.c (general_insert_function): Likewise.
23046 * eval.c (struct backtrace.nargs, interactive_p)
23047 (internal_condition_case_n, run_hook_with_args, apply_lambda)
23048 (funcall_lambda, mark_backtrace): Likewise.
23049 * fns.c (concat): Likewise.
23050 * frame.c (x_set_frame_parameters): Likewise.
23051 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
23052 0 if not found, not -1. All callers changed.
23053
23054 * alloc.c (garbage_collect): Don't assume stack size fits in int.
23055 (stack_copy_size): Now size_t, not int.
23056 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
23057
23058 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23059
23060 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
23061 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23062 All callers changed.
23063
23064 * lisp.h (multibyte_char_to_unibyte):
23065 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
23066 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
23067 * character.h (CHAR_TO_BYTE8):
23068 * cmds.c (internal_self_insert):
23069 * editfns.c (general_insert_function):
23070 * keymap.c (push_key_description):
23071 * search.c (Freplace_match):
23072 * xdisp.c (message_dolog, set_message_1): All callers changed.
23073
23074 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
23075
23076 * keyboard.c (safe_run_hook_funcall): New function.
23077 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
23078 don't set the hook to nil, but remove the offending function instead.
23079 (Qcommand_hook_internal): Remove, unused.
23080 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
23081 Vcommand_hook_internal.
23082
23083 * eval.c (enum run_hooks_condition): Remove.
23084 (funcall_nil, funcall_not): New functions.
23085 (run_hook_with_args): Call each function through a `funcall' argument.
23086 Remove `cond' argument, now redundant.
23087 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
23088 (Frun_hook_with_args_until_failure): Adjust accordingly.
23089 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
23090
23091 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
23092
23093 * dispextern.h (string_buffer_position): Remove declaration.
23094
23095 * print.c (strout): Remove parameter `multibyte', unused since
23096 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
23097
23098 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
23099 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
23100 All callers changed.
23101
23102 * w32.c (_wsa_errlist): Use braces for struct initializers.
23103
23104 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
23105 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
23106 All callers changed.
23107 (string_buffer_position): Likewise. Also, make static (it's never
23108 used outside xdisp.c).
23109 (cursor_row_p): Remove parameter `w', unused since
23110 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
23111 (decode_mode_spec): Remove parameter `precision', introduced during
23112 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
23113 All callers changed.
23114
23115 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23116
23117 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
23118
23119 2011-03-27 Anders Lindgren <andlind@gmail.com>
23120
23121 * nsterm.m (ns_menu_bar_is_hidden): New variable.
23122 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
23123 (ns_update_auto_hide_menu_bar): New functions.
23124 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
23125 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
23126 ns_constrain_all_frames.
23127 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
23128 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
23129
23130 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
23131
23132 * nsmenu.m (runDialogAt): Remove argument to timer_check.
23133
23134 2011-03-27 Glenn Morris <rgm@gnu.org>
23135
23136 * syssignal.h: Replace RETSIGTYPE with void.
23137 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
23138 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
23139 Replace SIGTYPE with void everywhere.
23140 * s/usg5-4-common.h (SIGTYPE): Remove definition.
23141 * s/template.h (SIGTYPE): Remove commented out definition.
23142
23143 2011-03-26 Eli Zaretskii <eliz@gnu.org>
23144
23145 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23146 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23147
23148 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
23149
23150 * w32.c (read_unc_volume): Use parameter `henum', instead of
23151 global variable `wget_enum_handle'.
23152
23153 * keymap.c (describe_vector): Remove parameters `indices' and
23154 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23155 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23156
23157 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23158
23159 * keyboard.c (timer_check): Remove parameter `do_it_now',
23160 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23161 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23162 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23163
23164 * keyboard.c (read_char):
23165 * w32menu.c (w32_menu_display_help):
23166 * xmenu.c (show_help_event, menu_help_callback):
23167 Adjust calls to `show_help_echo'.
23168
23169 * gtkutil.c (xg_maybe_add_timer):
23170 * keyboard.c (readable_events):
23171 * process.c (wait_reading_process_output):
23172 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23173
23174 * insdel.c (adjust_markers_gap_motion):
23175 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23176 (gap_left, gap_right): Don't call it.
23177
23178 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
23179
23180 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23181 incurred during fontification.
23182
23183 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23184
23185 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23186 (DEFVAR_PER_BUFFER): Don't pass it.
23187
23188 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23189 (scrolling_window): Don't pass it.
23190
23191 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
23192
23193 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23194
23195 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23196 and `suffix'.
23197 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23198 of variables specific to SELinux and computation of `encoded_absname'.
23199
23200 * image.c (XPutPixel): Remove unused variable `height'.
23201
23202 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23203
23204 * unexw32.c (get_section_info): Remove unused variable `section'.
23205
23206 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23207 (system_process_attributes): Remove unused variable `sess'.
23208 (sys_read): Remove unused variable `err'.
23209
23210 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23211 (w32_wnd_proc): Remove unused variable `isdead'.
23212 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23213 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23214 (x_create_tip_frame): Remove unused variable `tem'.
23215
23216 * w32inevt.c (w32_console_read_socket):
23217 Remove unused variable `no_events'.
23218
23219 * w32term.c (x_draw_composite_glyph_string_foreground):
23220 Remove unused variable `width'.
23221
23222 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
23223
23224 * w32term.c (x_set_glyph_string_clipping):
23225 Don't pass uninitialized region to CombineRgn.
23226
23227 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
23228
23229 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23230 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23231 (Fx_close_connection): Remove unused variable `i'.
23232
23233 * w32font.c (w32font_draw): Return number of glyphs.
23234 (w32font_open_internal): Remove unused variable `i'.
23235 (w32font_driver): Add missing initializer.
23236
23237 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23238 (fill_in_menu): Remove unused variable `items_added'.
23239
23240 * w32term.c (last_mouse_press_frame): Remove static global variable.
23241 (w32_clip_to_row): Remove unused variable `f'.
23242 (x_delete_terminal): Remove unused variable `i'.
23243
23244 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23245 (NOTHING): Remove unused static global variable.
23246 (uniscribe_check_otf): Remove unused variable `table'.
23247 (uniscribe_font_driver): Add missing initializers.
23248
23249 2011-03-23 Julien Danjou <julien@danjou.info>
23250
23251 * term.c (Fsuspend_tty, Fresume_tty):
23252 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23253 * window.c (temp_output_buffer_show):
23254 * insdel.c (signal_before_change):
23255 * frame.c (Fhandle_switch_frame):
23256 * fileio.c (Fdo_auto_save):
23257 * emacs.c (Fkill_emacs):
23258 * editfns.c (save_excursion_restore):
23259 * cmds.c (internal_self_insert):
23260 * callint.c (Fcall_interactively):
23261 * buffer.c (Fkill_all_local_variables):
23262 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23263 Use Frun_hooks.
23264 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
23265 unconditionally since it does the check itself.
23266
23267 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
23268
23269 Fix more problems found by GCC 4.5.2's static checks.
23270
23271 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23272 the first time through the loop, since we know p0 < p1 then.
23273 This also avoids a gcc -Wstrict-overflow warning.
23274
23275 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23276 leading to a memory leak, possible in functions like
23277 load_charset_map_from_file that can allocate an unbounded number
23278 of objects (Bug#8318).
23279
23280 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23281 that could (at least in theory) be that large.
23282
23283 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23284 This is less likely to overflow, and avoids undefined behavior if
23285 overflow does occur. All callers changed. Use strtoul to scan
23286 for the unsigned long integer.
23287 (pint2hrstr): Simplify and tune code slightly.
23288 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
23289
23290 * scroll.c (do_scrolling): Work around GCC bug 48228.
23291 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23292
23293 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23294 This also avoids a warning with gcc -Wstrict-overflow.
23295 (validate_x_resource_name): Simplify count usage.
23296 This also avoids a warning with gcc -Wstrict-overflow.
23297
23298 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23299 fail (Bug#8306).
23300
23301 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
23302
23303 * process.c (Fmake_network_process): Use socklen_t, not int,
23304 where POSIX says socklen_t is required in portable programs.
23305 This fixes a porting bug on hosts like 64-bit HP-UX, where
23306 socklen_t is wider than int (Bug#8277).
23307 (Fmake_network_process, server_accept_connection):
23308 (wait_reading_process_output, read_process_output):
23309 Likewise.
23310
23311 * process.c: Rename or move locals to avoid shadowing.
23312 (list_processes_1, Fmake_network_process):
23313 (read_process_output_error_handler, exec_sentinel_error_handler):
23314 Rename or move locals.
23315 (Fmake_network_process): Define label "retry_connect" only if needed.
23316 (Fnetwork_interface_info): Fix pointer signedness.
23317 (process_send_signal): Add cast to avoid pointer signedness problem.
23318 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
23319 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
23320
23321 Make tparam.h and terminfo.c consistent.
23322 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23323 Include tparam.h instead, since it declares them.
23324 * cm.h (PC): Remove extern decl; tparam.h now does this.
23325 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23326 * terminfo.c: Include tparam.h, to check interfaces.
23327 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23328 (tparam): Adjust signature to match interface in tparam.h;
23329 this removes some undefined behavior. Check that outstring and len
23330 are zero, which they always are with Emacs.
23331 * tparam.h (PC, BC, UP): New extern decls.
23332
23333 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
23334 (xftfont_open): Rename locals to avoid shadowing.
23335
23336 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
23337 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23338 (OTF_TAG_SYM): Omit macro if not needed.
23339 (ftfont_list): Remove unused local.
23340 (get_adstyle_property, ftfont_pattern_entity):
23341 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23342 Rename locals to avoid shadowing.
23343
23344 * xfont.c (xfont_list_family): Mark var as initialized.
23345
23346 * xml.c (make_dom): Now static.
23347
23348 * composite.c (composition_compute_stop_pos): Rename local to
23349 avoid shadowing.
23350 (composition_reseat_it): Remove unused locals.
23351 (find_automatic_composition, composition_adjust_point): Likewise.
23352 (composition_update_it): Mark var as initialized.
23353 (find_automatic_composition): Mark vars as initialized,
23354 with a FIXME (Bug#8290).
23355
23356 character.h: Rename locals to avoid shadowing.
23357 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23358 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23359 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23360 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23361 to avoid shadowing.
23362
23363 * textprop.c (property_change_between_p): Remove; unused.
23364
23365 * intervals.c (interval_start_pos): Now static.
23366
23367 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23368
23369 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23370 Rename locals to avoid shadowing.
23371
23372 * sound.c (wav_play, au_play, Fplay_sound_internal):
23373 Fix pointer signedness.
23374 (alsa_choose_format): Remove unused local var.
23375 (wav_play): Initialize a variable to 0, to prevent undefined
23376 behavior (Bug#8278).
23377
23378 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23379
23380 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23381
23382 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23383 clobbering (Bug#8298).
23384 * sysdep.c (sys_subshell): Likewise.
23385 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
23386
23387 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23388 This should get cleaned up, so that child_setup has the
23389 same signature on all platforms.
23390
23391 * callproc.c (call_process_cleanup): Now static.
23392 (relocate_fd): Rename locals to avoid shadowing.
23393
23394 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
23395
23396 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23397 not to be necessary, and produces flickering.
23398
23399 2011-03-20 Glenn Morris <rgm@gnu.org>
23400
23401 * config.in: Remove file.
23402
23403 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
23404
23405 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23406 are now in src/globals.h.
23407 (syms_of_minibuf): Remove spurious & from previous change.
23408
23409 2011-03-20 Leo Liu <sdl.web@gmail.com>
23410
23411 * minibuf.c (completing-read-function): New variable.
23412 (completing-read-default): Rename from completing-read.
23413 (completing-read): Call completing-read-function.
23414
23415 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23416
23417 * xfaces.c (Fx_load_color_file):
23418 Read color file from absolute filename (bug#8250).
23419
23420 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
23421
23422 * makefile.w32-in: Update dependencies.
23423
23424 2011-03-17 Eli Zaretskii <eliz@gnu.org>
23425
23426 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23427
23428 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23429
23430 Fix more problems found by GCC 4.5.2's static checks.
23431
23432 * process.c (make_serial_process_unwind, send_process_trap):
23433 (sigchld_handler): Now static.
23434
23435 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23436 That way, the code declares only the vars that it needs.
23437 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23438 * s/cygwin.h (PTY_ITERATION): Likewise.
23439 * s/darwin.h (PTY_ITERATION): Likewise.
23440 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23441
23442 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23443 * process.c (allocate_pty): Don't declare stb unless it's needed.
23444
23445 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
23446 (CONSTANTLIM): Remove; unused.
23447 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23448 Define only if needed.
23449
23450 * unexelf.c (unexec): Name an expression,
23451 to avoid gcc -Wbad-function-cast warning.
23452 Use a different way to cause a compilation error if anyone uses
23453 n rather than nn, a way that does not involve shadowing.
23454 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
23455
23456 * deps.mk (unexalpha.o): Remove; unused.
23457
23458 New file unexec.h, the (simple) interface for unexec (Bug#8267).
23459 * unexec.h: New file.
23460 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23461 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23462 Depend on unexec.h.
23463 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23464 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23465 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
23466 Change as necessary to match prototype in unexec.h.
23467
23468 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23469 shadowing.
23470 (back_comment, skip_chars): Mark vars as initialized.
23471
23472 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23473 Rename locals to avoid shadowing.
23474
23475 * lread.c (read1): Rewrite so as not to use empty "else".
23476 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
23477
23478 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23479
23480 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23481 warning when compiling print.c.
23482
23483 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23484 instead of using an uninitialized var.
23485 (font_sort_entities): Mark var as initialized.
23486
23487 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23488
23489 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23490 pointers to constants.
23491 (font_parse_fcname): Remove unused vars.
23492 (font_delete_unmatched): Now static.
23493 (font_get_spec): Remove; unused.
23494 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23495 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23496 Rename or move locals to avoid shadowing.
23497
23498 * fns.c (require_nesting_list, require_unwind): Now static.
23499 (Ffillarray): Rename locals to avoid shadowing.
23500
23501 * floatfns.c (domain_error2): Define only if needed.
23502 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
23503
23504 * alloc.c (mark_backtrace): Move decl from here ...
23505 * lisp.h: ... to here, so that it can be checked.
23506
23507 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
23508 (Fdefvar): Rewrite so as not to use empty "else".
23509 (lisp_indirect_variable): Name an expression,
23510 to avoid gcc -Wbad-function-cast warning.
23511 (Fdefvar): Rename locals to avoid shadowing.
23512
23513 * callint.c (quotify_arg, quotify_args): Now static.
23514 (Fcall_interactively): Rename locals to avoid shadowing.
23515 Use const pointer when appropriate.
23516
23517 * lisp.h (get_system_name, get_operating_system_release):
23518 Move decls here, to check interfaces.
23519 * process.c (get_operating_system_release): Move decl to lisp.h.
23520 * xrdb.c (get_system_name): Likewise.
23521 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23522 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23523 some of which prompt warnings from gcc -Wbad-function-cast.
23524 (Fformat_time_string, Fencode_time, Finsert_char):
23525 (Ftranslate_region_internal, Fformat):
23526 Rename or remove local vars to avoid shadowing.
23527 (Ftranslate_region_internal): Mark var as initialized.
23528
23529 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23530 avoid shadowing.
23531
23532 * lisp.h (eassert): Check that the argument compiles, even if
23533 ENABLE_CHECKING is not defined.
23534
23535 * data.c (Findirect_variable): Name an expression, to avoid
23536 gcc -Wbad-function-cast warning.
23537 (default_value, arithcompare, arith_driver, arith_error): Now static.
23538 (store_symval_forwarding): Rename local to avoid shadowing.
23539 (Fmake_variable_buffer_local, Fmake_local_variable):
23540 Mark variables as initialized.
23541 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
23542
23543 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
23544 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23545 Rename locals to avoid shadowing.
23546 (mark_stack): Move local variables into the #ifdef region where
23547 they're used.
23548 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23549 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23550 needed otherwise.
23551 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23552 (GC_STRING_CHARS): Remove; not used.
23553 (Fmemory_limit): Cast sbrk's returned value to char *.
23554
23555 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23556 avoids undefined behavior in theory.
23557
23558 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23559
23560 Use functions, not macros, for up- and down-casing (Bug#8254).
23561 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23562 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23563 to use the following functions instead of these macros.
23564 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23565 EMACS_INT, since callers assume the returned value fits in int.
23566 (upcase1): Likewise, for UPCASE_TABLE.
23567 (uppercasep, lowercasep, upcase): New static inline functions.
23568 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
23569 the race-condition problem in the old DOWNCASE.
23570
23571 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23572 Rename locals to avoid shadowing.
23573 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
23574 (regex_compile, re_search_2, re_match_2_internal):
23575 Remove unused local vars.
23576 (FREE_VAR): Rewrite so as not to use empty "else",
23577 which gcc can warn about.
23578 (regex_compile, re_match_2_internal): Mark locals as initialized.
23579 (RETALLOC_IF): Define only if needed.
23580 (WORDCHAR_P): Likewise. This one is never needed, but is used
23581 only in a comment talking about a compiler bug, so put inside
23582 the #if 0 of that comment.
23583 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23584 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23585 Remove; unused.
23586
23587 * search.c (boyer_moore): Rename locals to avoid shadowing.
23588 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23589 (PREV_CHAR_BOUNDARY): Likewise.
23590
23591 * search.c (simple_search): Remove unused var.
23592
23593 * dired.c (compile_pattern): Move decl from here ...
23594 * lisp.h: ... to here, so that it can be checked.
23595 (struct re_registers): New forward decl.
23596
23597 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23598
23599 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23600 All uses changed.
23601 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23602 Rename locals to avoid shadowing.
23603 (Fvertical_motion): Mark locals as initialized.
23604
23605 * casefiddle.c (casify_object, casify_region): Now static.
23606 (casify_region): Mark local as initialized.
23607
23608 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23609
23610 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23611 New macros, so that the caller can use some names other than
23612 gcpro1, gcpro2, etc.
23613 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23614 of the new macros.
23615 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23616 argument, for consistency with GCPRO2_VAR, etc: it is now the
23617 prefix of the variable, not the variable itself. All uses
23618 changed.
23619 * dired.c (directory_files_internal, file_name_completion):
23620 Rename locals to avoid shadowing.
23621
23622 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23623 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23624 dired.c's scmp function, had undefined behavior.
23625 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23626 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23627 * buffer.h: ... to here, because these macros use current_buffer,
23628 and the new implementation with inline functions needs to have
23629 current_buffer in scope now, rather than later when the macros
23630 are used.
23631 (downcase, upcase1): New static inline functions.
23632 (DOWNCASE, UPCASE1): Reimplement using these functions.
23633 This avoids undefined behavior in expressions like
23634 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23635 from race conditions in accessing the global variables
23636 case_temp1 and case_temp2.
23637 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23638 * lisp.h (case_temp1, case_temp2): Remove their decls.
23639 * character.h (ASCII_CHAR_P): Move from here ...
23640 * lisp.h: ... to here, so that the inline functions mentioned
23641 above can use them.
23642
23643 * dired.c (directory_files_internal_unwind): Now static.
23644
23645 * fileio.c (file_name_as_directory, directory_file_name):
23646 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23647 Now static.
23648 (file_name_as_directory): Use const pointers when appropriate.
23649 (Fexpand_file_name): Likewise. In particular, newdir might
23650 point at constant storage, so make it a const pointer.
23651 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
23652 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23653 signedness issues.
23654 (Fset_file_times, Finsert_file_contents, auto_save_error):
23655 Rename locals to avoid shadowing.
23656
23657 * minibuf.c (choose_minibuf_frame_1): Now static.
23658 (Ftry_completion, Fall_completions): Rename or remove locals
23659 to avoid shadowing.
23660
23661 * marker.c (bytepos_to_charpos): Remove; unused.
23662
23663 * lisp.h (verify_bytepos, count_markers): New decls,
23664 so that gcc does not warn that these functions aren't declared.
23665
23666 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23667 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
23668 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
23669 (copy_text): Remove unused local var.
23670
23671 * filelock.c (within_one_second): Now static.
23672 (lock_file_1): Rename local to avoid shadowing.
23673
23674 * buffer.c (fix_overlays_before): Mark locals as initialized.
23675 (fix_start_end_in_overlays): Likewise. This function should be
23676 simplified by using pointers-to-pointers, but that's a different
23677 matter.
23678 (switch_to_buffer_1): Now static.
23679 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23680 (report_overlay_modification): Rename locals to avoid shadowing.
23681
23682 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
23683 Fix pointer signedness issue.
23684 (sys_subshell): Mark local as volatile if checking for lint,
23685 to suppress a gcc -Wclobbered warning that does not seem to be right.
23686 (MAXPATHLEN): Define only if needed.
23687
23688 * process.c (serial_open, serial_configure): Move decls from here ...
23689 * systty.h: ... to here, so that they can be checked.
23690
23691 * fns.c (get_random, seed_random): Move extern decls from here ...
23692 * lisp.h: ... to here, so that they can be checked.
23693
23694 * sysdep.c (reset_io): Now static.
23695 (wait_for_termination_signal): Remove; unused.
23696
23697 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23698 (copy_keymap_item, append_key, push_text_char_description):
23699 Now static.
23700 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
23701 (DENSE_TABLE_SIZE): Remove; unused.
23702 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23703 (describe_map_tree):
23704 Rename locals to avoid shadowing.
23705
23706 * keyboard.c: Declare functions static if they are not used elsewhere.
23707 (echo_char, echo_dash, cmd_error, top_level_2):
23708 (poll_for_input, handle_async_input): Now static.
23709 (read_char, kbd_buffer_get_event, make_lispy_position):
23710 (make_lispy_event, make_lispy_movement, apply_modifiers):
23711 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23712 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23713 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
23714 (read_key_sequence, read_char): Mark locals as initialized.
23715 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
23716
23717 * keyboard.h (make_ctrl_char): New decl.
23718 (mark_kboards): Move decl here ...
23719 * alloc.c (mark_kboards): ... from here.
23720
23721 * lisp.h (force_auto_save_soon): New decl.
23722
23723 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
23724 (DEFINE_DUMMY_FUNCTION): New macro.
23725 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23726 Use it.
23727 (main): Add casts to avoid warnings
23728 if GCC considers string literals to be constants.
23729
23730 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23731
23732 * dbusbind.c: Pointer signedness fixes.
23733 (xd_signature, xd_append_arg, xd_initialize):
23734 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23735 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23736 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23737 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23738
23739 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23740 if GCC considers string literals to be constants.
23741 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
23742
23743 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23744
23745 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23746 (print_preprocess, print_object): New macro to fix last change.
23747
23748 * print.c (print_preprocess): Don't forget font objects.
23749
23750 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
23751
23752 * emacs.c (USAGE3): Doc fixes.
23753
23754 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23755
23756 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23757 structure.
23758
23759 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
23760
23761 * lisp.h (VWindow_system, Qfile_name_history):
23762 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23763 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23764 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23765
23766 * w32select.c: Don't #include "keyboard.h".
23767 (run_protected): Add extern declaration for waiting_for_input.
23768
23769 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23770 * w32console.c (detect_input_pending, read_input_pending)
23771 (encode_terminal_code):
23772 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23773 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23774 (w32_system_caret_y, Qfile_name_history):
23775 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23776 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23777 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23778 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23779 * w32proc.c (Qlocal, report_file_error):
23780 * w32term.c (Vwindow_system, updating_frame):
23781 * w32uniscribe.c (initialized, uniscribe_font_driver):
23782 Remove unneeded extern declarations.
23783
23784 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
23785
23786 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
23787
23788 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
23789
23790 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23791 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23792 These macros can no longer be used for assignment.
23793
23794 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23795 Assign struct members directly, instead of using BUF_BEGV etc.
23796 (record_buffer_markers, fetch_buffer_markers): New functions for
23797 recording and fetching special buffer markers.
23798 (set_buffer_internal_1, set_buffer_temp): Use them.
23799
23800 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23801
23802 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23803
23804 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23805 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23806
23807 * xdisp.c (hscroll_window_tree):
23808 (reconsider_clip_changes): Use PT instead of BUF_PT.
23809
23810 2011-03-13 Eli Zaretskii <eliz@gnu.org>
23811
23812 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23813 $(EMACS_ROOT)/lib/intprops.h.
23814
23815 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23816
23817 Fix more problems found by GCC 4.5.2's static checks.
23818
23819 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23820 to unsigned char * to avoid compiler diagnostic.
23821 (xg_free_frame_widgets): Make it clear that a local variable is
23822 needed only if USE_GTK_TOOLTIP.
23823 (gdk_window_get_screen): Make it clear that this macro is needed
23824 only if USE_GTK_TOOLTIP.
23825 (int_gtk_range_get_value): New function, which avoids a diagnostic
23826 from gcc -Wbad-function-cast.
23827 (xg_set_toolkit_scroll_bar_thumb): Use it.
23828 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23829 diagnostic from gcc -Wbad-function-cast.
23830 (get_utf8_string, xg_get_file_with_chooser):
23831 Rename locals to avoid shadowing.
23832 (create_dialog): Move locals to avoid shadowing.
23833
23834 * xgselect.c (xg_select): Remove unused var.
23835
23836 * image.c (four_corners_best): Mark locals as initialized.
23837 (gif_load): Initialize transparent_p to zero (Bug#8238).
23838 Mark another local as initialized.
23839 (my_png_error, my_error_exit): Mark with NO_RETURN.
23840
23841 * image.c (clear_image_cache): Now static.
23842 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
23843 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
23844 (x_edge_detection): Remove unnecessary cast that
23845 gcc -Wbad-function-cast diagnoses.
23846 (gif_load): Fix pointer signedness.
23847 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23848 (jpeg_load, gif_load): Rename locals to avoid shadowing.
23849
23850 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
23851
23852 Improve quality of tests for time stamp overflow.
23853 For example, without this patch (encode-time 0 0 0 1 1
23854 1152921504606846976) returns the obviously-bogus value (-948597
23855 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23856 reports time overflow. See
23857 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
23858 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23859 * editfns.c: Include limits.h and intprops.h.
23860 (TIME_T_MIN, TIME_T_MAX): New macros.
23861 (time_overflow): Move earlier, to before first use.
23862 (hi_time, lo_time): New functions, for an accurate test for
23863 out-of-range times.
23864 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23865 (Fget_internal_run_time): Don't assume time_t fits in int.
23866 (make_time): Use list2 instead of Fcons twice.
23867 (Fdecode_time): More accurate test for out-of-range times.
23868 (check_tm_member): New function.
23869 (Fencode_time): Use it, to test for out-of-range times.
23870 (lisp_time_argument): Don't rely on undefined left-shift and
23871 right-shift behavior when checking for time stamp overflow.
23872
23873 * editfns.c (time_overflow): New function, refactoring common code.
23874 (Fformat_time_string, Fdecode_time, Fencode_time):
23875 (Fcurrent_time_string): Use it.
23876
23877 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23878 * dired.c (make_time): Move to ...
23879 * editfns.c (make_time): ... here.
23880 * systime.h: Note the move.
23881
23882 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23883
23884 * fringe.c (update_window_fringes): Remove unused variables.
23885
23886 * unexmacosx.c (copy_data_segment): Also copy __got section.
23887 (Bug#8223)
23888
23889 2011-03-12 Eli Zaretskii <eliz@gnu.org>
23890
23891 * termcap.c [MSDOS]: Include "msdos.h".
23892 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23893 Constify `char *' arguments and their references according to
23894 prototypes in tparam.h.
23895
23896 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
23897
23898 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23899 Adapt all references accordingly.
23900
23901 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23902
23903 2011-03-11 Tom Tromey <tromey@redhat.com>
23904
23905 * buffer.c (syms_of_buffer): Remove obsolete comment.
23906
23907 2011-03-11 Eli Zaretskii <eliz@gnu.org>
23908
23909 * termhooks.h (encode_terminal_code): Declare prototype.
23910
23911 * msdos.c (encode_terminal_code): Don't declare prototype.
23912
23913 * term.c (encode_terminal_code): Now external again, used by
23914 w32console.c and msdos.c.
23915
23916 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23917 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
23918
23919 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
23920
23921 Fix some minor problems found by GCC 4.5.2's static checks.
23922
23923 * fringe.c (update_window_fringes): Mark locals as initialized
23924 (Bug#8227).
23925 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
23926
23927 * alloc.c (mark_fringe_data): Move decl from here ...
23928 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23929 to check its interface.
23930 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23931
23932 * fontset.c (free_realized_fontset): Now static.
23933 (Fset_fontset_font): Rename local to avoid shadowing.
23934 (fontset_font): Mark local as initialized.
23935 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
23936
23937 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23938
23939 * xselect.c (x_disown_buffer_selections): Remove; not used.
23940 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
23941 (x_own_selection, Fx_disown_selection_internal): Rename locals
23942 to avoid shadowing.
23943 (x_handle_dnd_message): Remove local to avoid shadowing.
23944
23945 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23946 so that the caller can use some name other than gcpro1.
23947 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
23948 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23949 (Fx_backspace_delete_keys_p):
23950 Use them to avoid shadowing, and rename vars to avoid shadowing.
23951 (x_decode_color, x_set_name, x_window): Now static.
23952 (Fx_create_frame): Add braces to silence GCC warning.
23953 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
23954 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23955 Remove unused locals.
23956 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23957 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23958 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23959 macros.
23960
23961 * xterm.h (x_mouse_leave): New decl.
23962
23963 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23964 Remove unused functions.
23965 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23966 (x_calc_absolute_position): Now static.
23967 (XTread_socket): Don't define label "out" unless it's used.
23968 Don't declare local "event" unless it's used.
23969 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23970 unless they are used.
23971 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23972 (x_fatal_error_signal): Remove; not used.
23973 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23974 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23975 (x_error_catcher, x_connection_closed, x_error_handler):
23976 (x_error_quitter, xembed_send_message, x_iconify_frame):
23977 (my_log_handler): Rename locals to avoid shadowing.
23978 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
23979 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
23980
23981 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23982 Rename or move locals to avoid shadowing.
23983 (tty_defined_color, merge_face_heights): Now static.
23984 (free_realized_faces_for_fontset): Remove; not used.
23985 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23986 does not deduce is never used uninitialized.
23987 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23988 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
23989
23990 * terminal.c (store_terminal_param): Now static.
23991
23992 * xmenu.c (menu_highlight_callback): Now static.
23993 (set_frame_menubar): Remove unused local.
23994 (xmenu_show): Rename parameter to avoid shadowing.
23995 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23996 since they might point to immutable storage.
23997 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23998 since it's unused otherwise.
23999
24000 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
24001 Add a FIXME, since the code still doesn't look right. (Bug#8215)
24002 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
24003 avoids a gcc -Wuninitialized diagnostic.
24004 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
24005 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
24006 does not deduce are never used uninitialized.
24007
24008 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
24009
24010 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
24011 * window.c (window_loop, size_window):
24012 (run_window_configuration_change_hook, enlarge_window): Likewise.
24013
24014 * window.c (display_buffer): Now static.
24015 (size_window): Mark variables that gcc -Wuninitialized
24016 does not deduce are never used uninitialized.
24017 * window.h (check_all_windows): New decl, to forestall
24018 gcc -Wmissing-prototypes diagnostic.
24019 * dispextern.h (bidi_dump_cached_states): Likewise.
24020
24021 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
24022 shadowing.
24023 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
24024 Include <limits.h>.
24025 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
24026 and to avoid gcc -Wuninitialized warning.
24027 (load_charset_map): Mark variables that gcc -Wuninitialized
24028 does not deduce are never used uninitialized.
24029 (load_charset): Abort instead of using uninitialized var (Bug#8229).
24030
24031 * coding.c (coding_set_source, coding_set_destination):
24032 Use "else { /* comment */ }" rather than "else /* comment */;"
24033 for clarity, and to avoid gcc -Wempty-body warning.
24034 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
24035 a block, when the outer 'i' will do.
24036 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
24037 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
24038 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
24039 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
24040 (Fdecode_sjis_char, Fdefine_coding_system_internal):
24041 Rename locals to avoid shadowing.
24042 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
24043 * coding.c (emacs_mule_char, encode_invocation_designation):
24044 Now static, since they're not used elsewhere.
24045 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
24046 (decode_coding_object, encode_coding_object, detect_coding_system):
24047 (decode_coding_emacs_mule): Mark variables that gcc
24048 -Wuninitialized does not deduce are never used uninitialized.
24049 (detect_coding_iso_2022): Initialize a local variable that might
24050 be used uninitialized. Leave a FIXME because it's not clear that
24051 this initialization is needed. (Bug#8211)
24052 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
24053 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
24054 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
24055 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
24056 Remove unused macros.
24057
24058 * category.c (hash_get_category_set): Remove unused local var.
24059 (copy_category_table): Now static, since it's not used elsewhere.
24060 * character.c (string_count_byte8): Likewise.
24061
24062 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
24063 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
24064
24065 * chartab.c (copy_sub_char_table): Now static, since it's not used
24066 elsewhere.
24067 (sub_char_table_ref_and_range, char_table_ref_and_range):
24068 Rename locals to avoid shadowing.
24069 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
24070
24071 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
24072 (BIDI_BOB): Remove unused macro.
24073
24074 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
24075 deduce are never used uninitialized.
24076 * term.c (encode_terminal_code): Likewise.
24077
24078 * term.c (encode_terminal_code): Now static. Remove unused local.
24079
24080 * tparam.h: New file.
24081 * term.c, tparam.h: Include it.
24082 * deps.mk (term.o, tparam.o): Depend on tparam.h.
24083 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
24084 Move these decls to tparam.h, and make them agree with what
24085 is actually in tparam.c. The previous trick of using incompatible
24086 decls in different modules does not conform to the C standard.
24087 All callers of tparam changed to use tparam's actual API.
24088 * tparam.c (tparam1, tparam, tgoto):
24089 Use const pointers where appropriate.
24090
24091 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
24092 * cm.h (struct cm): Likewise.
24093 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
24094 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
24095 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
24096 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
24097 (turn_on_face, init_tty): Likewise.
24098 * termchar.h (struct tty_display_info): Likewise.
24099
24100 * term.c (term_mouse_position): Rename local to avoid shadowing.
24101
24102 * alloc.c (mark_ttys): Move decl from here ...
24103 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
24104
24105 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
24106
24107 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
24108
24109 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
24110
24111 * search.c (compile_pattern_1): Remove argument regp, unused since
24112 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
24113 (compile_pattern): Don't pass it.
24114
24115 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
24116
24117 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
24118 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
24119 for ! HAVE_GTK3.
24120 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
24121
24122 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
24123
24124 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
24125 gdk_window_get_screen, gdk_window_get_geometry,
24126 gdk_x11_window_lookup_for_display and GDK_KEY_g.
24127 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
24128 (xg_get_pixbuf_from_pixmap): New function.
24129 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
24130 to Pixmap, take frame as parameter, remove GdkColormap parameter.
24131 Call xg_get_pixbuf_from_pixmap instead of
24132 gdk_pixbuf_get_from_drawable.
24133 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
24134 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
24135 (xg_check_special_colors): Use GtkStyleContext and its functions
24136 for HAVE_GTK3.
24137 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
24138 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
24139 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
24140 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
24141 Call gtk_widget_get_preferred_size.
24142 (xg_frame_resized): gdk_window_get_geometry only takes 5
24143 parameters.
24144 (xg_win_to_widget, xg_event_is_for_menubar):
24145 Call gdk_x11_window_lookup_for_display.
24146 (xg_set_widget_bg): New function.
24147 (delete_cb): New function.
24148 (xg_create_frame_widgets): Connect delete-event to delete_cb.
24149 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
24150 (xg_set_background_color): Call xg_set_widget_bg.
24151 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24152 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24153 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24154 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24155 if ! HAVE_GTK3.
24156 (update_frame_tool_bar): Call gtk_widget_hide.
24157 (xg_initialize): Use GDK_KEY_g.
24158
24159 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24160 if ! HAVE_GTK3
24161 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24162
24163 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24164 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24165 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24166
24167 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
24168
24169 * w32xfns.c (select_palette): Check success of RealizePalette against
24170 GDI_ERROR, not zero.
24171
24172 See ChangeLog.11 for earlier changes.
24173
24174 ;; Local Variables:
24175 ;; coding: utf-8
24176 ;; End:
24177
24178 Copyright (C) 2011-2013 Free Software Foundation, Inc.
24179
24180 This file is part of GNU Emacs.
24181
24182 GNU Emacs is free software: you can redistribute it and/or modify
24183 it under the terms of the GNU General Public License as published by
24184 the Free Software Foundation, either version 3 of the License, or
24185 (at your option) any later version.
24186
24187 GNU Emacs is distributed in the hope that it will be useful,
24188 but WITHOUT ANY WARRANTY; without even the implied warranty of
24189 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24190 GNU General Public License for more details.
24191
24192 You should have received a copy of the GNU General Public License
24193 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.