Define SIZE_MAX for MSVC, part of bug #14409.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
df065a0b
EZ
12013-05-16 Eli Zaretskii <eliz@gnu.org>
2
3 * w32.c: Include epaths.h.
4 (init_environment): Use cmdproxy.exe without leading directories.
5 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
6 case.
7 (gettimeofday): Adjust signature and return value to Posix
8 expectations.
9
10 * unexw32.c (open_output_file): Delete the existing emacs.exe
11 before creating it, to break the hard link to the versioned
12 executable.
13
14 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
15 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
16 (FIRSTFILE_OBJ): New variables.
17 (W32_RES): Rename to EMACSRES. All users changed.
18 (base_obj): Use $(CM_OBJ).
19 (ALLOBJS): Use $(FIRSTFILE_OBJ).
20 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
21 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
22 $(W32_RES_LINK) before $(LIBES).
23 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
24
1aa8d505
SM
252013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
26
6e911150
SM
27 * makefile.w32-in (DOC): Use just "DOC".
28
29 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
30
1aa8d505
SM
31 * process.c: Export default filters and sentinels to Elisp.
32 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
33 New constants.
34 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
35 (Fset_process_sentinel, Fformat_network_address):
36 Default to them instead of nil.
37 (server_accept_connection): Sentinels can't be nil any more.
38 (read_and_dispose_of_process_output): New function, extracted from
39 read_process_output.
40 (read_process_output): Use it; filters can't be nil.
41 (Finternal_default_process_filter): New function, extracted from
42 read_process_output.
43 (exec_sentinel_unwind): Remove function.
44 (exec_sentinel): Don't zilch sentinel while running.
45 (status_notify): Sentinels can't be nil.
46 (Finternal_default_process_sentinel): New function extracted from
47 status_notify.
48 (setup_process_coding_systems): Default filter is not nil any more.
49 (syms_of_process): Export new Elisp functions and initialize
50 new constants.
51 * lisp.h (make_lisp_proc): New function.
52
5ac2eb34
SM
532013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
54
55 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
56
eda9c7d7
EZ
572013-05-14 Eli Zaretskii <eliz@gnu.org>
58
59 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
5ac2eb34
SM
60 unless we know that the window w is a leaf window.
61 Another attempt at solving bug#14062.
eda9c7d7 62
8fdeaad5
JD
632013-05-14 Jan Djärv <jan.h.d@swipnet.se>
64
65 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
66 fdesc (Bug#14375).
67
44aa9ee6
PE
682013-05-12 Paul Eggert <eggert@cs.ucla.edu>
69
70 * image.c (gif_load): Check that subimages fit (Bug#14345).
71
759fd763
SM
722013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
73
74 * lread.c (skip_dyn_eof): New function.
75 (read1): Use it to skip the end of a file in response to #@00.
76
77 * doc.c (get_doc_string): Slightly relax the sanity checking.
78
4465bfb4
JD
792013-05-09 Jan Djärv <jan.h.d@swipnet.se>
80
81 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
82 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
83 (MonitorInfo): New struct.
84 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
85 (Fns_display_monitor_attributes_list): New functions.
86 (display-usable-bounds): Remove.
87 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
88 Qsource.
89
7583e2a0
PE
902013-05-09 Paul Eggert <eggert@cs.ucla.edu>
91
92 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
93 (GTK_CHECK_VERSION): New macro, if not already defined.
94 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
95 replaced by GTK_CHECK_VERSION.
96
ad75d77e
PE
972013-05-08 Paul Eggert <eggert@cs.ucla.edu>
98
99 * xterm.h (GTK_PREREQ): New macro.
100 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
101 to use this macro instead, for consistency and clarity.
102
07525f77
EZ
1032013-05-08 Eli Zaretskii <eliz@gnu.org>
104
105 * xdisp.c (row_for_charpos_p): New function, with code of
106 cursor_row_p, but accepts an additional argument CHARPOS instead
107 of using a hardcoded PT.
108 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
109 (row_containing_pos): Call row_for_charpos_p instead of partially
110 doing the same. Fixes cursor positioning under longlines-mode
111 when longlines-show-effect includes more than one newline, when
112 moving the cursor vertically up.
113
d901fc8d
JB
1142013-05-08 Juanma Barranquero <lekktu@gmail.com>
115
116 * makefile.w32-in (ACL_H): New macro.
117 ($(BLD)/fileio.$(O)): Update dependencies.
118
f269bc61
PE
1192013-05-07 Paul Eggert <eggert@cs.ucla.edu>
120
ffdc270a
PE
121 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
122 * Makefile.in (LIB_ACL): New macro.
123 (LIBACL_LIBS): Remove.
124 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
125 * fileio.c: Include <acl.h>.
126 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
127 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
128 !acl_errno_valid.
129 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
130 it ourselves.
131
f269bc61
PE
132 * unexelf.c: Don't assume ElfW (Half) fits in int.
133 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
134 when dealing with ElfW (Half) values, since they can exceed 2**31
135 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
136 (entry_address): Omit unused NUM arg. All uses changed.
137
a261c53e
JL
1382013-05-07 Juri Linkov <juri@jurta.org>
139
140 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
141 to the string converted from number with `Fnumber_to_string'.
142 (Bug#14254)
143
2b66427d
PE
1442013-05-07 Paul Eggert <eggert@cs.ucla.edu>
145
146 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
147 This fixes a problem introduced by my previous change.
148
15acfe41
GM
1492013-05-07 Glenn Morris <rgm@gnu.org>
150
151 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
152
5ea03bf5
JD
1532013-05-07 Jan Djärv <jan.h.d@swipnet.se>
154
155 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
156
e0c9d565
PE
1572013-05-07 Paul Eggert <eggert@cs.ucla.edu>
158
159 Static checking by GCC 4.8.0.
160 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
161 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
162 (x_get_monitor_attributes_fallback)
163 (x_get_monitor_attributes_xinerama)
164 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
165 Define only if USE_GTK.
166 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
167 (x_get_monitor_attributes_fallback): Omit unused locals.
168 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
169 Use double, not float, to avoid mixed-mode floating point arithmetic.
170
4e3f9230
YM
1712013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
172 Jan Djärv <jan.h.d@swipnet.se>
173
174 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
175 (XINERAMA_CFLAGS): New macros.
176 (ALL_CFLAGS, LIBES): Use them.
177
178 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
179 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
180 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
181 (syms_of_xfns): DEFSYM them.
182 (struct MonitorInfo): New struct.
183 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
184 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
185 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
186 (x_get_monitor_attributes_xinerama): New functions.
187 (Fx_display_monitor_attributes_list): New primitive.
188 (syms_of_xfns): Defsubr it.
189
190 * xterm.h (x_display_info): Add Xatom_net_workarea and
191 Xatom_net_current_desktop.
192
193 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
194 and dpyinfo->Xatom_net_current_desktop.
195
05839b6a
EZ
1962013-05-06 Eli Zaretskii <eliz@gnu.org>
197
198 * xdisp.c (pos_visible_p): Use the special code for finding the
199 beginning of a display property or overlay for any "replacing"
200 display property, not just for display strings. This solves
201 incorrect reporting of position by posn-at-point. (Bug#14241)
202
dc4a2ee0
PE
2032013-05-06 Paul Eggert <eggert@cs.ucla.edu>
204
5ee94506
PE
205 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
206 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
207 Verify that ElfW (Half) fits in int.
208 (fatal): Use same signature as lisp.h.
209 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
210 configure and build with -DUNEXELF_DEBUG without worrying about
211 other modules that use DEBUG.
212 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
213 possibly-wide integers now uses it instead of plain fprintf.
214 (entry_address): New function, which avoids problems with 32-bit
215 overflow on 64-bit hosts.
216 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
217 (round_up): Don't assume the remainder fits in int.
218 (find_section): Use bool for boolean. Simplify debug code.
219 (unexec): Don't assume file sizes fit in int or size_t.
220 Omit unnecessary trailing newline in 'fatal' format.
221 Use strerror rather than outputting decimal error number.
222 Remove unused code when emacs is not defined;
223 this file relies on Emacs now.
224 Don't assume e_phnum and e_shnum are positive.
225
dc4a2ee0
PE
226 * regex.c: Fix problems when DEBUG is defined.
227 (extract_number, extract_number_and_incr): Define regardless of
228 whether DEBUG is defined; that's simpler and makes the code less
229 likely to go stale in the normal case when DEBUG is not defined.
230 Return int rather than taking an int * arg. All callers changed.
231 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
232 Remove, replacing with ...
233 (DEBUG_PRINT): New macro. All callers changed.
234 (DEBUG_COMPILES_ARGUMENTS): New macro.
235 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
236 (print_compiled_pattern, print_double_string) [DEBUG]:
237 Use prototype rather than old-style definition.
238 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
239 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
240 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
241 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
242 Don't assume ptrdiff_t, size_t, and long are the same width as int.
243 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
244 This matters only when DEBUG is defined.
245
14c7ed05
EZ
2462013-05-05 Eli Zaretskii <eliz@gnu.org>
247
248 * xdisp.c (set_iterator_to_next): Set the
249 ignore_overlay_strings_at_pos_p flag only if we are _really_
250 iterating over an overlay string, as indicated by the
251 current.overlay_string_index member. (Bug#14306)
252
e6076b1b
JD
2532013-05-05 Jan Djärv <jan.h.d@swipnet.se>
254
255 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
256 to where it is used, to avoid autorelease issues (Bug#14050).
257
cbee2131
PE
2582013-05-05 Paul Eggert <eggert@cs.ucla.edu>
259
260 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
261 * fileio.c (syms_of_fileio): Implement this.
262 * filelock.c (create_lock_file): If symbolic links don't work, so
263 we use a regular file as a lock file, do not fsync the lock file;
264 it's not needed.
265
30c7e542
SM
2662013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
267
268 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
269 (syms_of_minibuf): Adjust accodingly.
270 * lread.c (Fread):
271 * callint.c (Fcall_interactively): Adjust calls accordingly.
272
5bebd186
EZ
2732013-05-04 Eli Zaretskii <eliz@gnu.org>
274
275 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
30c7e542
SM
276 w->contents is a buffer before computing everything else.
277 Use parentheses to disambiguate last part of the condition.
5bebd186
EZ
278
279 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
280 assertion violations. (Bug#14062)
281
0fb0a4f3
DR
2822013-05-01 David Reitter <david.reitter@gmail.com>
283
284 * nsfns.m (ns_tooltip): Initialize.
285
9e63b4a5
EZ
2862013-04-28 Eli Zaretskii <eliz@gnu.org>
287
288 * coding.c (decode_coding_gap): Don't remove the character before
289 a newline unless it's a CR character. (Bug#14287)
290
ad60824e
DN
2912013-04-28 Dan Nicolaescu <dann@gnu.org>
292
293 * dispextern.h (struct face): Move enum face_underline_type
294 earlier so that bitfields can be in the same word.
295
edbdcec0
JD
2962013-04-28 Jan Djärv <jan.h.d@swipnet.se>
297
298 * nsfns.m (handlePanelKeys): New function.
299 (EmacsOpenPanel:performKeyEquivalent:)
300 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
301 arrows/function/control and copy/paste keys (Bug#14296).
302
0208ede7
JL
3032013-04-27 Juri Linkov <juri@jurta.org>
304
305 * callint.c (Fcall_interactively): Call `Qread_number' for
306 interactive code letter `n' instead of using duplicate code.
307 (Bug#14254)
308
b8dd59f7
PE
3092013-04-27 Paul Eggert <eggert@cs.ucla.edu>
310
311 * systime.h (make_timeval): Declare as 'const'.
312
8bd722db
KH
3132013-04-27 Kenichi Handa <handa@gnu.org>
314
315 * font.c (font_open_entity): Always open a font of manageable
316 size.
317
13d0e56f 3182013-04-26 Paul Eggert <eggert@cs.ucla.edu>
cbee2131 319
f780d632
PE
320 Port better to AIX (Bug#14258).
321 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
322 to pacify AIX xlc.
323
ec509856
KH
3242013-04-24 Kenichi Handa <handa@gnu.org>
325
326 * coding.c (decode_coding_iso_2022): When an invalid escape
327 sequence is encountered, reset the invocation and designation
328 status to the safest one.
329
84fc48e5
PE
3302013-04-22 Paul Eggert <eggert@cs.ucla.edu>
331
332 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
333 Without this fix, "make distclean" leaves stamp-h1 behind.
334
806bda47
EC
3352013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
336
337 * w32fns.c (w32_fullscreen_rect): New function to compute the
338 window rectangle for the given fullscreen mode.
339 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
340 longer tunes the window size. This keeps the window's edges flush
341 with the screen and allows the taskbar to hide itself in fullboth.
342
343 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
344 window decorations and uses the entire screen.
345
346 * w32term.h (w32_fullscreen_rect) Add prototype.
347 (struct w32_output): Replace normal_width, normal_height,
348 normal_top, and normal_left members with a single normal_placement
349 struct.
350 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
351 Remove macros.
352 (FRAME_NORMAL_PLACEMENT): New macro.
353
9cc2810b
JB
3542013-04-16 Juanma Barranquero <lekktu@gmail.com>
355
356 * minibuf.c (Ftest_completion): Silence compiler warning.
357
fd16b54c
EZ
3582013-04-15 Eli Zaretskii <eliz@gnu.org>
359
360 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
5fbcd237 361 bug#14062.
fd16b54c
EZ
362
363 * frame.h (WINDOW_FRAME): Protect macro and its argument with
364 parentheses.
365
366 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
367 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
368 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
369 parentheses where appropriate.
370
9e3379a0
PE
3712013-04-14 Paul Eggert <eggert@cs.ucla.edu>
372
373 * keyboard.c (timer_start_idle): Remove no-longer-used local.
374
ddd6b685
EZ
3752013-04-14 Eli Zaretskii <eliz@gnu.org>
376
377 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
378 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
379 Mention in the doc string that setting these variables takes
380 effect only after a call to set-window-buffer. (Bug#14200)
381
29b79ba1
EZ
3822013-04-13 Eli Zaretskii <eliz@gnu.org>
383
384 * indent.c (Fvertical_motion): Don't consider display strings on
385 overlay strings as display strings on the buffer position we
386 started from. This prevents vertical cursor motion from jumping
387 more than one line when there's an overlay string with a display
388 property at end of line.
389 Reported by Karl Chen <Karl.Chen@quarl.org> in
390 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
391
562c6ee9
SM
3922013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
393
394 * window.c (select_window): `record_buffer' even if window is
395 already selected (bug#14191).
396
fcc1fe85
EZ
3972013-04-11 Eli Zaretskii <eliz@gnu.org>
398
399 * window.c (Fwindow_end): Test more flags, including the buffer's
400 last_overlay_modified flag, to determine whether the window's
401 display is really up-to-date. Prevents the function from
402 returning a stale value. (Bug#14170)
403 (Fwindow_line_height): Fix the test for up-to-date-ness of the
404 current matrix.
405
f009190a
EZ
4062013-04-10 Eli Zaretskii <eliz@gnu.org>
407
408 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
562c6ee9
SM
409 garbaged only if it is not already the top frame on its TTY.
410 This prevents flickering due to constant redrawing of TTY frames when
f009190a
EZ
411 there are GUI frames open in the same session. (Bug#13864)
412
78ce603d
SM
4132013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
414
415 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
416 of marking the idle timers directly.
417
a8036e40
SM
4182013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
419
420 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
421 tables (bug#14054).
422
7ffe7ef6
SM
4232013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
424
425 * window.c (select_window): Don't record_buffer while the invariant is
426 temporarily broken (bug#14161).
427
428 * fns.c (Fdelq): Don't assume !NILP => CONSP.
429
7d9f6883
EZ
4302013-04-07 Eli Zaretskii <eliz@gnu.org>
431
432 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
433
5406cfd9
RF
4342013-04-07 Romain Francoise <romain@orebokech.com>
435
436 Ignore additional platform-specific ACL errors (Bug#13702).
437 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
438 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
439
95c0e83b
JD
4402013-03-31 Jan Djärv <jan.h.d@swipnet.se>
441
442 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
443 f->output_data.ns.
444
876da980
PE
4452013-04-07 Paul Eggert <eggert@cs.ucla.edu>
446
447 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
448 This bug was introduced by my 2013-02-25 change that simplified
449 data_start configuration. Without this change, on GNU/Linux
450 an Emacs configured with --enable-profiling fails immediately
451 due to a profiler signal.
452 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
453 with these flags. On platforms where special flags are needed
454 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
455 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
456 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
457
7452b7bd
DA
4582013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
459
460 Get rid of some platform-specific functions examining window
461 system and its capabilities. This is a partial rework of the
462 2013-04-05 change.
463 * lisp.h (have_menus_p): Remove prototype. This function is
464 replaced with platform-independent window_system_available.
465 (check_window_system): Move to...
466 * frame.h (decode_window_system_frame, window_system_available):
467 ...here, add new prototypes.
468 * frame.c (window_system_available, decode_window_system_frame):
469 New functions.
470 (check_window_system): Platform-independent now.
471 * xterm.h (x_in_use): Remove declaration.
472 (check_x_frame):
473 * w32term.h (check_x_frame):
474 * nsterm.h (check_x_frame): Remove prototypes. This function
475 is replaced with platform-independent decode_window_system_frame.
476 * msdos.c (have_menus_p): Remove.
477 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
478 Remove platform-specific functions. Use check_window_system,
479 decode_window_system_frame and check_ns_display_info where
480 appropriate. Minor style and comment tweaks.
481 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
482 (check_x_frame): Likewise.
483 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
484 Likewise.
485 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
486 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
487 * xmenu.c, xselect.c: All related users changed.
488
251e9147
KH
4892013-04-03 Kenichi Handa <handa@gnu.org>
490
491 The following changes is to optimize the code for reading UTF-8
492 files.
493
562c6ee9 494 * coding.c (check_ascii): Rename from detect_ascii. Return value
251e9147
KH
495 changed. Check EOL format. Do not call adjust_coding_eol_type
496 here.
497 (check_utf_8): New function.
498 (adjust_coding_eol_type): Do nothing if already adjusted.
499 (detect_coding): Compare the return value of check_ascii with
500 coding->src_bytes. Call adjust_coding_eol_type if necessary.
501 (decode_coding_gap): Optimize for valid UTF-8.
502
8bc369d4
KH
5032013-03-21 Kenichi Handa <handa@gnu.org>
504
505 * coding.c (syms_of_coding): Cancel previous change.
506
507 * insdel.c (insert_from_gap): Fix previous change.
508
73931ad1
DA
5092013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
510
511 Consistently use platform-specific function to detect window system.
512 * lisp.h (check_window_system): New prototype. This function is
513 going to replace check_x, check_w32 and check_ns.
514 (have_menus_p): Mention msdos.c in comment.
515 * fontset.c (check_window_system_func): Remove. Adjust all users.
516 * fontset.h (check_window_system_func): Remove prototype.
517 * nsterm.h (check_ns):
518 * xterm.h (check_x):
519 * w32term.h (check_w32): Likewise.
520 * menu.c (Fx_popup_menu): Use check_window_system.
521 * msdos.c (check_window_system): Define for MS-DOS.
522 * nsfns.m (check_window_system): Define for NS. Adjust all users.
523 * w32fns.c (check_window_system): Likewise for MS-Windows.
524 * xfns.c (check_window_system): Likewise for X.
525 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
526 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
527
7216e43b
PE
5282013-04-02 Paul Eggert <eggert@cs.ucla.edu>
529
530 Prefer < to > in range checks such as 0 <= i && i < N.
531 This makes it easier to visualize quantities on a number line.
532 This patch doesn't apply to all such range checks,
533 only to the range checks affected by the 2013-03-24 change.
534 This patch reverts most of the 2013-03-24 change.
535 * alloc.c (xpalloc, Fgarbage_collect):
536 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
537 * character.c (string_escape_byte8):
538 * charset.c (read_hex):
539 * data.c (cons_to_unsigned):
540 * dispnew.c (update_frame_1):
541 * doc.c (Fsubstitute_command_keys):
542 * doprnt.c (doprnt):
543 * editfns.c (hi_time, decode_time_components):
544 * fileio.c (file_offset):
545 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
546 * font.c (font_intern_prop):
547 * frame.c (x_set_alpha):
548 * gtkutil.c (get_utf8_string):
549 * indent.c (check_display_width):
550 * keymap.c (Fkey_description):
551 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
552 * lread.c (read1):
553 * minibuf.c (read_minibuf_noninteractive):
554 * process.c (wait_reading_process_output):
555 * search.c (Freplace_match):
556 * window.c (get_phys_cursor_glyph):
557 * xdisp.c (redisplay_internal):
558 * xsmfns.c (smc_save_yourself_CB):
559 Prefer < to > for range checks.
560 * dispnew.c (sit_for): Don't mishandle NaNs.
561 This fixes a bug introduced in the 2013-03-24 change.
562 * editfns.c (decode_time_components): Don't hoist comparison.
563 This fixes another bug introduced in the 2013-03-24 change.
564
92759988
DA
5652013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
566
567 * frame.h (struct frame): Drop scroll_bottom_vpos
568 member becaue all real users are dead long ago.
569 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
570 * xdisp.c (redisplay_internal): Adjust user.
571
9a1971bb
GM
5722013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
573
f38ab167
JD
574 * nsmenu.m (showAtX:Y:for:): setLevel to
575 NSPopUpMenuWindowLevel (Bug#13998).
576
6d01f1fe
JD
5772013-03-30 Jan Djärv <jan.h.d@swipnet.se>
578
579 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
580 (ns_check_pending_open_menu): Declare.
581
582 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
583 (x_activate_menubar): Update the menu with title that matches
584 ns_get_pending_menu_title, and call
585 ns_check_pending_openmenu (Bug#12698).
586 (menuWillOpen:): New method.
587 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
588
589 * nsterm.m (menu_will_open_state, menu_mouse_point)
590 (menu_pending_title): New varaibles.
591 (ns_get_pending_menu_title, ns_check_menu_open)
592 (ns_check_pending_open_menu): New functions.
593
781f4782
DA
5942013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
595
596 * indent.c (current_column_bol_cache): Remove leftover which is not
597 used in Fmove_to_column any more.
598 (current_column, scan_for_column): Adjust users.
599 * keyboard.c (last_point_position_buffer, last_point_position_window):
600 Remove leftovers which are not used for recording undo any more.
601 (command_loop_1, syms_of_keyboard): Adjust users.
602 * xdisp.c (last_max_ascent): Remove leftover which is not used in
603 redisplay_window any more.
604 (move_it_to): Adjust user.
605
1921c31b
JB
6062013-03-29 Juanma Barranquero <lekktu@gmail.com>
607
608 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
609 Update dependencies.
610
717b8bcd
SM
6112013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
612
613 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
614 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
615 forward references.
616
e74aeda8
DA
6172013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
618
619 * window.h (struct window): Replace hchild, vchild and buffer slots
620 with the only contents slot. This is possible because each valid
621 window may have either the child window (in vertical or horizontal
622 combination) or buffer to display (for the leaf window). Using that,
623 a lof of operations to traverse and/or change window hierarchies may
624 be simplified. New member horizontal is used to distinguish between
625 horizontal and vertical combinations of internal windows.
626 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
627 (WINDOW_VERTICAL_COMBINATION_P): New macros.
628 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
629 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
630 Use contents slot, not buffer, where appropriate.
631 (wset_combination): New function.
632 (wset_buffer): Add eassert.
633 (Fframe_first_window): Simplify the loop reaching first window.
634 (Fwindow_buffer): Use WINDOW_LEAF_P.
635 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
636 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
637 (unshow_buffer): Convert initial debugging check to eassert.
638 (replace_window, recombine_windows, Fdelete_other_windows_internal)
639 (make_parent_window, window_resize_check, window_resize_apply)
640 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
641 (Fset_window_configuration, delete_all_child_windows, save_window_save):
642 Adjust to match struct window changes.
643 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
644 (mark_window_cursors_off, count_windows, get_leaf_windows)
645 (foreach_window_1): Simplify the loop.
646 * alloc.c (mark_object): Do not check for the leaf window because
647 internal windows has no glyph matrices anyway.
648 * dispnew.c (clear_window_matrices, showing_window_margins_p)
649 (allocate_matrices_for_window_redisplay, fake_current_matrices)
650 (allocate_matrices_for_frame_redisplay, free_window_matrices)
651 (build_frame_matrix_from_window_tree, mirror_make_current)
652 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
653 (update_window_tree, set_window_update_flags): Simplify the loop.
654 (sync_window_with_frame_matrix_rows): Enforce live window.
655 Use contents slot, not buffer, where appropriate.
656 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
657 and WINDOW_HORIZONTAL_COMBINATION_P.
658 (make_frame_visible_1): Simplify the loop.
659 Use contents slot, not buffer, where appropriate.
660 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
661 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
662 (expose_window_tree): Likewise.
663 Use contents slot, not buffer, where appropriate.
664 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
665 to avoid deleted windows. Use contents slot instead of buffer.
666 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
667 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
668 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
669 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
670
121ab1cd
EZ
6712013-03-28 Eli Zaretskii <eliz@gnu.org>
672
ef454cf7
EZ
673 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
674 identify the reasons for assertion violations in bug#14062 and
675 similar ones.
21e930f8
EZ
676 (Fx_show_tip): Fix compilation error under
677 "--enable-check-lisp-object-type". (Bug#14073)
ef454cf7 678
121ab1cd
EZ
679 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
680 Reported by <rzl24ozi@gmail.com>.
681
5c89ca24
DA
6822013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
683
684 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
685 start marker...
562c6ee9
SM
686 (unwind_with_echo_area_buffer): ...to restore it here.
687 This is needed to ensure that...
5c89ca24
DA
688 (redisplay_window): ...both window markers are valid here,
689 which is verified by eassert.
690 * editfns.c (save_excursion_save): Do not assume that
691 selected_window always displays the buffer.
c7f53895
DA
692 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
693 Fix comment.
5c89ca24 694
f557c1b1
SM
6952013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
696
697 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
698 the upcase table.
699
40693bba 7002013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
701
702 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
703
c86f791f
EZ
7042013-03-27 Eli Zaretskii <eliz@gnu.org>
705
706 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
707 since MinGW's w32api headers do. This avoids compiler warnings.
708
709 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
710 if already defined.
711
c6e72e17
EZ
7122013-03-26 Eli Zaretskii <eliz@gnu.org>
713
714 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
715
54e95010
JD
7162013-03-26 Jan Djärv <jan.h.d@swipnet.se>
717
718 * gtkutil.c (style_changed_cb): Check if frame is live and an
719 X frame (Bug#14038).
720
b88b62de
EZ
7212013-03-26 Eli Zaretskii <eliz@gnu.org>
722
a18d7de6
EZ
723 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
724 Define only for _WIN32_WINNT less than 0x0500.
da9dcbb8
EZ
725 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
726 MinGW64.
8f5e14c8
EZ
727 Move inclusion of time.h before sys/time.h, so that MinGW64 could
728 see its own definitions of 'struct timeval' and 'struct timezone'.
a18d7de6 729
b88b62de
EZ
730 Fix incompatibilities between MinGW.org and MinGW64 headers.
731 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
732
733 * w32.c (REPARSE_DATA_BUFFER): Guard with
734 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
735
c074e458
JD
7362013-03-25 Jan Djärv <jan.h.d@swipnet.se>
737
738 * xterm.c: Include X11/XKBlib.h
739 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
740
908589fd
AS
7412013-03-24 Andreas Schwab <schwab@linux-m68k.org>
742
743 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
744 written backwards.
745 * blockinput.h (input_blocked_p): Likewise.
746 * bytecode.c (exec_byte_code): Likewise.
747 * callproc.c (call_process_kill, call_process_cleanup)
748 (Fcall_process): Likewise.
749 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
750 (Fccl_execute_on_string): Likewise.
751 * character.c (string_escape_byte8): Likewise.
752 * charset.c (read_hex): Likewise.
753 * cm.c (calccost): Likewise.
754 * data.c (cons_to_unsigned): Likewise.
755 * dired.c (directory_files_internal, file_name_completion):
756 Likewise.
757 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
758 (sit_for): Likewise.
759 * doc.c (Fsubstitute_command_keys): Likewise.
760 * doprnt.c (doprnt): Likewise.
761 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
762 * emacsgtkfixed.c: Likewise.
763 * fileio.c (file_offset, Fwrite_region): Likewise.
764 * floatfns.c (Fexpt, fmod_float): Likewise.
765 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
766 Likewise.
767 * font.c (font_intern_prop): Likewise.
768 * frame.c (x_set_alpha): Likewise.
769 * gtkutil.c (get_utf8_string): Likewise.
770 * indent.c (check_display_width): Likewise.
771 * intervals.c (create_root_interval, rotate_right, rotate_left)
772 (split_interval_right, split_interval_left)
773 (adjust_intervals_for_insertion, delete_node)
774 (interval_deletion_adjustment, adjust_intervals_for_deletion)
775 (merge_interval_right, merge_interval_left, copy_intervals)
776 (set_intervals_multibyte_1): Likewise.
777 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
778 * keymap.c (Fkey_description): Likewise.
779 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
780 * lread.c (openp, read_integer, read1, string_to_number):
781 Likewise.
782 * menu.c (ensure_menu_items): Likewise.
783 * minibuf.c (read_minibuf_noninteractive): Likewise.
784 * print.c (printchar, strout): Likewise.
785 * process.c (create_process, Faccept_process_output)
786 (wait_reading_process_output, read_process_output, send_process)
787 (wait_reading_process_output): Likewise.
788 * profiler.c (make_log, handle_profiler_signal): Likewise.
789 * regex.c (re_exec): Likewise.
790 * regex.h: Likewise.
791 * search.c (looking_at_1, Freplace_match): Likewise.
792 * sysdep.c (get_child_status, procfs_ttyname)
793 (procfs_get_total_memory): Likewise.
794 * systime.h (EMACS_TIME_VALID_P): Likewise.
795 * term.c (dissociate_if_controlling_tty): Likewise.
796 * window.c (get_phys_cursor_glyph): Likewise.
797 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
798 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
799 Likewise.
800 * xfns.c (Fx_window_property): Likewise.
801 * xmenu.c (set_frame_menubar): Likewise.
802 * xselect.c (x_get_window_property, x_handle_dnd_message):
803 Likewise.
804 * xsmfns.c (smc_save_yourself_CB): Likewise.
805 * xterm.c (x_scroll_bar_set_handle): Likewise.
806
2bf7d27a
DA
8072013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
808
809 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
810 to be optional or nil. Adjust comment and convert it to docstring.
811 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
812 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
813
a9ebfa0b
PE
8142013-03-24 Paul Eggert <eggert@cs.ucla.edu>
815
816 Static checking by GCC 4.8-20130319.
817 * image.c (gif_load): Assume pass < 3 to pacify GCC.
818 * process.c (Fset_process_datagram_address)
819 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
820 * xdisp.c (get_char_face_and_encoding):
821 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
822 (get_glyph_face_and_encoding): Prepare face before possibly using it.
823 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
824
4f3576ee
KB
8252013-03-24 Ken Brown <kbrown@cornell.edu>
826
789b5e9a
KB
827 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
828 fix compilation on 64-bit Cygwin, where underscores are not
829 automatically prepended.
830
4f3576ee
KB
831 * w32term.c (w32_initialize): Silence compiler warning.
832
b5b7745f
EZ
8332013-03-23 Eli Zaretskii <eliz@gnu.org>
834
cdc0d0bd
EZ
835 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
836 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
562c6ee9
SM
837 variables, to save and restore frame dimensions.
838 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
839 after returning from a 'fullscreen' configuration.
840 use SendMessage instead of PostMessage to send the SC_RESTORE message,
cdc0d0bd
EZ
841 to avoid races between the main thread and the input thread.
842
843 * w32term.h (struct w32_output): New members normal_width,
844 normal_height, normal_top, normal_left, and prev_fsmode.
845 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
846 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
847 members of a frame.
848
b5b7745f
EZ
849 * w32term.c (w32fullscreen_hook): Record last value of the frame's
850 'fullscreen' parameter. Always record previous width and height
851 of the frame, except when switching out of maximized modes, so
852 that they could be restored correctly, instead of resetting to the
853 default frame dimensions. Send SC_RESTORE command to the frame,
854 unless we are going to send SC_MAXIMIZE, to restore the frame
855 resize hints in the mouse pointer shown by the window manager.
856 (Bug#14032)
857
858 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
859
860 * lisp.h (get_frame_param): Adjust conditions for prototype
861 declaration.
862
a3454eed
KB
8632013-03-22 Ken Brown <kbrown@cornell.edu>
864
865 * unexcw.c: Drop unneeded inclusion of w32common.h.
866 (report_sheap_usage): Declare.
867 (read_exe_header): Add magic numbers for x86_64.
868 (fixup_executable): Fix printf format specifier for unsigned long
869 argument.
870
5a49b79c
DA
8712013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
872
873 * frame.h (struct frame): Put menu_bar_window under #ifdef
874 because this member is not needed when X toolkit is in use.
875 (fset_menu_bar_window):
876 * dispnew.c (clear_current_matrices, clear_desired_matrices)
877 (free_glyphs, update_frame):
878 * xdisp.c (expose_frame): Likewise.
879 (display_menu_bar): Likewise. Remove redundant eassert.
880 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
881 toolkit is in use.
882
d6723bf7
PE
8832013-03-21 Paul Eggert <eggert@cs.ucla.edu>
884
7b1123d8
PE
885 Use functions and constants to manipulate Lisp_Save_Value objects.
886 This replaces code that used macros and strings and token-pasting.
887 The change makes the C source a bit easier to follow,
888 and shrinks the Emacs executable a bit.
889 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
890 (make_save_value): Change 1st arg from string to enum. All callers
891 changed.
892 (INTX): Remove.
893 (mark_object): Use if, not #if, for GC_MARK_STACK.
894 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
895 (XSAVE_OBJECT): Now functions, not macros.
896 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
897 the constant was never used.
898 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
899 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
900 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
901 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
902 New constants.
903 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
904 type3 with a single member save_type. All uses changed.
905 (save_type, set_save_pointer, set_save_integer): New functions.
906 * print.c (PRINTX): Remove.
907
d6723bf7
PE
908 * alloc.c: Remove redundant static declarations.
909
5f24fa51
DA
9102013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
911
912 * window.h (struct window): Convert left_col, top_line, total_lines
913 and total_cols from Lisp_Objects to integers. Adjust comments.
914 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
915 Remove.
916 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
917 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
918 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
919 Adjust users where appropriate.
920
42143acd
DA
9212013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
922
923 * frame.h (struct frame): Drop resx and resy because the same data is
924 available from window system-specific output context. Adjust users.
562c6ee9
SM
925 (default_pixels_per_inch_x, default_pixels_per_inch_y):
926 New functions to provide defaults when no window system available.
42143acd 927 (FRAME_RES_X, FRAME_RES_Y): New macros.
562c6ee9 928 (NUMVAL): Move from xdisp.c.
42143acd
DA
929 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
930 (Ffont_face_attributes, Fopen_font):
931 * image.c (gs_load):
932 * w32font.c (fill_in_logfont):
933 * xdisp.c (calc_pixel_width_or_height):
934 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
935 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
936
c0a17406
KH
9372013-03-20 Kenichi Handa <handa@gnu.org>
938
939 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
940 to 1 (temporary workaround until a bug related to ASCII
941 optimization is fixed).
942
095d384d
DA
9432013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
944
945 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
946 Signal error if window is not internal. Adjust docstring.
947 (delete_all_child_windows): Use combination_limit to save the buffer.
948 (Fset_window_configuration): Adjust accordingly.
cf4bb06d
DA
949 * print.c (syms_of_print): Initialize debugging output not here...
950 (init_print_once): ...but in a new function here.
951 * lisp.h (init_print_once): Add prototype.
952 * emacs.c (main): Add call to init_print_once. Adjust comments.
095d384d 953
748fa866
DA
9542013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
955
956 * window.c (window_resize_check, window_resize_apply)
957 (window_from_coordinates, recombine_windows, set_window_buffer)
958 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
959 (Fsplit_window_internal, Fdelete_window_internal)
960 (freeze_window_starts): Use bool for booleans.
961 * window.h (window_frame_coordinates, resize_frame_windows)
962 (freeze_window_starts, set_window_buffer): Adjust prototypes.
963
81519fd2
SM
9642013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
965
966 * dispnew.c (bitch_at_user): Use `user-error'.
967
6db423a9
KB
9682013-03-17 Ken Brown <kbrown@cornell.edu>
969
970 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
971 as return type of image_background. (Bug#13981)
972 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
973
8f2906f5
JD
9742013-03-16 Jan Djärv <jan.h.d@swipnet.se>
975
960ce480 976 * nsterm.m (updateFrameSize:): Change resize increments if needed.
6615748a 977 (ns_select): Don't return with result uninitialized.
960ce480 978
8f2906f5
JD
979 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
980 and getDirectory.
981
81519fd2
SM
982 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
983 New functions.
8f2906f5
JD
984 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
985 directories. If filename is nil, get directory name (Bug#13932).
986 Use getFilename and getDirectory.
987 (getFilename, getDirectory): New methods for EmacsSavePanel and
988 EmacsOpenPanel.
989 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
990
cded56c1
PE
9912013-03-15 Paul Eggert <eggert@cs.ucla.edu>
992
993 * coding.c (decode_coding_gap): Fix typo caught by static checking.
994
251e9147 9952013-03-15 Kenichi Handa <handa@gnu.org>
8a44e6d1
KH
996
997 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
998 (adjust_after_replace): Make it back to static. Delete the third
999 arg text_at_gap_tail. Cancel the code for handling it.
1000
1001 * coding.h (struct coding_system): New member eol_seen.
1002
1003 * coding.c (detect_ascii): New function.
1004 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1005 when the source bytes are actually scanned. On detecting for
1006 coding_category_utf_8_auto, call detect_ascii instead of scanning
1007 source bytes directly.
1008 (produce_chars): Call insert_from_gap with the new arg 0.
1009 (encode_coding): Likewise.
1010 (decode_coding_gap): Control ASCII optimization by the variable
1011 disable_ascii_optimization instead of #ifndef .. #endif.
1012 Deccode EOL format according to coding->eol_seen.
1013 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1014 variable.
1015
8a44e6d1
KH
1016 * lisp.h (adjust_after_replace): Cancel externing it.
1017 (insert_from_gap): Adjust prototype.
1018
5f795e34
EZ
10192013-03-15 Eli Zaretskii <eliz@gnu.org>
1020
1021 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1022 FULLSCREEN_MAXIMIZED. (Bug#13935)
1023
f258b4be
DA
10242013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1025
1026 * region-cache.c (find_cache_boundary, move_cache_gap)
1027 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1028 Simplify debugging check and convert to eassert. Adjust comment.
1029 (pp_cache): Put under ENABLE_CHECKING.
1030
a5cc4dde
EZ
10312013-03-14 Eli Zaretskii <eliz@gnu.org>
1032
1033 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1034 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1035 and WM_ACTIVATEAPP.
1036 (w32fullscreen_hook): If the frame is visible, reset
1037 f->want_fullscreen flag after changing the frame size. If the
1038 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1039 (Bug#13953)
1040
3fc5e44a
DC
10412013-03-13 Daniel Colascione <dancol@dancol.org>
1042
1043 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1044 too so that these builds can use Cygwin's file conversion
1045 functions. (We've been building and linking cygw32.o all along
1046 and just not using it.)
1047
47d7532e
PE
10482013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1049
1050 File synchronization fixes (Bug#13944).
1051 * Makefile.in (LIB_FDATASYNC): New macro.
1052 (LIBES): Use it.
1053 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1054 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1055 Don't worry about HAVE_FSYNC, since a substitute fsync is
1056 available if the system lacks one.
1057 (Fwrite_regin): Retry fsync if interrupted.
1058
c7ffccaf
EZ
10592013-03-13 Eli Zaretskii <eliz@gnu.org>
1060
4e2df81d 1061 * w32term.c (w32_read_socket): If the Emacs frame is being
c7ffccaf
EZ
1062 activated, call w32fullscreen_hook, to make sure the new frame
1063 dimensions are in effect. (Bug#13937)
1064
8a7debc1
DA
10652013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1066
1067 * xdisp.c (init_iterator): Simplify because both character and byte
1068 positions are either specified or -1. Add eassert. Adjust comment.
ffcd945e
DA
1069 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1070 character and byte positions can be obtained from marker.
8a7debc1 1071
7fd8c501
PE
10722013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1073
d9df6f40
PE
1074 Static checking by Sun C 5.12.
1075 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1076 * bytecode.c (exec_byte_code):
1077 * dispnew.c (init_display):
1078 * eval.c (error):
1079 * fileio.c (Fsubstitute_in_file_name):
1080 * keyboard.c (Fevent_convert_list):
1081 * keymap.c (Fsingle_key_description):
1082 * term.c (maybe_fatal, fatal):
1083 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1084 * xsmfns.c (Fhandle_save_session):
1085 Omit unreachable code.
1086 * keymap.c (map_keymap_char_table_item): Cast void * to
1087 a function pointer type; the C Standard requires this.
1088
7fd8c501
PE
1089 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1090 Include <sys/param.h> unconditionally, as that works elsewhere and
1091 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1092 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1093 and FreeBSD now.
1094
cb0290df
PE
10952013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1096
1097 * insdel.c (adjust_after_replace): Use bool for boolean.
1098
cbae07d5
SM
10992013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1100
1101 * keyboard.c: Move keyboard decoding to read_key_sequence.
1102 (decode_keyboard_code): Remove.
1103 (tty_read_avail_input): Don't try to decode input.
1104 (read_decoded_char): New function.
1105 (read_key_sequence): Use it.
1106
819e2da9
DC
11072013-03-10 Daniel Colascione <dancol@dancol.org>
1108
1109 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1110 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1111 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1112 w32fns.c.
1113
1114 * w32term.c (construct_drag_n_drop): Use the above macros to make
1115 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1116
1117 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1118 properly display non-ASCII frame titles in cygw32 builds.
1119
1120 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1121 call ShellExecute in cygw32 builds.
1122
1123 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1124 common file dialog code.
1125
1126 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1127 can just use du like other systems.
1128
1129 * coding.c (from_unicode_buffer): Declare.
1130 * coding.c (from_unicode_buffer): Implement.
1131
99ec1647
SM
11322013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1133
d2e24f92
SM
1134 * lread.c: Minor cleanup.
1135 (FROM_FILE_P): New macro.
1136 (skip_dyn_bytes, unreadchar, read1): Use it.
1137 (read_list): Consolidate duplicated code.
1138
99ec1647
SM
1139 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1140
138c0ae8
EZ
11412013-03-10 Eli Zaretskii <eliz@gnu.org>
1142
1143 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1144 (redisplay_internal, set_cursor_from_row, try_window)
1145 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1146 (display_line, notice_overwritten_cursor)
99ec1647
SM
1147 (mouse_face_from_buffer_pos, note_mouse_highlight):
1148 Use MATRIX_ROW_DISPLAYS_TEXT_P.
138c0ae8 1149 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
99ec1647
SM
1150 (mouse_face_from_string_pos, fast_find_string_pos):
1151 Use MATRIX_ROW_VPOS.
138c0ae8
EZ
1152
1153 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1154
1155 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1156
1157 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1158 MATRIX_MODE_LINE_ROW.
1159
1160 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1161
c230dd7d
KH
11622013-03-10 handa <handa@gnu.org>
1163
1164 * lisp.h (adjust_after_replace): Extern it.
1165
1166 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1167 case of detection for coding_category_utf_8_auto.
99ec1647
SM
1168 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1169 Skip decoding if all bytes are ASCII.
c230dd7d
KH
1170
1171 * insdel.c (adjust_after_replace): Make it public. New arg
1172 text_at_gap_tail.
1173 (adjust_after_insert): Call adjust_after_replace with the new arg
1174 value 0.
1175
27a98a62
SM
11762013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1177
1178 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1179 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1180 from Elisp via unread-command-events.
1181
1182 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1183 functions to mean "no change".
1184
457882c2
PE
11852013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1186
1187 region-cache.c, scroll.c, search.c: Use bool for booleans.
1188 * lisp.h (compile_pattern):
1189 * scroll.c (do_scrolling, do_direct_scrolling):
1190 * search.c (struct regexp_cache, compile_pattern_1)
1191 (compile_pattern, string_match_1, search_command)
1192 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1193 (search_regs_saved, Fregexp_quote):
1194 Use bool for boolean.
1195 * region-cache.c (region_cache_forward, region_cache_backward):
1196 Fix comments to match code: these functions return int, not boolean.
1197
b5426561
DA
11982013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1199
1200 * search.c (find_newline): Accept start and end byte positions
1201 as arguments and allow -1 if not known.
1202 (find_newline_no_quit): Likewise for start position.
1203 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1204 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1205 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
27a98a62
SM
1206 * editfns.c (Fconstrain_to_field): Break long line.
1207 Adjust call to find_newline.
b5426561
DA
1208 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1209 Use DEC_BOTH to start next search from the previous buffer
1210 position, where appropriate.
1211 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1212 (get_visually_first_element, move_it_vertically_backward): Likewise.
1213 Obtain byte position from the display iterator, where appropriate.
1214
0bce5d9e
PE
12152013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1216
1217 print.c, process.c: Use bool for booleans.
1218 * lisp.h (wait_reading_process_output):
1219 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1220 (strout, debug_output_compilation_hack, float_to_string, print)
1221 (print_object):
1222 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1223 (decode_status, status_message, create_process, create_pty)
1224 (Fmake_network_process, Fnetwork_interface_info)
1225 (wait_reading_process_output, read_process_output)
1226 (write_queue_push, write_queue_pop, process_send_signal)
1227 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1228 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1229 Use bool for booleans.
1230 * process.c (Fnetwork_interface_list): Remove unused local.
1231 (connect_counter): Now EMACS_INT, not int.
1232
36075a19
DA
12332013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1234
1235 * bidi.c (bidi_fetch_char): Swap first and second arguments
1236 to match other functions accepting character and byte positions.
1237 Adjust comment.
1238 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1239 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1240 when you need just to move to the previous buffer position.
1241 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1242
4aae1914
EZ
12432013-03-07 Eli Zaretskii <eliz@gnu.org>
1244
1245 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1246
c54aa166
DA
12472013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1248
1249 Avoid character to byte conversions in motion subroutines.
1250 * indent.h (compute_motion, vmotion): Add byte position argument.
1251 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1252 Add eassert.
1253 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1254 Use list5 for return value.
1255 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1256 Adjust comments, style and calls to compute_motion.
1257 (Fvertical_motion): Adjust call to vmotion.
1258 * window.c (Fdelete_other_windows_internal): Record window start
1259 byte position and adjust call to vmotion.
1260 (window_scroll_line_based): Likewise with call to compute_motion.
1261 Use SET_PT_BOTH.
1262 (Frecenter): Adjust calls to vmotion.
1263
3de717bd
DA
12642013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1265
1266 * lisp.h (list2i, list3i): New functions.
1267 (list4i): Move from window.c and make LISP_INLINE.
1268 * editfns.c (make_lisp_time):
1269 * fns.c (Flocale_info):
1270 * keyboard.c (parse_modifiers):
1271 * xterm.c (x_ewmh_activate_frame): Use list2i.
1272 * instel.c (signal_after_change):
1273 * nsfns.m (Fx_server_version, Fxw_color_values):
1274 * w32fns.c (Fxw_color_values, Fx_server_version):
1275 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1276 * fileio.c (Fvisited_file_modtime):
1277 * nsfns.m (Fns_display_usable_bounds):
1278 * w32.c (ltime): Use list4i.
1279
d26e478e
EZ
12802013-03-06 Eli Zaretskii <eliz@gnu.org>
1281
a611149e
EZ
1282 * search.c (find_newline_no_quit): Rename from find_next_newline.
1283 Add commentary.
1284
1285 * lisp.h (find_newline_no_quit): Rename prototype.
1286
1287 * xdisp.c (back_to_previous_line_start)
1288 (forward_to_next_line_start, get_visually_first_element)
1289 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1290 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1291 * bidi.c (bidi_find_paragraph_start): Callers of
1292 find_newline_no_quit changed.
1293
d26e478e
EZ
1294 * msdos.c: Change encoding to cp850. (Bug#13879)
1295 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1296
1af1a51a
DA
12972013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1298
1299 Coding system support cleanup and minor refactoring.
1300 * coding.h (enum coding_result_code): Remove
1301 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1302 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1303 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1304 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1305 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1306 (decode_coding_region, encode_coding_region, decode_coding_string):
1307 Remove unused compatibility macros.
1308 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1309 (record_conversion_result): Adjust user.
1310 (syms_of_coding): Likewise.
1311 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1312 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1313 (decode_coding_object): Simplify since xrealloc never returns NULL.
1314 Add eassert.
1315
0bafabe7 13162013-03-06 Paul Eggert <eggert@cs.ucla.edu>
725eb027 1317
9b1c3271 1318 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
0845a75c
PE
1319 * sysdep.c (list_system_processes)
1320 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
9b1c3271 1321 Make it a stub in this case; otherwise the build might fail,
0845a75c 1322 and this code hasn't been tested on such hosts anyway.
725eb027 1323 Problem reported by Nelson H. F. Beebe in
9b1c3271
PE
1324 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1325 and analyzed by Jérémie Courrèges-Anglas in
1326 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
725eb027 1327
ffc65bee
DA
13282013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1329
1330 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1331 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1332 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1333 * bidi.c (bidi_find_paragraph_start): Likewise.
1334 * indent.c (vmotion): Likewise.
1335
70743157
PE
13362013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1337
1338 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1339 * filelock.c: Include <c-ctype.h>.
1340 (MAX_LFINFO): New top-level constant.
1341 (lock_info_type): Remove members pid, boot_time. Add members at,
1342 dot, colon. Change user member to be the entire buffer, not a
1343 pointer. This allows us to handle the case where a foreign
1344 pid or boot time exceeds the local range. All uses changed.
1345 (LINKS_MIGHT_NOT_WORK): New constant.
1346 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1347 (defined_WINDOWSNT): Remove.
1348 (MAKE_LOCK_NAME, file_in_lock_file_name):
1349 Always use .#FILE (not .#-FILE) for the file lock,
1350 even if it is a regular file.
1351 (rename_lock_file): New function.
1352 (create_lock_file): Use it.
1353 (create_lock_file, read_lock_data):
1354 Prefer a symbolic link for the lock file, falling back on a
1355 regular file if symlinks don't work. Do not try to create
1356 symlinks on MS-Windows, due to security hassles. Stick with
1357 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1358 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1359 host may be using a Windowsish file system, and cannot use
1360 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1361 doesn't work. Don't fail merely because of a symlink-contents
1362 length limit in the current file system; fall back on regular
1363 files. Increase the symlink contents length limit to 8 KiB, this
1364 should be big enough for any real use and doesn't crunch the
1365 stack.
1366 (create_lock_file, lock_file_1, read_lock_data):
1367 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1368 (lock_file_1): Return error number, not bool. All callers changed.
1369 (ELOOP): New macro, if not already defined.
1370 (read_lock_data): Return size of lock file contents, not Lisp object.
1371 All callers changed. Handle a race condition if some other process
1372 replaces a regular-file lock with a symlink lock or vice versa,
1373 while we're trying to read the lock.
1374 (current_lock_owner): Parse contents more carefully, to help avoid
1375 confusing a regular-file lock with some other application's use
1376 of the file. Check for lock file contents being too long, or
1377 not parsing correctly.
1378 (current_lock_owner, lock_file):
1379 Allow foreign pid and boot times that exceed the local range.
1380 (current_lock_owner, lock_if_free, lock_file):
1381 Simplify allocation of lock file contents.
1382 * w32.c (sys_rename_replace): New function, containing most of
1383 the contents of the old sys_rename.
1384 (sys_rename): Use it.
1385 (fchmod): New dummy function.
1386 * w32.h (sys_rename_replace, fchmod): New decls.
1387
05e193f1
EZ
13882013-03-05 Eli Zaretskii <eliz@gnu.org>
1389
1390 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1391 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1392 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1393 <dmantipov@yandex.ru>.
1394
3bfc46eb
DA
13952013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1396
1397 * composite.c (get_composition_id, fill_gstring_header):
1398 Use make_uninit_vector where appropriate.
1399 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1400 * xselect.c (clean_local_selection_data): Likewise.
1401
84ac6f9d
PE
14022013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1403
1404 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1405 * image.c (imagemagick_load_image): Calculate height and width
1406 after flattening the image, not before.
1407
42926ec8
DA
14082013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1409
1410 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1411 * ftfont.c (ftfont_shape_by_flt): Likewise.
1412 * w32uniscribe.c (uniscribe_shape): Likewise.
1413
b5029e23
PE
14142013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1415
1416 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1417 The old approach, which fell back on DIR/.#FILE.0 through
1418 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1419 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1420 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1421 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1422 because the locking mechanism was never reliable in that case).
1423 This patch fixes this and other bugs discovered by a code
1424 inspection that was prompted by
1425 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1426 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1427 to avoid interoperability problems between the MS-Windows and
1428 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1429 instances of Emacs now ignore each others' locks.
1430 * filelock.c (defined_WINDOWSNT): New constant.
1431 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1432 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1433 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1434 regular files on MS-Windows hosts.
1435 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1436 Use SAFE_ALLOCA to avoid problems with long file names.
1437 (MAX_LFINFO): Now a local constant, not a global macro.
1438 (IS_LOCK_FILE): Remove.
1439 (lock_file_1): Don't inspect errno if symlink call succeeds;
1440 that's not portable.
1441 (lock_file): Document that this function can return if lock
1442 creation fails.
2db41375 1443 (lock_file): Don't access freed storage.
b5029e23 1444
b270d116
AS
14452013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1446
1447 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1448
81c23309
PE
14492013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1450
1451 * textprop.c: Use bool for booleans.
1452 (validate_interval_range, Fadd_text_properties)
1453 (Fremove_text_properties): Prefer bool to int when either works.
1454
18f2ac09
EZ
14552013-03-02 Eli Zaretskii <eliz@gnu.org>
1456
27a98a62
SM
1457 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1458 If the interval tree changes as a side effect of calling
18f2ac09
EZ
1459 modify_region, re-do processing starting from the call to
1460 validate_interval_range. (Bug#13743)
1461
929aeac6 14622013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
1463
1464 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1465 (Bug#13546).
1466
531e70ec
EZ
14672013-02-27 Eli Zaretskii <eliz@gnu.org>
1468
1469 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1470 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1471 access to the lock file until it is written and closed.
1472 (Bug#13807)
1473
6e65b9cc
PE
14742013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1475
1476 * callint.c (Qcall_interactively):
1477 * macros.c (Qexecute_kbd_macro):
1478 Now static.
1479
3b166f09
BG
14802013-02-26 Bastien Guerry <bzg@gnu.org>
1481
1482 * window.c (Frecenter): Tiny docstring enhancement.
1483
ecc0fdd4
PE
14842013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1485
1486 Minor textprop integer cleanup.
1487 * intervals.h, textprop.c (add_text_properties_from_list):
1488 Return void, not int, since nobody uses the return value.
1489 * textprop.c (validate_plist, add_properties, remove_properties)
1490 (Fadd_text_properties):
1491 Don't assume list length fits in int.
1492 (interval_has_all_properties, interval_has_some_properties)
1493 (interval_has_some_properties_list, add_properties, remove_properties)
1494 (Fadd_text_properties, Fremove_text_properties)
1495 (Fremove_list_of_text_properties, text_property_stickiness):
1496 Use bool for booleans.
1497 (Fadd_text_properties, Fremove_text_properties):
1498 (Fremove_list_of_text_properties):
1499 Reindent do-while as per GNU style.
1500
0248b0d7
EZ
15012013-02-25 Eli Zaretskii <eliz@gnu.org>
1502
343a2aef
EZ
1503 Implement CLASH_DETECTION for MS-Windows.
1504
1505 * filelock.c [WINDOWSNT]: Include w32.h.
1506 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1507 function of that name. Up-case the macro arguments.
1508 (IS_LOCK_FILE): New macro.
1509 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1510 (create_lock_file): New function, with body extracted from
1511 lock_file_1.
1512 [WINDOWSNT]: Implement lock files by writing a regular file with
1513 the lock information as its contents.
1514 (read_lock_data): New function, on Posix platforms just calls
1515 emacs_readlinkat.
1516 [WINDOWSNT]: Read the lock info from the file.
1517 (current_lock_owner): Call read_lock_data instead of calling
1518 emacs_readlinkat directly.
1519 (lock_file) [WINDOWSNT]: Run the file name through
1520 dostounix_filename.
1521
1522 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1523 just check if the process by that PID exists.
1524
1525 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1526 also present, as doing so will fail to error out if the file
1527 already exists.
1528
1529 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1530
0248b0d7
EZ
1531 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1532 (Fremove_list_of_text_properties): Skip all of the intervals in
1533 the region between START and END that already have resp. don't
27a98a62
SM
1534 have the requested properties, not just the first one.
1535 Add assertions that the loop afterwards always modifies the
0248b0d7
EZ
1536 properties. (Bug#13743)
1537
b5071fc7
SM
15382013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1539
1540 * callint.c (Fcall_interactively): Use the right lexical environment
1541 for `interactive' specs (bug#13811).
1542 * eval.c (Feval): Accept a lexical environment.
1543
1ddc2bd6
PE
15442013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1545
1546 Simplify data_start configuration (Bug#13783).
1547 This is a followon simplification to the fix for Bug#13650.
1548 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1549 (START_FILES): Remove. All uses removed.
1550 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1551 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1552 (buildobj.h): Use it.
1553 ($(ALLOBJS)): Depend on globals.h.
1554 (temacs$(EXEEXT)): Use $(ALLOBJS).
1555 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1556 * deps.mk (vm-limit.o):
1557 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1558 Do not depend on mem-limits.h.
1559 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1560 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1561 [__GNUC__ && !ORDINARY_LINK]: Remove.
1562 * mem-limits.h, pre-crt0.c: Remove.
1563 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1564 * unexcoff.c (etext): New decl.
1565 (make_hdr): Use DATA_START instead of start_of_data.
1566 * vm-limit.c: Move most of mem-limits.h's contents here.
1567 (data_start): New decl. It's OK if this is approximate,
1568 so simplify-away some unnecessary exactness.
1569 (POINTER): Remove; all uses removed.
1570 (data_space_start): Now char *, to avoid casts.
1571 (exceeds_lisp_ptr): New function, replacing the old
1572 EXCEEDS_LISP_PTR macro. All uses changed.
1573 (check_memory_limits): Simplify and remove casts.
1574 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1575 (memory_warnings): Use data_start instead of start_of_data.
1576
51aa2a8b
AS
15772013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1578
1579 * xdisp.c (set_message): Only check for debug-on-message if STRING
1580 is a string. (Bug#13797)
1581
1938d88c
PE
15822013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1583
1584 Fix regression introduced by July 10 filelock.c patch.
1585 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1586 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1587 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1588 and diagnosed by Andreas Schwab in
1589 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1590
fcee5028
PE
15912013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1592
1593 Assume C89 or better.
1594 * ralloc.c (SIZE, POINTER, NIL):
1595 * vm-limit.c (POINTER):
1596 Remove, replacing all uses with C89 equivalents. These old
1597 symbols were present only for porting to pre-C89 platforms.
1598
d78cf5ed
CB
15992013-02-22 Claudio Bley <claudio.bley@gmail.com>
1600
1601 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1602 This avoids warning messages reported as part of Bug#13546.
1603
6bcd97a4
KB
16042013-02-21 Ken Brown <kbrown@cornell.edu>
1605
1606 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1607
b6c2bfff
SM
16082013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1609
e11dacb5
SM
1610 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1611
b6c2bfff
SM
1612 * keyboard.c (Qcommand_execute): New var.
1613 (command_loop_1, read_char): Use it.
1614 (Fcommand_execute): Remove, replace by an Elisp implementation.
1615 (syms_of_keyboard): Adjust accordingly.
1616
f4ad7ea1 16172013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 1618
d69f1120
DC
1619 * sheap.c (report_sheap_usage): Use message, not message1, so
1620 that we don't try to create a buffer while we're in the middle
1621 of dumping Emacs. Explain why.
b6c2bfff 1622
2a14a4f1 16232013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 1624
2a14a4f1
DA
1625 * search.c (find_newline): Return byte position in bytepos.
1626 Adjust comment.
b6c2bfff
SM
1627 (find_next_newline_no_quit, find_before_next_newline):
1628 Add bytepos argument.
2a14a4f1
DA
1629 * lisp.h (find_newline, find_next_newline_no_quit)
1630 (find_before_next_newline): Adjust prototypes.
1631 * bidi.c (bidi_find_paragraph_start):
1632 * editfns.c (Fconstrain_to_field, Fline_end_position):
1633 * indent.c (compute_motion, vmotion):
1634 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1635 (get_visually_first_element, move_it_vertically_backward):
1636 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1637
872faefb 16382013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
1639
1640 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1641 resources were not orderly released.
1642
fd80c659
EZ
16432013-02-17 Eli Zaretskii <eliz@gnu.org>
1644
1645 * xdisp.c (x_draw_vertical_border): For a window that is neither
1646 the leftmost nor the rightmost, redraw both the left and the right
1647 vertical borders. (Bug#13723)
1648
2f73da9c
SM
16492013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1650
1651 * xml.c (init_libxml2_functions):
1652 * sound.c (sound_warning):
1653 * sheap.c (report_sheap_usage):
1654 * process.c (wait_reading_process_output):
1655 * msdos.c (XMenuActivate):
1656 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1657 * keyboard.c (top_level_1):
1658 * editfns.c (Fmessage, Fmessage_box):
1659 * callint.c (Fcall_interactively):
1660 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1661
fd9547e8
JD
16622013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1663
1664 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
1665 * frame.c (syms_of_frame): ... to here.
1666
f277993b
EZ
16672013-02-16 Eli Zaretskii <eliz@gnu.org>
1668
c7939585
EZ
1669 * w32.c (sys_chown): Remove unused function.
1670
cd91fb4b
EZ
1671 * w32term.c <input_signal_count>: Declare 'volatile'
1672 unconditionally. (Bug#9066)
1673
f277993b
EZ
1674 * w32.c (set_errno): Reset h_errno and don't set it to any other
1675 value. Set errno instead.
1676 (check_errno): Reset h_errno.
1677 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1678 (sys_gethostname, sys_getservbyname, sys_getpeername)
1679 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1680 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1681 h_errno.
1682 (sys_gethostbyname): Set h_errno only errors detected.
1683
e454145b
PE
16842013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1685
1686 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1687
bcf7fe2a
EZ
16882013-02-15 Eli Zaretskii <eliz@gnu.org>
1689
ef9c57e2
EZ
1690 * keyboard.c (read_char): Fix calculation of auto-save time out
1691 when auto-save-timeout is less than 4. (Bug#13720)
1692
ef862e20 1693 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 1694 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 1695
bcf7fe2a
EZ
1696 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1697 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1698 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1699 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1700 make sure errno is set to an appropriate value. (Bug#13546)
1701 (socket_to_fd): Add assertion against indexing fd_info[] with a
1702 value that is out of bounds.
1703 (sys_accept): If fd is negative, do not set up the child_process
1704 structure for reading.
1705
0063fdb1
DA
17062013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1707
1708 * composite.c (fill_gstring_header): Remove useless prototype.
1709 Break long line.
1710 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1711 * print.c (PRINTDECLARE, print_object):
1712 * search.c (compile_pattern, fast_looking_at, search_buffer):
1713 (simple_search, boyer_moore, Freplace_match):
1714 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1715 (get_overlay_arrow_glyph_row, display_mode_element):
1716 (decode_mode_spec_coding, message3):
1717 * xfaces.c (face_at_string_position): Use bool for booleans.
1718 Adjust comments.
1719
648e5523 17202013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 1721
35b3a27e
PE
1722 Fix AIX port (Bug#13650).
1723 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1724 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1725 was #undeffed earlier, so it cannot be used as a macro here.
1726 Use the constant and not the macro.
35b3a27e 1727
648e5523 17282013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 1729
0e4e7b74
EZ
1730 * w32proc.c (new_child): If no vacant slots are found in
1731 child_procs[], make another pass looking for slots whose process
1732 has exited or died. (Bug#13546)
1733
6e432f0c
EZ
1734 * w32.c (sys_pipe): When failing due to file descriptors above
1735 MAXDESC, set errno to EMFILE.
1736 (_sys_read_ahead): Update cp->status when failing to read serial
1737 communications input, so that the status doesn't stay at
1738 STATUS_READ_IN_PROGRESS. (Bug#13546)
1739
51b3a99c
JD
17402013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1741
1742 * gtkutil.c (tb_size_cb): New function.
1743 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1744
e31560a7
SM
17452013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1746
1747 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1748 an event.
1749
fe336261
SM
17502013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1751
1752 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1753
5a655b9f
DA
17542013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1755
1756 * font.c (font_range): Add pos_byte argument. Adjust comment
1757 and break long line.
1758 * font.h (font_range): Adjust prototype.
1759 * composite.c (autocmp_chars): Pass byte position to font_range.
1760 Break long line. Remove useless prototype and format comment.
1761
1a359750
GM
17622013-02-13 Glenn Morris <rgm@gnu.org>
1763
1764 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1765
01fcc3a5 17662013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 1767
f53f992a
PE
1768 Improve AIX port some more (Bug#13650).
1769 With this, it should be as good as it was in 23.3, though it's
1770 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1771 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1772 * unexaix.c (start_of_text): Remove.
1773 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1774 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1775 (orig_load_scnptr, orig_data_scnptr):
1776 Now off_t, not long, since they are file offsets.
1777 (make_hdr): Use _data, not start_of_data ().
1778 This is the key part of the fix.
1779 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1780 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1781
4458c255
PE
1782 * pre-crt0.c (data_start): Initialize to 1.
1783 This ports to compilers that optimize the external declaration
1784 'int x = 0;' as if it were 'int x;' to shrink the executable.
1785
227be86d
PE
1786 Improve AIX port (Bug#13650).
1787 This doesn't fix the bug, but it makes progress: Emacs builds now.
1788 * unexaix.c: Include inttypes.h, stdarg.h.
1789 (report_error, report_error_1): Mark as _Noreturn.
1790 (report_error): Don't report the wrong errno.
1791 (report_error_1): Now varargs. All callers changed.
1792 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1793 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1794 (write_ptr): Use %p to print address rather than %lx and a cast
1795 to unsigned long. Grow buffer a bit, to be safer.
1796
01fcc3a5 17972013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
1798
1799 * bidi.c (bidi_resolve_neutral): After finding the next
1800 non-neutral character, accept NEUTRAL_ON type as well, because
1801 directional control characters, such as LRE and RLE, have their
1802 type converted to that by bidi_resolve_weak. This avoids aborts
1803 when LRE/RLE follows a run of neutrals.
1804 (bidi_move_to_visually_next): Assert that return value of
1805 bidi_peek_at_next_level is non-negative. Negative values will
1806 cause an infloop.
1807
83be8524
PE
18082013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1809
1810 Minor getenv-related fixes.
1811 * callproc.c (Fcall_process_region) [!DOS_NT]:
1812 Avoid unnecessary duplicate call to getenv.
1813 * callproc.c (init_callproc):
1814 * dispnew.c (init_display):
1815 * sysdep.c (sys_subshell):
1816 Omit unnecessary cast of getenv or egetenv.
1817
45b2b768
JB
18182013-02-13 Juanma Barranquero <lekktu@gmail.com>
1819
1820 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1821 Update dependencies.
1822
33b49d71
EZ
18232013-02-12 Eli Zaretskii <eliz@gnu.org>
1824
1825 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1826 marker's position.
1827 (display_line): Set w->region_showing to the value of
1828 it->region_beg_charpos, not to -1. This fixes redisplay
1829 optimization when cursor is moved up after M->. (Bug#13623)
1830 (Bug#13626)
c4131562
EZ
1831 (try_scrolling): Scroll text up more if point is too close to ZV
1832 and inside the scroll margin. This makes sure point is moved
1833 outside the scroll margin in these cases.
33b49d71
EZ
1834
1835 * window.h (struct window): region_showing can no longer be
1836 negative.
1837
b09a4810
PE
18382013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1839
a84b7c53
PE
1840 Tune by using memchr and memrchr.
1841 * doc.c (Fsnarf_documentation):
1842 * fileio.c (Fsubstitute_in_file_name):
1843 * search.c (find_newline, scan_newline):
1844 * xdisp.c (pos_visible_p, display_count_lines):
1845 Use memchr and memrchr rather than scanning byte-by-byte.
1846 * search.c (find_newline): Rename from scan_buffer.
1847 Omit first arg TARGET, as it's always '\n'. All callers changed.
1848
b09a4810
PE
1849 Clean up read_key_sequence a tiny bit more.
1850 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1851 (read_key_sequence): Remove unused locals.
1852
99d0d6dc
SM
18532013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1854
1855 Clean up read_key_sequence a bit; reread active keymaps after first event.
1856 * keyboard.c (read_char, read_char_x_menu_prompt)
1857 (read_char_minibuf_menu_prompt):
1858 Replace nmaps+maps with a single `map' arg.
1859 (follow_key): Operate on a single map.
1860 (active_maps): New function.
1861 (test_undefined): Also return true for nil bindings.
1862 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1863 a single (composed) keymap. Remember `first_event' to choose the right
1864 set of active keymaps. Recompute the set of keymaps after receiving
1865 the first event. Remove GOBBLE_FIRST_EVENT.
1866 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1867 * keyboard.h (read_char): Update declaration.
1868 * lread.c (read_filtered_event): Adjust call to read_char.
1869
f5e1b680
EZ
18702013-02-11 Eli Zaretskii <eliz@gnu.org>
1871
99d0d6dc
SM
1872 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1873 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
1874 in the window. (Bug#13675)
1875
f74de345
DA
18762013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1877
1878 * marker.c (set_marker_internal): If desired position is passed
1879 as a marker, avoid call to buf_charpos_to_bytepos.
1880 * window.c (Fset_window_point): Omit redundant type checking.
1881 (Fset_window_start): Likewise. Format comment.
1882 (window_scroll_pixel_based): Use set_marker_restricted_both
1883 with character and byte positions obtained from an iterator.
1884 (Fset_window_configuration): Use set_marker_restricted_both.
1885 * xdisp.c (message_dolog): Likewise.
1886
a4ba3963
EZ
18872013-02-10 Eli Zaretskii <eliz@gnu.org>
1888
99d0d6dc
SM
1889 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1890 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
1891 too far. This speeds up some redisplay operations. (Bug#13675)
1892
68643cde
DA
18932013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1894
1895 * syntax.c (scan_sexps_forward): Fix byte position calculation
1896 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1897
7ba11bee
PE
18982013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1899
1900 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1901 that was not needed.
1902
eff1c190
PE
19032013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1904
1905 Minor hashing refactoring.
1906 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1907 (sxhash_float): Return EMACS_UINT, for consistency with the other
1908 hash functions.
1909 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1910 non-static inline function and therefore can't use static vars.
1911 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1912 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1913 with the other hash functions.
1914
6b48c831
EZ
19152013-02-09 Eli Zaretskii <eliz@gnu.org>
1916
4dde2087
EZ
1917 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1918 XXXXXX part of the temporary file pattern is not downcased even
1919 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 1920
8549f9e8
EZ
1921 * xdisp.c (decode_mode_spec): Remove handling of %t.
1922
6b48c831
EZ
1923 * msdos.c (careadlinkatcwd): Remove.
1924
75a65c7e
SM
19252013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1926
1927 * lread.c (skip_dyn_bytes): New function (bug#12598).
1928 (read1): Use it. Use getc instead of READCHAR to read bytes.
1929 (load_each_byte): Remove. Update users.
1930
8ca30920
DA
19312013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1932
1933 * search.c (scan_buffer): Calculate end byte position just once.
1934 (scan_newline): Do not recalculate start_byte.
1935 (search_command): Use eassert.
1936 * syntax.c (struct lisp_parse_state): New member location_byte.
1937 (scan_sexps_forward): Record from_byte and avoid redundant
1938 character to byte position calculation ...
1939 (Fparse_partial_sexp): ... here. Break too long line.
1940
25721f5b
DA
19412013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1942
1943 * lisp.h (make_uninit_vector): New function.
1944 * alloc.c (Fvector, Fmake_byte_code):
1945 * ccl.c (Fregister_ccl_program):
1946 * charset.c (Fdefine_charset_internal, define_charset_internal):
1947 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1948 * composite.c (syms_of_composite):
1949 * font.c (Fquery_font, Ffont_info, syms_of_font):
1950 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1951 * ftfont.c (ftfont_shape_by_flt):
1952 * indent.c (recompute_width_table):
1953 * nsselect.m (clean_local_selection_data):
1954 * syntax.c (init_syntax_once):
1955 * w32unsubscribe.c (uniscribe_shape):
1956 * window.c (Fcurrent_window_configuration):
1957 * xfaces.c (Fx_family_fonts):
1958 * xselect.c (selection_data_to_lisp_data): Use it.
1959
9a9d91d9
DA
19602013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1961
1962 * coding.c (Fdefine_coding_system_internal): Use AREF where
1963 argument is known to be a vector.
1964 * fns.c (Flocale_info): Likewise for ASET.
1965 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1966 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1967
6871e574
JD
19682013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1969
1970 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1971 height.
1972
1973 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1974 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1975 updateCollectionBehaviour.
1976
1977 * nsterm.m (NEW_STYLE_FS): Remove.
1978 (ns_last_use_native_fullscreen): New variable.
1979 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1980 (x_set_window_size): Do not take title bar and tool bar into account
1981 if isFullscreen returns YES.
1982 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1983 (check_native_fs): New function.
1984 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1985 (ns_term_init): Remove NEW_STYLE_FS.
1986 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1987 and tool bar if isFullscreen returns NO.
1988 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1989 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1990 with HAVE_NATIVE_FS.
1991 (window:willUseFullScreenPresentationOptions:): New method.
1992 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1993 Hide toolbar if not enabled (Bug#13444).
1994 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1995 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1996 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1997 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1998 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1999 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2000 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2001 (syms_of_nsterm): Add ns-use-native-fullscreen.
2002
3f011c7f
PE
20032013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2004
2005 * fileio.c (Qchoose_write_coding_system): Now static.
2006
86f7c0fe
EZ
20072013-02-04 Eli Zaretskii <eliz@gnu.org>
2008
2009 * xdisp.c (window_buffer_changed): region_showing can be negative,
2010 which still means region is being displayed.
2011 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
2012 whole window when showing region and the mark has changed.
2013 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
2014 (display_line): If it->region_beg_charpos is non-zero, set the
2015 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2016
2017 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2018 not bitfield of 1 bit.
2019
5257b701
DC
20202013-02-03 Daniel Colascione <dancol@dancol.org>
2021
2022 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2023 daemon mode works on cygw32 when Emacs is installed and not just
2024 during development.
2025
8ea41ea9
PE
20262013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2027
2028 Avoid file time stamp bug on MS-Windows (Bug#13149).
2029 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2030 as FAT32 doesn't update time stamps when truncating them.
2031 Also, check that a file time stamp is not a multiple of 100 ns;
2032 this should catch all instances of the problem on MS-Windows,
2033 as its native file system resolution is 100 ns or worse, and
2034 checking for a non-multiple of 100 ns should impose only a small
2035 overhead on systems with ns resolution.
2036
94fbc901 20372013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 2038
e7ac588e
EZ
2039 Avoid encoding file names on MS-Windows when they need to be run
2040 through dostounix_filename.
2041 * w32.c (normalize_filename): Accept an additional argument
2042 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2043 downcase it even if w32-downcase-file-names is non-nil.
2044 (dostounix_filename): Accept an additional argument MULTIBYTE and
2045 pass it to normalize_filename.
2046 (emacs_root_dir): Adjust.
2047
2048 * msdos.h (dostounix_filename): Adjust prototype.
2049
2050 * w32.h (dostounix_filename): Adjust prototype.
2051
2052 * msdos.c (dostounix_filename): Accept an additional argument and
2053 ignore it.
2054 (init_environment): Adjust callers of dostounix_filename.
2055
2056 * fileio.c (Ffile_name_directory, file_name_as_directory)
2057 (directory_file_name, Fexpand_file_name)
2058 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2059 dostounix_filename.
2060 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2061 non-nil.
2062 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2063 variables, as egetenv is case-insensitive for DOS_NT.
2064
2065 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2066 with an encoded file name.
2067
99d0d6dc
SM
2068 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2069 Adjust calls to dostounix_filename.
e7ac588e
EZ
2070
2071 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2072
2073 * unexw32.c (unexec): Adjust call to dostounix_filename.
2074
2075 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2076
2077 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2078 dostounix_filename.
2079
2080 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2081 dostounix_filename.
2082
e7c3fb06
EZ
2083 * callproc.c (Fcall_process): Make sure program name in PATH and
2084 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2085 is passed to exec/spawnve, which fails unless the file-name
2086 encoding is UTF-8.
2087
18a80473
EZ
2088 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2089 even if w32-quote-process-args is nil.
2090
35e85499
PE
20912013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2092
2093 Fix timestamp bug when write-region appends nothing (Bug#13149).
2094 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2095 the file's time stamp doesn't change if Emacs happens to write nothing
2096 to the file, and on a buggy file system this could cause Emacs to
2097 incorrectly infer that the file system doesn't have the bug.
2098 Avoid this problem by inhibiting the inference in this case.
2099
422ff52b
DA
21002013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2101
2102 * window.h (struct window): Convert base_line_number, base_line_pos
2103 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2104 Convert region_showing member from Lisp_Object to bitfield.
2105 Remove sequence_number member. Adjust comments.
2106 * window.c (sequence_number): Remove.
2107 (make_window): Initialize column_number_displayed.
2108 * print.c (print_object): Follow the printed representation of
2109 frames and print window pointer to distinguish between windows.
2110 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2111 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2112 (wset_column_number_displayed, wset_region_showing): Remove.
2113 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2114 (try_scrolling, try_cursor_movement, redisplay_window)
2115 (try_window_reusing_current_matrix, try_window_id, display_line)
2116 (display_mode_lines, decode_mode_spec): Adjust users.
2117 * .gdbinit (pwinx): Do not print sequence_number.
2118
8654f9d7
PE
21192013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2120
2121 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2122 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2123 * dired.c: Include <fcntl.h>.
2124 (open_directory): New function, which uses open and fdopendir
2125 rather than opendir. DOS_NT platforms still use opendir, though.
2126 (directory_files_internal, file_name_completion): Use it.
2127 (file_attributes): New function, with most of the old Ffile_attributes.
2128 (directory_files_internal, Ffile_attributes): Use it.
2129 (file_attributes, file_name_completion_stat): First arg is now fd,
2130 not dir name. All uses changed. Use fstatat rather than lstat +
2131 stat.
2132 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2133 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2134 (emacs_readlinkat): New function, with much of the old
2135 Ffile_symlink_p, but with an fd argument for speed.
2136 It uses readlinkat rather than careadlinkatcwd, so that it
2137 need not assume the working directory.
2138 (Ffile_symlink_p): Use it.
2139 * filelock.c (current_lock_owner): Use emacs_readlinkat
2140 rather than emacs_readlink.
2141 * lisp.h (emacs_readlinkat): New decl.
2142 (READLINK_BUFSIZE, emacs_readlink): Remove.
2143 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2144 (emacs_norealloc_allocator, emacs_readlink): Remove.
2145 This stuff is moved to fileio.c.
2146 * w32.c (fstatat, readlinkat): New functions.
2147 (careadlinkat): Don't check that fd == AT_FDCWD.
2148 (careadlinkatcwd): Remove; no longer needed.
2149
9dbda100
GM
21502013-01-31 Glenn Morris <rgm@gnu.org>
2151
2152 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
2153 (Fwrite_region): Update for new choose_write_coding_system args.
2154 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
2155 (syms_of_fileio): Add choose-write-coding-system.
2156
3f82a88a 21572013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
2158
2159 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2160 (sys_close): Zero out the flags for the file descriptor before
2161 closing it. (Bug#13546)
2162
806fed21 2163 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
2164 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2165 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
2166 DBCS. (Bug#13553)
2167
6ee4509a
EZ
2168 * w32.c (w32_get_long_filename, init_environment, readlink):
2169 Support file names encoded in DBCS codepages.
26854e9c
EZ
2170 (readlink): Use the current file-name-coding-system, not the ANSI
2171 codepage, to decode and handle targets of symlinks.
6ee4509a 2172
cf01a359
EZ
21732013-01-28 Eli Zaretskii <eliz@gnu.org>
2174
2175 * w32.c (opendir): Now accepts a 'const char *'.
2176
6fd326b7
DA
21772013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2178
2179 Remove obsolete redisplay code. See the discussion at
2180 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2181 * dispnew.c (preemption_period, preemption_next_check): Remove.
2182 (Vredisplay_preemption_period): Likewise.
2183 (update_frame, update_single_window, update_window, update_frame_1):
2184 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2185 used, following the 2012-06-22 change.
2186
d8cd7742
EZ
21872013-01-25 Eli Zaretskii <eliz@gnu.org>
2188
2189 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2190
266fee4f
DA
21912013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2192
2193 * font.c (num_fonts): Remove the leftover from old
2194 debugging code. Adjust comment style here and there.
59e624b3
DA
2195 * insdel.c (insert_1): Remove.
2196 * lisp.h (insert_1): Remove prototype.
2197 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 2198
830e46e6 21992013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
2200
2201 * w32.c (max_filename_mbslen): New function.
2202 (normalize_filename, readdir): Use it to detect locales where ANSI
2203 encoding of file names uses a double-byte character set (DBCS).
2204 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
2205 CharNextExA, instead of incrementing a 'char *' pointer.
2206 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 2207
81abbb95
EZ
2208 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2209 request of memory reservation to 1.7GB. (Bug#13065)
2210
830e46e6 22112013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
2212
2213 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2214 at check_extra_latin label. (Bug#13505)
2215
fd3ceb09
DA
22162013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2217
2218 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2219 Avoid redundant calls to strlen.
2220
edfa7fa0
DA
22212013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2222
2223 Drop async_visible and async_iconified fields of struct frame.
2224 This is possible because async input is gone; for details, see
2225 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2226 * frame.h (struct frame): Remove async_visible and async_iconified
2227 members, convert garbaged to unsigned bitfield. Adjust comments.
2228 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2229 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2230 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2231 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2232 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2233 * w32term.c: Ditto.
2234 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2235 properly. Likewise for obscured.
2236 * xterm.c: Ditto.
266fee4f 2237 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
2238 properly.
2239 * nsterm.m: Ditto.
2240 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2241
5ad86e34
DA
22422013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2243
2244 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2245 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2246
b09cca6a
SM
22472013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2248
2249 * xdisp.c (message2, message2_nolog): Remove functions.
2250 (message3, message3_nolog): Extract nbytes and multibyteness directly
2251 from the string. Change all callers.
2252 (message3_nolog): Don't set message_enable_multibyte since set_message
2253 will reset it anyway.
2254 (message1, message1_nolog): Use message3.
2255 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2256 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2257 (set_message): Drop all but the second arg, which has to be a string.
2258 (set_message_1): Simplify now that we know that a1 is NULL and the
2259 second arg is a string.
2260 * frame.h (struct frame): Remove `message_buf' field.
2261 Use glyphs_initialized_p instead.
2262 (FRAME_MESSAGE_BUF): Remove macro.
2263 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2264 * lisp.h (message2, message2_nolog): Remove declarations.
2265 (message3, message3_nolog): Update declarations.
2266 * keyboard.c (read_char_minibuf_menu_text)
2267 (read_char_minibuf_menu_width): Remove vars.
2268 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2269 to correctly handle multibyte strings.
2270 * frame.c (delete_frame): Don't free message_buf any more.
2271 * editfns.c (message_text, message_length): Remove vars.
2272 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2273 * fileio.c (auto_save_error): Use message3 instead of message2.
2274 * dispnew.c (adjust_frame_message_buffer): Remove function.
2275
54ab1c5a
EZ
22762013-01-23 Eli Zaretskii <eliz@gnu.org>
2277
2278 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2279 real estate used for the tool bar and the menu bar.
2280
6c27465b
DA
22812013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2282
2283 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2284 hidden buffer is prepared to modification (Bug#13164).
2285
9d93ce29
DA
22862013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2287
2288 * window.h (struct window): Change window_end_valid member from
2289 Lisp_Object to a bitfield. Adjust comments.
2290 (wset_window_end_valid): Remove.
2291 * window.c (adjust_window_count): Clear window_end_valid.
2292 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2293 (Fwindow_line_height, set_window_buffer, Frecenter)
2294 (Fsplit_window_internal, Fdelete_other_windows_internal)
2295 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2296 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2297 * xdisp.c (check_window_end, reconsider_clip_changes)
2298 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2299 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2300 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2301
1dcb8ea2
DA
23022013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2303
2304 * xdisp.c (mark_window_display_accurate): Simplify the loop
2305 assuming that the only one of vchild, hchild or buffer window
2306 slots is non-nil. Call mark_window_display_accurate_1 for
2307 the leaf windows only.
2308 (mark_window_display_accurate_1): Always assume leaf window.
2309 Adjust comment.
2310
b41b8a7e
PE
23112013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2312
593a5f2e
PE
2313 * emacs.c (Qkill_emacs_hook): Now static.
2314
b41b8a7e
PE
2315 * fileio.c (Finsert_file_contents): Simplify.
2316 Remove unnecessary assignments and tests.
2317
84e5ed96
EZ
23182013-01-21 Eli Zaretskii <eliz@gnu.org>
2319
2320 * w32.c (acl_set_file): Don't test for errors unless
2321 set_file_security returns FALSE. Avoids spurious errors when
2322 saving files.
2323
2ef88fd4
DA
23242013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2325
2326 * fileio.c (Finsert_file_contents): Revert code introduced at
2327 2013-01-18 in favor of the simpler and generally better fix.
2328 Save stack space by removing 'buffer' and reusing 'read_buf'
2329 where appropriate.
2330
d7a0a7c9
PE
23312013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2332
2333 * lisp.h (eabs): Define unconditionally (Bug#13419).
2334 The old "#if !defined (eabs)" was an unnecessary revenant of back
2335 when this macro was called "abs". Document 'eabs' better.
2336
795e7a5b 23372013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
2338
2339 * fns.c (Frandom): Doc fix.
2340
59ac2d13
EZ
23412013-01-19 Eli Zaretskii <eliz@gnu.org>
2342
2343 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2344 segfault when there are lots of overlays.
2345
2346 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
2347 when there are lots of overlays.
2348 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
2349 for the details and a way to reproduce.
2350
b3fbb395
PE
23512013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2352
3a955a1f
PE
2353 * fileio.c: Use O_APPEND to append.
2354 This corresponds better to the natural interpretation of "append",
2355 and avoids the need to open the output file twice, or to invoke
2356 lseek when APPEND is neither nil nor a number.
2357 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2358 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2359 file possibly twice, and lseeking to its end; this avoids the
2360 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2361 at the same time: the combination is never needed and apparently
2362 it doesn't work with DOS_NT.
2363
21cd50b8
PE
2364 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2365 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2366
b3fbb395
PE
2367 Allow floating-point file offsets.
2368 Problem reported by Vitalie Spinu in
2369 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2370 * fileio.c (emacs_lseek): Remove.
2371 (file_offset): New function.
2372 (Finsert_file_contents, Fwrite_region): Use it.
2373
73c14218
CY
23742013-01-19 Chong Yidong <cyd@gnu.org>
2375
2376 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2377 aborting on Fsignal (Bug#13289).
2378
6a9465f3
EZ
23792013-01-19 Eli Zaretskii <eliz@gnu.org>
2380
2381 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2382 set_file_security as failure due to insufficient privileges.
2383 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 2384 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 2385
fa705c99
PE
23862013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2387
9fe43ff6
PE
2388 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2389 The bug was observed on Ubuntu operating inside a virtual machine,
2390 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2391 The workaround introduces a race condition on non-buggy hosts,
2392 but it's an unlikely race and anyway there's a nearly identical
2393 nearby race that can't be fixed.
2394 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2395 New static vars.
2396 (Fwrite_region): Test for file system time stamp bug.
2397 (init_fileio): New function.
2398 * lisp.h (init_fileio): Declare it.
2399 * emacs.c (main): Call it.
2400
fa705c99
PE
2401 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2402 and make it more consistent with other stat-failure diagnostics.
2403
e07469fa
DA
24042013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2405
99d0d6dc
SM
2406 Fix crash when inserting data from non-regular files.
2407 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
2408 for the error description produced by valgrind.
2409 * fileio.c (read_non_regular): Rename to read_contents.
2410 Free Lisp_Save_Value object used to pass parameters.
2411 (read_non_regular_quit): Rename to read_contents_quit.
2412 (Finsert_file_contents): Redesign internal file reading loop to adjust
2413 gap and end positions after each read and so help make_gap to work
2414 properly. Do not signal an I/O error too early and so do not leave
2415 not yet decoded characters in a buffer, which was the reason of
2416 redisplay crash. Use list2 to build return value. Adjust comments.
2417
67722112
PE
24182013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2419
2420 Close a race when statting and reading files (Bug#13149).
2421 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2422 This avoids a race if the file is renamed between stat and open.
2423 This race is not the problem originally noted in Bug#13149;
2424 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2425
468afbac
DA
24262013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2427
2428 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2429 objects, related functions and macros.
2430 (make_save_value): Adjust prototype.
2431 (make_save_pointer): New prototype.
2432 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2433 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2434 * alloc.c (format_save_value): Rename to make_save_value.
2435 (make_save_pointer): New function.
2436 (record_xmalloc): Use make_save_pointer.
2437 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2438 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2439 Change users of make_save_value to make_save_pointer.
2440 Likewise for format_save_value and make_save_value.
2441
0e70695a
DA
24422013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2443
2444 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2445 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2446 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2447 debugging stubs.
2448
963ea40f
PE
24492013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2450
2451 * alloc.c (free_save_value): Now static.
2452
3346c1d0
DA
24532013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2454
2455 * keymap.c (map_keymap_internal): Use format_save_value.
2456 (map_keymap_char_table_item): Adjust accordingly.
2457 * fileio.c (non_regular_fd, non_regular_inserted)
2458 (non_regular_nbytes): Remove.
99d0d6dc
SM
2459 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2460 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
2461 (read_non_regular): Use XSAVE_ macros to extract parameters.
2462 Adjust comment.
2463 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2464 format_save_value.
2465 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2466
2b30549c
DA
24672013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2468
2469 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2470 extraction from any Lisp_Save_Value slot. Add type checking.
2471 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2472 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2473 * xselect.c: All users changed.
2474
1b971ac1
DA
24752013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2476
2477 Some convenient bits to deal with Lisp_Save_Values.
2478 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2479 (allocate_misc): Remove prototype.
2480 (format_save_value): New prototype.
2481 * alloc.c (allocate_misc): Revert back to static.
2482 (format_save_value): New function to build Lisp_Save_Value
2483 object with the specified internal structure.
2484 (make_save_value): Reimplement using format_save_value.
2485 * editfns.c (save_excursion_save): Use format_save_value.
2486 (save_excursion_restore): Use XSAVE_OBJECT.
2487
c50cf2ea
PE
24882013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2489
2490 Avoid needless casts with XSAVE_POINTER.
2491 * alloc.c (mark_object) [GC_MARK_STACK]:
2492 * dired.c (directory_files_internal_unwind):
2493 * fileio.c (do_auto_save_unwind):
2494 * gtkutil.c (pop_down_dialog):
2495 * keymap.c (map_keymap_char_table_item):
2496 * lread.c (load_unwind):
2497 * nsmenu.m (pop_down_menu):
2498 * print.c (print_object) [GC_MARK_STACK]:
2499 * xfns.c (clean_up_file_dialog):
2500 * xmenu.c (cleanup_widget_value_tree):
2501 Omit casts between XSAVE_POINTER and a pointer type.
2502
9d5a1260
DA
25032013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2504
2505 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2506 * eval.c (eval_sub): Protect `form' from being GCed before its
2507 car and cdr becomes protected with the backtrace entry.
2508
73ebd38f
DA
25092013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2510
2511 Make Lisp_Save_Value more versatile storage for up to four objects.
2512 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2513 (struct Lisp_Save_Value): New layout. Adjust comments.
2514 (XSAVE_POINTER): New macro.
2515 (XSAVE_INTEGER): Likewise.
2516 (allocate_misc): Add prototype.
2517 (free_misc): Likewise.
2518 * alloc.c (allocate_misc): Now global.
2519 (free_misc): Likewise. Adjust comment.
2520 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2521 (free_save_value): Likewise.
2522 (mark_object): Likewise.
2523 * editfns.c (save_excursion_save): Pack everything within
2524 Lisp_Save_Value and so avoid xmalloc.
2525 (save_excursion_restore): Adjust to match new layout. Use free_misc
2526 because we do not allocate extra memory any more. Add eassert.
2527 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2528 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2529 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2530 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2531 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2532
b826986f
JD
25332013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2534
2535 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2536 (nsfont_draw): Remove disabling of LCD smoothing.
2537 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 2538 Bug#11484 with LCD smoothing on.
b826986f 2539
c0511b57 25402013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 2541
b6f960a0
PE
2542 Fix SIGDANGER handlers, for AIX (Bug#13408).
2543 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2544 Move handlers here from emacs.c; they were out of place.
2545
616763d5
JD
25462013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2547
2548 * xterm.c (syms_of_xterm): Adjust documentation for
2549 scroll-bar-adjust-thumb-portion.
2550
0b59090b 25512012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
2552
2553 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2554 determine whether scroll bar thumb size should be adjusted or
2555 not. Use variable for MOTIF.
2556
2557 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2558 GTK.
2559
7bc916b4
JD
25602013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2561
eac4d08f
JD
2562 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2563 event is generated.
2564 (doCommandBySelector:): Set processingCompose to NO.
2565
7bc916b4
JD
2566 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2567 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2568 (nsfont_list_family): Add block/unblock_input calls.
2569 (nsfont_open): Move block_input earlier. Add unblock_input before early
2570 return.
2571 (nsfont_draw): Add block/unblock_input calls.
2572
bdc9b756
PE
25732013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2574
2575 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2576 for old_charpos and old_bytepos.
2577
ee56a6dc
PE
25782013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2579
2580 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2581 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2582 Clear tzvalbuf_in_environ if this workaround is in effect.
2583 Problem and fix reported by Kazuhiro Ito.
2584
9fc9a531
AH
25852013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2586
99d0d6dc
SM
2587 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2588 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
2589
2590 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2591 doc string cross-reference(s).
2592
2593 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2594 string cross-reference(s).
2595
6020559a
DA
25962013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2597
2598 Avoid unnecessary byte position calculation for the gap movement.
2599 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2600 anyway, all of them should use move_gap_both instead.
2601 * lisp.h (move_gap): Remove prototype.
2602 * insdel.c (move_gap): Remove.
2603 (move_gap_both): Add eassert.
2604 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2605 * xml.c (parse_region): Likewise.
2606
b8956427
PE
26072013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2608
2609 emacsclient -t should not suspend Emacs server (Bug#13387)
2610 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2611 New functions.
2612 * term.c (init_tty): Use them instead of rolling our own code.
2613 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2614 switches from 'signal' to 'pthread_sigmask', which is safer in
2615 multithreaded applications.
2616 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2617 which has already arranged for that.
2618 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2619 This is the main part of the bug fix.
2620
0b59090b 26212013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
2622
2623 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2624 x_last_font_name (Bug#13403).
2625
58cc0a01
DA
26262013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2627
2628 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2629 the type of per-buffer values where appropriate.
2630 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2631 predicate, which is how it's really used now. Adjust comment.
2632 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2633 * buffer.c (buffer_slot_type_mismatch): Remove.
2634 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2635 predicate. Adjust comment.
2636 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2637 fill-column, left-margin, tab-width, buffer-saved-size,
2638 left-margin-width, right-margin-width, left-fringe-width,
2639 right-fringe-width, scroll-bar-width and buffer-display-count.
2640 Use Qstringp for default-directory, buffer-file-name,
2641 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2642 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2643 line-spacing.
2644 * data.c (store_symval_forwarding): Adjust to call the predicate.
2645
5104861e
JB
26462013-01-09 Juanma Barranquero <lekktu@gmail.com>
2647
2648 * w32.c (get_name_and_id, acl_set_file):
2649 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2650
eefd7278
DA
26512013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2652
2653 * lisp.h (make_gap_1): New prototype.
2654 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2655 gap size values.
2656 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2657 naming convention.
2658 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 2659 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
2660 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2661 (make_gap_1): New function to adjust the gap of any buffer.
2662 * coding.c (coding_alloc_by_making_gap): Use it.
2663 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2664 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2665
073ca75b
JL
26662013-01-08 Juri Linkov <juri@jurta.org>
2667
2668 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2669 of (supports :underline (:style wave)). (Bug#13000)
2670
3bace969
AH
26712013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2672
2673 * undo.c (Fprimitive_undo): Move to simple.el.
2674 (syms_of_undo): Remove declarations for Sprimitive_undo.
2675
63a63bd4
SM
26762013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2677
2678 * keyboard.c (echo_add_key): Rename from echo_add_char.
2679
56ed110a
CY
26802013-01-06 Chong Yidong <cyd@gnu.org>
2681
2682 * keyboard.c (echo_add_char): New function, factored out from
2683 echo_char. Don't add a space if the previous echo string was
2684 empty (Bug#13255).
2685 (echo_char): Use it.
2686 (read_key_sequence): When echoing mock input, ensure that the
2687 trailing dash is properly added.
2688
b630991b
EZ
26892013-01-05 Eli Zaretskii <eliz@gnu.org>
2690
2691 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2692 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
2693 digits for buffer positions, before misalignment starts.
2694 Display "0" for integer "object" field.
b630991b
EZ
2695 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2696 Display the newline glyph more unambiguously.
2697
f032a318
YM
26982013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2699
2700 * nsterm.m (ns_draw_underwave):
2701 * w32term.c (w32_draw_underwave):
2702 * xterm.c (x_draw_underwave): Make underwave look more triangular
2703 and also degrade gracefully for small fonts. (Bug#13000)
2704
4240dd3c
YM
2705 * nsterm.m (ns_draw_text_decoration):
2706 * w32term.c (x_draw_glyph_string):
2707 * xterm.c (x_draw_glyph_string): Don't use previous underline
2708 thickness and position if previous underline type is underwave.
2709
553081a5
SM
27102013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2711
2712 * fileio.c (Ffile_acl): Undocument return format.
2713
9539d465 27142013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
2715
2716 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2717
71376d4b
PE
27182013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2719
2720 Simplify via eabs.
2721 * dired.c (file_name_completion):
2722 * doc.c (get_doc_string):
2723 * floatfns.c (round2):
2724 * font.c (font_score, font_delete_unmatched):
2725 * fringe.c (compute_fringe_widths):
2726 * lread.c (read_list):
2727 * minibuf.c (Ftry_completion):
2728 * term.c (tty_ins_del_lines):
2729 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2730 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2731
a7f11948
EZ
27322012-12-31 Eli Zaretskii <eliz@gnu.org>
2733
2734 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
2735 correctly.
2736 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
2737 for the bug this caused.
2738
84cc1ab6
PE
27392012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2740
2741 * coding.c (Qmac): Now static.
2742
5a1d858b
JD
27432012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2744
2745 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2746 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2747 handlebox_widget. Set toolbar_in_hbox to false/true, set
2748 toolbar_is_packed to true.
2749 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2750 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2751 Show all on TOOLBAR_TOP_WIDGET.
2752 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2753 by TOOLBAR_TOP_WIDGET.
2754 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2755 Check toolbar_is_packed.
8b745d92
JD
2756 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2757 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2758 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2759 false.
2760 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2761 (xg_update_menubar): Update title only if
2762 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2763 (xg_update_submenu): Skip tearoff only if
2764 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2765 (xg_initialize): Initialize xg_detached_menus only if
2766 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
2767
2768 * xterm.h (struct x_output): Surround handlebox_widget with
2769 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2770 toolbar_in_hbox is bool.
2771
d5e5e7b4 27722012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
2773
2774 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2775 (LIBS_GNUSTEP): Define.
2776 (LIBES): Add $(LIBS_GNUSTEP).
2777 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2778
d5e5e7b4 27792012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
2780
2781 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2782 continuation glyph on a TTY with an indication of an empty line.
2783 (Bug#13277)
2784
e7ae8039
EZ
27852012-12-29 Eli Zaretskii <eliz@gnu.org>
2786
ccad023b
EZ
2787 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2788 file's SELinux context or ACLs successfully set, nil otherwise.
2789 (Bug#13298)
8d23a331 2790 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 2791
e7ae8039
EZ
2792 * w32proc.c (reader_thread): Avoid passing NULL handles to
2793 SetEvent and WaitForSingleObject.
2794
7456e13f
PE
27952012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2796
2797 Port EXTERNALLY_VISIBLE to Clang 3.2.
2798 * conf_post.h (__has_attribute): New macro.
2799 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2800
1ab0c851
GM
28012012-12-27 Glenn Morris <rgm@gnu.org>
2802
2803 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2804 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2805
82e2a1f0 28062012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 2807
63a63bd4
SM
2808 * fileio.c (file_name_as_directory, directory_file_name):
2809 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
2810 came from a multibyte or a unibyte Lisp string; all callers
2811 adjusted. Don't assume the input string is always multibyte.
2812 (Bug#13262)
2813 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2814 don't ENCODE_FILE them, and return a unibyte string if the input
2815 was unibyte.
2816 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2817 don't assume the input strings will always be multibyte. If the
2818 input strings are multibyte, decode strings obtained from C
2819 library functions.
2820
8847a0de
DA
28212012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2822
2823 * lisp.h (toplevel): Add two notices to the comment about
2824 defining a new Lisp data type.
6cda572a
DA
2825 * print.c (print_object): If Lisp_Save_Value object's pointer
2826 is the address of a memory area containing Lisp_Objects, try
2827 to print them.
2828 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 2829
4b298d5a
DA
28302012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2831
2832 * keyboard.c (record_asynch_buffer_change): Initialize an event
2833 only if it's really needed.
2834 * frame.h (enum output_method): Remove output_mac member since
2835 it's a leftover from the deleted code.
2836 * frame.c (Fframep): Adjust user here ...
2837 * terminal.c (Fterminal_live_p): ... and here.
2838 * coding.c (Qmac): Now here because it's only used to denote
2839 end-of-line encoding type.
2840 (syms_of_coding): DEFSYM it.
2841 * frame.h (Qmac): Remove duplicated declaration.
2842
12384b01
PE
28432012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2844
2845 * window.c (select_window_1): Now static, since it's used only here.
2846
f1665bdc
EZ
28472012-12-25 Eli Zaretskii <eliz@gnu.org>
2848
2849 * window.c (window_body_cols): Subtract display margins from the
2850 window body width on TTYs as well. See
2851 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2852 for the original report.
2853
9a0d4f34
DA
28542012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2855
2856 * xdisp.c (redisplay_window): Remove inner local variable
2857 because the outer shadowed one has the same meaning.
cd78d9b1
DA
2858 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2859 set but never used.
2860 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2861 (xg_create_tool_bar): Adjust users.
9a0d4f34 2862
f9e7c67e
DA
28632012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2864
2865 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2866 * buffer.c (Fget_buffer_create): Use it to set compact field of
2867 struct buffer_text to avoid accessing an uninitialized value
2868 when compact_buffer is called for the first time.
2869 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
2870 (Fset_buffer_modified_p): Use buffer_window_count to check
2871 whether the buffer is displayed in some window.
2872 * xdisp.c (message_dolog): Likewise.
f9e7c67e 2873
299614f3
EZ
28742012-12-23 Eli Zaretskii <eliz@gnu.org>
2875
40ff07a5
EZ
2876 * w32.c (acl_set_file): If setting the file security descriptor
2877 fails, and the new DACL is identical to the existing one, silently
2878 return success. This fixes problems for users backing up their
2879 own files without having the necessary privileges for setting
2880 security descriptors.
2881
299614f3
EZ
2882 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2883 values.
2884 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2885 after WaitForSingleObject returns normally. This expedites reader
2886 thread shutdown when delete_child triggers it.
2887 (reap_subprocess): More accurate commentary for why we call
2888 delete_child only when cp->fd is negative.
2889
2890 * w32.c (sys_close): Do not call delete_child on a subprocess
2891 whose handle is not yet closed. Instead, set its file descriptor
2892 to a negative value, so that reap_subprocess will call
63a63bd4
SM
2893 delete_child on that subprocess when its SIGCHLD arrives.
2894 This avoids closing handles used for communications between sys_select
299614f3
EZ
2895 and reader_thread, which doesn't give sys_select a chance to
2896 notice that the process exited and invoke the SIGCHLD handler for
2897 it.
2898
cf162aee
JD
28992012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2900
2901 * nsfns.m (Fns_do_applescript): Run event loop until script has
2902 been executed (Bug#12969).
2903 (ns_run_ascript): Chech as_script for nil, set to nil after
2904 executing script.
2905
94900bfe
MR
29062012-12-22 Martin Rudalics <rudalics@gmx.at>
2907
2908 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2909
b2faf49c
EZ
29102012-12-22 Eli Zaretskii <eliz@gnu.org>
2911
2912 * w32term.c (w32fullscreen_hook): New function.
2913 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2914
7efa3fb3
EZ
29152012-12-21 Eli Zaretskii <eliz@gnu.org>
2916
bb085aed
EZ
2917 * fileio.c (Finsert_file_contents): Doc fix.
2918
7efa3fb3
EZ
2919 * w32proc.c (new_child, delete_child, find_child_pid): For a
2920 subprocess, consider its slot being in use as long as its process
2921 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2922 slot when a new process is started immediately after killing
2923 another one, without waiting enough time for the first process to
2924 be reaped and resources allocated for it be orderly freed.
2925 (Bug#13086)
2926 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2927
c1f02afa
CY
29282012-12-21 Chong Yidong <cyd@gnu.org>
2929
2930 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2931
5bec25eb
CY
2932 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2933
a4b0cca1 29342012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
2935
2936 * w32.c (get_name_and_id): Always pass NULL as the first argument
2937 of lookup_account_sid. Avoids crashes with UNC file names that
2938 refer to DFS domains, not to specific machine names. (Bug#12621)
2939 Remove now unused argument FNAME; all callers changed.
2940 (get_file_owner_and_group): Remove now unused argument FNAME; all
2941 callers changed.
2942
34b4b7eb
CY
29432012-12-21 Chong Yidong <cyd@gnu.org>
2944
2945 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2946 error for invalid chars, don't check for a nil return value.
2947
13002885
DA
29482012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2949
2950 Avoid calls to CHAR_TO_BYTE if byte position is known.
2951 * editfns.c (make_buffer_string_both): Use move_gap_both.
2952 (Fbuffer_string): Use make_buffer_string_both.
2953 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2954 Adjust comment.
2955 (buf_bytepos_to_charpos): Likewise.
2956 (charpos_to_bytepos): Remove.
2957 * fileio.c (Finsert_file_contents): Use move_gap_both.
2958 * search.c (Freplace_match): Likewise.
9a0d4f34 2959 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
2960 names for byte positions.
2961 * lisp.h (charpos_to_bytepos): Remove prototype.
2962 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2963 * insdel.c (move_gap): Likewise.
2964
99e9311c
PE
29652012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2966
2967 * xdisp.c (redisplay_internal): Remove now-unused local.
2968
e02230bf
SM
29692012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2970
2971 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2972 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 2973 proper value of frame-local variables (bug#13225).
e02230bf 2974
1687fb14
DA
29752012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2976
2977 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2978 Rename 4th argument since it may be buffer or string. Adjust comment.
2979 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2980
a2f07cd2
DA
29812012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2982
2983 * coding.c (Fdetect_coding_region): Do not check start and end with
2984 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2985 (code_convert_region): Likewise.
2986
474d441e
EZ
29872012-12-18 Eli Zaretskii <eliz@gnu.org>
2988
2989 * w32.c (acl_get_file, acl_set_file): Run the file name through
2990 map_w32_filename, and resolve any symlinks in the file name, like
2991 Posix platforms do.
2992 (acl_set_file): Call revert_to_self, if any privileges were
2993 enabled.
2994
8725c076
JB
29952012-12-17 Juanma Barranquero <lekktu@gmail.com>
2996
2997 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2998 ($(BLD)/w32.$(O)): Update dependencies.
2999
1e101a4b
SM
30002012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3001
3002 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3003 propagate redisplay's scrolling (if any) to the right window.
3004 (redisplay_internal): Use ensure_selected_frame.
3005 (display_mode_lines): Complete last fix.
3006 * window.c (select_window_1): New func, extracted from select_window.
3007 (select_window): Use it.
3008 * window.h (select_window_1): Declare.
3009
66447e07
EZ
30102012-12-17 Eli Zaretskii <eliz@gnu.org>
3011
3012 Emulate Posix ACL APIs on MS-Windows.
3013 * w32.c: Include sddl.h and sys/acl.h.
3014 (SDDL_REVISION_1): Define if not already defined.
3015 (g_b_init_get_security_descriptor_dacl)
3016 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3017 (g_b_init_is_valid_security_descriptor)
3018 (g_b_init_set_file_security): New static flags.
3019 (globals_of_w32): Initialize them to zero.
3020 (SetFileSecurity_Name): New string constant.
3021 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3022 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3023 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3024 (IsValidSecurityDescriptor_Proc): New typedefs.
3025 (get_file_security, get_security_descriptor_owner)
3026 (get_security_descriptor_group): Set errno to ENOTSUP.
3027 (set_file_security, get_security_descriptor_dacl)
3028 (is_valid_security_descriptor, convert_sd_to_sddl)
3029 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3030 (acl_free, acl_get_file, acl_set_file): New functions.
3031
3032 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3033
207a7ef0
PE
30342012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3035
3036 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3037 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3038 for some of that bug's symptoms can now cause Emacs to abort.
3039 Remove the workaround.
3040 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3041 The bug that caused SIGCHLD to get lost has been fixed, and the
3042 workaround for it can now cause Emacs to abort.
3043
17fdfc15
PE
30442012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3045
3046 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3047 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3048 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3049
7c3d167f
RF
30502012-12-16 Romain Francoise <romain@orebokech.com>
3051
3052 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3053 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 3054 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
3055 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3056
3057 * Makefile.in (LIBACL_LIBS): New macro.
3058 (LIBES): Use it.
3059
7d80ea23
PE
30602012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3061
3062 * fileio.c (internal_delete_file): Use bool for boolean.
3063
b0728617
EZ
30642012-12-15 Eli Zaretskii <eliz@gnu.org>
3065
3066 Fix bug #13079 on MS-Windows with temp files not being deleted.
3067 * w32.h (_child_process): New members input_file and
3068 pending_deletion.
3069 (register_child): First argument is now pid_t.
3070 (record_infile, record_pending_deletion): New prototypes.
3071
3072 * w32proc.c (new_child): Initialize input_file and
3073 pending_deletion members of the child.
3074 (delete_child): Delete the child's temporary input file, if any,
3075 that is pending deletion.
3076 (register_child): First argument is now pid_t.
3077 (record_infile, record_pending_deletion): New functions.
3078 (reap_subprocess): Fix a typo in DebPrint string.
3079 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3080
3081 * fileio.c (internal_delete_file): Return an int again: non-zero
3082 if delete-file succeeds, zero otherwise.
3083
3084 * lisp.h (internal_delete_file): Adjust prototype.
3085
3086 * callproc.c (Fcall_process): Don't overwrite infile with result
3087 of DECODE_FILE.
3088 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3089 asynchronous subprocess, record the name of the input file name,
3090 if any.
3091 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3092 delete the file, record it as pending deletion when the subprocess
3093 exits.
3094
7e90af26
EZ
30952012-12-14 Eli Zaretskii <eliz@gnu.org>
3096
3097 * editfns.c [HAVE_PWD_H]: Include grp.h.
3098
3099 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3100
97976f9f
PE
31012012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3102
3103 Fix permissions bugs with setgid directories etc. (Bug#13125)
3104 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3105 to mark it as a placeholder. The old value was often wrong.
3106 The only user of this attribute has been changed to use
3107 file-ownership-preserved-p instead, with its new group arg.
3108 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3109
26ec1f49
SM
31102012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3111
ad966fe7
SM
3112 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3113 Keep selected_window and selected_frame in sync.
26ec1f49 3114
5c207910
EZ
31152012-12-14 Eli Zaretskii <eliz@gnu.org>
3116
3117 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3118 try to get accurate owner and group information from NT file
3119 security APIs. This is to make most callers of 'stat' and
3120 'lstat', which don't need that information, much faster.
3121
26ec1f49
SM
3122 * dired.c (Ffile_attributes) [WINDOWSNT]:
3123 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
3124 owner and group information from 'lstat'.
3125
893f52d8
PE
31262012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3127
4c95c9a5
PE
3128 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3129 as that confuses set-auto-coding, so insist on the head-read
3130 returning the full 1024 bytes. Let lseek compute the tail offset;
3131 less work for us. Do not ignore I/O errors when reading the tail.
3132
893f52d8
PE
3133 * xdisp.c: Minor style fixes.
3134 (init_iterator): Hoist assignment out of if-expression.
3135 (markpos_of_region): Callers now test for sign, not for -1.
3136
40d1e434
DA
31372012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3138
3139 Minor redisplay optimization when the region length is zero.
3140 * xdisp.c (markpos_of_region): New function.
3141 (init_iterator): Do not highlight the region of zero length.
3142 (redisplay_window): Check whether the region is of non-zero length.
3143 (try_cursor_movement): Allow if the region length is zero.
3144 (try_window_reusing_current_matrix, try_window_id): Likewise.
3145
727f9739 31462012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
3147
3148 * search.c (search_buffer): Check the inverse translations of each
3149 character in pattern when the buffer being searched is unibyte.
3150 (Bug#13084)
3151
727f9739 31522012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
3153
3154 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3155 files, fixing a regression from 24.2.
645c6a30 3156 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 3157
d20704ef
PE
31582012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3159
3160 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3161 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3162 Remove unnecessary S_ISLNK test, as (contra the comments) this
3163 function can't copy symlinks. Improve quality of error message
3164 when attempting to copy files that are neither regular files nor
3165 directories.
3166
2dd61a9b
DA
31672012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3168
3169 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3170 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3171 * window.c (Frecenter):
3172 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3173 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3174
cc98b684
DC
31752012-12-12 Daniel Colascione <dancol@dancol.org>
3176
1e101a4b 3177 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
3178 the dumped Emacs is not a sparse file, greatly improving Cygwin
3179 "make bootstrap" performance.
3180
38e791fd
MA
31812012-12-11 Michael Albinus <michael.albinus@gmx.de>
3182
3183 * inotify.c (inotify_callback): Generate an Emacs event for every
3184 incoming inotify event.
3185
f9d1448f
EZ
31862012-12-11 Eli Zaretskii <eliz@gnu.org>
3187
3188 * xdisp.c (handle_face_prop): Fix logic of computing
3189 it->start_of_box_run_p.
3190 (append_space_for_newline): If the glyph row is R2L, reset the
3191 iterator's end_of_box_run_p flag before prepending the space glyph.
3192 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3193 iterator's start_of_box_run_p flag before prepending the stretch.
3194 (append_glyph, produce_image_glyph, append_composite_glyph)
3195 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3196 left_box_line_p and right_box_line_p flags of the glyph for R2L
3197 glyph rows. (Bug#13011)
3198
c6afe371
DA
31992012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3200
3201 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3202 if changed buffer is not shown in a window.
3203 * insdel.c (prepare_to_modify_buffer): Likewise.
3204 * window.c (replace_buffer_in_windows_safely): Do nothing
3205 if buffer is not shown in a window.
3206 (Fforce_window_update): Likewise if string or buffer argument
3207 is passed.
3208
1b47babd
EZ
32092012-12-11 Eli Zaretskii <eliz@gnu.org>
3210
3211 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3212 encoded_file_name, which is what it is.
3213
4c1acb95
DA
32142012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3215
3216 Consistently use marker_position and marker_byte_position.
3217 * fringe.c (Ffringe_bitmaps_at_pos):
3218 * indent.c (Fvertical_motion):
3219 * insdel.c (prepare_to_modify_buffer):
3220 * keyboard.c (make_lispy_position):
3221 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3222 (window_scroll_pixel_based, displayed_window_lines)
3223 (Fset_window_configuration):
3224 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3225 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3226 Replace direct access to marker fields with calls
3227 to marker_position and/or marker_byte_position.
3228
0eeb69fe
JB
32292012-12-11 Juanma Barranquero <lekktu@gmail.com>
3230
3231 * makefile.w32-in (SIG2STR_H): New macro.
3232 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3233 ($(BLD)/w32notify.$(O)): Update dependencies.
3234
1cf1bbd5
DC
32352012-12-10 Daniel Colascione <dancol@dancol.org>
3236
8db4b52f
DC
3237 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3238 Windows file notification functionality unless WINDOWSNT.
3239
1cf1bbd5
DC
3240 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3241 declarations.
3242
3243 * w32fns.c (cache_system_info): Initialize the global hinst
3244 variable here so various initialization calls DTRT.
3245
1e101a4b 3246 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
3247 (hinst): Remove unneeded extern declaration.
3248 (_start): Remove initialization of above variables; remove
3249 initialization of hinst, as cache_system_info now does that.
3250
3251 * emacs.c (main): Call cache_system_info early in startup; we
3252 previously weren't calling it in Cygwin builds.
3253
26ec1f49
SM
3254 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3255 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
3256 and link it to Emacs.
3257
98a07056
DA
32582012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3259
3260 Per-buffer window counters.
3261 * buffer.h (struct buffer): New member window_count.
3262 (buffer_window_count): New function.
3263 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3264 Initialize window_count.
3265 (Fkill_buffer): Verify window_count for the buffer being killed.
3266 (modify_overlay): Do not force redisplay if buffer is not shown
3267 in any window.
3268 (init_buffer_once): Initialize window_count for buffer_defaults
3269 and buffer_local_symbols.
3270 * window.h (buffer_shared): Remove declaration.
3271 (wset_buffer): Convert from inline ...
3272 * window.c (wset_buffer): ... to an ordinary function.
3273 (adjust_window_count): New function.
3274 (make_parent_window): Use it.
3275 * xdisp.c (buffer_shared): Remove.
3276 (redisplay_internal, redisplay_window): Adjust users.
3277 (buffer_shared_and_changed): Use per-buffer window counter.
3278
2b8c9064
EZ
32792012-12-10 Eli Zaretskii <eliz@gnu.org>
3280
3281 Support for filesystem notifications on MS-Windows.
3282 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3283 and this is a TTY frame, signal the caller that keyboard input is
3284 available.
3285
3286 * w32xfns.c (drain_message_queue): Now returns an int: an
3287 indication whether any WM_EMACS_FILENOTIFY messages were found in
3288 the queue.
3289
3290 * w32inevt.c (handle_file_notifications): New function.
3291 (w32_console_read_socket): Call it to process file notifications.
3292
3293 * w32console.c (initialize_w32_display): Record the main thread ID
3294 in dwMainThreadId.
3295
3296 * deps.mk (inotify.o): New dependency list.
3297
3298 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3299
3300 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3301 (WM_EMACS_END): Bump value by 1.
3302 (notification_buffer_in_use, file_notifications)
3303 (notifications_size, notifications_desc): Declare.
3304 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3305 Add prototypes.
3306
3307 * w32term.c (lispy_file_action, queue_notifications): New functions.
3308 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3309 <Qrenamed_to>: New symbols.
3310 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3311
3312 * w32notify.c: New file, implements file event notifications for
3313 MS-Windows.
3314
3315 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3316 by posting it to the w32_read_socket queue.
3317
1e101a4b 3318 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
3319
3320 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3321 (GLOBAL_SOURCES): Add w32notify.c
3322 ($(BLD)/w32notify.$(O)): New set of dependencies.
3323
3324 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3325
1e101a4b
SM
3326 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3327 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
3328 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3329 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3330 w32notify-handle-event by default.
3331
3332 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3333 syms_of_w32notify.
3334
81606b10
RS
33352012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3336
2b8c9064 3337 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 3338 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
3339
3340 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3341
3342 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3343 (syms_of_keyboard): DEFSYM it.
3344 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3345 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3346 Qfile_inotify events.
3347 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3348 special-event-map to inotify-handle-event.
3349
3350 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3351
3352 * Makefile.in (base_obj): Add inotify.o.
3353
3354 * inotify.c: New file.
3355
265c2fbf 33562012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
3357
3358 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3359
265c2fbf 33602012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
3361
3362 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3363 DWORD_PTR, for compatibility with 64-bit builds.
3364
a06ae17d 3365 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
3366 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3367 (system_process_attributes): Use SIZE_T rather than DWORD, for
3368 compatibility with 64-bit builds.
3369
265c2fbf 33702012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
3371
3372 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3373
265c2fbf 33742012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
3375
3376 * indent.c (Fvertical_motion): If a display string will be
3377 displayed on the left or the right margin, don't consider it as a
3378 factor in cursor positioning. (Bug#13108)
3379
265c2fbf 33802012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
3381
3382 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3383
5f460827
PE
33842012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3385
3386 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3387 for string length.
3388
a16e75cd
EZ
33892012-12-08 Eli Zaretskii <eliz@gnu.org>
3390
3391 * w32.c (unsetenv): Return 0 if the input string is too long.
3392
5745a7df
PE
33932012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3394
3395 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3396 * alloc.c (xputenv): New function.
3397 * dbusbind.c (Fdbus_init_bus):
3398 * emacs.c (main):
3399 * xterm.c (x_term_init):
3400 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3401 * editfns.c (initial_tz): Move static var decl up.
3402 (tzvalbuf_in_environ): New static var.
3403 (init_editfns): Initialize these two static vars.
3404 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3405 Save old TZ value on stack, if it's small.
3406 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3407 instead, use xputenv+unsetenv to set and restore TZ.
3408 (environbuf): Remove static var. All uses removed.
3409 (Fset_time_zone_rule): Do not save TZ and environ;
3410 no longer needed here.
3411 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3412 Move to inside set_time_zone_rule; they don't need file scope any more.
3413 (set_time_zone_rule): Maintain the TZ=value string separately.
3414 (syms_of_editfns): Don't initialize initial_tz;
3415 init_editfns now does it.
3416 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3417 * lisp.h (xputenv): New decl.
3418
c56efa40
FP
34192012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3420
3421 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3422
75ceee05
EZ
34232012-12-08 Eli Zaretskii <eliz@gnu.org>
3424
3425 * w32.c (unsetenv, sys_putenv): New functions.
3426
1b6dbfeb
CY
34272012-12-08 Chong Yidong <cyd@gnu.org>
3428
3429 * editfns.c (Finsert_char): Make the error message more
3430 informative (Bug#12992).
3431
d983a10b
PE
34322012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3433
7be78020
PE
3434 Simplify get_lim_data.
3435 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3436 Remove USG and vlimit methods; no longer used these days.
3437 Add #error catchall just in case.
3438
d983a10b
PE
3439 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3440 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3441 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3442 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3443 (deleted_pid_list, Fdelete_process, create_process)
3444 (record_child_status_change, handle_child_signal, deliver_child_signal)
3445 (init_process_emacs, syms_of_process):
3446 Assume SIGCHLD is defined.
3447 (parse_signal): Remove. All uses removed.
3448 (abbr_to_signal): New static function.
3449 (Fsignal_process): Use it to convert signal names to ints.
3450 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3451 kill (getpgrp (), ...).
3452 (emacs_sigaction_init): Assume SIGCHLD is defined.
3453 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3454 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3455 * syssignal.h (EMACS_KILLPG): Remove.
3456 All uses replaced by 'kill' with a negative pid.
3457 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3458 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3459
9cdde1e2
PE
34602012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3461
3462 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3463 This will cause a production Emacs to dump core instead of
3464 infinite-looping.
3465
822995f8
DA
34662012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3467
3468 * frame.c (make_frame): Do not set window's buffer to t.
3469 * window.c (Fsplit_window_internal): Likewise. Previously it was
3470 used to indicate that the window is being set up. Now we use
3471 set_window_buffer for all new windows, so the condition in ...
3472 (Fset_window_buffer): ... is always true and can be removed.
3473
ed08365b
DA
34742012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3475
3476 Convenient macro to check whether the buffer is hidden.
3477 * buffer.h (BUFFER_HIDDEN_P): New macro.
3478 * frame.c (make_frame): Use it. Adjust comment.
3479 * buffer.c (candidate_buffer): New function.
3480 (Fother_buffer, other_buffer_safely): Use it.
3481
e86f5134
EZ
34822012-12-06 Eli Zaretskii <eliz@gnu.org>
3483
3484 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3485 if the child process is still running. Instead, exit the wait
3486 loop and return zero. (Bug#13086)
3487
1700db3c
DA
34882012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3489
3490 * frame.h (x_char_width, x_char_height): Remove prototypes.
3491 * w32term.h (x_char_width, x_char_height): Likewise.
3492 * xfns.c (x_char_width, x_char_height): Remove.
3493 * w32fns.c (x_char_width, x_char_height): Likewise.
3494 * nsfns.c (x_char_width, x_char_height): Likewise.
3495 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3496 all window frames.
3497 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3498 * keyboard.c (command_loop_1): Remove prototype.
3499 (command_loop_2, top_level_1): Add static to match prototype.
3500
35fb8050
PE
35012012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3502
3503 Fix a recently-introduced delete-process race condition.
3504 * callproc.c, process.h (record_kill_process):
3505 New function, containing part of the old call_process_kill.
3506 (call_process_kill): Use it.
3507 This does not change call_process_kill's behavior.
3508 * process.c (Fdelete_process): Use record_kill_process to fix a
3509 race condition that could cause Emacs to lose track of a child.
3510
565212e5
DA
35112012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3512
3513 Avoid code duplication between prev_frame and next_frame.
3514 * frame.c (candidate_frame): New function. Add comment.
3515 (prev_frame, next_frame): Use it. Adjust comment.
3516
d8ad4d3f 35172012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
3518
3519 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3520 fails, signal an error instead of continuing with an empty
3521 string. (Bug#13079)
7c2fcf9b
EZ
3522 Encode expanded temp file pattern before passing it to mkstemp or
3523 mktemp.
d3cefd13 3524
2e7cddd3
EZ
3525 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3526 Encode the file name before passing it to dostounix_filename, in
3527 case it will downcase it (under w32-downcase-file-names).
3528 (Bug#12933)
3529
644d3f0d
PE
35302012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3531
3532 Minor call-process cleanups.
3533 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3534 at the same time as other platforms, to simplify analysis.
3535 No need for fd0_volatile since we have synch_process_fd.
3536 Avoid needless emacs_close; arg is always negative.
3537
396376f1
AS
35382012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3539
3540 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3541 processes.
3542
350f51ad
DA
35432012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3544
3545 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3546 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3547 and mouse_face_hidden members to a bitfields.
3548 * frame.h (struct frame): Remove set-but-not-used space_width member.
3549 (FRAME_SPACE_WIDTH): Remove.
3550 * nsterm.m, w32term.c, xterm.c: Adjust users.
3551 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3552 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3553 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3554 members to a bitfields.
3555
bc9dbce6
PE
35562012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3557
bb5f74ee
PE
3558 Don't let call-process be a zombie factory (Bug#12980).
3559 Fixing this bug required some cleanup of the signal-handling code.
3560 As a side effect, this change also fixes a longstanding rare race
3561 condition whereby Emacs could mistakenly kill unrelated processes,
3562 and it fixes a bug where a second C-g does not kill a recalcitrant
3563 synchronous process in GNU/Linux and similar platforms.
3564 The patch should also fix the last vestiges of Bug#9488,
3565 a bug which has mostly been fixed on the trunk by other changes.
3566 * callproc.c, process.h (synch_process_alive, synch_process_death)
3567 (synch_process_termsig, sync_process_retcode):
3568 Remove. All uses removed, to simplify analysis and so that
3569 less consing is done inside critical sections.
3570 * callproc.c (call_process_exited): Remove. All uses replaced
3571 with !synch_process_pid.
3572 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3573 These take the role of what used to be in unwind-protect arg.
3574 All uses changed.
3575 (block_child_signal, unblock_child_signal):
3576 New functions, to avoid races that could kill innocent-victim processes.
3577 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3578 (call_process_kill): Record killed processes as deleted, so that
3579 zombies do not clutter up the system. Do this inside a critical
3580 section, to avoid a race that would allow the clutter.
3581 (call_process_cleanup): Fix code so that the second C-g works again
3582 on common platforms such as GNU/Linux.
3583 (Fcall_process): Create the child process in a critical section,
3584 to fix a race condition. If creating an asynchronous process,
3585 record it as deleted so that zombies do not clutter up the system.
3586 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3587 light of these changes. Omit unnecessary call to emacs_close
3588 before failure, as the unwind-protect code does that.
3589 * callproc.c (call_process_cleanup):
3590 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3591 * process.c (record_deleted_pid): New function, containing
3592 code refactored out of Fdelete_process.
3593 (Fdelete_process): Use it.
3594 (process_status_retrieved): Remove. All callers changed to use
3595 child_status_change.
3596 (record_child_status_change): Remove, folding its contents into ...
3597 (handle_child_signal): ... this signal handler. Now, this
3598 function is purely a handler for SIGCHLD, and is not called after
3599 a synchronous waitpid returns; the synchronous code is moved to
3600 wait_for_termination. There is no need to worry about reaping
3601 more than one child now.
3602 * sysdep.c (get_child_status, child_status_changed): New functions.
3603 (wait_for_termination): Now takes int * status and bool
3604 interruptible arguments, too. Do not record child status change;
3605 that's now the caller's responsibility. All callers changed.
3606 Reimplement in terms of get_child_status.
3607 (wait_for_termination_1, interruptible_wait_for_termination):
3608 Remove. All callers changed to use wait_for_termination.
3609 * syswait.h: Include <stdbool.h>, for bool.
3610 (record_child_status_change, interruptible_wait_for_termination):
3611 Remove decls.
3612 (record_deleted_pid, child_status_changed): New decls.
3613 (wait_for_termination): Adjust to API changes noted above.
3614
bc9dbce6
PE
3615 * bytecode.c, lisp.h (Qbytecode): Remove.
3616 No longer needed after 2012-11-20 interactive-p changes.
3617
3cf3c607
EZ
36182012-12-03 Eli Zaretskii <eliz@gnu.org>
3619
3620 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3621 the scroll margin, move point outside the margin. (Bug#13055)
3622
005c8d13
JD
36232012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3624
3625 * gtkutil.c (my_log_handler): New function.
3626 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3627
20edc1c9
DA
36282012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3629
3630 * lisp.h (modify_region): Rename to...
3631 (modify_region_1): ...new prototype.
3632 * textprop.c (modify_region): Now static. Adjust users.
3633 * insdel.c (modify_region): Rename to...
3634 (modify_region_1): ...new function to work with current buffer.
3635 Adjust comment and users. Use true and false for booleans.
3636
62c2e5ed
DA
36372012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3638
3639 * alloc.c (free_save_value): New function.
3640 (safe_alloca_unwind): Use it.
3641 * lisp.h (free_save_value): New prototype.
3642 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3643 Add comment.
3644 (save_excursion_restore): Adjust to match saved data structure.
3645 Use free_save_value to offload some work from GC. Drop obsolete
3646 #if 0 code.
3647
c5bc2d1d 36482012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
3649
3650 * fileio.c (Vauto_save_list_file_name): Doc fix.
3651
c5bc2d1d 36522012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
3653
3654 * w32fns.c: Remove prototype of atof.
1e101a4b 3655 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 3656 builds.
1e101a4b 3657 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
3658
3659 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3660 with 64-bit builds.
3661
3662 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3663 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3664 defined.
3665
c5bc2d1d 36662012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 3667
a9de9f0c 3668 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 3669
21e54a94
PE
36702012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3671
2dd2e622
PE
3672 Fix xpalloc confusion after memory is exhausted.
3673 * alloc.c (xpalloc): Comment fix.
3674 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3675 and signals an error, do not clear charset_table_size, as
3676 charset_table is still valid.
3677 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3678
21e54a94
PE
3679 Use execve to avoid need to munge environ (Bug#13054).
3680 * callproc.c (Fcall_process):
3681 * process.c (create_process):
3682 Don't save and restore environ; no longer needed.
3683 * callproc.c (child_setup):
3684 Use execve, not execvp, to preserve environ.
3685
3e5490f7
PE
36862012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3687
3688 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3689
75b4f59c
YM
36902012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3691
3692 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3693 display for sliced images (Bug#10500).
3694
3695 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3696
f8aff4c6
JB
36972012-11-30 Juanma Barranquero <lekktu@gmail.com>
3698
3699 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3700 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3701
3940b924
DA
37022012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3703
3704 * xdisp.c (window_outdated): Remove eassert since it hits
3705 some suspicious corner cases (see Bug#13007 and Bug#13012).
3706 (mode_line_update_needed): New function.
3707 (redisplay_internal, redisplay_window): Use it.
3708 (ensure_selected_frame): New function.
3709 (redisplay_internal, unwind_redisplay): Use it.
3710 (redisplay_internal): Move comment about buffer_shared...
3711 (buffer_shared_and_changed): ...near to its real use.
3712
4a9204fe
PE
37132012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3714
3715 * callproc.c (Fcall_process): Don't misreport vfork failure.
3716
60aeceb8
PE
37172012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3718
3719 * callproc.c (Fcall_process): Fix vfork portability problems.
3720 Do not assume that fd[0], count, filefd, and save_environ survive
3721 vfork. Fix bug whereby wrong errno value could be reported for
3722 pipe failure. Some minor cleanups, too, as follows. Move buf and
3723 bufsize to the context where they're needed. Change new_argv to
3724 be of type char **, as this is more convenient and avoids casts.
3725 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3726 Now local constants, not macros.
3727
00dc3ead
KH
37282012-11-18 Kenichi Handa <handa@gnu.org>
3729
3730 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3731 for the variable "f".
3732
e1bf05c1
KH
37332012-11-13 Kenichi Handa <handa@gnu.org>
3734
3735 * font.c (font_unparse_xlfd): Exclude special characters from the
3736 generating XLFD name.
3737
22626a85
PE
37382012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3739
350e0088
PE
3740 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3741 * dired.c (stat_uname, stat_gname):
3742 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3743
22626a85
PE
3744 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3745 * dired.c (directory_files_internal, file_name_completion):
3746 Assume EAGAIN and EINTR are defined.
350e0088 3747
22626a85
PE
3748 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3749 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3750 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3751 * lread.c (readbyte_from_file): Assume EINTR is defined.
3752 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3753 Assume EIO and EAGAIN are defined.
3754 * unexcoff.c (write_segment): Assume EFAULT is defined.
3755
5c9cf0a3 37562012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
3757
3758 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3759 (Bug#11964)
3760
22294a56
EZ
3761 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3762 highlighting on the frame was cleared. Prevents assertion
3763 violations when repeatedly clicking on the "Top" link of the
3764 "bread-crumbs" in Info buffers.
3765
5fbab051
PE
37662012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3767
3768 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3769
bcd77a2b
KB
37702012-11-24 Ken Brown <kbrown@cornell.edu>
3771
3772 * keyboard.c (HAVE_MOUSE):
3773 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3774 were always defined.
3775
d125ca15 37762012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 3777
24becea4
EZ
3778 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3779 between bpos_covered and bpos_max. This fixes cursor display when
3780 several display strings follow each other.
3781
8654a41b
EZ
3782 * .gdbinit (pgx): If the glyph's object is a string, display the
3783 pointer to string data, rather than the value of the string object
3784 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3785
cb5867b1
EZ
3786 * indent.c (Fvertical_motion): If the starting position is covered
3787 by a display string, return to one position before that, to avoid
3788 overshooting it inside move_it_to. (Bug#12930)
3789
f418b22e
DA
37902012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3791
3792 * frame.h (struct frame): Remove display_preempted member
3793 since all users are dead long ago.
3794 * nsterm.h (struct x_output): Use the only dummy member.
3795 * w32menu.c (pending_menu_activation): Remove since not
3796 really used.
3797 (set_frame_menubar): Adjust user.
3798 * w32term.h (struct x_output): Drop outdated #if 0 code.
3799 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
3800 asked_for_visible and menubar_active members.
3801 Drop unused pending_menu_activation member.
f418b22e
DA
3802 * xterm.h (struct x_output): Drop outdated #if 0 code.
3803 Use bitfields for explicit_parent, asked_for_visible,
3804 has_been_visible and net_wm_state_hidden_seen members.
3805
a879f0ea
EZ
38062012-11-23 Eli Zaretskii <eliz@gnu.org>
3807
3808 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3809 of a literal "/". (Bug#12955)
3810 (gl-stamp): Invoke fc.exe directly, not through cmd.
3811
95ef7787
PE
38122012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3813
3814 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3815 * dired.c: Assume HAVE_DIRENT_H.
3816 (NAMLEN): Remove, replacing with ...
3817 (dirent_namelen): New function. All uses changed. Use the GNU macro
3818 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3819 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3820 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3821 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3822 $(NT_INC)/dirent.h.
3823 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3824 * ndir.h: Rename to ../nt/inc/dirent.h.
3825 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3826 Do not include <dirent.h>; no longer needed.
3827 * w32.c: Include <dirent.h> rather than "ndir.h".
3828
12645ae6
CY
38292012-11-23 Chong Yidong <cyd@gnu.org>
3830
3831 * xftfont.c (xftfont_open): Remove duplicate assignment.
3832
5c747675
DA
38332012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3834
3835 * alloc.c (Fgarbage_collect): Unblock input after clearing
3836 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3837 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3838 * msdos.c (IT_frame_up_to_date): Use it here...
3839 * w32term.c (w32_frame_up_to_date): ...here...
3840 * xterm.c (XTframe_up_to_date): ...and here...
3841 * nsterm.m (ns_frame_up_to_date): ...but not here.
3842 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3843 Adjust users.
3844 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3845 Do not check whether GC is in progress.
3846
6ceeb5f1
DA
38472012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3848
3849 * xdisp.c (window_buffer_changed): New function.
3850 (update_menu_bar, update_tool_bar): Use it to
3851 simplify large 'if' statements.
3852 (redisplay_internal): Generalize commonly used
3853 'tail' and 'frame' local variables.
3854
ec84768f
EZ
38552012-11-22 Eli Zaretskii <eliz@gnu.org>
3856
3857 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3858 with Windows system header.
3859
9239d970
PE
38602012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3861
3862 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3863 * alloc.c: Assume unistd.h exists.
3864 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3865 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3866 (getwd) [USG]: Remove; no longer needed.
3867 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3868 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3869 * w32.h (getcwd): Remove decl.
3870
954bba56
SM
38712012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3872
3873 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3874 Make it set selected_window as well.
3875 (update_tool_bar): Use it.
3876
6ef2e5ef 38772012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
3878
3879 * emacs.c (main): Set the G_SLICE environment variable for all
3880 Cygwin builds, not just GTK builds. See
3881 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3882
6ef2e5ef 38832012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
3884
3885 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3886 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3887 Define for the MSVC compiler.
3888
6ef2e5ef 3889 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
3890
3891 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3892 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3893 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
3894 dostounix_filename assumes it gets a unibyte string.
3895 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
3896 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3897
eadf1faa
SM
38982012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3899
3900 Conflate Qnil and Qunbound for `symbol-function'.
3901 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3902 * lread.c (init_obarray): Set `function' fields to Qnil.
3903 * eval.c (Fcommandp): Ignore Qunbound.
3904 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3905 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3906 Test NILP rather than Qunbound.
3907 (Ffmakunbound): Set to Qnil.
3908 (Fsymbol_function): Never signal an error.
3909 (Finteractive_form): Ignore Qunbound.
3910
b83fdfa9
PE
39112012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3912
3913 * eval.c (interactive_p): Remove no-longer-used decl.
3914
952580c5
DA
39152012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3916
3917 * xdisp.c (buffer_shared): Adjust comment.
3918 (buffer_shared_and_changed): New function.
3919 (prepare_menu_bars, redisplay_internal): Use it to
3920 decide whether all windows or frames should be updated.
ea6de9b1
DA
3921 (window_outdated): New function.
3922 (text_outside_line_unchanged_p, redisplay_window): Use it.
3923 (redisplay_internal): Likewise. Fix indentation.
952580c5 3924
23ba2705
SM
39252012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3926
3927 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3928 (syms_of_eval): Remove corresponding defsubr.
3929 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3930
6e9f7997
DC
39312012-11-19 Daniel Colascione <dancol@dancol.org>
3932
3933 * w32fns.c (Fx_file_dialog):
3934 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3935 cygwin_convert_file_name*.
3936
3937 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3938 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3939
552a1590
PE
39402012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3941
3942 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3943
2ac9538d 39442012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
3945
3946 * w32select.c: Include w32common.h before w32term.h, so that
3947 windows.h gets included before w32term.h uses some of its
3948 features, see below.
3949
23ba2705
SM
3950 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3951 New typedefs.
3952 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3953 New prototypes.
d8715cdf
EZ
3954 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3955
2ac9538d 39562012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
3957
3958 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3959 (ns_select): Return at once if events are held (Bug#12834).
3960
2ac9538d 39612012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 3962
3963 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3964 Needed following 2012-10-20 change. (Bug#12902)
3965
c1f7ba3a
JB
39662012-11-18 Juanma Barranquero <lekktu@gmail.com>
3967
3968 * w32proc.c (waitpid): Remove unused label get_result.
3969
a75ce9d3
JB
39702012-11-17 Juanma Barranquero <lekktu@gmail.com>
3971
3972 * makefile.w32-in (SYSWAIT_H): New macro.
3973 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3974 ($(BLD)/sysdep.$(O)): Update dependencies.
3975
49cdacda
PE
39762012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3977
3978 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3979 * callproc.c (relocate_fd): Assume F_DUPFD.
3980 * emacs.c, term.c (O_RDWR): Remove.
3981 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3982 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3983 * nsterm.m: Assume <fcntl.h> exists.
3984 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3985 (create_pty, Fmake_network_process, server_accept_connection)
3986 (wait_reading_process_output, init_process_emacs):
3987 Assume O_NONBLOCK.
3988 (wait_reading_process_output): Put in a special case for WINDOWSNT
3989 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3990 It's not clear this is needed, but it's a more-conservative change.
3991 (create_process): Assume FD_CLOEXEC.
3992 (create_process, create_pty): Assume O_NOCTTY.
3993 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3994 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3995 Omit if not DOS_NT, since F_GETFL is not defined there.
3996 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3997 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3998 (O_NOCTTY): Remove.
3999 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4000 lack it, since gnulib guarantees this.
4001 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4002
22bae83f
EZ
40032012-11-17 Eli Zaretskii <eliz@gnu.org>
4004
6ad30855
EZ
4005 * w32.c (faccessat): Pretend that directories have the execute bit
4006 set. Emacs expects that, e.g., in files.el:cd-absolute.
4007
22bae83f
EZ
4008 * w32proc.c (create_child): Don't clip the PID of the child
4009 process to fit into an Emacs integer, as this is no longer a
4010 restriction.
4011 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4012 reaping only the process specified by PID argument, if that is
4013 positive. Use PID instead of dead_child to know which process to
4014 reap. Wait for the child to die only if WNOHANG is not in
4015 OPTIONS.
4016 (sys_select): Don't set dead_child.
4017
4018 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4019 as it is no longer needed.
4020
4021 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4022 no longer needed.
4023 (record_child_status_change): Remove the setting of
4024 record_at_most_one_child for the !WNOHANG case.
4025
a631d0e0
PE
40262012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4027
4028 Fix problems in ns port found by static checking.
4029 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4030 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4031 not to process group.
4032 (ns_select): Use emacs_write, not write, as that's more robust
4033 in the presence of signals.
4034 (fd_handler:): Check for read errors.
4035
d56f2e49
GM
40362012-11-16 Glenn Morris <rgm@gnu.org>
4037
4038 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4039
96e05507 40402012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
4041
4042 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4043
96e05507 40442012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
4045
4046 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4047 use the same value of thread handle.
4048 (start_timer_thread): If the timer thread exited (due to error),
4049 clean up by closing the two handles it used. Duplicate the caller
4050 thread's handle here, so it gets duplicated only once, when
4051 launching the timer thread. Set priority of the timer thread, not
4052 the caller thread.
4053 (getitimer): Don't duplicate the caller thread's handle here.
4054 (Bug#12832)
4055
96e05507 40562012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
4057
4058 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4059 called (Bug#12834).
4060
3d082a26
PE
40612012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4062
4063 Remove no-longer-used pty_max_bytes variable.
4064 * process.c (pty_max_bytes): Remove; unused.
4065 (send_process): Do not set it.
4066
b72c161c
JB
40672012-11-15 Juanma Barranquero <lekktu@gmail.com>
4068
4069 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4070 Update dependencies.
4071
bf20ea80
PE
40722012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4073
4074 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4075 This follows up on the 2012-09-29 patch that removed indirection
4076 for the 'function' field. Reported by Sergey Vinokurov in
4077 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4078
14f20728
EZ
40792012-11-14 Eli Zaretskii <eliz@gnu.org>
4080
4081 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4082 different name, as the MS runtime does not have such a function,
4083 and probably never will.) All callers changed. Ignore DIRFD
4084 value if PATH is an absolute file name, to match Posix spec
4085 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4086 symlinks.
4087
77731919
DA
40882012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4089
4090 * xdisp.c (echo_area_display, redisplay_internal):
4091 Omit redundant check whether frame_garbaged is set.
4092
73dcdb9f
PE
40932012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4094
4095 Use faccessat, not access, when checking file permissions (Bug#12632).
4096 This fixes a bug that has been present in Emacs since its creation.
4097 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4098 which must set some sort of record. (Torek's bug report was against
4099 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4100 same common flaw.) See Torek's Usenet posting
4101 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4102 Posted: Fri Apr 8 14:18:56 1983.
4103 * Makefile.in (LIB_EACCESS): New macro.
4104 (LIBES): Use it.
4105 * callproc.c (init_callproc):
4106 * charset.c (init_charset):
4107 * fileio.c (check_existing, check_executable, check_writable)
4108 (Ffile_readable_p):
4109 * lread.c (openp, load_path_check):
4110 * process.c (allocate_pty):
4111 * xrdb.c (file_p):
4112 Use effective UID when checking permissions, not real UID.
4113 * callproc.c (init_callproc):
4114 * charset.c (init_charset):
4115 * lread.c (load_path_check, init_lread):
4116 Test whether directories are accessible, not merely whether they exist.
4117 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4118 * fileio.c (check_existing, check_executable, check_writable)
4119 (Ffile_readable_p):
4120 Use symbolic names instead of integers for the flags, as they're
4121 portable now.
4122 (check_writable): New arg AMODE. All uses changed.
4123 Set errno on failure.
4124 (Ffile_readable_p): Use faccessat, not stat + open + close.
4125 (Ffile_writable_p): No need to call check_existing + check_writable.
4126 Just call check_writable and then look at errno. This saves a syscall.
4127 dir should never be nil; replace an unnecessary runtime check
4128 with an eassert. When checking the parent directory of a nonexistent
4129 file, check that the directory is searchable as well as writable, as
4130 we can't create files in unsearchable directories.
4131 (file_directory_p): New function, which uses 'stat' on most platforms
4132 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4133 (Ffile_directory_p, Fset_file_times): Use it.
4134 (file_accessible_directory_p): New function, which uses a single
4135 syscall for efficiency.
4136 (Ffile_accessible_directory_p): Use it.
4137 * xrdb.c (file_p): Use file_directory_p.
4138 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4139 * lread.c (openp): When opening a file, use fstat rather than
4140 stat, as that avoids a permissions race. When not opening a file,
4141 use file_directory_p rather than stat.
4142 (dir_warning): First arg is now a usage string, not a format.
4143 Use errno. All uses changed.
4144 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4145 that merely introduced a race.
4146 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4147 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4148 and similarly for the other O_* flags.
4149 * w32.c (sys_faccessat): Rename from sys_access and switch to
4150 faccessat's API. All uses changed.
4151 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4152 (magic_db): Rename from magic_file_p.
4153 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4154 char *, so that we don't have to test for file existence
4155 separately from opening the file for reading. This removes a race
4156 fixes a permission-checking problem, and simplifies the code.
4157 All uses changed.
4158 (file_p): Remove; no longer needed.
4159
2a14f83b
DA
41602012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4161
4162 Omit glyphs initialization at startup.
4163 * dispnew.c (glyphs_initialized_initially_p): Remove.
4164 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4165 (Fredraw_frame): Move actual code from here...
c7085245 4166 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
4167 (Fredraw_display): Use redraw_frame.
4168 * xdisp.c (clear_garbaged_frames): Likewise.
4169
f78ee6af 41702012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
4171
4172 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4173 passed to pint2str and pint2hrstr to be at most the size of the
4174 frame's decode_mode_spec_buffer. This avoids crashes with very
4175 large values of FIELD_WIDTH argument to decode_mode_spec.
4176 (Bug#12867)
4177
b95a9c0c
PE
41782012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4179
4180 Fix a race with verify-visited-file-modtime (Bug#12863).
4181 Since at least 1991 Emacs has ignored an mtime difference of no
4182 more than one second, but my guess is that this was to work around
4183 file system bugs that were fixed long ago. Since the race is
4184 causing problems now, let's remove that code.
4185 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4186 whose time stamp is off by no more than a second. Insist that the
4187 file time stamps match exactly.
4188
be49ba74
DA
41892012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4190
4191 * frame.h (struct frame): Convert external_tool_bar member to
4192 1-bit unsigned bitfield.
4193 * termhooks.h (struct terminal): Remove mouse_moved member since
4194 all users are long dead. Adjust comment on mouse_position_hook.
4195
5b04e9f9
DA
41962012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4197
4198 Simplify by using FOR_EACH_FRAME here and there.
4199 * frame.c (next_frame, prev_frame, other_visible_frames)
4200 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4201 * w32term.c (x_window_to_scroll_bar): Likewise.
4202 * window.c (window_list): Likewise.
4203 * xdisp.c (x_consider_frame_title): Likewise.
4204 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4205 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4206 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4207 * xmenu.c (menubar_id_to_frame): Likewise.
4208 * xselect.c (frame_for_x_selection): Likewise.
4209 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4210 (x_window_to_menu_bar): Likewise.
4211 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4212
76ae24d7
PE
42132012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4214
12cc4337
PE
4215 * data.c (Qdefalias_fset_function): Now static.
4216
76ae24d7
PE
4217 Another tweak to vectorlike_header change.
4218 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4219 Remove, and replace all uses with ...
4220 (next_in_free_list, set_next_in_free_list):
4221 New functions, which respect C's aliasing rules better.
4222
1479c557
PE
42232012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4224
4225 * window.c (list4i): Rename from 'quad'. All uses changed.
4226 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4227
11235c03
JB
42282012-11-11 Juanma Barranquero <lekktu@gmail.com>
4229
4230 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4231 warning about mixing declarations and code in ISO C90.
4232
6baf66d5 42332012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
4234
4235 * window.c (Fsplit_window_internal): Set combination limit of
4236 new parent window to t iff Vwindow_combination_limit is t;
4237 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 4238 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 4239
6baf66d5 42402012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
4241
4242 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4243 amount when the scroll margins are too large. When scrolling
4244 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
4245 scroll margin within a reasonable number of screen lines.
4246 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
4247 point is positioned many lines beyond the window top/bottom.
4248 (Bug#12811)
4249
508f51f5
EZ
4250 * ralloc.c (relinquish): If real_morecore fails to return memory
4251 to the system, don't crash; instead, leave the last heap
4252 unchanged and return. (Bug#12774)
4253
32e5c58c
SM
42542012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4255
4256 * lisp.h (AUTOLOADP): New macro.
4257 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4258 * data.c (Ffset): Remove special ad-advice-info handling.
4259 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4260 (Fsubr_arity): CSE.
4261 (Finteractive_form): Simplify.
4262 (Fquo): Don't insist on having at least 2 arguments.
4263 (Qdefalias_fset_function): New var.
4264
719b0aa5
JD
42652012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4266
4ab15c3e
JD
4267 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4268
719b0aa5
JD
4269 * nsfont.m (Qcondensed, Qexpanded): New variables.
4270 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4271 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4272
535cc8e9
DA
42732012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4274
4275 Fix recently introduced crash on MS-Windows (Bug#12839).
4276 * w32term.h (struct scroll_bar): Use convenient header.
4277 (SCROLL_BAR_VEC_SIZE): Remove.
4278 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4279
7d377c48
DA
42802012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4281
4282 Tweak last vectorlike_header change.
4283 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4284 vectorlike object on the free list. This is introduced to avoid
4285 some (but not all) pointer casting and aliasing problems, see
4286 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4287 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4288 objects.
4289 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4290
7ad27466
JD
42912012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4292
32e5c58c 4293 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
4294 been removed, so remove them here also.
4295
57618ecf
SM
42962012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4297
4298 * doc.c (Fdocumentation): Handle new property
4299 dynamic-docstring-function to replace the old ad-advice-info.
4300
53371430
PE
43012012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4302
4303 * fns.c (Qeql, hashtest_eq): Now static.
4304
61ddb1b9
SM
43052012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4306
4307 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4308 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4309 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4310 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4311
04a2d0d3
PE
43122012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4313
4314 Use same hash function for hashfn_profiler as for hash_string etc.
4315 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4316 * lisp.h (sxhash_combine): New inline function, with the contents
4317 of the old SXHASH_COMBINE.
4318 * profiler.c (hashfn_profiler): Use it, instead of having a
4319 special hash function containing a comparison that always yields 1.
4320
de5ef41a
SM
43212012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4322
4323 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4324 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4325 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4326 Remove unused vars.
4327
a23c4171
JD
43282012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4329
4330 * image.c (xpm_make_color_table_h): Fix compiler error because
4331 make_hash_table changed.
4332
0b59090b 43332012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
4334
4335 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4336
b7432bb2
SM
43372012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4338
4339 Use ad-hoc comparison function for the profiler's hash-tables.
4340 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4341 (make_log): Use them.
4342 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4343 call Fequal any more.
4344 (Ffunction_equal): New function.
4345 (cmpfn_profiler, hashfn_profiler): New functions.
4346 (syms_of_profiler): Initialize them.
4347 * lisp.h (struct hash_table_test): New struct.
4348 (struct Lisp_Hash_Table): Use it.
4349 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4350 * fns.c (make_hash_table): Take a struct to describe the test.
4351 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4352 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4353 (hash_lookup, hash_remove_from_table): Move assertion checking of
4354 hashfn result here. Check hash-equality before calling cmpfn.
4355 (Fmake_hash_table): Adjust call to make_hash_table.
4356 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4357 (syms_of_fns): Initialize them.
4358 * emacs.c (main): Move syms_of_fns earlier.
4359 * xterm.c (syms_of_xterm):
4360 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4361 * print.c (print_object): Adjust to new hash-table struct.
4362 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4363
88002743
EZ
43642012-11-08 Eli Zaretskii <eliz@gnu.org>
4365
4366 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4367 value of w32-scroll-lock-modifier is neither nil nor one of the
4368 known key modifiers. (Bug#12806)
4369
914adc42
DA
43702012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4371
4372 Shrink struct vectorlike_header to the only size field.
4373 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4374 Adjust comment.
4375 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4376 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4377 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4378 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4379 information from the vector header. Adjust comment.
4380 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4381 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4382 layout.
4383 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4384 (struct vectorlike_header): Remove next member. Adjust comment.
4385 (struct Lisp_Subr): Add convenient header. Adjust comment.
4386 (allocate_pseudovector): Adjust prototype.
4387 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4388 (sweep_string, lisp_malloc): Remove useless prototypes.
4389 (enum mem_type): Adjust comment.
4390 (NEXT_IN_FREE_LIST): New macro.
4391 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4392 (Fmake_bool_vector): Likewise.
4393 (struct large_vector): New type to represent allocation unit for
4394 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4395 (large_vectors): Change type to struct large_vector.
4396 (allocate_vector_from_block): Simplify.
4397 (PSEUDOVECTOR_NBYTES): Replace with...
4398 (vector_nbytes): ...new function. Adjust users.
4399 (sweep_vectors): Adjust processing of large vectors.
4400 (allocate_vectorlike): Likewise.
4401 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4402 Add easserts. Adjust XSETPVECTYPESIZE usage.
4403 (allocate_buffer): Use BUFFER_PVEC_INIT.
4404 (live_vector_p): Adjust to match large vector.
4405 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4406 * buffer.h (struct buffer): Add next member.
4407 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4408 New macros.
4409 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4410 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4411 (copy_hash_table): Adjust to match vector header change.
4412 * lread.c (defsubr): Use XSETPVECTYPE.
4413 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4414 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4415 (xvecsize): New command.
4416
c66f21ea
DA
44172012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4418
4419 * keyboard.c (event_to_kboard): Do not dereference
4420 frame_or_window field of SELECTION_REQUEST_EVENT
4421 and SELECTION_CLEAR_EVENT events (Bug#12814).
4422 * xterm.h (struct selection_input_event): Adjust comment.
4423
eb147960
EZ
44242012-11-07 Eli Zaretskii <eliz@gnu.org>
4425
dab72075
EZ
4426 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4427 such as Scroll Lock, if the respective keys are treated as
4428 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 4429 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 4430
5890e400
DA
44312012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4432
4433 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4434
b6b3b294
PE
44352012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4436
4437 Restore some duplicate definitions (Bug#12814).
4438 This undoes part of the 2012-11-03 changes. Some people build
4439 with plain -g rather than with -g3, and they need the duplicate
4440 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4441 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4442 Define as macros, as well as as enums or as constants.
4443
e770aad5
JD
44442012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4445
4446 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4447 to keypad keys (Bug#12816).
4448
68f8f1c0
PE
44492012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4450
4451 Minor adjustments of recently-changed frame functions.
4452 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4453 known to be a frame (we're in the FRAMEP branch).
4454 * lisp.h (Qframep): Remove decl. frame.h declares this.
4455 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4456 since they're meant for Lisp fixnum values.
4457
72f94d4b
DA
44582012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4459
4460 * window.c (Fwindow_combination_limit): Revert to the only
4461 required argument and adjust docstring as suggested in
4462 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4463 by Martin Rudalics <rudalics@gmx.at>.
4464
d9f07150
DA
44652012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4466
4467 Widely used frame validity and checking functions.
4468 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4469 * frame.c (decode_live_frame, decode_any_frame): New functions.
4470 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4471 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4472 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4473 (Fframe_pointer_visible_p): Use decode_any_frame.
4474 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4475 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4476 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4477 (Fframe_focus): Likewise. Allow zero number of arguments.
4478 Adjust docstring.
4479 (frame_buffer_list, frame_buffer_predicate): Remove.
4480 * lisp.h (frame_buffer_predicate): Remove prototype.
4481 * buffer.c (Fother_buffer): Use decode_any_frame.
4482 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4483 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4484 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4485 (Fclose_font, Ffont_info): Use decode_live_frame.
4486 * fontset.c (check_fontset_name): Likewise.
4487 * terminal.c (Fframe_terminal): Likewise.
4488 * w32fns.c (check_x_frame): Likewise.
4489 * window.c (Fminibuffer_window, Fwindow_at)
4490 (Fcurrent_window_configuration): Likewise.
4491 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4492 Likewise. Allow zero number of arguments. Adjust docstring.
4493 * dispnew.c (Fredraw_frame): Likewise.
4494 * xfaces.c (frame_or_selected_frame): Remove.
4495 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4496 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4497 (Fframe_face_alist): Use decode_live_frame.
4498 * xfns.c (check_x_frame): Likewise.
4499
89bc0592
DA
45002012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4501
4502 * window.c (quad): New function.
4503 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4504 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4505 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4506 (Fwindow_line_height): Use it.
4507 (Fwindow_fringes): Use list3.
4508 (Fwindow_scroll_bars): Use list4.
4509 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4510 (Fwindow_combination_limit): Allow zero number of arguments.
4511
c8e3a9c3
EZ
45122012-11-05 Eli Zaretskii <eliz@gnu.org>
4513
4514 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4515
8e2417bf 4516 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 4517 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 4518 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 4519
209c6a58
CY
45202012-11-05 Chong Yidong <cyd@gnu.org>
4521
4522 * process.c (wait_reading_process_output): Revert previous change.
4523
8148369c
PE
45242012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4525
dd0333b6
PE
4526 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4527 This removes code that has been obsolete since around 1990.
4528 * callproc.c (Fcall_process):
4529 * emacs.c (main):
4530 * process.c (create_process):
4531 * term.c (dissociate_if_controlling_tty):
4532 Assume setsid exists.
4533 * callproc.c (child_setup): Assume setpgid exists and behaves as
4534 per POSIX.1-1988 or later.
4535 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4536 * emacs.c (shut_down_emacs):
4537 * sysdep.c (sys_suspend, init_foreground_group):
4538 Assume getpgrp behaves as per POSIX.1-1998 or later.
4539 * msdos.c (setpgrp): Remove.
4540 (tcgetpgrp, setpgid, setsid): New functions.
4541 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4542 * term.c (no_controlling_tty): Remove; unused.
4543 * w32proc.c (setpgrp): Remove.
4544 (setsid, tcgetpgrp): New functions.
4545
8148369c
PE
4546 Simplify by assuming __fpending.
4547 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4548 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4549 Do not assume that __fpending's result fits in int.
4550
76abf5e5
PE
45512012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4552
06b63c9b
PE
4553 Remove EMACS_OUTQSIZE+sleep hack.
4554 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
4555 than 2400 bps, which throttled Emacs by having it sleep.
4556 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
4557 was added, and anyway those old terminals are long dead.
4558 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4559 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4560
76abf5e5
PE
4561 Fix data-loss with --version (Bug#9574).
4562 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4563 as we can't assume that emacs_strerror is initialized, and strerror
4564 is good enough here.
4565 (main): Invoke atexit earlier, to catch earlier instances of
4566 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4567
8f31e74b
MM
45682012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4569
4570 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4571 (keyDown): Remap keypad keys to X11 virtual key codes.
4572
0d879dca
PE
45732012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4574
7ccfb720
PE
4575 Fix data-loss with --batch (Bug#9574).
4576 * emacs.c: Include <close-stream.h>.
4577 (close_output_streams): New function.
4578 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4579 and handles errors appropriately.
4580 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4581 does that now.
4582
0b3d4a47
PE
4583 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4584 The symptom is a diagnostic "GLib-WARNING **: In call to
4585 g_spawn_sync(), exit status of a child process was requested but
4586 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4587 waitpid(), so exit status can't be returned." The diagnostic
4588 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4589 The real bug is a race condition between Emacs and glib: Emacs
4590 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4591 so that glib can't find it. Work around the bug by invoking
4592 waitpid only on subprocesses that Emacs itself creates.
4593 * process.c (create_process, record_child_status_change):
4594 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
4595 know the pid rather than having the callee infer it.
4596 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
4597 (create_process): Set new 'alive' member if child is created.
4598 (process_status_retrieved): New function.
4599 (record_child_status_change): Use it.
4600 Accept negative 1st argument, which means to wait for the
4601 processes that Emacs already knows about. Move special-case code
4602 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4603 processes that have already been waited for, by testing and
4604 clearing new 'alive' member.
4605 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4606 now does this internally.
4607 (handle_child_signal): Let record_child_status_change do all
4608 the work, since we do not want to reap all exited child processes,
4609 only the child processes that Emacs itself created.
4610 * process.h (Lisp_Process): New boolean member 'alive'.
4611
0d879dca
PE
4612 Omit duplicate definitions no longer needed with gcc -g3.
4613 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4614 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4615 Define only as macros. There's no longer any need to also define
4616 these symbols as enums or as constants, since we now assume
4617 gcc -g3 when debugging.
4618
3478f4b5
EZ
46192012-11-03 Eli Zaretskii <eliz@gnu.org>
4620
4621 * lisp.mk: Adjust comments to the fact that term/internal is now
4622 loaded from loadup.el.
4623
4624 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4625 (msdos_fatal_signal): New function.
4626 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4627 its argument list.
4628
4629 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4630 for GCC versions before 4.
4631 (emacs_raise): Define to call msdos_fatal_signal.
4632
4633 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4634 iterator when starting in the middle of a display or overlay
4635 string. (Bug#12745)
4636
85fabcb7
CY
46372012-11-03 Chong Yidong <cyd@gnu.org>
4638
4639 * process.c (wait_reading_process_output): Clean up the last
4640 change.
4641
893cc455
CY
46422012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4643
4644 * process.c (wait_reading_process_output): Avoid a race condition
4645 with SIGIO delivery (Bug#11536).
4646
0f7b074f
CY
46472012-11-03 Chong Yidong <cyd@gnu.org>
4648
4649 * buffer.c (cursor_type): Untabify docstring.
4650
3737fee7
DA
46512012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4652
4653 * frame.h (struct frame): Drop can_have_scroll_bars member
4654 which is meaningless for a long time. Adjust comments.
4655 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4656 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4657
b6a9e8b1
DA
46582012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4659
4660 * window.c (decode_next_window_args): Update window arg after
4661 calling decode_live_window and so fix crash reported at
4662 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4663 by Juanma Barranquero <lekktu@gmail.com>.
4664 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4665 * font.c (Ffont_at): Likewise.
4666
600d4768
JD
46672012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4668
4669 * widget.c (resize_cb): New function.
4670 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4671 (EmacsFrameResize): Check if all is up to date before changing frame
4672 size.
4673
1005b4b9
EZ
46742012-11-02 Eli Zaretskii <eliz@gnu.org>
4675
4676 Implement backtrace output for fatal errors on MS-Windows.
4677 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4678 (BACKTRACE_LIMIT_MAX): New macro.
4679 (w32_backtrace): New function.
4680 (emacs_abort): Use w32_backtrace when the user chooses not to
4681 attach a debugger. Update the text of the abort dialog.
4682
b9e9df47
DA
46832012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4684
4685 Window-related stuff cleanup here and there.
4686 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4687 Use decode_any_window.
4688 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4689 * xdisp.c (Fformat_mode_line): Likewise.
4690 * font.c (Ffont_at): Use decode_live_window.
4691 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4692 * window.c (decode_next_window_args): Likewise.
4693 (decode_any_window): Remove static.
4694 * window.h (decode_any_window): Add prototype.
4695 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4696 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4697 respectively.
4698
2b371ff7
DA
46992012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4700
4701 Remove pad from struct input_event.
4702 * termhooks.h (struct input_event): Remove padding field.
4703 Adjust comment.
4704 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4705 member is never cons for a long time. Adjust comment.
4706 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4707 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4708 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4709 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4710
7e8b50d9
EZ
47112012-11-01 Eli Zaretskii <eliz@gnu.org>
4712
4713 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4714
322aea6d
PE
47152012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4716
4717 Fix crash when using Emacs as commit editor for git (Bug#12697).
4718 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4719 and it is configured in conf_post.h.
4720 (Fcall_process): Don't invoke both setsid and setpgid; the former
4721 is enough, if it exists.
4722 * callproc.c (Fcall_process, child_setup):
4723 * process.c (create_process): Use setpgid.
4724 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4725 for the real thing.
4726 * dispnew.c (init_display): Initialize the foreground group
4727 if we are running a tty display.
4728 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4729 * lisp.h (init_foreground_group): New decl.
4730 * sysdep.c (inherited_pgroup): New static var.
4731 (init_foreground_group, tcsetpgrp_without_stopping)
4732 (narrow_foreground_group, widen_foreground_group): New functions.
4733 (init_sys_modes): Narrow foreground group.
4734 (reset_sys_modes): Widen foreground group.
4735
220cb2bd
MA
47362012-10-31 Michael Albinus <michael.albinus@gmx.de>
4737
4738 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4739
218e997a
MR
47402012-10-31 Martin Rudalics <rudalics@gmx.at>
4741
4742 * minibuf.c (read_minibuf): Restore current buffer since
4743 choose_minibuf_frame calling Fset_frame_selected_window may
4744 change it (Bug#12766).
4745
02615da0
JD
47462012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4747
4748 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4749
aee5b18e
KH
47502012-10-30 Kenichi Handa <handa@gnu.org>
4751
4752 * font.c (Ffont_at): If WINDOW is specified and it is not
4753 displaying the current buffer, signal an error.
4754
ba116008
DC
47552012-10-29 Daniel Colascione <dancol@dancol.org>
4756
de5ef41a
SM
4757 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4758 In preparation for fixing bug#12739, move these functions from
ba116008
DC
4759 here...
4760
4761 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
4762 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4763 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 4764
640bf8ad
EZ
47652012-10-28 Eli Zaretskii <eliz@gnu.org>
4766
4767 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4768 (timer_loop, getitimer, setitimer): Use it instead of
4769 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4770 'clock'.
4771 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4772 literal 10000.
4773
64ccff5f
JD
47742012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4775
4776 * nsterm.m (NO_APPDEFINED_DATA): New define.
4777 (last_appdefined_event_data): New variable
4778 (last_appdefined_event): Remove.
4779 (ns_select): Initialize t from last_appdefined_event_data instead
4780 of [last_appdefined_event data1].
4781 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4782 remove last_appdefined_event (Bug#12698).
4783
e483264c
SM
47842012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4785
4786 * frame.c (x_set_font): Catch internal error.
4787
6c16c13e
EZ
47882012-10-27 Eli Zaretskii <eliz@gnu.org>
4789
e483264c
SM
4790 Avoid overflow in w32 implementation of interval timers.
4791 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
4792 actually executes.
4793 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
4794 'volatile ULONGLONG' types. All the other data which was
4795 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
4796 (GetThreadTimes_Proc): New typedef.
4797 (w32_get_timer_time): New function, returns a suitable time value
4798 for the timer.
4799 (timer_loop): Enter critical section when accessing ULONGLONG
4800 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
4801 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4802 Remove unused variable.
6c16c13e
EZ
4803 (init_timers): Initialize s_pfn_Get_Thread_Times.
4804 (start_timer_thread): Don't assign itimer->caller_thread here.
4805 (getitimer): Assign itimer->caller_thread here.
4806 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 4807 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 4808
ccc83f50
EZ
48092012-10-26 Eli Zaretskii <eliz@gnu.org>
4810
4811 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4812 mouse movement events if the menu bar is active. This avoids
4813 producing a busy "hour-glass" cursor by Windows if the mouse
4814 pointer is positioned over a tooltip shown for some menu item.
4815
69deda53
PE
48162012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4817
4818 Don't assume process IDs fit in int.
4819 * emacs.c (shut_down_emacs) [!DOS_NT]:
4820 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4821 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4822 Use pid_t, not int, to store process IDs, as 'int'
4823 is not wide enough on a few platforms (e.g., AIX and IRIX).
4824
7e70a152
KH
48252012-10-23 Kenichi Handa <handa@gnu.org>
4826
4827 The following change is to make face-font-rescale-alist work
4828 correctly for non-ASCII fonts.
4829
4830 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4831 (font_open_for_lface): Handle Vface_font_rescale_alist.
4832
49238e7f
CY
48332012-10-23 Chong Yidong <cyd@gnu.org>
4834
4835 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4836
5ec86886
JD
48372012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4838
ef446959
JD
4839 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4840 for screen font.
4841 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4842
5ec86886
JD
4843 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4844 event (Bug#12681).
4845
ee7a418d
GM
48462012-10-21 Glenn Morris <rgm@gnu.org>
4847
4848 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4849
4973679b
PE
48502012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4851
4852 Port to OpenBSD 5.1.
4853 * frame.c (Fmouse_position, Fmouse_pixel_position):
4854 * xdisp.c (produce_stretch_glyph):
4855 Declare local vars only when they're needed.
4856 This is clearer and avoids a warning on OpenBSD about unused vars.
4857 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4858 This is safer, and avoids OpenBSD warnings about unused vars.
4859 * keyboard.c (record_menu_key): Remove unnecessary decl.
4860 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4861 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4862 as our definition clashes with OpenBSD's.
4863 * xfaces.c (load_face_colors, check_lface_attrs)
4864 (get_lface_attributes_no_remap, get_lface_attributes)
4865 (lface_fully_specified_p, x_supports_face_attributes_p)
4866 (tty_supports_face_attributes_p, face_fontset, realize_face)
4867 (realize_x_face, realize_tty_face):
4868 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4869 merely Lisp_Object *. This is more informative and avoids
4870 a warning on OpenBSD about accessing beyond an object's size.
4871
c664f463
CY
48722012-10-20 Chong Yidong <cyd@gnu.org>
4873
4874 * lread.c (Fload): Doc fix (Bug#12592).
4875
6ec83f92 48762012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
4877
4878 * font.c (Ffont_at): Fix previous change.
4879
d2824928
EZ
48802012-10-19 Eli Zaretskii <eliz@gnu.org>
4881
e483264c
SM
4882 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4883 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
4884 for the reasons.
4885
d2824928
EZ
4886 * alloc.c (NSTATICS): Decrease to 0x800.
4887
f60d391f
SM
48882012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4889
4a0e1924 4890 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
4891 error (bug#12677).
4892
1a9327d5
JD
48932012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4894
4895 * nsterm.m (ns_select): Check writefds before call to
4896 FD_ISSET (Bug#12668).
4897
14145a1e
DC
48982012-10-18 Daniel Colascione <dancol@dancol.org>
4899
4900 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4901 (staticpro): If we run out of staticpro slots, die with an
4902 informative error instead of just calling emacs_abort.
4903
1f76f6f5
MR
49042012-10-18 Martin Rudalics <rudalics@gmx.at>
4905
4906 Fix two flaws reported by Dmitry Antipov.
4907 * window.c (Ftemp_output_buffer_show): Remove.
4908 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4909 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4910
fcf14875
EZ
49112012-10-17 Eli Zaretskii <eliz@gnu.org>
4912
1f76f6f5
MR
4913 * makefile.w32-in ($(BLD)/w32.$(O)):
4914 ($(BLD)/vm-limit.$(O)):
4915 ($(BLD)/term.$(O)):
4916 ($(BLD)/unexw32.$(O)):
4917 ($(BLD)/fileio.$(O)):
a68089e4
EZ
4918 ($(BLD)/dispnew.$(O)): Update dependencies.
4919
4920 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4921 Add prototypes.
4922
4923 * w32proc.c: Include ctype.h.
4924
4925 * w32.h (init_environment, check_windows_init_file)
4926 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4927 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4928 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4929 (sys_link): Add prototypes.
4930
4931 * w32.c: Include w32select.h.
4932 (sys_access, e_malloc, sys_select): Add prototypes.
4933 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4934
4935 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4936
4937 * unexw32.c: Include lisp.h and w32.h.
4938
4939 * term.c [WINDOWSNT]: Include w32term.h.
4940
4941 * process.c [WINDOWSNT]: Add prototype of sys_select.
4942
4943 * fileio.c [WINDOWSNT]: Include w32.h.
4944
4945 * dispnew.c [WINDOWSNT]: Include w32.h.
4946
fcf14875
EZ
4947 * cygw32.c (Fcygwin_convert_path_to_windows)
4948 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4949 Lisp_Object values. (Bug#12661)
4950
4951 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4952 to Lisp_Object. (Bug#12661)
4953
fe0b1ec4
KH
49542012-10-17 Kenichi Handa <handa@gnu.org>
4955
4956 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4957 invalidate.
4958
d556ebf9
DA
49592012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4960
4961 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 4962 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 4963
f0863a54
DA
49642012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4965
4966 Do not verify indirection counters of killed buffers (Bug#12579).
4967 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4968 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4969
12fbe755
DA
49702012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4971
4972 * alloc.c (Fmake_byte_code): Fix typo in comment.
4973 * print.c (print_interval): Define as static to match prototype.
4974 * indent.c (disptab_matches_widthtab, recompute_width_table):
4975 Convert to eassert.
4976
61655b89
DA
49772012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4978
4979 * editfns.c (get_system_name): Remove.
4980 * lisp.h (get_system_name): Remove prototype.
4981 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4982 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4983
9520f2f2
DC
49842012-10-15 Daniel Colascione <dancol@dancol.org>
4985
4986 * dbusbind.c: Add comment explaining reason for previous change.
4987
dca778d5
MR
49882012-10-15 Martin Rudalics <rudalics@gmx.at>
4989
4990 * window.c (Fwindow_end): Rewrite check whether cached position
4991 can be used (Bug#12600).
4992 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4993 Set windows_or_buffers_changed.
4994
3e0341b0
DC
49952012-10-15 Daniel Colascione <dancol@dancol.org>
4996
4997 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4998 enabled by undefining the symbol "interface", which the platform
4999 headers define to something incompatible.
5000
33d4113c
DC
50012012-10-14 Daniel Colascione <dancol@dancol.org>
5002
5003 * image.c (init_tiff_functions, init_imagemagick_functions)
5004 (init_svg_functions): Fix cygw32 build break by using these
5005 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5006
a36fb15e
JD
50072012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5008
5009 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5010
537f336d
JD
50112012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5012
5013 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5014
0ba06a77
KH
50152012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5016
5017 * coding.c (detect_coding): Set coding->id before calling
5018 this->detector.
5019
ce2fe65a
AS
50202012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5021
5022 * fileio.c: Formatting fixes.
5023
d6453ce4
PE
50242012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5025
5026 Fix some stat-related races.
5027 * fileio.c (Fwrite_region): Avoid race condition if a file is
5028 removed or renamed by some other process immediately after Emacs
5029 writes it but before Emacs stats it. Do not assume that stat (or
5030 fstat) succeeds.
5031 * image.c (slurp_file): Resolve the file name with fopen + fstat
5032 rather than stat + fopen.
5033 (pbm_read_file) [0]: Remove unused code with stat race.
5034 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5035 Remove ineffective code with stat race.
5036
06485aa8
SM
50372012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5038
5039 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5040
167e3640
JD
50412012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5042
5043 * nsterm.m (hold_event_q): New static variable.
5044 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5045 ! q_event_ptr.
5046 (hold_event): New function.
5047 (ns_read_socket): If hold_event_q have events, store them and
5048 return (Bug#12384).
5049 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5050 is zero (Bug#12384).
5051
c40239df
JB
50522012-10-12 Juanma Barranquero <lekktu@gmail.com>
5053
5054 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5055
bb385a92
EZ
50562012-10-12 Eli Zaretskii <eliz@gnu.org>
5057
2a9f1099
EZ
5058 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5059
bb385a92
EZ
5060 * fileio.c (check_existing): New function.
5061 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5062 instead of calling 'stat', when what's needed is to check whether
5063 a file exists. This avoids expensive system calls on MS-Windows.
5064 (Bug#12587)
5065
8599b23a 5066 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
5067
5068 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5069 determine whether a file exists and is not a directory.
5070
5071 * lisp.h (check_existing): Add prototype.
5072
2b9c2e68
JD
50732012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5074
5075 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5076
81749a23
GM
50772012-10-12 Glenn Morris <rgm@gnu.org>
5078
5079 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5080
5253a5fd
SM
50812012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5082
389a94a5
SM
5083 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5084
5253a5fd
SM
5085 * eval.c (Fautoload): Remember previous autoload status in load-history.
5086
7cded46f
PE
50872012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5088
5089 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5090 * lread.c (load_each_byte, new_backquote_flag, readchar)
5091 (read_filtered_event, lisp_file_lexically_bound_p)
5092 (safe_to_load_version, Fload, complete_filename_p, openp)
5093 (build_load_history, readevalloop, read_escape, read1)
5094 (string_to_number, read_vector, read_list):
5095 * macros.c (Fstart_kbd_macro):
5096 * marker.c (CONSIDER):
5097 * menu.c (parse_single_submenu, digest_single_submenu)
5098 (find_and_return_menu_selection, Fx_popup_menu):
5099 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5100 (Ftry_completion):
5101 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5102 (ns_menu_show):
5103 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5104 (xmenu_show, xdialog_show):
5105 Use bool for booleans.
5106 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5107 as it's not a predicate. All uses changed. Omit unnecessary
5108 buffer termination.
5109
549c3414
DA
51102012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5111
5112 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5113 (save_excursion_restore): Do not restore mark if it was not saved.
5114
e85aafe7
PE
51152012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5116
fd2f90cf
PE
5117 * marker.c (cached_modiff): EMACS_INT, not int.
5118
c1af190b
PE
5119 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5120 instead of having a wrong decl.
e85aafe7
PE
5121 * nsmenu.m (waiting_for_input): Remove wrong decl.
5122
e738ca56
PE
51232012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5124
9fa1de30
PE
5125 keyboard.c, keymap.c: Use bool for booleans.
5126 * dispnew.c (sit_for): Distinguish between 3-way display_option
5127 and boolean do_display.
5128 * keyboard.c (single_kboard, this_command_key_count_reset)
5129 (waiting_for_input, echoing, immediate_quit, input_pending)
5130 (interrupt_input, interrupts_deferred, pop_kboard)
5131 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5132 (command_loop_1, adjust_point_for_property)
5133 (safe_run_hooks_error, input_polling_used, read_char):
5134 (help_char_p, readable_events, kbd_buffer_events_waiting)
5135 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5136 (lucid_event_type_list_p, get_input_pending):
5137 (gobble_input, menu_separator_name_p, menu_bar_item)
5138 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5139 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5140 (keyremap_step, test_undefined, read_key_sequence)
5141 (detect_input_pending, detect_input_pending_ignore_squeezables)
5142 (detect_input_pending_run_timers, requeued_events_pending_p)
5143 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5144 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5145 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5146 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5147 (accessible_keymaps_1, Fkey_description, push_key_description):
5148 (shadow_lookup, struct where_is_internal_data)
5149 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5150 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5151 (describe_map, describe_vector):
5152 * menu.c (single_menu_item):
5153 * nsmenu.m (ns_update_menubar):
5154 * process.c (wait_reading_process_output):
5155 * search.c (scan_buffer, scan_newline):
5156 Use bool for boolean.
5157 * keyboard.c (timers_run, swallow_events)
5158 (detect_input_pending_run_timers):
5159 * process.c (wait_reading_process_output):
5160 Use unsigned for counter where wraparound-on-overflow is desired,
5161 since unsigned is guaranteed to have that behavior and signed is not.
5162 (read_char): Use ptrdiff_t for string length.
5163 (get_input_pending): Remove first argument, since it was always
5164 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5165 and behave as if it had that value. Return new value of
5166 input_pending. All callers changed.
5167 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5168 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5169 a string length.
5170 * keymap.c (push_key_description): Omit last arg, which was always 1.
5171 All callers changed.
5172
e738ca56
PE
5173 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5174
29f21cdf
JB
51752012-10-10 Juanma Barranquero <lekktu@gmail.com>
5176
5177 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5178 ($(BLD)/term.$(O)): Update dependencies.
5179
6aea7528
DA
51802012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5181
5182 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5183 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5184 initializer for PVEC_NORMAL_VECTOR.
5185
5f3f57be
PE
51862012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5187
5188 Clean out old termopts cruft.
5189 * termopts.h (flow_control, meta_key): Remove unused decls.
5190 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5191 Don't include termopts.h.
5192
3e98c68e
DA
51932012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5194
5195 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5196
77e344e5
PE
51972012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5198
5199 * commands.h (immediate_quit): Remove duplicate decl.
5200
5683d7cd
JD
52012012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5202
5203 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5204 caching.
5205 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 5206 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 5207
cf5fc6db
EZ
52082012-10-09 Eli Zaretskii <eliz@gnu.org>
5209
b15736e6
EZ
5210 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5211 match what GetLastError returns. Explain why the function is
5212 needed.
5213
cf5fc6db
EZ
5214 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5215 'is_tooltip_frame', to avoid confusion with its global namesake.
5216
f99714ce
DC
52172012-10-08 Daniel Colascione <dancol@dancol.org>
5218
5219 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
5220 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5221 build that caused Emacs to display the hourglass cursor forever.
f99714ce 5222
fd59cb29
GM
5223 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5224 which is broken under remote desktop, calculate the number of
5225 colors available for a display based on the display's number of
5226 planes and number of bits per pixel per plane. (bug#10397).
5227
62c480c9 52282012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 5229
62c480c9
JD
5230 * nsfont.m (Vfonts_in_cache): New variable.
5231 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5232 are used. Add cached fonts to Vfonts_in_cache.
5233 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5234
607446ba
JB
52352012-10-08 Juanma Barranquero <lekktu@gmail.com>
5236
fd5125ad
JB
5237 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5238 in nt/config.nt.
46979e0b
JB
5239 (FONT_H): Define after FRAME_H.
5240 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5241 Update dependencies.
fd5125ad 5242
607446ba
JB
5243 * w32term.c: Remove leftover declaration of keyboard_codepage.
5244
b6f4e300
EZ
52452012-10-08 Eli Zaretskii <eliz@gnu.org>
5246
c54ebba4
EZ
5247 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5248 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5249 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5250 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
5251 ($(BLD)/unexw32.$(O)):
5252 ($(BLD)/w32.$(O)):
5253 ($(BLD)/w32console.$(O)):
5254 ($(BLD)/w32fns.$(O)):
5255 ($(BLD)/w32heap.$(O)):
5256 ($(BLD)/w32menu.$(O)):
15c720a3 5257 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 5258
b6f4e300
EZ
5259 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5260 'const char *'.
5261 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5262
501199a3
DC
52632012-10-08 Daniel Colascione <dancol@dancol.org>
5264
5265 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5266 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5267 accidental message numbering hole. Change other messages to
5268 match.
5269
5270 * w32select.h (HAVE_W32SELECT): Remove.
5271
5272 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 5273 w32common.h instead of w32heap.h.
501199a3
DC
5274
5275 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5276 (get_allocation_unit, get_processor_type, get_w32_major_version)
5277 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5278 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5279 (OS_NT, os_subtype, cache_system_info): Move declarations to
5280 w32common.
5281
5282 * w32heap.c: Include w32common.h.
5283 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
5284 (w32_minor_version, w32_build_number, w32_subtype):
5285 Remove duplicate definitions.
501199a3
DC
5286
5287 * w32fns.c: Include w32common.h; include w32heap.h only in
5288 WINDOWSNT.
5289
5290 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5291 Use `report_file_error' instead of `error' in order to better
5292 inform users of what went wrong. Increase NTGUI_UNICODE file
5293 dialog box file name length to 32k, the maximum allowed by the NT
5294 kernel.
5295
5296 * w32common.h: New file.
5297 (ROUND_UP, ROUND_DOWN, get_page_size)
5298 (get_allocation_unit, get_processor_type, get_w32_major_version)
5299 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5300 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5301 (OS_NT, os_subtype, cache_system_info): Move here.
5302
5303 * unexw32.c, unexcw.c: Include w32common.h.
5304
5305 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5306 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5307 to call syms_of_w32select.
5308
5309 * cygw32.h: Remove obsolete EXFUN declarations.
5310
5311 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5312
5313 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5314 of w32inevt.o from SOME_MACHINE_OBJECTS.
5315
93aa5c81
DC
53162012-10-08 Daniel Colascione <dancol@dancol.org>
5317
5318 * image.c: Permanent fix for JPEG compilation issue --- limit
5319 jpeglib `boolean' redefinition to Cygwin builds.
5320
d424f3d8
EZ
53212012-10-08 Eli Zaretskii <eliz@gnu.org>
5322
8ee4c6ce
EZ
5323 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5324
d424f3d8
EZ
5325 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5326 Cygwin.
5327
e08348a0
DC
53282012-10-08 Daniel Colascione <dancol@dancol.org>
5329
5330 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5331 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5332 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5333 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5334 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5335 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5336 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5337 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5338 now a supported configuration.
5339
5340 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 5341 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
5342
5343 * conf_post.h:
5344 (_DebPrint) declare tracing facility for W32 debugging. We need
5345 to unify tracing later.
5346
5347 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5348 unconditional use of W32 Unicode functions. Cygwin runs only on
5349 100% Unicode operating systems.
5350
5351 * cygw32.c: New file. Define Cygwin-specific facilities.
5352 (Fcygwin_convert_path_to_windows)
5353 (Fcygwin_convert_path_from_windows): New user functions for
5354 accessing Cygwin path-munging routines.
5355
5356 * cygw32.h: New file.
5357 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5358 UTF-16LE strings temporarily inside non-Lisp-visible string
5359 objects.
5360
5361 (w32_strerror): Just what it says on the tin.
5362
5363 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5364 also run for Cygwin; both systems have the same problem with using
5365 GUI facilities in a forked child. Also call syms_of_cygw32,
5366 syms_of_w32select in correct places.
5367
5368 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5369 needs fork-then-exec for daemon launching.
5370
5371 * font.h: Include frame.h.
5372
5373 * image.c: Use the image library cache machinery only when we're
5374 compiling for native WINDOWSNT; Cygwin can use shared libraries
5375 like any other Unixlike system.
5376
5377 * keyboard.c: Clarify a comment regarding the input loop.
5378
5379 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5380 functions directly instead of trying to detect at runtime that our
5381 host operating system supports them. We make this change for two
5382 reasons: Cygwin lacks support for the multibyte character
5383 conversion functions used by the legacy menu code, and Cygwin
5384 never needs to rely on non-Unicode APIs.
5385
5386 * unexw32.c (hinst): Declare extern.
5387
5388 * w32.c: Change header order;
5389 (w32_strerror): Move to w32fns.c because we need it for
5390 non-WINDOWSNT builds.
5391
5392 * w32.h: Add #error macro to make sure we don't include w32.h for
5393 Cygwin builds. Remove w32select declarations.
5394
5395 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 5396 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
5397
5398 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5399 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5400 POSIXy alternative.
5401 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5402 (w32_major_version, w32_minor_version, w32_build_number)
5403 (os_subtype, sound_type): Define here
5404 (w32_defined_color): Make color parameter const for consistency
5405 with other _defined_color functions.
5406 (w32_createwindow): Unconditionally call w32_init_class instead of
5407 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5408 through the code is complex and unnecessary because class
5409 registration is practically free.
5410 (w32_name_of_message): New EMACSDEBUG-only function.
5411 (Fset_message_beep): Move here
5412 (Fx_open_connection): Require that the display name for Windows be
5413 "w32" for consistency, emacsclient disambiguation, and maybe, one
5414 day, multi-window-system support.
5415 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5416 Cygwin files for W32 GUI facilities, since these clearly don't
5417 expect Cygwin names.
5418 (_DebPrint): Define.
5419 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5420 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5421 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5422 (w32_last_error): Remove.
5423
5424 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5425
5426 * w32heap.c (syspage_mask): Declare here.
5427 (cache_system_info): Remove.
5428
5429 * w32inevt.c (faked_key): Define globally, not statically.
5430 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5431 (w32_console_toggle_lock_key): Move to w32fns.c.
5432
5433 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5434
5435 * w32proc.c (_DebPrint): Move to w32fns.c.
5436 * w32select.c: Include string.h, stdio.h for Cygwin.
5437 * w32select.h: New File.
5438
5439 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5440 get_osfhandle.
5441 (w32_message_fd): New variable. Under Cygwin, holds the file
5442 descriptor the system used to tell us about pending thread
5443 messages.
5444
5445 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5446 that prevented compilation under non-WINDOWSNT systems.
5447
5448 (w32_initialize): Open /dev/windows and assign it to
5449 w32_message_fd. Provide w32 feature.
5450
5451 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5452 (WM_EMACS_INPUT_READY): add.
5453 (prepend_msg, w32_message_fd): Declare globally.
5454
5455 * w32xfns.c:
5456 (keyboard_handle): Use only when WINDOWSNT.
5457 (notify_msg_ready): New function. Posts a message to the main
5458 thread's message queue under CYGWIN, which wakes up the main
5459 thread from select(2) by making the /dev/windows file descriptor
5460 ready. Under WINDOWSNT, it sets an event the same way the old
5461 code did.
5462
5463 (post, prepend_msg): Actually call notify_msg_ready instead of
5464 setting the input event directly.
5465
98daa893
EZ
54662012-10-07 Eli Zaretskii <eliz@gnu.org>
5467
5468 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5469 but it still has blocs in it, don't return it to the system,
5470 instead of aborting. (Bug#12402)
5471
3bc0a2f7
JD
54722012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5473
8ad5b73b 5474 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 5475
335f5ae4
JD
5476 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5477 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
5478 (syms_of_nsterm): Remove comment about Panther and above for
5479 ns-antialias-text.
335f5ae4
JD
5480 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5481 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5482 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5483
5484 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5485 MAC_OS_X_VERSION_10_4.
5486
8ad5b73b
JD
5487 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5488 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
5489
5490 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5491
5492 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5493 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5494
3bc0a2f7
JD
5495 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5496 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
5497 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5498 Remove ns_in_resize check.
3bc0a2f7
JD
5499 (ns_clear_frame_area): Remove resize handle code.
5500
5501 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
5502 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5503 Remove ns_in_resize check.
3bc0a2f7 5504
c622b48f
PE
55052012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5506
5507 Improve sys_siglist detection.
5508 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5509 defined as a macro, as is done in Solaris.
5510 (sys_siglist_entries): New macro.
5511 (save_strsignal): Use it.
5512 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5513 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5514
04fafa46
JD
55152012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5516
5517 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5518 fullscreen/Fullscreen.
5519
5520 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5521 tobar_height is new.
5522
5523 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5524 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5525 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5526 (windowDidResize:): Check for correct window if old style fullscreen.
5527 Capitalize word in comment. Remove incorrect comment.
5528 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5529 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5530 error in drawing background.
1f9f395d 5531 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
5532 Set toolbar values to zero, save old height in tobar_height.
5533 Restore tool bar height when leaving fullscreen.
5534 (canBecomeMainWindow): New function.
5535
c6e21c03
PE
55362012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5537
5538 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5539
0d9f584b
EZ
55402012-10-05 Eli Zaretskii <eliz@gnu.org>
5541
a65fbb5f
EZ
5542 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5543
0d9f584b 5544 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
5545 that time stamps of directories could also be changed.
5546 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
5547 FILE_WRITE_ATTRIBUTES access rights.
5548
5549 * fileio.c (Fset_file_times): Special-case ignoring errors for
5550 directories only on MSDOS, not on MS-Windows.
5551
e8757f09 55522012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
5553
5554 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5555
7604f298
EZ
55562012-10-04 Eli Zaretskii <eliz@gnu.org>
5557
5558 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5559 see whether CreateFile failed.
5560
88d69b7d
PE
55612012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5562
5563 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5564 to avoid similar races.
5565 * keyboard.c (pending_signals): Now bool, not int.
5566
7509f454
PE
5567 Port timers to OpenBSD, plus check for timer failures.
5568 OpenBSD problem reported by Han Boetes.
5569 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5570 and/or setitimer.
5571 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5572 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5573 like OpenBSD, which has timer_settime but does not declare it.
5574 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5575 whether to use itimerspec-related primitives. All uses of
5576 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5577
a3c5c0c5
PE
55782012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5579
5580 * profiler.c (handle_profiler_signal): Fix a malloc race
5581 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5582
914e743b
JD
55832012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5584
5585 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5586
d8ab37a8
EZ
55872012-10-02 Eli Zaretskii <eliz@gnu.org>
5588
5589 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5590 consistent with the change in return value of 'safe_strsignal'.
5591
b3ecad33
PE
55922012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5593
0a99eee1
PE
5594 Prefer plain 'static' to 'static inline' (Bug#12541).
5595 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5596 (bidi_set_sor_type, bidi_push_embedding_level)
5597 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5598 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5599 (bidi_cache_search, bidi_cache_ensure_space)
5600 (bidi_cache_iterator_state, bidi_cache_find)
5601 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5602 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5603 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5604 Now 'static', not 'static inline'.
5605
b3ecad33
PE
5606 Count overruns when profiling; change units to ns.
5607 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5608 Give extra weight to samples after overruns, to attempt to count
5609 the time more accurately.
5610 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5611 the underlying primitives nominally do ns.
5612 (Fprofiler_cpu_start): Document the change. Mention that
5613 the sampling intervals are only approximate.
5614
090cf9db
SM
56152012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5616
5617 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5618
5619 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5620 case for the special 0 coding-system.
5621
5622 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5623 (Fmake_overlay): Remove redundant tests.
64edc777 5624 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 5625
81550bf4
JB
56262012-10-02 Juanma Barranquero <lekktu@gmail.com>
5627
5628 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5629 Update dependencies.
5630
aa1ba90e
PE
56312012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5632
5633 Fix a malloc race condition involving strsignal.
5634 A signal can arrive in the middle of a malloc, and Emacs's signal
5635 handler can invoke strsignal, which can invoke malloc, which is
5636 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5637 Fix it by altering the signal handler so that it does not invoke
5638 strsignal.
5639 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5640 * process.c (status_message): Use const pointer, in case strsignal
5641 is #defined to safe_strsignal.
5642 * sysdep.c (sys_siglist, init_signals): Always define and
5643 initialize a substitute sys_siglist if the system does not define
5644 one, even if HAVE_STRSIGNAL.
5645 (safe_strsignal): Rename from strsignal. Always define,
5646 using sys_siglist. Return a const pointer.
5647 * syssignal.h (safe_strsignal): New decl.
5648 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5649
ace917bd
EZ
56502012-10-01 Eli Zaretskii <eliz@gnu.org>
5651
5652 * w32proc.c (timer_loop): Fix code that waits for timer
5653 expiration, to avoid high CPU usage.
5654
9eb71b9c
SM
56552012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5656
5657 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5658 (sweep_weak_table): Remove redundant prototypes.
5659
b3317662
FP
56602012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5661
5662 * emacs.c: Move the inclusion of TERM_HEADER after including
5663 windows.h on WINDOWSNT. This avoids compilation problems with
5664 MSVC.
5665
f0e5f225
EZ
56662012-10-01 Eli Zaretskii <eliz@gnu.org>
5667
2d7d1608
EZ
5668 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5669 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5670 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5671 as the previous version used 'void *'.
5672
5673 * ralloc.c (ROUNDUP): Fix last change.
5674 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5675 'size_t'.
5676
f0e5f225
EZ
5677 * w32proc.c <disable_itimers>: New static flag.
5678 (init_timers): Initialize it to zero, after creating the critical
5679 sections used by the timer threads.
5680 (term_timers): Set to 1 before deleting the critical sections.
5681 (getitimer, setitimer): If disable_itimers is non-zero, return an
5682 error indication without doing anything. Reported by Fabrice
5683 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
5684 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5685 return results.
5686 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5687 support timers.
f0e5f225
EZ
5688
5689 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5690 term_ntproc after all the other bookkeeping, to get timers working
5691 as long as possible.
5692
82ef37c1
PE
56932012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5694
b3a4c387
PE
5695 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5696 Suggested by Juri Linkov in
5697 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5698
b0ab8123
PE
5699 Prefer plain 'static' to 'static inline' (Bug#12541).
5700 With static functions, modern compilers inline pretty well by
5701 themselves; advice from programmers often hurts as much as it helps.
5702 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5703 this change shrinks the text size of the Emacs executable by 1.1%
5704 without affecting CPU significantly in my benchmark.
5705 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5706 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5707 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5708 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5709 (bset_auto_fill_function, bset_auto_save_file_format)
5710 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5711 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5712 (bset_cache_long_line_scans, bset_case_fold_search)
5713 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5714 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5715 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5716 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5717 (bset_header_line_format, bset_indicate_buffer_boundaries)
5718 (bset_indicate_empty_lines, bset_invisibility_spec)
5719 (bset_left_fringe_width, bset_major_mode, bset_mark)
5720 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5721 (bset_name, bset_overwrite_mode, bset_pt_marker)
5722 (bset_right_fringe_width, bset_save_length)
5723 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5724 (bset_scroll_up_aggressively, bset_selective_display)
5725 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5726 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5727 (set_buffer_overlays_after):
5728 * category.c (bset_category_table):
5729 * charset.c (read_hex):
5730 * coding.c (produce_composition, produce_charset)
5731 (handle_composition_annotation, handle_charset_annotation)
5732 (char_encodable_p):
5733 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5734 (assign_row, set_frame_matrix_frame, make_current)
5735 (add_row_entry):
5736 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5737 * fns.c (maybe_resize_hash_table):
5738 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5739 * gmalloc.c (register_heapinfo):
5740 * image.c (lookup_image_type):
5741 * intervals.c (set_interval_object, set_interval_left)
5742 (set_interval_right, copy_interval_parent, rotate_right)
5743 (rotate_left, balance_possible_root_interval):
5744 * keyboard.c (kset_echo_string, kset_kbd_queue)
5745 (kset_keyboard_translate_table, kset_last_prefix_arg)
5746 (kset_last_repeatable_command, kset_local_function_key_map)
5747 (kset_overriding_terminal_local_map, kset_real_last_command)
5748 (kset_system_key_syms, clear_event, set_prop):
5749 * lread.c (digit_to_number):
5750 * marker.c (attach_marker, live_buffer, set_marker_internal):
5751 * nsterm.m (ns_compute_glyph_string_overhangs):
5752 * process.c (pset_buffer, pset_command)
5753 (pset_decode_coding_system, pset_decoding_buf)
5754 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5755 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5756 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5757 * syntax.c (bset_syntax_table, dec_bytepos):
5758 * terminal.c (tset_param_alist):
5759 * textprop.c (interval_has_some_properties)
5760 (interval_has_some_properties_list):
5761 * window.c (wset_combination_limit, wset_dedicated)
5762 (wset_display_table, wset_hchild, wset_left_fringe_width)
5763 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5764 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5765 (wset_right_fringe_width, wset_right_margin_cols)
5766 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5767 (wset_vertical_scroll_bar_type, wset_window_parameters):
5768 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5769 (wset_column_number_displayed, wset_region_showing)
5770 (window_box_edges, run_window_scroll_functions)
5771 (append_glyph_string_lists, prepend_glyph_string_lists)
5772 (append_glyph_string, set_glyph_string_background_width)
5773 (append_glyph, append_composite_glyph)
5774 (take_vertical_position_into_account):
5775 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5776 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5777 (lface_hash, lface_same_font_attributes_p, lookup_face):
5778 * xml.c (libxml2_loaded_p):
5779 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5780 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5781 Now 'static', not 'static inline'.
5782
05584c31
PE
5783 * bidi.c: Tune.
5784 (bidi_copy_it): Do the whole copy with a single memcpy.
5785 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5786
86ec63ba
PE
5787 Revert the FOLLOW-SYMLINKS change for file-attributes.
5788 Doing it right would require several changes to Tramp, and there's
5789 not enough time to get that tested before the freeze today.
5790 * dired.c (directory_files_internal, Ffile_attributes):
5791 Undo last change.
5792
82ef37c1
PE
5793 * frame.c (x_report_frame_params): Port better to wider ints.
5794 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5795 or that pointers can be printed in 15 decimal digits.
5796 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5797
62aba0d4
FP
57982012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5799
5800 Support x64 build on MS-Windows.
5801 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5802 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5803 compatibility with x64.
5e4daaf3 5804 (x_get_focus_frame): Add prototype.
62aba0d4
FP
5805
5806 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5807 defining an XRectangle structure.
5808
5809 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5810 arithmetics for compatibility with x64.
5811
5812 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5813 compatibility with x64.
5814
5815 * w32heap.h: Adjust prototypes and declarations.
5816
5817 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5818 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5819 DWORD, long, and unsigned long, for compatibility with x64.
5820 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5821 (sbrk): Argument is now of type ptrdiff_t.
5822
5823 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5824 less than 0x0500.
5825 (w32_msg_pump): Use WPARAM type for 'result'.
5826
5827 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5828 architecture.
5829 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5830 compatibility with x64.
5831
5832 * vm-limit.c (lim_data): Now size_t.
5833 (check_memory_limits): Adjust prototypes of real_morecore and
5834 __morecore to receive argument of type ptrdiff_t. Use size_t for
5835 five_percent and data_size.
5836
5837 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5838 variables, for compatibility with x64.
5839 (rva_to_section, offset_to_section, relocate_offset)
5840 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5841 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5842 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5843 for compatibility with x64.
5844
5845 * sysdep.c (STDERR_FILENO): Define if not already defined.
5846
5847 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5848 (__morecore): Argument type is now ptrdiff_t.
5849 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5850 (relinquish): Use ptrdiff_t type for 'excess'.
5851 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5852
5853 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5854 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5855 instead of a literal number.
5856
5857 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5858 (min): Define only if not already defined.
5859
5860 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5861 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5862 hosts.
5863
5864 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5865 'bitmaps' is a pointer.
5866
5867 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5868
5869 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5870
e7a2937b
PE
58712012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5874 * dired.c (directory_files_internal, Ffile_attributes):
5875 New arg follow_symlinks. All uses changed.
5876
b43d62ae
SM
58772012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5878
5879 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5880
c06c382a
EZ
58812012-09-30 Eli Zaretskii <eliz@gnu.org>
5882
5883 Support atimers and CPU profiler via profile.c on MS-Windows.
5884 * w32proc.c (sig_mask, crit_sig): New static variables.
5885 (sys_signal): Support SIGALRM and SIGPROF.
5886 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 5887 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
5888 sigfillset, and sigprocmask are no longer no-ops.
5889 (sigismember): New function.
5890 (struct itimer_data): New definition.
5891 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5892 (crit_prof): New static variables.
5893 (MAX_SINGLE_SLEEP): New definition.
5894 (timer_loop, stop_timer_thread, term_timers, init_timers)
5895 (start_timer_thread, getitimer, setitimer): New functions.
5896 (alarm): No longer a no-op, calls setitimer.
5897
5898 * w32.c (term_ntproc): Call term_timers.
5899 (init_ntproc): Make sure all signals are unblocked at startup, to
5900 erase any traces of dumping. Call init_timers.
5901
5902 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5903 Windows-specific code to display the hourglass mouse pointer is no
5904 longer used.
5905 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5906 to hourglass timer expiration.
5907 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5908 Remove, no longer used.
b43d62ae
SM
5909 (w32_note_current_window, show_hourglass, hide_hourglass):
5910 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
5911 window systems.
5912 (syms_of_w32fns): Don't initialize hourglass_timer.
5913
5914 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5915 WINDOWSNT as well.
5916 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5917
5918 * w32.h (init_timers, term_timers): Add prototypes.
5919
95402d5f
KH
59202012-09-30 Kenichi Handa <handa@gnu.org>
5921
5922 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5923 to the buffer relocation which may be caused by ccl_driver.
5924
dd946752
JD
59252012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5926
d7e642cc
JD
5927 * xfns.c (Fx_file_dialog): Update comment.
5928
5929 * w32fns.c (Fx_file_dialog): Update comment.
5930
5931 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5932 Initialize panel name field if OSX >= 10.6.
5933
5934 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5935
dd946752
JD
5936 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5937
5938 * nsterm.m (NEW_STYLE_FS): New define.
5939 (ns_fullscreen_hook, windowWillEnterFullScreen)
5940 (windowDidEnterFullScreen, windowWillExitFullScreen)
5941 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5942 (setFSValue): New functions.
5943 (EmacsFSWindow): New implementation.
5944 (canBecomeKeyWindow): New function for EmacsFSWindow.
5945 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5946 (dealloc): Release nonfs_window if in fullscreen.
5947 (updateFrameSize:): Call windowDidMove to update top/left.
5948 (windowWillResize:toSize:): Check if frame is still maximized.
5949 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5950 next_maximized, maximized_width, maximized_height and nonfs_window.
5951 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5952 tbar_height.
5953 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 5954 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
5955
5956 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5957 (EmacsView): Add variables for fullscreen.
5958 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5959 (EmacsFSWindow): New interface for fullscreen.
5960
427730eb
JB
59612012-09-30 Juanma Barranquero <lekktu@gmail.com>
5962
5963 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5964
48de8b12
CY
59652012-09-30 Chong Yidong <cyd@gnu.org>
5966
5967 * fns.c (Frandom): Doc fix.
5968
5938d519
MR
59692012-09-30 Martin Rudalics <rudalics@gmx.at>
5970
5971 * window.c (Vwindow_combination_limit): New default value.
5972 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5973
cb5b0266
PE
59742012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5975
5976 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5977 Suggested by Eli Zaretskii in
5978 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5979
84f72efd
EZ
59802012-09-30 Eli Zaretskii <eliz@gnu.org>
5981
5982 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5983 HAVE_TIMER_SETTIME is defined.
5984
9d4dcdc9
PE
59852012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5986
d89460ed
PE
5987 Profiler improvements: more-accurate timers, overflow checks.
5988 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5989 signal.h, setjmp.h. Include systime.h instead.
5990 (saturated_add): New function.
5991 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5992 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5993 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5994 New static vars.
84f72efd 5995 (enum profiler_cpu_running): New enum.
d89460ed
PE
5996 (profiler_cpu_running): Now of that enum type, not bool.
5997 All uses changed to store the new value.
5998 (handle_profiler_signal): Rename from sigprof_handler_1,
5999 for consistency with other handlers. Do not check whether
6000 cpu_log is a hash-table if garbage collecting, since it
6001 doesn't matter in that case.
6002 (deliver_profiler_signal): Rename from sigprof_handler,
6003 for consistency with other handlers.
6004 (setup_cpu_timer): New function, with much of what used to be in
6005 Fprofiler_cpu_start. Check for out-of-range argument.
6006 Prefer timer_settime if available, and prefer
6007 thread cputime clocks, then process cputime clocks, then
6008 monotonic clocks, to the old realtime clock. Use make_timeval
6009 to round more-correctly when falling back to setitimer.
6010 (Fprofiler_cpu_start): Use it.
6011 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6012 Don't assume that passing NULL as the 2nd argument of setitimer
6013 is the same as passing a pointer to all-zero storage.
6014 Ignore SIGPROF afterwards.
6015 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6016 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6017 non-fatal signal handlers. Ignore SIGPROF on startup.
6018 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6019 in profiler.c, since sysdep.c now uses it.
6020
9d4dcdc9
PE
6021 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6022 Suggested by Eli Zaretskii in
6023 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6024
8e5691a0
JB
60252012-09-29 Juanma Barranquero <lekktu@gmail.com>
6026
6027 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6028
e7c1b6ef
SM
60292012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6030
6031 * lisp.h (struct backtrace): Remove indirection for `function' field.
6032 * xdisp.c (redisplay_internal):
6033 * profiler.c (record_backtrace, sigprof_handler_1):
6034 * alloc.c (Fgarbage_collect):
6035 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6036 (Fbacktrace_frame): Adjust accordingly.
6037
e61d39cd 60382012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
6039
6040 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6041 (Frun_hook_with_args_until_failure): Doc fixes.
6042
404043ea
EZ
60432012-09-28 Eli Zaretskii <eliz@gnu.org>
6044
6045 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6046 Qautomatic_redisplay and change the symbol name. All users changed.
6047
704d3f45
TM
60482012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6049
6050 * profiler.c (sigprof_handler): Fix race condition.
6051
757140ff
GM
60522012-09-28 Glenn Morris <rgm@gnu.org>
6053
6054 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6055
a615a3ae
PE
60562012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6057
6058 Check more robustly for timer_settime.
89d17fd0
PE
6059 * Makefile.in (LIB_TIMER_TIME): New macro.
6060 (LIBES): Add it.
a615a3ae
PE
6061 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6062 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6063 call timer_settime.
6064
3670daf7
TM
60652012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6066
6067 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6068
6a586b7f
JB
60692012-09-26 Juanma Barranquero <lekktu@gmail.com>
6070
6071 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6072
41c8bfcf
PE
60732012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6074
6075 * character.h (MAYBE_UNIFY_CHAR): Remove.
6076 * charset.c, charset.h (maybe_unify_char): Now static.
6077 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6078 Since this stuff is now private to charset.c, there's no need for
6079 a public macro and no need to inline by hand.
6080
3a880af4 60812012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
908589fd
AS
6082 Stefan Monnier <monnier@iro.umontreal.ca>
6083 Juanma Barranquero <lekktu@gmail.com>
611b7507 6084
3a880af4
SM
6085 * profiler.c: New file.
6086 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
6087 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6088 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
6089 * emacs.c (main): Call syms_of_profiler.
6090 * alloc.c (Qautomatic_gc): New constant.
6091 (MALLOC_PROBE): New macro.
6092 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6093 (total_bytes_of_live_objects): New function.
6094 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6095 Call malloc_probe for the memory profiler.
6096 (syms_of_alloc): Define Qautomatic_gc.
6097 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6098 race condition.
6099 (struct backtrace): Move definition...
6100 * lisp.h (struct backtrace): ..here.
6101 (Qautomatic_gc, profiler_memory_running): Declare vars.
6102 (malloc_probe, syms_of_profiler): Declare functions.
6103 * xdisp.c (Qautomatic_redisplay): New constant.
6104 (redisplay_internal): Record itself in backtrace_list.
6105 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 6106
5938d519 61072012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
61082012-09-25 Juanma Barranquero <lekktu@gmail.com>
6109
6110 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6111
e26fd2e4
PE
61122012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6113
6114 Prefer POSIX timers if available.
6115 They avoid a race if the timer is too close to the current time.
6116 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6117 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 6118 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 6119
eedec3ee
EZ
61202012-09-25 Eli Zaretskii <eliz@gnu.org>
6121
6122 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6123 CHAR_STRING_ADVANCE.
6124 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6125 STRING_CHAR_ADVANCE.
6126
aa15c6bb
JB
61272012-09-25 Juanma Barranquero <lekktu@gmail.com>
6128
6129 Move Vlibrary_cache to emacs.c and reset before dumping.
6130
6131 * lisp.h (reset_image_types): Declare.
6132 [WINDOWSNT] (Vlibrary_cache): Declare.
6133
6134 * image.c (reset_image_types): New function.
6135
6136 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6137 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6138 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6139
6140 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6141 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6142
6143 * w32.h (Vlibrary_cache): Do not declare.
6144
54d629be
EZ
61452012-09-25 Eli Zaretskii <eliz@gnu.org>
6146
16b22fef
EZ
6147 * w32proc.c (sys_signal): Handle all signals defined by the
6148 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6149 handlers for signals supported by Windows. Don't override
6150 term_ntproc as the handler for SIGABRT.
6151 (sigaction): Rewrite to call sys_signal instead of duplicating its
6152 code.
6153 (sys_kill): Improve commentary.
6154
6155 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6156 consistency with a signature of a signal handler. All callers
6157 changed.
6158 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6159 install term_ntproc as a signal handler for SIGABRT, as that
6160 should be done by the dumped Emacs.
6161
6162 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6163
6164 * w32select.c (term_w32select): Protect against repeated
6165 invocation by setting clipboard_owner to NULL after calling
6166 DestroyWindow.
6167
6168 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6169 and term_ntproc to their modified signatures.
6170
54d629be
EZ
6171 * character.c (char_string, string_char): Remove calls to
6172 MAYBE_UNIFY_CHAR. See the discussion starting at
6173 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6174 for the details.
6175
59f7af81
CY
61762012-09-25 Chong Yidong <cyd@gnu.org>
6177
6178 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6179
22e8cf4a
SM
61802012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6181
6182 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6183 when encountering an unknown bytecode.
6184
578098f3
PE
61852012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6186
6187 image.c, indent.c: Use bool for booleans.
6188 * dispextern.h (struct image_type): Members valid_p, load, init
6189 now return bool, not int. All uses changed.
6190 * image.c: Omit unnecessary static decls.
6191 (x_create_bitmap_mask, x_build_heuristic_mask):
6192 Return void, not int, since callers don't care about the return value.
6193 (x_create_bitmap_mask, define_image_type, valid_image_p)
6194 (struct image_keyword, parse_image_spec, image_spec_value)
6195 (check_image_size, image_background)
6196 (image_background_transparent, x_clear_image_1)
6197 (postprocess_image, lookup_image, x_check_image_size)
6198 (x_create_x_image_and_pixmap, xbm_image_p)
6199 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6200 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6201 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6202 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6203 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6204 (png_image_p, init_png_functions, png_load_body, png_load)
6205 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6206 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6207 (init_gif_functions, gif_load, imagemagick_image_p)
6208 (imagemagick_load_image, imagemagick_load, svg_image_p)
6209 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6210 (gs_load):
6211 * nsimage.m (ns_load_image):
6212 * nsterm.m (ns_defined_color):
6213 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6214 * xfns.c (x_defined_color):
6215 * xterm.c (x_alloc_lighter_color_for_widget)
6216 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6217 (x_alloc_lighter_color):
6218 * indent.c (disptab_matches_widthtab, current_column)
6219 (scan_for_column, string_display_width, indented_beyond_p)
6220 (compute_motion, vmotion, Fvertical_motion):
6221 Use bool for booleans.
6222
a5f2b6ec
CY
62232012-09-24 Chong Yidong <cyd@gnu.org>
6224
6225 * chartab.c (Fset_char_table_default): Obsolete function removed.
6226
18e27ea8
PE
62272012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6228
afea8a8a
PE
6229 Move pid_t related decls out of lisp.h.
6230 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6231 (interruptible_wait_for_termination):
6232 Move these decls from lisp.h to syswait.h, since they use pid_t.
6233 Needed on FreeBSD; see Herbert J. Skuhra in
6234 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6235 * callproc.c: Include syswait.h.
6236
18e27ea8
PE
6237 gnutls.c, gtkutil.c: Use bool for boolean.
6238 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6239 (emacs_gnutls_handle_error):
6240 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6241 (xg_hide_tooltip, xg_create_frame_widgets)
6242 (create_dialog, xg_uses_old_file_dialog)
6243 (xg_get_file_with_chooser, xg_get_file_with_selection)
6244 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6245 (xg_item_label_same_p, xg_update_menubar)
6246 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6247 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6248 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6249 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6250 (update_frame_tool_bar, free_frame_tool_bar):
6251 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6252 * nsmenu.m (ns_update_menubar):
6253 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6254 * xfns.c (Fx_show_tip) [USE_GTK]:
6255 Use bool for boolean.
6256 * gtkutil.c (xg_update_frame_menubar):
6257 * xmenu.c (update_frame_menubar):
6258 Return void, not int, since caller ignores return value.
6259 * gtkutil.c (xg_change_toolbar_position):
6260 Return void, not 1.
6261
af0e9f75
JB
62622012-09-23 Juanma Barranquero <lekktu@gmail.com>
6263
6264 * makefile.w32-in (BLOCKINPUT_H): Remove.
6265 (SYSSIGNAL_H): New macro.
6266 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6267 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6268 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6269 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6270 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6271 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6272 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6273 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6274 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6275 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6276 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6277 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6278 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6279 ($(BLD)/w32xfns.$(O)): Update dependencies.
6280
5101529e
EZ
62812012-09-23 Eli Zaretskii <eliz@gnu.org>
6282
6283 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6284 fatal_error_backtrace.
6285
6286 * w32proc.c (sys_kill): Undo last change: don't do anything when
6287 invoked to deliver SIGABRT to our own process. This is now
6288 handled by emacs_raise.
6289
2c3ee0ad
JB
62902012-09-23 Juanma Barranquero <lekktu@gmail.com>
6291
6292 * w32term.c (w32_read_socket): Remove leftover reference to
6293 interrupt_input_pending.
6294
62a1d661
PE
62952012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6296
6297 Do not use SA_NODEFER.
6298 Problem reported by Dani Moncayo in
6299 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6300 * alloc.c (die):
6301 * sysdep.c (emacs_abort): Do not reset signal handler.
6302 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6303 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6304 wanted even on POSIXish hosts, and it doesn't work on Windows.
6305
a0942b9a
JD
63062012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6307
6308 * xterm.c (x_term_init): Call fixup_locale before and after calling
6309 gtk_init (Bug#12392).
6310
d07ff9db
CY
63112012-09-23 Chong Yidong <cyd@gnu.org>
6312
6313 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6314 Vdynamic_library_alist.
6315
6316 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6317 (Fgnutls_available_p): Caller changed.
6318
6319 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6320 (Flibxml_parse_xml_region): Likewise.
6321
6322 * dispextern.h (struct image_type): Remove arg from init function.
6323
6324 * image.c (Finit_image_library, lookup_image_type)
6325 (define_image_type): Remove now-unneeded second arg.
6326 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6327 (init_tiff_functions, init_gif_functions, init_svg_functions):
6328 Arglist and w32_delayed_load calling convention changed.
6329 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 6330 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 6331
4d7e6e51
PE
63322012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6333
6334 Simplify and avoid signal-handling races (Bug#12471).
6335 * alloc.c (die):
6336 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6337 Avoid recursive loop if there's a fatal error in the function itself.
6338 * atimer.c (pending_atimers):
6339 * blockinput.h: Don't include "atimer.h"; no longer needed.
6340 (interrupt_input_pending): Remove. All uses removed.
6341 pending_signals now counts both atimers and ordinary interrupts.
6342 This is less racy than having three separate pending-signal flags.
6343 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6344 (input_blocked_p):
6345 Rename from their upper-case counterparts BLOCK_INPUT,
6346 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6347 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6348 This makes it easier to access volatile variables more accurately.
6349 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6350 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6351 that's more reliable if the code is buggy and sets
6352 interrupt_input_blocked to a negative value. All uses changed.
6353 * atimer.c (deliver_alarm_signal):
6354 Remove. No need to deliver this to the parent; any thread can
6355 handle this signal now. All uses replaced by underlying handler.
6356 * atimer.c (turn_on_atimers):
6357 * dispnew.c (handle_window_change_signal):
6358 * emacs.c (handle_danger_signal):
6359 * keyboard.c (kbd_buffer_get_event):
6360 Don't reestablish signal handler; not needed with sigaction.
6361 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6362 (UNBLOCK_INPUT_TO):
6363 Rework to avoid unnecessary accesses to volatile variables.
6364 (UNBLOCK_INPUT_TO): Now a function.
6365 (totally_unblock_input, unblock_input): New decls.
6366 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6367 (init_data): Remove. Necessary stuff now done in init_signal.
6368 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6369 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6370 (fatal_error_code): Remove; no longer needed.
6371 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6372 it doesn't always backtrace. All uses changed. No need to reset
6373 signal to default, since sigaction and/or die does that for us now.
6374 Use emacs_raise (FOO), not kill (getpid (), FOO).
6375 (main): Check more-accurately whether we're dumping.
6376 Move fatal-error setup to sysdep.c
6377 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6378 * gtkutil.c (xg_get_file_name, xg_get_font):
6379 Remove no-longer-needed signal-mask manipulation.
6380 * keyboard.c, process.c (POLL_FOR_INPUT):
6381 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6382 * keyboard.c (read_avail_input): Remove.
6383 All uses replaced by gobble_input.
6384 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6385 (kbd_buffer_store_event_hold, gobble_input):
6386 (record_asynch_buffer_change) [USABLE_SIGIO]:
6387 (store_user_signal_events):
6388 No need to mess with signal mask.
6389 (gobble_input): If blocking input and there are terminals, simply
6390 set pending_signals to 1 and return. All hooks changed to not
6391 worry about whether input is blocked.
6392 (process_pending_signals): Clear pending_signals before processing
6393 them, in case a signal comes in while we're processing.
6394 By convention callers now test pending_signals before calling us.
6395 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6396 New functions, to support changes to blockinput.h.
6397 (handle_input_available_signal): Now extern.
6398 (reinvoke_input_signal): Remove. All uses replaced by
6399 handle_async_input.
6400 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
6401 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6402 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
6403 Clear sigmask reliably, even if Fsignal returns, which it can.
6404 Omit unnecessary accesses to volatile var.
6405 (quit_throw_to_read_char): No need to restore sigmask.
6406 * keyboard.c (gobble_input, handle_user_signal):
6407 * process.c (wait_reading_process_output):
6408 Call signal-handling code rather than killing ourselves.
6409 * lisp.h: Include <float.h>, for...
6410 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6411 (pending_signals): Now volatile.
6412 (syms_of_data): Now const if IEEE floating point.
6413 (handle_input_available_signal) [USABLE_SIGIO]:
6414 (terminate_due_to_signal, record_child_status_change): New decls.
6415 * process.c (create_process): Avoid disaster if memory is exhausted
6416 while we're processing a vfork, by tightening the critical section
6417 around the vfork.
6418 (send_process_frame, process_sent_to, handle_pipe_signal)
6419 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6420 ignores SIGPIPE.
6421 (send_process): No need for setjmp/longjmp any more, since the
6422 SIGPIPE stuff is now gone. Instead, report an error if errno
6423 is EPIPE.
6424 (record_child_status_change): Now extern. PID and W are now args.
6425 Return void, not bool. All callers changed.
6426 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6427 Remove. All uses removed. This bug should be fixed now in a
6428 different way.
6429 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6430 and record the child status change directly. This avoids the
6431 need to futz with the signal mask.
6432 (process_fatal_action): Move here from emacs.c.
6433 (emacs_sigaction_flags): New function, containing
6434 much of what used to be in emacs_sigaction_init.
6435 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6436 caught by emacs, to make races less likely.
6437 (deliver_process_signal): Rename from handle_on_main_thread.
6438 All uses changed.
6439 (BACKTRACE_LIMIT_MAX): Now at top level.
6440 (thread_backtrace_buffer, threadback_backtrace_pointers):
6441 New static vars.
6442 (deliver_thread_signal, deliver_fatal_thread_signal):
6443 New functions, for more-accurate delivery of thread-specific signals.
6444 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6445 (deliver_arith_signal): Handle in this thread, not
6446 in the main thread, since it's triggered by this thread.
6447 (maybe_fatal_sig): New function.
6448 (init_signals): New arg DUMPING so that we can be more accurate
6449 about whether we're dumping. Caller changed.
6450 Treat thread-specific signals differently from process-general signals.
6451 Block all signals while handling fatal error; that's safer.
6452 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6453 on IEEE hosts.
6454 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6455 Ignore SIGPIPE unless batch.
6456 (emacs_backtrace): Output backtrace for the appropriate thread,
6457 which is not necessarily the main thread.
6458 * syssignal.h: Include <stdbool.h>.
6459 (emacs_raise): New macro.
6460 * xterm.c (x_connection_signal): Remove; no longer needed
6461 now that we use sigaction.
6462 (x_connection_closed): No need to mess with sigmask now.
6463 (x_initialize): No need to reset SIGPIPE handler here, since
6464 init_signals does this for us now.
6465
8f4635e9
JD
64662012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6467
6468 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 6469 background rect may be larger (Bug#12245).
8f4635e9 6470
3296976d
CY
64712012-09-23 Chong Yidong <cyd@gnu.org>
6472
6473 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6474
d41e491e
PE
64752012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6476
6477 * .gdbinit: Just stop at fatal_error_backtrace.
6478 See Stefan Monnier's request in
6479 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6480 Remove no-longer-used query of system type.
6481
c88b867f
CY
64822012-09-22 Chong Yidong <cyd@gnu.org>
6483
6484 * search.c (Freplace_match): Doc fix (Bug#12325).
6485
6486 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6487
6488 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6489 (Fline_end_position): Doc fix.
6490
6491 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6492
bb4d86b4
CY
64932012-09-22 Chong Yidong <cyd@gnu.org>
6494
6495 * dispextern.h (struct image_type): Add new slot, storing a type
6496 initialization function.
6497
6498 * image.c (define_image_type): Call the image initializer function
6499 if it is defined. Arguments and return value changed.
6500 (valid_image_p, make_image): Callers changed.
6501 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
6502 (gif_type, imagemagick_type, svg_type, gs_type):
6503 Add initialization functions.
bb4d86b4
CY
6504 (Finit_image_library): Call lookup_image_type.
6505 (CHECK_LIB_AVAILABLE): Macro deleted.
6506 (lookup_image_type): Call define_image_type here, rather than via
6507 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6508 (syms_of_image): Move define_image_type calls for xbm_type and
6509 pbm_type to lookup_image_type.
6510
df9685f3
EZ
65112012-09-22 Eli Zaretskii <eliz@gnu.org>
6512
6513 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6514 'idle_timers' from here ...
6515 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6516 lists, to avoid infloops when the timer does something stupid,
6517 like reinvoke itself with the same or smaller time-out.
6518 (Bug#12447)
6519
8e17c9ba
MR
65202012-09-22 Martin Rudalics <rudalics@gmx.at>
6521
6522 * window.c (Fsplit_window_internal): Handle only Qt value of
6523 Vwindow_combination_limit separately.
6524 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
6525 (Vwindow_combination_limit): New default value.
6526 Rewrite doc-string.
8e17c9ba 6527
589bd69b
EZ
65282012-09-22 Eli Zaretskii <eliz@gnu.org>
6529
6530 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6531 the new overlay string. (Bug#10159)
6532
01108e3f
PE
65332012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6534
6535 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6536 or that fprintf is async-signal-safe. POSIX doesn't require
6537 either assumption.
6538
82f8cd94
CY
65392012-09-22 Chong Yidong <cyd@gnu.org>
6540
6541 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6542 (Bug#8207).
6543
3cccbd87
KH
65442012-09-22 Kenichi Handa <handa@gnu.org>
6545
6546 * composite.c (composition_reseat_it): Handle the case that a
6547 grapheme cluster is not covered by a single font (Bug#12352).
6548
09c01941
CY
65492012-09-21 Chong Yidong <cyd@gnu.org>
6550
6551 * image.c (define_image_type): Avoid adding duplicate types to
6552 image_types (Bug#12463). Suggested by Jörg Walter.
6553
acfa068f 65542012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
6555
6556 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6557 (print_load_command_name): Add case LC_DATA_IN_CODE.
6558 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6559
acfa068f 65602012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
6561
6562 * eval.c (Frun_hook_with_args_until_success)
6563 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6564
acfa068f 65652012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
6566
6567 * fileio.c (Ffile_selinux_context): Only call freecon when
6568 lgetfilecon succeeded.
6569 (Fset_file_selinux_context): Likewise. (Bug#12444)
6570
acfa068f 65712012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
6572
6573 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6574 reordering, locate the cursor by calling set_cursor_from_row; if
6575 that fails, clear the desired glyph matrix before returning a
6576 failure indication to the caller. Fixes leaving garbled display
6577 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
6578 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6579 scrolling through multibyte text.
aa36e4d2 6580
e99f70c8
SM
65812012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6582
6583 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6584 calling mark_vectorlike since that's the one that marks the window.
6585 (mark_discard_killed_buffers): Mark the final cdr.
6586 * window.h (struct window): Move prev/next_buffers to the
6587 non-standard fields.
6588 * window.c (make_window): Initialize prev/next_buffers manually.
6589
f75beb47
PE
65902012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6591
6592 Omit unused arg EXPECTED from socket hooks.
6593 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6594 * nsterm.m (ns_term_init):
6595 * termhooks.h (struct terminal.read_socket_hook):
6596 * w32inevt.c (w32_console_read_socket):
6597 * w32term.c (w32_read_socket):
6598 * xterm.c (XTread_socket):
6599 Omit unused arg EXPECTED. All callers changed.
6600 (store_user_signal_events): Return void, not int, since callers no
6601 longer care about the return value. All uses changed.
6602
b019b76a
JB
66032012-09-20 Juanma Barranquero <lekktu@gmail.com>
6604
6605 * w32gui.h (XParseGeometry): Do not declare.
6606
05642592
PE
66072012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6608
e4bce92a 6609 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 6610 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
6611 <http://bugs.gnu.org/12471#8> (last line).
6612
05642592
PE
6613 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6614 (XParseGeometry): Now static. Substitute extremal values for
6615 values that are out of range.
6616
e543ae91
JD
66172012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6618
6619 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6620
6621 * nsfns.m (XParseGeometry): Remove.
6622 (Fx_create_frame): Call x_set_offset to correctly interpret
6623 top_pos in geometry.
6624
3a880af4 6625 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
6626 (Fx_parse_geometry): If there is a space in string, call
6627 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6628
45ba16c7
EZ
66292012-09-17 Eli Zaretskii <eliz@gnu.org>
6630
c8b9f1bc
EZ
6631 * search.c (scan_buffer): Use character positions in calls to
6632 region_cache_forward and region_cache_backward, not byte
6633 positions. (Bug#12196)
6634
b4c932a2
EZ
6635 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6636 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6637
45ba16c7
EZ
6638 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6639 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6640 emacs_blocked_malloc, now deleted.
6641
eeceac93
PE
66422012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6643
6644 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6645 The workaround was for improving performance on Solaris 2.4, but
6646 is getting in the way now. Emacs will still work if someone is
6647 still running Solaris 2.4 in a museum somewhere; Sun dropped
6648 support for Solaris 2.4 in 2003.
6649 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6650 * process.c (create_process) [HAVE_WORKING_VFORK]:
6651 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6652 since Emacs no longer uses vfork on that platform.
6653
78f83752
GM
66542012-09-17 Glenn Morris <rgm@gnu.org>
6655
6656 * emacs.c: Use COPYRIGHT.
6657
634b8cac
PE
66582012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6659
0caaedb1
PE
6660 Remove configure's --without-sync-input option (Bug#12450).
6661 When auditing signal-handling in preparation for cleaning it up,
6662 I found that SYNC_INPUT has race conditions and would be a real
6663 pain to fix. Since it's an undocumented and deprecated
6664 configure-time option, now seems like a good time to remove it.
6665 Also see <http://bugs.gnu.org/11080#16>.
6666 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6667 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6668 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6669 (malloc_hysteresis):
6670 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6671 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6672 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6673 (dont_register_blocks, bytes_used_when_reconsidered)
6674 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6675 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6676 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 6677 Remove. All uses removed.
0caaedb1
PE
6678 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6679 implementation, one that depends on whether the new macro
6680 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6681 is defined.
6682 * atimer.c (run_timers, handle_alarm_signal):
6683 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6684 (handle_async_input, process_pending_signals)
6685 (handle_input_available_signal, init_keyboard):
6686 * nsterm.m (ns_read_socket):
6687 * process.c (wait_reading_process_output):
6688 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6689 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6690 (emacs_write):
6691 * xterm.c (XTread_socket):
6692 Assume SYNC_INPUT.
6693 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6694 * eval.c (handling_signal): Remove. All uses removed.
6695 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6696 All uses replaced with the SYNC_INPUT version.
6697 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6698 Remove decls.
6699 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6700 Now static.
6701
634b8cac
PE
6702 * font.c (Ffont_shape_gstring): Remove unused local.
6703
83da1b55
GM
67042012-09-16 Glenn Morris <rgm@gnu.org>
6705
518650a5
GM
6706 * Makefile.in (clean): No longer run nextstep's clean.
6707
83da1b55
GM
6708 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6709 (ns_frag): Remove.
6710 (ns-app): Move here from ns.mk, and simplify.
6711 (clean): Simplify nextstep entry.
6712 * ns.mk: Remove file.
6713
85a43e2e
KH
67142012-09-17 Kenichi Handa <handa@gnu.org>
6715
6716 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6717 not covert the last few charactes.
6718
ba13e616 67192012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
6720
6721 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6722 here, but just check the validity of glyphs in the glyph-string.
6723
a8c729af
MR
67242012-09-16 Martin Rudalics <rudalics@gmx.at>
6725
3a880af4
SM
6726 * window.c (Fwindow_parameter, Fset_window_parameter):
6727 Accept any window as argument (Bug#12452).
a8c729af 6728
c077c059
JD
67292012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6730
6731 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6732 to ns_term_init to avoid memory leak.
6733
6734 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6735 explicit retain/release.
6736 (ns_term_init): Only allow one display. Initialize outerpool and
6737 ns_*_types.
6738
39a57ad0
PE
67392012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6740
6741 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6742 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6743 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6744 the Microsoft problem in a different way, by altering ../nt/config.nt.
6745
7105c8cb
EZ
67462012-09-15 Eli Zaretskii <eliz@gnu.org>
6747
6748 * w32xfns.c:
6749 * w32uniscribe.c:
6750 * w32term.c:
6751 * w32select.c:
6752 * w32reg.c:
6753 * w32proc.c:
6754 * w32menu.c:
6755 * w32inevt.c:
6756 * w32heap.c:
6757 * w32font.c:
6758 * w32fns.c:
6759 * w32console.c:
6760 * w32.c:
6761 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6762 by lisp.h. This completes removal of setjmp.h inclusion
6763 erroneously announced in the previous commit. (Bug#12446)
6764
6765 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6766 more accurate.
6767
6768 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6769 not defined as a macro. The latter happens on MS-Windows.
6770 (Bug#12446)
6771
0328b6de
PE
67722012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6773
6774 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6775 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 6776 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
6777 only reason for the instance was because "lisp.h" was included.
6778 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6779 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6780 and _longjmp with the new symbols. Emacs already uses _setjmp if
6781 available, so this change affects only POSIXish hosts that have
6782 sigsetjmp but not _setjmp, such as some versions of Solaris and
6783 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6784 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6785 (png_load_body) [HAVE_PNG]:
6786 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6787 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6788 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6789 since PNG requires jmp_buf. This is the only exception to the
6790 general rule that we now use sys_setjmp and sys_longjmp.
6791 This exception is OK since this code does not change the signal
6792 mask or longjmp out of a signal handler.
6793
2af03429
PE
67942012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6795
6796 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6797 Include "syssignal.h", for 'main_thread'.
6798
2f294edf
DA
67992012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6800
6801 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
6802 * insdel.c (replace_range, replace_range_2):
6803 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
6804 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6805 Remove redundant check before calling offset_intervals.
6806
6b533e9c
MR
68072012-09-14 Martin Rudalics <rudalics@gmx.at>
6808
6809 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6810 current buffer (Bug#12387).
6811
2a7931e3
JB
68122012-09-14 Juanma Barranquero <lekktu@gmail.com>
6813
6814 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6815
c18e885b
PE
68162012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6817
6818 Use a more backwards-compatible timer format (Bug#12430).
6819 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6820 vector element, not from the 4th, since PSECS is now at the end.
6821 (Fcurrent_idle_time): Doc fix.
6822
d59a1afb
DA
68232012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6824
6825 Function to mark objects and remove killed buffers at once.
6826 * alloc.c (discard_killed_buffers): Rename to ...
6827 (mark_discard_killed buffers) ... new name. Add marking
6828 of remaining objects. Fix comment. Adjust users.
6829 (mark_object): Do not touch frame buffer lists here.
6830 * frame.c (delete_frame): Reset frame buffer lists here.
6831
5f0cb45a
PE
68322012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6833
8ea47e3a
PE
6834 Better workaround for GNOME bug when --enable-gcc-warnings.
6835 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6836 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6837 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6838
4a4bbad2
PE
6839 Simplify SIGIO usage (Bug#12408).
6840 The code that dealt with SIGIO was crufty and confusing, e.g., it
6841 played tricks like "#undef SIGIO" but these tricks were not used
6842 consistently. Simplify mostly by not #undeffing standard symbols,
6843 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6844 or not as we please) rather than "defined SIGIO" (standard symbol
6845 that we probably shouldn't #undef).
6846 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6847 Modules that need it can include it.
6848 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6849 * dispextern.h (ignore_sigio): New decl.
6850 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6851 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6852 * emacs.c (shut_down_emacs):
6853 * keyboard.c (kbd_buffer_store_event_hold):
6854 Use ignore_sigio rather than invoking 'signal' directly.
6855 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6856 for FIONREAD.
6857 (FIONREAD, SIGIO): Do not #undef.
6858 (tty_read_avail_input): Use #error rather than a syntax error.
6859 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6860 for I_PIPE, used by SETUP_SLAVE_PTY.
6861 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6862 * sysdep.c (croak): Remove; no longer needed. This bit of
6863 temporary code, with Fred N. Fish's comment that it's temporary,
6864 has been in Emacs since at least 1992!
6865 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6866 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6867 * syssignal.h (croak): Remove decl.
6868 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6869 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6870 now that we're termios-only.
6871 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6872 * term.c (dissociate_if_controlling_tty): Use #error rather than
6873 a run-time error.
6874
5f0cb45a
PE
6875 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6876 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6877 to work around GNOME bug 683906.
6878 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6879 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6880 This works around GCC bug 54561.
6881
40bce90b
PE
68822012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6883
6884 More fixes for 'volatile' and setjmp/longjmp.
6885 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6886 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6887 (png_load_body) [HAVE_PNG]:
6888 (jpeg_load_body) [HAVE_JPEG]:
6889 New function, with most of the old parent function's body.
6890 (png_load) [HAVE_PNG]:
6891 (jpeg_load) [HAVE_JPEG]:
6892 Invoke the new function, to avoid longjmp munging our locals.
6893 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6894 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6895 longjmp is passed 2, as the C standard doesn't guarantee this.
6896 Instead, store the failure code into mgr->failure_code.
6897
bfeae2cf
SM
68982012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6899
6900 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6901 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6902 (syms_of_keyboard): Remove support for unread-command-char.
6903
8099e36b
EZ
69042012-09-12 Eli Zaretskii <eliz@gnu.org>
6905
6906 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6907 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6908 violation. (Bug#12426)
6909
92547ff9
PE
69102012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6911
6912 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6913
45b82ad0
SM
69142012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6915
6916 * eval.c: Add `inhibit-debugger'.
6917 (Qinhibit_debugger): New symbol.
6918 (call_debugger): Bind it instead of Qdebug_on_error.
6919 (maybe_call_debugger): Test Vinhibit_debugger.
6920 (syms_of_eval): Define inhibit-debugger.
6921 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6922 (syms_of_xdisp): Remove inhibit-debug-on-message.
6923
5779a1dc
PE
69242012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6925
50f2e553
PE
6926 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6927 If a nonvolatile local variable is written before a _longjmp to
6928 the frame containing the variable, and is read after the _longjmp,
6929 the value read is indeterminate. Some local variables of type
6930 'struct handler' and 'struct catchtag' are used in this way, so
6931 mark each of their slots as volatile if the slot can be set before
6932 _longjmp and read afterwards.
6933 * lisp.h (struct handler): var and chosen_clause are now volatile.
6934 (struct catchtag): val, next, and pdlcount are now volatile.
6935
ae1d87e2
PE
6936 * bidi.c (bidi_push_it, bidi_pop_it):
6937 * fns.c (copy_hash_table):
6938 * image.c (define_image_type):
6939 * keyboard.c (kbd_buffer_store_event_hold):
6940 * process.c (Fprocess_send_eof):
6941 * xfaces.c (x_create_gc) [HAVE_NS]:
6942 * xgselect.c (xg_select):
6943 Prefer assignment to memcpy when either will do.
6944
5779a1dc
PE
6945 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6946 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6947 time an item is removed. No need to mark this function 'inline';
6948 the compiler knows better than we do.
6949
c4c9756b
JD
69502012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6951
6952 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6953 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6954 to change_frame_size (Bug#12388).
6955 (windowDidResize:): Pass YES to updateFrameSize.
6956
6957 * nsterm.h: Add delay parameter to updateFrameSize.
6958
d73e321c
DA
69592012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6960
6961 Discard killed buffers from deleted window and frame objects.
6962 This reduces an amount of references to killed buffers and
6963 helps GC to reclaim them faster.
6964 * alloc.c (discard_killed_buffers): New function.
6965 (mark_object): Use it for deleted windows and frames.
6966 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 6967 or deleted frame, restore its global binding.
d73e321c
DA
6968 * data.c (swap_in_global_binding): Add GC notice.
6969 (swap_in_symval_forwarding): Use convenient set_blv_where.
6970 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6971 * window.h: ... to here.
6972
e578f381
DA
69732012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6974
6975 Convenient macro to check whether the buffer is live.
6976 * buffer.h (BUFFER_LIVE_P): New macro.
6977 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6978 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6979
3057e615
YM
69802012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6981
6982 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6983 composition cases (Bug#12364).
6984
6985 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6986 overhang of succeeding glyphs overlapping box cursor.
6987
6988 * w32term.c (x_draw_glyph_string): Likewise.
6989
6fda35f2
PE
69902012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6991
c990426a
PE
6992 Simplify, document, and port floating-point (Bug#12381).
6993 The porting part of this patch fixes bugs on non-IEEE platforms
6994 with frexp, ldexp, logb.
6995 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6996 Now static.
6997 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6998 support, by removing commented-out code and briefly listing the
6999 C89 functions excluded. The commented-out stuff was confusing
7000 maintenance, e.g., we thought we needed cbrt but it was commented out.
7001 (logb): Remove decl; no longer needed.
7002 (isfinite): New macro, if not already supplied.
7003 (isnan): Don't replace any existing macro.
7004 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7005 are present on all C89 platforms.
7006 (Ffrexp): Do not special-case zero, as frexp does the right thing
7007 for that case.
7008 (Flogb): Do not use logb, as it doesn't have the desired meaning
7009 on hosts that use non-base-2 floating point. Instead, stick with
7010 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7011 frexp, to avoid getting an unspecified result.
7012
6fda35f2
PE
7013 * xdisp.c (Qinhibit_debug_on_message): Now static.
7014
16130a58
JD
70152012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7016
7017 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7018 NSBezierPath (Bug#12131).
7019
d105a573
CY
70202012-09-10 Chong Yidong <cyd@gnu.org>
7021
7022 * fns.c (Fdelq, Fdelete): Doc fix.
7023
ff55dfe8
PE
70242012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7025
7026 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7027 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7028
e7032e7c
SM
70292012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7030
7031 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7032 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7033 Use it.
7034
e9957956
EZ
70352012-09-09 Eli Zaretskii <eliz@gnu.org>
7036
aba05ce9
EZ
7037 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7038 left fringe if the window has a left margin. This avoids leaving
7039 traces of the cursor because its leftmost pixel is not drawn over.
7040
e9957956
EZ
7041 * dispnew.c (update_window_line): When the left margin area of a
7042 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7043 that screen line. (Bug#12277)
7044
f6196b87
PE
70452012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7046
7047 Assume C89 or later for math functions (Bug#12381).
7048 This simplifies the code, and makes it a bit smaller and faster,
7049 and (most important) makes it easier to clean up signal handling
7050 since we can stop worring about floating-point exceptions in
7051 library code. That was a problem before C89, but the problem
7052 went away many years ago on all practical Emacs targets.
7053 * data.c, image.c, lread.c, print.c:
7054 Don't include <math.h>; no longer needed.
7055 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7056 might be autoconfigured, as that never happens.
7057 * data.c (fmod):
7058 * doprnt.c (DBL_MAX_10_EXP):
7059 * print.c (DBL_DIG):
7060 Remove. C89 or later always defines these.
7061 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7062 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7063 (arith_error, domain_error, domain_error2):
7064 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7065 no longer needed -- we simply return what C returns. All uses removed.
7066 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7067 the wrapped code.
7068 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7069 Remove. All uses expanded, as these macros are no longer used
7070 more than once and are now more trouble than they're worth.
7071 (Ftan): Use tan, not sin / cos.
7072 (Flogb): Assume C89 frexp.
7073 (fmod_float): Assume C89 fmod.
7074 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7075 (init_floatfns): Remove. All uses removed.
7076
9d7f1863
JD
70772012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7078
7079 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7080 compositeToPoint for OSX < 10.6 (Bug#12390).
7081
eabf0404
PE
70822012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7083
7084 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7085 This produces more-accurate results.
7086
0b3b1d23
JD
70872012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7088
7089 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7090 changes (Bug#12088).
7091
6dcef6ec
CY
70922012-09-08 Chong Yidong <cyd@gnu.org>
7093
7094 * syntax.c (Fstring_to_syntax): Doc fix.
7095
aa7d57c5
JD
70962012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7097
7098 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7099 in the internal border.
7100 (x_set_window_size): Remove static variables and their usage.
7101 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
7102 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7103 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
7104 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7105 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7106 (ns_fix_rect_ibw): Remove.
7107 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7108 (ns_dumpglyphs_box_or_relief): Ditto.
7109 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7110 adjustment.
7111 (ns_dumpglyphs_image): Ditto.
fc0c31f8 7112 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
7113 border adjustment.
7114 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7115 their usage. Add fringe_extended_p and its use as in other terms.
7116 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7117 scroll bar was removed.
7118 (updateFrameSize): New function.
7119 (windowDidResize): Move code to updateFrameSize and call it.
7120
7121 * nsterm.h (EmacsView): Add updateFrameSize.
7122
1a5432bc
CY
71232012-09-07 Chong Yidong <cyd@gnu.org>
7124
b4f5313e
CY
7125 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7126
1a5432bc
CY
7127 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7128
1a4f1e9b
PE
71292012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7130
7131 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
7132 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7133 Problem introduced when merging patches. Noted by Eli Zaretskii in
7134 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
7135 * floatfns.c: Comment fix.
7136 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7137 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7138 and anyway the declaration is harmless even if SIGDANGER is not defined.
7139 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7140 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7141 source files not surprisingly expected syssignal.h to define, or
7142 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7143 Include <sys/ioctl.h>, for FIONREAD.
7144 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7145 This eliminates a problem whereby other files mysteriously had
7146 to include "syssignal.h" before including "systty.h" if they
7147 wanted to use "#ifdef SIGIO".
7148
bc8000ff
EZ
71492012-09-07 Eli Zaretskii <eliz@gnu.org>
7150
3e6d6928
EZ
7151 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7152
7153 * w32.c (sigemptyset): Empty the set.
7154 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7155
bc8000ff
EZ
7156 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7157
b4fa72f2
DA
71582012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7159
7160 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7161 (mark_object): Likewise for frame objects.
7162
30730c93
PE
71632012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7164
7165 * syssignal.h (handle_on_main_thread): Always declare,
7166 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7167 This ports to platforms without HAVE_PTHREAD.
7168
2fe28299
PE
71692012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7170
7171 Signal-handler cleanup (Bug#12327).
7172 Emacs's signal handlers were written in the old 4.2BSD style with
7173 sigblock and sigmask and so forth, and this led to some
7174 inefficiencies and confusion. Rewrite these to use
7175 pthread_sigmask etc. without copying signal sets around. Also,
7176 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7177 'signal', and instead use functions that do not attempt to take
7178 over the system name space. This patch causes Emacs's text
7179 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7180 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7181 Do not include <signal.h> or "syssignal.h", as these
7182 modules do not use signals.
7183 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7184 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7185 Do not include <signal.h>, as "syssignal.h" does that for us now.
7186 * atimer.c (sigmask_atimers): New function.
7187 (block_atimers, unblock_atimers): New functions,
7188 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7189 All uses replaced.
7190 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7191 no longer needed here.
7192 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 7193 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
7194 * sysdep.c (struct save_signal): New member 'action', replacing
7195 old member 'handler'.
7196 (save_signal_handlers, restore_signal_handlers):
7197 Use sigaction instead of 'signal' to save and restore.
7198 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7199 New function. All users of 'signal' modified to use set_sighandler
7200 if they're writeonly, and to use sys_signal if they're read+write.
7201 (emacs_sigaction_init, forwarded_signal): New functions.
7202 (sys_signal): Remove. All uses replaced by calls to sigaction
7203 and emacs_sigaction_init, or by direct calls to 'signal'.
7204 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7205 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7206 all uses replaced by pthread_sigmask etc. calls.
7207 * syssignal.h: Include <signal.h>.
7208 (emacs_sigaction_init, forwarded_signal): New decls.
7209 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7210 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7211 (sigmask, sys_sigmask): Remove; no longer needed.
7212 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7213 (sigblock, sigunblock, sigfree):
7214 (sigsetmask) [!defined sigsetmask]:
7215 Remove. All uses replaced by pthread_sigmask.
7216 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7217 no longer need to be replaced, and its typical old uses
7218 are now done via emacs_sigaction_init and sigaction.
7219 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7220 (sys_sigdel): Remove; unused.
7221 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7222
0216c128
EZ
72232012-09-06 Eli Zaretskii <eliz@gnu.org>
7224
7225 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7226 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7227
c752cfa9
DA
72282012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7229
7230 Explicitly mark buffer_defaults and buffer_local_symbols.
7231 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7232 mark_local_symbols here.
7233 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7234 since special buffers aren't marked here any more.
7235 (allocate_buffer): Chain new buffer with all_buffers here...
7236 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7237 not here.
7238 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7239 (syms_of_buffer): Remove staticpro of the above.
7240 (init_buffer_once): Set names for buffer_defaults and
7241 buffer_local_symbols.
7242
a864ef14
PE
72432012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7244
7245 Use bool for booleans in font-related modules.
7246 * font.c (font_intern_prop, font_style_to_value)
7247 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7248 (generate_otf_features, font_check_otf_features, font_check_otf)
7249 (font_match_p, font_list_entities, font_at):
7250 * fontset.c (fontset_id_valid_p, reorder_font_vector
7251 (fontset_find_font, Fset_fontset_font)
7252 (face_suitable_for_char_p) [0]:
7253 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7254 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7255 (m17n_flt_initialized, ftfont_shape_by_flt):
7256 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7257 * nsfont.m (nsfont_draw):
7258 * w32font.c (w32font_draw):
7259 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7260 Use bool for booleans.
7261 * font.h: Adjust to above API changes.
7262 (struct font, struct font_driver, struct font_driver_list):
7263 Use bool for booleans.
7264 (struct font): Remove useless member encoding_type.
7265 All users removed.
7266 * fontset.c, xftfont.c: Omit unnecessary static decls.
7267
0699fc18
DA
72682012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7269
7270 * alloc.c (mark_object): Revert window marking code
7271 since it's unsafe for the Fset_window_configuration.
7272
20ef56db
PE
72732012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7274
2fe28299 7275 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
7276 Be more systematic about preserving errno whenever a signal
7277 handler returns, even if it's not in the main thread. Do this by
7278 renaming signal handlers to distinguish between signal delivery
7279 and signal handling. All uses changed.
7280 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7281 * data.c (deliver_arith_signal): Rename from arith_error.
7282 * dispnew.c (deliver_window_change_signal): Rename from
7283 window_change_signal.
7284 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7285 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7286 * keyboard.c (deliver_input_available_signal): Rename from
7287 input_available_signal.
7288 (deliver_user_signal): Rename from handle_user_signal.
7289 (deliver_interrupt_signal): Rename from interrupt_signal.
7290 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7291 (deliver_child_signal): Rename from sigchld_handler.
7292 * atimer.c (handle_alarm_signal):
7293 * data.c (handle_arith_signal):
7294 * dispnew.c (handle_window_change_signal):
7295 * emacs.c (handle_fatal_signal, handle_danger_signal):
7296 * keyboard.c (handle_input_available_signal):
7297 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7298 * process.c (handle_pipe_signal, handle_child_signal):
7299 New functions, with the actual signal-handling code taken from the
7300 original respective signal handlers, sans the sporadic attempts to
7301 preserve errno, since that's now done by handle_on_main_thread.
7302 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7303 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7304 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7305 Move to sysdep.c.
7306 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7307 Move initialization of main_thread to sysdep.c's init_signals.
7308 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7309 our usage, and simplifies the mainline code.
7310 (record_child_status_change): New static function, as a helper
7311 for handle_child_signal, and with most of the old child handler's
7312 contents.
7313 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7314 (handle_child_signal): Use the above.
7315 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7316 Moved here from emacs.c.
7317 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7318 code moved here from emacs.c's main function.
7319 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
7320 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7321 This lets callers save and restore errno properly.
20ef56db 7322
e3ccf108
DA
73232012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7324
7325 Remove redundant or unused things here and there.
7326 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7327 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7328 * editfns.c (Fcompare_buffer_substrings): Likewise.
7329 * frame.h (struct terminal, struct font_driver_list):
7330 Remove redundant declarations.
7331 * window.h (Qleft, Qright): Likewise.
7332
697e1e39
DA
73332012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7334
7335 Do not mark objects from deleted buffers, windows and frames.
7336 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7337 (mark_object): Likewise for windows and frames.
7338
c1ca42ca
DA
73392012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7340
7341 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7342 buffer_defaults and buffer_local_symbols as valid objects.
7343 Return special value to denote them.
7344
014d93be
PE
73452012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7346
f75d7a91
PE
7347 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7348 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7349 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7350 (file_name_absolute_p, Fsubstitute_in_file_name):
7351 (check_executable, check_writable, Ffile_accessible_directory_p)
7352 (Fset_file_selinux_context, Fdefault_file_modes)
7353 (Finsert_file_contents, choose_write_coding_system)
7354 (Fwrite_region, build_annotations, a_write, e_write)
7355 (Fdo_auto_save):
7356 * filelock.c (boot_time_initialized, get_boot_time)
7357 (get_boot_time_1, lock_file_1, within_one_second):
7358 * floatfns.c (in_float):
7359 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7360 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7361 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7362 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7363 * window.c (compare_window_configurations):
7364 Use bool for booleans.
7365 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7366 (Fdefault_file_modes): Now mode_t, not int, for modes.
7367 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7368 (internal_delete_file): Now returns void, not a (boolean) int,
7369 since nobody was looking at the return value.
7370 * lisp.h, window.h: Adjust to above API changes.
7371
014d93be
PE
7372 * xdisp.c (set_message): Simplify and reindent last change.
7373
776f29e1
JB
73742012-09-05 Juanma Barranquero <lekktu@gmail.com>
7375
7376 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7377
7f7e0167
LI
73782012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7379
7380 * eval.c (call_debugger): Make the function non-static so that we
7381 can call it from set_message.
7382
7383 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7384 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7385
cf29dd84
PE
73862012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7387
7388 Give more-useful info on a fatal error (Bug#12328).
7389 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7390 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7391 of doing the work ourselves.
7392 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7393 do most of the work.
7394 (fatal_error_backtrace): New function, taken from the guts
7395 of the old fatal_error_signal, but with a new option to output
7396 a backtrace.
7397 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7398 info about the signal than just its number.
7399 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7400 * sysdep.c: Include <execinfo.h>
7401 (emacs_backtrace): New function, taken partly from the previous
7402 code of the 'die' function.
7403 (emacs_abort): Call fatal_error_backtrace rather than abort.
7404
972debf2
SM
74052012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7406
7407 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7408 eager (load-time) macro-expansion.
7409 * lisp.mk (lisp): Add macroexp.
7410
1088b922
PE
74112012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7412
7413 Simplify redefinition of 'abort' (Bug#12316).
7414 Do not try to redefine the 'abort' function. Instead, redo
7415 the code so that it calls 'emacs_abort' rather than 'abort'.
7416 This removes the need for the NO_ABORT configure-time macro
7417 and makes it easier to change the abort code to do a backtrace.
7418 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7419 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7420 Remove; sysdep.c's emacs_abort now takes its place.
7421 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7422 'abort' changed to use 'emacs_abort'.
7423 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7424 (abort) [!defined abort]: Rename to ...
7425 (emacs_abort): ... new name.
7426 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7427 the place of the old 'abort' in emacs.c.
7428 * w32.c, w32fns.c (abort): Do not #undef.
7429 * w32.c (emacs_abort): Rename from w32_abort.
7430
30934d33
EZ
74312012-09-04 Eli Zaretskii <eliz@gnu.org>
7432
7433 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7434 offsets[j].dv, since the y axis of the screen coordinates points
7435 down, while the y axis of the font definition coordinates points
7436 up. This fixes display of Arabic diacritics such as KASRA and
7437 KASRATAN. (Bug#11860)
7438
af26b72c
PE
74392012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7440
7441 Be more systematic about _setjmp vs setjmp.
7442 * alloc.c (test_setjmp, mark_stack):
7443 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7444 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7445 (png_load, my_error_exit, jpeg_load):
7446 * process.c (send_process_trap, send_process):
7447 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7448 The underscored versions are up to 30x faster on some hosts.
7449 Formerly, the code used setjmp+longjmp sometimes and
7450 _setjmp+_longjmp at other times, with no particular reason to
7451 prefer setjmp+longjmp.
7452
26d4541d
PE
74532012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7454
d42f4f0f 7455 Fix minor problem found by static checking.
26d4541d 7456 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 7457
c5e28e39
MR
74582012-09-03 Martin Rudalics <rudalics@gmx.at>
7459
7460 * buffer.c (Fdelete_all_overlays): New function.
7461
3eab3ca9
CY
74622012-09-03 Chong Yidong <cyd@gnu.org>
7463
7464 * gtkutil.c: Add extern decl for Qxft.
7465
c04889f8
PE
74662012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7467
1882aa38
PE
7468 * emacs.c, eval.c: Use bool for boolean.
7469 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7470 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7471 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7472 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7473 (main, decode_env_path, Fdaemon_initialized):
7474 * eval.c (call_debugger, Finteractive_p, interactive_p):
7475 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7476 (maybe_call_debugger, Fbacktrace):
7477 * process.c (read_process_output, exec_sentinel):
7478 Use bool for booleans.
7479 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7480 All callers changed.
7481 * eval.c (interactive_p): Omit always-true boolean argument
7482 EXCLUDE_SUBRS_P. All callers changed.
7483 * dispextern.h, lisp.h: Reflect above API changes.
7484 * firstfile.c (dummy): Use the address of 'main', whose signature
7485 won't change, instead of the address of 'initialize', whose
7486 signature just changed from int to bool.
7487 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7488 * msdos.c (fatal_error_in_progress): ... from here.
7489 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7490 of incrementing it.
7491 (redisplay_internal, unwind_redisplay): Simply clear
7492 REDISPLAYING_P when unwinding, instead of saving its previous,
7493 always-false value and then restoring it.
7494
a411ac43
PE
7495 Clean up some extern decls.
7496 Mostly, this hoists extern decls out of .c files and into .h files.
7497 That way, we're more likely to catch errors if the interfaces change.
7498 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7499 declare xg_mark_data.
7500 * dispextern.h (x_frame_parm_handlers):
7501 * font.h (Qxft):
7502 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7503 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7504 (Qultra_bold, Qoblique, Qitalic):
7505 Move extern decl here from .c file.
7506 * alloc.c (xg_mark_data) [USE_GTK]:
7507 * doc.c (Qclosure):
7508 * eval.c (Qlexical_binding):
7509 * fns.c (time) [!HAVE_UNISTD_H]:
7510 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7511 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7512 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7513 * lread.c (Qinternal_interpreter_environment):
7514 * minibuf.c (Qbuffer):
7515 * process.c (QCfamily, QCfilter):
7516 * widget.c (free_frame_faces):
7517 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7518 * xfont.c (x_clear_errors):
7519 * xterm.c (x_frame_parm_handlers):
7520 Remove now-redundant extern decls.
7521 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7522 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7523 Now static.
7524 * xfaces.c: Remove unnecessary static decls.
7525 * xterm.c (updating_frame): Remove decl of nonexistent object.
7526
c04889f8
PE
7527 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7528 when building globals.h, as the objects that are not built on
7529 this host are not needed to compile C files on this host.
7530
8b339673
JD
75312012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7532
7533 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7534
7535 * frame.h: Add missing prototype for x_wm_set_size_hint.
7536
a08d4ba7
PE
75372012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7538
7539 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7540 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7541 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7542 (Fsubstitute_command_keys):
7543 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7544 (save_excursion_save, save_excursion_restore)
7545 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7546 (format_time_string, general_insert_function)
7547 (make_buffer_string, make_buffer_string_both)
7548 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7549 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7550 (copy_text, insert_1, insert_1_both, insert_from_string)
7551 (insert_from_string_before_markers, insert_from_string_1)
7552 (insert_from_buffer, insert_from_buffer_1, replace_range)
7553 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7554 (del_range_2, modify_region):
7555 * intervals.c (intervals_equal, balance_possible_root_interval)
7556 (adjust_intervals_for_insertion, merge_properties_sticky)
7557 (graft_intervals_into_buffer, lookup_char_property)
7558 (adjust_for_invis_intang, set_point_both)
7559 (get_property_and_range, compare_string_intervals)
7560 (set_intervals_multibyte_1, set_intervals_multibyte):
7561 * keyboard.c (decode_timer):
7562 Use bool for boolean.
7563 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7564 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7565
48c948de
CY
75662012-09-02 Chong Yidong <cyd@gnu.org>
7567
7568 * keymap.c (push_key_description): Print M-TAB as C-M-i
7569 (Bug#11758).
7570
6c49a40b
JB
75712012-09-02 Juanma Barranquero <lekktu@gmail.com>
7572
7573 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7574 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7575 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7576 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7577 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7578 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7579 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7580
4dfbd238
EZ
75812012-09-01 Eli Zaretskii <eliz@gnu.org>
7582
7e510e28
EZ
7583 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7584 more than one grapheme cluster passed to the shaper: compute the
7585 offset adjustment values separately for each cluster. (Bug#11860)
7586
4dfbd238
EZ
7587 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7588 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7589 about implicit conversions from integer to pointer.
7590
86571ae0
DC
75912012-09-01 Daniel Colascione <dancol@dancol.org>
7592
7593 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7594 system used too early.
7595
0e23ef9d
PE
75962012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7597
7598 Better seed support for (random).
7599 * emacs.c (main): Call init_random.
7600 * fns.c (Frandom): Set the seed from a string argument, if given.
7601 Remove long-obsolete Gentzel cruft.
7602 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7603 (init_random): New function.
7604
17a2cbbd
DC
76052012-09-01 Daniel Colascione <dancol@dancol.org>
7606
7607 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7608 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7609 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7610 x_wm_set_size_hint, x_query_colors, x_real_positions,
7611 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7612 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7613 all of which have been moved to common code.
7614
7615 * xfaces.c: Include TERM_HEADER instead of listing all possible
7616 window-system headers.
7617
7618 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7619 to match header.
7620
7621 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7622 directly accessing frame internals.
7623
f18cbb28 7624 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
7625 globals_of_w32font.
7626
7627 * process.c: Include TERM_HEADER instead of listing all possible
7628 window-system headers.
7629
3a880af4
SM
7630 * nsterm.h: Remove declarations now in frame.h.
7631 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
7632
7633 * menu.c: Include TERM_HEADER instead of listing all possible
7634 window-system headers.
7635
7636 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7637 window system.
7638
7639 * keyboard.c: Include TERM_HEADER instead of listing all possible
7640 window-system headers.
7641
7642 * image.c: Include TERM_HEADER instead of listing all possible
7643 window-system headers. Declare Vlibrary_cache when compiling for
7644 Windows.
7645
7646 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7647 window system declarations.
7648
7649 * frame.h: Move common functions here: set_frame_menubar,
7650 x_set_window_size, x_sync, x_get_focus_frame,
7651 x_set_mouse_position, x_set_mouse_pixel_position,
7652 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7653 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7654 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7655 x_activate_menubar, x_real_positions, x_bitmap_icon,
7656 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7657 and x_query_colors.
7658
7659 * frame.c: Include TERM_HEADER instead of listing all possible
7660 window-system headers.
7661
7662 * font.c: Include TERM_HEADER instead of listing all possible
7663 window-system headers.
7664
7665 * emacs.c: Include TERM_HEADER.
7666
f18cbb28
EZ
7667 * dispnew.c: Include TERM_HEADER instead of listing all possible
7668 window-system headers.
17a2cbbd 7669
f18cbb28 7670 * ccl.h: Include character.h.
17a2cbbd
DC
7671
7672 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7673 the current window system; include in list of objects to link into
7674 Emacs.
7675
c650a5de
DA
76762012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7677
7678 Remove mark_ttys function and fix tty_display_info initialization.
7679 * lisp.h (mark_ttys): Remove prototype.
7680 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7681 to mark_ttys because all possible values of 'top_frame' slot are
7682 the frames which are reachable from Vframe_list.
7683 * term.c (mark_ttys): Remove.
7684 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7685
4e0f6479
DA
76862012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7687
7688 Change struct frame bitfields from unsigned char to unsigned.
7689 * frame.h (struct frame): Change type of 'display_preempted',
7690 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7691 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7692 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7693 bitfields from unsigned char to unsigned.
7694
8b96a52c
DA
76952012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7696
7697 Remove unused member of struct x_output and struct w32_output.
7698 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7699 * w32term.h (struct w32_output): Likewise.
7700
b4444c8a
JD
77012012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7702
7703 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7704 does not become zero (Bug#12234).
7705
b98521db
PE
77062012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7707
7708 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7709 for GCC 4.7.1 x86-64.
7710
31d02438
GM
77112012-08-30 Glenn Morris <rgm@gnu.org>
7712
7713 * lread.c (init_lread): For out-of-tree builds, only add the
7714 source directory's site-lisp dir to the load-path if it exists,
7715 consistent with in-tree builds. (Bug#12302)
7716
7f8941d8
JD
77172012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7718
7719 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 7720 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
7721 (windowShouldClose:): Set window_closed.
7722 (dealloc): New member, free button_values.
fc0c31f8
JB
7723 (process_dialog:): Make member function. Remove window argument,
7724 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
7725 in button_values.
7726 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 7727 with tag. Remove return self, declare return value as void.
7f8941d8
JD
7728 (addString:row:): Remove return self, declare return value as void.
7729 (addSplit): Remove return self, declare return value as void.
7730 (clicked:): Remove return self, declare return value as void.
fc0c31f8 7731 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
7732 (initFromContents:isQuestion:): Adjust call to process_dialog.
7733 Code formatting change.
7734 (timeout_handler:): Set timer_fired to YES.
7735 (runDialogAt:): Set timer_fired to NO.
7736 Handle click on close button as quit.
7737
7738 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7739 Add window_closed and button_values. Add void as return value for
7740 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7741 Add process_dialog as new member.
7742
eada0861 77432012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 7744
eada0861
GM
7745 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7746 is not one of the heaps we manage. (Bug#12242)
7747
77482012-08-28 Glenn Morris <rgm@gnu.org>
7749
7750 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7751
457294dd
MR
77522012-08-28 Martin Rudalics <rudalics@gmx.at>
7753
7754 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
7755 auto-buffer-name window parameter. Install revision of reverted
7756 fix.
457294dd 7757
4f2daf31
DA
77582012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7759
7760 Do not allow to set major mode for a dead buffer.
7761 * buffer.c (Fset_buffer_major_mode): Signal an error
7762 if the buffer is dead.
7763 (Fother_buffer, other_buffer_safely): Remove redundant
7764 nested declaration.
7765
66322887
DA
77662012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7767
7768 Always use set_buffer_if_live to restore original buffer at unwind.
7769 * buffer.h (record_unwind_current_buffer): New function.
7770 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7771 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7772 * undo.c, window.c: Adjust users.
7773 * buffer.c (set_buffer_if_live): Fix comment.
7774
a3d794a1
DA
77752012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7776
7777 Fix usage of set_buffer_internal.
7778 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7779 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7780 * coding.c (decode_coding): Omit redundant test.
7781 * fileio.c (decide_coding_unwind): Likewise.
7782 * fns.c (secure_hash): Likewise.
7783 * insdel.c (modify_region): Likewise.
7784 * keyboard.c (command_loop_1): Likewise.
7785 * print.c (PRINTFINISH): Likewise.
7786 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7787
59ea14cd
PE
77882012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7789
7790 * dispnew.c: Use bool for boolean.
7791 (frame_garbaged, display_completed, delayed_size_change)
7792 (fonts_changed_p, add_window_display_history)
7793 (add_frame_display_history, verify_row_hash)
7794 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7795 (row_equal_p, realloc_glyph_pool)
7796 (allocate_matrices_for_frame_redisplay)
7797 (showing_window_margins_p)
7798 (adjust_frame_glyphs_for_frame_redisplay)
7799 (build_frame_matrix_from_leaf_window, make_current)
7800 (mirrored_line_dance, mirror_line_dance, update_frame)
7801 (update_window_tree, update_single_window)
7802 (check_current_matrix_flags, update_window, update_text_area)
7803 (update_window_line, set_window_update_flags, scrolling_window)
7804 (update_frame_1, scrolling, buffer_posn_from_coords)
7805 (do_pending_window_change, change_frame_size)
7806 (change_frame_size_1, sit_for):
7807 Use bool for boolean.
7808 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7809 and remove last int (actually boolean) argument, which was always 0.
7810 All callers changed.
7811 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7812 * dispextern.h (struct composition_it): Use bool for boolean.
7813 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7814 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7815 * dired.c (file_name_completion):
7816 Use bool for boolean. (This was missed in an earlier change.)
7817
95072a94
MR
78182012-08-27 Martin Rudalics <rudalics@gmx.at>
7819
7820 * window.c (Fset_window_configuration): Revert first part of
7821 last change.
7822
0f19feff
JD
78232012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7824
7825 * nsterm.h (NSPanel): New class variable dialog_return.
7826
3a880af4
SM
7827 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7828 Initialize dialog_return.
0f19feff
JD
7829 (windowShouldClose:): Use stop instead of stopModalWithCode.
7830 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7831 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7832 event.
7833 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7834 modal loop returns.
7835
f10fe38f
PE
78362012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7837
de1339b0
PE
7838 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7839 * composite.c (find_composition, composition_gstring_p)
7840 (composition_reseat_it, find_automatic_composition):
7841 * data.c (let_shadows_buffer_binding_p)
7842 (let_shadows_global_binding_p, set_internal, make_blv)
7843 (Fmake_variable_buffer_local, Fmake_local_variable)
7844 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7845 (cons_to_signed, arith_driver):
7846 * dbusbind.c (xd_in_read_queued_messages):
7847 * dired.c (directory_files_internal, file_name_completion):
7848 Use bool for booleans.
7849 * dired.c (file_name_completion):
7850 * process.h (fd_callback):
7851 Omit int (actually boolean) argument. It wasn't being used.
7852 All uses changed.
7853 * composite.h, lisp.h: Reflect above API changes.
7854
f10fe38f
PE
7855 * cmds.c, coding.c: Use bool for booleans.
7856 * cmds.c (move_point, Fself_insert_command):
7857 * coding.h (struct composition status, struct coding_system):
7858 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7859 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7860 (emacs_mule_char, decode_coding_emacs_mule)
7861 (encode_coding_emacs_mule, detect_coding_iso_2022)
7862 (decode_coding_iso_2022, encode_invocation_designation)
7863 (encode_designation_at_bol, encode_coding_iso_2022)
7864 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7865 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7866 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7867 (encode_coding_raw_text, detect_coding_charset)
7868 (decode_coding_charset, encode_coding_charset, detect_eol)
7869 (detect_coding, get_translation_table, produce_chars)
7870 (consume_chars, reused_workbuf_in_use)
7871 (make_conversion_work_buffer, code_conversion_save)
7872 (decode_coding_object, encode_coding_object)
7873 (detect_coding_system, char_encodable_p)
7874 (Funencodable_char_position, code_convert_region)
7875 (code_convert_string, code_convert_string_norecord)
7876 (Fset_coding_system_priority):
7877 * fileio.c (Finsert_file_contents):
7878 Use bool for booleans.
7879 * coding.h, lisp.h: Reflect above API changes.
7880 * coding.c: Remove unnecessary static function decls.
7881 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7882 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7883 not a boolean 'int', since callers never look at the return value.
7884 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7885 * coding.h (decoding_buffer_size, encoding_buffer_size)
7886 (emacs_mule_string_char): Remove unused extern decls.
7887 (struct iso_2022_spec, struct coding_system):
7888 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7889 (struct emacs_mule_spec): Remove unused field 'full_support'.
7890 All initializations removed.
7891 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7892
5474c384
DA
78932012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7894
f10fe38f 7895 Fix spare memory change (Bug#12286).
5474c384
DA
7896 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7897 (valid_lisp_object_p): Likewise.
7898
c4b6914d
MR
78992012-08-27 Martin Rudalics <rudalics@gmx.at>
7900
7901 * window.c (Fset_window_configuration): Record any window's old
7902 buffer if it's replaced (see Bug#8789). If the new current
7903 buffer doesn't appear in the selected window, go to its old
7904 point (Bug#12208).
7905
35aaa1ea
DA
79062012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7907
7908 Special MEM_TYPE_SPARE to denote reserved memory.
7909 * alloc.c (enum mem_type): New memory type.
7910 (refill_memory_reserve): Use new type for spare memory.
7911 This prevents live_cons_p and live_string_p from incorrect
7912 detection of uninitialized objects from spare memory as live.
7913
6af64513
PE
79142012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7915
8b2e00a3
PE
7916 Spelling fixes.
7917 * Makefile.in (.PHONY): versioclean -> versionclean.
7918
b52d6985
PE
7919 Remove unused external symbols.
7920 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7921 * window.c (Qwindow_valid_p, decode_valid_window):
7922 Now static, not extern.
7923 * data.c (Qinterval): Remove; unused.
7924 (syms_of_data): Do not define 'interval'.
7925 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7926 * window.h (decode_valid_window):
7927 Remove decls.
7928
d5172d4f
PE
7929 * character.c, charset.c, chartab.c: Use bool for booleans.
7930 * character.c (lisp_string_width, string_count_byte8)
7931 (string_escape_byte8):
7932 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7933 (load_charset_map_from_file, map_charset_chars)
7934 (Fdefine_charset_internal, define_charset_internal)
7935 (Fdeclare_equiv_charset, find_charsets_in_text)
7936 (Ffind_charset_region, char_charset, Fiso_charset):
7937 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7938 (sub_char_table_set, sub_char_table_set_range)
7939 (char_table_set_range, optimize_sub_char_table)
7940 (map_sub_char_table):
7941 Use bool for boolean.
7942 * character.c (str_to_unibyte): Omit last boolean argument; it was
7943 always 0. All callers changed.
7944 * character.h, charset.h: Adjust to match previous changes.
7945 * character.h (char_printable_p): Remove decl of nonexistent function.
7946 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7947 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7948 are all boolean, so make them single-bit bitfields.
7949
6af64513
PE
7950 * lisp.h (ASET): Remove attempt to detect side effects.
7951 It was meant to be temporary and it often doesn't work,
7952 because when IDX has side effects the behavior of IDX==IDX
7953 is undefined. See Stefan Monnier in
7954 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7955
e1f29348
BR
79562012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7957
7958 * lisp.h (functionp): New function (extracted from Ffunctionp).
7959 (FUNCTIONP): Use it.
7960 * eval.c (Ffunctionp): Use it.
7961
17c05d74
PE
79622012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7963
0f46bc75
PE
7964 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7965 as that's faster and simpler than static storage. Don't bother
7966 with the g_main_context_query overhead if g_main_context_pending
7967 says no events are pending.
7968 (gfds, gfds_size): Remove these static vars.
7969 (xgselect_initialize): Remove; no longer needed.
7970 All uses and decls removed.
7971
ee4c0f69
PE
7972 * emacs.c (fatal_error_signal_hook): Remove.
7973 All uses removed. This leftover from old code was always 0.
7974
17c05d74
PE
7975 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7976 * casefiddle.c (casify_object, casify_region):
7977 * casetab.c (set_case_table):
7978 * category.c, category.h (word_boundary_p):
7979 * category.h (CHAR_HAS_CATEGORY):
7980 Use bool for booleans, instead of int.
7981
391ceac5
EZ
79822012-08-25 Eli Zaretskii <eliz@gnu.org>
7983
7984 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7985
2f221583
PE
79862012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7987
f4a681b0
PE
7988 On assertion failure, print backtrace if available.
7989 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7990 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7991 * Makefile.in (LIB_EXECINFO): New macro.
7992 (LIBES): Use it.
7993
2f221583
PE
7994 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7995 * bytecode.c (exec_byte_code):
7996 * callint.c (check_mark, Fcall_interactively):
7997 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7998 (getenv_internal, sync_process_alive, call_process_exited):
7999 * lisp.h (USE_SAFE_ALLOCA):
8000 Use bool for booleans, instead of int.
8001 * lisp.h, process.h: Adjust prototypes to match above changes.
8002 * callint.c (Fcall_interactively): Don't assume the mark's
8003 offset fits in 'int'.
8004
37ef52bb
PE
80052012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8006
8007 * buffer.c, buffer.h: Use bool for boolean.
8008 * buffer.c (reset_buffer_local_variables)
8009 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8010 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8011 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8012 (overlay_touches_p, overlay_strings, Foverlay_put)
8013 (report_overlay_modification, call_overlay_mod_hooks):
8014 (mmap_enlarge, mmap_set_vars):
8015 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8016 Use bool for booleans, instead of int.
8017 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8018 since the 1-or-0 return value is always ignored anyway.
8019 (mmap_initialized_p):
8020 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8021 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8022
2cc21167
PE
80232012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8024
8025 * bidi.c: Use bool for boolean.
8026 This is a bit more readable, and makes the text segment of bidi.o
8027 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8028 Presumably it's faster too.
8029 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8030 Now bool.
8031 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8032 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8033 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8034 (bidi_explicit_dir_char, bidi_level_of_next_char)
8035 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8036 Use bool for booleans, instead of int.
8037 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8038 (bidi_unshelve_cache): Adjust decls to match code.
8039
7db4ddf4
MR
80402012-08-23 Martin Rudalics <rudalics@gmx.at>
8041
8042 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8043 argument.
8044
b1bb8011
PE
80452012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8046
8047 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8048 * atimer.h: Include <stdbool.h>.
8049
ff687885
DN
80502012-08-22 Dan Nicolaescu <dann@gnu.org>
8051
8052 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8053 compile time tests instead of run time tests on systems that do
8054 not use them.
8055 (FRAME_MAC_P): Remove leftover from deleted code.
8056 * frame.c (syms_of_frame): Remove leftover from deleted code.
8057
4ce7a138
JD
80582012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8059
8060 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8061
d733ec6d
PE
80622012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8063
8064 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8065 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 8066 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
8067 (fontset_add): Return void, for FONTSET_ADD.
8068
d0d2d26f
PE
80692012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8070
fce31d69
PE
8071 * alloc.c: Use bool for booleans.
8072 (gc_in_progress, abort_on_gc)
8073 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8074 (dont_register_blocks) [GC_MALLOC_CHECK]:
8075 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8076 (check_string_bytes, make_specified_string, memory_full)
8077 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8078 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8079 (mark_stack, valid_pointer_p, make_pure_string)
8080 (Fgarbage_collect, survives_gc_p, gc_sweep):
8081 Use bool for booleans, instead of int.
8082 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8083 Remove unused local.
8084 * alloc.c (PURE_POINTER_P):
8085 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8086 * editfns.c (Fformat):
8087 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8088 (Fdo_auto_save):
8089 * fns.c (sweep_weak_table):
8090 * lisp.h (suppress_checking, push_message, survives_gc_p)
8091 (make_pure_string, gc_in_progress, abort_on_gc):
8092 * lread.c (readchar, read1):
8093 * print.c (Fprin1_to_string):
8094 * xdisp.c (push_message):
8095 Use bool for booleans affected directly or indirectly by
8096 alloc.c's changes.
8097
d0d2d26f
PE
8098 Make recently-introduced setters macros.
8099 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8100 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8101 (set_fontset_default, set_fontset_fallback): Rename from their
8102 upper-case counterparts, and make them functions rather than macros.
8103 This is more consistent with the other recently-introduced setters.
8104 These don't need to be inline, since they're local.
8105
d18e2bb6
JD
81062012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8107
8108 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8109 the loop (Bug#12247).
8110
1b9d9d16
PE
81112012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8112
8113 * lisp.h (vcopy): Use memcpy rather than our own loop.
8114 This fixes a performance regression introduced by the recent
8115 addition of vcopy. This means 'vcopy' will need to be modified
8116 for a copying collector, but that's OK. Also, tighten the
8117 checking in the assertion.
8118
b2f09701
EZ
81192012-08-21 Eli Zaretskii <eliz@gnu.org>
8120
8121 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8122 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8123 non-base glyph for the width of the base character, according to
e1f29348
BR
8124 what x_draw_composite_glyph_string_foreground expects.
8125 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
8126 expectations, to produce correct width of the composed character.
8127 Reverse the sign of the DU offset produced by ScriptPlace.
8128
9b994fed
PE
81292012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8130
8131 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8132
086ca913
DA
81332012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8134
8135 Avoid direct writes to contents member of struct Lisp_Vector.
8136 * lisp.h (vcopy): New function to copy data into vector.
8137 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8138 * fns.c (Ffillarray): Use ASET.
8139 * keyboard.c (timer_check_2): Use AREF and ASET.
8140 (append_tool_bar_item, Frecent_keys): Use vcopy.
8141 * lread.c (read_vector): Use ASET.
8142 * msdos.c (Frecent_doskeys): Use vcopy.
8143 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8144 (Finternal_merge_in_global_face): Use ASET and vcopy.
8145 * xfont.c (xfont_list_pattern): Likewise.
8146
5481664a
MR
81472012-08-21 Martin Rudalics <rudalics@gmx.at>
8148
8149 * window.c (Fwindow_point): For the selected window always return
8150 the position of its buffer's point.
8151 (Fset_window_point): For the selected window always go in its
8152 buffer to the specified position.
8153
6d470bdd
DA
81542012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8155
8156 Setter macros for fontsets.
8157 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8158 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8159 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8160 Adjust users.
8161
24564fe1
GM
81622012-08-20 Glenn Morris <rgm@gnu.org>
8163
8164 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8165 Don't assume that `ln -f' works.
8166
0a05a035
EZ
81672012-08-20 Eli Zaretskii <eliz@gnu.org>
8168
8169 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8170 and later about non-assignments with no effect. See discussion at
8171 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8172 details.
8173
e46f2325
DA
81742012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8175
8176 Inline setter functions for Lisp_Objects slots of struct specbinding.
8177 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8178 Adjust users.
8179
734fbd86
MR
81802012-08-20 Martin Rudalics <rudalics@gmx.at>
8181
8182 * window.c (select_window): Always make selected window's buffer
8183 current.
8184
f1a95992
DA
81852012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8186
8187 Use AREF and ASET for docstrings of category tables.
8188 * category.h (CATEGORY_DOCSTRING): Use AREF.
8189 (SET_CATEGORY_DOCSTRING): Use ASET.
8190 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8191
e83064be
DA
81922012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8193
8194 Inline setter functions for hash table members.
8195 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8196 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8197 (set_hash_key_and_value, set_hash_index, set_hash_next)
8198 (set_hash_hash): New functions.
8199 * charset.c, fns.c: Adjust users.
8200
4ce60d2e
DA
82012012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8202
8203 Inline getter and setter functions for per-buffer values.
8204 * buffer.h (per_buffer_default, set_per_buffer_default)
8205 (per_buffer_value, set_per_buffer_value): New functions.
8206 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8207 * buffer.c, data.c: Adjust users.
8208
c06c9690
JB
82092012-08-20 Juanma Barranquero <lekktu@gmail.com>
8210
8211 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8212
32bd4250
PE
82132012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8214
bad03192 8215 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
8216 as gnulib does this if the system doesn't.
8217 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
8218 Remove declaration. MS-Windows declares it on stdlib.h which is
8219 included by conf_post.h.
b69a6d22
PE
8220 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8221 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8222 * vm-limit.c: Include <unistd.h>, for 'environ'.
8223
22d7feb2
PE
8224 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8225 (start_of_data): Remove decl; mem-limits.h provides it.
8226
32bd4250
PE
8227 * xdisp.c (handle_invisible_prop): Make it a bit faster
8228 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8229
450809af
CY
82302012-08-19 Chong Yidong <cyd@gnu.org>
8231
8232 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8233 ends (Bug#3874).
8234
9e677988
AS
82352012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8236
6b1319ce
AS
8237 * .gdbinit: Use call instead of set when calling a function in the
8238 inferior.
8239
9e677988
AS
8240 * data.c (set_internal): Don't use set_blv_found.
8241 (Fkill_local_variable): Likewise.
8242
d7191076
AA
82432012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8244
8245 * nsfont.m (ns_ascii_average_width): Ensure the string
8246 ascii_printable is initialized with a null-terminated character
8247 array. Otherwise, it can contain undesired extra characters.
8248
e757f1c6
PE
82492012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8250
8251 port new setting code to Sun C 5.8 2005/10/13
8252 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8253 Return void, not Lisp_Object. Otherwise, the compiler
8254 complains about (A?B:C) where B is void and C is Lisp_Object
8255 when compiling CHAR_TABLE_SET, due to the recent change to
8256 the API of sub_char_table_set_contents.
8257
a999ce26
CY
82582012-08-18 Chong Yidong <cyd@gnu.org>
8259
8260 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8261 for the string case (Bug#3874).
8262
3f22b86f
PE
82632012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8264
39eb03f1
PE
8265 * buffer.h (BSET): Remove (Bug#12215).
8266 Replace all uses with calls to new setter functions.
8267 (bset_bidi_paragraph_direction, bset_case_canon_table)
8268 (bset_case_eqv_table, bset_directory, bset_display_count)
8269 (bset_display_time, bset_downcase_table)
8270 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8271 (bset_last_selected_window, bset_local_var_alist)
8272 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8273 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8274 (bset_width_table):
8275 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8276 (bset_auto_fill_function, bset_auto_save_file_format)
8277 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8278 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8279 (bset_cache_long_line_scans, bset_case_fold_search)
8280 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8281 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8282 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8283 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8284 (bset_header_line_format, bset_indicate_buffer_boundaries)
8285 (bset_indicate_empty_lines, bset_invisibility_spec)
8286 (bset_left_fringe_width, bset_major_mode, bset_mark)
8287 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8288 (bset_name, bset_overwrite_mode, bset_pt_marker)
8289 (bset_right_fringe_width, bset_save_length)
8290 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8291 (bset_scroll_up_aggressively, bset_selective_display)
8292 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8293 (bset_word_wrap, bset_zv_marker):
8294 * category.c (bset_category_table):
8295 * syntax.c (bset_syntax_table):
8296 New setter functions.
8297
6a09a33b
PE
8298 * process.h (PSET): Remove (Bug#12215).
8299 Replace all uses with calls to new setter functions.
8300 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8301 (PROCESS_INLINE): New macro.
8302 (pset_childp): New setter function.
8303 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8304 * process.c (PROCESS_INLINE):
8305 Define to EXTERN_INLINE, so that the corresponding functions
8306 are compiled into code.
8307 (pset_buffer, pset_command, pset_decode_coding_system)
8308 (pset_decoding_buf, pset_encode_coding_system)
8309 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8310 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8311 (pset_type, pset_write_queue): New setter functions.
8312
e8c17b81
PE
8313 * window.h (WSET): Remove (Bug#12215).
8314 Replace all uses with calls to new setter functions.
8315 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8316 (WINDOW_INLINE): New macro.
8317 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8318 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8319 (wset_total_lines, wset_vertical_scroll_bar)
8320 (wset_window_end_pos, wset_window_end_valid)
8321 (wset_window_end_vpos): New setter functions.
8322 * window.c (WINDOW_INLINE):
8323 Define to EXTERN_INLINE, so that the corresponding functions
8324 are compiled into code.
8325 (wset_combination_limit, wset_dedicated, wset_display_table)
8326 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8327 (wset_new_normal, wset_new_total, wset_next_buffers)
8328 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8329 (wset_prev_buffers, wset_right_fringe_width)
8330 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8331 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8332 (wset_window_parameters):
8333 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8334 (wset_column_number_displayed, wset_region_showing):
8335 New setter functions.
8336
3f22b86f
PE
8337 * termhooks.h (TSET): Remove (Bug#12215).
8338 Replace all uses with calls to new setter functions.
8339 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8340 (TERMHOOKS_INLINE): New macro.
8341 (tset_charset_list, tset_selection_alist): New setter functions.
8342 * terminal.c (TERMHOOKS_INLINE):
8343 Define to EXTERN_INLINE, so that the corresponding functions
8344 are compiled into code.
8345 (tset_param_alist): New setter function.
8346
742af32f
PE
83472012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8348
15dbb4d6
PE
8349 * keyboard.h (KSET): Remove (Bug#12215).
8350 Replace all uses with calls to new setter functions.
8351 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8352 (KEYBOARD_INLINE): New macro.
8353 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8354 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8355 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8356 New setter functions.
8357 * keyboard.c (KEYBOARD_INLINE):
8358 Define to EXTERN_INLINE, so that the corresponding functions
8359 are compiled into code.
8360 (kset_echo_string, kset_kbd_queue)
8361 (kset_keyboard_translate_table, kset_last_prefix_arg)
8362 (kset_last_repeatable_command, kset_local_function_key_map)
8363 (kset_overriding_terminal_local_map, kset_real_last_command)
8364 (kset_system_key_syms): New setter functions.
8365
f00af5b1
PE
8366 * frame.h (FSET): Remove (Bug#12215).
8367 Replace all uses with calls to new setter functions.
8368 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8369 (FRAME_INLINE): New macro.
8370 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8371 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8372 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8373 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8374 (fset_param_alist, fset_root_window, fset_scroll_bars)
8375 (fset_selected_window, fset_title, fset_tool_bar_items)
8376 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8377 * frame.c (FRAME_INLINE):
8378 Define to EXTERN_INLINE, so that the corresponding functions
8379 are compiled into code.
8380 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8381
0c94c8d6
PE
8382 A few more naming-convention fixes for getters and setters.
8383 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8384 and rename from buffer_overlays_set_before.
8385 (set_buffer_overlays_after): Move here from buffer.h, and rename
8386 from buffer_overlays_set_after.
8387 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8388 All uses changed.
8389 (set_buffer_intervals): Rename from buffer_set_intervals.
8390 * intervals.c (set_interval_object): Move here from intervals.h,
8391 and rename from interval_set_object.
8392 (set_interval_left): Move here from intervals.h, and rename from
8393 interval_set_left.
8394 (set_interval_right): Move here from intervals.h, and rename from
8395 interval_set_right.
8396 (copy_interval_parent): Move here from intervals.h, and rename from
8397 interval_copy_parent.
8398 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8399 (set_interval_plist): Rename from interval_set_plist.
8400 Return void, not Lisp_Object, since no caller uses the result.
8401 * lisp.h (string_intervals): Rename from string_get_intervals.
8402 (set_string_intervals): Rename from string_set_intervals.
8403
34dabdb7
PE
8404 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8405 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 8406 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
8407 All uses changed. See the end of
8408 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8409
742af32f
PE
8410 * lisp.h (CSET): Remove (Bug#12215).
8411 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8412 (set_char_table_purpose): New functions,
8413 replacing CSET. All uses changed. For example, replace
8414 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 8415 "set_char_table_parent (char_table, parent);".
742af32f
PE
8416 The old version was confusing because it used the same name
8417 'parent' for two different things.
8418
a04e2c62
DA
84192012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8420
8421 Functions to get and set Lisp_Object fields of buffer-local variables.
8422 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8423 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8424 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8425 * data.c, eval.c, frame.c: Adjust users.
8426
383dcbf9
CY
84272012-08-17 Chong Yidong <cyd@gnu.org>
8428
8429 * xfaces.c (merge_face_vectors): If the target font specfies a
8430 font spec, make the font's attributes take precedence over
8431 directly-specified attributes.
8432 (merge_face_ref): Recognize :font.
8433
44386687
DA
84342012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8435
8436 Do not use memcpy for copying intervals.
8437 * intervals.c (reproduce_interval): New function.
8438 (reproduce_tree, reproduce_tree_obj): Use it.
8439 (reproduce_tree_obj): Remove prototype.
8440
927c7216
PE
84412012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8442
8443 * lisp.h (duration_to_sec_usec): Remove unused decl.
8444
93044f7b
AA
84452012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8446
8447 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8448 to an allocated instance of NSString, not to the class itself.
8449
9851e4a5
JB
84502012-08-17 Juanma Barranquero <lekktu@gmail.com>
8451
8452 * makefile.w32-in (C_CTYPE_H): New macro.
8453 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8454 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8455 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8456
620f13b0
PE
84572012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8458
8459 Use ASCII tests for character types.
8460 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8461 * xfns.c, xterm.c:
8462 Don't include <ctype.h>; was not needed.
8463 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8464 * sysdep.c, xfaces.c:
8465 Include <c-ctype.h> instead of <ctype.h>.
8466 * nsterm.m: Include <c-ctype.h>.
8467 * charset.c (read_hex):
8468 * doc.c (Fsnarf_documentation):
8469 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8470 (DRIVE_LETTER) [DOS_NT]:
8471 (Ffile_name_directory, Fexpand_file_name)
8472 (Fsubstitute_in_file_name):
8473 * font.c (font_parse_xlfd, font_parse_fcname):
8474 * frame.c (x_set_font_backend):
8475 * gtkutil.c (xg_get_font):
8476 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8477 * nsimage.m (hexchar):
8478 * nsterm.m (ns_xlfd_to_fontname):
8479 * sysdep.c (system_process_attributes):
8480 * xfaces.c (hash_string_case_insensitive):
8481 Use C-locale tests instead of locale-specific tests for character
8482 types, since we want the ASCII interpretation here, not the
8483 interpretation suitable for whatever happens to be the current locale.
8484
52162052
MR
84852012-08-16 Martin Rudalics <rudalics@gmx.at>
8486
8487 Consistently check windows for validity/liveness
8488 (Bug#11984, Bug#12025, Bug#12026).
8489 * lisp.h (CHECK_VALID_WINDOW): New macro.
8490 * window.c (decode_window): Rename to decode_live_window.
8491 (decode_valid_window, Fwindow_valid_p): New functions.
8492 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8493 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8494 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8495 (Fwindow_prev_sibling, Fwindow_combination_limit)
8496 (Fset_window_combination_limit, Fwindow_use_time)
8497 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8498 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8499 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8500 (Fwindow_hscroll, Fset_window_hscroll)
8501 (Fwindow_redisplay_end_trigger)
8502 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8503 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8504 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8505 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8506 (Fwindow_end, Fset_window_point, Fset_window_start)
8507 (Fpos_visible_in_window_p, Fwindow_line_height)
8508 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8509 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8510 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8511 (Fset_window_parameter, Fwindow_display_table)
8512 (Fset_window_display_table, Fdelete_other_windows_internal)
8513 (Fset_window_buffer, Fset_window_new_total)
8514 (Fset_window_new_normal, Fdelete_window_internal)
8515 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8516 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8517 (Fwindow_scroll_bars): Check whether argument window is a valid or
8518 live window. Update doc-strings.
8519 (syms_of_window): New symbol Qwindow_valid_p.
8520 * keyboard.c (Fposn_at_x_y): Check whether argument
8521 frame_or_window denotes a valid window.
8522
2751c80f
DA
85232012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8524
8525 Fix previous char table change.
8526 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8527 * chartab.c (optimize_sub_char_table): Likewise.
8528
032a42c8
CY
85292012-08-16 Chong Yidong <cyd@gnu.org>
8530
a2d19368
CY
8531 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8532
032a42c8
CY
8533 * xfont.c (xfont_open):
8534 * xftfont.c (xftfont_open): Set the font's max_width field.
8535
8536 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8537 min_width to space_width and average_width to the average over
8538 printable ASCII characters.
8539 (ns_char_width): Code cleanup.
8540 (ns_ascii_average_width): New utility function.
8541
8542 * font.h (struct font): Update comments.
8543
a098c930
DA
85442012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8545
032a42c8 8546 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
8547 * lisp.h (CSET): New macro.
8548 (char_table_set_extras, char_table_set_contents)
8549 (sub_char_table_set_contents): New function.
8550 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8551 * syntax.c: Adjust users.
8552
8be3a09c
SM
85532012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8554
8555 * eval.c (eval_sub): Bind lexical-binding.
8556 * lread.c (Qlexical_binding): Make non-static.
8557
ac4845a6
JD
85582012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8559
ddee6515
JD
8560 * nsmenu.m (popupSession): Remove.
8561 (pop_down_menu): Remove endModalSession.
8562 (timeout_handler:): New method.
8563 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8564 Call runModalForWindow. Check timer_fired when it returns.
8565 If not set, cancel timer and break out of loop.
8566 Otherwise loop again, with a new timeout.
8567
8568 * nsterm.m: Include fcntl.h if present.
8569 (fd_entry, t_readfds, inNsSelect): Remove.
8570 (select_writefds, select_valid, select_timeout, selfds)
8571 (select_mutex, apploopnr): Add.
8572 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8573 Otherwise call kbd_buffer_store_event.
8574 (ns_send_appdefined): Remove release of fd_entry.
8575 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8576 Increment and decrement apploopnr.
8577 (ns_select): If no file descriptors, just do a NSTimer.
8578 Otherwise copy read/write masks and start select thread (fd_handler).
8579 Start main loop and wait for application defined event.
8580 Inform select thread to stop selecting after main loop is exited.
8581 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 8582 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
8583 (fd_handler:): Loop forever, wait for info from the main thread
8584 to either start or stop selecting. When select returns, send
8585 and appdefined event.
8586 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8587 If not call kbd_buffer_store_event.
8588
8589 * nsterm.h (EmacsApp): fd_handler takes id argument.
8590 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8591
ac4845a6
JD
8592 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8593
eb424fe3
EZ
85942012-08-15 Eli Zaretskii <eliz@gnu.org>
8595
8596 * region-cache.c (move_cache_gap): Update gap_len using the actual
8597 growth of the boundaries array. Do not change cache_len.
8598 (Bug#12196)
8599
4e6a86c6
DA
86002012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8601
8602 Generalize and cleanup font subsystem checks.
8603 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
8604 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8605 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 8606
5bf192ca
DA
86072012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8608
8609 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8610
f2045622
CY
86112012-08-15 Chong Yidong <cyd@gnu.org>
8612
8be3a09c
SM
8613 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8614 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8615 extract the font descriptor instead of just the font name.
8616 In that case, return a font spec instead of a string.
f2045622
CY
8617 (x_last_font_name): Move to this file from xfns.c.
8618
8619 * xfns.c (Fx_select_font): The return value can also be a font
8620 spec. Move x_last_font_name management to gtkutil.c.
8621
8622 * xfaces.c: Make font weight and style symbols non-static.
8623
7f6feb56
SM
86242012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8625
8626 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8627 (bug#12117).
8628
fecbd8ff
SM
86292012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8630
8631 * alloc.c (Fgarbage_collect): Use plural form consistently.
8632
9b8d5165
EZ
86332012-08-14 Eli Zaretskii <eliz@gnu.org>
8634
8635 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8636 iteration through the command loop. Fixes a problem whereby mouse
8637 movements are ignored until the first mouse click.
8638
f5d9e83a
PE
86392012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8640
8641 Use bool, not int, for Lisp booleans.
8642 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8643 makes Emacs a bit smaller and presumably a bit faster.
8644 * lisp.h: Include <stdbool.h>.
8645 (struct Lisp_Boolfwd, defvar_bool):
8646 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8647 * regex.c [!emacs]: Include <stdbool.h>.
8648 (false, true): Remove; <stdbool.h> does this for us now.
8649
55802e4a
CY
86502012-08-14 Chong Yidong <cyd@gnu.org>
8651
4abcdac8
CY
8652 * character.c (Fcharacterp): Doc fix (Bug#12076).
8653
8654 * data.c (Findirect_variable): Doc fix (Bug#11040).
8655
55802e4a
CY
8656 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8657
8658 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 8659 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 8660
8e99d072
BR
86612012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8662
8663 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8664 (bug#12022).
8665
08908aca
MR
86662012-08-14 Martin Rudalics <rudalics@gmx.at>
8667
8668 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8669 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8670 * minibuf.c (choose_minibuf_frame, read_minibuf):
8671 * w32fns.c (x_create_tip_frame):
8672 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8673 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8674
56120d6f
PE
86752012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8676
8677 * intervals.c (offset_intervals): Remove obsolete comment.
8678
67b77c0b
AS
86792012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8680
8681 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8682
f48b82fd
GR
86832012-08-14 Gergely Risko <gergely@risko.hu>
8684
8685 * coding.c (decode_coding): Record buffer modification before
8686 disabling undo_list (Bug#11773).
8687
fd318b54
DA
86882012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8689
8690 Revert and cleanup some recent overlay changes.
8691 * buffer.h (enum overlay_type): Remove.
8692 (buffer_get_overlays, buffer_set_overlays): Likewise.
8693 (buffer_set_overlays_before, buffer_set_overlays_after):
8694 New function. Adjust users.
8695 (unchain_both): Add eassert.
8696
41a62dd9
DA
86972012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8698
8699 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8700
5884c324
PE
87012012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8702
8703 * gtkutil.c (xg_mark_data): Don't assume C99.
8704
ca06f160
JD
87052012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8706
8707 * gtkutil.c (xg_frame_tb_info): New struct.
8708 (TB_INFO_KEY): New define.
8709 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8710 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8711 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8712 if not present.
8713 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 8714 is up to date. Otherwise store new data.
ca06f160
JD
8715 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8716
7864a3f7
DA
87172012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8718
8719 Use KSET for write access to Lisp_Object members of struct kboard.
8720 * keyboard.h (KSET): New macro.
8721 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8722 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8723 * xterm.c: Adjust users.
8724
4c31be61
DA
87252012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8726
8727 Use BSET for write access to Lisp_Object members of struct buffer.
8728 * buffer.h (BSET): New macro.
8729 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8730 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8731 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8732 * window.c, xdisp.c, xfns.c: Adjust users.
8733
14ae4239
BT
87342012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8735
8736 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8737
32bcadb4
JD
87382012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8739
3d29b2ce 8740 * nsterm.m (not_in_argv): New function.
fc0c31f8 8741 (application:openFile, application:openTempFile:):
3d29b2ce
JD
8742 (application:openFileWithoutUI:, application:openFiles:): Open file
8743 if not_in_argv returns non-zero (bug#12171).
8744
32bcadb4 8745 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
8746 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8747 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
8748 (xg_get_font_name): Use those functions/macros here.
8749 Reported by Frans Oilinki <moilinki@gmail.com>.
8750
9ff9402d 87512012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
8752
8753 * unexmacosx.c (copy_data_segment): Copy initialized data in
8754 statically linked libraries from input file rather than memory.
8755
db74a5fc
YM
8756 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8757 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8758 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8759
25e65510
GM
87602012-08-10 Glenn Morris <rgm@gnu.org>
8761
8762 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8763 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8764
7961135c
DA
87652012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8766
8767 Fix last change to allow compilation with low optimization levels.
8768 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8769 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8770
42b3a444
DA
87712012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8772
8773 Use common inline syntax in intervals.h.
8774 * intervals.h (INTERVALS_INLINE): New macro.
8775 Change all users from LISP_INLINE.
8776
9fb0c957
DA
87772012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8778
8779 Define Qnone once for all platforms.
8780 * frame.c (Qnone): Define here.
8781 (syms_of_frame): DEFSYM it.
8782 * lisp.h (Qnone): New declaration.
8783 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8784 * xfns.c: Remove duplication. Adjust users.
8785
65e8ee52
DA
87862012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8787
8788 Remove unused macros from intervals.h.
8789 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8790 * intervals.c: Adjust comment.
8791
9b855fd6
EZ
87922012-08-10 Eli Zaretskii <eliz@gnu.org>
8793
8794 * w32fns.c <w32_unicode_gui>: New static variable.
8795 (globals_of_w32fns): Initialize it according to os_subtype.
8796 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8797 testing os_subtype.
8798
39cb9e56 87992012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
8800 Eli Zaretskii <eliz@gnu.org>
8801
8802 Fix bug #10299 with Unicode characters sent by customized
8803 keyboards created by MSKLC.
8804 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8805 (w32_init_class): Use it to initialize the Emacs class with either
8806 ANSI or Unicode API calls.
8807 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8808 later.
8809 (w32_wnd_proc): If the character code sent by WM_CHAR or
8810 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8811 original message. Call DefWindowProcW on NT and later.
8812
9374581a
GM
88132012-08-10 Glenn Morris <rgm@gnu.org>
8814
4b94e8cf
GM
8815 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8816
9374581a
GM
8817 * lisp.h (DIRECTORY_SEP): Let configure set it.
8818
a2752828
DA
88192012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8820
8821 Use TSET for write access to Lisp_Object slots of struct terminal.
8822 * termhooks.h (TSET): New macro.
8823 * coding.c, terminal.c, xselect.c: Adjust users.
8824
cc92c454
SM
88252012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8826
8827 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8828 the failing expression, include them in the error message.
8829 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8830 * lisp.h (internal_condition_case_n): Update declaration.
8831
4cb3e6b3
DA
88322012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8833
8834 Inline functions to examine and change buffer overlays.
8835 * buffer.c (unchain_both): New function.
8836 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8837 (buffer_has_overlays): New function.
8838 (enum overlay_type): New enum.
8839 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8840 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8841
8707c1e5
DA
88422012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8843
8844 Inline functions to examine and change buffer intervals.
8845 * alloc.c (mark_interval_tree): Remove.
8846 (MARK_INTERVAL_TREE): Simplify.
8847 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8848 * intervals.c (buffer_balance_intervals): New function.
8849 (graft_intervals_into_buffer): Adjust indentation.
8850 (set_intervals_multibyte): Simplify.
8851 * buffer.h (BUF_INTERVALS): Remove.
8852 (buffer_get_intervals, buffer_set_intervals): New function.
8853 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8854 * intervals.c, textprop.c: Adjust users.
8855
ad8c997f
DA
88562012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8857
8858 Inline functions to examine and change string intervals.
8859 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8860 (string_get_intervals, string_set_intervals): New function.
8861 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8862 * lread.c, print.c, textprop.c: Adjust users.
8863
32ac3a6b
GM
88642012-08-08 Glenn Morris <rgm@gnu.org>
8865
8866 * lisp.mk (lisp): Remove language/persian.elc.
8867
77c7bcb1
DA
88682012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8869
8870 Cleanup intervals.
8871 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8872 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
8873 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8874 Adjust comment. Move under #if 0.
77c7bcb1
DA
8875 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8876 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8877
9c08a8d4
DA
88782012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8879
8880 Check total length of intervals with eassert.
8881 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8882 * intervals.c: Change all users to eassert.
8883
26d16b35
EZ
88842012-08-07 Eli Zaretskii <eliz@gnu.org>
8885
14ae4239
BT
8886 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8887 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
8888 INTERNAL_FIELD in Lisp_Cons.
8889
c644523b
DA
88902012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8891
8892 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8893 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8894 name since all xname users are fixed long time ago. Do not
8895 use INTERNAL_FIELD.
8896 (set_symbol_name, set_symbol_function, set_symbol_plist):
8897 (set_symbol_next, set_overlay_plist): New function.
8898 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8899 (struct Lisp_Overlay): Likewise.
8900 (CVAR, MVAR, SVAR): Remove.
8901 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8902 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8903 * xterm.c: Adjust users.
8904 * .gdbinit: Change to use name field of struct Lisp_Symbol
8905 where appropriate.
8906
6a3d20cc
DA
89072012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8908
8909 Basic functions to set Lisp_Object and pointer slots of intervals.
8910 * intervals.h (interval_set_parent, interval_set_object):
8911 (interval_set_left, interval_set_right, interval_set_plist):
8912 (interval_copy_parent): New function.
8913 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
8914 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8915 Adjust indentation.
6a3d20cc
DA
8916 (INTERVAL_SIZE): Remove. Adjust users.
8917 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8918
4d2b044c
DA
89192012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8920
8921 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8922 * process.h (PGET): Remove.
8923 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8924 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8925
d3d50620
DA
89262012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8927
8928 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8929 * window.h (WGET): Remove.
8930 (struct window): Do not use INTERNAL_FIELD.
8931 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8932 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8933 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8934 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8935 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8936 Adjust users.
8937
d10a51dc
CY
89382012-08-07 Chong Yidong <cyd@gnu.org>
8939
8940 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8941 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8942 (Fdelete_window_internal): Signal an error if the window is not on
8943 a live frame (Bug#12025).
8944
e69b0960
DA
89452012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8946
8947 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8948 * frame.h (FGET): Remove.
8949 (struct frame): Do not use INTERNAL_FIELD.
8950 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8951 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8952 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8953 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8954
25a20a3a
JB
89552012-08-06 Juanma Barranquero <lekktu@gmail.com>
8956
8957 * w32.c: Silence compiler warnings.
8958 (map_w32_filename): Remove unused variable `is_fat'.
8959 (chase_symlinks): Add parentheses around expression.
8960
1c6f11f4
GM
89612012-08-06 Glenn Morris <rgm@gnu.org>
8962
1db4583a
GM
8963 * sysdep.c: Respect BROKEN_GETWD.
8964
1c6f11f4
GM
8965 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8966 Let configure handle it.
8967 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8968
2b90362b
DA
89692012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8970
8971 Use GCALIGNMENT where appropriate.
8972 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8973 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8974 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8975
5f50daf2
EZ
89762012-08-06 Eli Zaretskii <eliz@gnu.org>
8977
14ae4239
BT
8978 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8979 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 8980
cbcc7007
SM
89812012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8982
8983 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8984 that should be sufficient for everyone.
8985
4d365fa4
JD
89862012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8987
8988 * keyboard.c (timer_check_2): Add break so timer_check returns next
8989 timeout.
8990
dd86bd82
DA
89912012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8992
8993 Fix Windows build errors introduced after converting to WGET and WSET.
8994 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8995 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8996
054e1668
JD
89972012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8998
8999 * nsterm.m (ns_frame_rehighlight): Use FSET.
9000
9001 * nsmenu.m (ns_update_menubar): Use FSET.
9002
21238f11
DA
90032012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9004
9005 Separate read and write access to Lisp_Object slots of Lisp_Process.
9006 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9007 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9008
077288cf
DA
90092012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9010
9011 Separate read and write access to Lisp_Object slots of struct window.
9012 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9013 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9014 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9015 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9016 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9017 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9018 Adjust users.
9019
71688bd7
DA
90202012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9021
9022 Fix Windows build errors introduced after converting to FGET and FSET.
9023 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9024 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9025 (w32_judge_scroll_bars): Change to use FSET.
9026 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9027
f99bac93
DA
90282012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9029
9030 Fix replacement typo.
9031 * window.c (replace_window): Set root_window instead of
9032 selected_window. This fixes a total window subsystem
9033 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9034
8c2a0f2d
GM
90352012-08-06 Glenn Morris <rgm@gnu.org>
9036
9037 * lisp.mk (lisp): Add language/persian.elc.
9038
edd74c35
DA
90392012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9040
9041 Separate read and write access to Lisp_Object slots of struct frame.
9042 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9043 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9044 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9045 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9046 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9047
8671676c
AS
90482012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9049
9050 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9051
663e2b3f
DA
90522012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9053
9054 Generalize common compile-time constants.
9055 * lisp.h (header_size, bool_header_size, word_size): Now here.
9056 (struct Lisp_Vector): Add comment.
9057 (struct Lisp_Bool_Vector): Move up to define handy constants.
9058 (VECSIZE, PSEUDOVECSIZE): Simplify.
9059 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9060 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9061 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9062 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9063 * xfont.c, xmenu.c: Use word_size where appropriate.
9064
d32e47af
LM
90652012-08-05 Lawrence Mitchell <wence@gmx.li>
9066
9067 * search.c (Freplace_match): Treat \? in the replacement text
9068 literally (Bug#8161).
9069
e5d9c0d1
CY
90702012-08-05 Chong Yidong <cyd@gnu.org>
9071
9072 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9073 * frame.c (Vdelete_frame_functions):
9074 * emacs.c (Vkill_emacs_hook): Doc fix.
9075
8da0576b
EZ
90762012-08-04 Eli Zaretskii <eliz@gnu.org>
9077
9078 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9079 --with-x-toolkit=no builds.
9080 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9081
02676e5d
CY
90822012-08-04 Chong Yidong <cyd@gnu.org>
9083
9084 * syntax.c (Fmodify_syntax_entry): Doc fix.
9085
97147da9
EZ
90862012-08-04 Eli Zaretskii <eliz@gnu.org>
9087
76151e2c
EZ
9088 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9089 * w32.c (init_environment): Change the default values of many
9090 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
9091 them into environment when they were not already defined.
9092 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 9093 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
9094 (check_windows_init_file): Now external, not static.
9095 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
9096 called when Vload_path is already set up.
9097
9098 * w32.h (check_windows_init_file): Add prototype.
9099
9100 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9101 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9102 compatibility with Posix platforms.
9103 (main): Move the call to check_windows_init_file to here from
9104 w32.c.
9105 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9106 any, in the DEFALT argument into the root of the Emacs build or
9107 installation tree, as appropriate.
9108
9109 * callproc.c (init_callproc_1): Call decode_env_path instead of
9110 doing its equivalent by hand.
9111 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9112 the code that sets Vexec_path run on MS-Windows.
9113
9114 * lread.c (init_lread): Add comments to #ifdef's.
9115
97147da9
EZ
9116 * msdos.c (dos_set_window_size, IT_update_begin)
9117 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9118 instead of direct references.
9119
185ee146
PE
91202012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9121
9122 Export DEFAULT_REHASH_* to GDB.
9123 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9124 Now constants, not macros.
9125
8834c57a
PE
91262012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9127
98c6f1e3
PE
9128 Remove unnecessary casts involving pointers.
9129 These casts are no longer needed now that we assume C89 or later,
9130 since they involve casting to or from void *.
9131 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9132 (make_pure_float, make_pure_vector):
9133 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9134 * macros.c (Fstart_kbd_macro):
9135 * menu.c (find_and_return_menu_selection):
9136 * minibuf.c (read_minibuf_noninteractive):
9137 * sysdep.c (closedir):
9138 * xdisp.c (x_produce_glyphs):
9139 * xfaces.c (compare_fonts_by_sort_order):
9140 * xfns.c (x_real_positions, select_visual):
9141 * xselect.c (x_stop_queuing_selection_requests)
9142 (x_get_window_property, x_get_window_property_as_lisp_data):
9143 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9144 Remove unnecessary pointer casts.
9145 * alloc.c (record_xmalloc): New function.
9146 * lisp.h (record_xmalloc): New decl.
9147 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9148 more like a function. This is because the pointer cast is not
9149 needed. All uses changed.
9150 * print.c (print_string, print_error_message): Avoid length recalc.
9151
8834c57a
PE
9152 Improve fix for macroexp crash with debugging (Bug#12118).
9153 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9154 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9155 not supposed to be invoked from the garbage collector.
9156 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9157 (gc_aset): New function, which is like ASET but can be
9158 used in the garbage collector.
9159 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9160 (set_hash_index): Use it instead of ASET.
9161
6dad7178
EZ
91622012-08-03 Eli Zaretskii <eliz@gnu.org>
9163
9164 Support symlinks on latest versions of MS-Windows.
9165 * w32.c: Include winioctl.h and aclapi.h.
9166 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9167 (revert_to_self): Forward declarations of static functions.
9168 <static BOOL g_b_init_get_security_info>:
9169 <g_b_init_create_symbolic_link>: New static flags.
9170 (globals_of_w32): Initialize them to zero.
9171 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9172 (map_w32_filename): Improve commentary. Simplify switch.
9173 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9174 headers (most versions of MinGW w32api don't).
9175 (get_security_info, create_symbolic_link)
9176 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9177 New functions.
9178 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9179 in the argument file name.
9180 (sys_access): Call unc_volume_file_attributes only if
9181 GetFileAttributes fails with network-related error codes.
9182 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9183 have the required privileges.
14ae4239 9184 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
9185 get_file_security_desc.
9186 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
9187 with addition of handling of symlinks and support for 'lstat'.
9188 If possible, get file's attributes and security information by
6dad7178
EZ
9189 handle, not by name. Produce S_IFLNK bit for symlinks, when
9190 called from 'lstat'.
9191 (stat, lstat): New functions, call 'stat_worker'.
9192 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9193 symlinks when the underlying filesystem supports them.
9194
f162bcc3
PE
91952012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9196
79ea6c20
PE
9197 Fix macroexp crash on Windows with debugging (Bug#12118).
9198 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9199 checking subscripts; problem introduced with the recent
9200 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9201 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9202 since it's used in non-static inline functions now.
9203
c0ce93fd
PE
9204 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9205 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 9206
f162bcc3
PE
9207 Use C99-style 'extern inline' if available.
9208 * buffer.h (BUFFER_INLINE):
9209 * category.h (CATEGORY_INLINE):
9210 * character.h (CHARACTER_INLINE):
9211 * charset.h (CHARSET_INLINE):
9212 * composite.h (COMPOSITE_INLINE):
9213 * dispextern.h (DISPEXTERN_INLINE):
9214 * lisp.h (LISP_INLINE):
9215 * systime.h (SYSTIME_INLINE):
9216 New macro, replacing 'static inline' in this header.
9217 * buffer.h, category.h, character.h, charset.h, composite.h:
9218 * dispextern.h, lisp.h, systime.h:
9219 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9220 * alloc.c (LISP_INLINE):
9221 * buffer.c (BUFFER_INLINE):
9222 * category.c (CATEGORY_INLINE):
9223 * character.c (CHARACTER_INLINE):
9224 * charset.c (CHARSET_INLINE):
9225 * composite.c (COMPOSITE_INLINE):
9226 * dispnew.c (DISPEXTERN_INLINE):
9227 * sysdep.c (SYSTIME_INLINE):
9228 Define to EXTERN_INLINE, so that the corresponding functions
9229 are compiled into code.
9230 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9231 (INLINE_HEADER_END): New macros.
9232 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9233 since it's used in non-static inline functions now.
a8333d03 9234 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 9235
837b365b
GM
92362012-08-02 Glenn Morris <rgm@gnu.org>
9237
d66b744d
GM
9238 * s/: Remove empty directory.
9239
837b365b
GM
9240 * s/ms-w32.h: Move to ../nt/inc.
9241 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9242 Update for new ms-w32.h location.
9243
13294f95
PE
92442012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9245
9246 Port to Solaris 8.
9247 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9248
90df0db3
GM
92492012-08-02 Glenn Morris <rgm@gnu.org>
9250
9251 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9252 hard-coding the path separator.
9253
4939150c
PE
92542012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9255
9256 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9257 This how ASET and AREF are supposed to work, and makes
9258 it easier to think about future improvements. See
9259 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9260 * charset.h (set_charset_attr): New function.
9261 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9262 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9263 (aref_addr): New function. All uses of &AREF(...) changed.
9264 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9265 (set_hash_index): New functions. All lvalue-style uses of
9266 HASH_KEY etc. changed.
9267 * keyboard.c (set_prop): New function. All lvalue-style uses
9268 of PROP changed.
9269
947b2afd
AA
92702012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9271
9272 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9273 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 9274 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
9275 * nsfns.m (ns_set_name_as_filename): Likewise.
9276 * nsmenu.m (ns_update_menubar): Likewise.
9277 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9278
4f5d0325
EZ
92792012-08-01 Eli Zaretskii <eliz@gnu.org>
9280
2008beae
EZ
9281 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9282 Adapt to latest changes in field names of the corresponding Lisp
288479f6 9283 objects.
2008beae 9284
4f5d0325
EZ
9285 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9286
fe3cc771
GM
92872012-08-01 Glenn Morris <rgm@gnu.org>
9288
9289 * s/msdos.h: Remove file.
9290 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9291 * Makefile.in (S_FILE): Remove.
9292 (config_h): Remove S_FILE.
9293
c90acc54
JB
92942012-08-01 Juanma Barranquero <lekktu@gmail.com>
9295
9296 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9297 Remove; moved to nt/config.nt.
9298
d8a05828
DA
92992012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9300
9301 Use INTERNAL_FIELD for conses and overlays.
9302 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9303 Remove obsolete comment.
9304 (MVAR): New macro.
9305 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9306 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9307
8271d590
DA
93082012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9309
9310 Use INTERNAL_FIELD for symbols.
9311 * lisp.h (SVAR): New macro. Adjust users.
9312 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9313 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9314
3193acd2
DA
93152012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9316
9317 Use INTERNAL_FIELD for processes.
9318 * process.h (PVAR): New macro. Adjust style.
9319 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9320 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9321
3a45383a
DA
93222012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9323
9324 Use INTERNAL_FIELD for windows.
9325 * window.h (WVAR): New macro.
9326 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9327 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9328 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9329 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9330 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9331 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9332
c1dbc63c
PE
93332012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9334
9335 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9336
5c0c0e8a
GM
93372012-08-01 Glenn Morris <rgm@gnu.org>
9338
9339 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9340 Move to configure.ac.
9341
552a99b4
JB
93422012-08-01 Juanma Barranquero <lekktu@gmail.com>
9343
9344 * makefile.w32-in (CONFIG_H): Update dependencies.
9345 (CONF_POST_H): New macro.
9346
9347 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9348
8d8e2dfe
GM
93492012-07-31 Glenn Morris <rgm@gnu.org>
9350
bc96620a
GM
9351 * Makefile.in (S_FILE): No longer set by configure.
9352
476b1b2d
GM
9353 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9354 is available.
9355 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9356
b2c7a106
GM
9357 * process.h (NULL_DEVICE):
9358 * emacs.c (SEPCHAR):
9359 * editfns.c (USER_FULL_NAME): Let configure set them.
9360
d53d062a
GM
9361 * s/README, s/template.h: Remove files.
9362
4515017f
GM
9363 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9364
8d8e2dfe
GM
9365 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9366 Move to configure.ac.
9367
5b20b3cc
EZ
93682012-07-31 Eli Zaretskii <eliz@gnu.org>
9369
1e0afd9a
EZ
9370 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9371 resulting renaming of 'struct frame' members.
9372
5b20b3cc
EZ
9373 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9374
9375 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9376 after introduction of FVAR.
9377
f1310128
JD
93782012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9379
79e721e0
JD
9380 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9381
9382 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9383 instead of compositeToPoint.
9384 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9385
8d7c7eed 9386 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 9387
e34f7f79
DA
93882012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9389
9390 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9391 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 9392 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
9393 (BVAR): Change to use INTERNAL_FIELD.
9394 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9395 (KVAR): Change to use INTERNAL_FIELD.
9396 * frame.h (FVAR): New macro.
9397 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
9398 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9399 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9400 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
9401 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9402
c09bfb2f
DA
94032012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9404
9405 Miscellaneous fixes for non-default X toolkits.
9406 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9407 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9408 Move under #ifdef USE_LUCID.
9409 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9410 definition and usage to avoid warnings.
9411
14c114ae
JD
94122012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9413
9414 * nsterm.m (openFiles): Fix previous checkin.
9415
3bd21e82
PE
94162012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9417
9418 * indent.c (compute_motion): Remove unused local.
9419
c1529ded
GM
94202012-07-31 Glenn Morris <rgm@gnu.org>
9421
400d5621
GM
9422 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9423
268e2432
GM
9424 * conf_post.h [USG5_4]:
9425 Move remaining contents of s/usg5-4-common.h here.
9426 * s/usg5-4-common.h: Remove file.
9427
7552f3ee
GM
9428 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9429 * s/irix6-5.h: Remove file.
9430
6a381852
GM
9431 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9432 * s/darwin.h: Remove file.
9433
c1529ded
GM
9434 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9435 * s/hpux10-20.h: Remove file, which is now empty.
9436
b429a4ee
GM
94372012-07-30 Glenn Morris <rgm@gnu.org>
9438
9439 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9440 * Makefile.in (config_h): Add conf_post.h.
9441 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9442
adff3182
JD
94432012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9444
9445 * nsterm.m (ns_do_open_file): New variable.
b9031d69 9446 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
9447 (openFile, openTempFile, openFileWithoutUI, openFiles):
9448 Open files only if ns_do_open_file.
adff3182 9449
c32af1e4
PE
94502012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9451
7393bcbb
PE
9452 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9453 This no-op macro hasn't been needed for many years.
9454 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9455
c32af1e4
PE
9456 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9457 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9458 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9459 gdb_make_enums_visible.
9460 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9461 (DIRECTORY_SEP): Now a constant, not a macro.
9462
302fc036
EZ
94632012-07-30 Eli Zaretskii <eliz@gnu.org>
9464
9465 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9466 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9467
9468 * w32term.c <w32_keyboard_codepage>: Renamed from
9469 keyboard_codepage and now external. All users changed.
9470
9471 * w32term.h: Add declaration of w32_keyboard_codepage.
9472
9473 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9474 the codepage to translate keys to Unicode. If this argument is
9475 -1, use the value returned by GetConsoleCP. All callers changed.
9476
88fb40b4
PE
94772012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9478
0aee6912
PE
9479 Update .PHONY listings in makefiles.
9480 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9481 bootstrap-clean, distclean, maintainer-clean, versioclean,
9482 extraclean, frc.
9483
88fb40b4
PE
9484 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9485 This is a bit clearer. Fix some commentary typos.
9486
0a763bd1
GM
94872012-07-30 Glenn Morris <rgm@gnu.org>
9488
32bac6d6
GM
9489 * s/netbsd.h: Let configure include signal.h if needed.
9490 Remove file, which is now empty.
9491
b65e7c46
GM
9492 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9493 Let configure set them.
9494 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9495 No more need to undefine.
0a763bd1 9496
169304bd
AS
94972012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9498
9499 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9500 non-single-byte char when adding meta modifier. (Bug#12090)
9501
6cd7a139
DA
95022012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9503
9504 Convert safe_call to use variable number of arguments.
9505 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9506 (safe_call2): Fix comment.
9507 * lisp.h (safe_call): Adjust prototype.
9508 * coding.c (encode_coding_object): Change to use safe_call2.
9509 * xfaces.c (merge_face_heights): Change to use safe_call1.
9510
d34d6ffc
GM
95112012-07-30 Glenn Morris <rgm@gnu.org>
9512
7b8a48e4 9513 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 9514 does that unconditionally. Remove file, which is now empty.
7b8a48e4 9515
d34d6ffc
GM
9516 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9517 Remove empty files.
9518
03a660a6
PE
95192012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9520
9521 Export to GDB most of lisp.h's remaining object-like macros.
9522 * lisp.h (min, max): Move earlier, because they're used earlier now.
9523 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9524 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9525 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9526 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9527 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9528 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9529 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9530 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9531 Now constants, for GDB. They need not be macros.
9532 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9533 Now constants, for GDB, as well as macros, for static initializers.
9534 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9535 Move to after the definition of struct Lisp_Char_Table,
9536 since the former now needs that type defined.
9537 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9538 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9539 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9540 New enums, for gdb_make_enums_visible.
9541 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 9542 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
9543 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9544 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9545 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9546 enum maxargs, enum MAX_ALLOCA.
9547 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9548 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9549 no longer needed, now that they are done in lisp.h.
9550
e499d0ee
DA
95512012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9552
9553 Cleanup string bytes checking.
9554 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9555 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9556 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9557 (check_sblock, compact_small_strings): Simplify.
9558
d5040d2d
PE
95592012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9560
9561 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9562 These macros are confusing and no longer need to be defined, as
9563 the enum values now suffice. All uses replaced with definiens.
9564 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9565
7f259ae6
JB
95662012-07-29 Juanma Barranquero <lekktu@gmail.com>
9567
9568 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9569 ($(BLD)/w32console.$(O)): Update dependencies.
9570
7e63e0c3
DA
95712012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9572
9573 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9574 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9575 time. Adjust users.
9576 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9577
ffd817eb
JD
95782012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9579
9580 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9581 setting sitelisp (Bug#12010).
9582
417a7a0e
EZ
95832012-07-29 Eli Zaretskii <eliz@gnu.org>
9584
14ae4239 9585 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
9586
9587 * w32heap.c (cache_system_info):
9588 * w32.c (sys_rename):
9589 * w32proc.c (find_child_console, sys_kill): All users changed.
9590
387d4d92
PE
95912012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9592
9593 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9594
55a6cca6
EZ
95952012-07-29 Eli Zaretskii <eliz@gnu.org>
9596
9597 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9598
dbcf001c
DA
95992012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9600
9601 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
9602 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9603 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 9604
e2688e4a
DA
96052012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9606
9607 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9608 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9609 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9610 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9611 (replace_range, replace_range_2, del_range_2): Change to eassert.
9612 * marker.c (byte_char_debug_check): Adjust style.
9613
b46a6a83
PE
96142012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9615
9616 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9617 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9618 long-ago-commented-out code that talks about "WIN32".
9619 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9620 All uses changed.
9621
e32a5799
PE
96222012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9623
9624 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9625 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9626 Simplify by using alignof.
9627 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9628 * lisp.h: Include <stdalign.h>.
9629 (GCALIGNMENT): New macro and constant.
9630 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9631 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9632 (stdalign): New macro, if not already defined.
9633
df81cd29
EZ
96342012-07-28 Eli Zaretskii <eliz@gnu.org>
9635
01bd1b0d
EZ
9636 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9637 * w32inevt.c: Include w32inevt.h.
9638 (w32_read_console_input): New inline function, calls either
9639 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9640 w32_console_unicode_input.
9641 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9642 (w32_kbd_patch_key, key_event): Use the codepage returned by
9643 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9644 (key_event): use uChar.UnicodeChar only if
9645 w32_console_unicode_input is non-zero.
9646
9647 * w32console.c: Include w32heap.h.
9648 <w32_console_unicode_input>: New global variable.
9649 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9650 family of Windows, zero otherwise.
9651
9652 * w32inevt.h: Declare w32_console_unicode_input.
9653
df81cd29
EZ
9654 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9655 --without-x. (Bug#11742)
9656
c20fdd9e
PE
96572012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9658
9659 Adjust GDB to reflect pvec_type changes (Bug#12036).
9660 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
9661 2012-07-04 changes to pseudovector representation.
9662 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 9663
32770973 96642012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
9665
9666 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9667 bus address.
9668 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9669
3438fe21
EZ
96702012-07-27 Eli Zaretskii <eliz@gnu.org>
9671
bcfbc9de
EZ
9672 * alloc.c (listn): Fix the order the arguments are consed onto the
9673 list.
9674
3438fe21
EZ
9675 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9676 enumeration constants, as PURE and HEAP are too general, and clash
9677 with other headers and sources, such as gmalloc.c and the
9678 MS-Windows system headers. All users changed.
9679
eeaea515
DA
96802012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9681
9682 Revert last save_excursion_save and save_excursion_restore changes.
9683 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9684 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9685
073c88c2
DA
96862012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9687
9688 Fix recently-introduced typos in Windows port.
9689 Reported by Martin Rudalics <rudalics@gmx.at>.
9690 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 9691 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 9692
4706125e
PE
96932012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9694
9695 Improve GDB symbol export (Bug#12036).
9696 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9697 arms of an 'if', not using conditional expressions; otherwise GDB
9698 complains about the types in the unevaluated arm when the argument
9699 is an integer literal.
9700 (xgetint): Simplify expression.
9701 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9702 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9703 Zaretskii in <http://bugs.gnu.org/12036#13>.
9704 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9705 needed now that we have gdb_make_enums_visible.
9706 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9707 (enum enum_USE_LSB_TAG):
9708 New enum types, packaging up enums that need to be exported to GDB.
9709
694b6c97
DA
97102012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9711
9712 Utility function to make a list from specified amount of objects.
9713 * lisp.h (enum constype): New datatype.
9714 (listn): New prototype.
9715 * alloc.c (listn): New function.
9716 (Fmemory_use_count, syms_of_alloc): Use it.
9717 * buffer.c (syms_of_buffer): Likewise.
9718 * callint.c (syms_of_callint): Likewise.
9719 * charset.c (define_charset_internal): Likewise.
9720 * coding.c (syms_of_coding): Likewise.
9721 * keymap.c (syms_of_keymap): Likewise.
9722 * search.c (syms_of_search): Likewise.
9723 * syntax.c (syms_of_syntax): Likewise.
9724 * w32.c (init_environment): Likewise.
9725 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9726 * xdisp.c (syms_of_xdisp): Likewise.
9727 * xfns.c (syms_of_xfns): Likewise.
9728
6195f384
DA
97292012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9730
9731 Fast save_excursion_save and save_excursion_restore.
9732 * lisp.h (struct Lisp_Excursion): New data type.
9733 (PVEC_EXCURSION): New pseudovector type.
9734 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9735 to deal with it. Adjust comments.
9736 (init_marker, attach_marker): New prototype.
9737 (unchain_marker): Adjust prototype.
9738 * marker.c (attach_marker): Change to global.
9739 (init_marker): New function.
9740 * alloc.c (Fmake_marker, build_marker): Use it.
9741 (build_marker): More easserts.
9742 (mark_object): Handle struct Lisp_Excursion.
9743 * editfns.c (save_excursion_save, save_excursion_restore):
9744 Reimplement to use struct Lisp_Excursion. Add comments.
9745
5eceb8fb
PE
97462012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9747
9748 Fix export of symbols to GDB (Bug#12036).
9749 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9750 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9751 emacs.c, as this is a more-suitable home. Had this been done earlier
9752 the fix for 12036 would have avoided some of the problems noted in
9753 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9754 would have been more obvious.
562157c8
PE
9755 * emacs.c: Do not include <verify.h>; no longer needed.
9756 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
9757 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9758 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9759 Remove; now done in lisp.h.
9760 * lisp.h (PUBLISH_TO_GDB): New macro.
9761 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9762 (DATA_SEG_BITS): Use it.
9763 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9764 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9765 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9766 not be usable in #if. This simplifies things.
9767
d6749401
JB
97682012-07-26 Juanma Barranquero <lekktu@gmail.com>
9769
9770 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9771
1781b9e9
PE
97722012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9773
d89518db 9774 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
9775 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9776 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9777 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9778 Adjust to changes in lisp.h and emacs.c, by using
9779 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9780 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9781 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9782 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9783 instead of gdb_valbits.
9784 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9785 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9786 instead of gdb_array_mark_flag.
9787 (xboolvector): Get size from $->size, not $->header.size.
9788 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9789 (xreload, hook-run, hookpost-run): Remove.
9790 * emacs.c: Include <verify.h>.
9791 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9792 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9793 Remove.
9794 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9795 (gdb_USE_LSB_TAG): New enum constants.
9796 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9797 Also define these as enum constants, so they're visible to GDB.
9798 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9799 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9800 as constants, so they're visible to GDB.
9801 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9802 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9803 Now enum constants, not macros, so they're visible to GDB.
9804 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9805 more convenient now. All uses changed.
9806 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9807 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9808
3628596a
DA
98092012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9810
9811 Explicitly free restriction data that are not needed anymore.
9812 * editfns.c (save_restriction_restore): Free restriction data.
9813
7abaf5cc
SM
98142012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9815
9816 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9817 add argument, tune behavior, and adjust all callers.
9818
71f88e00
PE
98192012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9820
9821 Use typedef for EMACS_INT, EMACS_UINT.
9822 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9823 than macros. This simplifies debugging in the usual case, since
9824 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9825 and it allows expressions involving EMACS_INT casts.
9826 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9827
57ec3034
JD
98282012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9829
9830 * nsterm.m (ns_read_socket): Return early if there is a modal
9831 window (Bug#12043).
9832
8137e7b3
MR
98332012-07-25 Martin Rudalics <rudalics@gmx.at>
9834
9835 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9836 that FOCUS-FRAME can be omitted.
9837
04e9897c
DA
98382012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9839
9840 Adjust buffer text indirection counters at the end of Fkill_buffer.
9841 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9842 buffer is definitely dead. This should really fix an issue reported
9843 by Christoph Scholtes again. (Bug#12007).
9844 (init_buffer_once): Initialize indirection counters of
9845 buffer_defaults and buffer_local_symbols (for sanity and safety).
9846
8a0484e1
EZ
98472012-07-24 Eli Zaretskii <eliz@gnu.org>
9848
9849 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9850 and continuation glyphs on tooltip frames, leave them at zero.
9851 Avoids continued lines in tooltips. (Bug#11832)
9852
fa691a83
DA
98532012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9854
9855 Simplify copy_overlay.
04e9897c 9856 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
9857 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9858
436bc8e0
EZ
98592012-07-23 Eli Zaretskii <eliz@gnu.org>
9860
9861 * print.c (print_object): Don't crash when a frame's name is nil
9862 or invalid. (Bug#12025)
9863
9864 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9865 it signals an error when a tooltip frame is being created.
9866
d7a7fda3
DA
98672012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9868
9869 Cleanup miscellaneous objects allocation and initialization.
9870 * alloc.c (allocate_misc): Change to static. Add argument to
9871 specify the subtype. Adjust comment and users.
9872 (build_overlay): New function.
9873 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9874 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9875 (allocate_misc): Remove prototype.
9876 (build_overlay): Add prototype.
9877
98782012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
9879
9880 Swap buffer text indirection counters in Fbuffer_swap_text.
9881 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9882 This avoids crash reported by Christoph Scholtes at
9883 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9884
9d7fa573
JD
98852012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9886
9887 * nsmenu.m (Popdown_data): New struct.
9888 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9889 free Popdown_data.
9890 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9891 (initWithContentRect): Make imgView and contentView non-static
9892 and autorelease them. Also autorelease img and matrix (Bug#12005).
9893 (dealloc): Remove (Bug#12005).
9894
0dd6d66d
DA
98952012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9896
9897 Adjust consing_since_gc when objects are explicitly freed.
9898 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9899 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9900 (free_cons, free_misc): Subtract object size from consing_since_gc.
9901
d36d71df
DA
99022012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9903
9904 Simplify and cleanup markers positioning code.
9905 * marker.c (attach_marker): More useful eassert.
9906 (live_buffer, set_marker_internal): New function.
9907 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9908 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9909
fb9ea40f
PE
99102012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9911
9912 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9913 as it's limited by the amount of memory, not by INT_MAX.
9914
2d5c5f7d
EZ
99152012-07-21 Eli Zaretskii <eliz@gnu.org>
9916
07fb592e
EZ
9917 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9918 in special-event-map. See the discussion at
9919 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9920 for the reasons.
9921
37a9eac8 9922 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
9923 info.dwItemData. Fixes crashes on 64-bit Windows.
9924 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 9925
c4328746
JD
99262012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9927
fc0c31f8 9928 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 9929 (conversationIdentifier): Return value is NSInteger.
784051c4 9930 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 9931
6e5d1c12
CY
99322012-07-21 Chong Yidong <cyd@gnu.org>
9933
9934 * window.c (decode_any_window): Signal an error if the window is
9935 on a dead frame (Bug#11984).
9936
9928463d
DA
99372012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9938
9939 Add indirection counting to speed up Fkill_buffer.
9940 * buffer.h (struct buffer): New member.
9941 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9942 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9943 base buffer indirection counter.
9944 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9945 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9946 through buffer list if indirection counter is 0.
9947
f8643a6b
DA
99482012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9949
9950 Extend the value returned by Fgarbage_collect with heap statistics.
9951 * alloc.c (Qheap): New symbol.
9952 (syms_of_alloc): DEFSYM it.
9953 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9954 (Fmemory_free): Remove.
9955 (syms_of_alloc): Don't defsubr it.
9956 * buffer.c (Fcompact_buffer): Remove.
9957 (syms_of_buffer): Don't defsubr it.
9958
dac616ff
DA
99592012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9960
9961 Make maybe_gc inline.
9962 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9963 * lisp.h (consing_since_gc, gc_relative_threshold)
9964 (memory_full_cons_threshold): Revert declaration.
9965 (maybe_gc): Remove prototype, define as inline.
9966 * alloc.c: Remove old commented-out code.
9967 (consing_since_gc, gc_relative_threshold)
9968 (memory_full_cons_threshold): Revert to global.
9969 (maybe_gc): Remove.
9970
d7ea76b4
DA
99712012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9972
9973 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9974 * lisp.h (build_unibyte_string): New function.
9975 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9976 * sysdep.c, w32fns.c, xfns.c: Use it.
9977 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9978 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9979 Adjust users accordingly.
9980 * font.h (font_open_by_name): Adjust prototype.
9981
765e61e3
DA
99822012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9983
9984 Cleanup calls to Fgarbage_collect.
9985 * lisp.h (maybe_gc): New prototype.
9986 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9987 Remove declarations.
9988 * alloc.c (maybe_gc): New function.
9989 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9990 Make them static.
9991 * bytecode.c (MAYBE_GC): Use maybe_gc.
9992 * eval.c (eval_sub, Ffuncall): Likewise.
9993 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9994 to avoid dependency from auto-save feature.
9995
52b852c7
PE
99962012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9997
9998 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9999 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10000 'for_each_per_buffer_object_at'.
10001 All uses changed. It's better to use upper-case for macros that
10002 cannot be implemented as functions, to give the reader a clue
10003 that they're special.
10004
5db81e33
SM
100052012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10006
10007 * alloc.c (Fgarbage_collect): Tweak docstring.
10008
5b835e1d
DA
100092012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10010
10011 Tweak the value returned from Fgarbage_collect again.
10012 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10013 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10014 Adjust documentation.
10015 (total_vector_bytes): Rename to total_vector_slots, adjust
10016 accounting.
10017 (total_free_vector_bytes): Rename to total_free_vector_slots,
10018 adjust accounting.
10019 (Qstring_bytes, Qvector_slots): New symbols.
10020 (syms_of_alloc): DEFSYM them.
10021
9cd47b72
DA
100222012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10023
10024 Buffer compaction primitive which may be used from Lisp.
10025 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10026 (syms_of_buffer): Register Fcompact_buffer.
10027 * alloc.c (Fgarbage_collect): Use compact_buffer.
10028 * buffer.h (compact_buffer): New prototype.
10029 (struct buffer_text): New member.
10030
d17337e5
DA
100312012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10032
10033 New macro to iterate over all buffers, miscellaneous cleanups.
10034 * lisp.h (all_buffers): Remove declaration.
10035 * buffer.h (all_buffers): Add declaration, with comment.
10036 (for_each_buffer): New macro.
10037 * alloc.c (Fgarbage_collect, mark_object): Use it.
10038 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10039 (init_buffer): Likewise.
10040 * data.c (Fset_default): Likewise.
10041 * coding.c (code_conversion_restore): Remove redundant check
10042 for dead buffer.
10043 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10044
60cfd278
AS
100452012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10046
10047 Fix bug that created negative-length intervals.
10048 * intervals.c (merge_interval_right, merge_interval_left):
10049 Do not zero out this interval if it is absorbed by its children,
10050 as this interval's total length doesn't change in that case. See
10051 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10052
d06714cb
PE
100532012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10054
83713154
PE
10055 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10056 when invoking (make-bool-vector N t) and N is a positive
10057 multiple of 8 -- the last 8 bits were mistakenly cleared.
10058
d06714cb
PE
10059 Remove some struct layout assumptions in bool vectors.
10060 * alloc.c (bool_header_size): New constant.
10061 (header_size, word_size): Move earlier, as they're now used earlier.
10062 Use 'word_size' in a few more places, where it's appropriate.
10063 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10064 padding before the data member of a bool vector.
10065 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10066 than doing the check by hand with an abort ().
10067
464d5a5e
SM
100682012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10069
5fbc0409
SM
10070 * eval.c (Fdefvar): Don't check constants since we only set the var if
10071 it's not yet defined anyway (bug#11904).
10072
464d5a5e
SM
10073 * lisp.h (last_undo_boundary): Declare new var.
10074 * keyboard.c (command_loop_1): Set it.
10075 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10076 were auto-added by the command loop (bug#11774).
10077
8dc2e44a
AS
100782012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10079
10080 * w32font.c (Qsymbol): Remove local definition.
10081 (syms_of_w32font): Don't DEFSYM it.
10082
169925ec
DA
100832012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10084
10085 Fix sweep_vectors to handle large bool vectors correctly.
10086 * alloc.c (sweep_vectors): Account total_vector_bytes for
10087 bool vectors larger than VBLOCK_BYTES_MAX.
10088
5fbfb018
CY
100892012-07-18 Chong Yidong <cyd@gnu.org>
10090
10091 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10092 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10093
3ab6e069
DA
100942012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10095
10096 Return more descriptive data from Fgarbage_collect.
10097 Suggested by Stefan Monnier in
10098 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10099 * alloc.c (bounded_number): New function.
10100 (total_buffers, total_vectors): New variable.
10101 (total_string_size): Rename to total_string_bytes, adjust users.
10102 (total_vector_size): Rename to total_vector_bytes, adjust users.
10103 (sweep_vectors): Account total_vectors and total_vector_bytes.
10104 (Fgarbage_collect): New return value. Adjust documentation.
10105 (gc_sweep): Account total_buffers.
10106 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10107 (VECTOR_SIZE): Remove.
10108 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10109 (Qinterval, Qmisc): New symbols.
10110 (syms_of_data): Initialize them.
10111 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10112 (Qcons, Qbuffer): New declarations.
10113
6d02fe5b
PE
101142012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10115
10116 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10117 Round up, not down. Improve doc.
10118
b7ffe040
DA
101192012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10120
10121 Restore old code in allocate_string_data to avoid Faset breakage.
10122 Reported by Julien Danjou <julien@danjou.info> in
10123 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10124 * alloc.c (allocate_string_data): Restore old code with minor
10125 adjustments, fix comment to explain this subtle issue.
10126
4dc7c8d5
SM
101272012-07-17 Eli Zaretskii <eliz@gnu.org>
10128
10129 Remove FILE_SYSTEM_CASE.
10130 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10131
10132 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10133 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10134 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10135 call-process-region passes it through expand-file-name.
10136
10137 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10138
101392012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10140
10141 Fix crash when creating indirect buffer (Bug#11917)
10142 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10143 Don't handle unbound variables specially if non-zero.
10144 (Fbuffer_local_variables): Pass zero.
10145 (clone_per_buffer_values): Pass non-zero.
10146
101472012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10148
10149 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10150 to make the loop interruptible.
10151
101522012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10153
10154 * gnutls.c (emacs_gnutls_handshake): Only retry if
10155 GNUTLS_E_INTERRUPTED.
10156
cce7fefc
DA
101572012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10158
10159 Cleanup and convert miscellaneous checks to eassert.
10160 * alloc.c (mark_interval): Fix comment, partially rephrase
10161 old comment from intervals.h (see below).
10162 * intervals.c (find_interval, adjust_intervals_for_insertion)
10163 (delete_interval, adjust_intervals_for_deletion)
10164 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10165 Convert to eassert.
10166 (adjust_intervals_for_insertion, make_new_interval):
10167 Remove obsolete and unused code.
10168 * intervals.h (struct interval): Remove obsolete comment.
10169 * textprotp.c (erase_properties): Remove unused code.
10170 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10171 (Fremove_list_of_text_properties): Convert to eassert.
10172
9ea10cc3
CY
101732012-07-17 Chong Yidong <cyd@gnu.org>
10174
10175 * editfns.c (Finsert_char): Doc fix.
10176
3900d5de
DA
101772012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10178
10179 Fix previous change to make Fmemory_free always accurate.
10180 * alloc.c (make_interval): Update total_free_intervals.
10181 (make_float): Likewise for total_free_floats.
10182 (free_cons, Fcons): Likewise for total_free_conses.
10183 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10184 Likewise for total_free_vector_bytes.
10185 (Fmake_symbol): Likewise for total_free_symbols.
10186 (bytes_free): Remove.
10187
7098646f
DA
101882012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10189
10190 Simple free memory accounting feature.
10191 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10192 (sweep_vectors): Accumulate size of free vectors.
10193 (Fgarbage_collect): Setup bytes_free.
10194 (Fmemory_free): New function.
10195 (syms_of_alloc): Register it.
10196
22657b40
DA
101972012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10198
10199 Cleanup overlays checking.
10200 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10201 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10202 eassert and OVERLAYP.
10203 (sort_overlays): Change to use OVERLAYP.
10204
ddfc8813
RK
102052012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10206
10207 * editfns.c (Finsert_char): Make it interactive, and make the
10208 second arg optional. Copy interactive spec and docstring from
10209 ucs-insert.
10210
7c26cf3c
PE
102112012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10212
10213 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10214 Unlike the other wrapped functions, fabs has an unspecified
10215 effect on errno.
10216
5d127af9
JD
102172012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10218
10219 * nsterm.m (keyDown): Interpret flags without left/right bits
10220 as the left key (Bug#11670).
10221
6a0dd1d7
DA
102222012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10223
10224 Remove empty and useless init functions.
10225 * lisp.h (init_character_once, init_fns, init_image)
10226 (init_filelock, init_sound): Remove prototype.
10227 * character.c (init_character_once): Remove.
10228 * filelock.c (init_filelock): Likewise.
10229 * fns.c (init_fns): Likewise.
10230 * image.c (init_image): Likewise.
10231 * sound.c (init_sound): Likewise.
10232 * emacs.c (main): Adjust accordingly.
10233
7a6136fd
DA
102342012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10235
10236 * gtkutil.h: Tiny cleanups.
10237 (use_old_gtk_file_dialog): Remove useless declaration.
10238 (xg_uses_old_file_dialog): Add suggested const attribute.
10239
ce811ad9
EZ
102402012-07-15 Eli Zaretskii <eliz@gnu.org>
10241
10242 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10243 (bidi_paragraph_init): Use it to limit search forward for a strong
10244 directional character in abnormally large paragraphs full of
10245 neutral or weak characters. (Bug#11943)
10246
c9adfeaa
SF
102472012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10248
10249 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10250 the toolbar (Bug#9451).
10251 (xg_make_tool_item): Give the widget event box a transparent
10252 background.
10253
fff62aa9
DA
102542012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10255
10256 Cleanup basic allocation variables and functions.
10257 * alloc.c (ignore_warnings, init_intervals, init_float)
10258 (init_cons, init_symbol, init_marker): Remove.
10259 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10260 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10261 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10262 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10263 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10264 (staticidx, init_alloc_once, init_strings, free_ablock):
10265 Remove redundant initialization.
10266 * fns.c (init_weak_hash_tables): Remove.
10267 * lisp.h (init_weak_hash_tables): Remove prototype.
10268
9730daca
DA
102692012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10270
10271 Use zero_vector where appropriate.
10272 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10273 accordingly.
10274 * lisp.h (zero_vector): New declaration.
10275 * font.c (null_vector): Remove.
10276 (syms_of_font): Remove initialization and staticpro.
10277 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10278 * keymap.c (Faccessible_keymaps): Likewise.
10279
2e2d2a13
LL
102802012-07-15 Leo Liu <sdl.web@gmail.com>
10281
10282 * fringe.c: Fix typo in comments.
10283
cd276f6e
LL
102842012-07-14 Leo Liu <sdl.web@gmail.com>
10285
10286 * fringe.c: Add a new bitmap exclamation-mark.
10287
5a1131d9
EZ
102882012-07-14 Eli Zaretskii <eliz@gnu.org>
10289
10290 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10291
10292 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10293 (HAVE_MENUS): Don't define, defined by editing config.in with
10294 msdos/sed2v2.inp.
10295 (GMALLOC_INHIBIT_VALLOC): Don't define.
10296 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10297
22e983b7
JB
102982012-07-14 Juanma Barranquero <lekktu@gmail.com>
10299
10300 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10301
5b3f250f
GM
103022012-07-14 Glenn Morris <rgm@gnu.org>
10303
10304 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10305 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10306 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10307
33d63ff4
GM
103082012-07-13 Glenn Morris <rgm@gnu.org>
10309
5b633342
GM
10310 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10311
33d63ff4
GM
10312 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10313 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10314
b55b9f85
JD
103152012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10316
0dc8cf50
JD
10317 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10318 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10319 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10320 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10321 where appropriate.
10322 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10323 as boolean expression.
10324 (x_set_window_size): Remove unused variable toolbar.
10325 (ns_get_color_default, ns_mod_to_lisp): Remove.
10326 (ns_mouse_position): Remove unused variables xchar and ychar.
10327 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10328 (ns_set_vertical_scroll_bar): Remove unused variable count.
10329 (ns_delete_terminal): Remove unused variable i.
10330 (ns_term_init): Remove unused variables r, g and b.
10331 (mouseDown): Remove unused variable window.
10332 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10333 (initFrameFromEmacs): Remove unused variable vbextra.
10334 (mouseEntered): Remove unused variables p and dpyinfo.
10335 (mouseExited): Remove unused variables p and r.
10336 (ns_define_frame_cursor, ns_clear_frame_area)
10337 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10338 (menuDown): Assign [sender tag] to variable and cast the variable.
10339
10340 * nsterm.h (menuDown): Add id as type to argument sender.
10341 (ns_display_info_for_name): Add Lisp_Object argument.
10342 (ns_term_init): Add Lisp_Object argument.
10343 (ns_map_event_to_object): Add void argument.
10344 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10345 prototype with arguments and only declare if __OBJC__.
10346 (nxatoms_of_nsselect): Add void argument.
10347 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10348 (ns_alloc_autorelease_pool): Add void argument.
10349 (ns_release_autorelease_pool): Add void* argument.
10350 (ns_get_defaults_value): Add const char* argument.
10351
10352 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10353 (initFromContents): Use SSDATA where appropriate.
10354 (ns_update_menubar): Add braces to ambigous if-else.
10355 (initWithTitle): Put () around assignment in if statement.
10356 (ns_menu_show): Remove unused variables window and keymap.
10357 (update_frame_tool_bar): Remove unused variable selected_p.
10358 (initWithContentRect): Remove unused variable this_cmd_name.
10359
10360 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10361 appropriate.
10362 (setXBMColor): Remove unused variable len.
10363 (setPixmapData): Put () around assignment in loop statement.
10364
10365 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10366 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10367 where appropriate.
10368 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10369 around assignment in loop statement.
10370 (nsfont_open): Remove unused variable i.
10371 (nsfont_open): Remove unused variable len.
10372 (nsfont_draw): Remove unused variable cs.
10373
10374 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10375 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10376 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10377 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10378 (Fns_font_name, Fns_perform_service)
10379 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10380 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10381 (ns_set_name): Remove unused variable view.
10382 (x_set_menu_bar_lines): Remove unused variable olines.
10383 (x_set_tool_bar_lines): Remove unused variable root_window.
10384 (Fns_list_colors): Put () around assignment in while statement.
10385 (Fns_perform_service): Remove unused variable len.
10386 (Fns_display_usable_bounds): Remove unused variable top.
10387 (syms_of_nsfns): Remove unused variable i.
10388
b55b9f85
JD
10389 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10390 memcpy (Bug#11907).
10391
ed9265fc 103922012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
10393
10394 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10395 and free it with DestroyExceptionInfo (Bug#11558).
10396
ef099b57
JB
103972012-07-13 Juanma Barranquero <lekktu@gmail.com>
10398
10399 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10400 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10401 Set here, not in nt/config.nt.
10402
ea814a5d
EZ
104032012-07-13 Eli Zaretskii <eliz@gnu.org>
10404
10405 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10406 cursor overflow into the last glyph on display line when the right
10407 fringe is off. (Bug#11832)
10408
1a952767
PE
104092012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10410
10411 * xdisp.c (produce_special_glyphs): Now static.
10412 * dispextern.h (produce_special_glyphs): Remove decl.
10413
983188fd
GM
104142012-07-13 Glenn Morris <rgm@gnu.org>
10415
8d7c7eed 10416 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
10417 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10418
983188fd
GM
10419 * s/usg5-4-common.h (USG, USG5):
10420 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10421 * s/sol2-6.h (SOLARIS2):
10422 * s/irix6-5.h (IRIX6_5):
10423 * s/hpux10-20.h (USG, USG5, HPUX):
10424 * s/gnu-linux.h (USG, GNU_LINUX):
10425 * s/freebsd.h (BSD_SYSTEM):
10426 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10427 * s/cygwin.h (CYGWIN):
10428 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10429 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10430
d1e68667 104312012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
10432
10433 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 10434
6de0e799
GM
104352012-07-13 Glenn Morris <rgm@gnu.org>
10436
739ae010
GM
10437 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10438
dbee5793
GM
10439 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10440
6de0e799
GM
10441 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10442 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10443
b82da769
GM
104442012-07-12 Glenn Morris <rgm@gnu.org>
10445
4fae5a7a 10446 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
10447
10448 * process.c (init_process_emacs): Rename from init_process.
10449 The old name is also the name of a Mach system call.
10450 * lisp.h, emacs.c: Update for this name change.
10451 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10452 longer needed.
10453
5a979817
EZ
104542012-07-12 Eli Zaretskii <eliz@gnu.org>
10455
10456 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10457 memmove call that removes glyphs covered by the left truncation
10458 glyph. Improve commentary.
10459 (display_line): Fix display of continuation glyphs on GUI frames
10460 when the right fringe is turned off and variable-size fonts are
10461 used in the window. Move the code that appends a stretch glyph to
10462 produce_special_glyphs, so that it could be used for truncation
10463 and continuation glyphs alike.
10464 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10465 glyph of a suitably computed width, to align the special glyphs at
10466 the window margin. Code moved from display_line. (Bug#11832)
10467
3e91a053
GM
104682012-07-12 Glenn Morris <rgm@gnu.org>
10469
ba9e4b84
GM
10470 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10471
10472 * s/gnu-linux.h, s/hpux10-20.h:
10473 Do not unconditionally define HAVE_XRMSETDATABASE.
10474
3e91a053
GM
10475 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10476
b300b1f4
PE
104772012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10478
10479 Fix typos that broke OS X build.
10480 Reported by Randal L. Schwartz in
10481 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10482 * nsterm.m (ns_timeout): Add missing local decl.
10483 (ns_get_color): snprintf -> sprintf, to fix typo.
10484
6e777848
GM
104852012-07-12 Glenn Morris <rgm@gnu.org>
10486
3f922c37
GM
10487 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10488 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10489 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10490 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10491
0ab7b23a
GM
10492 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10493 Move PTY_OPEN to configure.
10494
6e777848
GM
10495 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10496 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10497 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10498
4a7edc24
DA
104992012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10500
10501 Use empty_unibyte_string where applicable.
10502 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10503 * lread.c (read1): Likewise.
10504 * xsettings.c (syms_of_xsettings): Likewise.
10505
308aab79
GM
105062012-07-12 Glenn Morris <rgm@gnu.org>
10507
42bd1719
GM
10508 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10509 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
10510 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10511 * s/hpux10-20.h (RUN_TIME_REMAP):
10512 * s/bsd-common.h (TABDLY): Move to configure.
10513
10514 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10515
10516 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10517
ea0bbd17 10518 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 10519 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
10520
10521 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 10522
308aab79
GM
10523 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10524 * s/template.h: Move NARROWPROTO to configure.
10525
ee1cf5cf
GM
105262012-07-11 Glenn Morris <rgm@gnu.org>
10527
30fe9bf4
GM
10528 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10529 unused since 2011-01-17 change to systty.h.
10530
ee1cf5cf
GM
10531 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10532 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10533 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10534
63e47e07
PE
105352012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10536
10537 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10538
c43fb4c3
GM
105392012-07-11 Glenn Morris <rgm@gnu.org>
10540
10541 * s/darwin.h, s/gnu-linux.h, s/template.h:
10542 Move INTERRUPT_INPUT to configure.
10543
e8df9267
DA
105442012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10545
10546 Minor adjustments to interning code.
10547 * lisp.h (intern, intern_c_string): Redefine as static inline
10548 wrappers for intern_1 and intern_c_string_1, respectively.
10549 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
10550 * lread.c (intern_1, intern_c_string_1, oblookup):
10551 Simplify Vobarray checking.
e8df9267
DA
10552 * font.c (font_intern_prop): Likewise. Adjust comment.
10553 * w32font.c (intern_font_name): Likewise.
10554
34348bd4
AS
105552012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10556
d96a1e0c
AS
10557 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10558
34348bd4
AS
10559 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10560 of Fcar/Fcdr if possible.
10561 * font.c (check_otf_features): Likewise.
10562 * fontset.c (Fnew_fontset): Likewise.
10563 * gnutls.c (Fgnutls_boot): Likewise.
10564 * minibuf.c (read_minibuf): Likewise.
10565 * msdos.c (IT_set_frame_parameters): Likewise.
10566 * xmenu.c (Fx_popup_dialog): Likewise.
10567 * w32menu.c (Fx_popup_dialog): Likewise.
10568
c8add24e
GM
105692012-07-11 Glenn Morris <rgm@gnu.org>
10570
4b575b3c
GM
10571 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10572 since nothing has defined it on these platforms.
10573
09f4e3b0
GM
10574 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10575 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10576
172bedef
GM
10577 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10578 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10579 Move CLASH_DETECTION to configure.
10580
249685df
GM
10581 * s/gnu.h: Remove file, which is now empty.
10582
c8add24e
GM
10583 * s/gnu.h, s/gnu-linux.h:
10584 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10585
b41253a3
JW
105862012-07-11 John Wiegley <johnw@newartisans.com>
10587
10588 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10589 function attribute, so we only use it if it exists in the
10590 compiler.
10591
d923b542
DA
105922012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10593
10594 Avoid call to strlen in fast_c_string_match_ignore_case.
10595 * search.c (fast_c_string_match_ignore_case): Change to use
10596 length argument. Adjust users accordingly.
10597 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10598
5ebbef1d
PE
105992012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10600
bb352260
PE
10601 Assume mkdir, rmdir.
10602 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10603 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10604
57054ddd
PE
10605 Assume rename.
10606 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10607
b747d3f7
PE
10608 Assume perror.
10609 * s/hpux10-20.h (HAVE_PERROR): Remove.
10610 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10611 Remove dummy definition, as this problem was obsolete long ago.
10612
5ebbef1d
PE
10613 Assume strerror.
10614 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10615
984e7f30
DA
106162012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10617
10618 Avoid calls to strlen in font processing functions.
10619 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
10620 (font_open_by_name): Change to use length argument.
10621 Adjust users accordingly.
d923b542
DA
10622 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10623 Adjust prototypes.
10624 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10625 Change to return ptrdiff_t.
984e7f30
DA
10626 (xfont_list_pattern, xfont_match): Use length returned by
10627 xfont_decode_coding_xlfd.
10628 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10629
20e94fdd
GM
106302012-07-11 Glenn Morris <rgm@gnu.org>
10631
9d596af3
GM
10632 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10633 Move DONT_REOPEN_PTY to configure.
10634
20e94fdd
GM
10635 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10636 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10637
e99a530f
PE
106382012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10639
22ffb973
PE
10640 Remove "#define unix" that is no longer needed (Bug#11905).
10641 * s/aix4-2.h (unix): Remove; no longer needed.
10642
e9a9ae03
PE
10643 EMACS_TIME simplification (Bug#11875).
10644 This replaces macros (which typically do not work in GDB)
10645 with functions, typedefs and enums, making the code easier to debug.
10646 The functional style also makes code easier to read and maintain.
10647 * systime.h: Include <sys/time.h> on all hosts, not just if
10648 WINDOWSNT, since 'struct timeval' is needed in general.
10649 (EMACS_TIME): Now a typedef, not a macro.
10650 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10651 not macros.
10652 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10653 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10654 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10655 (EMACS_TIME_LE): Now functions, not macros.
10656 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10657 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10658 which are not functions. All uses rewritten to use:
10659 (make_emacs_time): New function.
10660 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10661 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10662 not functions. All uses rewritten to use the following, respectively:
10663 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10664 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 10665 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
10666 * fileio.c (Fcopy_file):
10667 * xterm.c (XTflash): Get the current time closer to when it's used.
10668 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10669
ffacb126
PE
10670 * bytecode.c (targets): Suppress -Woverride-init warnings.
10671
e99a530f
PE
10672 Simplify by avoiding confusing use of strncpy etc.
10673 * doc.c (Fsnarf_documentation):
10674 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10675 * frame.c (Fmake_terminal_frame):
10676 * gtkutil.c (get_utf8_string):
10677 * lread.c (openp):
10678 * nsmenu.m (ns_update_menubar):
10679 * regex.c (regerror):
10680 Prefer memcpy to strncpy and strncat when either will do.
10681 * fileio.c (Fsubstitute_in_file_name):
10682 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10683 (menu_separator_name_p):
10684 * nsmenu.m (ns_update_menubar):
10685 Prefer memcmp to strncmp when either will do.
10686 * nsterm.m: Include <ftoastr.h>.
10687 (ns_get_color):
10688 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10689 Prefer snprintf to strncpy.
10690 * nsterm.m (ns_term_init):
10691 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10692 * nsterm.m (ns_term_init):
10693 Avoid the need for strncpy, by using build_string or
10694 make_unibyte_string directly. Use dtoastr, not snprintf.
10695 * process.c (Fmake_network_process): Diagnose service names that
10696 are too long, rather than silently truncating them or creating
10697 non-null-terminated names.
10698 (Fnetwork_interface_info): Likewise, for interface names.
10699 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10700 Prefer sprintf to strncat.
10701 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10702 Prefer vsnprintf to vsprintf + strncpy.
10703
c59592b3
GM
107042012-07-10 Glenn Morris <rgm@gnu.org>
10705
10706 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10707 Clarify fallback case.
10708
7d7bbefd
DA
107092012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10710
10711 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10712 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10713 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 10714 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
10715 where argument type is known to be a Lisp_Cons.
10716
3a4c8000
TT
107172012-07-10 Tom Tromey <tromey@redhat.com>
10718
10719 * bytecode.c (BYTE_CODE_THREADED): New macro.
10720 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10721 (enum byte_code_op): New type.
10722 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10723 (exec_byte_code): Use them. Use token threading when applicable.
10724
2a0213a6
DA
107252012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10726
10727 Optimize pure C strings initialization.
10728 * lisp.h (make_pure_string): Fix prototype.
10729 (build_pure_c_string): New function, defined as static inline. This
10730 provides a better opportunity to optimize away calls to strlen when
10731 the function is called with compile-time constant argument.
10732 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10733 argument, adjust users accordingly. Use build_pure_c_string where
10734 appropriate.
10735 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10736 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10737 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10738
cb1caeaf
DA
107392012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10740
10741 Avoid calls to strlen in miscellaneous functions.
10742 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10743 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10744 * lread.c (openp): Likewise.
10745
c293e30c
DA
107462012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10747
10748 Avoid calls to strlen in path processing functions.
10749 * fileio.c (file_name_as_directory): Add comment. Change to add
10750 srclen argument and return the length of result. Adjust users
10751 accordingly.
10752 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
10753 swap 1st and 2nd arguments to obey the common convention.
10754 Adjust users accordingly.
c293e30c
DA
10755 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10756
9e059e3f
GM
107572012-07-10 Glenn Morris <rgm@gnu.org>
10758
d02eb359
GM
10759 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10760 Move PENDING_OUTPUT_COUNT definition to configure.
10761
882cf227
GM
10762 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10763 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10764 * s/gnu.h (DATA_START): Move definitions to configure.
10765
af6e839f
GM
10766 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10767 We include usg5-4-common.h, which defines them both.
10768
40289a12
GM
10769 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10770 O_RDONLY already includes it).
10771
9e059e3f
GM
10772 Stop ns builds setting the EMACSLOADPATH environment variable.
10773 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10774 Now it does not set EMACSLOADPATH, just returns the load-path string.
10775 * nsterm.h: Update accordingly.
10776 * lread.c [HAVE_NS]: Include nsterm.h.
10777 (init_lread) [HAVE_NS]: Use ns_load_path.
10778 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10779
7c4e8ec0
GM
107802012-07-09 Glenn Morris <rgm@gnu.org>
10781
d4f600ff
GM
10782 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10783 since the included bsd-common.h does so.
10784
cbb31951
GM
10785 Stop ns builds setting the EMACSPATH environment variable.
10786 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10787 (ns_init_paths): Do not set EMACSPATH.
10788 * nsterm.h (ns_exec_path): Add it.
10789 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10790 Use ns_exec_path.
10791
7c4e8ec0
GM
10792 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10793
26bccfae
PE
107942012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10795
a0bee46f
PE
10796 * process.c (wait_reading_process_output): 'waitchannels' was unset
10797 when read_kbd || !NILP (wait_for_cell); fix this.
10798
5994c183
PE
10799 Add GCC-style 'const' attribute to functions that can use it.
10800 * character.h (char_resolve_modifier_mask):
10801 * keyboard.h (make_ctrl_char):
10802 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10803 (init_character_once, next_almost_prime, init_fns, init_image)
10804 (flush_pending_output, init_sound):
10805 * mem-limits.h (start_of_data):
10806 * menu.h (finish_menu_items):
10807 Add ATTRIBUTE_CONST.
10808 * emacs.c (DEFINE_DUMMY_FUNCTION):
10809 Declare the dummy function with ATTRIBUTE_CONST.
10810 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10811 Add decls with ATTRIBUTE_CONST.
10812
26bccfae
PE
10813 Minor improvements to make_formatted_string.
10814 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10815 where int is good enough, as vsprintf returns an int.
10816 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10817
a8290ec3
DA
108182012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10819
10820 Use make_formatted_string to avoid double length calculation.
10821 * lisp.h (make_formatted_string): New prototype.
10822 * alloc.c (make_formatted_string): New function.
10823 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 10824 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
10825 * editfns.c (Fcurrent_time_zone): Likewise.
10826 * filelock.c (get_boot_time): Likewise.
10827 * frame.c (make_terminal_frame, set_term_frame_name)
10828 (x_report_frame_params): Likewise.
10829 * image.c (gs_load): Likewise.
10830 * minibuf.c (get_minibuffer): Likewise.
10831 * msdos.c (dos_set_window_size): Likewise.
10832 * process.c (make_process): Likewise.
10833 * xdisp.c (ensure_echo_area_buffers): Likewise.
10834 * xsettings.c (apply_xft_settings): Likewise.
10835
d01ba2f1
GM
108362012-07-09 Glenn Morris <rgm@gnu.org>
10837
10838 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10839 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10840 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10841 * nsterm.h (ns_etc_directory): Add it.
10842 * callproc.c [HAVE_NS]: Include nsterm.h.
10843 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10844
f1f924b6
DA
108452012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10846
10847 Move marker debugging code under MARKER_DEBUG.
10848 * marker.c (MARKER_DEBUG): Move marker debugging code under
10849 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10850 for bootstrap with --enable-checking (~3x slowdown reported
10851 by Juanma Barranquero <lekktu@gmail.com>).
10852 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10853
ab531b66
PE
108542012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10855
10856 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10857 See <http://bugs.gnu.org/11825#29>.
10858
c4b3bc8a
EZ
108592012-07-08 Eli Zaretskii <eliz@gnu.org>
10860
10861 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10862 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
10863 (display_line): Add commentary about displaying truncation glyphs
10864 on GUI frames.
10865 (produce_special_glyphs): Move here from term.c.
10866
10867 * term.c (produce_special_glyphs): Move to xdisp.c.
10868
10869 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10870 section.
c4b3bc8a 10871
b676b881
AS
108722012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10873
f17c5273
AS
10874 * xdisp.c (display_line): Avoid warning about implicit declaration
10875 of FRAME_FONT.
10876
298819b9
AS
10877 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10878
b676b881
AS
10879 * lisp.h: Remove empty conditional.
10880
6045c4fd
PE
108812012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10882
b3350bf9
PE
10883 * lread.c (load_path_check): Now static.
10884
6045c4fd
PE
10885 Fix some minor --with-ns problems found by static checking.
10886 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10887 (x_set_font) [!HAVE_X_WINDOWS]:
10888 * image.c (xpm_load_image) [HAVE_NS]:
10889 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10890 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10891 Remove unused local.
10892 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10893 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10894 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10895 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10896 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10897 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10898 Fix pointer signedness problem.
10899 * xfaces.c (FRAME_X_FONT_TABLE):
10900 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10901
929e7845
GM
109022012-07-07 Glenn Morris <rgm@gnu.org>
10903
10904 * lread.c (load_path_check): New function, split from init_lread.
10905 (init_lread): Reorganize. Motivation:
10906 If EMACSLOADPATH is set, check/warn about that rather than the
10907 defaults, which we are not going to use. Hence we can remove
10908 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10909 Don't warn if site-lisp directories are missing.
10910 If not installed, start from a blank load-path, since
10911 PATH_LOADSEARCH refers to the eventual installation directories.
10912
58dd0aa4
EZ
109132012-07-07 Eli Zaretskii <eliz@gnu.org>
10914
10915 Support truncation and continuation glyphs on GUI frames, when
10916 fringes are disabled. (Bug#11832)
10917 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
10918 continuation glyphs even if on GUI frames.
10919 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
10920 or both, are absent.
10921 (start_display, move_it_in_display_line_to): Handle the case of a
10922 GUI frame without a fringe to display continuation or truncation
10923 glyphs.
10924 (insert_left_trunc_glyphs): Support GUI frames: make sure
10925 truncation glyphs overwrite enough glyphs from the current line to
10926 have sufficient space in pixels.
10927 (display_line): Support truncation and continuation glyphs on GUI
10928 frames. If some spare pixels are left on the line after inserting
10929 the truncation glyphs, fill that space with a stretch glyph of a
10930 suitably computed width.
10931
10932 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10933 produce_glyphs, to support GUI sessions.
10934
31571fd7
PE
109352012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10936
5a16b9bc
PE
10937 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10938
f3047c75
PE
10939 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10940
31571fd7
PE
10941 Do not require float-time's arg to fit in time_t (Bug#11825).
10942 This works better on hosts where time_t is unsigned, and where
10943 float-time is applied to the (negative) difference between two times.
10944 * editfns.c (decode_time_components): Last arg is now double *,
10945 not int *, and means to store all the result as a double, without
10946 worrying about whether the seconds part fits in time_t.
10947 All callers changed.
10948 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10949 All callers changed.
10950 (Ffloat_time): Do not fail merely because the specified time falls
10951 outside of time_t range.
10952
4516fbef
GM
109532012-07-07 Glenn Morris <rgm@gnu.org>
10954
10955 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10956 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10957 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10958
07adc2c6
JB
109592012-07-07 Juanma Barranquero <lekktu@gmail.com>
10960
10961 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10962 Update dependencies.
10963
10964 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10965
fd573f31
PE
109662012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10967
fee5959d
PE
10968 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10969 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10970 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10971 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10972 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10973 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10974
fd573f31
PE
10975 * xfont.c (compare_font_names): Redo to omit the need for casts.
10976
ddadbc0e
AS
109772012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10978
fca8d6b6
AS
10979 * xfns.c (Fx_change_window_property): Doc fix.
10980 * w32fns.c (Fx_change_window_property): Doc fix.
10981
ddadbc0e
AS
10982 * w32fns.c (Fx_window_property): Accept the same arguments as the
10983 X Windows version. Doc fix.
10984 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10985
ed9265fc 109862012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
10987 Eli Zaretskii <eliz@gnu.org>
10988
10989 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10990 Windows-specific code from nt/config.nt moved here.
10991 Obsolete settings removed.
10992
216ee680
PE
109932012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10994
10995 * process.c: Avoid unnecessary calls to gettime.
10996 (wait_reading_process_output): Don't get the time of day
10997 when gobbling data immediately and not waiting, as there's no need
10998 for it in that case. This removes a FIXME.
10999
bdd091e4
JD
110002012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11001
11002 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11003 is defined (Bug#11768).
11004
9d44f8ce
DA
110052012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11006
11007 Fix marker debugging code.
11008 * marker.c (byte_char_debug_check): Do not perform the check
11009 if buffer is not multibyte.
090bd7cb
JB
11010 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11011 Call byte_char_debug_check with correct arguments.
9d44f8ce 11012
90fc4786
DA
110132012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11014
11015 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
11016 * marker.c (byte_char_debug_check, count_markers):
11017 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
11018 (byte_debug_flag): Remove.
11019 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11020 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11021
7b7ae965
DA
110222012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11023
4e57b342
DA
11024 Avoid code repetition in marker-related functions.
11025 * marker.c (attach_marker): New function.
11026 (Fset_marker, set_marker_restricted, set_marker_both)
11027 (set_marker_restricted_both): Use it.
11028 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11029 Consistently rename charno to charpos.
11030 (marker_position): Add eassert.
11031 (marker_byte_position): Convert to eassert.
11032
110332012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11034
11035 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 11036 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 11037 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 11038
657924ff
DA
110392012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11040
11041 Introduce fast path for the widely used marker operation.
11042 * alloc.c (build_marker): New function.
11043 * lisp.h (build_marker): New prototype.
11044 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11045 * composite.c (autocmp_chars): Likewise.
11046 * editfns.c (buildmark): Remove.
11047 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11048 (save_restriction_save): Use build_marker.
11049 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11050 * window.c (save_window_save): Likewise.
11051
041a49a6
DA
110522012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11053
11054 Do not use Fdelete_overlay in delete_all_overlays
11055 to avoid redundant calls to unchain_overlay.
11056 * buffer.c (drop_overlay): New function.
11057 (delete_all_overlays, Fdelete_overlay): Use it.
11058 * minibuf.c (get_minibuffer): Fix comment.
11059
7dca65a4
PE
110602012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11061
11062 Port to OpenBSD 5.1 amd64.
11063 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11064 This is needed for OpenBSD, and should be harmless on all BSD systems.
11065 Also, include <sys/sysctl.h>, as it should be available on all
11066 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11067 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11068 use p_pid member, not kp_proc.pid.
11069
8eb876e2
GM
110702012-07-06 Glenn Morris <rgm@gnu.org>
11071
11072 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11073
38182d90
PE
110742012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11075
11076 More xmalloc and related cleanup.
11077 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11078 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11079 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11080 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11081 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11082 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11083 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11084 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11085 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11086 * xterm.c:
11087 Omit needless casts involving void * pointers and allocation.
11088 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11089 as the former is more robust if P's type is changed.
11090 Prefer xzalloc to xmalloc + memset 0.
11091 Simplify malloc-or-realloc to realloc.
11092 Don't worry about xmalloc returning a null pointer.
11093 Prefer xstrdup to xmalloc + strcpy.
11094 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11095 growing it.
11096 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11097 alloca of a constant.
11098
6dd5a677
EZ
110992012-07-05 Eli Zaretskii <eliz@gnu.org>
11100
11101 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11102 hscroll is larger than the line width. Fixes long and futile
11103 looping inside extend_face_to_end_of_line (on a TTY) producing
11104 glyphs that are not needed and thrown away.
11105
6b312f0f
DA
111062012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11107
11108 * marker.c (set_marker_restricted_both): Simplify by using
11109 clip_to_bounds.
11110
f520ef9b
PE
111112012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11112
11113 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11114
383b7c95
JD
111152012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11116
11117 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11118 not defined (Bug#11768).
11119 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11120 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11121 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11122 followed by gtk_box_set_homogeneous (Bug#11768).
11123 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
11124 (update_theme_scrollbar_width, xg_create_scroll_bar):
11125 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
11126 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11127 (is_box_type): New function (Bug#11768).
11128 (xg_tool_item_stale_p): Call is_box_type.
5293d758 11129 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
11130 with default display (Bug#11768).
11131
d6e7bf45
EZ
111322012-07-05 Eli Zaretskii <eliz@gnu.org>
11133
11134 * xdisp.c (window_hscroll_limited): New function.
11135 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11136 coordinates when window's hscroll is set to insanely large
11137 values. (Bug#11857)
11138
431391ec
JB
111392012-07-05 Juanma Barranquero <lekktu@gmail.com>
11140
11141 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11142 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11143
23f86fce
DA
111442012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11145
11146 Cleanup xmalloc.
11147 * lisp.h (xzalloc): New prototype. Omit needless casts.
11148 * alloc.c (xzalloc): New function. Omit needless casts.
11149 * charset.c: Omit needless casts. Convert all calls to
11150 xmalloc with following memset to xzalloc.
11151 * dispnew.c: Likewise.
11152 * fringe.c: Likewise.
11153 * image.c: Likewise.
11154 * sound.c: Likewise.
11155 * term.c: Likewise.
11156 * w32fns.c: Likewise.
11157 * w32font.c: Likewise.
11158 * w32term.c: Likewise.
11159 * xfaces.c: Likewise.
11160 * xfns.c: Likewise.
11161 * xterm.c: Likewise.
11162 * atimer.c: Omit needless casts.
11163 * buffer.c: Likewise.
11164 * callproc.c: Likewise.
11165 * ccl.c: Likewise.
11166 * coding.c: Likewise.
11167 * composite.c: Likewise.
11168 * doc.c: Likewise.
11169 * doprnt.c: Likewise.
11170 * editfns.c: Likewise.
11171 * emacs.c: Likewise.
11172 * eval.c: Likewise.
11173 * filelock.c: Likewise.
11174 * fns.c: Likewise.
11175 * gtkutil.c: Likewise.
11176 * keyboard.c: Likewise.
11177 * lisp.h: Likewise.
11178 * lread.c: Likewise.
11179 * minibuf.c: Likewise.
11180 * msdos.c: Likewise.
11181 * print.c: Likewise.
11182 * process.c: Likewise.
11183 * region-cache.c: Likewise.
11184 * search.c: Likewise.
11185 * sysdep.c: Likewise.
11186 * termcap.c: Likewise.
11187 * terminal.c: Likewise.
11188 * tparam.c: Likewise.
11189 * w16select.c: Likewise.
11190 * w32.c: Likewise.
11191 * w32reg.c: Likewise.
11192 * w32select.c: Likewise.
11193 * w32uniscribe.c: Likewise.
11194 * widget.c: Likewise.
11195 * xdisp.c: Likewise.
11196 * xmenu.c: Likewise.
11197 * xrdb.c: Likewise.
11198 * xselect.c: Likewise.
11199
0497dc44
PE
112002012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11201
11202 * fileio.c (time_error_value): Check the right error number.
11203 Problem reported by Troels Nielsen in
11204 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11205
356e7178
PE
112062012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11207
4e71fd89
PE
11208 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11209 This should be fixed in a better way; see Eli Zaretskii in
11210 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11211 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11212
f0941253
PE
11213 * fileio.c (time_error_value): Rename from special_mtime.
11214 The old name's problems were noted by Eli Zaretskii in
11215 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11216
065c9eb4
PE
11217 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11218 This variable's comment says Emacs needs at least one GDB-visible
11219 symbol of type enum pvec_type, to work around GDB problems.
11220 The symbol's value doesn't matter.
11221
356e7178
PE
11222 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11223 that causes compilation to fail on pre-C99 compilers.
11224
ed9265fc 112252012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
11226
11227 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11228 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11229
3884d954
DA
112302012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11231
d209e2fb 11232 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
11233 headers for buffer_defaults and buffer_local_symbols.
11234 Reported by Juanma Barranquero <lekktu@gmail.com>.
11235
ee28be33
SM
112362012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11237
11238 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11239 * lisp.h (enum pvec_type): Use fewer bits.
11240 (PSEUDOVECTOR_SIZE_BITS): New constant.
11241 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11242 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11243 change in pvec_type.
11244 (PSEUDOVECTOR_TYPEP): New macro.
11245 (TYPED_PSEUDOVECTORP): Use it.
11246 * fns.c (internal_equal): Adapt code to extract pvectype.
11247 * emacs.c (gdb_pvec_type): Update type.
11248 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11249 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11250 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11251 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11252 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11253 abusing vector->header.next.nbytes.
11254 (live_vector_p): Use PVEC_TYPE.
11255 (mark_object): Adapt code to extract pvectype. Use switch.
11256
c7f2cd7f
PE
112572012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11258
11259 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11260 Tighten new eassert a bit.
11261
8ce70ed2
DA
112622012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11263
11264 Fix compilation with --enable-gcc-warnings and -O1
11265 optimization level.
11266 * doprnt.c (doprnt): Change type of tem to int, initialize
11267 to avoid compiler warning. Add eassert.
11268 * search.c (simple_search): Initialize match_byte to avoid
11269 compiler warning. Add eassert.
11270
dea7f1e5
PE
112712012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11272
24a212eb
PE
11273 Avoid weird behavior with large horizontal scrolls.
11274 Without this change, for example, large hscroll values would
11275 mess up Emacs's display on Fedora 15 x86, presumably due to
11276 overflows in int calculations in the display code.
11277 Also, if buffers had long lines, Emacs would freeze.
11278 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11279 (set_window_hscroll): New function, containing the old guts of
11280 Fset_window_hscroll. Return the clipped value.
11281 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11282 This avoids the need to check against PTRDIFF_MAX.
11283
dea7f1e5
PE
11284 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11285
76046526
DA
112862012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11287
11288 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11289
39adff0d
PE
112902012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11291
63807d47
PE
11292 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11293 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11294 since GCC 4.4.6 issues a bogus warning for them.
11295
39adff0d
PE
11296 Fix bugs in file timestamp newness comparisons.
11297 * fileio.c (Ffile_newer_than_file_p):
11298 * lread.c (Fload): Use full timestamp resolution of files,
11299 not just the 1-second resolution, so that files that are only
11300 slightly newer still count as newer.
11301 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11302 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11303
dbeed9a6
PE
113042012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11305
11306 * fileio.c: Improve handling of file time marker. (Bug#11852)
11307 (special_mtime): New function.
11308 (Finsert_file_contents, Fverify_visited_file_modtime):
11309 Use it to set special mtime values consistently.
11310
636334d6
AS
113112012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11312
11313 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11314 marker for non-existing file. (Bug#11852)
11315
e2017fe2
GM
113162012-07-03 Glenn Morris <rgm@gnu.org>
11317
11318 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11319 and did not make it into globals.h).
11320
404dbd37
TT
113212012-07-03 Tom Tromey <tromey@redhat.com>
11322
11323 * window.c (Fset_window_margins, Fset_window_fringes)
11324 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11325 * textprop.c (Fprevious_property_change): No longer static.
11326 * syntax.c (Fsyntax_table_p): No longer static.
11327 * process.c (Fget_process, Fprocess_datagram_address): No longer
11328 static.
11329 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11330 * keyboard.c (Fcommand_execute): No longer static.
11331 Remove EXFUN.
11332 * insdel.c (Fcombine_after_change_execute): No longer static.
11333 * image.c (Finit_image_library): No longer static.
11334 * fileio.c (Fmake_symbolic_link): No longer static.
11335 * eval.c (Ffetch_bytecode): No longer static.
11336 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
11337 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11338 No longer static.
404dbd37
TT
11339 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11340 static.
11341 * dired.c (Ffile_attributes): No longer static.
11342 * composite.c (Fcomposition_get_gstring): No longer static.
11343 * callproc.c (Fgetenv_internal): No longer static.
11344
11345 * ccl.h: Remove EXFUNs.
11346 * buffer.h: Remove EXFUNs.
11347 * dispextern.h: Remove EXFUNs.
11348 * intervals.h: Remove EXFUNs.
11349 * fontset.h: Remove EXFUN.
11350 * font.h: Remove EXFUNs.
11351 * dosfns.c (system_process_attributes): Remove EXFUN.
11352 * keymap.h: Remove EXFUNs.
11353 * lisp.h: Remove EXFUNs.
11354 * w32term.h: Remove EXFUNs.
11355 * window.h: Remove EXFUNs.
11356 * xsettings.h: Remove EXFUN.
11357 * xterm.h: Remove EXFUN.
11358
8e4fd1e1
GM
113592012-07-03 Glenn Morris <rgm@gnu.org>
11360
11361 * lisp.h (Frandom): Make it visible to C.
11362 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11363 buffer for invisible buffers. (Bug#1229)
11364
ca95b3eb
DA
113652012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11366
11367 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11368 values which aren't power of 2.
14ae4239 11369 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 11370 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
11371 accordingly.
11372
7555c33f
SM
113732012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11374
11375 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11376
11377 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11378
d12e8f5a
DA
113792012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11380
11381 * alloc.c (allocate_vector_block): Remove redundant
11382 calls to mallopt if DOUG_LEA_MALLOC is defined.
11383 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11384 avoid calls to mallopt if zero_vector is returned.
11385
296094c3
DA
113862012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11387
11388 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11389 is enabled, avoid dereferencing NULL current_sblock if
11390 running undumped.
11391
36429c89
DA
113922012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11393
11394 Cleanup basic buffer management.
11395 * buffer.h (struct buffer): Change layout to use generic vector
11396 marking code. Fix some comments. Change type of 'clip_changed'
11397 to bitfield. Remove unused #ifndef old.
11398 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11399 (GET_OVERLAYS_AT): Fix indentation.
11400 (for_each_per_buffer_object_at): New macro.
11401 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11402 (Fbuffer_local_variables): Use it.
11403 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11404 * alloc.c (allocate_buffer): Adjust to match new layout of
11405 struct buffer. Fix comment.
11406 (mark_overlay): New function.
11407 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11408 Lisp area of struct buffer.
11409 (mark_object): Use it. Adjust marking of misc objects
11410 and related comments.
11411
3b3e4cac
PE
114122012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11413
11414 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11415 wrapper that is not needed because the wrapped code is a no-op (zero
11416 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11417 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11418
cf5c0175
DA
114192012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11420
11421 * alloc.c (mark_buffer): Simplify. Remove prototype.
11422 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 11423 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
11424 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11425 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 11426
ca26824c
GM
114272012-06-30 Glenn Morris <rgm@gnu.org>
11428
2e4c5312
GM
11429 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11430
ca26824c
GM
11431 * epaths.in (PATH_SITELOADSEARCH): New.
11432 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11433 This is rather than relying on --enable-locallisppath elements
11434 having "site-lisp" in their names. (Bug#10208#25, 11658)
11435
0d23c240
EZ
114362012-06-30 Eli Zaretskii <eliz@gnu.org>
11437
c9240d7a
EZ
11438 * w32proc.c (sys_select): Accept and ignore one more argument.
11439
11440 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11441
0d23c240 11442 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 11443 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
11444
11445 * sysdep.c: Don't include dos.h and dosfns.h.
11446
11447 * process.c (sys_select):
11448 * msdos.c (sys_select): Accept one more argument and ignore it.
11449
11450 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11451 adapt data types and code to that.
11452
11453 * dosfns.c:
11454 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11455 which clashes with the gnulib function of the same name.
11456
af5a5a98
AS
114572012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11458
c5e4379c
AS
11459 * font.c (font_style_to_value, font_style_symbolic)
11460 (font_prop_validate_style): Add type checks for values in
11461 font_style_table.
11462
af5a5a98
AS
11463 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11464 argument.
11465 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11466 uses.
11467
8d38f461
EZ
114682012-06-29 Eli Zaretskii <eliz@gnu.org>
11469
2e5a6631
EZ
11470 * xdisp.c (try_window_id): Undo last change.
11471
8d38f461
EZ
11472 * w32.c (getwd): Adjust commentary about startup_dir.
11473 (init_environment): Always call sys_access, even in non-MSVC
11474 builds. Don't chdir to the directory of the Emacs executable.
11475 This undoes code from 1997 which was justified by the need to
11476 "avoid conflicts when removing and renaming directories". But its
11477 downside was that every relative file name was being interpreted
11478 relative to the directory of the Emacs executable, which can never
11479 be TRT. In particular, it broke sys_access when called with
11480 relative file names.
11481 (sys_access): Map GetLastError to errno.
11482
2af3565e
DA
114832012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11484
11485 * window.h (struct window): Change type of 'fringes_outside_margins'
11486 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 11487 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
11488 Adjust comment.
11489 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11490 to ptrdiff_t.
11491
c8d3a25c 114922012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 11493
c8d3a25c
GM
11494 * gnutls.c (emacs_gnutls_handshake):
11495 Add QUIT to make the loop interruptible.
57570cd3 11496
c8d3a25c 114972012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 11498
c8d3a25c
GM
11499 * charset.c (init_charset): Make lack of etc/charsets fatal.
11500
3e984ee8
DA
115012012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11502
11503 * editfns.c (region_limit): Fix type mismatch.
11504
ef884f23
DA
115052012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11506
11507 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11508 undefined. Convert from xassert to eassert.
11509 * nsmenu.m: Convert from xassert to eassert.
11510 * nsterm.m: Likewise.
11511
7d7e0027
SM
115122012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11513
11514 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11515
aa754e6a
PE
115162012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11517
11518 Avoid integer overflow on scroll-left and scroll-right.
11519 * window.c (HSCROLL_MAX): New macro.
11520 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11521 overflow when requested scroll falls outside ptrdiff_t range.
11522
80b00b08
DA
115232012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11524
11525 * window.h (struct window): Change type of 'hscroll',
11526 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11527 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11528 Adjust users accordingly.
11529 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11530 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11531 from EMACS_INT to ptrdiff_t.
11532 (make_window): Omit redundant initialization.
11533
62b2bcf6
JB
115342012-06-28 Juanma Barranquero <lekktu@gmail.com>
11535
11536 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11537
45942c7d
DA
115382012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11539
11540 * window.h (struct window): Change type of 'use_time' and
11541 'sequence_number' from Lisp_Object to int.
11542 * frame.c (make_frame): Adjust users accordingly.
11543 * print.c (print_object): Likewise.
11544 * window.c (select_window, Fwindow_use_time, make_parent_window)
11545 (make_window): Likewise.
11546
e509cfa6
DA
115472012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11548
11549 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11550 enabled with --enable-checking=[all,glyphs] configure option.
11551 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11552 adjust comments accordingly.
11553 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11554 undefined, adjust comments accordingly.
11555 * image.c: Likewise.
11556 * scroll.c: Likewise.
11557 * w32fns.c: Likewise.
11558 * w32term.c: Likewise.
11559 * xdisp.c: Likewise.
11560 * xfaces.c: Likewise.
11561 * xfns.c: Likewise.
11562 * xterm.c: Likewise.
11563
a54e2c05
DA
115642012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11565
11566 Generalize run-time debugging checks.
11567 * dispextern.h (XASSERTS): Remove.
11568 * fontset.c (xassert): Remove.
11569 Convert from xassert to eassert.
11570 * alloc.c: Convert from xassert to eassert.
11571 * bidi.c: Likewise.
11572 * dispnew.c: Likewise.
11573 * fns.c: Likewise.
11574 * fringe.c: Likewise.
11575 * ftfont.c: Likewise.
11576 * gtkutil.c: Likewise.
11577 * image.c: Likewise.
11578 * keyboard.c: Likewise.
11579 * menu.c: Likewise.
11580 * process.c: Likewise.
11581 * scroll.c: Likewise.
11582 * sound.c: Likewise.
11583 * term.c: Likewise.
11584 * w32console.c: Likewise.
11585 * w32fns.c: Likewise.
11586 * w32term.c: Likewise.
11587 * window.c: Likewise.
11588 * xdisp.c: Likewise.
11589 * xfaces.c: Likewise.
11590 * xfns.c: Likewise.
11591 * xselect.c: Likewise.
11592 * xterm.c: Likewise.
11593
1ec4b7b2
SM
115942012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11595
11596 * fns.c (maybe_resize_hash_table): Output message when growing the
11597 purify-hashtable.
11598
2014308a
DA
115992012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11600
11601 * alloc.c (allocate_string_data): Remove dead code.
11602 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11603 avoid GCC warning about unused macro.
11604
246155eb
DA
116052012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11606
11607 * alloc.c (allocate_string): Omit intervals initialization.
11608 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11609 as in make_pure_string and make_pure_c_string.
11610
43184b7b
DA
116112012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11612
d209e2fb 11613 * alloc.c (allocate_string): Fix last change.
43184b7b 11614
3fe6dd74
DA
116152012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11616
d209e2fb 11617 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
11618 to memset, add explicit initialization where appropriate.
11619
1ba6038a
GM
116202012-06-27 Glenn Morris <rgm@gnu.org>
11621
11622 * lisp.mk (lisp): Remove paths.elc.
11623
c89926a5
CY
116242012-06-27 Chong Yidong <cyd@gnu.org>
11625
11626 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11627
ed6b3510
JW
116282012-06-26 John Wiegley <johnw@newartisans.com>
11629
1ec4b7b2 11630 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
11631 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11632
ed6b3510
JW
11633 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11634 when building with Clang.
11635
8edd4a2b
SM
116362012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11637
11638 * eval.c (Fapply): Allow calling it with a single argument.
11639
f6f62d1b
EZ
116402012-06-26 Eli Zaretskii <eliz@gnu.org>
11641
11642 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11643 _stricmp and _strnicmp.
11644 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11645
62efea5e
DA
116462012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11647
11648 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11649 allocated window.
11650 (allocate_process): Likewise for new process.
8edd4a2b 11651 (allocate_terminal): Change to use offsetof.
62efea5e
DA
11652 (allocate_frame): Likewise.
11653 * frame.c (make_frame): Omit redundant initialization.
11654 * window.c (make_parent_window): Use memset.
11655 (make_window): Omit redundant initialization.
11656 * process.c (make_process): Omit redundant initialization.
11657 * terminal.c (create_terminal): Likewise.
11658
42997f4d
DA
116592012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11660
11661 * term.c (delete_tty): Remove redundant call to memset.
11662
1130ecfc
DA
116632012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11664
11665 * alloc.c: Remove build_string.
11666 * lisp.h: Define build_string as static inline. This provides
11667 a better opportunity to optimize away calls to strlen when the
11668 function is called with compile-time constant argument.
11669 * image.c (imagemagick_error): Convert to build_string.
11670 * w32proc.c (sys_spawnve): Likewise.
11671 * xterm.c (x_term_init): Likewise.
11672
cf38a720
PE
116732012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11674
99027bdd
PE
11675 Use sprintf return value instead of invoking strlen on result.
11676 In the old days this wasn't portable, since some sprintf
11677 implementations returned char *. But they died out years ago and
11678 Emacs already assumes sprintf returns int.
11679 Similarly for float_to_string.
11680 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11681 * ccl.c (ccl_driver):
11682 * character.c (string_escape_byte8):
11683 * data.c (Fnumber_to_string):
11684 * doprnt.c (doprnt):
11685 * print.c (print_object):
11686 * xdisp.c (message_dolog):
11687 * xfns.c (syms_of_xfns):
11688 Use sprintf or float_to_string result to avoid need to call strlen.
11689 * data.c (Fnumber_to_string):
11690 Use make_unibyte_string, since the string must be ASCII.
11691 * lisp.h, print.c (float_to_string): Now returns int length.
11692 * term.c (produce_glyphless_glyph):
11693 Use sprintf result rather than recomputing it.
11694
cf38a720
PE
11695 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11696 * Makefile.in (ALL_CFLAGS):
11697 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11698 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11699
3511c784
DA
117002012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11701
0a08eb21 11702 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
11703 strcasecmp if available.
11704 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11705
fb7da12e
AS
117062012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11707
11708 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11709 Avoid comma operator.
11710 * menu.c (push_submenu_start, push_submenu_end)
11711 (push_left_right_boundary, push_menu_pane): Likewise.
11712 * msdos.c (dos_rawgetc): Likewise.
11713
afa2ffd8
DA
117142012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11715
11716 * xfns.c (xic_create_fontsetname): Remove redundant calls
11717 to memset.
11718
b3b4476b
PE
117192012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11720
4495ff38
PE
11721 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11722 sprintf already null-terminates its output.
11723
b3b4476b
PE
11724 * xfns.c (x_window): Remove redundant cast.
11725
b00876c9
DA
117262012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11727
11728 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11729 `const char *' to `char *' to avoid compiler warning.
11730
d188e26b
PE
117312012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11732
885d1d74
PE
11733 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11734 instead of truncating it to 63 (admittedly a generous limit).
11735
d188e26b
PE
11736 * process.c: Fix spelling and caps in comments.
11737
e2f560b1
DN
117382012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11739
e86db54b 11740 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
11741 * sysdep.c (setpgrp): Remove definition, not used in this file.
11742
7583a3a1
JB
117432012-06-24 Juanma Barranquero <lekktu@gmail.com>
11744
11745 * makefile.w32-in: Update dependencies.
11746
696056c2
EZ
117472012-06-24 Eli Zaretskii <eliz@gnu.org>
11748
11749 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11750 (SYSTIME_H): Add nt/inc/sys/time.h.
11751
11752 * systime.h [WINDOWSNT]: Include sys/time.h.
11753
11754 * s/ms-w32.h (struct timespec): Definition moved from
11755 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11756
845ca893
PE
117572012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11758
11759 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11760 * buffer.h (buffer_slot_type_mismatch):
11761 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11762 * eval.c (unwind_to_catch):
11763 * image.c (my_png_error, my_error_exit):
11764 * keyboard.c (quit_throw_to_read_char, user_error)
11765 (Fexit_recursive_edit, Fabort_recursive_edit):
11766 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11767 (wrong_type_argument, buffer_overflow, __executable_start)
11768 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11769 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11770 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11771 (fatal):
11772 (child_setup) [!DOS_NT]:
11773 * lread.c (end_of_file_error, invalid_syntax):
11774 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11775 * puresize.h (pure_write_error):
11776 * search.c (matcher_overflow):
11777 * sound.c (sound_perror, alsa_sound_perror):
11778 * sysdep.c, syssignal.h (croak):
11779 * term.c (maybe_fatal, vfatal):
11780 * textprop.c (text_read_only):
11781 * undo.c (user_error):
11782 * unexmacosx.c (unexec_error):
11783 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11784 Use _Noreturn rather than NO_RETURN.
11785 No need for separate decl merely because of _Noreturn.
11786 * sound.c (sound_warning, parse_sound):
11787 Remove unnecessary forward decls.
11788
f1dd8073
PE
117892012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11790
11791 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11792 * lisp.h (WAIT_READING_MAX): New macro.
11793 * dispnew.c (Fsleep_for, sit_for):
11794 * keyboard.c (kbd_buffer_get_event):
11795 * process.c (Faccept_process_output):
11796 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11797 This improves on the previous patch, which introduced a bug
11798 when time_t is unsigned and as wide as intmax_t.
11799 See <http://bugs.gnu.org/9000#51>.
11800
b82c1755
EZ
118012012-06-23 Eli Zaretskii <eliz@gnu.org>
11802
11803 * dispnew.c (sit_for, Fsleep_for):
11804 * keyboard.c (kbd_buffer_get_event):
11805 * process.c (Faccept_process_output): Avoid compiler warnings when
11806 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11807
ca300656
JB
118082012-06-23 Juanma Barranquero <lekktu@gmail.com>
11809
049ec95b
JB
11810 * makefile.w32-in: Update dependencies.
11811
ca300656
JB
11812 * w32.c (ltime): Add return type and declare static.
11813 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11814
db7b8d06
PE
118152012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11816
11817 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11818 Privately reported by Herbert J. Skuhra.
11819 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11820 All uses changed.
11821 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11822 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11823
0bd8297f
EZ
118242012-06-23 Eli Zaretskii <eliz@gnu.org>
11825
96512555
EZ
11826 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11827 last argument of make_unibyte_string.
11828
0bd8297f
EZ
11829 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11830 language ID in the event parameters.
11831
11832 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11833 event.code, not the obscure "character set ID".
11834
63def6b6
CY
118352012-06-23 Chong Yidong <cyd@gnu.org>
11836
11837 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11838
e8a02204
EZ
118392012-06-23 Eli Zaretskii <eliz@gnu.org>
11840
388cdec0
EZ
11841 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11842 * w32.c (fdutimens): New function.
11843
11844 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11845
11846 * s/ms-w32.h (pselect): Redirect to sys_select.
11847
11848 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11849
e8a02204
EZ
11850 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11851 in the logic of incrementing and decrementing the value of
11852 use_relocatable_buffers.
11853
d054f3fb
PE
118542012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11855
11856 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11857 Privately reported by Herbert J. Skuhra.
11858 [__FreeBSD__]: Remove "*/" typo after "#include".
11859 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11860 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11861 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11862 Don't assume EMACS_TIME and struct timeval are the same type.
11863
d35af63c
PE
118642012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11865
11866 Support higher-resolution time stamps (Bug#9000).
11867 The time stamps are only nanosecond-resolution at the C level,
11868 since that's the best that any real-world system supports now.
11869 But they are picosecond-resolution at the Lisp level, as that's
11870 easy, and leaves room for future OS improvements.
11871
11872 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11873 (LIBES): Use it.
11874
11875 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11876 Don't get current time unless it's needed.
11877
11878 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11879 now provides it if it's absent.
11880 (start_atimer): Port to higher-res time stamps.
11881 Check for time stamp overflow. Don't get current time more
11882 often than is needed.
11883
11884 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11885 Include systime.h, not time.h.
11886 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11887
11888 * dired.c: Include stat-time.h.
11889 (Ffile-attributes): File times now have higher resolution.
11890
11891 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11892 (struct image): Timestamp now has higher resolution.
11893
11894 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11895 has at least microseconds now. All uses removed.
11896 (update_frame, update_single_window, update_window, update_frame_1)
11897 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 11898 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
11899
11900 * editfns.c (time_overflow): Now extern.
11901 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11902 (float-time, Fformat_time_string, Fcurrent_time_string)
11903 (Fcurrent_time_zone): Accept and generate higher-resolution
11904 time stamps.
11905 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11906 (decode_time_components, lisp_seconds_argument): New functions.
11907 (make_time): Now static.
11908 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11909 Report an error if the time is invalid, rather than having the caller
11910 do that.
11911
11912 * fileio.c: Include <stat-time.h>
11913 (Fcopy_file): Copy higher-resolution time stamps.
11914 Prefer to set the time stamp via a file descriptor if that works.
11915 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11916 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11917 (Fvisited_file_modtime, Fset_visited_file_modtime):
11918 Support higher-resolution time stamps.
11919
11920 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11921
11922 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11923
11924 * image.c (prepare_image_for_display, clear_image_cache)
11925 (lookup_image): Port to higer-resolution time stamps.
11926
11927 * keyboard.c (start_polling, bind_polling_period):
11928 Check for time stamp overflow.
11929 (read_char, kbd_buffer_get_event, timer_start_idle)
11930 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11931 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11932 Port to higher-resolution time stamps. Do not assume time_t is signed.
11933 (decode_timer): New function. Timers are now vectors of length 9,
11934 not 8, to accommodate the picosecond component.
11935 (timer_check_2): Use it.
11936
11937 * nsterm.m (select_timeout, timeval_subtract): Remove.
11938 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11939 as they're a bit more accurate and handle overflow better.
11940 (ns_select): Change prototype to be compatible with pselect.
11941 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11942 * nsterm.h (ns_select): Adjust prototype.
11943
11944 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11945 us-resolution time stamps.
11946 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11947
11948 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11949
11950 * lisp.h (time_overflow): New decl.
11951 (wait_reading_process_output): First arg is now intmax_t, not int,
11952 to accommodate larger waits.
11953
11954 * process.h (struct Lisp_Process.read_output_delay):
11955 Now counts nanoseconds, not microseconds.
11956 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11957 EMACS_HAS_USECS.
11958 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11959 (wait_reading_process_output):
11960 Port to ns-resolution time stamps.
11961 (Faccept_process_output, wait_reading_process_output):
11962 Check for time stamp overflow. Do not assume time_t is signed.
11963 (select_wrapper): Remove; we now use pselect.
11964 (Fprocess_attributes): Now generates ns-resolution time stamps.
11965
11966 * sysdep.c: Include utimens.h. Don't include utime.h
11967 or worry about struct utimbuf; gnulib does that for us now.
11968 (gettimeofday): Remove; gnulib provides a substitute.
11969 (make_timeval): New function.
11970 (set_file_times): Now sets ns-resolution time stamps.
11971 New arg FD; all uses changed.
11972 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11973 (system_process_attributes):
11974 Now returns ns-resolution time stamp. All uses changed.
11975 Check for time stamp overflow.
11976
11977 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11978 provides a substitute now.
11979
11980 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11981 since it guarantees struct timespec.
11982 (EMACS_TIME): Now struct timespec, so that we can support
11983 ns-resolution time stamps.
11984 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11985 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11986 (EMACS_USECS): Remove.
11987 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11988 so multiply the arg by 1000 before storing it.
11989 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11990 New macros.
11991 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11992 Port to ns-resolution time stamps.
11993 (EMACS_TIME_NEG_P): Remove; replaced by....
11994 (EMACS_TIME_SIGN): New macro.
11995 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11996 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11997 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11998 (make_timeval, make_lisp_time, decode_time_components): New decls.
11999 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12000 that it mishandled time_t overflow. You can't compare by subtracting!
12001 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12002 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12003
12004 * term.c: Include <sys/time.h>.
12005 (timeval_to_Time): New function, for proper overflow wraparound.
12006 (term_mouse_position, term_mouse_click): Use it.
12007
12008 * undo.c (record_first_change): Support higher-resolution time stamps
12009 in the undo buffer.
12010 (Fprimitive_undo): Use them when restoring time stamps.
12011
12012 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12013 (w32_get_internal_run_time):
12014 Port to higher-resolution Emacs time stamps.
12015 (ltime): Now accepts single 64-bit integer, as that's more convenient
12016 for callers.
12017
12018 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12019
12020 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12021 for compatibility with pselect. Support ns-resolution time stamps.
12022
12023 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12024
12025 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12026 Check for time stamp overflow, and support ns-resolution time stamps.
12027
12028 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12029 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12030 (timeval_subtract): Remove; no longer needed.
12031 (XTflash, XTring_bell, x_wait_for_event):
12032 Port to ns-resolution time stamps. Don't assume time_t is signed.
12033
b6a92dfe
CY
120342012-06-22 Chong Yidong <cyd@gnu.org>
12035
12036 * xdisp.c (x_consider_frame_title): Revert last change.
12037
d251c37c
EZ
120382012-06-22 Eli Zaretskii <eliz@gnu.org>
12039
12040 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12041 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12042 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12043 staticidx goes up to 1597 out of 1600 = 0x640.)
12044
f10deafb
PE
120452012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12046
12047 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12048 Otherwise, the umask might be mistakenly 0 while handling input signals.
12049
ec6de1e2
SM
120502012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12051
12052 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12053
28be1ada
DA
120542012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12055
12056 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12057 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12058 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12059 access to `contents' member of Lisp_Vector objects with AREF and ASET
12060 where appropriate.
12061
c6bf3022
CY
120622012-06-19 Chong Yidong <cyd@gnu.org>
12063
12064 * frame.c (delete_frame): When selecting a frame on a different
12065 text terminal, do not alter the terminal's top-frame.
12066
12067 * xdisp.c (format_mode_line_unwind_data): Record the target
12068 frame's selected window and its terminal's top-frame.
12069 (unwind_format_mode_line): Restore them.
12070 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12071 Callers changed.
12072 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12073 since tty frames can be explicitly named.
12074 (prepare_menu_bars): Likewise.
12075
12076 * term.c (Ftty_top_frame): New function.
12077
defd4196
PE
120782012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12079
12080 Port byte-code-meter to modern targets.
12081 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12082 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 12083 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
12084 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12085 (METER_1, METER_2): Simplify.
12086
1053a871
SM
120872012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12088
12089 * data.c (Fdefalias): Return `symbol' (bug#11686).
12090
b7e8d081
MR
120912012-06-18 Martin Rudalics <rudalics@gmx.at>
12092
12093 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
12094 gets killed during executing of this function (Bug#11665).
12095 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
12096 (Vkill_buffer_query_functions): In doc-string say that functions
12097 run by this hook should not change the current buffer.
12098
7ea2b339
PE
120992012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12100
12101 Fix recently-introduced process.c problems found by static checking.
12102 * process.c (write_queue_push, write_queue_pop, send_process):
12103 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12104 (write_queue_pop): Fix pointer signedness problem.
12105 (send_process): Remove unused local.
12106
96a313a1
CY
121072012-06-17 Chong Yidong <cyd@gnu.org>
12108
12109 * xdisp.c (redisplay_internal): No need to redisplay terminal
12110 frames that are not on top.
12111
20ca2e94
TN
121122012-06-17 Troels Nielsen <bn.troels@gmail.com>
12113
12114 * process.c (make_process): Initialize write_queue.
12115 (write_queue_push, write_queue_pop): New functions.
12116 (send_process): Use them to maintain correct ordering of process
12117 writes (Bug#10815).
12118
9a900ca9
PE
121192012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12120
310fbfa8
PE
12121 * lisp.h (eassert): Assume C89 or later.
12122 This removes the need for CHECK.
12123 (CHECK): Remove. Its comments about always evaluating its
12124 argument were confusing, as 'eassert' typically does not evaluate
12125 its argument.
12126
27bb1ca4
PE
12127 * coding.c (produce_chars): Use ptrdiff_t, not int.
12128
9a900ca9
PE
12129 * xterm.c (x_draw_underwave): Check for integer overflow.
12130 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12131
41b7f8bc 121322012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
12133
12134 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12135 referenced (Bug#11583).
12136
9b0e3eba
AA
121372012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12138
12139 Implement wave-style variant of underlining.
12140 * dispextern.h (face_underline_type): New enum.
12141 (face): Add field for underline type.
12142 * nsterm.m (ns_draw_underwave): New function.
12143 (ns_draw_text_decoration): Use it.
12144 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12145 New functions.
12146 (x_draw_glyph_string): Use them.
12147 * xfaces.c (Qline, Qwave): New Lisp objects.
12148 (check_lface_attrs, merge_face_ref)
1053a871
SM
12149 (Finternal_set_lisp_face_attribute, realize_x_face):
12150 Handle wave-style underline face attributes.
9b0e3eba
AA
12151 * xterm.c (x_draw_underwave): New function.
12152 (x_draw_glyph_string): Use it.
12153
0fb52f11
JB
121542012-06-16 Juanma Barranquero <lekktu@gmail.com>
12155
12156 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12157 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12158 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12159 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12160 ($(BLD)/w32select.$(O)): Update dependencies.
12161
e5560ff7
AS
121622012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12163
12164 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12165 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12166 * character.c (_fetch_multibyte_char_p): Remove.
12167 * alloc.c: Include "character.h" before "buffer.h".
12168 * bidi.c: Likewise.
12169 * buffer.c: Likewise.
12170 * bytecode.c: Likewise.
12171 * callint.c: Likewise.
12172 * callproc.c: Likewise.
12173 * casefiddle.c: Likewise.
12174 * casetab.c: Likewise.
12175 * category.c: Likewise.
12176 * cmds.c: Likewise.
12177 * coding.c: Likewise.
12178 * composite.c: Likewise.
12179 * dired.c: Likewise.
12180 * dispnew.c: Likewise.
12181 * doc.c: Likewise.
12182 * dosfns.c: Likewise.
12183 * editfns.c: Likewise.
12184 * emacs.c: Likewise.
12185 * fileio.c: Likewise.
12186 * filelock.c: Likewise.
12187 * font.c: Likewise.
12188 * fontset.c: Likewise.
12189 * fringe.c: Likewise.
12190 * indent.c: Likewise.
12191 * insdel.c: Likewise.
12192 * intervals.c: Likewise.
12193 * keyboard.c: Likewise.
12194 * keymap.c: Likewise.
12195 * lread.c: Likewise.
12196 * macros.c: Likewise.
12197 * marker.c: Likewise.
12198 * minibuf.c: Likewise.
12199 * nsfns.m: Likewise.
12200 * nsmenu.m: Likewise.
12201 * print.c: Likewise.
12202 * process.c: Likewise.
12203 * regex.c: Likewise.
12204 * region-cache.c: Likewise.
12205 * search.c: Likewise.
12206 * syntax.c: Likewise.
12207 * term.c: Likewise.
12208 * textprop.c: Likewise.
12209 * undo.c: Likewise.
12210 * unexsol.c: Likewise.
12211 * w16select.c: Likewise.
12212 * w32fns.c: Likewise.
12213 * w32menu.c: Likewise.
12214 * window.c: Likewise.
12215 * xdisp.c: Likewise.
12216 * xfns.c: Likewise.
12217 * xmenu.c: Likewise.
12218 * xml.c: Likewise.
12219 * xselect.c: Likewise.
12220
2f07e6af
EZ
122212012-06-16 Eli Zaretskii <eliz@gnu.org>
12222
1053a871
SM
12223 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12224 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 12225 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
12226 row.
12227 (handle_face_prop): Use chunk-relative overlay string index when
12228 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
12229 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12230 the rightmost. (Bug#11720)
2f07e6af 12231
29b83cec
AS
122322012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12233
12234 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12235 (CATEGORY_MEMBER): Enforce 1/0 value.
12236 * category.c (_temp_category_set): Remove.
12237
4c5501e9
EZ
122382012-06-16 Eli Zaretskii <eliz@gnu.org>
12239
12240 * window.c (Fdelete_other_windows_internal)
12241 (Fdelete_window_internal): Don't access frame's mouse highlight
12242 info of the initial frame. (Bug#11677)
12243
2b570124
PE
122442012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12245
e93864f9
PE
12246 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12247 Assume USE_2_TAGS_FOR_INTS.
12248 (xreload): Adjust $tagmask width to match recent lisp.h change.
12249
2b570124
PE
12250 Simplify lisp.h in minor ways that should not affect code.
12251 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12252 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12253 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12254 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12255 (INTTYPEBITS): New macro, for clarity.
12256 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
12257 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12258 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
12259 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12260 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12261
81755f69
JB
122622012-06-13 Juanma Barranquero <lekktu@gmail.com>
12263
12264 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12265
16192a57
GM
122662012-06-13 Glenn Morris <rgm@gnu.org>
12267
12268 * s/bsd-common.h (BSD4_3):
12269 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12270
646b5f55
AS
122712012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12272
12273 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12274 instead of union.
12275 (XLI, XIL): Define.
1053a871
SM
12276 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12277 Use them.
12278 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 12279 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 12280 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
12281 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12282 * frame.c (delete_frame): Remove outdated comment.
12283 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12284 USE_LISP_UNION_TYPE.
12285 (Fw32_unregister_hot_key): Likewise.
12286 (Fw32_toggle_lock_key): Likewise.
12287 * w32menu.c (add_menu_item): Likewise.
12288 (w32_menu_display_help): Use XIL instead of checking
12289 USE_LISP_UNION_TYPE.
12290 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12291 (init_heap): Likewise.
12292 * w32term.c (w32_read_socket): Update comment.
12293
1d3823c9
GM
122942012-06-13 Glenn Morris <rgm@gnu.org>
12295
c62ff706
GM
12296 * s/usg5-4-common.h, src/s/unixware.h:
12297 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12298
1d3823c9
GM
12299 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12300
bfe3e0a2
PE
123012012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12302
12303 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12304 * alloc.c (make_number) [!defined make_number]:
12305 Remove, as lisp.h always defines this now.
12306 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12307 (roundup_size): Verify that it is a power of 2.
12308 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12309 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12310 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12311 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12312 USE_LSB_TAG now is always defined to be either 0 or 1.
12313 All uses changed.
12314 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12315 code works fine either way, and efficiency is not a concern here,
12316 as the union type is for debugging, not for production.
12317 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12318 Use an inline function on all platforms when using the union type,
12319 since this is simpler and 'static inline' can be used portably
12320 within Emacs now.
12321 (LISP_INITIALLY_ZERO): New macro.
12322 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12323 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12324
45fa9c0f
GM
123252012-06-12 Glenn Morris <rgm@gnu.org>
12326
b4492cba
GM
12327 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12328
12329 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 12330
45fa9c0f
GM
12331 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12332 Move BROKEN_SIGIO to configure.
12333
12334 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12335 Move NO_TERMIO to configure.
12336
0e25d334
CY
123372012-06-12 Chong Yidong <cyd@gnu.org>
12338
12339 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12340 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12341 MagickExportImagePixels is undefined.
12342
43682bb6
PE
123432012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12344
12345 * image.c (imagemagick_load_image): Remove unused label.
12346
a9be7d2b
GM
123472012-06-11 Glenn Morris <rgm@gnu.org>
12348
12349 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12350 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12351 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12352 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12353
3017f87f
SM
123542012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12355
12356 * alloc.c (make_byte_code): New function.
12357 (Fmake_byte_code): Use it. Don't purify here.
12358 * lread.c (read1): Use it as well to avoid extra allocation.
12359
1b9b4cf4
CY
123602012-06-11 Chong Yidong <cyd@gnu.org>
12361
12362 * image.c (imagemagick_load_image): Implement transparency.
12363
95988fcf
AS
123642012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12365
12366 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12367 account for preceding backslashes. (Bug#11663)
12368
cd4eb164
CY
123692012-06-09 Chong Yidong <cyd@gnu.org>
12370
12371 * term.c: Support italics in capable terminals (Bug#9652).
12372 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12373 (turn_on_face): Output using TS_enter_italic_mode if available.
12374 Don't handle unused blinking and alt-charset cases.
12375 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12376 and tty_alt_charset_p cases.
12377 (tty_capable_p, init_tty): Support italics.
12378
12379 * termchar.h (struct tty_display_info): Add field for italics.
12380 Remove unused blink field.
12381
12382 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12383 Handle slant.
12384
12385 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12386 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12387 tty_alt_charset_p. Add tty_italic_p.
12388
ff88beb8
MA
123892012-06-09 Michael Albinus <michael.albinus@gmx.de>
12390
12391 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12392 dbus_type_is_basic if available.
12393 (xd_extract_signed, xd_extract_unsigned): Rename from
12394 extract_signed and extract_unsigned, respectively. Adapt callers.
12395
44286096
CY
123962012-06-09 Chong Yidong <cyd@gnu.org>
12397
1682701f
CY
12398 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12399
44286096
CY
12400 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12401 case (Bug#9752).
12402
d86feb17
PE
124032012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12404
12405 * xdisp.c (vmessage): Treat frame message as multibyte.
12406 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12407 would generate the diagnostic "Making \302\247 buffer-local while
12408 let-bound!".
12409
d5c20fe8
EZ
124102012-06-08 Eli Zaretskii <eliz@gnu.org>
12411
12412 * dispnew.c (showing_window_margins_p): Undo last change, which
12413 was done due to an inadvertent commit.
12414 (adjust_frame_glyphs_for_frame_redisplay): Do call
12415 showing_window_margins_p.
12416
513749ee
SM
124172012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12418
12419 * eval.c (Fmake_var_non_special): New primitive.
12420 (syms_of_eval): Defsubr it.
12421 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12422
d4a8f5c1
JB
124232012-06-08 Juanma Barranquero <lekktu@gmail.com>
12424
12425 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12426 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12427
8bbbc977
EZ
124282012-06-08 Eli Zaretskii <eliz@gnu.org>
12429
12430 * alloc.c (allocate_vectorlike): Fix last change.
12431
f3372c87
DA
124322012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12433
12434 Block-based vector allocation of small vectors.
12435 * lisp.h (struct vectorlike_header): New field `nbytes',
12436 adjust comment accordingly.
12437 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 12438 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
12439 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12440 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
f4ad7ea1
JB
12441 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12442 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12443 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
f3372c87
DA
12444 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12445 (roundup_size): New constant.
12446 (struct vector_block): New data type.
12447 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 12448 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
12449 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12450 (sweep_vectors): New functions.
12451 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 12452 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
12453 or equal to VBLOCK_BYTES_MAX.
12454 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12455 (init_alloc_once): Add call to init_vectors.
12456
4f18a4ed
SM
124572012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12458
12459 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12460
86f158bc
PE
124612012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12462
12463 * doprnt.c (doprnt): Truncate multibyte char correctly.
12464 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12465 would mishandle a string argument "Xc" if X was a multibyte
12466 character of length 2: it would truncate after X's first byte
12467 rather than including all of X.
12468
c5cfcbe0
CY
124692012-06-06 Chong Yidong <cyd@gnu.org>
12470
12471 * buffer.c (word_wrap): Doc fix.
12472
c05cf390
PE
124732012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12474
12475 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12476
0c3461de
GM
124772012-06-03 Glenn Morris <rgm@gnu.org>
12478
12479 * xdisp.c (tool-bar-style): Doc fix.
12480
c71232db
UM
124812012-06-03 Ulrich Müller <ulm@gentoo.org>
12482
12483 * Makefile.in (PAXCTL): Define.
12484 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12485 binary via PaX flags if the paxctl utility is available.
12486 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12487 Restore PaX flags to their default. (Bug#11398)
12488
383f7350
CY
124892012-06-03 Chong Yidong <cyd@gnu.org>
12490
12491 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12492 buffer (Bug#11226).
12493
5f2c76c6
CY
124942012-06-03 Chong Yidong <cyd@gnu.org>
12495
12496 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12497 (note_mode_line_or_margin_highlight): If there is no help echo,
12498 use mode-line-default-help-echo. Handle the case where the mouse
12499 position is past the end of the mode line string.
12500
12501 * buffer.c (buffer_local_value_1): New function, split from
12502 Fbuffer_local_value; can return Qunbound.
12503 (Fbuffer_local_value): Use it.
12504 (Vmode_line_format): Docstring tweaks.
12505
773d47f6
PE
125062012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12507
12508 * sysdep.c (system_process_attributes): Improve comment.
12509
f2d6a3df
SM
125102012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12511
12512 * keyboard.c: Export real-this-command to Elisp.
12513 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12514 and DEFVAR it. Update all users.
12515
63810350
PE
125162012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12517
7bd5c1f4
PE
12518 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12519
63810350
PE
12520 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12521 Convert pctcpu and pctmem to Lisp float properly.
12522 Let the compiler fold better, as 100.0/0x8000 is exact.
12523
a2821611
AS
125242012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12525
12526 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12527 cons_block.
12528
5fceba1d
PE
125292012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12530
12531 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12532
c98ff5dd
DA
125332012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12534
12535 For a 'struct window', replace some Lisp_Object fields to
12536 bitfields where appropriate, remove unused fields.
12537 * window.h (struct window): Remove unused 'last_mark_x' and
12538 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 12539 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
12540 Change type of 'force_start', 'optional_new_start',
12541 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 12542 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 12543
ca34e0be
PE
125442012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12545
12546 Pacify gcc -Wdouble-precision when using Xaw.
12547 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12548 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12549 Use 'float' consistently, rather than 'float' in most places
12550 and 'double' in a couple of places.
12551
efc00ab1 125522012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
12553
12554 * xdisp.c (handle_stop): Detect whether we have overlay strings
12555 loaded by testing it->current.overlay_string_index to be
12556 non-negative, instead of checking whether n_overlay_strings is
12557 positive. (Bug#11587)
12558
efc00ab1 125592012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
12560
12561 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12562
12563 * doc.c (Fsubstitute_command_keys): Doc fix.
12564
efc00ab1 125652012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
12566
12567 * search.c (search_buffer): Remove calls to
12568 r_alloc_inhibit_buffer_relocation, as it is now called by
12569 maybe_unify_char, which was the cause of relocation of buffer text
12570 in bug#11519.
12571
efc00ab1 125722012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
12573
12574 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12575 for the duration of call to load_charset, to avoid problems with
12576 callers of maybe_unify_char that access buffer text through C
12577 pointers.
12578
12579 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12580 decrement the inhibition flag, instead of just setting or
12581 resetting it.
12582
ba93a187
PE
125832012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12584
12585 Remove obsolete '#define static' cruft.
12586 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12587 This #undef was "temporary" in 2000; it is no longer needed
12588 now that '#define static' has gone away.
12589 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12590 (gray_bitmap_bits): Remove; no longer needed.
12591 All uses replaced with definiens.
12592 * xterm.c: Include "bitmaps/gray.xbm".
12593
9e4bf381
PE
125942012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12595
12596 Clean up __executable_start, monstartup when --enable-profiling.
12597 The following changes affect the code only when profiling.
12598 * dispnew.c (__executable_start): Rename from safe_bcopy.
12599 Define only on platforms that need it.
12600 * emacs.c: Include <sys/gmon.h> when profiling.
12601 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12602 (__executable_start): Remove decl, since lisp.h does it now.
12603 (safe_bcopy): Remove decl; no longer has that name.
12604 (main): Coalesce #if into single bit of code, for simplicity.
12605 Cast pointers to uintptr_t, since standard libraries want integers
12606 and not pointers.
12607 * lisp.h (__executable_start): New decl.
12608
32d72c2f
GM
126092012-05-31 Glenn Morris <rgm@gnu.org>
12610
12611 * image.c (Fimagemagick_types): Doc fix.
12612
baac5bc7
JM
126132012-05-30 Jim Meyering <meyering@redhat.com>
12614
12615 * callproc.c (Fcall_process_region): Include directory component
12616 in mkstemp error message (Bug#11586).
12617
72cb32cf
PE
126182012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12619
12620 * alloc.c, lisp.h (make_pure_vector): Now static.
12621
61b108cc
SM
126222012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12623
12624 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12625 Move to byte-run.el.
12626 (Fautoload): Do the hash-doc more carefully.
12627 * data.c (Fdefalias): Purify definition, except for keymaps.
12628 (Qdefun): Move from eval.c.
12629 * lisp.h (Qdefun): Remove.
12630 * lread.c (read1): Tiny simplification.
12631
471fe23d
TN
126322012-05-29 Troels Nielsen <bn.troels@gmail.com>
12633
934f3f58 12634 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
12635 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12636 Bug#9642, but explicitly check that the buffer the overlay would
12637 be moved to is live and rearrange lines to make sure that errors
12638 will not put the overlay in an inconsistent state.
12639 (Fdelete_overlay): Cosmetics.
12640
85d0efd1
EZ
126412012-05-28 Eli Zaretskii <eliz@gnu.org>
12642
12643 * w32term.c (my_bring_window_to_top): New function.
12644 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
12645 could be different from the original one.
12646 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
12647 (Bug#11513)
12648
12649 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12650 by calling BringWindowToTop.
12651
12652 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12653 (WM_EMACS_END): Increase by one.
12654
da92a98c
PE
126552012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12656
12657 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12658 This avoids undefined behavior that might cause the eassert
12659 to not catch an out-of-range value.
12660
74d1f848
JB
126612012-05-28 Juanma Barranquero <lekktu@gmail.com>
12662
12663 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12664 Update dependencies.
12665
9e1a06fc
EZ
126662012-05-27 Eli Zaretskii <eliz@gnu.org>
12667
12668 * bidi.c (bidi_mirror_char): Fix last change.
12669
f3dd7312
AS
126702012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12671
12672 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12673 when referring to sectname field in printf format.
12674
81899c91
PE
126752012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12676
57b81a9f
PE
12677 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12678 Only r_alloc_inhibit_buffer_relocation needed to be added;
12679 the others were already declared.
12680
81899c91
PE
12681 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12682 before checking whether it's out of range. Put the check inside
12683 eassert. See
12684 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12685
33017faf 126862012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
12687
12688 * callproc.c (Fcall_process): Restore a line that was accidentally
12689 commented out in the 2011-02-13 change (bug#11547).
12690
33017faf 126912012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
12692
12693 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12694 defined on ralloc.c.
12695
12696 * buffer.c [REL_ALLOC]: Remove prototypes of
12697 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12698 they are now on lisp.h.
12699
12700 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12701
12702 * search.c (search_buffer): Use it to inhibit relocation of buffer
12703 text while re_search_2 is doing its job, because re_search_2 is
12704 passed C pointers to buffer text. (Bug#11519)
12705
23415acf
EZ
12706 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12707 Update value to 24.
12708
44e27368
EZ
12709 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12710 state after an additional call to move_it_in_display_line_to, keep
12711 the values of it->max_ascent and it->max_descent found for the
12712 entire line.
12713 (pos_visible_p): Revert the comparison against bottom_y to what it
12714 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12715 (Bug#11464)
12716
c1892f11
PE
127172012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12718
12719 Fix coding-related core dumps with gcc -ftrapv.
12720 The code was computing A - B, where A and B are pointers, and B is
12721 random garbage. This can lead to core dumps on platforms that
12722 have special pointer registers, and it also leads to core dumps on
12723 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12724 A - B only when B is initialized properly.
12725 * coding.c (coding_set_source, coding_set_destination): Return void.
12726 (coding_change_source, coding_change_destinations): New functions,
12727 with the old behaviors of coding_set_source and coding_set_destination.
12728 All callers that need an offset changed to use these new functions.
12729
eb7afdad
GM
127302012-05-26 Glenn Morris <rgm@gnu.org>
12731
12732 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12733
f12fdf02
EZ
127342012-05-26 Eli Zaretskii <eliz@gnu.org>
12735
53a63be6 12736 Extend mouse support on W32 text-mode console.
61b108cc
SM
12737 * xdisp.c (draw_row_with_mouse_face):
12738 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 12739
eb3f6f01 12740 * w32console.c: Include window.h.
61b108cc
SM
12741 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12742 New functions.
eb3f6f01
EZ
12743 (initialize_w32_display): Initialize mouse-highlight data.
12744
53a63be6
EZ
12745 * w32inevt.c: Include termchar.h and window.h.
12746 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12747 moves, call note_mouse_highlight. If help_echo changed, call
12748 gen_help_event to produce help-echo message in the echo area.
12749 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12750 highlight info.
12751
4cfd81f6
PE
127522012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12753
12754 * lread.c (read1): Simplify slightly to avoid an overflow warning
12755 with GCC 4.7.0 on x86-64.
12756
4446092a
EZ
127572012-05-26 Eli Zaretskii <eliz@gnu.org>
12758
12759 * bidi.c (bidi_mirror_char): Revert last change: an int is
12760 definitely wide enough here.
12761
42b2a986 127622012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 12763
42b2a986 12764 Fix integer width and related bugs (Bug#9874).
eb106a49 12765 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
12766 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12767 (string_bytes, check_sblock, allocate_string_data):
12768 (compact_small_strings, Fmake_bool_vector, make_string)
12769 (make_unibyte_string, make_multibyte_string)
12770 (make_string_from_bytes, make_specified_string)
12771 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12772 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12773 (mark_vectorlike):
12774 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12775 (allocate_pseudovector):
12776 Use int, not EMACS_INT, where int is wide enough.
12777 (inhibit_garbage_collection, Fgarbage_collect):
12778 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12779 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12780 int might not be wide enough.
12781 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12782 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12783 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12784 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12785 (bidi_level_of_next_char, bidi_move_to_visually_next):
12786 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12787 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12788 (Fkill_buffer, Fset_buffer_major_mode)
12789 (advance_to_char_boundary, Fbuffer_swap_text)
12790 (Fset_buffer_multibyte, overlays_at, overlays_in)
12791 (overlay_touches_p, struct sortvec, record_overlay_string)
12792 (overlay_strings, recenter_overlay_lists)
12793 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12794 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12795 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12796 (Foverlay_recenter, last_overlay_modification_hooks_used)
12797 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12798 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
12799 (validate_region): Omit unnecessary test for b <= e,
12800 since that's guaranteed by the previous test.
d311d28c
PE
12801 (adjust_overlays_for_delete): Avoid pos + length overflow.
12802 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12803 (report_overlay_modification):
12804 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12805 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12806 Omit pointer cast, which isn't needed anyway, and doesn't work
12807 after the EMACS_INT -> ptrdiff_t change.
02481186 12808 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
12809 * buffer.h: Adjust decls to match defn changes elsewhere.
12810 (struct buffer_text, struct buffer):
12811 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12812 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
12813 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12814 not int, to avoid needless 32-bit limit on 64-bit hosts.
12815 (exec_byte_code): Use tighter memory-full test, one that checks
12816 for alloca overflow. Don't compute the address of the object just
12817 before an array, as that's not portable. Use EMACS_INT, not
12818 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
12819 * callint.c (Fcall_interactively):
12820 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12821 * callproc.c (call_process_kill, Fcall_process):
12822 Don't assume pid_t fits into an Emacs fixnum.
12823 (call_process_cleanup, Fcall_process, child_setup):
12824 Don't assume pid_t fits into int.
12825 (call_process_cleanup, Fcall_process, delete_temp_file)
12826 (Fcall_process_region):
12827 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12828 (Fcall_process): Simplify handling of volatile integers.
12829 Use int, not EMACS_INT, where int will do.
12830 * casefiddle.c (casify_object, casify_region, operate_on_word)
12831 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12832 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12833 (casify_object): Avoid integer overflow when overallocating buffer.
12834 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 12835 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
12836 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12837 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12838 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12839 integers are now checked earlier. All uses replaced with XINT.
12840 (ccl_driver):
12841 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12842 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
12843 (ccl_driver, Fregister_code_conversion_map):
12844 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
12845 (resolve_symbol_ccl_program): Check that vector header is in range.
12846 Always copy the vector, so that we can check its contents reliably
12847 now rather than having to recheck each instruction as it's being
12848 executed. Check that vector words fit in 'int'.
12849 (ccl_get_compiled_code, Fregister_ccl_program)
12850 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12851 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12852 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12853 contents are in range.
12854 (Fccl_execute_on_string): Check that status is in range.
12855 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12856 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12857 Accept and return EMACS_INT, not int, because callers can pass values
12858 out of 'int' range.
12859 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12860 (multibyte_chars_in_text, parse_str_as_multibyte)
12861 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12862 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12863 (string_escape_byte8, Fget_byte):
12864 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 12865 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
12866 avoid mishandling large integers.
12867 * character.h: Adjust decls to match defn changes elsewhere.
12868 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12869 (Ffind_charset_region):
12870 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12871 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12872 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 12873 Don't assume fixnum fits in int.
d311d28c
PE
12874 (load_charset_map_from_vector, Fmap_charset_chars):
12875 Remove now-unnecessary CHECK_NATNUMs.
12876 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
12877 Don't rely on undefined behavior with signed left shift overflow.
12878 Don't assume unsigned int fits into fixnum, or that fixnum fits
12879 into unsigned int. Don't require max_code to be a valid fixnum;
12880 that's not true for gb10830 4-byte on a 32-bit host. Allow
12881 invalid_code to be a cons, for the same reason. Require code_offset
12882 to be a character. Avoid int overflow if max_char is close
12883 to INT_MAX.
12884 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12885 this is intended anyway and avoids some undefined behavior.
12886 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12887 INDEX_TO_CODE_POINT, as that's what it expects.
12888 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
12889 * charset.h (DECODE_CHAR): Return int, not unsigned;
12890 this is what was intended anyway, and it avoids undefined behavior.
12891 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12892 integer-overflow issues.
12893 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12894 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12895 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
12896 * chartab.c (Fmake_char_table, Fset_char_table_range)
12897 (uniprop_get_decoder, uniprop_get_encoder):
12898 Don't assume fixnum fits in int.
12899 * cmds.c (move_point): New function, that does the gist of
12900 Fforward_char and Fbackward_char, but does so while checking
12901 for integer overflow more accurately.
c96e5d6a 12902 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
12903 (Fforward_line, Fend_of_line, internal_self_insert)
12904 (internal_self_insert):
12905 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12906 Fix a FIXME, by checking for integer overflow when calculating
12907 target_clm and actual_clm.
12908 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 12909 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
12910 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12911 (coding_alloc_by_making_gap, alloc_destination)
12912 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12913 (encode_coding_utf_16, detect_coding_emacs_mule)
12914 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12915 (detect_coding_iso_2022, decode_coding_iso_2022)
12916 (encode_invocation_designation, encode_designation_at_bol)
12917 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12918 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12919 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12920 (encode_coding_ccl, encode_coding_raw_text)
12921 (detect_coding_charset, decode_coding_charset)
12922 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12923 (produce_composition, produce_charset, produce_annotation)
12924 (decode_coding, handle_composition_annotation)
12925 (handle_charset_annotation, consume_chars, decode_coding_gap)
12926 (decode_coding_object, encode_coding_object, detect_coding_system)
12927 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12928 (code_convert_region, code_convert_string)
8f50130c
PE
12929 (Fdefine_coding_system_internal)
12930 (coding_set_source, coding_set_destination):
d311d28c
PE
12931 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12932 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12933 (Fdefine_coding_system_internal):
12934 Don't assume fixnums fit in int.
12935 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 12936 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
12937 (Funencodable_char_position, Fcheck_coding_systems_region)
12938 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 12939 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 12940 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 12941 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 12942 Don't access memory outside of the args array.
d311d28c 12943 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
12944 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12945 result of ENCODE_CHAR.
d311d28c
PE
12946 * coding.h: Adjust decls to match defn changes elsewhere.
12947 (struct coding_system):
12948 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12949 * composite.c (get_composition_id, find_composition)
12950 (run_composition_function, update_compositions)
12951 (compose_text, composition_gstring_put_cache)
12952 (composition_gstring_p, composition_gstring_width)
12953 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12954 (composition_compute_stop_pos, composition_reseat_it)
12955 (composition_update_it, struct position_record)
12956 (find_automatic_composition, composition_adjust_point)
12957 (Fcomposition_get_gstring, Ffind_composition_internal):
12958 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12959 (update_compositions):
12960 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12961 * composite.h: Adjust decls to match defn changes elsewhere.
12962 (struct composition):
12963 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12964 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12965 Do not attempt to compute the address of the object just before a
12966 buffer; this is not portable.
12967 (Faref, Faset):
12968 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12969 (Faset): Use int, not EMACS_INT, where int is wide enough.
12970 (Fstring_to_number): Don't assume fixnums fit in int.
12971 (Frem): Don't assume arg is nonnegative.
12972 * dbusbind.c (xd_append_arg): Check for integers out of range.
12973 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 12974 (extract_signed, extract_unsigned): New functions.
243e0530
PE
12975 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12976 (xd_get_connection_references): Return ptrdiff_t, not int.
12977 All uses changed.
12978 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12979 (xd_read_message_1):
12980 Use int, not unsigned, where the dbus API uses int.
12981 (Fdbus_message_internal): Don't overflow mtype.
12982 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
12983 * dired.c (directory_files_internal, file_name_completion, scmp)
12984 (file_name_completion_stat):
12985 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12986 (file_name_completion): Don't overflow matchcount.
12987 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12988 * dispextern.h: Adjust decls to match defn changes elsewhere.
12989 (struct text_pos, struct glyph, struct bidi_saved_info)
12990 (struct bidi_string_data, struct bidi_it, struct composition_it)
12991 (struct it):
12992 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12993 (struct display_pos, struct composition_it, struct it):
12994 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12995 * dispnew.c (increment_matrix_positions)
12996 (increment_row_positions, mode_line_string)
12997 (marginal_area_string):
12998 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 12999 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
13000 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13001 (duration_to_sec_usec): New function, to check for overflow better.
13002 (Fsleep_for, sit_for): Use it.
13003 * doc.c (get_doc_string, store_function_docstring):
13004 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13005 (get_doc_string, Fsnarf_documentation):
13006 Use int, not EMACS_INT, where int is wide enough.
13007 (get_doc_string):
13008 Use SAFE_ALLOCA, not alloca.
13009 Check for overflow when converting EMACS_INT to off_t.
13010 * doprnt.c (doprnt):
13011 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13012 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13013 Don't assume uid_t fits into fixnum.
13014 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13015 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13016 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13017 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13018 (general_insert_function)
13019 (Finsert_char, make_buffer_string, make_buffer_string_both)
13020 (update_buffer_properties, Fbuffer_substring)
13021 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13022 (Fsubst_char_in_region, check_translation)
13023 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13024 (transpose_markers, Ftranspose_regions):
13025 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13026 (clip_to_bounds): Move to lisp.h as an inline function).
13027 (Fconstrain_to_field): Don't assume integers are nonnegative.
13028 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13029 (Fsubst_char_in_region, Fsave_restriction):
13030 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13031 (Femacs_pid): Don't assume pid_t fits into fixnum.
13032 (lo_time): Use int, not EMACS_INT, when int suffices.
13033 (lisp_time_argument): Check for usec out of range.
13034 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
13035 (Fuser_login_name, Fuser_full_name): Signal an error
13036 if a uid argument is out of range, rather than relying on
13037 undefined behavior.
c8d5c857
PE
13038 (Fformat_time_string): Remove now-unnecessary check.
13039 lisp_time_argument checks for out-of-range usec now.
243e0530 13040 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
13041 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13042 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13043 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13044 (init_cmdargs, Fdump_emacs):
13045 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13046 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13047 the bottom (typically) 32 bits of the fixnum.
13048 * eval.c (specpdl_size, call_debugger):
13049 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13050 (when_entered_debugger, Fbacktrace_debug):
13051 Don't assume fixnum can fit in int.
13052 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13053 the object just before a buffer; this is not portable.
13054 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13055 (grow_specpdl, unbind_to):
13056 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13057 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13058 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 13059 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
13060 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13061 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13062 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13063 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13064 (a_write, e_write):
13065 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13066 (Fcopy_file, non_regular_nbytes, read_non_regular)
13067 (Finsert_file_contents):
13068 Use int, not EMACS_INT, where int is wide enough.
13069 (READ_BUF_SIZE): Verify that it fits in int.
13070 (Finsert_file_contents): Check that counts are in proper range,
13071 rather than assuming fixnums fit into ptrdiff_t etc.
13072 Don't assume fixnums fit into int.
125b3835 13073 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
13074 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13075 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
13076 (string_char_to_byte, string_byte_to_char)
13077 (string_make_multibyte, string_to_multibyte)
13078 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13079 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13080 (substring_both, Fdelete, internal_equal, Ffillarray)
13081 (Fclear_string, mapcar1)
13082 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13083 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13084 (larger_vector, make_hash_table, maybe_resize_hash_table)
13085 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13086 (Fmaphash, secure_hash):
13087 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13088 (concat): Check for string index and length overflow.
13089 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13090 (Frequire):
13091 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13092 (larger_vector): New API (vec, incr_min, size_max) replaces old
13093 one (vec, new_size, init). This catches size overflow.
13094 INIT was removed because it was always Qnil.
13095 All callers changed.
13096 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13097 the upper bound on a hash table index size.
13098 (make_hash_table, maybe_resize_hash_table): Use it.
13099 (secure_hash): Computer start_byte and end_byte only after
13100 they're known to be in ptrdiff_t range.
13101 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13102 (Ffont_get_glyphs, Ffont_at):
13103 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13104 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13105 (Flist_fonts, Fopen_font):
13106 Don't assume fixnum can fit in int.
13107 (check_gstring): Don't assume index can fit in int.
13108 (font_match_p): Check that fixnum is a character, not a nonnegative
13109 fixnum, since the later code needs to stuff it into an int.
13110 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13111 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13112 conversion overflow issues.
13113 (Fopen_font): Check for integer out of range.
13114 (Ffont_get_glyphs): Don't assume index can fit in int.
13115 * font.h: Adjust decls to match defn changes elsewhere.
13116 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13117 integer overflow.
13118 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13119 printmax_t, where ptrdiff_t is wide enough.
13120 (Finternal_char_font):
13121 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13122 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13123 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13124 (Fset_frame_position, x_set_frame_parameters)
13125 (x_set_line_spacing, x_set_border_width)
13126 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13127 Check that fixnums are in proper range for system types.
13128 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13129 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13130 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13131 Use SAFE_ALLOCA_LISP, not alloca.
13132 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13133 intptr_t is wide enough.
13134 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13135 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13136 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13137 Check for fixnum out of range.
13138 * ftfont.c (ftfont_list): Don't assume index fits in int.
13139 Check that fixnums are in proper range for system types.
13140 (ftfont_shape_by_flt):
13141 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
13142 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13143 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13144 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13145 Check that fixnums are in proper range for system types.
13146 * gnutls.h: Adjust decls to match defn changes elsewhere.
13147 * gtkutil.c (xg_dialog_run):
13148 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13149 (update_frame_tool_bar):
13150 Check that fixnums are in proper range for system types.
13151 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 13152 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
13153 * indent.c (last_known_column, last_known_column_point):
13154 (current_column_bol_cache):
13155 (skip_invisible, current_column, check_display_width):
13156 (check_display_width, scan_for_column, current_column_1)
13157 (Findent_to, Fcurrent_indentation, position_indentation)
13158 (indented_beyond_p, Fmove_to_column, compute_motion):
13159 (Fcompute_motion, Fvertical_motion):
13160 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13161 (last_known_column_modified): Use EMACS_INT, not int.
13162 (check_display_width):
13163 (Fcompute_motion):
13164 Check that fixnums and floats are in proper range for system types.
13165 (compute_motion): Don't assume index or fixnum fits in int.
13166 (compute_motion, Fcompute_motion):
13167 Use int, not EMACS_INT, when it is wide enough.
13168 (vmotion): Omit local var start_hpos that is always 0; that way
13169 we don't need to worry about overflow in expressions involving it.
13170 * indent.h: Adjust decls to match defn changes elsewhere.
13171 (struct position):
13172 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13173 Use int, not EMACS_INT, where int is wide enough.
13174 Remove unused members ovstring_chars_done and tab_offset;
13175 all uses removed.
13176 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13177 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13178 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13179 (make_gap, copy_text, insert, insert_and_inherit)
13180 (insert_before_markers, insert_before_markers_and_inherit)
13181 (insert_1, count_combining_before, count_combining_after)
13182 (insert_1_both, insert_from_string)
13183 (insert_from_string_before_markers, insert_from_string_1)
13184 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13185 (adjust_after_replace, adjust_after_insert, replace_range)
13186 (replace_range_2, del_range, del_range_1, del_range_byte)
13187 (del_range_both, del_range_2, modify_region)
13188 (prepare_to_modify_buffer, signal_before_change)
13189 (signal_after_change, Fcombine_after_change_execute):
13190 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13191 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13192 (balance_an_interval, split_interval_right, split_interval_left)
13193 (find_interval, next_interval, update_interval)
13194 (adjust_intervals_for_insertion, delete_node, delete_interval)
13195 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13196 (static_offset_intervals, offset_intervals)
13197 (merge_interval_right, merge_interval_left, make_new_interval)
13198 (graft_intervals_into_buffer, temp_set_point_both)
13199 (temp_set_point, set_point, adjust_for_invis_intang)
13200 (set_point_both, move_if_not_intangible, get_property_and_range)
13201 (get_local_map, copy_intervals, copy_intervals_to_string)
13202 (compare_string_intervals, set_intervals_multibyte_1):
13203 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13204 * intervals.h: Adjust decls to match defn changes elsewhere.
13205 (struct interval):
13206 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13207 * keyboard.c (this_command_key_count, this_single_command_key_start)
13208 (before_command_key_count, before_command_echo_length, echo_now)
13209 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13210 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13211 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13212 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13213 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13214 (last_non_minibuf_size, last_point_position, echo_truncate)
13215 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13216 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13217 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13218 (stuff_buffered_input):
13219 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13220 (last_auto_save, command_loop_1, read_char):
13221 Use EMACS_INT, not int, to avoid integer overflow.
13222 (record_char): Avoid overflow in total_keys computation.
13223 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13224 * keyboard.h: Adjust decls to match defn changes elsewhere.
13225 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13226 (Fkey_description, Fdescribe_vector, Flookup_key):
13227 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13228 (click_position): New function, to check that positions are in range.
13229 (Fcurrent_active_maps):
13230 (describe_command):
13231 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13232 (Faccessible_keymaps, Fkey_description):
13233 (preferred_sequence_p):
13234 Don't assume fixnum can fit into int.
13235 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13236 Check for integer overflow in size calculations.
13237 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13238 avoid mishandling large integers.
13239 * lisp.h: Adjust decls to match defn changes elsewhere.
13240 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13241 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13242 (struct Lisp_Marker):
13243 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13244 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
13245 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13246 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13247 All callers changed.
13248 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13249 Assume the arg has valid form, since it always does.
13250 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13251 unsigned integer system type.
13252 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13253 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13254 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13255 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13256 (duration_to_sec_usec): New decl.
13257 * lread.c (read_from_string_index, read_from_string_index_byte)
13258 (read_from_string_limit, readchar, unreadchar, openp)
13259 (read_internal_start, read1, oblookup):
13260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13261 (Fload, readevalloop, Feval_buffer, Feval_region):
13262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13263 (openp): Check for out-of-range argument to 'access'.
13264 (read1): Use int, not EMACS_INT, where int is wide enough.
13265 Don't assume fixnum fits into int.
6efdadfd 13266 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
13267 (read_filtered_event): Use duration_to_sec_usec
13268 to do proper overflow checking on durations.
d311d28c
PE
13269 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13270 in size calculation.
13271 (Fexecute_kbd_macro):
13272 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13273 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13274 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13275 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13276 (set_marker_both, set_marker_restricted_both, marker_position)
13277 (marker_byte_position, Fbuffer_has_markers_at):
13278 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13279 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 13280 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
13281 It now merely ensures that the menu is large enough, without
13282 necessarily growing it, as this avoids some integer overflow issues.
13283 All callers changed.
13284 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13285 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13286 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13287 Use SAFE_ALLOCA_LISP, not alloca.
13288 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13289 to EMACS_INT. Check that fixnums are in proper range for system types.
13290 * minibuf.c (minibuf_prompt_width, string_to_object)
13291 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13292 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13293 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13294 (get_minibuffer, read_minibuf_unwind):
13295 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13296 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13297 this simplifies overflow checking. All callers changed.
13298 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13299 (Ftest_completion):
13300 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13301 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13302 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13303 Check that fixnums are in proper range for system types.
13304 (Fx_create_frame, Fx_show_tip):
13305 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13306 * nsfont.m (ns_findfonts, nsfont_list_family):
13307 Don't assume fixnum fits in long.
13308 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13309 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13310 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13311 wide enough.
17fdb222 13312 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
13313 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13314 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13315 (PRINTDECLARE, PRINTPREPARE):
13316 (strout, print_string):
13317 (print, print_preprocess, print_check_string_charset_prop)
13318 (print_object):
13319 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13320 (PRINTDECLARE):
13321 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13322 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13323 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 13324 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 13325 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
13326 (print_error_message): Use SAFE_ALLOCA, not alloca.
13327 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
13328 (print_depth, new_backquote_output, print_number_index):
13329 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
13330 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13331 (Fset_process_window_size, Fformat_network_address)
13332 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 13333 (sigchld_handler):
d311d28c 13334 Check that fixnums are in proper range for system types.
d44287d4 13335 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
13336 Check for process-ids out of pid_t range rather than relying on
13337 undefined behavior.
e4d81efc 13338 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
13339 (Fformat_network_address, read_process_output, send_process)
13340 (Fprocess_send_region, status_notify):
13341 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13342 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13343 (wait_reading_process_output, read_process_output, exec_sentinel):
13344 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13345 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13346 (Faccept_process_output): Use duration_to_sec_usec to do proper
13347 overflow checking on durations.
dde14581
PE
13348 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13349 Don't assume pid_t fits in int.
02481186
PE
13350 * process.h (struct Lisp_Process): Members tick and update_tick
13351 are now of type EMACS_INT, not int.
b62b53e8
PE
13352 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13353 configured --with-wide-int.
d311d28c
PE
13354 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13355 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13356 * search.c (looking_at_1, string_match_1):
13357 (fast_string_match, fast_c_string_match_ignore_case)
13358 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13359 (scan_newline, find_before_next_newline, search_command)
13360 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13361 (set_search_regs, wordify):
13362 (Freplace_match):
13363 (Fmatch_data):
13364 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13365 (string_match_1, search_buffer, set_search_regs):
13366 (Fmatch_data):
13367 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13368 (wordify): Check for overflow in size calculation.
13369 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13370 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13371 Check that fixnums are in proper range for system types.
13372 * sound.c (struct sound_device)
13373 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13374 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13375 (Fplay_sound_internal):
13376 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 13377 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
13378 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13379 (Fparse_partial_sexp):
13380 Don't assume fixnums can fit in int.
13381 (struct lisp_parse_state, find_start_pos, find_start_value)
13382 (find_start_value_byte, find_start_begv)
13383 (update_syntax_table, char_quoted, dec_bytepos)
13384 (find_defun_start, prev_char_comend_first, back_comment):
13385 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13386 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13387 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13388 (Finternal_describe_syntax_value): Check that match_lisp is a
13389 character, not an integer, since the code stuffs it into int.
13390 (scan_words, scan_sexps_forward):
13391 Check that fixnums are in proper range for system types.
13392 (Fforward_word):
13393 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13394 (scan_sexps_forward):
13395 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13396 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13397 * syntax.h: Adjust decls to match defn changes elsewhere.
13398 (struct gl_state_s):
13399 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
13400 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13401 MOST_POSITIVE_FIXNUM.
d311d28c
PE
13402 * sysdep.c (wait_for_termination_1, wait_for_termination)
13403 (interruptible_wait_for_termination, mkdir):
13404 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13405 (emacs_read, emacs_write):
13406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
13407 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13408 and double all fit in int.
d311d28c
PE
13409 * term.c (set_tty_color_mode):
13410 Check that fixnums are in proper range for system types.
13411 * termhooks.h (struct input_event):
13412 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13413 * textprop.c (validate_interval_range, interval_of)
13414 (Fadd_text_properties, set_text_properties_1)
13415 (Fremove_text_properties, Fremove_list_of_text_properties)
13416 (Ftext_property_any, Ftext_property_not_all)
13417 (copy_text_properties, text_property_list, extend_property_ranges)
13418 (verify_interval_modification):
13419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13420 (Fnext_single_char_property_change)
13421 (Fprevious_single_char_property_change):
13422 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
13423 (copy_text_properties):
13424 Check for integer overflow in index calculation.
d311d28c
PE
13425 * undo.c (last_boundary_position, record_point, record_insert)
13426 (record_delete, record_marker_adjustment, record_change)
13427 (record_property_change):
13428 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13429 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13430 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13431 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13432 (Fx_hide_tip, Fx_file_dialog):
13433 * w32menu.c (set_frame_menubar):
13434 Use ptrdiff_t, not int, for consistency with rest of code.
13435 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13436 (select_window, Fdelete_other_windows_internal)
13437 (window_scroll_pixel_based, window_scroll_line_based)
13438 (Frecenter, Fset_window_configuration):
13439 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13440 (Fset_window_hscroll, run_window_configuration_change_hook)
13441 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 13442 (Fscroll_other_window, Frecenter):
d311d28c
PE
13443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13444 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13445 Don't assume fixnum fits in int.
13446 (Fset_window_scroll_bars):
13447 Check that fixnums are in proper range for system types.
13448 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13449 (string_pos, c_string_pos, number_of_chars, init_iterator)
13450 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13451 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13452 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
13453 (face_before_or_after_it_pos, handle_invisible_prop)
13454 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
13455 (display_prop_intangible_p, string_buffer_position_lim)
13456 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13457 (get_overlay_strings_1, get_overlay_strings)
13458 (iterate_out_of_display_property, forward_to_next_line_start)
13459 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13460 (get_next_display_element, set_iterator_to_next)
13461 (get_visually_first_element, compute_stop_pos_backwards)
13462 (handle_stop_backwards, next_element_from_buffer)
13463 (move_it_in_display_line_to, move_it_in_display_line)
13464 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13465 (add_to_log, message_dolog, message_log_check_duplicate)
13466 (message2, message2_nolog, message3, message3_nolog
13467 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13468 (current_message_1, truncate_echo_area, truncate_message_1)
13469 (set_message, set_message_1, store_mode_line_noprop)
13470 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13471 (text_outside_line_unchanged_p, check_point_in_composition)
13472 (reconsider_clip_changes)
13473 (redisplay_internal, set_cursor_from_row, try_scrolling)
13474 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13475 (redisplay_window, find_last_unchanged_at_beg_row)
13476 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13477 (trailing_whitespace_p, find_row_edges, display_line)
13478 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13479 (display_mode_element, store_mode_line_string)
13480 (pint2str, pint2hrstr, decode_mode_spec)
13481 (display_count_lines, display_string, draw_glyphs)
13482 (x_produce_glyphs, x_insert_glyphs)
13483 (rows_from_pos_range, mouse_face_from_buffer_pos)
13484 (fast_find_string_pos, mouse_face_from_string_pos)
13485 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13486 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13487 (safe_call, init_from_display_pos, handle_fontified_prop)
13488 (handle_single_display_spec, load_overlay_strings)
13489 (with_echo_area_buffer, setup_echo_area_for_printing)
13490 (display_echo_area, echo_area_display)
13491 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13492 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
13493 (redisplay_window, dump_glyph_row, display_mode_line)
13494 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 13495 (handle_display_spec, display_prop_string_p):
d311d28c
PE
13496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13497 (handle_single_display_spec, build_desired_tool_bar_string)
13498 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13499 (get_specified_cursor_type):
13500 Check that fixnums are in proper range for system types.
13501 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13502 (Flookup_image_map):
13503 Don't assume fixnums fit in int.
13504 (compare_overlay_entries):
13505 Avoid mishandling comparisons due to subtraction overflow.
13506 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13507 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13508 (handle_tool_bar_click):
13509 Use int, not unsigned, since we prefer signed and the signedness
13510 doesn't matter here.
13511 (get_next_display_element, next_element_from_display_vector):
13512 Use int, not EMACS_INT, when int is wide enough.
13513 (start_hourglass): Use duration_to_sec_usec to do proper
13514 overflow checking on durations.
13515 * xfaces.c (Fbitmap_spec_p):
13516 Check that fixnums are in proper range for system types.
13517 (compare_fonts_by_sort_order):
13518 Avoid mishandling comparisons due to subtraction overflow.
13519 (Fx_family_fonts, realize_basic_faces):
13520 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13521 (Fx_family_fonts):
13522 Don't assume fixnum fits in int.
13523 Use SAFE_ALLOCA_LISP, not alloca.
13524 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13525 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13526 (face_at_buffer_position, face_for_overlay_string)
13527 (face_at_string_position):
13528 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13529 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13530 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13531 (Fx_show_tip):
13532 Check that fixnums are in proper range for system types.
13533 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13534 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13535 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13536 (Fx_change_window_property): Don't assume fixnums fit in int.
13537 * xfont.c (xfont_chars_supported):
13538 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13539 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13540 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13541 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13542 * xml.c (parse_region):
13543 * xrdb.c (magic_file_p):
13544 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13545 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13546 (x_get_local_selection, x_reply_selection_request)
13547 (x_handle_selection_request, wait_for_property_change):
13548 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13549 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13550 short is wide enough.
13551 (x_send_client_event): Don't assume fixnum fits in int.
13552 * xterm.c (x_x_to_emacs_modifiers):
13553 Don't assume EMACS_INT overflows nicely into int.
13554 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13555 may come from Lisp.
13556 (handle_one_xevent): NATNUMP can eval its arg twice.
13557 (x_connection_closed):
13558 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13559 * xterm.h: Adjust decls to match defn changes elsewhere.
13560 (struct scroll_bar): Use struct vectorlike_header
13561 rather than rolling our own approximation.
13562 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13563
c6574eb5
GM
135642012-05-25 Glenn Morris <rgm@gnu.org>
13565
13566 * lisp.mk (lisp): Update for more files being compiled now.
13567
e8d32c7e
SM
135682012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13569
48def666
SM
13570 * lread.c: Remove `read_pure' which makes no difference.
13571 (read_pure): Remove var.
13572 (unreadpure): Remove function.
13573 (readevalloop): Don't call read_list with -1 flag.
13574 (read1, read_vector): Don't test read_pure any more.
13575 (read_list): Simplify.
13576
e8d32c7e
SM
13577 * fileio.c, character.h: Minor style tweaks.
13578
4b2addb7
DA
135792012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13580
13581 * window.h (clip_changed): Remove useless declaration.
13582
584461b2
JB
135832012-05-22 Juanma Barranquero <lekktu@gmail.com>
13584
13585 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13586 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13587
34374650
PE
135882012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13589
13590 Remove src/m/*.
13591 This directory predates autoconf and is no longer needed nowadays.
13592 Move its few remaining bits of functionality to where they're needed.
13593 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13594 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13595 * m/template.h: Remove.
13596 * Makefile.in (M_FILE): Remove. All uses removed.
13597 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13598 * lisp.h (USE_LSB_TAG):
13599 * mem-limits.h (EXCEEDS_LISP_PTR):
13600 Use VAL_MAX, not VALBITS, in #if.
13601 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13602 (EMACS_UINT): Define unconditionally now.
13603 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13604 (BITS_PER_EMACS_INT): New constants, replacing
13605 what used to be in config.h, but not useful in #if.
13606 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13607 define them any more.
13608 (VAL_MAX): New macro.
13609 (VALMASK): Use it.
13610 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13611 BITS_PER_EMACS_INT, in #if.
13612 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13613 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13614 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13615 * s/ms-w32.h (DATA_START):
13616 Move here from removed file m/intel386.h.
13617 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13618 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13619
261cb4bb
PE
136202012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13621
13622 Assume C89 or later.
13623 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13624 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13625 (xrealloc):
13626 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13627 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13628 * textprop.c, tparam.c (NULL): Remove.
13629 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13630 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13631 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13632 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13633 * xterm.c (input_signal_count): Assume volatile works.
13634
ff23cd9f
KB
136352012-05-21 Ken Brown <kbrown@cornell.edu>
13636
13637 * xgselect.c (xg_select): Fix first argument in call to 'select'
13638 (bug#11508).
13639
1b170bc6
KB
136402012-05-20 Ken Brown <kbrown@cornell.edu>
13641
13642 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 13643 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 13644
b2f4d39f
KB
136452012-05-19 Ken Brown <kbrown@cornell.edu>
13646
13647 * xfns.c (x_in_use): Remove `static' qualifier.
13648 * xterm.h (x_in_use): Declare.
13649 * xgselect.c: Include xterm.h.
13650 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13651 and `display_arg' (bug#9754).
13652
003fdae2
PE
136532012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13654
9232a6d9
PE
13655 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13656
003fdae2
PE
13657 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13658 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13659
784b56e2
EZ
136602012-05-18 Eli Zaretskii <eliz@gnu.org>
13661
13662 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13663
13664 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 13665 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
13666
13667 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13668 reference to image_cache->refcount.
13669 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13670
a0a79cde
JL
136712012-05-17 Juri Linkov <juri@jurta.org>
13672
13673 * search.c (Fword_search_regexp, Fword_search_backward)
13674 (Fword_search_forward, Fword_search_backward_lax)
13675 (Fword_search_forward_lax): Move functions to isearch.el
13676 (bug#10145, bug#11381).
13677
b0572523
PE
136782012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13679
13680 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13681
9660f5fc
SM
136822012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13683
13684 * lread.c (init_obarray): Declare Qt and Qnil as special.
13685
4374de83
GM
136862012-05-14 Glenn Morris <rgm@gnu.org>
13687
13688 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 13689 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 13690
dc44c39a
PE
136912012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13692
078c97cb
PE
13693 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13694
dc44c39a
PE
13695 * unexaix.c: Port to more-recent AIX compilers.
13696 (report_error, report_error_1, make_hdr, copy_sym)
13697 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13698 Make arguments const char *, not char *, to avoid violations of C
13699 standard and to fix some AIX warnings reported by Gilles Pion.
13700
e18afed7 137012012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
13702
13703 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13704 already have overlays loaded.
13705 (handle_single_display_spec): Before returning without displaying
13706 fringe bitmap, synchronize the bidi iterator with the main display
13707 iterator, by calling iterate_out_of_display_property.
13708 (iterate_out_of_display_property): Detect buffer iteration by
13709 testing that it->string is a Lisp string.
13710 (get_next_display_element): When the current object is exhausted,
13711 and there's something on it->stack, call set_iterator_to_next to
13712 proceed with what's on the stack, instead of returning zero.
13713 (set_iterator_to_next): If called at the end of a Lisp string,
13714 proceed to consider_string_end without incrementing string
13715 position. Don't increment display vector index past the end of
13716 the display vector. (Bug#11417)
c8fb9dc6
EZ
13717 (pos_visible_p): Don't report a position visible when move_it_to
13718 stopped at the last line of window, which happens to be scanned
13719 backwards by the bidi iteration. (Bug#11464)
ac268e67 13720
e18afed7 137212012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
13722
13723 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13724 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
13725 are on a TTY, and thus unable to display on the fringes.
13726 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
13727 so we need to signal to the caller that this is a "replacing"
13728 display spec. This fixes display when the spec is invalid or we
13729 are on a TTY.
13730
e18afed7 137312012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
13732
13733 * unexaix.c (make_hdr): Fix typo in prototype.
13734 This bug broke the build on AIX. Problem reported by Gilles Pion.
13735
9d0a235a
MA
137362012-05-14 Michael Albinus <michael.albinus@gmx.de>
13737
13738 * keyboard.c (kbd_buffer_get_event): Read special events also in
13739 batch mode. (Bug#11415)
13740
9e6b06ed
GM
137412012-05-12 Glenn Morris <rgm@gnu.org>
13742
13743 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13744
c1a1d7a3
EZ
137452012-05-12 Eli Zaretskii <eliz@gnu.org>
13746
13747 * lisp.mk (lisp): Add newcomment.elc.
13748
3fe7cdc8
GM
137492012-05-12 Glenn Morris <rgm@gnu.org>
13750
13751 * Makefile.in (MKDIR_P): New, set by configure.
13752 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13753
53f7d2c0
PE
137542012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13755
13756 Remove unused function hourglass_started.
13757 * dispextern.h (hourglass_started):
13758 * w32fns.c (hourglass_started):
13759 * xdisp.c (hourglass_started): Remove.
13760
75aafb17
JB
137612012-05-10 Juanma Barranquero <lekktu@gmail.com>
13762
13763 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13764 Update dependencies.
13765
12959e8e
PE
137662012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13767
97107e2e
PE
13768 * xgselect.c (xg_select): Put maxfds+1 into a var.
13769 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13770
12959e8e
PE
13771 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13772
836d29b3
DA
137732012-05-10 Dave Abrahams <dave@boostpro.com>
13774
13775 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13776 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13777
5cb67954
MA
137782012-05-09 Michael Albinus <michael.albinus@gmx.de>
13779
13780 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 13781 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
13782 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13783 Initialize xd_registered_buses.
13784
3478ec45
PE
137852012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13786
b263a6b0
PE
13787 Untag more efficiently if USE_LSB_TAG.
13788 This is based on a proposal by YAMAMOTO Mitsuharu in
13789 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13790 For an admittedly artificial (nth 8000 longlist) benchmark on
13791 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13792 Emacs's overall text size by 1%.
13793 * lisp.h (XUNTAG): New macro.
13794 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13795 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13796 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13797 * eval.c (Fautoload):
13798 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13799 * frame.h (XFRAME): Use XUNTAG.
13800
3478ec45
PE
13801 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13802 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13803 Remove unportable assumptions about print widths of types like
13804 dbus_uint32_t.
13805 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13806 intptr_t when converting between pointer and integer, to avoid GCC
13807 warnings about wrong width.
13808
666b903b 138092012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
13810
13811 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13812 stack for each reader_thread, instead of defaulting to 8MB
13813 determined by the linker. This avoids failures in creating
13814 subprocesses on Windows 7, see the discussion in this thread:
13815 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13816
b120cc17
JC
138172012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13818
13819 Fix up display of the *Minibuf-0* buffer in the mini window.
13820 * keyboard.c (read_char): Don't clear the echo area if there's no
13821 message to clear.
13822 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 13823 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 13824
9a4b36f8
MA
138252012-05-07 Michael Albinus <michael.albinus@gmx.de>
13826
13827 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13828 batch mode.
13829
e5f9458f
CY
138302012-05-06 Chong Yidong <cyd@gnu.org>
13831
13832 * lisp.mk (lisp): Update.
13833
eceeb5fc 138342012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
13835
13836 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13837
71873e2b
SM
138382012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13839
13840 * data.c (PUT_ERROR): New macro.
13841 (syms_of_data): Use it. Add new error type `user-error'.
13842 * undo.c (user_error): New function.
13843 (Fprimitive_undo): Use it.
13844 * print.c (print_error_message): Adjust print style for `user-error'.
13845 * keyboard.c (user_error): New function.
13846 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13847
ab0fa4e4
PE
138482012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13849
13850 Do not limit current-time-string to years 1000..9999.
13851 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13852 (Fcurrent_time_string): Support any year that is supported by the
13853 underlying localtime representation. Don't use asctime, as it
13854 has undefined behavior for years outside the range -999..9999.
13855
7ed806a7
PE
138562012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13857
13858 Fix race conditions involving setenv, gmtime, localtime, asctime.
13859 Without this fix, interrupts could mess up code that uses these
13860 nonreentrant functions, since setting TZ invalidates existing
13861 tm_zone or tzname values, and since most of these functions return
13862 pointers to static storage.
13863 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13864 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13865 Grow the critical sections to include not just invoking
13866 localtime/gmtime, but also accessing these functions' results
13867 including their tm_zone values if any, and any related TZ setting.
13868 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
13869 so that the struct tm is saved in the critical section.
13870 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
13871 motivated by the fact that memory allocation needs to be outside
13872 the critical section.
13873
0c16dfed
DA
138742012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13875
13876 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13877 with RESET_INTERVAL.
13878
13879 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13880 Remove duplicated buffer name initialization.
13881
3f83ace8
JM
138822012-05-02 Jim Meyering <jim@meyering.net>
13883
13884 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13885
c7b8541e
JM
13886 * xfns.c (x_window): Use xstrdup (Bug#11375).
13887
90207a15 138882012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
13889
13890 * xdisp.c (pos_visible_p): If already at a newline from the
13891 display string before the 'while' loop, don't walk back the glyphs
13892 from it3.glyph_row. Solves assertion violation when the display
13893 string begins with a newline (egg.el). (Bug#11367)
13894
b593d6a9
AH
138952012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13896
13897 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13898 Move to simple.el.
13899
4737362e
GM
139002012-05-01 Glenn Morris <rgm@gnu.org>
13901
99cf43f9
GM
13902 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13903 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13904 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13905 All were removed before 23.1.
13906
9311dcff
GM
13907 * dispnew.c: Remove HAVE_LIBNCURSES test;
13908 it is always true on relevant platforms.
13909
4d5c6349
GM
13910 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13911 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13912
4737362e
GM
13913 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13914
74dd3a6b
AS
139152012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13916
13917 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13918 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13919 Remove.
13920
13c379ee
PE
139212012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13922
13923 Do not avoid creating empty evaporating overlays (Bug#9642).
13924 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13925 That is, do not delete an evaporating overlay if it becomes
13926 empty after its bounds are adjusted to fit within its buffer.
13927 This fix caused other problems, and I'm reverting it until we get
13928 to the bottom of them.
13929
a8e7d6d7 139302012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
13931
13932 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13933
a8e7d6d7 139342012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
13935
13936 * xdisp.c (pos_visible_p): If the window start position is beyond
13937 ZV, start the display from buffer beginning. Prevents assertion
13938 violation in init_iterator when the minibuffer window is scrolled
13939 via the scroll bar.
13940
13941 * window.c (window_scroll_pixel_based): Likewise.
13942
a8e7d6d7 139432012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
13944
13945 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13946
a8e7d6d7 139472012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
13948
13949 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13950 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13951
a8e7d6d7 139522012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 13953
b593d6a9
AH
13954 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13955 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 13956
1c6900d9
EZ
139572012-04-26 Eli Zaretskii <eliz@gnu.org>
13958
4c3fa1d9
EZ
13959 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13960 display element, check also the underlying string or buffer
13961 character. (Bug#11341)
13962
1c6900d9
EZ
13963 * w32menu.c: Include w32heap.h.
13964 (add_menu_item): If the call to AppendMenuW (via
13965 unicode_append_menu) fails, disable Unicode menus only if we are
13966 running on Windows 9X/Me.
13967
42bf8205
AS
139682012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13969
13970 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13971 (xgetint): Add missing shift for LSB tags.
13972
b1bac16e
MR
139732012-04-24 Martin Rudalics <rudalics@gmx.at>
13974
13975 * keyboard.c (read_char): Don't wipe echo area for select window
13976 events: These might get delayed via `mouse-autoselect-window'
13977 (Bug#11304).
13978
d69621cc
JB
139792012-04-24 Juanma Barranquero <lekktu@gmail.com>
13980
13981 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13982 manipulation of :loaded-from data.
13983
02fd101b
JB
139842012-04-23 Juanma Barranquero <lekktu@gmail.com>
13985
13986 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13987 now a cons (bug#11311).
13988
888bec30
PE
139892012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13990
89a438bd
PE
13991 Do not create empty overlays with the evaporate property (Bug#9642).
13992 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13993 if it becomes empty after its bounds are adjusted to fit within
13994 its buffer. Without this fix, in a nonempty buffer (let ((o
13995 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13996 yields an empty overlay that has the evaporate property, which is
13997 not supposed to happen.
13998
1068fe4d
PE
13999 Fix minor GTK3 problems found by static checking.
14000 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14001 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14002 (struct _EmacsFixedClass, emacs_fixed_get_type):
14003 Move decls here from emacsgtkfixed.h, since they needn't be public.
14004 (emacs_fixed_get_type): Now static.
14005 (emacs_fixed_class_init): Omit unused local.
14006 (emacs_fixed_child_type): Remove; unused.
14007 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14008 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14009 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14010 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14011 (EMACS_FIXED_GET_CLASS): Remove; unused.
14012 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14013
888bec30
PE
14014 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14015 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14016
de85e130
PE
140172012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14018
d0baac98 14019 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 14020 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
14021 (__malloc_size_t, __malloc_ptrdiff_t):
14022 Remove. All uses removed, replaced by the definiens if needed,
14023 since we can assume C89 or better now.
14024 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14025 (protect_malloc_state, align, get_contiguous_space)
14026 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14027 (malloc_atfork_handler_child, malloc_enable_thread)
14028 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14029 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14030 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14031 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14032 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14033 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14034 Define using prototypes, not old style.
14035 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14036 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14037 (align): Don't assume that signed integer overflow wraps around.
14038 Omit unused local var.
14039 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14040 (_free_internal_nolock, memalign, mallochook, reallochook):
14041 Omit no-longer-needed casts.
14042 (valloc): Use getpagesize, not __getpagesize.
14043 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14044 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14045
de85e130
PE
14046 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14047
dcbf5805
MA
140482012-04-22 Michael Albinus <michael.albinus@gmx.de>
14049
14050 Move functions from C to Lisp. Make non-blocking method calls
14051 the default. Implement further D-Bus standard interfaces.
14052
14053 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14054 (QCdbus_request_name_allow_replacement)
14055 (QCdbus_request_name_replace_existing)
14056 (QCdbus_request_name_do_not_queue)
14057 (QCdbus_request_name_reply_primary_owner)
14058 (QCdbus_request_name_reply_in_queue)
14059 (QCdbus_request_name_reply_exists)
14060 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14061 (QCdbus_registered_serial, QCdbus_registered_method)
14062 (QCdbus_registered_signal): New Lisp objects.
14063 (XD_DEBUG_MESSAGE): Use sizeof.
14064 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14065 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14066 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14067 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14068 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14069 (xd_signature, xd_append_arg): Allow float for integer types.
14070 (xd_get_connection_references): New function.
b593d6a9
AH
14071 (xd_get_connection_address): Rename from xd_initialize.
14072 Return cached address.
dcbf5805
MA
14073 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14074 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14075 level.
14076 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 14077 Return number of refcounts.
dcbf5805
MA
14078 (Fdbus_get_unique_name): Make stronger parameter check.
14079 (Fdbus_message_internal): New defun.
14080 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14081 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14082 (Fdbus_send_signal, Fdbus_register_service)
14083 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14084 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14085 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14086 (Vdbus_compiled_version, Vdbus_runtime_version)
14087 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14088 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14089 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
14090 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14091 Adapt docstring.
dcbf5805 14092
52828e02
PE
140932012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14094
da05bc4c
PE
14095 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14096 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14097 Do not assume ptrdiff_t is the same width as 'int'.
14098
52828e02
PE
14099 * alloc.c: Handle unusual debugging option combinations.
14100 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14101 since the two debugging options are incompatible.
14102 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14103 is defined.
14104 (mem_init, mem_insert, mem_insert_fixup):
14105 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14106 (NEED_MEM_INSERT): Remove; no longer needed.
14107
f01769f9
LL
141082012-04-22 Leo Liu <sdl.web@gmail.com>
14109
14110 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14111
5790543d
PE
141122012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14113
14114 * sysdep.c [__FreeBSD__]: Minor cleanups.
14115 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14116 Use Emacs indenting style more consistently. Avoid some casts.
14117 Use 'double' consistently rather than mixing 'float' and 'double'.
14118
b91b7e4d
EW
141192012-04-21 Eduard Wiebe <usenet@pusto.de>
14120
b593d6a9
AH
14121 * sysdep.c (list_system_processes, system_process_attributes):
14122 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 14123
6114eb15
AS
141242012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14125
14126 * lisp.mk (lisp): Update.
14127
2f38dff7
PE
141282012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14129
14130 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14131 It is never used otherwise.
14132
4ae29f89
SM
141332012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14134
14135 * print.c (print_preprocess): Only check print_depth if print-circle
14136 is nil.
14137 (print_object): Check for cycles even when print-circle is nil and
14138 print-gensym is t, but only check print_depth if print-circle is nil.
14139
f30d612a
CY
141402012-04-20 Chong Yidong <cyd@gnu.org>
14141
14142 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14143 set the status to "failed" and ensure that sentinel is run.
14144
c07a4c0b 141452012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
14146
14147 * process.c (Fset_process_inherit_coding_system_flag)
14148 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 14149 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 14150
c07a4c0b 141512012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
14152
14153 * xdisp.c (string_buffer_position_lim): Limit starting position to
14154 BEGV.
14155 (set_cursor_from_row): If called for a mode-line or header-line
14156 row, return zero immediately.
14157 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
14158 farther than the first row after the header line, if any.
14159 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
14160 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14161
c07a4c0b 141622012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 14163
4ae29f89
SM
14164 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14165 (bug#11238).
ad3a2b41 14166
c07a4c0b 141672012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 141682012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
14169
14170 configure: new option --enable-gcc-warnings (Bug#11207)
14171 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14172 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14173 (ALL_CFLAGS): Use new macros rather than old.
14174 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14175 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14176 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14177 -Wunused-result, -Wunused-variable. This should go away once
14178 the Emacs and Gnulib regex code is merged.
14179 (xmalloc, xrealloc): Now static.
14180
aba027e8
PE
141812012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14182
14183 * dired.c (Fsystem_groups): Remove unused local.
14184
e5a36063
GM
141852012-04-17 Glenn Morris <rgm@gnu.org>
14186
14187 * dired.c (Fsystem_users): Doc fix.
14188
316411f0
DA
141892012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14190
14191 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14192 (syms_of_dired): Add them.
14193
9426aba4
PE
141942012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14195
b62a57be
PE
14196 Fix minor alloc.c problems found by static checking.
14197 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14198 New extern decls, to avoid calling undeclared functions.
14199 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14200 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14201 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14202 (NEED_MEM_INSERT): New macro.
14203 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 14204 Remove one incorrect comment and fix another.
b62a57be 14205
3539f31f
PE
14206 Fix minor ralloc.c problems found by static checking.
14207 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14208 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14209 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14210 (r_alloc_sbrk): Now static.
14211
a041960a
PE
14212 Improve ralloc.c interface checking.
14213 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14214 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14215 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14216 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14217 [REL_ALLOC]: ... to here, to check interface.
14218 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14219 Remove decls. This fixes an "It stinks!".
14220
9426aba4
PE
14221 * alloc.c (which_symbols): Fix alignment issue / type clash.
14222
d55c12ed
AS
142232012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14224
14225 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14226 (struct Lisp_Misc_Any): Likewise.
14227 (struct Lisp_Free): Likewise.
14228 * alloc.c (union aligned_Lisp_Symbol): Define.
14229 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14230 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14231 (union aligned_Lisp_Misc): Define.
14232 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14233 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 14234 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 14235
b948ce8b
PE
142362012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14237
14238 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14239 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14240 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14241 * s/netbsd.h, s/sol2-6.h:
14242 Remove definition of GC_MARK_STACK, since the default now works.
14243 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14244 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14245 no longer the default.
14246 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14247
35dc09a1 142482012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 14249
35dc09a1
GM
14250 * lread.c (lisp_file_lexically_bound_p):
14251 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 14252
35dc09a1
GM
142532012-04-14 Eli Zaretskii <eliz@gnu.org>
14254
14255 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14256 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14257
142582012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14259
14260 * nsterm.m (constrainFrameRect): Always constrain when there is only
14261 one screen (Bug#10962).
14262
bcd86815
KB
142632012-04-13 Ken Brown <kbrown@cornell.edu>
14264
14265 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14266
c25df26e
RT
142672012-04-13 Reuben Thomas <rrt@sc3d.org>
14268
14269 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14270
0fc59f1e
DC
142712012-04-11 Daniel Colascione <dancol@dancol.org>
14272
14273 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14274 against is gone. It's better to use vfork now so that when Cygwin
14275 gains a new, working vfork, we use it automatically (bug#10398).
14276
de8c03dc
SM
142772012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14278
14279 * window.c (save_window_save): Obey window-point-insertion-type.
14280
2f097256
GM
142812012-04-11 Glenn Morris <rgm@gnu.org>
14282
14283 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14284
453b951e
SM
142852012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14286
14287 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14288
75f1671a 142892012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
14290
14291 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14292 (force_quit_count): New var.
14293 (handle_interrupt): Use it.
14294
2a8ce227
JB
142952012-04-10 Juanma Barranquero <lekktu@gmail.com>
14296
14297 * w32.c (w32_delayed_load): Record the full path of the library
14298 being loaded (bug#10424).
14299
935396c0
GM
143002012-04-09 Glenn Morris <rgm@gnu.org>
14301
05920a43
GM
14302 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14303 not just in the obarray, before snarfing them. (Bug#11036)
14304
935396c0
GM
14305 * Makefile.in ($(leimdir)/leim-list.el):
14306 Pass EMACS rather than BUILT_EMACS.
14307
a18ecafa
TZ
143082012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14309
14310 * process.c (make_process):
14311 * process.h: Add integer `gnutls_handshakes_tried' member to
14312 process struct.
14313
6bbef4e5
JC
14314 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14315 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
14316
14317 * gnutls.c (gnutls_log_function2i): Convenience log function.
14318 (emacs_gnutls_read): Use new log functions,
14319 `gnutls_handshakes_tried' process member, and
14320 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14321 attempts per process (connection).
14322
b4d3bc10
CY
143232012-04-09 Chong Yidong <cyd@gnu.org>
14324
14325 * eval.c (Fuser_variable_p, user_variable_p_eh)
14326 (lisp_indirect_variable): Functions deleted.
14327 (Fdefvar): Caller changed.
14328
14329 * callint.c (Finteractive, Fcall_interactively):
14330 * minibuf.c (Fread_variable): Callers changed.
14331
70f4d973
EZ
143322012-04-09 Eli Zaretskii <eliz@gnu.org>
14333
14334 * xdisp.c (set_cursor_from_row): If the display string appears in
14335 the buffer at position that is closer to point than the position
14336 after the display string, display the cursor on the first glyph of
14337 the display string. Fixes cursor display when a 'display' text
14338 property immediately follows invisible text. (Bug#11094)
14339
cb3c2e3e
PE
143402012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14341
14342 composite.c: use 'double' consistently
14343 * composite.c (get_composition_id): Use 'double' consistently
14344 instead of converting 'float' to 'double' and vice versa; this is
14345 easier to understand and avoids a GCC warning.
14346
fd06db5d
GM
143472012-04-09 Glenn Morris <rgm@gnu.org>
14348
50fe702a
GM
14349 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14350 preparation for dumping it with emacs. (Bug#4789)
14351 (leimdir): New variable.
14352 ($(leimdir)/leim-list.el): New rule.
14353 (emacs$(EXEEXT)): Depend on leim-list.el.
14354
fd06db5d
GM
14355 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14356 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14357 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14358
55c131ee
AS
143592012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14360
14361 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14362 proper alignment.
14363
9209588f
JB
143642012-04-07 Juanma Barranquero <lekktu@gmail.com>
14365
14366 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14367 Remove unused local variable.
14368
e3fb2efb
PE
143692012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14370
14371 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14372 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14373 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14374 objects, as mark_maybe_pointer will catch them otherwise.
14375 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14376 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14377
b5385551
PE
143782012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14379
14380 Fix typo that broke non-Windows builds.
14381 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14382
9078ead6
EZ
143832012-04-07 Eli Zaretskii <eliz@gnu.org>
14384
14385 Support building on MS-Windows with libxml2.
14386
14387 * makefile.w32-in (OBJ2): Add xml.$(O).
14388 (GLOBAL_SOURCES): Add xml.c.
14389 ($(BLD)/xml.$(O)): New dependency list.
14390
14391 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14392 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14393 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14394 [!WINDOWSNT]: New macros.
14395 (init_libxml2_functions, libxml2_loaded_p): New functions.
14396 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14397 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14398 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14399 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14400 linked in).
6bbef4e5
JC
14401 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14402 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
14403 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14404
14405 * emacs.c: Don't include libxml/parser.h.
14406 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14407 xmlCleanupParser directly.
14408
14409 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14410
3811fdf3
EZ
144112012-04-07 Eli Zaretskii <eliz@gnu.org>
14412
14413 * indent.c (Fvertical_motion): If there is a display string at
14414 point, use it.vpos to compute how many lines to backtrack after
14415 move_it_to point. (Bug#11133)
14416
2f8e16b2
EZ
144172012-04-06 Eli Zaretskii <eliz@gnu.org>
14418
14419 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14420 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14421 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14422 macros related to unification of CJK characters. For the details,
14423 see the discussion following the message here:
14424 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14425
3d439cd1
CY
144262012-04-04 Chong Yidong <cyd@gnu.org>
14427
14428 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14429
8bc53d00
EZ
144302012-04-01 Eli Zaretskii <eliz@gnu.org>
14431
14432 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14433 instead of alloca. (Bug#11138)
14434
3b0512a3
AS
144352012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14436
14437 * w32menu.c (is_simple_dialog): Properly check lisp types.
14438 (Bug#11141)
14439
8427ddd2
EZ
144402012-03-31 Eli Zaretskii <eliz@gnu.org>
14441
979022ef
EZ
14442 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14443 position we get to after a call to move_it_to fails the
14444 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14445 only if we wind up in a string from display property. (Bug#11063)
14446
a6b1c7cc
EZ
14447 * window.c (Fdelete_other_windows_internal): Invalidate the row
14448 and column information about mouse highlight, so that redisplay
14449 restores it after reallocating the glyph matrices. (Bug#7464)
14450
8427ddd2
EZ
14451 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14452 string comes from a `display' text property, use the buffer
14453 position of that property as if we actually saw that position in
14454 the row's glyphs.
697ba24b
EZ
14455 (move_it_by_lines): Remove the assertion that
14456 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14457 violated when there's a before-string at the beginning of a line.
14458 (Bug#11063)
8427ddd2 14459
65a0a738
EZ
144602012-03-30 Eli Zaretskii <eliz@gnu.org>
14461
14462 * xdisp.c (append_space_for_newline): If the default face was
14463 remapped, use the remapped face for the appended newline.
14464 (extend_face_to_end_of_line): Use the remapped default face for
14465 extending the face to the end of the line.
14466 (display_line): Call extend_face_to_end_of_line when the default
14467 face was remapped. (Bug#11068)
14468
581355cc
EZ
144692012-03-29 Eli Zaretskii <eliz@gnu.org>
14470
14471 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14472
e8fc049f
SM
144732012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14474
14475 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14476
4fb9a543
GM
144772012-03-27 Glenn Morris <rgm@gnu.org>
14478
14479 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14480 Doc fixes.
14481
679910f1
KH
144822012-03-26 Kenichi Handa <handa@m17n.org>
14483
14484 * dispextern.h (struct glyph): Fix previous change. Change the
14485 bit length of glyphless.ch to 25 (Bug#11082).
14486
90d49b7f
CY
144872012-03-26 Chong Yidong <cyd@gnu.org>
14488
14489 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14490 (command_loop_1): Use it; inhibit selection update for
14491 handle-select-window too (Bug#8996).
14492
f514f6f0
FP
144932012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14494
e8fc049f 14495 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 14496
bf43fa51
KH
144972012-03-25 Kenichi Handa <handa@m17n.org>
14498
14499 * dispextern.h (struct glyph): Change the bit length of
14500 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14501
8a0c01dd
EZ
145022012-03-24 Eli Zaretskii <eliz@gnu.org>
14503
14504 * s/ms-w32.h (tzname): Include time.h before redirecting to
14505 _tzname. Fixes the MSVC build. (Bug#9960)
14506
7d1c3a76
AS
145072012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14508
8ed79523
AS
14509 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14510 characters.
14511
7d1c3a76
AS
14512 * xterm.c (XTread_socket): Only modify handling_signal if
14513 !SYNC_INPUT. (Bug#11080)
14514
e99a9b8b
EZ
145152012-03-23 Eli Zaretskii <eliz@gnu.org>
14516
14517 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14518 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14519 when fetching a multibyte character consumes more bytes than
14520 CHAR_BYTES returns, due to unification of CJK characters in
14521 string_char. (Bug#11073)
14522
5063c0e1
TN
145232012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14524
14525 * process.c (wait_reading_process_output): Handle pty disconnect
14526 by refraining from sending oneself a SIGCHLD (bug#10933).
14527
9f851fbd
CY
145282012-03-22 Chong Yidong <cyd@gnu.org>
14529
14530 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14531
5063c0e1 14532 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
14533 Mark string as coming from a prefix property.
14534 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14535 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14536
fb5b8aca
CY
145372012-03-21 Chong Yidong <cyd@gnu.org>
14538
14539 * xfaces.c (Vface_remapping_alist): Doc fix.
14540
62356a1b
EZ
145412012-03-20 Eli Zaretskii <eliz@gnu.org>
14542
14543 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
14544 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14545 Doc fixes.
62356a1b 14546
025de85b
CY
145472012-03-20 Chong Yidong <cyd@gnu.org>
14548
14549 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14550 to reflect default non-nil value of redisplay-dont-pause.
14551
4827f94e
KH
145522012-03-19 Kenichi Handa <handa@m17n.org>
14553
14554 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14555 it fit in a valid range (Bug#11003).
14556
e50a24a2
EZ
145572012-03-18 Eli Zaretskii <eliz@gnu.org>
14558
14559 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14560 that is not from display property, accept the row as a "cursor
14561 row" if one of the string's character has a non-nil `cursor'
14562 property. Fixes cursor positioning when there are newlines in
14563 overlay strings, e.g. in icomplete.el. (Bug#11035)
14564
9af5ed87
PE
145652012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14566
14567 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14568
d1f55f16
CY
145692012-03-12 Chong Yidong <cyd@gnu.org>
14570
14571 * eval.c (inhibit_lisp_code): Rename from
14572 inhibit_window_configuration_change_hook; move from window.c.
14573
14574 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14575 * window.c (run_window_configuration_change_hook)
14576 (syms_of_window): Callers changed.
14577
66c5eebd
CY
145782012-03-11 Chong Yidong <cyd@gnu.org>
14579
413df973
CY
14580 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14581
66c5eebd
CY
14582 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14583
1de11f56
CY
145842012-03-10 Chong Yidong <cyd@gnu.org>
14585
14586 * frame.c (other_visible_frames): Don't assume the selected frame
14587 is visible (Bug#10955).
14588
cae07000
SM
145892012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14590
14591 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14592
89c94350
JD
145932012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14594
14595 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14596 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14597 zero (Bug#10954).
14598
999dd333
GM
145992012-03-03 Glenn Morris <rgm@gnu.org>
14600
01a6dcc8 14601 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 14602
de0100f2
EZ
146032012-03-02 Eli Zaretskii <eliz@gnu.org>
14604
14605 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14606 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
14607 (redisplay_window, next_element_from_string): Fix typos in
14608 comments.
3e441275
EZ
14609 (redisplay_window): Pass to move_it_vertically the margin in
14610 pixels, not in screen lines.
de0100f2 14611
96a72ee9
GM
146122012-03-02 Glenn Morris <rgm@gnu.org>
14613
14614 * buffer.c (buffer-list-update-hook): Doc fix.
14615
312508d7
EZ
146162012-02-29 Eli Zaretskii <eliz@gnu.org>
14617
14618 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14619 push_it before setting up the iterator for the first overlay
14620 string, even if we have an empty string loaded.
14621 (next_overlay_string): If there's an empty string on the iterator
14622 stack, pop the stack. (Bug#10903)
14623
27f3c637
PE
146242012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14625
14626 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14627 Suggested by Stefan Monnier in
14628 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14629 * alloc.c (widen_to_Lisp_Object): New static function.
14630 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14631 and widening them to Lisp_Objects. This would work even if
14632 USE_LSB_TAG is defined and wide integers are used, which might
14633 happen in a future version of Emacs.
14634
3c9dfce6
CY
146352012-02-25 Chong Yidong <cyd@gnu.org>
14636
fa74b241
CY
14637 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14638 Doc fix.
14639
3c9dfce6
CY
14640 * xselect.c (Fx_selection_exists_p): Doc fix.
14641 (x_clipboard_manager_save_all): Print an informative message
14642 before saving to clipboard manager.
14643
9486df08
CY
146442012-02-24 Chong Yidong <cyd@gnu.org>
14645
14646 * keyboard.c (process_special_events): Handle all X selection
14647 requests in kbd_buffer, not just the next one (Bug#8869).
14648
f01d3321
CY
146492012-02-23 Chong Yidong <cyd@gnu.org>
14650
14651 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14652 call when setting menu-bar-lines and tool-bar-lines parameters.
14653 (unwind_create_frame_1): New helper function.
14654
14655 * window.c (inhibit_window_configuration_change_hook): New var.
14656 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 14657 (syms_of_window): Initialize it.
f01d3321 14658
86b847b6
CY
146592012-02-22 Chong Yidong <cyd@gnu.org>
14660
14661 * xterm.c (x_draw_image_relief): Add missing type check for
14662 Vtool_bar_button_margin (Bug#10743).
14663
a59225b1
CY
146642012-02-21 Chong Yidong <cyd@gnu.org>
14665
14666 * fileio.c (Vfile_name_handler_alist): Doc fix.
14667
14668 * buffer.c (Fget_file_buffer): Protect against invalid file
14669 handler return value.
14670
310f5bd4
PE
146712012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14672
cb3a28cc
PE
14673 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14674 when computing $valmask.
14675
310f5bd4
PE
14676 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14677 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14678 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14679 It's useless in that case, and it can cause problems on hosts
14680 that allocate halves of EMACS_INT values separately.
14681 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14682 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14683 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14684 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14685 it avoids undefined behavior on hosts where shifting right by more
14686 than the word width has undefined behavior.
14687
2375c96a
CY
146882012-02-19 Chong Yidong <cyd@gnu.org>
14689
14690 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14691 (Funhandled_file_name_directory, Ffile_name_as_directory)
14692 (Fdirectory_file_name, Fexpand_file_name)
14693 (Fsubstitute_in_file_name): Protect against invalid file handler
14694 return values (Bug#10845).
14695
3eb49e71
EZ
146962012-02-18 Eli Zaretskii <eliz@gnu.org>
14697
14698 * .gdbinit (pitx): Fix incorrect references to fields of the
14699 iterator stack.
14700
7b926f3f
CY
147012012-02-17 Chong Yidong <cyd@gnu.org>
14702
14703 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14704
11273115
PE
147052012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14706
14707 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14708 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14709
c3a70e2b
CY
147102012-02-15 Chong Yidong <cyd@gnu.org>
14711
14712 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14713 marked as special. Also, starting docstrings with * is obsolete.
14714
0ca43699
AS
147152012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14716
14717 * gnutls.c (emacs_gnutls_write): Fix last change.
14718
2e8f3c56
LI
147192012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14720
14721 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14722 send_process.
14723
af70074f
SM
147242012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14725
14726 * keymap.c (Fsingle_key_description): Handle char ranges.
14727
95986d52
CY
147282012-02-12 Chong Yidong <cyd@gnu.org>
14729
afd83bd1
CY
14730 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14731 as that creates a dangerous corner case.
14732
95986d52
CY
14733 * window.c (Fdelete_window_internal): Invalidate the mouse
14734 highlight (Bug#9904).
14735
bd7da63e
GM
147362012-02-12 Glenn Morris <rgm@gnu.org>
14737
14738 * xselect.c (Fx_own_selection_internal)
14739 (Fx_get_selection_internal, Fx_disown_selection_internal)
14740 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14741 * nsselect.m (Fx_own_selection_internal)
14742 (Fx_disown_selection_internal, Fx_selection_exists_p)
14743 (Fx_selection_owner_p, Fx_get_selection_internal):
14744 Sync docs and argument specs with the xselect.c versions.
14745
77abcbc2
LI
147462012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14747
14748 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14749
90b671e2
EZ
147502012-02-11 Eli Zaretskii <eliz@gnu.org>
14751
1c0ca0b7
EZ
14752 * w32select.c (Fx_selection_exists_p): Sync doc string and
14753 argument list with xselect.c. (Bug#10783)
14754
14755 * w16select.c (Fx_selection_exists_p): Sync doc string and
14756 argument list with xselect.c. (Bug#10783)
90b671e2 14757
49241268
GM
147582012-02-10 Glenn Morris <rgm@gnu.org>
14759
14760 * fns.c (Fsecure_hash): Doc fix.
14761
f998bbe7 147622012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
14763
14764 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14765
0992bd9c
CY
147662012-02-07 Chong Yidong <cyd@gnu.org>
14767
14768 * buffer.c (Fbuffer_local_variables)
14769 (buffer_lisp_local_variables): Handle unbound vars correctly;
14770 don't let Qunbound leak into Lisp.
14771
af008560
GM
147722012-02-07 Glenn Morris <rgm@gnu.org>
14773
dd605cc4
GM
14774 * image.c (Fimagemagick_types): Doc fix.
14775
af008560
GM
14776 * image.c (imagemagick-render-type): Change it from a lisp object
14777 to an integer. Move the doc here from the lisp manual.
14778 Treat all values not equal to 0 the same.
14779
1449fa1d
CY
147802012-02-06 Chong Yidong <cyd@gnu.org>
14781
14782 * doc.c (store_function_docstring): Avoid applying docstring of
14783 alias to base function (Bug#2603).
14784
3723ec07
AS
147852012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14786
14787 * .gdbinit (pp1, pv1): Remove redundant defines.
14788 (pr): Use pp.
14789
79c1cc1e
CY
147902012-02-04 Chong Yidong <cyd@gnu.org>
14791
14792 * nsterm.m: Declare a global (Bug#10694).
14793
d7f29f8e
EZ
147942012-02-04 Eli Zaretskii <eliz@gnu.org>
14795
cae07000
SM
14796 * w32.c (get_emacs_configuration_options):
14797 Include --enable-checking, if specified, in the return value.
d7f29f8e 14798
3b95a6f9
MR
147992012-02-04 Martin Rudalics <rudalics@gmx.at>
14800
14801 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14802 after rounding frame sizes. (Bug#9723)
14803
d6fa96a6
EZ
148042012-02-04 Eli Zaretskii <eliz@gnu.org>
14805
14806 * keyboard.c (adjust_point_for_property): Don't position point
14807 before BEGV. (Bug#10696)
14808
df0b2940
PE
148092012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14810
14811 Handle overflow when computing char display width (Bug#9496).
14812 * character.c (char_width): Return EMACS_INT, not int.
14813 (char_width, c_string_width): Check for overflow when
14814 computing the width; this is possible now that individual
14815 characters can have unbounded width. Problem introduced
14816 by merge from Emacs 23 on 2012-01-19.
14817
6bee44d6
MA
148182012-02-02 Michael Albinus <michael.albinus@gmx.de>
14819
14820 * dbusbind.c (Fdbus_register_method): Mention the return value
14821 :ignore in the docstring.
14822
44f92739
GM
148232012-02-02 Glenn Morris <rgm@gnu.org>
14824
1b9f60cc
GM
14825 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14826
44f92739
GM
14827 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14828 Unconditionally set to t. (Bug#10673)
14829 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14830 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14831 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14832
c5d3843c
KH
148332012-02-02 Kenichi Handa <handa@m17n.org>
14834
14835 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14836 0, do not call append_composite_glyph.
14837
159462d4 148382012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
14839
14840 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14841 NULL (Bug#6988).
14842 (x_produce_glyphs): If the component of a composition is a null
14843 string, set it->pixel_width to 1 to avoid zero-width glyph.
14844
78cef877
EZ
148452012-02-01 Eli Zaretskii <eliz@gnu.org>
14846
14847 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14848 first 2 arguments are identical. This makes inserting large
14849 output from a subprocess an order of magnitude faster on
14850 MS-Windows, where all sbrk'ed memory is always contiguous.
14851
97897668
GM
148522012-01-31 Glenn Morris <rgm@gnu.org>
14853
14854 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 14855 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
14856 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14857
31fd3586
GM
148582012-01-29 Glenn Morris <rgm@gnu.org>
14859
14860 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14861
0e24a8b2
CY
148622012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14863
14864 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14865
cc0adcb0
CY
148662012-01-28 Chong Yidong <cyd@gnu.org>
14867
14868 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14869
acc28cb9
CY
148702012-01-26 Chong Yidong <cyd@gnu.org>
14871
9c69cfb7
CY
14872 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14873
acc28cb9
CY
14874 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14875 repeat counts (Bug#10507).
14876
48da7392
GM
148772012-01-26 Glenn Morris <rgm@gnu.org>
14878
14879 * lread.c (syms_of_lread): Doc fix.
14880
14af5f7f
CY
148812012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14882
14883 * coding.c (encode_designation_at_bol): Change return value to
14884 EMACS_INT.
14885
0b21c100
CY
148862012-01-25 Chong Yidong <cyd@gnu.org>
14887
14888 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14889
3c2907f7
CY
148902012-01-21 Chong Yidong <cyd@gnu.org>
14891
14892 * floatfns.c (Fcopysign): Make the second argument non-optional,
14893 since nil is not allowed anyway.
14894
959ad23f
AS
148952012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14896
14897 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14898 (send_process): Likewise.
14899
34a02f46
MR
149002012-01-19 Martin Rudalics <rudalics@gmx.at>
14901
14902 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
14903 (Vwindow_persistent_parameters): Do not use Qstate.
14904 Rewrite doc-strings.
34a02f46 14905
1259009a 149062012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
14907
14908 * character.c (char_width): New function.
70d4fdf6
GM
14909 (Fchar_width, c_string_width, lisp_string_width):
14910 Use char_width (Bug#9496).
25ed9e61 14911
6a6ee00d
MR
149122012-01-16 Martin Rudalics <rudalics@gmx.at>
14913
14914 * window.c (Vwindow_persistent_parameters): New variable.
14915 (Fset_window_configuration, save_window_save): Handle persistent
14916 window parameters.
14917
c85efaf7
EZ
149182012-01-14 Eli Zaretskii <eliz@gnu.org>
14919
14920 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14921 thrashing the stack of the thread. (Bug#9087)
14922
5944709e
PE
149232012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14924
14925 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14926
e71f5d99
EZ
149272012-01-11 Eli Zaretskii <eliz@gnu.org>
14928
14929 * xdisp.c (rows_from_pos_range): Handle the case where the
14930 highlight ends on a newline. (Bug#10464)
14931 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14932 he end column for display of highlight that ends on a newline
14933 before a R2L line.
14934
ce316182
GM
149352012-01-11 Glenn Morris <rgm@gnu.org>
14936
14937 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14938 from load-path also when installation-directory is nil. (Bug#10208)
14939
5b43da69
GM
149402012-01-10 Glenn Morris <rgm@gnu.org>
14941
74cc8ff9
GM
14942 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14943
7d8d6e4e
GM
14944 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14945 Update template values to be closer to their typical values these days.
5b43da69 14946
a0db8d43
EZ
149472012-01-09 Eli Zaretskii <eliz@gnu.org>
14948
14949 * xdisp.c (rows_from_pos_range): Accept additional argument
14950 DISP_STRING, and accept any glyph in a row whose object is that
14951 string as eligible for mouse highlight. Fixes mouse highlight of
14952 display strings from overlays. (Bug#10464)
14953
9a0115ab 149542012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 14955
b9110d6a 14956 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
14957 * fileio.c (auto_saving_dir_umask): New static var.
14958 (Fmake_directory_internal): Use it.
14959 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14960 creating the directory. The old code temporarily assigns
14961 too-generous permissions to the directory.
14962 (do_auto_save_eh): Clear it.
b9110d6a 14963 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
14964 that the var is always cleared.
14965
6c1bd3f3
EZ
149662012-01-07 Eli Zaretskii <eliz@gnu.org>
14967
14968 * search.c (scan_buffer): Pass character positions to
14969 know_region_cache, not byte positions. (Bug#6540)
14970
069d2b50
L
149712012-01-07 LynX <_LynX@bk.ru> (tiny change)
14972
14973 * w32.c (sys_rename): Report EXDEV when rename of a directory
14974 fails because the target is on another logical disk. (Bug#10284)
14975
75bf0d33
DB
149762012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14977
14978 * xterm.c (x_embed_request_focus): New function.
14979
14980 * xterm.h: Add prototype.
14981
14982 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14983
1c6e5a32
GM
149842012-01-05 Glenn Morris <rgm@gnu.org>
14985
14986 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14987
651e947e
EZ
149882012-01-01 Eli Zaretskii <eliz@gnu.org>
14989
14990 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14991 Load gnutls_transport_set_lowat only if GnuTLS version is below
14992 2.11.1.
14993 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14994 GnuTLS versions below 2.11.1.
14995
3778cdd8
AL
149962011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14997
14998 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14999 to the doc string advising against its use for altering the way
15000 windows are scrolled.
15001
0e5317f7
KH
150022011-12-28 Kenichi Handa <handa@m17n.org>
15003
15004 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15005 coding-system ASCII compatible only when it does not produce BOM
15006 on encoding (Bug#10383).
15007
93d5ca1f
JD
150082011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15009
15010 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15011 can scroll.
15012 (create_and_show_popup_menu): Always use menu_position_func for
15013 Gtk3 (Bug#10361).
15014
ca22b785
AS
150152011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15016
15017 * callint.c (Fcall_interactively): Don't truncate prompt string.
15018
d048e1e6
EZ
150192011-12-23 Eli Zaretskii <eliz@gnu.org>
15020
15021 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15022 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 15023 resumed from there (after widening). (Bug#10360)
d048e1e6 15024
5ccaba1f
JD
150252011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15026
15027 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15028
204ee57f
JD
150292011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15030
b81d40f0
JB
15031 * nsterm.m (x_free_frame_resources):
15032 Release f->output_data.ns->miniimage.
204ee57f
JD
15033 (ns_index_color): Fix indentation. Do not retain
15034 color_table->colors[i].
15035
15036 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15037 before returning.
15038
15039 * nsfns.m (x_set_background_color): Assign return value from
15040 ns_index_color to face-background instead of NSColor*.
15041 (ns_implicitly_set_icon_type): Fix indentation.
15042 Change assignment in for loop to comparison.
15043
15044 * emacs.c (ns_pool): New variable.
15045 (main): Assign ns_pool.
15046 (Fkill_emacs): Call ns_release_autorelease_pool.
15047
15048 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15049 autorelease fdesc, release fdAttrs and tdict.
15050 (ns_get_covering_families): Release charset.
15051 (ns_findfonts): Release NSFontDescriptor created with new.
15052 (ns_uni_to_glyphs): Fix indentation.
15053 (setString): Release attrStr before assigning new value.
15054
c803b2b7
JD
150552011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15056
678f4426
JD
15057 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15058 and NS_IMPL_COCOA.
15059 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15060 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15061
cd394be1 150622011-12-18 David Reitter <reitter@cmu.edu>
678f4426 15063
5fecd5fc
JD
15064 * nsterm.m (ns_term_init): Subscribe for notifications
15065 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15066 to method trackingNotification in EmacsMenu.
15067
15068 * nsmenu.m (trackingMenu): New variable.
3771cb17 15069 (trackingNotification): New method (from Aquamacs).
5fecd5fc 15070 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 15071 from Aquamacs (Bug#7030).
678f4426
JD
15072
150732011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 15074
c803b2b7
JD
15075 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15076 (symbol_to_nsstring): Fix indentation.
15077 (ns_symbol_to_pb): New function.
cae07000
SM
15078 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15079 (Fns_rotate_cut_buffers_internal): Remove.
15080 (Fns_store_selection_internal): Rename from
c803b2b7
JD
15081 Fns_store_cut_buffer_internal.
15082 (ns_get_foreign_selection, Fx_own_selection_internal)
15083 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
15084 (Fns_get_selection_internal, Fns_store_selection_internal):
15085 Use ns_symbol_to_pb and check if return value is nil.
15086 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15087 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
15088 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15089 renamed to Sns_store_selection_internal.
15090 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15091 and remove this function.
15092 (ns_handle_selection_clear): Remove, never used.
15093 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15094 here.
15095
e1b01a3a
KB
150962011-12-17 Ken Brown <kbrown@cornell.edu>
15097
15098 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15099 GID is unknown (Bug#10257).
15100
2adb6e85
PE
151012011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15102
15103 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15104 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15105 which caused a build failure on GNU/Linux IA-64. This problem was
15106 introduced by my 2011-10-07 patch.
15107
d1d7b339
JL
151082011-12-15 Juri Linkov <juri@jurta.org>
15109
15110 * image.c (imagemagick_error): New function. (Bug#10112)
15111 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15112 Use `imagemagick_error' where ImageMagick functions return
15113 `MagickFalse'.
15114 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15115 proper order.
15116
100d5755
KH
151172011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15118
15119 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15120 fill background (Bug#8992).
15121
454592a6
MR
151222011-12-13 Martin Rudalics <rudalics@gmx.at>
15123
15124 * window.c (Vwindow_combination_resize)
15125 (Vwindow_combination_limit): Use t instead of non-nil in
15126 doc-strings.
61d4b438
MR
15127 (Vrecenter_redisplay): Add first sentence of doc-string on
15128 separate line.
53524d93 15129 (Frecenter): Fix doc-string typo.
454592a6 15130
3633e3aa
KH
151312011-12-11 Kenichi Handa <handa@m17n.org>
15132
15133 * coding.c (Funencodable_char_position): Pay attention to the
15134 buffer text relocation (Bug#9389).
15135
7b9d523a 151362011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 15137
7b9d523a
JD
15138 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15139 gtk_init (Bug#10100).
15140
b73189c6
EZ
151412011-12-10 Eli Zaretskii <eliz@gnu.org>
15142
15143 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15144 IT->string is nil. (Bug#10263)
15145
f7dfe5d6
JD
151462011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15147
83faebb4
JD
15148 * nsterm.h (x_free_frame_resources): Declare.
15149
f7dfe5d6
JD
15150 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15151 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15152
15153 * nsterm.h (ns_get_defaults_value): Declare.
15154
15155 * nsterm.m (ns_default): Call ns_get_defaults_value.
15156
7cd4e72c
EZ
151572011-12-09 Eli Zaretskii <eliz@gnu.org>
15158
15159 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15160 (Bug#10170)
15161
b34d7317
YM
151622011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15163
15164 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15165 that where the value of an _OBJC_* symbol points to is in the .bss
15166 section (Bug#10240).
15167
76470ad1
KH
151682011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15169
15170 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 15171 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 15172
745fff94
KH
151732011-12-08 Kenichi Handa <handa@m17n.org>
15174
15175 * ftfont.c (get_adstyle_property): Fix previous change
15176 (Bug#10233).
15177
6e44397c
JB
151782011-12-07 Juanma Barranquero <lekktu@gmail.com>
15179
15180 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15181 dirs from the default value of EMACSLOADPATH (bug#10208).
15182
7efa6272
GM
151832011-12-07 Glenn Morris <rgm@gnu.org>
15184
15185 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15186 installation and source directories as well. (Bug#10208)
15187
f6fc4d87
CY
151882011-12-06 Chong Yidong <cyd@gnu.org>
15189
15190 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15191
2bf26180
GM
151922011-12-06 Glenn Morris <rgm@gnu.org>
15193
15194 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15195 as an error, not just -1. (Bug#10217)
15196
3a6ad4f0
CY
151972011-12-05 Chong Yidong <cyd@gnu.org>
15198
15199 * keyboard.c (process_special_events): New function.
15200 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15201
75a3b399
PE
152022011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15203
15204 * coding.c (encode_designation_at_bol): Don't use uninitialized
15205 local variable (Bug#9318).
15206
c3c9e25e
KH
152072011-12-05 Kenichi Handa <handa@m17n.org>
15208
15209 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15210 return Qnil (Bug#8046, Bug#10193).
15211
5eb05ea3
KH
152122011-12-05 Kenichi Handa <handa@m17n.org>
15213
15214 * coding.c (encode_designation_at_bol): New args charbuf_end and
15215 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
15216 (coding_set_source): Return how many bytes coding->source was
15217 relocated.
15218 (coding_set_destination): Return how many bytes
15219 coding->destination was relocated.
15220 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 15221 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
15222
152232011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15224
15225 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15226 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15227 macro (Bug#9318).
15228
152292011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15230
15231 The following changes are to fix Bug#9318.
15232
a79703f5 15233 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
15234 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15235 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 15236 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 15237
7dbda6df
JB
152382011-12-05 Juanma Barranquero <lekktu@gmail.com>
15239
15240 * lisp.h (process_quit_flag): Fix external declaration.
15241
6d5eb5b0
SM
152422011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15243
15244 Don't macro-inline non-performance-critical code.
15245 * eval.c (process_quit_flag): New function.
15246 * lisp.h (QUIT): Use it.
15247
a0c3fad0
JD
152482011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15249
15250 * nsfns.m (get_geometry_from_preferences): New function.
15251 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15252
6c07aac2
AS
152532011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15254
15255 * emacs.c (Qkill_emacs): Define.
15256 (syms_of_emacs): Initialize it.
15257 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15258 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
15259 (quit_throw_to_read_char): Add parameter `from_signal'.
15260 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
15261 * lisp.h (QUIT): Call Fkill_emacs if requested.
15262
c052ead4
JD
152632011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15264
15265 * widget.c (update_wm_hints): Return if wmshell is null.
15266 (widget_update_wm_size_hints): New function.
15267
15268 * widget.h (widget_update_wm_size_hints): Declare.
15269
15270 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15271 widget_update_wm_size_hints (Bug#10104).
15272
9e49252b
EZ
152732011-12-03 Eli Zaretskii <eliz@gnu.org>
15274
15275 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15276 before a newline, prepare the bidi iterator for consuming the
15277 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 15278 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 15279
02b16839
JL
152802011-12-02 Juri Linkov <juri@jurta.org>
15281
15282 * search.c (Fword_search_regexp): New Lisp function created from
15283 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15284 (Fword_search_backward, Fword_search_forward)
15285 (Fword_search_backward_lax, Fword_search_forward_lax):
15286 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15287 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15288
0068070e
SM
152892011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15290
15291 * fileio.c (Finsert_file_contents): Move after-change-function call
15292 to before the "handled:" label, since all "goto handled" appear in
15293 cases where the *-change-functions have already been properly called
15294 (bug#10117).
15295
3360a3fc
AS
152962011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15297
15298 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15299 waiting for input. (Bug#10169)
15300
73d6c093
EZ
153012011-11-30 Eli Zaretskii <eliz@gnu.org>
15302
15303 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15304 verifies glyph row's hash code--we have just reallocated the
15305 glyphs, so their contents can be complete garbage. (Bug#10164)
15306
febe6bea
JB
153072011-11-30 Juanma Barranquero <lekktu@gmail.com>
15308
15309 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15310
801a4313
EZ
153112011-11-30 Eli Zaretskii <eliz@gnu.org>
15312
15313 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15314 attributes are tested _before_ calling verify_row_hash, to protect
15315 against GCC re-ordering of the tests. (Bug#10164)
15316
2b56b87e
JD
153172011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15318
15319 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15320
15321 * xterm.c (handle_one_xevent): Only set async_visible and friends
15322 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 15323 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
15324 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15325
dbf31225
PE
153262011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15327
15328 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15329 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15330 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15331 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15332 All uses changed to use GCPRO1 etc.
15333 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15334 Revert to old implementation (i.e., before 2011-03-11).
15335
1305621b
YM
153362011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15337
15338 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15339 of scroll runs so as to avoid assigning disabled bogus rows and
15340 unnecessary graphics copy operations.
15341
8c9afb46
EZ
153422011-11-27 Eli Zaretskii <eliz@gnu.org>
15343
15344 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15345 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15346 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15347 (malloc, free, realloc, calloc): Redirect to e_* only when
15348 compiling Emacs.
15349
15350 * lisp.h (GCTYPEBITS): Move before first use.
15351 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15352 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15353 this macro definition.
15354
15355 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15356 _MSC_VER.
15357
54e9e3bf
JD
153582011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15359
6d5eb5b0
SM
15360 * gtkutil.c (xg_create_frame_widgets):
15361 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
15362 present with Gtk+ 2.0.
15363
83aca1cb
PE
153642011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15365
15366 * fileio.c (Finsert_file_contents): Undo previous change; see
15367 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15368
5b76caa4
PE
153692011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15370
15371 Rename locals to avoid shadowing.
15372 * fileio.c (Finsert_file_contents):
15373 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15374 * process.c (wait_reading_process_output):
15375 Rename inner 'proc' to 'p' to avoid shadowing.
15376 Indent for consistency with usual Emacs style.
15377
8c535114
EZ
153782011-11-25 Eli Zaretskii <eliz@gnu.org>
15379
15380 * xdisp.c (redisplay_window): If cursor row is not fully visible
15381 after recentering, and scroll-conservatively is set to a large
15382 number, scroll window by a few more lines to make the cursor fully
15383 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
15384 (start_display): Don't move to the next line if the display should
15385 start at a newline that is part of a display vector or an overlay
15386 string. (Bug#10119)
8c535114 15387
fa4fdb5c
JL
153882011-11-24 Juri Linkov <juri@jurta.org>
15389
15390 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15391 after the `MagickPingImage' call. (Bug#10112)
15392
90ec88df
CY
153932011-11-23 Chong Yidong <cyd@gnu.org>
15394
15395 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15396
56e2e794
MR
153972011-11-23 Martin Rudalics <rudalics@gmx.at>
15398
15399 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15400 making another buffer current. (Bug#10114)
15401
b6e64c41
GM
154022011-11-23 Glenn Morris <rgm@gnu.org>
15403
15404 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15405
6b21de18
CY
154062011-11-23 Chong Yidong <cyd@gnu.org>
15407
15408 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15409 using it (Bug#5984).
15410
b12cd789
EZ
154112011-11-22 Eli Zaretskii <eliz@gnu.org>
15412
15413 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15414 and header-lines, as they don't have one computed for them.
15415 (Bug#10098)
15416
15417 * .gdbinit (prow): Make displayed values more self-explaining.
15418 Add row's hash code.
15419
261b6fd4
LMI
154202011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15421
15422 * process.c (wait_reading_process_output): Fix asynchrounous
15423 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 15424 (wait_reading_process_output): Add comment and URL.
261b6fd4 15425
e7cfd277
JD
154262011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15427
15428 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15429
a9b9b7f5
CY
154302011-11-21 Chong Yidong <cyd@gnu.org>
15431
15432 * window.c (Fnext_window, Fprevious_window): Doc fix.
15433
b0d15b4f
SM
154342011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15435
15436 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15437
fe7a3057
JB
154382011-11-20 Juanma Barranquero <lekktu@gmail.com>
15439
15440 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15441
d2999b1a
MR
154422011-11-20 Martin Rudalics <rudalics@gmx.at>
15443
15444 * window.c (Fset_window_combination_limit): Rename argument
15445 STATUS to LIMIT.
15446 (Vwindow_combination_limit): Remove "status" from doc-string.
15447
d5ff9cd0
AS
154482011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15449
15450 * m/ibms390.h: Remove.
15451 * m/ibms390x.h: Don't include "ibms390.h".
15452
a5bb9bd3
SM
154532011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15454
15455 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15456 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15457
cd1181db
JB
154582011-11-20 Juanma Barranquero <lekktu@gmail.com>
15459
15460 * casetab.c (Fset_case_table):
15461 * charset.c (Fcharset_after): Fix typos.
15462
615a3b8d 154632011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 15464
17e845af
PE
15465 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15466 Otherwise, valgrind does not work on some platforms.
15467 Problem reported by Andreas Schwab in
6a0bf43d
PE
15468 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15469 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15470 is set, removing the need for VIRT_ADDRESS_VARIES.
15471 (PURE_P): Use a more-efficient implementation that needs just one
15472 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15473 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15474 to 4 (xorl, subq, cmpq, setbe).
15475 * alloc.c (pure): Always extern now, since that's the
15476 VIRT_ADDR_VARIES behavior.
15477 (PURE_POINTER_P): Use a single comparison, not two, for
15478 consistency with the new puresize.h.
15479 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15480 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15481 Remove VIRT_ADDR_VARIES no longer needed.
15482
f8fe6f96
EZ
154832011-11-19 Eli Zaretskii <eliz@gnu.org>
15484
15485 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15486 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15487 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15488 behave as if the cursor position were at the window margin.
15489
15490 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15491 and the cursor position is out of bounds, behave as if the cursor
15492 position were at the window margin. (Bug#10075)
15493
df05a53c
CY
154942011-11-18 Chong Yidong <cyd@gnu.org>
15495
15496 * window.c (Fwindow_combination_limit): Make first argument
15497 non-optional, since it is meaningless for live windows like the
15498 selected window.
61ccba97 15499
2071918e
DA
155002011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15501
15502 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15503
b50a28de
SM
155042011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15505
15506 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15507 (graft_intervals_into_buffer): Simplify.
15508
015137db
EZ
155092011-11-18 Eli Zaretskii <eliz@gnu.org>
15510
15511 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15512 hash values of the two rows.
15513 (copy_row_except_pointers): Preserve the used[] arrays and the
15514 hash values of the two rows. (Bug#10035)
68c95424 15515 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
15516
15517 * xdisp.c (row_hash): New function, body extracted from
15518 compute_line_metrics.
15519 (compute_line_metrics): Call row_hash, instead of computing the
15520 hash code inline.
15521
15522 * dispnew.c (verify_row_hash): Call row_hash for computing the
15523 hash code of a row, instead of duplicating code from xdisp.c.
15524
15525 * dispextern.h (row_hash): Add prototype.
15526
a2addb04
TH
155272011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15528
15529 * frame.c (delete_frame): Don't delete the terminal when the last
15530 X frame is closed if emacs is built with GTK toolkit.
15531
df85d315
JB
155322011-11-17 Juanma Barranquero <lekktu@gmail.com>
15533
15534 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15535
a0c2d0ae
MR
155362011-11-17 Martin Rudalics <rudalics@gmx.at>
15537
15538 * window.c (Vwindow_splits): Rename to
15539 Vwindow_combination_resize. Suggested by Juri Linkov.
15540 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15541 of Vwindow_splits.
15542
58179cce
JB
155432011-11-16 Juanma Barranquero <lekktu@gmail.com>
15544
7877f373
JB
15545 * nsfns.m (Fns_font_name):
15546 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 15547
b6f67890
MR
155482011-11-16 Martin Rudalics <rudalics@gmx.at>
15549
15550 * window.h (window): Rename slot "nest" to "combination_limit".
15551 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15552 (Fset_window_nest): Rename to Fset_window_combination_limit.
15553 (Vwindow_nest): Rename to Vwindow_combination_limit.
15554 (recombine_windows, make_parent_window, make_window)
15555 (Fsplit_window_internal, saved_window)
15556 (Fset_window_configuration, save_window_save): Rename all
15557 occurrences of window_nest to window_combination_limit.
15558
c7015153
JB
155592011-11-15 Juanma Barranquero <lekktu@gmail.com>
15560
15561 * image.c (imagemagick_load_image): Fix typo.
15562
322ad6ec
EZ
155632011-11-14 Eli Zaretskii <eliz@gnu.org>
15564
15565 * xdisp.c (display_line): Move the call to
15566 highlight_trailing_whitespace before the call to
15567 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
15568 faces of all the glyphs to compute ROW's hash value.
15569 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 15570
f067b8ec
JB
155712011-11-14 Juanma Barranquero <lekktu@gmail.com>
15572
15573 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15574 just return (bug#10044).
15575
1e5b2111
EZ
155762011-11-12 Eli Zaretskii <eliz@gnu.org>
15577
7ef3cbd5
EZ
15578 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15579 with user-defined heap size. Bump the default size of the temacs
15580 heap to 27MB, to avoid memory warning when running temacs.
15581 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15582
1e5b2111
EZ
15583 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15584 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
15585 (verify_row_hash) [XASSERTS]: New function.
15586 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15587 that the hash value of glyph rows is correct.
1e5b2111 15588
89d61221
MR
155892011-11-12 Martin Rudalics <rudalics@gmx.at>
15590
15591 * window.h (window): Remove splits slot.
15592 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15593 (Fdelete_other_windows_internal, make_parent_window)
15594 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15595 (Fset_window_configuration, save_window_save): Don't deal with
15596 split status of windows.
15597 (saved_window): Remove splits slot.
15598 (Vwindow_splits): Rewrite doc-string.
15599
97f18cc8
JD
156002011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15601
15602 * xfns.c (unwind_create_frame):
15603 * nsfns.m (unwind_create_frame):
15604 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15605 Vframe_list (Bug#9999).
15606
22a648b4
DA
156072011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15608
0b381c7e 15609 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 15610
659afede
KH
156112011-11-11 Kenichi Handa <handa@m17n.org>
15612
15613 * callproc.c (Fcall_process): Set the member dst_multibyte of
15614 process_coding.
15615
9ac0394b
KH
156162011-11-11 Johan Bockgård <bojohan@gnu.org>
15617
15618 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15619 avoid a crash (bug#9496).
15620
2fbdc249
CY
156212011-11-09 Chong Yidong <cyd@gnu.org>
15622
15623 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15624 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15625
ac6b1f81
PE
156262011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15627
15628 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15629
09db192c
PE
156302011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15631
15632 Avoid some portability problems by eschewing 'extern inline' functions.
15633 The trivial performance wins aren't worth the portability hassles; see
15634 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15635 et seq.
15636 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15637 (window_box_width, window_box_left, window_box_left_offset)
15638 (window_box_right, window_box_right_offset): Undo previous change,
15639 by removing the "extern"s.
15640 * intervals.c (adjust_intervals_for_insertion)
15641 (adjust_intervals_for_deletion): Undo previous change,
15642 making these static again.
15643 (offset_intervals, temp_set_point_both, temp_set_point)
15644 (copy_intervals_to_string): No longer inline.
15645 * xdisp.c (window_text_bottom_y, window_box_width)
15646 (window_box_height, window_box_left_offset)
15647 (window_box_right_offset, window_box_left, window_box_right)
15648 (window_box): No longer inline.
15649
105216ed
CY
156502011-11-08 Chong Yidong <cyd@gnu.org>
15651
15652 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
15653 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15654 Signal an error if not a live window.
105216ed
CY
15655 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15656 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15657
ae9e237f
JB
156582011-11-07 Juanma Barranquero <lekktu@gmail.com>
15659
15660 * lisp.h (syms_of_abbrev): Remove declaration.
15661 Reported by CHENG Gao <chenggao@royau.me>.
15662
c7aa8333
EZ
156632011-11-07 Eli Zaretskii <eliz@gnu.org>
15664
15665 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15666 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15667 of temacs in GUI mode.
15668
be7f5545
MR
156692011-11-07 Martin Rudalics <rudalics@gmx.at>
15670
15671 * window.h: Declare delete_all_child_windows instead of
15672 delete_all_subwindows.
15673 * window.c (Fwindow_nest, Fset_window_nest)
15674 (Fset_window_new_total, Fset_window_new_normal)
15675 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15676 (delete_all_subwindows): Rename to delete_all_child_windows.
15677 (Fdelete_other_windows_internal, Fset_window_configuration):
15678 Call delete_all_child_windows instead of delete_all_subwindows.
15679 * frame.c (delete_frame): Call delete_all_child_windows instead
15680 of delete_all_subwindows.
15681
ca78dc43
PE
156822011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15683
15684 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15685 This is also needed for porting to any host where GC_MARK_STACK is
15686 not GC_MAKE_GCPROS_NOOPS.
15687 (which_symbols): Use it.
15688
a0241d01
KH
156892011-11-07 Kenichi Handa <handa@m17n.org>
15690
15691 * coding.c (coding_set_destination): Check coding->src_pos only
15692 when coding->src_object is a buffer (bug#9910).
15693
15694 * process.c (send_process): Set the member src_multibyte of coding
15695 to 0 (bug#9911) when sending a unibyte text.
15696
15697 * callproc.c (Fcall_process): Set the member src_multibyte of
15698 process_coding to 0 (bug#9912).
15699
a64bfdfa 157002011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
15701
15702 * xmenu.c (cleanup_widget_value_tree): New function.
15703 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15704 calling free_menubar_widget_value_tree directly (Bug#9830).
15705
cb41b32a
PE
157062011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15707
15708 Fix some portability problems with 'inline'.
15709 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15710 (window_box_width, window_box_left, window_box_left_offset)
15711 (window_box_right, window_box_right_offset): Declare extern.
15712 Otherwise, these inline functions do not conform to C99 and
15713 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15714 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15715 * intervals.c (adjust_intervals_for_insertion)
15716 (adjust_intervals_for_deletion): Now extern, because otherwise the
15717 extern inline functions 'offset_intervals' couldn't refer to it.
15718 (static_offset_intervals): Remove.
15719 (offset_intervals): Rewrite using the old contents of
15720 static_offset_intervals. The old version didn't conform to C99
15721 because an extern inline function contained a reference to an
15722 identifier with static linkage.
15723
b7041366
AS
157242011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15725
15726 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15727 GC.
15728
88a37c4d
EZ
157292011-11-06 Eli Zaretskii <eliz@gnu.org>
15730
15731 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15732 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15733 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15734 return Qleft_to_right.
15735
49745b39
CY
157362011-11-06 Chong Yidong <cyd@gnu.org>
15737
15738 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15739 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15740 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15741 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15742 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15743 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15744 (Fwindow_vscroll): Doc fix.
15745 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15746 argument, since it makes no sense to pass a live window and for
15747 consistency with window-child.
15748
1f05cd82
CS
157492011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15750
15751 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15752 support MSVC.
15753
22610910
JR
157542011-11-05 Jason Rumney <jasonr@gnu.org>
15755
15756 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15757 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15758 fonts (Bug#6029).
15759 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15760 bitwise arithmetic preventing use of unicode-sip and non-truetype
15761 opentype fonts.
15762
a06776b2
EZ
157632011-11-05 Eli Zaretskii <eliz@gnu.org>
15764
3ad924ba
EZ
15765 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15766 "emacs"-only part.
15767
a06776b2
EZ
15768 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15769 initialization code to keep similarity to xfns.c after changes
15770 from 2011-11-05.
15771
c9e7db78
JD
157722011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15773
a97f8f3f
JD
15774 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15775 (unwind_create_frame): New function (Bug#9943).
15776 (Fx_create_frame): Restructure code to be more similar to the one in
15777 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15778 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15779 Move terminal->reference_count++ just before making the frame official
15780 (Bug#9943).
15781
15782 * nsterm.m (x_free_frame_resources): New function.
15783 (x_destroy_window): Move code to x_free_frame_resources.
15784
c9e7db78 15785 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
15786 (Fx_create_frame, x_create_tip_frame):
15787 Move terminal->reference_count++ just before making the frame
75f1671a 15788 official. Move initialization of image_cache_refcount and
c9e7db78
JD
15789 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15790
a6fc3b5c
EZ
157912011-11-05 Eli Zaretskii <eliz@gnu.org>
15792
15793 Support MSVC build with newer versions of Visual Studio.
15794 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15795 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15796 nt/gmake.defs.
15797
15798 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15799 which are not supported by MSVC.
15800 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15801 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15802 bitfields.
15803 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15804 types in bitfields.
15805 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15806
15807 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15808
58179cce 158092011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
15810
15811 Support MSVC build with newer versions of Visual Studio.
15812 * w32.c: Don't include w32api.h for MSVC.
15813 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15814
15815 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15816 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15817 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15818 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15819 e_* cousins.
15820 (alloca) [_MSC_VER]: Define to _alloca.
15821
15822 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15823
15824 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15825
a58c13ed
EZ
158262011-11-04 Eli Zaretskii <eliz@gnu.org>
15827
15828 * xdisp.c (note_mouse_highlight): If either of
15829 previous/next-single-property-change returns nil, treat that as
15830 the beginning or the end of the buffer. (Bug#9955)
15831
fe0b6370
JD
158322011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15833
a58c13ed 15834 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
15835 label is not null (Bug#9951).
15836 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15837 may be NULL.
15838
89bd5ee1
EZ
158392011-11-04 Eli Zaretskii <eliz@gnu.org>
15840
15841 * window.c (Fwindow_body_size): Mention in the doc string that the
15842 return value is in frame's canonical units. (Bug#9949)
15843
84c3edb9
EZ
158442011-11-03 Eli Zaretskii <eliz@gnu.org>
15845
4e2fb5c7
EZ
15846 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15847
84c3edb9 15848 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 15849 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 15850 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 15851
bc17a887
EZ
158522011-11-01 Eli Zaretskii <eliz@gnu.org>
15853
15854 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15855 Don't stop backward scan on the continuation glyph, even though
15856 its CHARPOS is positive.
6d5eb5b0
SM
15857 (mouse_face_from_buffer_pos, note_mouse_highlight):
15858 Rename cover_string to disp_string.
bc17a887 15859
4ee88440
MR
158602011-11-01 Martin Rudalics <rudalics@gmx.at>
15861
15862 * window.c (temp_output_buffer_show): Don't use
15863 Vtemp_buffer_show_specifiers.
15864 (Vtemp_buffer_show_specifiers): Remove unused variable.
15865
c2ff3c02
EZ
158662011-10-30 Eli Zaretskii <eliz@gnu.org>
15867
15868 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15869 past the beginning of the current glyph matrix.
15870
58179cce 158712011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
15872
15873 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15874 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15875 HAVE_GTK3 (Bug#9869).
b77a6a7f 15876
3b574623
JD
15877 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15878 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15879
b77a6a7f
JD
15880 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15881
15882 * xterm.c: Declare x_handle_net_wm_state to return int.
15883 (handle_one_xevent): Check if we are iconified but don't have
15884 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15885 (get_current_wm_state): Return non-zero if not hidden,
15886 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15887 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15888 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15889 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15890
196e41e4
PE
158912011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15892
15893 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15894 so that this new function doesn't get optimized away by a
15895 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15896
021f2e1a
AS
158972011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15898
15899 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15900
8b058d44
EZ
159012011-10-29 Eli Zaretskii <eliz@gnu.org>
15902
15903 Fix the `xbytecode' command.
15904 * .gdbinit (xprintbytestr): New command.
b50a28de 15905 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
15906 (xbytecode): Print the byte-code string as well.
15907
4452fb80
EZ
159082011-10-29 Kim Storm <storm@cua.dk>
15909
8b058d44
EZ
15910 * alloc.c (which_symbols): New function.
15911
21b72067
AS
159122011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15913
15914 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15915 line. (Bug#9903)
15916
83ed7b5c
GM
159172011-10-29 Glenn Morris <rgm@gnu.org>
15918
15919 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15920 Not clear what it was for, and it causes various bugs. (Bug#9839)
15921
5a7a728b
EZ
159222011-10-28 Eli Zaretskii <eliz@gnu.org>
15923
15924 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15925 possible random value that matches one of those tested as
15926 condition to clear the mouse face.
15927
d3d0842f
CY
159282011-10-28 Chong Yidong <cyd@gnu.org>
15929
15930 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15931
31b39d13
DN
159322011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15933
15934 * window.c (make_window): Initialize phys_cursor_on_p.
15935
9aba6043
SM
159362011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15937
15938 * lisp.h (struct Lisp_Symbol): Update comments.
15939
c20992f4
JB
159402011-10-28 Juanma Barranquero <lekktu@gmail.com>
15941
15942 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15943
db4f02f2
EZ
159442011-10-28 Eli Zaretskii <eliz@gnu.org>
15945
15946 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15947 <oslsachem@gmail.com> for helping to debug this.
15948
15949 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15950 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15951 (g_b_init_get_glyph_outline_w): New static variables.
15952 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15953 (GetGlyphOutlineW_Proc): New typedefs.
15954 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
15955 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15956 New functions.
15957 (w32font_open_internal, compute_metrics):
15958 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
15959 instead of calling the "wide" APIs directly.
15960
15961 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15962
15963 * w32.h (syms_of_w32font): Add prototype.
15964
87e68db4
JB
159652011-10-27 Juanma Barranquero <lekktu@gmail.com>
15966
15967 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15968 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15969 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15970 (Fmove_to_window_line): Doc fix.
15971
435c1d67
CY
159722011-10-27 Chong Yidong <cyd@gnu.org>
15973
15974 * process.c (make_process): Set gnutls_state to NULL.
15975
15976 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15977 non-NULL, regardless of GNUTLS_INITSTAGE.
15978 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15979 an error. Set process slots as soon as we allocate them.
15980
15981 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15982
9c6c6f49
CY
159832011-10-27 Chong Yidong <cyd@gnu.org>
15984
9aba6043
SM
15985 * gnutls.c (emacs_gnutls_deinit): New function.
15986 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
15987 (Fgnutls_deinit, Fgnutls_boot): Use it.
15988
15989 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15990 (deactivate_process): Call emacs_gnutls_deinit.
15991
657d08d3
JB
159922011-10-27 Juanma Barranquero <lekktu@gmail.com>
15993
15994 * image.c (x_create_x_image_and_pixmap):
15995 * w32.c (sys_rename, w32_delayed_load):
15996 * w32font.c (fill_in_logfont):
15997 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15998
5430d399
JB
159992011-10-26 Juanma Barranquero <lekktu@gmail.com>
16000
16001 * w32fns.c (w32_default_color_map): New function,
16002 extracted from Fw32_default_color_map.
a7ef684b 16003 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 16004
fe0055fa
PE
160052011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16006
16007 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16008
e6346438
SM
160092011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16010
16011 * keyboard.c (test_undefined): New function (bug#9751).
16012 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16013
e112cc37
ET
160142011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16015
16016 * sysdep.c (init_sys_modes): Fix the check for the controlling
16017 terminal (Bug#6649).
16018
7b5d6677
EZ
160192011-10-20 Eli Zaretskii <eliz@gnu.org>
16020
16021 * dispextern.h (struct bidi_it): New member next_en_type.
16022
16023 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16024 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16025 current character, check also for next_en_type being WEAK_EN.
16026 (bidi_resolve_weak): Don't enter the expensive loop if the current
16027 position is before next_en_pos. Record the bidi type of the first
16028 non-ET, non-BN character we find, in addition to its position.
16029 (bidi_level_of_next_char): Invalidate next_en_type when
16030 next_en_pos is over-stepped.
16031
7da0b018
PE
160322011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16033
16034 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16035 * editfns.c: Rewrite current-time-zone so that it invokes
16036 the equivalent of (format-time-string "%Z") to get the time zone name.
16037 This fixes a bug when the time zone name contains characters that
16038 need converting from the system time locale to Emacs internal format.
16039 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16040 that patch fixed format-time-string to do the conversion, but
16041 I forgot to fix current-time-zone.
16042 (format_time_string): New function, containing most of
16043 what Fformat_time_string used to contain.
16044 (Fformat_time_string): Rewrite in terms of format_time_string.
16045 This doesn't change this function's behavior.
16046 (current-time-zone): Rewrite to use format_time_string.
16047 This fixes the bug reported by Michael Schierl in
16048 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16049 Jason Rumney's 2007-06-07 change worked around this bug, but
16050 didn't fix it.
16051 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16052
8547b010
EZ
160532011-10-19 Eli Zaretskii <eliz@gnu.org>
16054
16055 * xdisp.c (start_display): If the character at POS is displayed
16056 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
16057 (try_window_reusing_current_matrix): If a line ends in a display
16058 vector or the next line starts in a display vector, continue
16059 redrawing the window even though the character position of
16060 start_row was reached.
8547b010
EZ
16061 (Bug#9771, part 2)
16062
4e948d15
CY
160632011-10-18 Chong Yidong <cyd@gnu.org>
16064
16065 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16066 with nobreak-char-display too.
16067
4787455f
EZ
160682011-10-18 Eli Zaretskii <eliz@gnu.org>
16069
16070 Fix part 3 of bug#9771.
16071 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16072 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16073 non-neutral characters if the current character is a paragraph
16074 separator (a.k.a. Newline). This avoids running the same
16075 expensive loop twice, once when we consume the preceding newline
16076 and the other time when the line actually needs to be displayed.
16077 Avoid the loop when we see neutrals on the base embedding level
16078 following a character whose directionality is the same as the
16079 paragraph's. This avoids running the expensive loop when a line
16080 ends in a long sequence of neutrals, like control characters.
16081 Add assertion against STRONG_AL type. Slightly rearrange code
16082 that determines the type of a neutral given the first non-neutral
16083 that follows it.
16084 (bidi_level_of_next_char): Set next_en_pos to zero when
16085 invalidating its info.
16086
2c91f553
EZ
160872011-10-17 Eli Zaretskii <eliz@gnu.org>
16088
16089 * xdisp.c (push_display_prop): Determine whether to record string
16090 or buffer position by IT->string, not by IT->method. Allow
16091 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
16092 (move_it_vertically_backward): Don't look for character position
16093 immediately after the newline when in a continuation line.
16094 (Bug#9771, part 1)
2c91f553 16095
c7b08b0d
MR
160962011-10-15 Martin Rudalics <rudalics@gmx.at>
16097
16098 * window.c (coordinates_in_window): Rewrite and delabelize
16099 vertical border check. (Bug#5357) (Bug#9618)
16100
6b02f655
SM
161012011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16102
16103 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16104 errors in XSetWindowBorder (bug#9310).
16105
81d40c92
DA
161062011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16107
16108 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16109 avoid crash when xmalloc overrun checking is enabled.
16110
d4172c3b
EZ
161112011-10-13 Eli Zaretskii <eliz@gnu.org>
16112
16113 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16114 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16115 cursor motion with <left> and <right> arrow keys.
16116
16117 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16118 some callers set that themselves.
16119
b00eea75
EZ
161202011-10-12 Eli Zaretskii <eliz@gnu.org>
16121
16122 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16123 display string and the previous row comes from the same string and
16124 is empty. (Bug#9739) (Bug#9738)
16125
8fe012c4
SM
161262011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16127
16128 * doc.c (get_doc_string): Encode file name (bug#9735).
16129
0074aef2
EZ
161302011-10-12 Eli Zaretskii <eliz@gnu.org>
16131
79beb178
EZ
16132 * bidi.c (bidi_level_of_next_char):
16133 * xdisp.c (get_visually_first_element): Remove old incorrect
16134 comments regarding the Unicode Line Separator character.
16135
0074aef2
EZ
16136 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16137
6e4b3fbe
DA
161382011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16139
16140 * alloc.c (Fgc_status): Do not access beyond zombies array
16141 boundary if nzombies > MAX_ZOMBIES.
16142 * alloc.c (dump_zombies): Add missing format specifier.
16143
0324f3af
PE
161442011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16145
b5525cac
PE
16146 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16147 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16148
0324f3af
PE
16149 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16150 Some packages use them to denote characters with modifiers.
16151
e9b5f888
AS
161522011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16153
16154 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16155 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16156 matching a pp-number. Rename parameter var to var1.
16157
127827c0
SM
161582011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16159
16160 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16161
c8fd3bd0
GM
161622011-10-08 Glenn Morris <rgm@gnu.org>
16163
16164 * callint.c (Fcall_interactively): Give a more explicit error for the
16165 'c' case with a non-character input. (Bug#8479)
16166
352ec8ff
EZ
161672011-10-08 Eli Zaretskii <eliz@gnu.org>
16168
03669ccb
EZ
16169 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16170 lines.
7061c986
EZ
16171 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16172 lines that are hscrolled on the left.
03669ccb 16173
352ec8ff
EZ
16174 * dispnew.c (buffer_posn_from_coords): Account for a possible
16175 presence of header-line. (Bug#4426)
16176
a66cfb1c
SM
161772011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16178
6b02f655
SM
16179 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16180 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 16181
7c5ee88e
PE
161822011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16183
16184 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16185 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16186 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16187 this makes Emacs dump core during garbage collection on rare
16188 occasions. sizeof is obviously inferior to offsetof here, so
16189 stick with offsetof.
16190 (GC_POINTER_ALIGNMENT): New macro.
16191 (mark_memory): Omit 3rd (offset) arg; caller changed.
16192 Don't assume EMACS_INT alignment is the same as pointer alignment.
16193
df1bbe5b
SM
161942011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16195
16196 * keyboard.c (read_key_sequence_remapped): New var.
16197 (read_key_sequence): Compute remapping in the right buffer.
16198 (command_loop_1): Use read_key_sequence's remapping directly.
16199
51553db6
SM
162002011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16201
32c1fffd
SM
16202 * dired.c (file_name_completion): Don't expand file name.
16203 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16204 before checking file name handler.
16205
51553db6
SM
16206 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16207 they've been requested explicitly (bug#9591).
16208
b6bd1599 162092011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
16210
16211 * keymap.c (Fsingle_key_description): Use make_specified_string
16212 instead of build_string to build string from push_key_description.
16213 (Bug#5193)
16214
f701dc2a
PE
162152011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16216
4222c55d
PE
16217 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16218 This fixes a Y2038 bug on 64-bit hosts.
16219 * buffer.c (reset_buffer):
16220 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16221 (Fclear_buffer_auto_save_failure):
16222 Use 0, not -1, to represent an unset failure time, since time_t
16223 might not be signed.
16224
f701dc2a
PE
16225 Remove dependency on glibc malloc internals.
16226 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16227 Move back here from lisp.h, but with their new implementations.
16228 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16229 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16230 * charset.c (charset_table_init): New static var.
16231 (syms_of_charset): Use it instead of xmalloc. This removes a
16232 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16233 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16234 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16235 Move back to alloc.c.
16236 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16237 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16238
9ceebf39
JD
162392011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16240
16241 * nsterm.m (windowDidResize): Call x_set_window_size only when
16242 ns_in_resize is true. Otherwise set pixelwidth/height and
16243 call change_frame_size (Bug#9628).
16244
cb993c58
PE
162452011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16246
3930c88b
PE
16247 Port --enable-checking=all to Fedora 14 x86-64.
16248 * charset.c (syms_of_charset): Also account for glibc malloc's
16249 internal overhead when calculating the initial malloc maximum.
16250
cb993c58
PE
16251 Port --enable-checking=all to Fedora 14 x86.
16252 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16253 Move to lisp.h.
16254 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16255 (overrun_check_realloc, overrun_check_free):
16256 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16257 That way, xmalloc returns a properly-aligned pointer even if
16258 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16259 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16260 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16261 into account when calculating the initial malloc maximum.
16262 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16263 Move here from alloc.c, so that charset.c can use it too.
16264 Properly align; the old code wasn't right for common 32-bit hosts
16265 when configured with --enable-checking=all.
16266 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16267 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16268
31bed486
EZ
162692011-09-29 Eli Zaretskii <eliz@gnu.org>
16270
04c70788 16271 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
16272 use EDOM.
16273
fbcaa2f3
EZ
162742011-09-28 Eli Zaretskii <eliz@gnu.org>
16275
16276 * xdisp.c (compute_display_string_end): If there's no display
16277 string at CHARPOS, return -1.
16278
16279 * bidi.c (bidi_fetch_char): When compute_display_string_end
16280 returns a negative value, treat the character as a normal
16281 character not covered by a display string. (Bug#9624)
16282
a239d4e9
JB
162832011-09-28 Juanma Barranquero <lekktu@gmail.com>
16284
16285 * lread.c (Fread_from_string): Fix typo in docstring.
16286
88652fd5
EZ
162872011-09-27 Eli Zaretskii <eliz@gnu.org>
16288
16289 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16290 newline, reseat the iterator instead of bidi-iterating there one
16291 character at a time. (Bug#9610)
32c1fffd
SM
16292 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16293 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 16294
ed497dd4
AS
162952011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16296
16297 * lread.c (readevalloop): Use correct code for NBSP.
16298 (read1): Likewise. (Bug#9608)
16299
b2bf61aa
MA
163002011-09-25 Michael Albinus <michael.albinus@gmx.de>
16301
16302 * dbusbind.c (Fdbus_register_signal): When service is not
16303 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16304
32bbb17c
GM
163052011-09-25 Glenn Morris <rgm@gnu.org>
16306
16307 * buffer.c (truncate-lines): Doc fix.
16308
94e0933e
CY
163092011-09-24 Chong Yidong <cyd@stupidchicken.com>
16310
16311 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16312 (Fset_window_next_buffers): Doc fix.
16313
cddde921
GM
163142011-09-24 Glenn Morris <rgm@gnu.org>
16315
16316 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16317
1260aef1
PE
163182011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16319
25b4bfa0
PE
16320 Fix minor problems found by static checking.
16321 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
16322 * indent.c (Fvertical_motion): Fix == vs = typo.
16323
e3cbd34b
EZ
163242011-09-24 Eli Zaretskii <eliz@gnu.org>
16325
a66cfb1c
SM
16326 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16327 Default value is now t. Doc fix.
6bf7006f 16328
e3cbd34b 16329 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 16330 logic when moving up, not only when moving down. Fix the
e3cbd34b 16331 confusing name and values of the it_overshoot_expected variable;
32c1fffd 16332 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
16333
16334 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16335 CHARPOS is covered by a display string which includes newlines.
16336 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16337 is covered by a display string with embedded newlines.
16338
a3de0cbd
MA
163392011-09-24 Michael Albinus <michael.albinus@gmx.de>
16340
16341 * dbusbind.c (Fdbus_register_signal): Add match rule to
16342 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
16343 (Fdbus_register_method, Vdbus_registered_objects_table):
16344 Fix docstring.
a3de0cbd 16345
b260039d
JM
163462011-09-24 Jim Meyering <meyering@redhat.com>
16347
32c1fffd 16348 do not ignore write error for any output size
b260039d
JM
16349 The previous change was incomplete.
16350 While it makes emacs --batch detect the vast majority of stdout
16351 write failures, errors were still ignored whenever the output size is
16352 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16353 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16354 && echo FAIL: ignored write error
16355 FAIL: ignored write error
16356 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16357 && echo FAIL: ignored write error
16358 FAIL: ignored write error
16359 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16360
8eca8a7c
AS
163612011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16362
16363 * emacs.c (Fkill_emacs): In noninteractive mode exit
16364 non-successfully if a write error occurred on stdout. (Bug#9574)
16365
3341db62
EZ
163662011-09-21 Eli Zaretskii <eliz@gnu.org>
16367
16368 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16369 the xassert test.
16370
16371 * dispextern.h (struct it): Update the comment documenting what
16372 can it->OBJECT be.
16373
8c203dbf
EZ
163742011-09-20 Eli Zaretskii <eliz@gnu.org>
16375
16376 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16377 a display string, extend search for cursor position to end of row.
16378 (find_row_edges): If the row ends in a newline from a display
16379 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16380 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
16381 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16382 non-empty line. Fixes confusing cursor motion with arrow keys at
16383 the beginning of a line that starts with whitespace.
8c203dbf 16384
a4824228
LMI
163852011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16386
16387 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16388 (bug#9493).
16389
33ed493b
CY
163902011-09-18 Chong Yidong <cyd@stupidchicken.com>
16391
16392 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16393 boolean (Bug#9154).
16394
56cd55c8
EZ
163952011-09-18 Eli Zaretskii <eliz@gnu.org>
16396
16397 * xdisp.c (display_line): Record maximum and minimum buffer
16398 positions even if no glyphs were produced (e.g., by a zero-width
16399 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16400 buffer positions that will be removed from the glyph row because
16401 they don't fit.
c02dcedf
EZ
16402 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16403 column is beyond frame width: don't subtract 1 "pixel" when
16404 computing width of the stretch.
3e62b7e0
EZ
16405 (reseat_at_next_visible_line_start): Undo the change made on
16406 2011-09-17 that saved paragraph information and restored it after
16407 the call to `reseat'. (Bug#9545)
56cd55c8 16408
5ed99d36 164092011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
16410
16411 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16412 and turn window cursor on if cleared (Bug#9415).
16413
5ed99d36 164142011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
16415
16416 * search.c (boyer_moore): Take unibyte characters from pattern
16417 literally. (Bug#9458)
16418
9bade7b2
EZ
164192011-09-18 Eli Zaretskii <eliz@gnu.org>
16420
16421 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16422
e5e9d610
PE
164232011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16424
87e4427a
PE
16425 Fix minor problem found by static checking.
16426 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16427 initialized, to pacify gcc -Wuninitialized.
16428
e5e9d610
PE
16429 * fileio.c: Report proper errno when syscall falls.
16430 (Finsert_file_contents): Save and restore errno,
16431 so that report_file_error outputs the correct diagnostic.
16432 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16433
a1674f0b
EZ
164342011-09-18 Eli Zaretskii <eliz@gnu.org>
16435
16436 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16437
fbfb6dd4
EZ
164382011-09-17 Eli Zaretskii <eliz@gnu.org>
16439
16440 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16441 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16442
bb187662
EZ
164432011-09-17 Eli Zaretskii <eliz@gnu.org>
16444
1137e8b8 16445 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 16446 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
16447
16448 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16449 (bidi_find_paragraph_start): Search back for paragraph beginning
16450 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16451 (bidi_move_to_visually_next): Only trigger paragraph-related
16452 computations when the last character is a newline or at EOB, not
16453 just any NEUTRAL_B. (Bug#9470)
16454
bb187662
EZ
16455 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16456 truncated lines if point is covered by a display string. (Bug#9524)
16457
2e621251
PE
164582011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16459
16460 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16461 (cons_to_x_long): New function.
16462 (lisp_data_to_selection_data): Use it. Correct the test for
16463 short-versus-long data; it was negated. Break out of vector
16464 loop, for efficiency, when a long datum is discovered.
16465
91a15bc6
SM
164662011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16467
16468 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16469
b41c3a35
EZ
164702011-09-16 Eli Zaretskii <eliz@gnu.org>
16471
16472 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16473 GCC PR/17406) by declaring this function with external scope.
16474
7812ba2d
PE
164752011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16476
16477 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16478 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16479
cf7edc2a
AS
164802011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16481
16482 * editfns.c (Fformat): Correctly handle text properties on "%%".
16483
bd01620e
EZ
164842011-09-15 Eli Zaretskii <eliz@gnu.org>
16485
16486 * xterm.c (x_draw_composite_glyph_string_foreground):
16487 * w32term.c (x_draw_composite_glyph_string_foreground):
16488 * term.c (encode_terminal_code):
16489 * composite.c (composition_update_it, get_composition_id):
16490 * xdisp.c (get_next_display_element)
16491 (fill_composite_glyph_string): Add comments about special meaning
16492 of TAB characters in a composition.
16493
a02719a3
PE
164942011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16495
16496 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
16497 This occurs when processing a multibyte format.
16498 Problem reported by Wolfgang Jenker.
a02719a3 16499
72589a3c
JB
165002011-09-15 Johan Bockgård <bojohan@gnu.org>
16501
16502 * xdisp.c (try_cursor_movement): Only check for exact match if
16503 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16504
1c14176c
PE
165052011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16506
16507 Remove unused external symbols.
16508 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16509 * xdisp.c (calc_pixel_width_or_height): Now static.
16510 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16511 * indent.c (check_display_width):
16512 * w32term.c: Fix comment to match code.
16513 * xterm.c, xterm.h (x_catching_errors): Remove.
16514
d2eea5b5
PE
165152011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16516
16517 * xselect.c: Use signed conversions more consistently (Bug#9498).
16518 (selection_data_to_lisp_data): Assume incoming selection data are
16519 signed integers, not unsigned. This is to be consistent with
16520 outgoing selection data, which was modified to use signed integers
16521 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16522 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16523 expects long, not unsigned long.
16524
46888499
EZ
165252011-09-14 Eli Zaretskii <eliz@gnu.org>
16526
16527 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16528 computation of loop end. Reported by Johan Bockgård
16529 <bojohan@gnu.org>.
16530
ef8ef9fb
CY
165312011-09-13 Chong Yidong <cyd@stupidchicken.com>
16532
16533 * frame.c (Fother_visible_frames_p): Function deleted.
16534
fa819fed
EZ
165352011-09-12 Eli Zaretskii <eliz@gnu.org>
16536
16537 * indent.c (compute_motion): Process display vector front to back
16538 rather than the other way around. (Bug#2496)
16539
2ba8e008
SM
165402011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16541
16542 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16543
20f53c69
CY
165442011-09-11 Chong Yidong <cyd@stupidchicken.com>
16545
16546 * minibuf.c (Fread_from_minibuffer): Doc fix.
16547
d562d7a4
EZ
165482011-09-11 Eli Zaretskii <eliz@gnu.org>
16549
16550 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16551 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16552
1c4d7f3d
LMI
165532011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16554
16555 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16556 value for non-existent files.
16557
b885bf36
EZ
165582011-09-11 Eli Zaretskii <eliz@gnu.org>
16559
16560 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16561 set its "size" to -1. This will set the modtime_size field of
16562 the corresponding buffer to -1, which is what
16563 verify-visited-file-modtime expects for files that do not exist.
16564 (Bug#9139)
16565
6612f0bf
PE
165662011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16567
16568 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16569 here ...
16570 * lisp.h: ... from here. push_key_description is no longer
16571 defined in keyboard.c, so its declaration should not be in
16572 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16573 logically belongs with push_key_description.
16574
dfb3f755
PE
165752011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16576
16577 * buffer.h: Include <sys/types.h> instead of <time.h>.
16578 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16579 Problem reported by Herbert J. Skuhra.
16580
3134906c
LMI
165812011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16582
16583 * xml.c (parse_region): Make the parsing work for
16584 non-comment-starting XML files again (bug#9144).
16585
8d903f4e
AS
165862011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16587
16588 * image.c (gif_load): Fix calculation of bottom and right corner.
16589 (Bug#9468)
16590
80ad64f4
EZ
165912011-09-10 Eli Zaretskii <eliz@gnu.org>
16592
16593 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16594 redisplay in small windows.
16595
208a048d
EZ
165962011-09-09 Eli Zaretskii <eliz@gnu.org>
16597
16598 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16599
9b1c252e
MR
166002011-09-08 Martin Rudalics <rudalics@gmx.at>
16601
16602 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16603 Operate on live windows only.
16604
2949f33b
JB
166052011-09-08 Juanma Barranquero <lekktu@gmail.com>
16606
16607 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16608
e08dcafd
EZ
166092011-09-07 Eli Zaretskii <eliz@gnu.org>
16610
16611 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16612 only under bidi iteration.
16613
115b96bd
JD
166142011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16615
16616 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16617
c8199d0f
PE
166182011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16619
16620 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16621 Without this fix, the command to link temacs failed due to an
16622 undefined symbol __builtin_isnan. This is because
16623 /usr/include/iso/math_c99.h #defines isnan(x) to
16624 __builtin_isnan(x), but the bundled gcc, which identifies itself
16625 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16626 a __builtin_isnan.
16627 * floatfns.c (isnan): #undef, and then #define to a clone of
16628 what's in data.c.
16629 (Fisnan): Always define, since it's always available now.
16630 (syms_of_floatfns): Always define isnan at the Lisp level.
16631
e39b275c 166322011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
16633
16634 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16635
b2db44d9 166362011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 16637
f4af5137 16638 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
16639 The previous code assumed that file offsets (off_t values) fit in
16640 EMACS_INT variables, which is not true on typical 32-bit hosts.
16641 The code messed up by falsely reporting buffer overflow in cases
16642 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16643 when "big" contains more than 2**29 bytes, even though this
16644 inserts just one byte and does not overflow the buffer.
16645 (Finsert_file_contents): Store file offsets as off_t
16646 values, not as EMACS_INT values. Check for overflow when
16647 converting between EMACS_INT and off_t. When checking for
16648 buffer overflow or for overlap, take the offsets into account.
16649 Don't use EMACS_INT for small values where int suffices.
16650 When checking for overlap, fix a typo: ZV was used where
16651 ZV_BYTE was intended.
16652 (Fwrite_region): Don't assume off_t fits into 'long'.
16653 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16654
ecfc0a49
MA
166552011-09-05 Michael Albinus <michael.albinus@gmx.de>
16656
16657 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16658
6511acf2 166592011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 16660
0999621a 16661 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
16662
16663 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 16664 (esprintf, exprintf, evxprintf): New functions.
62f19c19 16665 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 16666 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
16667 (modify_event_symbol): Do not assume that the length of
16668 name_alist_or_stem is safe to alloca and fits in int.
16669 (Fexecute_extended_command): Likewise for function name and binding.
16670 (Frecursion_depth): Wrap around reliably on integer overflow.
16671 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16672 since some callers pass EMACS_INT values.
16673 (Fsingle_key_description): Don't crash if symbol name contains more
16674 than MAX_ALLOCA bytes.
16675 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16676 (get_minibuffer): Arg is now EMACS_INT, not int.
16677 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 16678 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
16679 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16680
2be7d702
PE
16681 * dbusbind.c (signature_cat): New function.
16682 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
16683 Do not overrun buffer; instead, report string overflow.
16684
9d1df220
PE
16685 * dispnew.c (add_window_display_history): Don't overrun buffer.
16686 Truncate instead; this is OK since it's just a log.
16687
33ef5c64
PE
16688 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16689 even if the time zone offset is outlandishly large.
16690 Don't mishandle offset == INT_MIN.
16691
66c6fdd5
PE
16692 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16693 when creating daemon; the previous buffer-overflow check was incorrect.
16694
d749b01b
PE
16695 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16696 which has the guts of the old verror function.
16697
b5cd1905
PE
16698 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16699 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16700
6e1a67fb
PE
16701 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16702 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 16703 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 16704 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
16705 length of string rather than counting it via multiple sprintfs;
16706 that's simpler and more reliable.
c21721cc
PE
16707 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16708 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16709 sprintf, in case result does not fit in int.
16710
c57b67fc
PE
16711 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16712 (fontset_from_font): Print it.
16713
8a401434
PE
16714 * frame.c (tty_frame_count): Now printmax_t, not int.
16715 (make_terminal_frame, set_term_frame_name): Print it.
16716 (x_report_frame_params): In X, window IDs are unsigned long,
16717 not signed long, so print them as unsigned.
16718 (validate_x_resource_name): Check for implausibly long names,
16719 and don't assume name length fits in 'int'.
16720 (x_get_resource_string): Don't blindly alloca invocation name;
16721 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16722 not fit in int.
16723
6e1a67fb
PE
16724 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16725 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
16726 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16727
0df02bf3
PE
16728 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16729 Use esprintf, not sprintf, in case result does not fit in int.
16730
48e30793
PE
16731 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16732 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16733 it as a large positive number.
16734 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16735 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16736
a66ff6d8
PE
16737 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16738 in case result does not fit in int.
16739
aca216ff
PE
16740 * print.c (float_to_string): Detect width overflow more reliably.
16741 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16742 buffer overrun. Don't assume list length fits in 'int'. Treat
16743 print length of 0 as 0, not as infinity; to be consistent with other
16744 uses of print length in this function. Don't overflow print length
16745 index. Don't assume hash table size fits in 'long', or that
16746 vectorlike size fits in 'unsigned long'.
16747
31c286f7
PE
16748 * process.c (make_process): Use printmax_t, not int, to format
16749 process-name gensyms.
16750
55e5faa1
PE
16751 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16752
80f2e268
PE
16753 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16754 to avoid potential buffer overrun.
16755
670741ab
PE
16756 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16757 if X resource line is longer than 512 bytes.
16758
b7163a50
PE
16759 * xfns.c (x_window): Make sprintf buffer a bit bigger
16760 to avoid potential buffer overrun.
16761
ae58ff1f
PE
16762 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16763
c43c8a6a
PE
16764 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16765
3f8236f4
PE
167662011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16767
53e9fe90 16768 Integer overflow fixes for scrolling, etc.
6511acf2
PE
16769 Without these, Emacs silently mishandles large integers sometimes.
16770 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
16771 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16772
6511acf2
PE
16773 * xdisp.c (try_window_id): Check Emacs fixnum range before
16774 converting to 'int'.
806add1d 16775
6511acf2 16776 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
16777 Check that an Emacs fixnum is in range before assigning it to 'int'.
16778 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16779 values converted from Emacs fixnums.
16780 (Frecenter): Don't wrap around a line count if it is out of 'int'
16781 range; instead, treat it as an extreme value.
16782 (Fset_window_configuration, compare_window_configurations):
16783 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16784
6511acf2
PE
16785 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16786 that can exceed INT_MAX. Check that EMACS_INT value is in range
16787 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
16788 (match_limit): Don't assume that a fixnum can fit in 'int'.
16789
6511acf2 16790 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
16791 exceed INT_MAX.
16792
6511acf2 16793 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
16794 (Fvertical_motion): Don't wrap around LINES values that don't fit
16795 in 'int'. Instead, treat them as extreme values. This is good
16796 enough for windows, which can't have more than INT_MAX lines anyway.
16797
fcb901a7
LMI
167982011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16799
0f2f6b6d
LMI
16800 * Require libxml/parser.h to avoid compilation warning.
16801
fcb901a7
LMI
16802 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16803
16804 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16805 since this reportedly can destroy thread storage.
16806
6e20a0d4
CY
168072011-08-30 Chong Yidong <cyd@stupidchicken.com>
16808
16809 * syntax.c (find_defun_start): Update all cache variables if
16810 exiting early (Bug#9401).
16811
148ae00e
EZ
168122011-08-30 Eli Zaretskii <eliz@gnu.org>
16813
f6cfbd8f
EZ
16814 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16815
148ae00e
EZ
16816 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16817 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16818 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16819
16820 * term.c (tty_append_glyph): New function.
16821 (produce_stretch_glyph): Static function and its prototype deleted.
16822
a66cfb1c
SM
16823 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16824 Add prototypes.
148ae00e 16825
c4a07a4c
PE
168262011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16827
16828 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16829 when checking :margin (Bug#9390).
16830 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 16831 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
16832 so that the name doesn't mislead. All uses changed.
16833
6bc8cd65
JB
168342011-08-28 Johan Bockgård <bojohan@gnu.org>
16835
16836 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16837 set_tty_hooks.
16838
dca4927e
EZ
168392011-08-27 Eli Zaretskii <eliz@gnu.org>
16840
16841 * xdisp.c (move_it_to): Don't bail out early when reaching
16842 position beyond to_charpos, if we are scanning backwards.
16843 (move_it_vertically_backward): When DY == 0, make sure we get to
16844 the first character in the line after the newline.
16845
f2cad773
PE
168462011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16847
16848 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16849 (ccl_driver): Do not generate an out-of-range pointer.
16850 (Fccl_execute_on_string): Remove unnecessary check for
16851 integer overflow, noted by Stefan Monnier in
16852 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16853 Remove a FIXME that didn't need fixing.
16854 Simplify the newly-introduced buffer reallocation code.
16855
0cae2cdb
JB
168562011-08-27 Juanma Barranquero <lekktu@gmail.com>
16857
16858 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16859
5fc295a4 168602011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 16861
70c60eb2 16862 Integer and memory overflow issues (Bug#9196).
726e0ab1 16863
d31850da
PE
16864 * doc.c (get_doc_string): Rework so that
16865 get_doc_string_buffer_size is the actual buffer size, rather than
16866 being 1 less than the actual buffer size; this makes xpalloc more
16867 convenient.
16868
a69fbedb
PE
16869 * image.c (x_allocate_bitmap_record, cache_image):
16870 * xselect.c (Fx_register_dnd_atom):
16871 Simplify previous changes by using xpalloc.
16872
fe5c5d37
PE
16873 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16874 since either will do and ptrdiff_t is convenient with xpalloc.
16875
0065d054
PE
16876 * charset.c (charset_table_size)
16877 (struct charset_sort_data.priority): Now ptrdiff_t.
16878 (charset_compare): Don't overflow if priorities differ greatly.
16879 (Fsort_charsets): Don't assume list length fits in int.
16880 Check for size-calculation overflow when allocating sort data.
16881 (syms_of_charset): Allocate an initial charset table that is
16882 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16883
16884 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16885
16886 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16887 The actual value is always <= INT_MAX, and leaving it unsigned made
16888 overflow checking harder.
16889
16890 * dispextern.h (struct glyph_matrix.rows_allocated)
16891 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16892 with xpalloc. The values are still always <= INT_MAX.
16893
16894 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16895
16896 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16897 (SAFE_NALLOCA): New macro.
16898
16899 * region-cache.c (struct boundary.pos, find_cache_boundary)
16900 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16901 (set_cache_region, invalidate_region_cache)
16902 (revalidate_region_cache, know_region_cache, region_cache_forward)
16903 (region_cache_backward, pp_cache):
16904 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16905 so that ptrdiff_t * can be passed to xpalloc.
16906 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16907 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16908 (pp_cache): Don't assume cache_len fits in int.
16909 * region-cache.h: Adjust extern decls to match.
16910
16911 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16912 EMACS_INT, since either will do, for xpalloc.
16913
16914 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16915 (xnmalloc, xnrealloc, xpalloc): New functions.
16916
726e0ab1
PE
16917 * bidi.c (bidi_shelve_header_size): New constant.
16918 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16919 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16920
51f30bc5 16921 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
16922 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16923 (overlay_strings):
16924 Don't update size of array until after memory allocation succeeds,
16925 because xmalloc/xrealloc may not return.
0065d054
PE
16926 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16927 now that we have proper integer overflow checking.
16928 (record_overlay_string, overlay_strings): Catch overflows when
16929 calculating size of overlay_str_buf.
726e0ab1 16930
0065d054
PE
16931 * callproc.c (Fcall_process): Check for size overflow when
16932 calculating size of args2.
16933 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16934 Normally we prefer signed values, but sticking with ptrdiff_t would
16935 require adding more-complicated checks.
726e0ab1
PE
16936
16937 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16938 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16939 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 16940 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
16941
16942 * character.c (Fstring): Check for size-calculation overflow.
16943
16944 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16945 unnecessary integer overflow. Check for size overflow.
16946 (encode_coding_object): Don't update size until xmalloc succeeds.
16947
16948 * composite.c (get_composition_id): Check for overflow in glyph
16949 length calculations.
16950
16951 Integer and memory overflow fixes for display code.
16952 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16953 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16954 (scrolling_window): Check for overflow in size calculations.
16955 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16956 Don't assume glyph table len fits in int.
16957 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16958 (row_table_size): Now ptrdiff_t, not int.
16959 (scrolling_window): Avoid overflow in size calculations.
16960 Don't update size until allocation succeeds.
16961 * fns.c (concat): Check for overflow in size calculations.
16962 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16963 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16964 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16965
16966 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16967 (get_doc_string): Check for size calculation overflow.
16968 Don't update size until allocation succeeds.
16969 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16970 EMACS_INT, where ptrdiff_t will do.
16971 (Fsubstitute_command_keys): Check for string overflow.
16972
16973 * editfns.c (set_time_zone_rule): Don't assume environment length
16974 fits in int.
16975 (message_length): Now ptrdiff_t, not int.
16976 (Fmessage_box): Don't update size until allocation succeeds.
16977 Don't assume message length fits in int.
16978 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16979
0065d054
PE
16980 * emacs.c (main): Do not reallocate argv, since there is a null at
16981 the end that can be overwritten, and this way there's no need to
16982 worry about size-calculation overflow.
16983 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
16984
16985 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16986 alloc succeeds.
16987 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16988
16989 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16990 (x_set_scroll_bar_width, x_figure_window_size):
16991 Check for integer overflow.
16992 (x_set_alpha): Do not assume XINT fits in int.
16993
16994 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16995 This is for the members text_lines, text_cols, total_lines, total_cols,
16996 where the system imposes an 'int' limit.
16997
16998 * fringe.c (Fdefine_fringe_bitmap):
16999 Don't update size until alloc works.
17000
17001 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17002 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17003
17004 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17005 Check for size-calculation overflow.
17006 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17007 do, as we prefer signed integers.
17008 (id_to_widget.max_size, id_to_widget.used)
17009 (xg_store_widget_in_map, xg_remove_widget_from_map)
17010 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17011 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17012 Use and return ptrdiff_t, not int.
17013 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17014 * gtkutil.h: Change prototypes to match the above.
17015
17016 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17017 are duplicate now that they've been promoted to lisp.h.
17018 (x_allocate_bitmap_record, x_alloc_image_color)
17019 (make_image_cache, cache_image, xpm_load):
17020 Don't update size until alloc is done.
17021 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17022 (x_detect_edges):
3256efce 17023 Check for size calculation overflow.
726e0ab1
PE
17024 (ct_colors_allocated_max): New constant.
17025 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17026 overflow.
3256efce 17027
726e0ab1
PE
17028 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17029 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17030 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17031 Use ptrdiff_t, not int, to count maps.
17032 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
17033 calculations. Don't update size until allocation succeeds.
17034 Redo calculations to avoid overflow.
726e0ab1
PE
17035 * keyboard.h: Change prototypes to match the above.
17036
17037 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17038 to count maps.
17039 (current_minor_maps): Check for size calculation overflow.
17040 * keymap.h: Change prototypes to match the above.
17041
17042 * lread.c (read1, init_obarray): Don't update size until alloc done.
17043
17044 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17045 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17046
726e0ab1
PE
17047 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17048 Now ptrdiff_t, not int.
17049 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17050 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17051
17052 * process.c (Fnetwork_interface_list): Check for overflow
17053 in size calculation.
17054
17055 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17056
17057 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17058 overflow. Don't bother calling xmalloc when xrealloc will do.
17059
17060 * search.c (Freplace_match): Check for size calculation overflow.
17061 (Fset_match_data): Don't assume list lengths fit in 'int'.
17062
17063 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17064 for command line length. Do not attempt to address one before the
17065 beginning of an array, as that's not portable.
17066
17067 * term.c (max_frame_lines): Remove; unused.
17068 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17069 not int.
17070 (encode_terminal_code, calculate_costs): Check for size
17071 calculation overflow.
17072 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17073 table lengths and related sizes. Don't update size until alloc
17074 done. Redo calculations to avoid overflow.
17075 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17076
17077 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17078 subtracting pointers.
17079 (gobble_line): Check for overflow more carefully. Don't update size
17080 until alloc done.
17081
17082 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17083 Don't update size until alloc done.
17084 Redo size calculations to avoid overflow.
17085 Check for size calculation overflow.
0065d054 17086 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
17087
17088 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17089 Use ptrdiff_t, not int, for sizes.
17090 (store_mode_line_noprop_char): Don't update size until alloc done.
17091
0065d054
PE
17092 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17093 Use ptrdiff_t, not int, for sizes.
17094 (Finternal_make_lisp_face, cache_face):
17095 Check for size calculation overflow.
17096 (cache_face): Treat size calculation overflows as if they were
17097 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
17098
17099 * xfns.c (x_encode_text, x_set_name_internal)
17100 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17101 sizes, since they can exceed INT_MAX in size. Check for size
17102 calculation overflow.
17103
0065d054
PE
17104 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17105 (xg_select): Check for size calculation overflow.
726e0ab1
PE
17106 Don't update size until alloc done.
17107
0065d054 17108 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 17109 as sprintf is limited to int lengths.
1d526e2f 17110
252c5ee1
PE
17111 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17112 (X_LONG_MIN): New macros.
864d7ce7
PE
17113 Use them to make the following changes clearer.
17114 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17115 This change doesn't affect the value now, but it may help remind
17116 future maintainers not to raise the value too much later.
17117 (SELECTION_QUANTUM): Remove, replacing with ...
17118 (selection_quantum): ... new function, which avoids overflow.
17119 All uses changed.
17120 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17121 assumption that selection length fits in 'int'.
17122 (x_reply_selection_request, x_handle_selection_request)
17123 (x_get_window_property, receive_incremental_selection)
17124 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17125 (lisp_data_to_selection_data, clean_local_selection_data):
17126 Use ptrdiff_t, not int, to record length of selection.
17127 (x_reply_selection_request, x_get_window_property)
17128 (receive_incremental_selection, x_property_data_to_lisp):
17129 Redo calculations to avoid overflow.
17130 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 17131 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
17132 something.
17133 (x_get_window_property, receive_incremental_selection)
17134 (lisp_data_to_selection_data, x_property_data_to_lisp):
17135 Check for size-calculation overflow.
17136 (x_get_window_property, receive_incremental_selection)
17137 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17138 Don't store size until memory allocation succeeds.
17139 (x_get_window_property): Plug memory leak on memory exhaustion.
17140 Don't double-block input; malloc is safe here. Don't assume 2**34
17141 - 4 fits in unsigned long. Add an xassert to check
17142 XGetWindowProperty overflow. Be more careful about overflow
17143 calculations, and distinguish size from memory overflow better.
17144 (receive_incremental_selection): When tracing, don't assume
17145 unsigned int is less than INT_MAX.
17146 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17147 harmful) conversions of unsigned short to int.
17148 (lisp_data_to_selection_data): Don't assume that integers
17149 in the range -65535 through -1 fit in an X unsigned short.
17150 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17151 result parameters unless successful. Rely on cons_to_unsigned
17152 to report problems with elements; the old code wasn't right anyway.
17153 (x_check_property_data): Check for int overflow; we cannot use
17154 a wider type due to X limits.
17155 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17156
726e0ab1 17157 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 17158
0065d054
PE
17159 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17160 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
17161 (x_color_cells): Don't store size until memory allocation succeeds.
17162 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 17163 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
17164 (x_term_init): Don't assume length fits in int (sprintf is limited
17165 to int size).
bc18e09d 17166
ebfa62c0
PE
17167 Use ptrdiff_t for composition IDs.
17168 * character.c (lisp_string_width):
17169 * composite.c (composition_table_size, n_compositions)
17170 (get_composition_id, composition_gstring_from_id):
17171 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17172 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17173 * window.c (Frecenter):
17174 Use ptrdiff_t, not int, for composition IDs.
17175 * composite.c (get_composition_id): Check for integer overflow.
17176 * composite.h: Adjust prototypes to match the above changes.
17177
d3411f89
PE
17178 Use ptrdiff_t for hash table indexes.
17179 * category.c (hash_get_category_set):
17180 * ccl.c (ccl_driver):
17181 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17182 * coding.c (coding_system_charset_list, detect_coding_system):
17183 * coding.h (struct coding_system.id):
17184 * composite.c (get_composition_id, gstring_lookup_cache):
17185 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17186 * image.c (xpm_get_color_table_h):
17187 * lisp.h (hash_lookup, hash_put):
17188 * minibuf.c (Ftest_completion):
17189 Use ptrdiff_t for hash table indexes, not int (which is too
17190 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17191 32-bit --with-wide-int hosts).
17192
e097a6fa
PE
17193 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17194 Add a FIXME comment about memory leaks.
17195 (syms_of_charset): Don't assume xmalloc returns.
17196
5637687f
PE
17197 Don't assume that stated character widths fit in int.
17198 * character.c (Fchar_width, c_string_width, lisp_string_width):
17199 * character.h (CHAR_WIDTH):
17200 * indent.c (MULTIBYTE_BYTES_WIDTH):
17201 Use sanitize_char_width to avoid undefined and/or bad behavior
17202 with outlandish widths.
a66cfb1c 17203 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
17204 now that we have two such functions. All uses changed.
17205 (sanitize_char_width): New inline function.
17206
a2271ba2
PE
17207 Don't assume that tab-width fits in int.
17208 * character.h (sanitize_width): New inline function.
17209 (SANE_TAB_WIDTH): New macro.
17210 (ASCII_CHAR_WIDTH): Use it.
17211 * indent.c (sane_tab_width): Remove. All uses replaced by
17212 SANE_TAB_WIDTH (current_buffer).
17213 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17214
18c52557
PE
17215 * fileio.c: Integer overflow issues with file modes.
17216 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17217
caeeedc1
PE
17218 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17219 Remove unreachable code.
17220 (read_hex, load_charset_map_from_file): Check for integer overflow.
17221
6df6ae42 17222 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
17223 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17224 (x_send_scroll_bar_event): Likewise. Check that the size does not
17225 exceed limits imposed by XClientMessageEvent, as well as the usual
17226 ptrdiff_t and size_t limits.
17227
b13995db
PE
17228 * keyboard.c: Overflow, signedness and related fixes.
17229 (make_lispy_movement): Use same integer type in forward decl
17230 that is used in the definition.
17231 (read_key_sequence, keyremap_step):
17232 Change bufsize argument back to int, undoing my 2011-03-30 change.
17233 We prefer signed types, and int is wide enough here.
17234 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17235 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17236 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17237 length, not size_t. Use ptrdiff_t for index, not int.
17238 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17239 possibility of integer overflow.
17240
13464394
PE
17241 Overflow, signedness and related fixes for images.
17242
17243 * dispextern.h (struct it.stack[0].u.image.image_id)
17244 (struct_it.image_id, struct image.id, struct image_cache.size)
17245 (struct image_cache.used, struct image_cache.ref_count):
17246 * gtkutil.c (update_frame_tool_bar):
17247 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17248 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17249 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17250 * nsmenu.m (update_frame_tool_bar):
17251 * xdisp.c (calc_pixel_width_or_height):
17252 * xfns.c (image_cache_refcount):
17253 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17254 on typical 64-bit hosts.
17255
17256 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17257 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17258 Omit unnecessary casts to int.
17259 (parse_image_spec): Check that integers fall into 'int' range
17260 when the callers expect that.
17261 (image_ascent): Redo ascent calculation to avoid int overflow.
17262 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17263 (lookup_image): Remove unnecessary tests.
17264 (xbm_image_p): Locals are now of int, not EMACS_INT,
17265 since parse_image_check makes sure they fit into int.
17266 (png_load, gif_load, svg_load_image):
17267 Prefer int to unsigned where either will do.
17268 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
17269 old tiff_error_handler and tiff_warning_handler.
17270 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
17271 stack buffer overflows. It uses only the features of vsnprintf
17272 that are common to both POSIX and native Microsoft.
17273 (tiff_error_handler, tiff_warning_handler): Use it.
17274 (tiff_load, gif_load, imagemagick_load_image):
17275 Don't assume :index value fits in 'int'.
17276 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17277 (imagemagick_load_image): Check that crop parameters fit into
17278 the integer types that MagickCropImage accepts. Don't assume
17279 Vimagemagick_render_type has a nonnegative value. Don't assume
17280 size_t fits in 'long'.
17281 (gs_load): Use printmax_t to print the widest integers possible.
17282 Check for integer overflow when computing image height and width.
17283
c11821d4
EZ
172842011-08-26 Eli Zaretskii <eliz@gnu.org>
17285
17286 * xdisp.c (redisplay_window): Don't force window start if point
17287 will be invisible in the resulting window. (Bug#9324)
17288
0c95fcf7
EZ
172892011-08-25 Eli Zaretskii <eliz@gnu.org>
17290
17291 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17292 the display spec is of the form `(space ...)'.
17293 (handle_display_spec): Return the value returned by
17294 handle_single_display_spec, not just 1 or zero.
17295 (handle_single_display_spec): If the display spec is of the form
17296 `(space ...)', and specifies display in the text area, return 2
17297 rather than 1.
fee65a97 17298 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
17299 accurately, and prefer exact match for point under bidi.
17300 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
17301
17302 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17303 into disp_prop; all users changed.
17304
17305 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17306 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17307 for the text covered by the display property.
17308
e4ed06f1
CY
173092011-08-25 Chong Yidong <cyd@stupidchicken.com>
17310
17311 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17312 Change return value to nil.
17313 (Frecord_buffer): Delete unused function.
17314
f67cdd7f
EZ
173152011-08-24 Eli Zaretskii <eliz@gnu.org>
17316
5980d4c6
EZ
17317 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17318 buffers, return left-to-right.
8610fe8b
EZ
17319 (set_cursor_from_row): Consider candidate row a win if its glyph
17320 represents a newline and point is on that newline. Fixes cursor
17321 positioning on the newline at EOL of R2L text within L2R
17322 paragraph, and vice versa.
17323 (try_cursor_movement): Check continued rows, in addition to
17324 continuation rows. Fixes unwarranted scroll when point enters a
17325 continued line of R2L text within an L2R paragraph, or vice versa.
17326 (cursor_row_p): Consider the case of point being equal to
17327 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17328 from the end of a short line to the beginning of a continued line
17329 of R2L text within L2R paragraph.
17330 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17331 composed characters.
5980d4c6 17332
f67cdd7f
EZ
17333 * bidi.c (bidi_check_type): Use xassert.
17334 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17335 members.
17336
bca633fb
EZ
173372011-08-23 Eli Zaretskii <eliz@gnu.org>
17338
17339 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17340 a character.
17341
4a5885a7
CY
173422011-08-23 Chong Yidong <cyd@stupidchicken.com>
17343
17344 * nsfont.m (ns_otf_to_script): Fix typo.
17345
0902a04e
KH
173462011-08-22 Kenichi Handa <handa@m17n.org>
17347
17348 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17349 extra slot even if the purpose is char-code-property-table.
17350
1a2e6670
EZ
173512011-08-23 Eli Zaretskii <eliz@gnu.org>
17352
8ddde651
EZ
17353 * xdisp.c (redisplay_window): When computing centering_position,
17354 account for the height of the header line. (Bug#8874)
17355
425cc014
EZ
17356 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17357 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17358 candidate is selected by the mouse, and that candidate has a
17359 composed character under the mouse.
17360
1a2e6670
EZ
17361 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17362 coordinates reported by pos-visible-in-window-p for a composed
17363 character in column zero.
17364
8b76d6f8
SM
173652011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17366
17367 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17368
dac347dd
EZ
173692011-08-22 Eli Zaretskii <eliz@gnu.org>
17370
17371 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17372 consider it a hit if to_charpos is anywhere in the range of the
17373 composed buffer positions.
17374
e013fb34
CY
173752011-08-22 Chong Yidong <cyd@stupidchicken.com>
17376
17377 * image.c (gif_load): Don't assume that each subimage has the same
17378 dimensions as the base image. Handle disposal method that is
17379 "undefined" by the gif spec (Bug#9335).
17380
bd1ba3e8
CY
173812011-08-20 Chong Yidong <cyd@stupidchicken.com>
17382
17383 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 17384 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 17385
54a1215b
EZ
173862011-08-19 Eli Zaretskii <eliz@gnu.org>
17387
823564e5
EZ
17388 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17389 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17390 from an Org mode buffer to a Speedbar frame.
17391
54a1215b
EZ
17392 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17393 a composition, take its buffer position from IT->cmp_it.charpos.
17394 Fixes cursor positioning at the beginning of a line that begins
17395 with a composed character.
17396
9778ebcc
EZ
173972011-08-18 Eli Zaretskii <eliz@gnu.org>
17398
0be6ee06
EZ
17399 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17400 character bidirectional type, use STRONG_L instead. Fixes crashes
17401 in a buffer produced by `describe-categories'.
17402
9778ebcc
EZ
17403 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17404 members before the level stack, so they would be saved and
17405 restored when copying iterator state. Fixes incorrect reordering
17406 around TABs covered by display properties.
17407
156bffbe
AS
174082011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17409
6b02f655 17410 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 17411
72ad093b
CY
174122011-08-17 Chong Yidong <cyd@stupidchicken.com>
17413
17414 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
17415 (internal_condition_case_2, internal_condition_case_n):
17416 Remove unnecessary aborts (Bug#9081).
72ad093b 17417
35774242
EZ
174182011-08-17 Eli Zaretskii <eliz@gnu.org>
17419
17420 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17421 has no `load' handler, try opening the file locally. (Bug#9311)
17422
db76dd85
KB
174232011-08-16 Ken Brown <kbrown@cornell.edu>
17424
17425 * gmalloc.c: Expand comment.
17426
b215eee5
EZ
174272011-08-16 Eli Zaretskii <eliz@gnu.org>
17428
17429 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17430 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17431
a4579d33
KB
174322011-08-16 Ken Brown <kbrown@cornell.edu>
17433
17434 Fix memory allocation problems in Cygwin build (Bug#9273).
17435
17436 * unexcw.c ( __malloc_initialized): Declare external variable.
17437 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17438
8b76d6f8
SM
17439 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17440 New variables.
a4579d33
KB
17441 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17442 dumped emacs.
17443 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17444 in the static heap.
17445 [CYGWIN] (special_realloc): New function.
17446 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17447 requests to realloc storage in the static heap.
17448
3ebec551
PE
174492011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17450
17451 * bidi.c (bidi_initialize): Remove unused local.
17452
9fd8be00
EZ
174532011-08-15 Eli Zaretskii <eliz@gnu.org>
17454
6b02f655
SM
17455 * bidimirror.h:
17456 * biditype.h: Remove file.
17457 * makefile.w32-in ($(BLD)/bidi.$(O)):
17458 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
17459
17460 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17461
17462 * chartab.c: Improve commentary for the uniprop_table API.
17463
32413314
EZ
17464 * bidi.c (bidi_paragraph_init): Support zero value of
17465 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
17466 (bidi_initialize): Use uniprop_table instead of including
17467 biditype.h and bidimirror.h.
32413314 17468
9fd8be00
EZ
17469 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17470 coordinates of the iterator when restoring from ppos_it.
17471 (Bug#9296)
17472
5cf2b69b
KH
174732011-08-14 Kenichi Handa <handa@m17n.org>
17474
17475 * process.c (create_process): Call setup_process_coding_systems
72ad093b 17476 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 17477
daf17d00
EZ
174782011-08-14 Eli Zaretskii <eliz@gnu.org>
17479
17480 * xdisp.c (move_it_in_display_line_to): Don't invoke
17481 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17482 ppos_it. Fixes vertical cursor motion when line beginning is
17483 covered by an image. (Bug#9296)
17484
08e3161a
JD
174852011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17486
17487 * nsterm.h (ns_run_ascript): Declare.
17488 (NSAPP_DATA2_RUNASSCRIPT): Define.
17489
17490 * nsfns.m (as_script, as_result, as_status): New static variables.
17491 (ns_run_ascript): New function.
5e617bc2 17492 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
17493 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17494 the event loop. Get status from as_status (Bug#7276).
17495
17496 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17497 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17498 the event loop (Bug#7276).
17499
a3720aa2
AS
175002011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17501
17502 * gnutls.c (QCgnutls_bootprop_priority)
17503 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17504 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17505 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17506 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17507 (QCgnutls_bootprop_verify_hostname_error)
17508 (QCgnutls_bootprop_callbacks_verify): Rename from
17509 Qgnutls_bootprop_..., all uses changed.
17510
17511 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17512 uses changed.
17513
0a0d27fb
PE
175142011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17515
19d5c50c
PE
17516 * xfaces.c (Qframe_set_background_mode): Now static.
17517 * dispextern.h (Qframe_set_background_mode): Remove decl.
17518
0a0d27fb
PE
17519 * process.c (Fnetwork_interface_info): Declare local only if needed.
17520
377538cb
JD
175212011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17522
17523 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17524 (Fnetwork_interface_list): Allocate in increments of bytes instead
17525 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17526 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17527 sockaddr.
17528 (struct ifflag_def): notrailers is smart on OSX.
17529 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17530 Get hardware address with getifaddrs if available.
17531
08fff70c
EZ
175322011-08-12 Eli Zaretskii <eliz@gnu.org>
17533
17534 * xdisp.c (iterate_out_of_display_property): xassert that
17535 IT->position is set to within IT->object's boundaries. Break from
17536 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
17537 when IT->position is set up wrongly due to some bug.
17538 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
17539 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17540 entry. Force push_it to save on the stack the current
17541 buffer/string position, to be restored by pop_it. Fix flags in
17542 the iterator structure wrt the object coming from a display
17543 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17544 properties. (Bug#9284)
17545
7be1c708 175462011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 17547
7be1c708
CY
17548 * fontset.c (fontset_get_font_group): Add proper type checks.
17549 (Bug#9172)
aac0c6e3 17550
7be1c708 175512011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 17552
7be1c708
CY
17553 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17554 and LC_VERSION_MIN_MACOSX.
17555 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17556 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 17557
97bb72a6
EZ
175582011-08-08 Eli Zaretskii <eliz@gnu.org>
17559
17560 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
17561 no-display-properties-and-no-overlays under bidi display.
17562 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 17563 properties and overlays.
97bb72a6 17564
d5617611
CY
175652011-08-08 Chong Yidong <cyd@stupidchicken.com>
17566
37e11a63
CY
17567 * editfns.c (Fset_time_zone_rule): Document relationship with the
17568 setenv function.
17569
d5617611
CY
17570 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17571 the font entity extracted from the cache (Bug#8109).
17572
58872834
CY
175732011-08-07 Chong Yidong <cyd@stupidchicken.com>
17574
17575 * composite.c (autocmp_chars): Don't reset point. That is done by
17576 restore_point_unwind (Bug#5984).
17577
75bfc667
JL
175782011-08-07 Juri Linkov <juri@jurta.org>
17579
17580 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17581 to show the arg `TIME' instead of `TIMEVAL'.
17582
d1410150
EZ
175832011-08-06 Eli Zaretskii <eliz@gnu.org>
17584
17585 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17586 display property strides EOL and includes a newline, as in
17587 longlines-mode. (Bug#9254)
75b771e4
EZ
17588 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17589 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
17590
17591 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17592 is non-zero, even if the data buffer is NULL. Fixes a crash in
17593 vertical-motion with longlines-mode. (Bug#9254)
17594
35928349
EZ
175952011-08-05 Eli Zaretskii <eliz@gnu.org>
17596
ec7cc85b
EZ
17597 * bidi.c <bidi_cache_total_alloc>: Now static.
17598 (bidi_initialize): Initialize bidi_cache_total_alloc.
17599
8b76d6f8 17600 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
17601 cache. (Bug#9221)
17602
17603 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17604 amount allocated this far in `bidi_cache_total_alloc'.
17605 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17606 non-zero, only free the data buffer without restoring the cache
17607 contents. All callers changed.
17608
17609 * dispextern.h (bidi_unshelve_cache): Update prototype.
17610
17611 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17612 (move_it_in_display_line, move_it_to)
17613 (move_it_vertically_backward, move_it_by_lines): Replace the call
17614 to xfree to an equivalent call to bidi_unshelve_cache.
17615 (move_it_in_display_line_to): Fix logic of returning
412b6358 17616 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 17617
e2e2423b
EZ
176182011-08-05 Eli Zaretskii <eliz@gnu.org>
17619
17620 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17621 came from a string character with a `cursor' property. (Bug#9229)
17622
ae9e757a
JD
176232011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17624
17625 * Makefile.in (LIB_PTHREAD): New variable.
17626 (LIBES): Add LIB_PTHREAD (Bug#9216).
17627
17628 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17629 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17630
213bd7f2
AS
176312011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17632
6b02f655 17633 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 17634
99aaf75f
JD
176352011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17636
17637 * xterm.c (x_find_topmost_parent): New function.
17638 (x_set_frame_alpha): Find topmost parent window with
17639 x_find_topmost_parent and set the property there also (bug#9181).
17640 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17641
c74e9d86
PE
176422011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17643
17644 * callproc.c (Fcall_process): Avoid vfork clobbering
17645 the local vars buffer, coding_systems, current_dir.
17646
640c8776
SM
176472011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17648
17649 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17650
f26d0e4c
PE
176512011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17652
8a10d76c
PE
17653 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17654 so that it is not optimized away.
17655
f26d0e4c
PE
17656 * xdisp.c (compute_display_string_pos): Remove unused local.
17657
55439c61
EZ
176582011-08-02 Eli Zaretskii <eliz@gnu.org>
17659
17660 Fix slow cursor motion and scrolling in large buffers with
17661 selective display, like Org Mode buffers. (Bug#9218)
17662
17663 * dispextern.h (struct bidi_it): New member disp_prop_p.
17664
17665 * xdisp.c: Remove one-slot cache of display string positions.
17666 (compute_display_string_pos): Accept an additional argument
5e617bc2 17667 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
17668 for a display string or property. If found, set DISP_PROP_P
17669 non-zero.
17670
17671 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
17672 DISP_PROP_P, and pass it to compute_display_string_pos.
17673 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
17674 non-zero. All callers of bidi_fetch_char changed.
17675
fb33fa43
SM
176762011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17677
17678 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17679
b099e063
DM
176802010-12-03 Don March <don@ohspite.net>
17681
17682 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17683 last character M-[char] is translated to ESC [char] (bug#7541).
17684
5cc7f7af
KH
176852011-08-02 Kenichi Handa <handa@m17n.org>
17686
d0fffa3f 17687 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
17688
17689 * chartab.c (uniprop_table): Make it non-static.
17690
525d5e6e
EZ
176912011-08-01 Eli Zaretskii <eliz@gnu.org>
17692
17693 * xdisp.c (forward_to_next_line_start): Accept additional argument
17694 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17695 on the newline.
17696 (reseat_at_next_visible_line_start): Use the bidi iterator state
17697 returned by forward_to_next_line_start to restore the state of
17698 it->bidi_it after backing up to previous newline. (Bug#9212)
17699
31011111
AS
177002011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17701
17702 * regex.c (re_comp): Protoize.
17703 (re_exec): Fix return type.
17704 (regexec): Fix type of `ret'. (Bug#9203)
17705
476371c4
PE
177062011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17707
e5d76069
PE
17708 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17709 This is needed if max-image-size is a floating-point number.
17710
9a79b20c
AS
177112011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17712
17713 * print.c (print_object): Print empty symbol as ##.
17714
17715 * lread.c (read1): Read ## as empty symbol.
17716
d8c2fa78
AA
177172011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17718
17719 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17720 setting frame foreground color (Bug#9175).
17721 (x_set_background_color): Likewise.
17722
ffe57a7a
AA
17723 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17724 contents (Bug#9176).
17725 (EmacsTooltip -init): Remove bezels and add shadows to
17726 tooltip windows.
17727
bf3492a5
AA
17728 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17729 or scroll bar (Bug#8470).
17730
d55e9c53
AA
17731 * nsfont.m (nsfont_open): Remove assignment to voffset and
17732 unnecessary vars hshink, expand, hd, full_height, min_height.
17733 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17734
17735 * nsterm.h (nsfont_info): Remove voffset field.
17736
d8c2fa78 177372011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
17738
17739 Implement strike-through and overline on NextStep (Bug#8863).
17740
17741 * nsfont.m (nsfont_open): Use underline position provided by font,
17742 instead of hard-coded value of 2.
17743 (nsfont_draw): Call ns_draw_text_decoration instead.
17744
17745 * nsterm.h: Add declaration for ns_draw_text_decoration.
17746
17747 * nsterm.m (ns_draw_text_decoration): New function for drawing
17748 underline, overline, and strike-through.
17749 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17750 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 17751 accommodate underlining, etc.
4843aac3 17752
4cc60b9b
EZ
177532011-07-28 Eli Zaretskii <eliz@gnu.org>
17754
bc7ece87
EZ
17755 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17756 default.
4cc60b9b 17757
476371c4
PE
177582011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17759
66606eea
PE
17760 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17761 Without this fix, if a signal arrives just after memory fills up,
17762 'malloc' might be invoked reentrantly.
17763
476371c4
PE
17764 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17765 In other words, assume that every image size is allowed, on non-X
17766 hosts. This assumption is probably wrong, but it lets Emacs compile.
17767
f3fcc40d
AS
177682011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17769
17770 * regex.c (re_iswctype): Convert return values to boolean.
17771
350c992f
EZ
177722011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17773
17774 * xdisp.c (compute_display_string_pos): Don't use cached display
17775 string position if the buffer had its restriction changed.
17776 (Bug#9184)
17777
5266b4bb
PE
177782011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17779
17780 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17781
2573a837 177822011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 17783
41f55ccd 17784 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 17785
39e378da
PE
17786 * bidi.c: Integer size and overflow fixes.
17787 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17788 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17789 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17790 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17791 (bidi_find_other_level_edge):
17792 Use ptrdiff_t instead of EMACS_INT where either will do.
17793 This works better on 32-bit hosts configured --with-wide-int.
17794 (bidi_cache_ensure_space): Check for size-calculation overflow.
17795 Use % rather than repeated addition, for better worst-case speed.
17796 Don't set bidi_cache_size until after xrealloc returns, because it
17797 might not return.
17798 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
17799 (bidi_cache_ensure_space): Also check that the bidi cache size
17800 does not exceed that of the largest Lisp string or buffer. See Eli
17801 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 17802
5e927815
PE
17803 * alloc.c (__malloc_size_t): Remove.
17804 All uses replaced by size_t. See Andreas Schwab's note
17805 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17806
ca4aa935
PE
17807 * image.c: Improve checking for integer overflow.
17808 (check_image_size): Assume that f is nonnull, since
17809 it is always nonnull in practice. This is one less thing to
17810 worry about when checking for integer overflow later.
17811 (x_check_image_size): New function, which checks for integer
17812 overflow issues inside X.
17813 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17814 This removes the need for a memory_full check.
17815 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17816 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17817 (xbm_read_bitmap_data): Change locals back to 'int', since
17818 their values must fit in 'int'.
17819 (xpm_load_image, png_load, tiff_load):
17820 Invoke x_create_x_image_and_pixmap earlier,
17821 to avoid much needless work if the image is too large.
17822 (tiff_load): Treat overly large images as if
17823 x_create_x_image_and_pixmap failed, not as malloc failures.
17824 (gs_load): Use x_check_image_size.
17825
5f8f9cc2
PE
17826 * gtkutil.c: Omit integer casts.
17827 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17828 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17829
5adf60bc
PE
17830 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17831
c8907a93
PE
17832 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17833 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17834 would wrongly return t on a 64-bit host.
17835
e3c25c68
PE
17836 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17837 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17838 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17839 and therefore cause GCC to emit a bogus diagnostic in some cases.
17840
3f791afe
PE
17841 * image.c: Integer signedness and overflow and related fixes.
17842 This is not an exhaustive set of fixes, but it's time to
17843 record what I've got.
17844 (lookup_pixel_color, check_image_size): Remove redundant decls.
17845 (check_image_size): Don't assume that arbitrary EMACS_INT values
17846 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17847 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17848 (tiff_load, imagemagick_load_image):
17849 Check for overflow in size calculations.
17850 (x_create_x_image_and_pixmap): Remove unnecessary test for
17851 xmalloc returning NULL; that can't happen.
17852 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17853 (xpm_color_bucket): Use better integer hashing function.
17854 (xpm_cache_color): Don't possibly over-allocate memory.
17855 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17856 (gif_memory_source):
17857 Use ptrdiff_t, not int or size_t, to record sizes.
17858 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17859 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17860 either works, as we prefer signed integers.
17861 (tiff_read_from_memory, tiff_write_from_memory):
17862 Return tsize_t, not size_t, since that's what the TIFF API wants.
17863 (tiff_read_from_memory): Don't fail simply because the read would
17864 go past EOF; instead, return a short read.
17865 (tiff_load): Omit no-longer-needed casts.
17866 (Fimagemagick_types): Don't assume size fits into 'int'.
17867
3cc5a532
PE
17868 Improve hashing quality when configured --with-wide-int.
17869 * fns.c (hash_string): New function, taken from sxhash_string.
17870 Do not discard information about ASCII character case; this
17871 discarding is no longer needed.
17872 (sxhash-string): Use it. Change sig to match it. Caller changed.
17873 * lisp.h: Declare it.
17874 * lread.c (hash_string): Remove, since we now use fns.c's version.
17875 The fns.c version returns a wider integer if --with-wide-int is
17876 specified, so this should help the quality of the hashing a bit.
17877
b312a492
PE
17878 * emacs.c: Integer overflow minor fix.
17879 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17880 Define only if GNU_LINUX.
17881 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17882
dfd153ae
PE
17883 * dispnew.c: Integer signedness and overflow fixes.
17884 Remove unnecessary forward decls, that were a maintenance hassle.
17885 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17886 All uses changed.
17887 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17888 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17889 (prepare_desired_row, line_draw_cost):
17890 Use int, not unsigned, where either works.
17891 (save_current_matrix, restore_current_matrix):
17892 Use ptrdiff_t, not size_t, where either works.
17893 (init_display): Check for overflow more accurately, and without
17894 relying on undefined behavior.
17895
a81d11a3
PE
17896 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17897 Remove, replacing with the new symbols in lisp.h. All uses changed.
17898 * fileio.c (make_temp_name):
17899 * filelock.c (lock_file_1, lock_file):
17900 * xdisp.c (message_dolog):
17901 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17902 Use pMd etc. instead.
17903 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17904 replacing the pWIDE etc. symbols removed from editfns.c.
17905
3300e6fd
PE
17906 * keyboard.h (num_input_events): Now uintmax_t.
17907 This is (very slightly) less likely to mess up due to wraparound.
17908 All uses changed.
17909
fd05c7e9
PE
17910 * buffer.c: Integer signedness fixes.
17911 (alloc_buffer_text, enlarge_buffer_text):
17912 Use ptrdiff_t rather than size_t when either will do, as we prefer
17913 signed integers.
17914
903fe15d
PE
17915 * alloc.c: Integer signedness and overflow fixes.
17916 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17917 (__malloc_size_t): Default to size_t, not to int.
17918 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17919 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17920 Prefer ptrdiff_t to size_t when either would do, as we prefer
17921 signed integers.
17922 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17923 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17924 Now const. Initialize with values that are in range even if char
17925 is signed.
17926 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17927 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17928 These functions do the right thing with sizes > 2**32.
17929 (check_depth): Now ptrdiff_t, not int.
17930 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17931 Adjust to new way of storing sizes. Check for size overflow bugs
17932 in rest of code.
17933 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17934 slightly wrong anyway, as it missed one instance of
17935 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17936 (refill_memory_reserve): Omit needless cast to size_t.
17937 (mark_object_loop_halt): Mark as externally visible.
17938
ac82cc6a
PE
17939 * xselect.c: Integer signedness and overflow fixes.
17940 (Fx_register_dnd_atom, x_handle_dnd_message):
17941 Use ptrdiff_t, not size_t, since we prefer signed.
17942 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17943 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17944 x_dnd_atoms_size and x_dnd_atoms_length.
17945
c2d1e36d
PE
17946 * doprnt.c: Prefer signed to unsigned when either works.
17947 * eval.c (verror):
17948 * doprnt.c (doprnt):
17949 * lisp.h (doprnt):
17950 * xdisp.c (vmessage):
17951 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17952 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17953 prefer signed arithmetic to avoid comparison confusion.
17954 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17955 but is a bit tricky.
17956
0e926e56
PE
17957 Assume freestanding C89 headers, string.h, stdlib.h.
17958 * data.c, doprnt.c, floatfns.c, print.c:
17959 Include float.h unconditionally.
17960 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17961 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17962 * regex.c: Likewise for stddef.h, string.h.
17963 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17964 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17965 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17966 (STDC_HEADERS): Remove obsolete defines.
17967 * sysdep.c: Include limits.h unconditionally.
17968
9cfdb3ec
PE
17969 Assume support for memcmp, memcpy, memmove, memset.
17970 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17971 * regex.c (memcmp, memcpy):
17972 Remove; we assume C89 now.
17973
17974 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17975 (__malloc_safe_bcopy): Remove; no longer needed.
17976
cf950e6b 17977 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
17978 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17979 well either way, and we prefer signed to unsigned.
17980
dbf38e02
LMI
179812011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17982
17983 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17984 closes the connection while we're reading (bug#9182).
17985
d6f0886c 179862011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 17987
d6f0886c
JD
17988 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17989 are specified (Bug#9168).
24e0f6b1 17990
2eb1f9e6
PE
179912011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17992
17993 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17994 Found by GCC static checking and --with-wide-int on a 32-bit host.
17995
22381272 179962011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
17997
17998 * xdisp.c (compute_display_string_pos): Fix logic of caching
17999 previous display string position. Initialize cached_prev_pos to
18000 -1. Fixes slow-down at the beginning of a buffer.
18001
f25e39b4
EZ
180022011-07-24 Eli Zaretskii <eliz@gnu.org>
18003
18004 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18005 for attrs[LFACE_FONTSET_INDEX].
18006
04c4b52e
PE
180072011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18008
18009 * xml.c (parse_region): Remove unused local
18010 that was recently introduced.
18011
c1734fbd
EZ
180122011-07-23 Eli Zaretskii <eliz@gnu.org>
18013
be18c5a5
EZ
18014 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18015 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18016
c1734fbd
EZ
18017 * xdisp.c (move_it_in_display_line_to): Record the best matching
18018 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
18019 exit if none of the characters scanned was an exact match.
18020 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
18021 when exact match is impossible due to invisible text, and the
18022 lines are truncated.
18023
a258d627
JD
180242011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18025
18026 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18027 for OSX >= 10.7.
18028
b6d5a689
EZ
180292011-07-22 Eli Zaretskii <eliz@gnu.org>
18030
0f74f785
EZ
18031 Fix a significant slow-down of cursor motion with C-n, C-p,
18032 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18033 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 18034 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
18035 (next_element_from_buffer): Call compute_stop_pos_backwards to
18036 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
18037 base_level_stop.
18038 (reseat): Don't look for prev_stop, as that could mean a very long
18039 run.
18040 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18041 <cached_disp_overlay_modiff>: Cache for last found display string
18042 position.
551918c1 18043 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
18044 about the same buffer in the same area of character positions, and
18045 the buffer wasn't changed since the time the display string
18046 position was cached.
551918c1 18047
b2d0c91a
EZ
180482011-07-22 Eli Zaretskii <eliz@gnu.org>
18049
18050 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18051 is an integer, which is important for empty lines. (Bug#9149)
18052
043604ee
CY
180532011-07-22 Chong Yidong <cyd@stupidchicken.com>
18054
18055 * frame.c (Fmodify_frame_parameters): In tty case, update the
18056 default face if necessary (Bug#4238).
18057
da4adb04
CY
180582011-07-21 Chong Yidong <cyd@stupidchicken.com>
18059
18060 * editfns.c (Fstring_to_char): No need to explain what a character
18061 is in the docstring (Bug#6576).
18062
9abd0532
LMI
180632011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18064
18065 * xml.c (parse_region): Make sure we always return a tree.
18066
36881d16
HK
180672011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18068
18069 * xml.c (parse_region): If a document contains only comments,
18070 return that, too.
18071
1e98674d
LMI
180722011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18073
18074 * xml.c (make_dom): Return comments, too.
18075
590bd467
PE
180762011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18077
18078 Port to OpenBSD.
18079 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18080 and the surrounding thread.
18081 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18082 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18083 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18084 timer goes off.
18085 * s/openbsd.h (BROKEN_SIGIO): Define.
18086 * unexelf.c (unexec) [__OpenBSD__]:
18087 Don't update the .mdebug section of the Alpha COFF symbol table.
18088
f41628b2
LMI
180892011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18090
18091 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18092 (bug#8460).
18093
b59b67c5
PE
180942011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18095
15e3a074
PE
18096 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18097 This fixes some race conditions on the permissions of any newly
18098 created file.
18099
41bed37d
PE
18100 * alloc.c (valid_pointer_p): Use pipe, not open.
18101 This fixes some permissions issues when debugging.
18102
b59b67c5
PE
18103 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18104 If fchown fails to set both uid and gid, try to set just gid,
18105 as that is sometimes allowed. Adjust the file's mode to eliminate
18106 setuid or setgid bits that are inappropriate if fchown fails.
18107
925a6be7
SM
181082011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18109
18110 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18111 to compare Lisp_Objects.
18112 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18113 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18114 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18115
52968808
AS
181162011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18117
0a6a104b
AS
18118 * lread.c (read_integer): Unread even EOF character.
18119 (read1): Likewise. Properly record start position of symbol.
18120
52968808
AS
18121 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18122 symbol character follows.
18123
9e381cdd
PE
181242011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18125
18126 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18127 This works around a problem with the previous change to Fcopy_file.
18128 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18129 and without this change, GCC might complain about discarding
18130 fchown's return value.
18131
b5641435
JB
181322011-07-16 Juanma Barranquero <lekktu@gmail.com>
18133
18134 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18135
a8031457
PE
181362011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18137
18138 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18139
dd889327
LMI
181402011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18141
750c33f7
LMI
18142 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18143 it's used from the C level.
18144
dd889327
LMI
18145 * process.c: Use the same condition for POLL_FOR_INPUT in both
18146 keyboard.c and process.c (bug#1858).
18147
87e86684
LM
181482011-07-09 Lawrence Mitchell <wence@gmx.li>
18149
18150 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18151 (Fgnutls_boot): Use it.
18152
64348f40
AS
181532011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18154
18155 * doc.c (Fsubstitute_command_keys): Revert last change.
18156
1d698799
LMI
181572011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18158
f863868c
LMI
18159 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18160 quotes the next character, and doesn't affect other longer
18161 sequences (bug#8935).
18162
1d698799
LMI
18163 * lread.c (syms_of_lread): Clarify that is isn't only
18164 `eval-buffer' and `eval-defun' that's affected by
18165 `lexical-binding' (bug#8460).
18166
aa4b6df6
EZ
181672011-07-15 Eli Zaretskii <eliz@gnu.org>
18168
18169 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 18170 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 18171
5d856da6
PE
181722011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18173
ad6042bb
PE
18174 Fix minor problems found by static checking.
18175 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18176 (elsz): Now a signed constant, not a size_t var. We prefer signed
18177 types to unsigned, to avoid integer comparison confusion. Without
18178 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18179 "cannot optimize loop, the loop counter may overflow", a symptom
18180 of the confusion.
f00bbb22 18181 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
18182 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18183
6468f31c
LMI
181842011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18185
49080b10
LMI
18186 * search.c (Fre_search_backward): Mention `case-fold-search' in
18187 all the re_search_* functions (bug#8138).
18188
6468f31c
LMI
18189 * keyboard.c (Fopen_dribble_file): Document when the file is
18190 closed (bug#8056).
18191
c965adc5
EZ
181922011-07-14 Eli Zaretskii <eliz@gnu.org>
18193
df9733bf
EZ
18194 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18195 bidi_cache_idx.
18196
0bb23927
EZ
18197 Support bidi reordering of display and overlay strings.
18198 * xdisp.c (compute_display_string_pos)
18199 (compute_display_string_end): Accept additional argument STRING.
18200 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18201 (reseat_to_string): Initialize bidi_it->string.s and
18202 bidi_it->string.schars.
18203 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
18204 NULL (avoids a crash in bidi_paragraph_init).
18205 Initialize itb.string.lstring.
0bb23927
EZ
18206 (init_iterator): Call bidi_init_it only of a valid
18207 buffer position was specified. Initialize paragraph_embedding to
18208 L2R.
18209 (reseat_to_string): Initialize the bidi iterator.
18210 (display_string): If we need to ignore text properties of
18211 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18212 original value of -1 will not work with bidi.)
18213 (compute_display_string_pos): First arg is now struct
18214 `text_pos *'; all callers changed. Support display properties on
18215 Lisp strings.
18216 (compute_display_string_end): Support display properties on Lisp
18217 strings.
18218 (init_iterator, reseat_1, reseat_to_string): Initialize the
18219 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18220 when iterating on a string not from display properties).
640c8776
SM
18221 (compute_display_string_pos, compute_display_string_end):
18222 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
18223 arrow keys.
18224 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
18225 base_level_stop; instead, set base_level_stop to BEGV.
18226 Fixes crashes in vertical-motion.
0bb23927
EZ
18227 (next_element_from_buffer): Improve commentary for when
18228 the iterator is before prev_stop.
18229 (init_iterator): Initialize bidi_p from the default value of
18230 bidi-display-reordering, not from buffer-local value. Use the
18231 buffer-local value only if initializing for buffer iteration.
18232 (handle_invisible_prop): Support invisible properties on strings
18233 that are being bidi-reordered.
18234 (set_iterator_to_next): Support bidi reordering of C strings and
18235 Lisp strings.
18236 (next_element_from_string): Support bidi reordering of Lisp
18237 strings.
18238 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
18239 (display_string): Support display of R2L glyph rows.
18240 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
18241 (init_iterator): Don't initialize it->bidi_p for strings
18242 here.
18243 (reseat_to_string): Initialize it->bidi_p for strings here.
18244 (next_element_from_string, next_element_from_c_string)
18245 (next_element_from_buffer): Add xassert's for correspondence
18246 between IT's object being iterated and it->bidi_it.string
18247 structure.
18248 (face_before_or_after_it_pos): Support bidi iteration.
18249 (next_element_from_c_string): Handle the case of the first string
18250 character that is not the first one in the visual order.
18251 (get_visually_first_element): New function, refactored from common
18252 parts of next_element_from_buffer, next_element_from_string, and
18253 next_element_from_c_string.
18254 (tool_bar_lines_needed, redisplay_tool_bar)
18255 (display_menu_bar): Force left-to-right direction. Add a FIXME
18256 comment for making that be controlled by a user option.
18257 (push_it, pop_it): Save and restore the state of the
18258 bidi iterator. Save and restore the bidi_p flag.
18259 (pop_it): Iterate out of display property for string iteration as
18260 well.
18261 (iterate_out_of_display_property): Support iteration over strings.
18262 (handle_single_display_spec): Set up it->bidi_it for iteration
18263 over a display string, and call bidi_init_it.
18264 (handle_single_display_spec, next_overlay_string)
18265 (get_overlay_strings_1, push_display_prop): Set up the bidi
18266 iterator for displaying display or overlay strings.
18267 (forward_to_next_line_start): Don't use the shortcut if
18268 bidi-iterating.
18269 (back_to_previous_visible_line_start): If handle_display_prop
18270 pushed the iterator stack, restore the internal state of the bidi
18271 iterator by calling bidi_pop_it same number of times.
18272 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18273 and we are bidi-iterating, don't decrement the iterator position;
18274 instead, set the first_elt flag in the bidi iterator, to produce
18275 the same effect.
18276 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18277 (push_display_prop): xassert that we are iterating a buffer.
18278 (push_it, pop_it): Save and restore paragraph_embedding member.
18279 (handle_single_display_spec, next_overlay_string)
18280 (get_overlay_strings_1, reseat_1, reseat_to_string)
18281 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18282 correctly. Don't assume unibyte strings are not bidi-reordered.
18283 (compute_display_string_pos)
18284 (compute_display_string_end): Fix handling the case of C string.
18285 (push_it, pop_it): Save and restore from_disp_prop_p.
18286 (handle_single_display_spec, push_display_prop): Set the
18287 from_disp_prop_p flag.
18288 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18289 (pop_it): Call iterate_out_of_display_property only if we are
18290 popping after iteration over a string that came from a display
18291 property. Fix a typo in popping stretch info. Add an assertion
18292 for verifying that the iterator position is in sync with the bidi
18293 iterator.
18294 (handle_single_display_spec, get_overlay_strings_1)
18295 (push_display_prop): Fix initialization of paragraph direction for
18296 string when that of the parent object is not yet determined.
18297 (reseat_1): Call bidi_init_it to resync the bidi
18298 iterator with IT's position. (Bug#7616)
18299 (find_row_edges): If ROW->start.pos gives position
18300 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18301 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18302 Reset the from_disp_prop_p flag.
18303 (SAVE_IT, RESTORE_IT): New macros.
18304 (pos_visible_p, face_before_or_after_it_pos)
18305 (back_to_previous_visible_line_start)
18306 (move_it_in_display_line_to, move_it_in_display_line)
18307 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18308 (try_scrolling, redisplay_window, display_line): Use them when
18309 saving a temporary copy of the iterator and restoring it back.
18310 (back_to_previous_visible_line_start, reseat_1)
18311 (init_iterator): Empty the bidi cache "stack".
18312 (move_it_in_display_line_to): If iterator ended up at
18313 EOL, but we never saw any buffer positions smaller than
18314 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18315 motion in bidi-reordered lines.
18316 (move_it_in_display_line_to): Record prev_method and prev_pos
18317 immediately before the call to set_iterator_to_next. Fixes cursor
18318 motion in bidi-reordered lines with stretch glyphs and strings
18319 displayed in margins. (Bug#8133) (Bug#8867)
18320 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18321 TO_CHARPOS.
640c8776
SM
18322 (pos_visible_p): Support positions in bidi-reordered lines.
18323 Save and restore bidi cache.
0bb23927
EZ
18324
18325 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18326 (bidi_paragraph_info): Delete unused struct.
18327 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18328 (bidi_cache_start): New variable.
18329 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18330 to zero.
18331 (bidi_cache_fetch_state, bidi_cache_search)
18332 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18333 (bidi_cache_find, bidi_peek_at_next_level)
18334 (bidi_level_of_next_char, bidi_find_other_level_edge)
18335 (bidi_move_to_visually_next): Compare cache index with
18336 bidi_cache_start rather than with zero.
18337 (bidi_fetch_char): Accept new argument STRING; all callers
18338 changed. Support iteration over a string. Support strings with
18339 display properties. Support unibyte strings. Fix the type of
18340 `len' according to what STRING_CHAR_AND_LENGTH expects.
18341 (bidi_paragraph_init, bidi_resolve_explicit_1)
18342 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
18343 (bidi_level_of_next_char, bidi_move_to_visually_next):
18344 Support iteration over a string.
0bb23927
EZ
18345 (bidi_set_sor_type, bidi_resolve_explicit_1)
18346 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18347 can now be zero (for strings); special values 0 and -1 were
18348 changed to -1 and -2, respectively.
18349 (bidi_char_at_pos): New function.
18350 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18351 Call it instead of FETCH_MULTIBYTE_CHAR.
18352 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18353 initialized to valid values.
18354 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18355 values.
18356 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18357 the test for valid cached positions. Fix the logic for looking up
18358 the sentinel state in the cache. GCPRO the Lisp string we are
18359 iterating.
18360 (bidi_push_it, bidi_pop_it): New functions.
18361 (bidi_initialize): Initialize the bidi cache start stack pointer.
18362 (bidi_cache_ensure_space): New function, refactored from part of
18363 bidi_cache_iterator_state. Don't assume the required size is just
18364 one BIDI_CACHE_CHUNK away.
18365 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18366 (bidi_count_bytes, bidi_char_at_pos): New functions.
18367 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18368 always valid if bidi_cache_idx is valid.
18369 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18370 is valid if it's going to be used.
18371 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18372 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
18373 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18374 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
18375 (bidi_find_other_level_edge, bidi_cache_start_stack):
18376 All variables related to cache indices are now EMACS_INT.
c965adc5 18377
0bb23927
EZ
18378 * dispextern.h (struct bidi_string_data): New structure.
18379 (struct bidi_it): New member `string'. Make flag members be 1-bit
18380 fields, and put them last in the struct.
640c8776
SM
18381 (compute_display_string_pos, compute_display_string_end):
18382 Update prototypes.
0bb23927
EZ
18383 (bidi_push_it, bidi_pop_it): Add prototypes.
18384 (struct iterator_stack_entry): New members bidi_p,
18385 paragraph_embedding, and from_disp_prop_p.
18386 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
18387 (bidi_shelve_cache, bidi_unshelve_cache):
18388 Declare prototypes.
0bb23927
EZ
18389
18390 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18391 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18392 and vector-like objects.
18393
18394 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18395 cache around display iteration.
18396
18397 * window.c (Fwindow_end, window_scroll_pixel_based)
18398 (displayed_window_lines, Frecenter): Save and restore the bidi
18399 cache around display iteration.
18400
3bbd2265
LMI
184012011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18402
18403 * editfns.c (Fdelete_region): Clarify the use of the named
18404 parameters (bug#6788).
18405
adc47434
MR
184062011-07-14 Martin Rudalics <rudalics@gmx.at>
18407
18408 * indent.c (Fvertical_motion): Set and restore w->pointm when
18409 saving and restoring the window's buffer (Bug#9006).
18410
837c31f8
LMI
184112011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18412
18413 * editfns.c (Fstring_to_char): Clarify just what is returned
18414 (bug#6576). Text by Eli Zaretskii.
18415
ac389d0c
JB
184162011-07-13 Juanma Barranquero <lekktu@gmail.com>
18417
18418 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18419
0be0ce47
EZ
184202011-07-13 Eli Zaretskii <eliz@gnu.org>
18421
18422 * buffer.c (mmap_find): Fix a typo.
18423
cd18e7e3
JB
184242011-07-13 Johan Bockgård <bojohan@gnu.org>
18425
18426 Fix execution of x selection hooks.
18427 * xselect.c (Qx_lost_selection_functions)
18428 (Qx_sent_selection_functions): New vars.
18429 (syms_of_xselect): DEFSYM them.
18430 (x_handle_selection_request): Pass Qx_sent_selection_functions
18431 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18432 (x_handle_selection_clear,x_clear_frame_selections):
18433 Pass Qx_lost_selection_functions rather than
18434 Vx_lost_selection_functions to Frun_hook_with_args.
18435
47ea7f44
PE
184362011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18437
ac389d0c 18438 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
18439 The old code sometimes used this field without initializing it.
18440
47ea7f44
PE
18441 * alloc.c (gc_sweep): Don't read past end of array.
18442 In theory, the old code could also have corrupted Emacs internals,
18443 though it'd be very unlikely.
18444
bc985c87
AS
184452011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18446
18447 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 18448 argument. (Bug#4026)
bc985c87 18449
0cf34688
LMI
184502011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18451
b3dadd76
LMI
18452 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18453 key" (bug#4257).
18454
0cf34688
LMI
18455 * window.c (Fset_window_start): Doc fix (bug#4199).
18456 (Fset_window_hscroll): Ditto.
18457
270768cd
PE
184582011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18459
077e3dda 18460 Fix minor new problems caught by GCC 4.6.1.
270768cd 18461 * term.c (init_tty): Remove unused local.
490011a6 18462 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 18463 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 18464 not used otherwise.
270768cd 18465
b1f58454
CY
184662011-07-12 Chong Yidong <cyd@stupidchicken.com>
18467
18468 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18469
22b9578d
LMI
184702011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18471
6e70ab07
LMI
18472 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18473 are the mini-buffer and the echo area (bug#3320).
18474
22b9578d
LMI
18475 * term.c (init_tty): Remove support for supdup, c10 and perq
18476 terminals, which are no longer supported (bug#1482).
18477
8974cc9f
JB
184782011-07-10 Johan Bockgård <bojohan@gnu.org>
18479
18480 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18481
a560d974
JD
184822011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18483
18484 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18485 for non-popups (Bug#3642).
18486
1dae0f0a
AS
184872011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18488
268c2c36 18489 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 18490 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
18491 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18492 * cm.c (losecursor): Likewise.
1dae0f0a
AS
18493 * data.c (fmod): Likewise.
18494 * dispnew.c (swap_glyphs_in_rows): Likewise.
18495 * emacs.c (memory_warning_signal): Likewise.
18496 * floatfns.c (float_error): Likewise.
18497 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18498 (otf_open, font_otf_capability, generate_otf_features)
18499 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18500 Likewise.
18501 * image.c (pbm_read_file): Likewise.
18502 * indent.c (string_display_width): Likewise.
18503 * intervals.c (check_for_interval, search_for_interval)
18504 (inc_interval_count, count_intervals, root_interval)
18505 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18506 * lread.c (defalias): Likewise.
268c2c36 18507 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
18508 * regex.c (set_image_of_range_1, set_image_of_range)
18509 (regex_grow_registers): Likewise.
18510 * sysdep.c (strerror): Likewise.
18511 * termcap.c (valid_filename_p, tprint, main): Likewise.
18512 * tparam.c (main): Likewise.
18513 * unexhp9k800.c (run_time_remap, save_data_space)
18514 (update_file_ptrs, read_header, write_header, calculate_checksum)
18515 (copy_file, copy_rest, display_header): Likewise.
18516 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18517 Likewise.
18518 * xdisp.c (check_it): Likewise.
18519 * xfaces.c (register_color, unregister_color, unregister_colors):
18520 Likewise.
18521 * xfns.c (print_fontset_result): Likewise.
18522 * xrdb.c (member, fatal, main): Likewise.
18523
99033785
PE
185242011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18525
18526 Fix minor problems found by static checking (Bug#9031).
18527 * chartab.c (char_table_set_range, map_sub_char_table):
18528 Remove unused locals.
18529 (uniprop_table): Now static.
18530 * composite.c (_work_char): Remove unused static var.
18531
9cb2ac56
JB
185322011-07-09 Juanma Barranquero <lekktu@gmail.com>
18533
18534 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18535
f25661f0
JD
185362011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18537
18538 * gtkutil.c (qttip_cb): Remove code without function.
18539
8278c4fe
EZ
185402011-07-09 Eli Zaretskii <eliz@gnu.org>
18541
18542 * w32.c (pthread_sigmask): New stub.
18543
1692ae2d 185442011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 18545
8a6ebd58 18546 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
18547 sigprocmask is portable only for single-threaded applications, and
18548 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
18549 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18550 (LIBES): Use it.
18551 * callproc.c (Fcall_process):
18552 * process.c (create_process):
18553 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18554 Use pthread_sigmask, not sigprocmask.
123403e4 18555
1b854618
JD
185562011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18557
18558 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18559 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18560 wrong (Bug#8591).
18561
3fe4b549
JD
185622011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18563
0ce7e563
JD
18564 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18565 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18566 (xg_hide_tooltip): Fix comment.
18567
3fe4b549
JD
18568 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18569 in registerServicesMenuSendTypes.
18570 (validRequestorForSendType): Don't check ns_return_types.
18571
18572 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18573 ns_return_type.
18574
5df75e47
JR
185752011-07-08 Jason Rumney <jasonr@gnu.org>
18576
22610910
JR
18577 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18578 SH_SHOW for hidden windows (Bug#5482).
18579
5df75e47
JR
18580 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18581 frame struct members of non-existent frames (Bug#6284).
18582
699c10bd
JD
185832011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18584
4393663b
JD
18585 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18586 variable firstTime not needed on OSX >= 10.6.
18587 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18588 >= 10.5. Use setKnobProportion, setDoubleValue.
18589
18590 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18591 (MAC_OS_X_VERSION_10_5): Define if not defined.
18592 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18593 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18594 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18595
18596 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 18597 cString and lossyCString on OSX >= 10.4.
4393663b 18598
58179cce 18599 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
18600 sizeToFit on OSX >= 10.2.
18601
18602 * nsimage.m (allocInitFromFile): Don't use deprecated method
18603 bestRepresentationForDevice on OSX >= 10.6.
18604
18605 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18606 to avoid warning.
18607
18608 * emacs.c: Declare unexec_init_emacs_zone.
18609
a63e0781
JD
18610 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18611
699c10bd
JD
18612 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18613
18614 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18615 on svcsMenu (Bug#8842).
18616
18617 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18618 ns_return_types.
18619 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18620
18621 * nsterm.m (QUTF8_STRING): Declare.
18622 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18623 (validRequestorForSendType): Return type is (id).
18624 Change indexOfObjectIdenticalTo to indexOfObject.
18625 Check if we have local selection before returning self (Bug#8842).
18626 (writeSelectionToPasteboard): Put local selection into paste board
18627 if we have a local selection (Bug#8842).
18628 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18629
18630 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18631 (ns_get_local_selection): Declare.
18632
54e10184
LMI
186332011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18634
9888ff71
LMI
18635 * keymap.c (describe_map_tree): Don't insert a double newline at
18636 the end of the buffer (bug#1169) and return whether we inserted
18637 something.
18638
54e10184
LMI
18639 * callint.c (Fcall_interactively): Change "reading args" to
18640 "providing args" to try to clarify what it does (bug#1010).
18641
15fa4783
KH
186422011-07-07 Kenichi Handa <handa@m17n.org>
18643
18644 * composite.c (composition_compute_stop_pos): Ignore a static
18645 composition starting before CHARPOS (Bug#8915).
18646
18647 * xdisp.c (handle_composition_prop): Likewise.
18648
a8815b00
EZ
186492011-07-07 Eli Zaretskii <eliz@gnu.org>
18650
18651 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18652 (Bug#9015)
18653
ef7b981d 186542011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
18655
18656 * character.h (unicode_category_t): New enum type.
18657
18658 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18659 (Qchar_code_property_table): New variable.
18660 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18661 (UNIPROP_COMPRESSED_FORM_P): New macros.
18662 (char_table_ascii): Uncompress the compressed values.
18663 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18664 Uncompress the compressed values.
ac389d0c 18665 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
18666 (char_table_ref_and_range): Uncompress the compressed values.
18667 (sub_char_table_set): New arg is_uniprop. Callers changed.
18668 Uncompress the compressed values.
18669 (sub_char_table_set_range): Args changed. Callers changed.
18670 (char_table_set_range): Adjuted for the above change.
18671 (map_sub_char_table): Delete args default_val and parent. Add arg
18672 top. Give decoded values to a Lisp function.
640c8776 18673 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
18674 values to a Lisp function. Gcpro more variables.
18675 (uniprop_table_uncompress)
18676 (uniprop_decode_value_run_length): New functions.
18677 (uniprop_decoder, uniprop_decoder_count): New variables.
18678 (uniprop_get_decoder, uniprop_encode_value_character)
18679 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18680 New functions.
18681 (uniprop_encoder, uniprop_encoder_count): New variables.
18682 (uniprop_get_encoder, uniprop_table)
18683 (Funicode_property_table_internal, Fget_unicode_property_internal)
18684 (Fput_unicode_property_internal): New functions.
18685 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18686 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 18687 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
18688 char-code-property-alist.
18689
640c8776 18690 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
18691 Vunicode_category_table.
18692
640c8776 18693 * font.c (font_range): Adjust for the change of
c805dec0
KH
18694 Vunicode_category_table.
18695
76b397fb
DN
186962011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18697
18698 * m/iris4d.h: Remove file, move contents ...
18699 * s/irix6-5.h: ... here.
18700
22b4128e
PE
187012011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18702
18703 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
18704 * alloc.c (mark_buffer):
18705 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18706 (clone_per_buffer_values): Don't assume that
22b4128e
PE
18707 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18708 This isn't true in general, and it's particularly not true
18709 if Emacs is configured with --with-wide-int.
18710 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18711 New macros, used in the buffer.c change.
18712
869795d6
JD
187132011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18714
18715 * xsettings.c: Use both GConf and GSettings if both are available.
18716 (store_config_changed_event): Add comment.
18717 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18718 (store_tool_bar_style_changed): New functions.
5e617bc2 18719 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
18720 (struct xsettings): Move font inside HAVE_XFT.
18721 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 18722 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 18723 Move inside HAVE_XFT.
640c8776 18724 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
18725 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18726 also.
18727 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 18728 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 18729 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
18730 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18731 (parse_settings): Move check for font inside HAVE_XFT.
18732 (read_settings, apply_xft_settings): Add comment.
18733 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18734 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18735 call store_font_name_changed.
18736 (xft_settings_event): Add comment.
18737 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18738 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18739 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18740 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18741 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
18742 (xsettings_get_system_font, xsettings_get_system_normal_font):
18743 Add comment.
869795d6 18744
d8ed26bd
PE
187452011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18746
18747 Random fixes. E.g., (random) never returned negative values.
18748 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18749 subseconds part to the entropy, as that's a bit more random.
18750 Prefer signed to unsigned, since the signedness doesn't matter and
18751 in general we prefer signed. When given a limit, use a
18752 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18753 latter isn't right if USE_2_TAGS_FOR_INTS.
18754 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18755 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18756
cabf1cac
SM
187572011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18758
18759 * textprop.c (text_property_stickiness):
18760 Obey Vtext_property_default_nonsticky.
18761 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18762 * w32fns.c (syms_of_w32fns):
18763 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18764
6e9b2be9
PE
187652011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18766
18767 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18768 This is more efficient than Ffile_directory_p and avoids a minor race.
18769
90186c68
LMI
187702011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18771
7c301272
LMI
18772 * buffer.c (Foverlay_put): Say what the return value is
18773 (bug#7835).
18774
c4f2d8d4
LMI
18775 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18776 is a directory before asking whether to use the file name
18777 (bug#7564).
ad637907
LMI
18778 (barf_or_query_if_file_exists): Make the "File is a directory"
18779 error be more correct.
c4f2d8d4 18780
90186c68
LMI
18781 * fns.c (Frequire): Remove the mention of the .gz files, since
18782 that's installation-specific, but keep the mention of
18783 `get-load-suffixes'.
18784
da64016e
PE
187852011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18786
18787 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18788 Report string overflow if the output is too long.
18789
7d47b580
JB
187902011-07-04 Juanma Barranquero <lekktu@gmail.com>
18791
a555cb87
JB
18792 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18793 (syms_of_gnutls): Remove duplicate DEFSYM for
18794 Qgnutls_bootprop_verify_hostname_error, an error for
18795 Qgnutls_bootprop_verify_error (which is no longer used).
18796
7d47b580
JB
18797 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18798 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18799 Also (re)move comments that are misplaced or no longer relevant.
18800
1e49bfab
LMI
188012011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18802
18803 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18804
1485f4c0
CY
188052011-07-03 Chong Yidong <cyd@stupidchicken.com>
18806
18807 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18808 and background color parameters if they have been changed.
18809
a9ab721e
LMI
188102011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18811
18812 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18813
cf7cff57
PE
188142011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18815
2e13213d
PE
18816 * xsettings.c (SYSTEM_FONT): Define only when used.
18817 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18818
cf7cff57
PE
18819 * keymap.c (access_keymap_1): Now static.
18820
7a8e04f7
CY
188212011-07-02 Chong Yidong <cyd@stupidchicken.com>
18822
18823 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18824 leave any prefix arg for the up event (Bug#1586).
18825
61352f62
LMI
188262011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18827
69bb1ef7
LMI
18828 * lread.c (syms_of_lread): Mention single symbols defined by
18829 `defvar' or `defconst' (bug#7154).
18830
61352f62 18831 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 18832 (Frequire): Mention get-load-suffixes.
61352f62 18833
28545e04
MR
188342011-07-02 Martin Rudalics <rudalics@gmx.at>
18835
18836 * window.h (window): Remove clone_number slot.
18837 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18838 Remove.
18839 (make_parent_window, make_window, saved_window)
18840 (Fset_window_configuration, save_window_save): Don't deal with
18841 clone numbers.
18842 * buffer.c (Qclone_number): Remove declaration.
18843 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18844
3349e122
SM
188452011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18846
18847 Add multiple inheritance to keymaps.
18848 * keymap.c (Fmake_composed_keymap): New function.
18849 (Fset_keymap_parent): Simplify.
18850 (fix_submap_inheritance): Remove.
18851 (access_keymap_1): New function extracted from access_keymap to handle
18852 embedded parents and handle lists of maps.
18853 (access_keymap): Use it.
18854 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18855 (Fcopy_keymap): Handle embedded parents.
18856 (Fcommand_remapping, define_as_prefix): Simplify.
18857 (Fkey_binding): Simplify.
18858 (syms_of_keymap): Move minibuffer-local-completion-map,
18859 minibuffer-local-filename-completion-map,
18860 minibuffer-local-must-match-map, and
18861 minibuffer-local-filename-must-match-map to Elisp.
18862 (syms_of_keymap): Defsubr make-composed-keymap.
18863 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18864 (parse_menu_item): Trivial simplification.
18865
3279eb87
GM
188662011-07-01 Glenn Morris <rgm@gnu.org>
18867
18868 * Makefile.in (SETTINGS_LIBS): Fix typo.
18869
39cb9e56 188702011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
18871
18872 * coding.c (Fencode_coding_string): Record the last coding system
18873 used, as the function doc string says (bug#8738).
18874
0949d2b6
JD
188752011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18876
18877 * xsettings.c (store_monospaced_changed): Take new font as arg and
18878 check for change against current_mono_font.
18879 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18880 (emacs_settings_constructor, emacs_settings_get_property)
18881 (emacs_settings_set_property, emacs_settings_class_init)
18882 (emacs_settings_init, gsettings_obj): Remove.
18883 (something_changedCB): New function for HAVE_GSETTINGS.
18884 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18885 with value as argument.
18886 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18887 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 18888 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
18889 "changed".
18890
18891 * xgselect.c: Add defined (HAVE_GSETTINGS).
18892 (xgselect_initialize): Ditto.
18893
18894 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18895 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18896 xg_select.
18897
bbc6b304
PE
188982011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18899
18900 * eval.c (struct backtrace): Simplify and port the data structure.
18901 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18902 signed bit field, as this assumption is not portable and it makes
18903 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18904 "char debug_on_exit : 1" as this is not portable either; instead,
18905 use the portable "unsigned int debug_on_exit : 1". Remove unused
18906 member evalargs. Remove obsolete comments about cc bombing out.
18907
9851bfc5
JD
189082011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18909
51bb811f 18910 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
18911 Let HAVE_GSETTINGS override HAVE_GCONF.
18912 (store_monospaced_changed): New function.
18913 (EMACS_SETTINGS): A new type derived from GObject to handle
18914 GSettings notifications.
18915 (emacs_settings_constructor, emacs_settings_get_property)
18916 (emacs_settings_set_property, emacs_settings_class_init):
18917 New functions.
18918 (gsettings_client, gsettings_obj): New variables.
18919 (GSETTINGS_SCHEMA): New define.
18920 (something_changedCB): Call store_monospaced_changed.
18921 (init_gsettings): New function.
18922 (xsettings_initialize): Call init_gsettings.
18923 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18924 to NULL.
18925
640c8776 18926 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
18927 GCONF_CFLAGS/LIBS.
18928
5386012d
MR
189292011-06-29 Martin Rudalics <rudalics@gmx.at>
18930
18931 * window.c (resize_root_window, grow_mini_window)
18932 (shrink_mini_window): Rename Qresize_root_window to
18933 Qwindow_resize_root_window and Qresize_root_window_vertically to
18934 Qwindow_resize_root_window_vertically.
18935
f13e0b08
PE
189362011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18937
18938 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18939
94515237
JB
189402011-06-27 Juanma Barranquero <lekktu@gmail.com>
18941
18942 * makefile.w32-in: Redesign dependencies so they reflect more
18943 clearly which files are directly included by each source file,
18944 and not through other includes.
18945
e43b6e43
MR
189462011-06-27 Martin Rudalics <rudalics@gmx.at>
18947
18948 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18949 (sort_overlays, overlay_strings): When an overlay's clone number
18950 matches the window's clone number process the overlay even if
18951 the overlay's window property doesn't match the current window.
18952
d68443dc
MR
18953 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18954 (Fwindow_hchild): Rename to Fwindow_left_child.
18955 (Fwindow_next): Rename to Fwindow_next_sibling.
18956 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
18957 (resize_window_check): Rename to window_resize_check.
18958 (resize_window_apply): Rename to window_resize_apply.
18959 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18960 (Fdelete_other_windows_internal, resize_frame_windows)
18961 (Fsplit_window_internal, Fdelete_window_internal)
18962 (grow_mini_window, shrink_mini_window)
18963 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 18964
c7e73be5
JD
189652011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18966
18967 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18968 (emacs_fixed_set_min_size): Remove.
18969 (emacs_fixed_new): Take frame as argument.
18970
18971 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18972 (_EmacsFixedPrivate): Remove minwidth/height.
18973 Add struct frame *f.
18974 (emacs_fixed_init): Initialize priv->f.
18975 (get_parent_class, emacs_fixed_set_min_size): Remove.
18976 (emacs_fixed_new): Set priv->f to argument.
18977 (emacs_fixed_get_preferred_width)
18978 (emacs_fixed_get_preferred_height): Use min_width/height from
18979 frames size_hint to set minimum and natural (Bug#8919).
18980 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18981 and use min_width/height from frames size_hint to set
18982 min_width/height (Bug#8919).
18983
18984 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
18985 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18986 Fix indentation.
c7e73be5 18987
cf99dcf8
EZ
189882011-06-26 Eli Zaretskii <eliz@gnu.org>
18989
18990 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18991 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18992 called at ZV.
18993
029529ac
CY
189942011-06-26 Chong Yidong <cyd@stupidchicken.com>
18995
18996 * process.c (wait_reading_process_output): Bypass select if
18997 waiting for a cell while ignoring keyboard input, and input is
18998 pending. Suggested by Jan Djärv (Bug#8869).
18999
7a7ef429
PE
190002011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19001
19002 Use gnulib's dup2 module instead of rolling our own.
19003 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19004
11fdef7d 190052011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
19006
19007 * dispnew.c (scrolling_window): Before scrolling, turn off a
19008 mouse-highlight in the window being scrolled.
19009
cd3520a4
JB
190102011-06-24 Juanma Barranquero <lekktu@gmail.com>
19011
19012 Move DEFSYM to lisp.h and use everywhere.
19013
19014 * character.h (DEFSYM): Move declaration...
19015 * lisp.h (DEFSYM): ...here.
19016
19017 * gnutls.c:
19018 * minibuf.c:
19019 * w32menu.c:
19020 * w32proc.c:
19021 * w32select.c: Don't include character.h.
19022
19023 * alloc.c (syms_of_alloc):
19024 * buffer.c (syms_of_buffer):
19025 * bytecode.c (syms_of_bytecode):
19026 * callint.c (syms_of_callint):
19027 * casefiddle.c (syms_of_casefiddle):
19028 * casetab.c (init_casetab_once):
19029 * category.c (init_category_once, syms_of_category):
19030 * ccl.c (syms_of_ccl):
19031 * cmds.c (syms_of_cmds):
19032 * composite.c (syms_of_composite):
19033 * dbusbind.c (syms_of_dbusbind):
19034 * dired.c (syms_of_dired):
19035 * dispnew.c (syms_of_display):
19036 * doc.c (syms_of_doc):
19037 * editfns.c (syms_of_editfns):
19038 * emacs.c (syms_of_emacs):
19039 * eval.c (syms_of_eval):
19040 * fileio.c (syms_of_fileio):
19041 * fns.c (syms_of_fns):
19042 * frame.c (syms_of_frame):
19043 * fringe.c (syms_of_fringe):
19044 * insdel.c (syms_of_insdel):
19045 * keymap.c (syms_of_keymap):
19046 * lread.c (init_obarray, syms_of_lread):
19047 * macros.c (syms_of_macros):
19048 * msdos.c (syms_of_msdos):
19049 * print.c (syms_of_print):
19050 * process.c (syms_of_process):
19051 * search.c (syms_of_search):
19052 * sound.c (syms_of_sound):
19053 * syntax.c (init_syntax_once, syms_of_syntax):
19054 * terminal.c (syms_of_terminal):
19055 * textprop.c (syms_of_textprop):
19056 * undo.c (syms_of_undo):
19057 * w32.c (globals_of_w32):
19058 * window.c (syms_of_window):
19059 * xdisp.c (syms_of_xdisp):
19060 * xfaces.c (syms_of_xfaces):
19061 * xfns.c (syms_of_xfns):
19062 * xmenu.c (syms_of_xmenu):
19063 * xsettings.c (syms_of_xsettings):
19064 * xterm.c (syms_of_xterm): Use DEFSYM.
19065
4228cf16
TZ
190662011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19067
cd3520a4 19068 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 19069
7fcccf1e
PE
190702011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19071
7efb4e0e
PE
19072 Integer and buffer overflow fixes (Bug#8873).
19073
ff5844ad
PE
19074 * print.c (printchar, strout): Check for string overflow.
19075 (PRINTPREPARE, printchar, strout):
19076 Don't set size unless allocation succeeds.
19077
90532f02
PE
19078 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19079 for sizes. Check for string overflow more accurately.
19080 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19081
6d84508d
PE
19082 * macros.c: Integer and buffer overflow fixes.
19083 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19084 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19085 Use ptrdiff_t, not int, for sizes.
19086 Don't increment bufsize until after realloc succeeds.
19087 Check for size-calculation overflow.
19088 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19089
437b2cb4
PE
19090 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19091
8b9ac8b4
PE
19092 * lread.c: Integer overflow fixes.
19093 (read_integer): Radix is now EMACS_INT, not int,
19094 to improve quality of diagnostics for out-of-range radices.
19095 Calculate buffer size correctly for out-of-range radices.
19096 (read1): Check for integer overflow in radices, and in
19097 read-circle numbers.
82cb60d3
PE
19098 (read_escape): Avoid int overflow.
19099 (Fload, openp, read_buffer_size, read1)
19100 (substitute_object_recurse, read_vector, read_list, map_obarray):
19101 Use ptrdiff_t, not int, for sizes.
19102 (read1): Use EMACS_INT, not int, for sizes.
20270765 19103 Check for size overflow.
8b9ac8b4 19104
7fcccf1e
PE
19105 * image.c (cache_image): Check for size arithmetic overflow.
19106
bfbbd7e7
PE
19107 * lread.c: Integer overflow issues.
19108 (saved_doc_string_size, saved_doc_string_length)
19109 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19110 Now ptrdiff_t, not int.
19111 (read1): Don't assume doc string length fits in int. Check for
19112 out-of-range doc string lengths.
19113 (read_list): Don't assume file position fits in int.
39019e54 19114 (read_escape): Check for hex character overflow.
bfbbd7e7 19115
4e323265
LL
191162011-06-22 Leo Liu <sdl.web@gmail.com>
19117
19118 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19119 Move to minibuffer.el.
19120
85fece3e
PE
191212011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19122
20b84ce9 19123 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
19124 The following patches are for when GLYPH_DEBUG && !XASSERT.
19125 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19126 * dispnew.c (flush_stdout):
19127 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19128 Mark as externally visible.
19129 * dispnew.c (check_window_matrix_pointers): Now static.
19130 * dispnew.c (window_to_frame_vpos):
19131 * xfns.c (unwind_create_frame):
19132 * xterm.c (x_check_font): Remove unused local.
19133 * scroll.c (CHECK_BOUNDS):
19134 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19135 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19136 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19137 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19138 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19139 Now static.
19140 (debug_method_add): Use va_list and vsprintf rather than relying
19141 on undefined behavior with wrong number of arguments.
19142 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19143 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19144 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19145 since we're not interested in debugging glyphs with old libraries.
19146 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19147 GCC 4.6.0's static checking.
19148
0766b489
PE
191492011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19150
31fd4b32
PE
19151 Integer overflow and signedness fixes (Bug#8873).
19152 A few related buffer overrun fixes, too.
19153
b79e8648
PE
19154 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19155
0766b489
PE
19156 * dispextern.h (struct face.stipple):
19157 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19158 (x_bitmap_mask, x_allocate_bitmap_record)
19159 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19160 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19161 (x_create_bitmap_from_xpm_data):
19162 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19163 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19164 (.bitmaps_last):
19165 * xfaces.c (load_pixmap):
19166 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19167 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19168 (.bitmaps_last, struct x_output.icon_bitmap):
19169 Use ptrdiff_t, not int, for bitmap indexes.
19170 (x_allocate_bitmap_record): Check for size overflow.
19171 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19172
b081724f
PE
19173 Use ptrdiff_t, not int, for overlay counts.
19174 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19175 * editfns.c (overlays_around, get_pos_property):
19176 * textprop.c (get_char_property_and_overlay):
19177 * xdisp.c (next_overlay_change, note_mouse_highlight):
19178 * xfaces.c (face_at_buffer_position):
21514da7
PE
19179 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19180 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19181 (Fnext_overlay_change, Fprevious_overlay_change)
19182 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 19183 Use ptrdiff_t, not int, for sizes.
21514da7 19184 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 19185
3de73e5e
PE
19186 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19187
2606c57b
PE
19188 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19189 (x_session_initialize): Do not assume string length fits in int.
19190
aaafe47a
PE
19191 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19192 This is unlikely, but can occur if DPI is outlandish.
19193
2674ddc8 19194 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
19195 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19196
28154962
PE
19197 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19198 * xrdb.c (magic_file_p, search_magic_path):
19199 Omit last arg SUFFIX; it was always 0. All callers changed.
19200 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19201
7de51af5
PE
19202 * xfont.c (xfont_match): Avoid need for strlen.
19203
25ed6cc3
PE
19204 * xfns.c: Don't assume strlen fits in int.
19205 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19206
4eab31dd
PE
19207 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19208 not unsigned long, as we prefer signed integers. All callers changed.
19209 Detect integer overflow in repeat count.
19210 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 19211 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 19212
171e2a58
PE
19213 * termcap.c: Don't assume sizes fit in int and never overflow.
19214 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19215 (gobble_line): Check for size-calculation overflow.
19216
ad39faca 19217 * minibuf.c (Fread_buffer):
6e5bb2dc 19218 * lread.c (intern, intern_c_string):
74ca2eb3
PE
19219 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19220 Don't assume string length fits in int.
19221
52c61c22 19222 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
19223 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19224
b5b8c9e5
PE
19225 * font.c: Don't assume string length fits in int.
19226 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19227 Use ptrdiff_t, not int.
ccd6111c
PE
19228 (font_intern_prop): Don't assume string length fits in int.
19229 Don't assume integer property fits in fixnum.
19230 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 19231
882f0d81 19232 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 19233 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
19234 Reformulate so as not to need the command string.
19235 Invoke gzip -cd rather than gunzip, as it's more portable.
19236 (lock_info_type, lock_file_1, lock_file):
19237 Don't assume pid_t and time_t fit in unsigned long.
19238 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19239 (current_lock_owner): Prefer signed type for sizes.
19240 Use memcpy, not strncpy, where memcpy is what is really wanted.
19241 Don't assume (via atoi) that time_t and pid_t fit in int.
19242 Check for time_t and/or pid_t out of range, e.g., via a network share.
19243 Don't alloca where an auto var works fine.
19244
93f4cf88
PE
19245 * fileio.c: Fix some integer overflow issues.
19246 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19247 Don't assume string length fits in int.
19248 (directory_file_name): Don't assume string length fits in long.
19249 (make_temp_name): Don't assume pid fits in int, or that its print
19250 length is less than 20.
19251
f3e92b69
PE
19252 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19253
1bfdaf10
PE
19254 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19255
35016e9a
PE
19256 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19257
3d1e65a1
PE
19258 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19259 We prefer signed integers, even for size calculations.
19260
0b963a93
PE
19261 * emacs.c: Don't assume string length fits in 'int'.
19262 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19263 (main): Don't invoke strlen when not needed.
19264
573f4b54
PE
19265 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19266 (XD_DEBUG_MESSAGE): Don't waste a byte.
19267
989f33ba
PE
19268 * callproc.c (getenv_internal_1, getenv_internal)
19269 (Fgetenv_internal):
965d34eb
PE
19270 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19271
e4d29b33
PE
19272 * lread.c (invalid_syntax): Omit length argument.
19273 All uses changed. This doesn't fix a bug, but it simplifies the
19274 code away from its former Hollerith-constant appearance, and it's
19275 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 19276 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 19277
eb49b136
PE
19278 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19279 This didn't break anything, but it didn't help either.
19280 It's confusing to put a bogus integer in a place where the actual
19281 value does not matter.
9f62aeb1 19282 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 19283 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 19284
15375a22
PE
19285 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19286 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19287 implementation.
b61cc01c
PE
19288 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19289 We prefer signed types, and the value cannot exceed the EMACS_INT
19290 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
19291 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19292 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19293 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 19294
53b2623d
PE
19295 * indent.c (sane_tab_width): New function.
19296 (current_column, scan_for_column, Findent_to, position_indentation)
19297 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 19298 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 19299
51cab52b 19300 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 19301
f2ed8a70
PE
19302 * lisp.h (lint_assume): New macro.
19303 * composite.c (composition_gstring_put_cache):
19304 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19305
abe80cc6
PE
19306 * editfns.c, insdel.c:
19307 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 19308
b02c740e
PE
19309 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19310
ebc96716
PE
19311 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19312
b4e50fa0 19313 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 19314 Use much-faster test for byte-length change.
311d5d7c 19315 Don't assume string byte-length fits in 'int'.
a4cf38e4 19316 Check that character arg fits in 'int'.
85461888 19317 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 19318
c0c1ee9f
PE
19319 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19320
a498d7f4
PE
19321 * fns.c (concat): Catch string overflow earlier.
19322 Do not rely on integer wraparound.
19323
51cab52b
PE
19324 * dispextern.h (struct it.overlay_strings_charpos)
19325 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
19326 * xdisp.c (forward_to_next_line_start)
19327 (back_to_previous_visible_line_start)
19328 (reseat_at_next_visible_line_start, next_element_from_buffer):
19329 Don't arbitrarily truncate the value of 'selective' to int.
19330
76031fad
PE
19331 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19332
5eb55db9
PE
19333 * composite.c: Don't truncate sizes to 'int'.
19334 (composition_gstring_p, composition_reseat_it)
19335 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
19336 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19337 not EMACS_UINT, for indexes.
5eb55db9 19338
0703a717
PE
19339 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19340
d6202519
PE
19341 * buffer.c: Include <verify.h>.
19342 (struct sortvec.priority, struct sortstr.priority):
8961a454 19343 Now EMACS_INT, not int.
c20998a7 19344 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
19345 (struct sortstr.size, record_overlay_string)
19346 (struct sortstrlist.size, struct sortlist.used):
19347 Don't truncate size to int.
19348 (record_overlay_string): Check for size-calculation overflow.
d6202519 19349 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 19350
d5a19415
JM
193512011-06-22 Jim Meyering <meyering@redhat.com>
19352
029529ac 19353 Don't leak an XBM-image-sized buffer
d5a19415
JM
19354 * image.c (xbm_load): Free the image buffer after using it.
19355
a9041e6c
PE
193562011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19357
19358 Port to Sun C.
19359 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19360 that Sun C diagnosed.
19361 * fns.c (secure_hash): Fix pointer signedness issue.
19362 * intervals.c (static_offset_intervals): New function.
19363 (offset_intervals): Use it.
19364
7f3f739f
LL
193652011-06-21 Leo Liu <sdl.web@gmail.com>
19366
19367 * deps.mk (fns.o):
19368 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19369 sha512.h.
19370
19371 * fns.c (secure_hash): Rename from crypto_hash_function and change
19372 the first arg to accept symbols.
5b66d427 19373 (Fsecure_hash): New primitive.
7f3f739f
LL
19374 (syms_of_fns): New symbols.
19375
76147d94
DD
193762011-06-20 Deniz Dogan <deniz@dogan.se>
19377
19378 * process.c (Fset_process_buffer): Clarify return value in
19379 docstring.
19380
7d7d0045
CY
193812011-06-18 Chong Yidong <cyd@stupidchicken.com>
19382
19383 * dispnew.c (add_window_display_history): Use BVAR.
19384
19385 * xdisp.c (debug_method_add): Use BVAR.
19386 (check_window_end, dump_glyph_matrix, dump_glyph)
19387 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19388
19389 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19390 Likewise.
19391
19392 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19393 check till after the cache is created in init_frame_faces.
19394
ff2bc410
SM
193952011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19396
19397 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19398
28177add
PE
193992011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19400
dd3482fe
PE
19401 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19402 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19403 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19404
393d71f3 19405 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
19406 * fileio.c (Finsert_file_contents):
19407 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19408 Remove the old (too-loose) buffer overflow checks.
19409 They weren't needed, since make_gap checks for buffer overflow.
19410 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19411 The old code merely checked for Emacs fixnum overflow, and relied
19412 on undefined (wraparound) behavior. The new code avoids undefined
19413 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19414
2e6813b0 19415 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
19416 Tune. Don't use wider integers than needed. Don't use alloca.
19417 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 19418
599a9e4f
PE
19419 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19420
99561444
PE
19421 * insdel.c, lisp.h (buffer_overflow): New function.
19422 (insert_from_buffer_1, replace_range, replace_range_2):
19423 * insdel.c (make_gap_larger):
19424 * editfns.c (Finsert_char):
19425 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19426
28177add
PE
19427 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19428
e69dafad
PE
194292011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19430
4baa020d 19431 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 19432
b1c46f02
PE
19433 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19434 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19435
e69dafad
PE
19436 * fileio.c: Don't assume EMACS_INT fits in off_t.
19437 (emacs_lseek): New static function.
19438 (Finsert_file_contents, Fwrite_region): Use it.
19439 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19440
566684ea
PE
19441 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19442
e6966cd6
PE
19443 * fns.c: Don't overflow int when computing a list length.
19444 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19445 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19446 truncation on 64-bit hosts. Check for QUIT every
19447 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19448 faster and is responsive enough.
19449 (Flength): Report an error instead of overflowing an integer.
19450 (Fsafe_length): Return a float if the value is not representable
19451 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 19452 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 19453 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 19454
dd0b0efb
PE
19455 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19456 (header_size, word_size): New constants.
19457 (allocate_vectorlike): Don't check size overflow here.
19458 (allocate_vector): Check it here instead, since this is the only
19459 caller of allocate_vectorlike that could cause overflow.
19460 Check that the new vector's length is representable as a fixnum.
19461
86fe5cfe
PE
19462 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19463 The previous code was bogus. For example, next_almost_prime (32)
19464 returned 39, which is undesirable as it is a multiple of 3; and
19465 next_almost_prime (24) returned 25, which is a multiple of 5 so
19466 why was the code bothering to check for multiples of 7?
19467
80e88859
PE
19468 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19469
4a2f0ad6
PE
19470 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19471
f66c7cf8
PE
19472 Variadic C functions now count arguments with ptrdiff_t.
19473 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19474 Back then I didn't know that the Emacs coding style prefers signed int.
19475 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
19476 were being counted with int, which may truncate counts on 64-bit
19477 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
19478 * lisp.h (struct Lisp_Subr.function.aMANY)
19479 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19480 Arg counts are now ptrdiff_t, not size_t.
19481 All variadic functions and their callers changed accordingly.
19482 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19483 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19484 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19485 * callint.c (Fcall_interactively): Check arg count for overflow,
19486 to avoid potential buffer overrun. Use signed char, not 'int',
19487 for 'varies' array, so that we needn't bother to check its size
19488 calculation for overflow.
19489 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19490 * eval.c (apply_lambda):
19491 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19492 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19493 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19494
a1759b76
PE
19495 * callint.c (Fcall_interactively): Don't use index var as event count.
19496
d96be9fc
PE
19497 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19498 * mem-limits.h (SIZE): Remove; no longer used.
19499
a690a978 19500 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 19501
578c21e6
PE
19502 Remove unnecessary casts.
19503 * xterm.c (x_term_init):
19504 * xfns.c (x_set_border_pixel):
19505 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19506 These aren't needed now that we assume ANSI C.
19507
96f53c6c
PE
19508 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19509 It's more likely to cause problems (due to unsigned overflow)
19510 than to cure them.
19511
83c77d31
PE
19512 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19513
ee2079f1
PE
19514 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19515
6da65536
PE
19516 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19517
7147c4a4
PE
19518 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19519
193e32d9
PE
19520 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19521
e5533da6
PE
19522 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19523
9910e595
PE
19524 GLYPH_CODE_FACE returns EMACS_INT, not int.
19525 * dispextern.h (merge_faces):
19526 * xfaces.c (merge_faces):
01103c44
PE
19527 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19528 Don't assume EMACS_INT fits in int.
9910e595 19529
2638320e
PE
19530 * character.h (CHAR_VALID_P): Remove unused parameter.
19531 * fontset.c, lisp.h, xdisp.c: All uses changed.
19532
045eb8d9
PE
19533 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19534
c1f134b5
PE
19535 * fns.c (concat): Minor tuning based on overflow analysis.
19536 This doesn't fix any bugs. Use int to hold character, instead
19537 of constantly refetching from Emacs object. Use XFASTINT, not
19538 XINT, for value known to be a character. Don't bother comparing
19539 a single byte to 0400, as it's always less.
19540
395fcb93 19541 * floatfns.c (Fexpt):
327eeec8
PE
19542 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19543
abbd3d23
PE
19544 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19545 for characters.
19546
684a03ef
PE
19547 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19548
0fed43f3
PE
19549 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19550 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19551 incorrectly succeed when S was a string, because 4294967386 was
19552 truncated before it was used.
19553
8fd02eb7
PE
19554 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19555 Otherwise, an out-of-range integer could cause undefined behavior
19556 on a 64-bit host.
19557
f8c86b69
PE
19558 * composite.c: Use int, not EMACS_INT, for characters.
19559 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19560 EMACS_INT, for values that are known to be in character range.
19561 This doesn't fix any bugs but is the usual style inside Emacs and
19562 may generate better code on 32-bit machines.
19563
34206dd2
PE
19564 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19565 This is for reasons similar to the recent CHAR_STRING fix.
19566 * charset.c (Fencode_char): Check that character arg is actually
19567 a character. Pass an int to ENCODE_CHAR.
19568 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19569 wider than 'int', as a compile-time check to prevent future regressions
19570 in this area.
19571
c5958d4c 19572 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
19573
19574 Make sure a 64-bit char is never passed to CHAR_STRING.
19575 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19576 by silently ignoring the top 32 bits, allowing some values
19577 that were far too large to be valid characters.
19578 * character.h: Include <verify.h>.
19579 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19580 arguments are no wider than unsigned, as a compile-time check
19581 to prevent future regressions in this area.
19582 * data.c (Faset):
01103c44 19583 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
19584 (Fsubst_char_in_region):
19585 * fns.c (concat):
19586 * xdisp.c (decode_mode_spec_coding):
19587 Adjust to CHAR_STRING's new requirement.
19588 * editfns.c (Finsert_char, Fsubst_char_in_region):
19589 * fns.c (concat): Check that character args are actually
19590 characters. Without this test, these functions did the wrong
19591 thing with wildly out-of-range values on 64-bit hosts.
19592
d37ca623
PE
19593 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19594 These casts should not be needed on 32-bit hosts, either.
19595 * keyboard.c (read_char):
19596 * lread.c (Fload): Remove casts to unsigned.
19597
ea204efb
PE
19598 * lisp.h (UNSIGNED_CMP): New macro.
19599 This fixes comparison bugs on 64-bit hosts.
19600 (ASCII_CHAR_P): Use it.
19601 * casefiddle.c (casify_object):
01103c44 19602 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
19603 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19604 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19605 * dispextern.h (FACE_FROM_ID):
19606 * keyboard.c (read_char): Use UNSIGNED_CMP.
19607
41cb286c
PE
19608 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19609 not to EMACS_INT, to avoid GCC warning.
19610
4a1b9832
PE
19611 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19612
55daad71
PE
19613 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19614 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19615 isn't needed on 32-bit machines.
8f95c75c 19616
01103c44
PE
19617 * buffer.c (Fgenerate_new_buffer_name):
19618 Use EMACS_INT for count, not int.
0ceccced 19619 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
19620
19621 * data.c (Qcompiled_function): Now static.
19622
c6f072e7
PE
19623 * window.c (window_body_lines): Now static.
19624
20ce5912
PE
19625 * image.c (gif_load): Rename local to avoid shadowing.
19626
9c4c5f81
PE
19627 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19628 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19629 * alloc.c (make_save_value): Integer argument is now of type
19630 ptrdiff_t, not int.
19631 (mark_object): Use ptrdiff_t, not int.
19632 * lisp.h (pD): New macro.
19633 * print.c (print_object): Use it.
19634
c0c5c8ae
PE
19635 * alloc.c: Use EMACS_INT, not int, to count objects.
19636 (total_conses, total_markers, total_symbols, total_vector_size)
19637 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
19638 (total_free_floats, total_floats, total_free_intervals)
19639 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
19640 Now EMACS_INT, not int. All uses changed.
19641 (Fgarbage_collect): Compute overall total using a double, so that
19642 integer overflow is less likely to be a problem. Check for overflow
19643 when converting back to an integer.
5a25e253
PE
19644 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19645 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19646 These were 'int' variables that could overflow on 64-bit hosts;
19647 they were never used, so remove them instead of repairing them.
211a0b2a 19648 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
19649 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19650 Previously, this ceilinged at INT_MAX, but that doesn't work on
19651 64-bit machines.
e46bb31a 19652 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 19653
c78baabf 19654 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 19655 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
19656 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19657 when a (possibly-narrower) signed value would do just as well.
19658 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 19659
c9d624c6
PE
19660 * alloc.c: Catch some string size overflows that we were missing.
19661 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19662 for convenience in STRING_BYTES_MAX.
19663 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19664 The definition here is exact; the one in lisp.h was approximate.
19665 (allocate_string_data): Check for string overflow. This catches
19666 some instances we weren't catching before. Also, it catches
19667 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19668 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19669 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 19670
c9d624c6
PE
19671 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19672 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 19673 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 19674
353032ce
PE
19675 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19676
2bccce07
PE
19677 * alloc.c (Fmake_string): Check for out-of-range init.
19678
0ac30604
SM
196792011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19680
19681 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19682
c195f2de
JD
196832011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19684
19685 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19686 xg_get_default_scrollbar_width.
19687
19688 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19689 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19690 (style_changed_cb): Call update_theme_scrollbar_width and call
19691 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19692 all frames (Bug#8505).
19693 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19694 Call gtk_window_set_resizable if HAVE_GTK3.
19695 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19696 and height if HAVE_GTK3 (Bug#8505).
19697 (scroll_bar_width_for_theme): New variable.
19698 (update_theme_scrollbar_width): New function.
19699 (xg_get_default_scrollbar_width): Move code to
19700 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19701 (xg_initialize): Call update_theme_scrollbar_width.
19702
19703 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19704
19705 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19706
e10ac9f1
MR
197072011-06-12 Martin Rudalics <rudalics@gmx.at>
19708
19709 * frame.c (make_frame): Call other_buffer_safely instead of
19710 other_buffer.
19711
19712 * window.c (temp_output_buffer_show): Call display_buffer with
19713 second argument Vtemp_buffer_show_specifiers and reset latter
19714 immediately after the call.
19715 (Vtemp_buffer_show_specifiers): New variable.
19716 (auto_window_vscroll_p, next_screen_context_lines)
19717 (Vscroll_preserve_screen_position): Remove leading asterisks from
19718 doc-strings.
19719
2d3c217e 197202011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 19721
7b7f97e8 19722 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
19723 * buffer.c (Qclone_number): Remove for now, as it's unused.
19724 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19725 (record_buffer): Remove unused local.
19726 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19727 (set_frame_buffer_list): Remove; unused.
19728 * frame.h (other_visible_frames): Remove decl.
19729 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19730 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19731 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19732 if HAVE_GPM.
19733 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19734 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19735 Define only if HAVE_GPM.
19736 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19737 (update_hints_inhibit): Remove; never set. All uses removed.
19738 * widgetprv.h (emacsFrameClassRec): Remove decl.
19739 * window.c (delete_deletable_window): Now returns void, since it
19740 wasn't returning anything.
19741 (compare_window_configurations): Remove unused locals.
19742 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19743 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
19744 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19745 the same widths as pointers. This follows up on the 2011-05-06 patch.
19746 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19747 * xterm.h: Likewise.
19748 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19749
1384b89e
JB
197502011-06-12 Juanma Barranquero <lekktu@gmail.com>
19751
19752 * makefile.w32-in: Update dependencies.
19753 (LISP_H): Add lib/intprops.h.
19754
1100a63c
CY
197552011-06-11 Chong Yidong <cyd@stupidchicken.com>
19756
19757 * image.c (gif_load): Add animation frame delay to the metadata.
19758 (syms_of_image): Use DEFSYM. New symbol `delay'.
19759
6198ccd0
MR
197602011-06-11 Martin Rudalics <rudalics@gmx.at>
19761
19762 * window.c (delete_deletable_window): Re-add.
19763 (Fset_window_configuration): Rewrite to handle dead buffers and
19764 consequently deletable windows.
19765 (window_tree, Fwindow_tree): Remove. Supply functionality in
19766 window.el.
19767 (compare_window_configurations): Simplify code.
19768
b6e3633c
AS
197692011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19770
1ab0dee5
AS
19771 * image.c (imagemagick_load_image): Fix type mismatch.
19772 (Fimagemagick_types): Likewise.
19773
b6e3633c
AS
19774 * window.h (replace_buffer_in_windows): Declare.
19775
9397e56f
MR
197762011-06-11 Martin Rudalics <rudalics@gmx.at>
19777
19778 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19779 Qclone_number. Remove external declaration of Qdelete_window.
19780 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19781 code.
640c8776
SM
19782 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19783 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
19784 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19785 buffer list implementation.
19786 (other_buffer_safely): New function.
19787 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19788 calls to replace_buffer_in_windows and
19789 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19790 if allowed.
19791 (record_buffer): Inhibit quitting and rewrite using quittable
19792 functions. Run Qbuffer_list_update_hook if allowed.
19793 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
19794 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19795 Move switch-to-buffer to window.el.
9397e56f
MR
19796 (bury-buffer): Move to window.el.
19797 (Vbuffer_list_update_hook): New variable.
19798
19799 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19800 section.
19801
19802 * window.h (resize_frame_windows): Move up in code.
19803 (Fwindow_frame): Remove EXFUN.
19804 (replace_buffer_in_all_windows): Remove prototype.
19805 (replace_buffer_in_windows_safely): Add prototype.
19806
19807 * window.c: Declare Qdelete_window static again. Move down
19808 declaration of select_count.
19809 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19810 (Fother_window): Move to window.el.
19811 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19812 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19813 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19814 window.el.
19815 (replace_buffer_in_windows): Implement by calling
19816 Qreplace_buffer_in_windows.
19817 (replace_buffer_in_all_windows): Remove with some functionality
19818 moved into replace_buffer_in_windows_safely.
19819 (replace_buffer_in_windows_safely): New function.
19820 (select_window_norecord, select_frame_norecord): Move in front
19821 of run_window_configuration_change_hook. Remove now obsolete
19822 declarations.
640c8776
SM
19823 (Fset_window_buffer): Rewrite doc-string.
19824 Call Qrecord_window_buffer.
9397e56f
MR
19825 (keys_of_window): Move binding for other-window to window.el.
19826
b50691aa
CY
198272011-06-11 Chong Yidong <cyd@stupidchicken.com>
19828
19829 * dispextern.h (struct image): Replace data member, whose int_val
19830 and ptr_val fields were not used by anything, with a single
19831 lisp_val object.
19832
19833 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19834 (gif_clear_image, gif_load, imagemagick_load_image)
19835 (gs_clear_image, gs_load): Callers changed.
19836
3f754b86
PE
198372011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19838
cca69397
PE
19839 * buffer.h: Include <time.h>, for time_t.
19840 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19841
109e28d0
PE
19842 Fix minor problems found by static checking.
19843
60737f02
PE
19844 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19845
4b66faf3
PE
19846 Make identifiers static if they are not used in other modules.
19847 * data.c (Qcompiled_function, Qframe, Qvector):
19848 * image.c (QimageMagick, Qsvg):
19849 * minibuf.c (Qmetadata):
19850 * window.c (resize_window_check, resize_root_window): Now static.
19851 * window.h (resize_window_check, resize_root_window): Remove decls.
19852
109e28d0
PE
19853 * window.c (window_deletion_count, delete_deletable_window):
19854 Remove; unused.
46a4ce9e
PE
19855 (window_body_lines): Now static.
19856 (Fdelete_other_windows_internal): Mark vars as initialized.
19857 Make sure 'resize_failed' is initialized.
19858 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19859 (resize_window_apply): Remove unused local.
19860 * window.h (delete_deletable_window): Remove decl.
19861
109e28d0 19862 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
19863 (imagemagick_load_image): Fix pointer signedness problem by changing
19864 last arg from unsigned char * to char *. All uses changed.
19865 Also, fix a local for similar reasons.
19866 Remove unused locals. Remove locals to avoid shadowing.
19867 (fn_rsvg_handle_free): Remove; unused.
19868 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 19869 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 19870
3f754b86
PE
19871 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19872
2547adb1
CY
198732011-06-10 Chong Yidong <cyd@stupidchicken.com>
19874
19875 * image.c (gif_load): Fix omitted cast error introduced by
19876 2011-06-06 change.
19877
2c8e37d4
MR
198782011-06-10 Martin Rudalics <rudalics@gmx.at>
19879
19880 * window.h (resize_proportionally, orig_total_lines)
19881 (orig_top_line): Remove from window structure.
19882 (set_window_height, set_window_width, change_window_heights)
19883 (Fdelete_window): Remove prototypes.
19884 (resize_frame_windows): Remove duplicate declaration.
19885
440a42e3
EZ
198862011-06-10 Eli Zaretskii <eliz@gnu.org>
19887
19888 * window.h (resize_frame_windows, resize_window_check)
19889 (delete_deletable_window, resize_root_window)
19890 (resize_frame_windows): Declare prototypes.
19891
19892 * window.c (resize_window_apply): Make definition be "static" to
19893 match the prototype.
19894
562dd5e9
MR
198952011-06-10 Martin Rudalics <rudalics@gmx.at>
19896
19897 * window.c: Remove declarations of Qwindow_size_fixed,
19898 window_min_size_1, window_min_size_2, window_min_size,
19899 size_window, window_fixed_size_p, enlarge_window, delete_window.
19900 Remove static from declaration of Qdelete_window, it's
19901 temporarily needed by Fbury_buffer.
19902 (replace_window): Don't assign orig_top_line and
19903 orig_total_lines.
19904 (Fdelete_window, delete_window): Remove. Window deletion is
19905 handled by window.el.
640c8776
SM
19906 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19907 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
19908 (Fdelete_other_windows): Remove. Deleting other windows is
19909 handled by window.el.
19910 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19911 handled in window.el.
19912 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19913 Window minimum sizes are handled in window.el.
19914 (shrink_windows, size_window, set_window_height)
19915 (set_window_width, change_window_heights, window_height)
19916 (window_width, CURBEG, CURSIZE, enlarge_window)
19917 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19918 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19919 handled in window.el.
19920 (make_dummy_parent): Rename to make_parent_window and give it a
19921 second argument horflag.
19922 (make_window): Don't set resize_proportionally any more.
19923 (Fsplit_window): Remove. Windows are split in window.el.
19924 (save_restore_action, save_restore_orig_size)
19925 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19926 Resize mini windows in window.el.
19927 (grow_mini_window, shrink_mini_window): Implement by calling
19928 Qresize_root_window_vertically, resize_window_check and
19929 resize_window_apply.
640c8776
SM
19930 (saved_window, Fset_window_configuration, save_window_save):
19931 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
19932 resize_proportionally.
19933 (window_min_height, window_min_width): Move to window.el.
19934 (keys_of_window): Move bindings for delete-other-windows,
19935 split-window, delete-window and enlarge-window to window.el.
19936
19937 * buffer.c: Temporarily extern Qdelete_window.
19938 (Fbury_buffer): Temporarily call Qdelete_window instead of
19939 Fdelete_window (Fbury_buffer will move to window.el soon).
19940
19941 * frame.c (set_menu_bar_lines_1): Remove code handling
19942 orig_top_line and orig_total_lines.
19943
19944 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19945 set_window_height but set heights directly.
19946 (change_frame_size_1): Use resize_frame_windows.
19947
19948 * xdisp.c (init_xdisp): Don't use set_window_height but set
19949 heights directly.
19950
640c8776
SM
19951 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19952 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
19953 run_window_configuration_change_hook.
19954
19955 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19956 instead of change_window_heights and run
19957 run_window_configuration_change_hook.
19958
1a13852e
MR
199592011-06-09 Martin Rudalics <rudalics@gmx.at>
19960
19961 * window.c (replace_window): Rename second argument REPLACEMENT to
19962 NEW. New third argument SETFLAG. Rewrite.
19963 (delete_window, make_dummy_parent): Call replace_window with
19964 third argument 1.
19965 (window_list_1): Move down in code.
19966 (run_window_configuration_change_hook): Move set_buffer part
19967 before select_frame_norecord part in order to unwind correctly.
19968 Rename count1 to count.
19969 (recombine_windows, delete_deletable_window, resize_root_window)
19970 (Fdelete_other_windows_internal)
19971 (Frun_window_configuration_change_hook, make_parent_window)
19972 (resize_window_check, resize_window_apply, Fresize_window_apply)
19973 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
19974 (Fdelete_window_internal, Fresize_mini_window_internal):
19975 New functions.
1a13852e
MR
19976 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19977
f3d1777e
MR
199782011-06-08 Martin Rudalics <rudalics@gmx.at>
19979
496e208e
MR
19980 * window.h (window): Add some new members to window structure -
19981 normal_lines, normal_cols, new_total, new_normal, clone_number,
19982 splits, nest, prev_buffers, next_buffers.
19983 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 19984 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 19985
f3d1777e
MR
19986 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19987 Remove.
496e208e
MR
19988 (make_dummy_parent): Set new members of windows structure.
19989 (make_window): Move down in code. Handle new members of window
19990 structure.
19991 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19992 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19993 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19994 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
19995 (Fset_window_next_buffers, Fset_window_clone_number):
19996 New functions.
496e208e
MR
19997 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19998 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19999 Doc-string fixes.
20000 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20001 Argument WINDOW can be now internal window too.
20002 (Fwindow_use_time): Move up in code.
20003 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20004 Rewrite doc-string.
20005 (Fset_window_configuration, saved_window)
20006 (Fcurrent_window_configuration, save_window_save): Handle new
20007 members of window structure.
b9e809c2
MR
20008 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20009 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20010 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20011 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20012 Qget_mru_window, Qresize_root_window,
20013 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20014 Qauto_buffer_name; staticpro them.
f3d1777e 20015
abde8f8c
MR
200162011-06-07 Martin Rudalics <rudalics@gmx.at>
20017
20018 * window.c (Fwindow_total_size, Fwindow_left_column)
20019 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20020 (Fwindow_list_1): New functions.
20021 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
20022 (Fwindow_width, Fscroll_left, Fscroll_right):
20023 Use window_body_cols instead of window_box_text_cols.
20024 (delete_window, Fset_window_configuration):
20025 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
20026 (delete_all_subwindows): Take a window as argument and not a
20027 structure. Rewrite.
190b47e6
MR
20028 (window_loop): Remove handling of GET_LRU_WINDOW and
20029 GET_LARGEST_WINDOW.
20030 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
20031
20032 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
20033 window_box_text_cols. delete_all_subwindows now takes a
20034 Lisp_Object as argument.
abde8f8c 20035
640c8776
SM
20036 * indent.c (compute_motion, Fcompute_motion):
20037 Use window_body_cols instead of window_box_text_cols.
abde8f8c 20038
fa8a67e6
MR
20039 * frame.c (delete_frame): Call delete_all_subwindows with root
20040 window as argument.
20041
a54e3482
DC
200422011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20043
20044 * fns.c (Fputhash): Document return value.
20045
60002bf5
CY
200462011-06-06 Chong Yidong <cyd@stupidchicken.com>
20047
20048 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20049
0c671da6 200502011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 20051
b862a52a 20052 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 20053
be44ca6c
PE
20054 Check for overflow when converting integer to cons and back.
20055 * charset.c (Fdefine_charset_internal, Fdecode_char):
20056 Use cons_to_unsigned to catch overflow.
20057 (Fencode_char): Use INTEGER_TO_CONS.
20058 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20059 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20060 * data.c (long_to_cons, cons_to_long): Remove.
20061 (cons_to_unsigned, cons_to_signed): New functions.
20062 These signal an error for invalid or out-of-range values.
20063 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20064 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20065 * font.c (Ffont_variation_glyphs):
20066 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20067 * lisp.h: Include <intprops.h>.
20068 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20069 (cons_to_signed, cons_to_unsigned): New decls.
20070 (long_to_cons, cons_to_long): Remove decls.
20071 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20072 (Fprimitive_undo): Use CONS_TO_INTEGER.
20073 * xfns.c (Fx_window_property): Likewise.
20074 * xselect.c: Include <limits.h>.
20075 (x_own_selection, selection_data_to_lisp_data):
20076 Use INTEGER_TO_CONS.
20077 (x_handle_selection_request, x_handle_selection_clear)
20078 (x_get_foreign_selection, Fx_disown_selection_internal)
20079 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20080 (lisp_data_to_selection_data): Use cons_to_unsigned.
20081 (x_fill_property_data): Use cons_to_signed.
20082 Report values out of range.
20083
d1f3d2af
PE
20084 Check for buffer and string overflow more precisely.
20085 * buffer.h (BUF_BYTES_MAX): New macro.
20086 * lisp.h (STRING_BYTES_MAX): New macro.
20087 * alloc.c (Fmake_string):
20088 * character.c (string_escape_byte8):
20089 * coding.c (coding_alloc_by_realloc):
20090 * doprnt.c (doprnt):
20091 * editfns.c (Fformat):
20092 * eval.c (verror):
20093 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20094 since they may not be the same number.
20095 * editfns.c (Finsert_char):
20096 * fileio.c (Finsert_file_contents):
20097 Likewise for BUF_BYTES_MAX.
20098
dd52fcea
PE
20099 * image.c: Use ptrdiff_t, not int, for sizes.
20100 (slurp_file): Switch from int to ptrdiff_t.
20101 All uses changed.
20102 (slurp_file): Check that file size fits in both size_t (for
20103 malloc) and ptrdiff_t (for sanity and safety).
20104
7f9bbdbb
PE
20105 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20106 if b->modtime has its maximal value.
20107
dfe18f82
PE
20108 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20109
84acfcf0
PE
20110 Don't assume time_t can fit into int.
20111 * buffer.h (struct buffer.modtime): Now time_t, not int.
20112 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20113 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20114
ccd9a01a
PE
20115 Minor fixes for signed vs unsigned integers.
20116 * character.h (MAYBE_UNIFY_CHAR):
20117 * charset.c (maybe_unify_char):
20118 * keyboard.c (read_char, reorder_modifiers):
20119 XINT -> XFASTINT, since the integer must be nonnegative.
20120 * ftfont.c (ftfont_spec_pattern):
20121 * keymap.c (access_keymap, silly_event_symbol_error):
20122 XUINT -> XFASTINT, since the integer must be nonnegative.
20123 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20124 since it makes no difference and we prefer signed.
20125 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20126 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20127 nonnegative.
20128
d6d100dd
SM
201292011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20130
20131 * window.h (Fwindow_frame): Declare.
20132
2b6148e4
PE
201332011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20134
20135 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20136 (SPARE_MEMORY): Always define.
20137 (LARGE_REQUEST): Remove.
20138 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20139
f230ecc9
MR
201402011-06-06 Martin Rudalics <rudalics@gmx.at>
20141
727e958e
MR
20142 * lisp.h: Move EXFUNS for Fframe_root_window,
20143 Fframe_first_window and Fset_frame_selected_window to window.h.
20144
20145 * window.h: Move EXFUNS for Fframe_root_window,
20146 Fframe_first_window and Fset_frame_selected_window here from
20147 lisp.h.
20148
20149 * frame.c (Fwindow_frame, Fframe_first_window)
20150 (Fframe_root_window, Fframe_selected_window)
20151 (Fset_frame_selected_window): Move to window.c.
20152 (Factive_minibuffer_window): Move to minibuf.c.
20153 (Fother_visible_frames_p): New function.
20154
20155 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20156
f230ecc9
MR
20157 * window.c (decode_window, decode_any_window): Move up in code.
20158 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20159 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
20160 (Fwindow_buffer): Move up and rewrite doc-string.
20161 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20162 (Fwindow_prev): New functions.
727e958e
MR
20163 (Fwindow_frame): Move here from frame.c. Accept any window as
20164 argument.
20165 (Fframe_root_window, Fframe_first_window)
20166 (Fframe_selected_window): Move here from frame.c. Accept frame
20167 or arbitrary window as argument. Update doc-strings.
20168 (Fminibuffer_window): Move up in code.
20169 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
20170 (Fset_frame_selected_window): Move here from frame.c.
20171 Marginal rewrite.
727e958e
MR
20172 (Fselected_window, select_window, Fselect_window): Move up in
20173 code. Minor doc-string fixes.
f230ecc9 20174
4d09bcf6
PE
201752011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20176
20177 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20178 Do not assume that spare memory exists; that assumption is valid
20179 only if SYSTEM_MALLOC.
20180 (LARGE_REQUEST): New macro, so that the issue of large requests
20181 is separated from the issue of spare memory.
20182
810928a2
AS
201832011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20184
172418ad
AS
20185 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20186 format. (Bug#8806)
20187
43f862f7
AS
20188 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20189
810928a2
AS
20190 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20191 before statements.
20192
a059fe24
JD
201932011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20194
20195 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20196
20197 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20198
20199 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20200 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20201
989bf368
JB
202022011-06-05 Juanma Barranquero <lekktu@gmail.com>
20203
20204 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20205
4b80f674
CY
202062011-06-04 Chong Yidong <cyd@stupidchicken.com>
20207
20208 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20209 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
20210 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20211 New error handlers.
4b80f674
CY
20212 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20213 Obey Vx_select_enable_clipboard_manager. Catch errors in
20214 x_clipboard_manager_save (Bug#8779).
20215 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 20216 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 20217
99a33b77 202182011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
20219
20220 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20221
99a33b77 202222011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
20223
20224 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20225 in the current matrix if keep_current_p is non-zero.
20226
8264569d
EZ
202272011-06-04 Eli Zaretskii <eliz@gnu.org>
20228
20229 * bidi.c (bidi_level_of_next_char): Fix last change.
20230
57f97249
EZ
202312011-06-03 Eli Zaretskii <eliz@gnu.org>
20232
fec2107c 20233 Support bidi reordering of text covered by display properties.
57f97249 20234
fec2107c
EZ
20235 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20236 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20237 (bidi_cache_search, bidi_cache_iterator_state)
20238 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
20239 (bidi_level_of_next_char, bidi_move_to_visually_next):
20240 Support character positions inside a run of characters covered by a
fec2107c
EZ
20241 display string.
20242 (bidi_paragraph_init, bidi_resolve_explicit_1)
20243 (bidi_level_of_next_char): Call bidi_fetch_char and
20244 bidi_fetch_char_advance instead of FETCH_CHAR and
20245 FETCH_CHAR_ADVANCE.
20246 (bidi_init_it): Initialize new members.
20247 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20248 definitions.
20249 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20250 instead of using explicit *_CHAR codes.
d6d100dd
SM
20251 (bidi_resolve_explicit, bidi_resolve_weak):
20252 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
20253 bidirectional text is supported only in multibyte buffers.
20254 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20255 it to initialize the frame_window_p member of struct bidi_it.
20256 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20257 (bidi_resolve_explicit, bidi_resolve_weak)
20258 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20259 bidi_it->nchars is non-positive.
20260 (bidi_level_of_next_char): Don't try to lookup the cache for the
20261 next/previous character if nothing is cached there yet, or if we
20262 were just reseat()'ed to a new position.
c40e2fb2 20263
0e14fe90
EZ
20264 * xdisp.c (set_cursor_from_row): Set start and stop points
20265 according to the row's direction when priming the loop that looks
20266 for the glyph on which to display cursor.
20267 (single_display_spec_intangible_p): Function deleted.
20268 (display_prop_intangible_p): Reimplement to call
20269 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
20270 Accept 3 additional arguments needed by handle_display_spec.
20271 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
20272 values: lists, `(when COND...)' forms, etc.
20273 (single_display_spec_string_p): Support property values that are
20274 lists with the argument STRING its top-level element.
20275 (display_prop_string_p): Fix the condition for processing a
20276 property that is a list to be consistent with handle_display_spec.
fec2107c 20277 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
20278 last portion of handle_display_prop.
20279 (compute_display_string_pos): Accept additional argument
20280 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20281 value of a `display' property is a "replacing spec".
20282 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20283 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20284 the display property, but just return a value indicating whether
20285 the display property will replace the characters it covers.
20286 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20287 frame_window_p members of struct bidi_it.
d6d100dd
SM
20288 (compute_display_string_pos, compute_display_string_end):
20289 New functions.
fec2107c
EZ
20290 (push_it): Accept second argument POSITION, where pop_it should
20291 jump to continue iteration.
20292 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 20293
fec2107c
EZ
20294 * keyboard.c (adjust_point_for_property): Adjust the call to
20295 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
20296
20297 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
20298 (bidi_init_it): Update prototypes.
20299 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
20300 (compute_display_string_pos, compute_display_string_end):
20301 Declare prototypes.
fec2107c
EZ
20302 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20303 EMACS_INT.
fc6f18ce 20304
40087514 203052011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 20306
57f53182
PE
20307 Malloc failure behavior now depends on size of allocation.
20308 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20309 * lisp.h: Change signatures accordingly.
20310 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20311 All callers changed. (Bug#8762)
20312
20313 * gnutls.c: Use Emacs's memory allocators.
20314 Without this change, the gnutls library would invoke malloc etc.
20315 directly, which causes problems on non-SYNC_INPUT hosts, and which
20316 runs afoul of improving memory_full behavior. (Bug#8761)
20317 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20318 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20319 xfree instead of the default malloc, realloc, free.
20320 (Fgnutls_boot): No need to check for memory allocation failure,
20321 since xmalloc does that for us.
20322
ac32cd99 20323 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
20324 * category.c (hash_get_category_set):
20325 * ccl.c (ccl_driver):
20326 * charset.c (Fdefine_charset_internal):
20327 * charset.h (struct charset.hash_index):
20328 * composite.c (get_composition_id, gstring_lookup_cache)
20329 (composition_gstring_put_cache):
20330 * composite.h (struct composition.hash_index):
20331 * dispextern.h (struct image.hash):
20332 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20333 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20334 (hashfn_equal, hashfn_user_defined, make_hash_table)
20335 (maybe_resize_hash_table, hash_lookup, hash_put)
20336 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20337 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20338 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20339 * image.c (make_image, search_image_cache, lookup_image)
20340 (xpm_put_color_table_h):
20341 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 20342 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 20343 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 20344 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
20345 * alloc.c (allocate_vectorlike):
20346 Check for overflow in vector size calculations.
20347 * ccl.c (ccl_driver):
20348 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
20349 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20350 need to be updated by these changes.
40087514
PE
20351 * fns.c (make_hash_table, maybe_resize_hash_table):
20352 Check for integer overflow with large hash tables.
0de4bb68
PE
20353 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20354 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20355 (SXHASH_REDUCE): New macro.
20356 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20357 Use it instead of discarding useful hash info with large hash values.
20358 (sxhash_float): New function.
20359 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20360 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
20361 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20362 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
20363 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20364 Adjust signatures to match updated version of code.
20365 (consing_since_gc): Now EMACS_INT, since a single hash table can
20366 use more than INT_MAX bytes.
20367
698d32e2
DN
203682011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20369
20370 Make it possible to build with GCC-4.6+ -O2 -flto.
20371
20372 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20373
fd6fa53f
SM
203742011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20375
20376 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20377 Call minibuffer-inactive-mode.
20378
864db017
JB
203792011-05-31 Juanma Barranquero <lekktu@gmail.com>
20380
20381 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20382 Update dependencies.
20383
2ad0baf4
DN
203842011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20385
20386 * data.c (init_data): Remove code for UTS, this system is not
20387 supported anymore.
20388
4fcc2638
DN
203892011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20390
20391 Don't force ./temacs to start in terminal mode.
20392
20393 * frame.c (make_initial_frame): Initialize faces in all cases, not
20394 only when CANNOT_DUMP is defined.
20395 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20396
c56e0fd5
DN
203972011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20398
20399 * dispnew.c (add_window_display_history): Use const for the string
20400 pointer. Remove declaration, not needed.
20401
333d54da 204022011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 20403
55d4c1b2 20404 Use 'inline', not 'INLINE'.
333d54da 20405 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
20406 * alloc.c, fontset.c (INLINE): Remove.
20407 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20408 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20409 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20410 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20411 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20412
738db178
DN
204132011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20414
20415 Make it possible to run ./temacs.
20416
20417 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20418 syms_of_callproc does the same thing. Remove test for
20419 "initialized", do it in the caller.
20420 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20421
620c53a6
SM
204222011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20423
20424 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20425 (read_minibuf): Use get_minibuffer.
20426 (syms_of_minibuf): Use DEFSYM.
20427 (Qmetadata): New var.
20428 * data.c (Qbuffer): Don't make it static.
20429 (syms_of_data): Use DEFSYM.
20430
e003a292
PE
204312011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20432
20433 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20434 (CCL_CODE_MIN): New macro.
20435
ed008a6d
PE
204362011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20437
3687c2ef
PE
20438 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20439
ed008a6d
PE
20440 * eval.c (Qdebug): Now static.
20441 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20442 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20443 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20444
d66c4c7c
CY
204452011-05-29 Chong Yidong <cyd@stupidchicken.com>
20446
20447 * image.c: Various fixes to ImageMagick code comments.
20448 (Fimagemagick_types): Doc fix.
20449
5fbc2025
PE
204502011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20451
0196f88a
PE
20452 Minor fixes prompted by GCC 4.6.0 warnings.
20453
20454 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20455
5fbc2025
PE
20456 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20457 (x_clipboard_manager_save_all): Move extern decl to ...
20458 * xterm.h: ... here, so that it can be checked for consistency.
20459
1dd3c2d9
CY
204602011-05-29 Chong Yidong <cyd@stupidchicken.com>
20461
20462 * xselect.c (x_clipboard_manager_save_frame)
20463 (x_clipboard_manager_save_all): New functions.
20464 (Fx_clipboard_manager_save): Lisp function deleted.
20465
20466 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20467 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20468
20469 * xterm.h: Update prototype.
20470
5ba6571d
WX
204712011-05-28 William Xu <william.xwl@gmail.com>
20472
20473 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20474 exiting (Bug#8239).
20475
3eaff834
JM
204762011-05-28 Jim Meyering <meyering@redhat.com>
20477
e1900994 20478 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
20479 * fns.c (to_uchar): Define.
20480 (crypto_hash_function): Use it to convert some newly-signed
20481 variables to unsigned, to avoid sign-extension bugs. For example,
20482 without this change, (md5 "truc") would evaluate to
20483 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20484 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 20485 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 20486
0f6990a7
PE
204872011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20488
20489 Integer overflow fixes.
c8a9ca5a 20490
08686060
PE
20491 * dbusbind.c: Serial number integer overflow fixes.
20492 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
20493 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20494 to hold a serial number that is too large for a fixnum.
20495 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20496 Check for serial numbers out of range. Decode any serial number
59568bf0 20497 that was so large that it became a float. (Bug#8722)
08686060 20498
2d1fc3c7
PE
20499 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20500 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20501 Use XFASTINT rather than XUINT when numbers are nonnegative.
20502 (xd_append_arg, Fdbus_method_return_internal):
20503 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20504 arguments, check that Lisp number is nonnegative, rather than
59568bf0 20505 silently wrapping negative numbers around. (Bug#8722)
30217ff0 20506 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 20507 (Bug#8722)
2d1fc3c7 20508
c8a9ca5a
PE
20509 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20510
519e1d69
PE
20511 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20512
6df6ae42 20513 ccl: Add integer overflow checks.
30569699
PE
20514 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20515 (IN_INT_RANGE): New macros.
20516 (ccl_driver): Use them to check for integer overflow when
20517 decoding a CCL program. Many of the new checks are whether XINT (x)
20518 fits in int; it doesn't always, on 64-bit hosts. The new version
20519 doesn't catch all possible integer overflows, but it's an
847044ea 20520 improvement. (Bug#8719)
30569699 20521
c11285dc
PE
20522 * alloc.c (make_event_array): Use XINT, not XUINT.
20523 There's no need for unsigned here.
20524
fdccd48e
PE
20525 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20526 This follows up to the 2011-05-06 change that substituted uintptr_t
20527 for EMACS_INT. This case wasn't caught back then.
20528
37910ab2
PE
20529 Rework Fformat to avoid integer overflow issues.
20530 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20531 now (part of C89). Include <verify.h>.
20532 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20533 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20534 (Fformat): Avoid the prepass trying to compute sizes; it was only
20535 approximate and thus did not catch overflow reliably. Instead, walk
20536 through the format just once, formatting and computing sizes as we go,
20537 checking for integer overflow at every step, and allocating a larger
20538 buffer as needed. Keep track separately whether the format is
20539 multibyte. Keep only the most-recently calculated precision, rather
20540 than them all. Record whether each argument has been converted to
20541 string. Use EMACS_INT, not int, for byte and char and arg counts.
20542 Support field widths and precisions larger than INT_MAX. Avoid
20543 sprintf's undefined behavior with conversion specifications such as %#d
20544 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20545 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20546 formatting out-of-range floating point numbers with int
9173deec 20547 formats. (Bug#8668)
37910ab2 20548
2e6578fb
PE
20549 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20550
0ae6bdee
PE
20551 * data.c: Avoid integer truncation in expressions involving floats.
20552 * data.c: Include <intprops.h>.
20553 (arith_driver): When there's an integer overflow in an expression
20554 involving floating point, convert the integers to floating point
20555 so that the resulting value does not suffer from catastrophic
20556 integer truncation. For example, on a 64-bit host (* 4
20557 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20558 Do not rely on undefined behavior after integer overflow.
20559
de883a70
PE
20560 merge count_size_as_multibyte, parse_str_to_multibyte
20561 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 20562 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
20563 Check for integer overflow.
20564 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20565 since it's now a duplicate of the other. This is more of
20566 a character than a buffer op, so better that it's in character.c.
20567 * fns.c, print.c: Adjust to above changes.
20568
2ff916cb
PE
205692011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20570
20571 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20572
f1b54466
PE
205732011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20574
fb1ac845
PE
20575 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20576 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20577 (x_clipboard_manager_save): Now static.
20578 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20579
f1b54466
PE
20580 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20581 (crypto_hash_function): Now static.
20582 Fix pointer signedness problems. Avoid unnecessary initializations.
20583
a9f737ee
CY
205842011-05-27 Chong Yidong <cyd@stupidchicken.com>
20585
20586 * termhooks.h (Vselection_alist): Make it terminal-local.
20587
20588 * terminal.c (create_terminal): Initialize it.
20589
20590 * xselect.c: Support for clipboard managers.
20591 (Vselection_alist): Move to termhooks.h as terminal-local var.
20592 (LOCAL_SELECTION): New macro.
20593 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20594 (symbol_to_x_atom): Remove gratuitous arg.
20595 (x_handle_selection_request, lisp_data_to_selection_data)
20596 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
20597 (x_own_selection, x_get_local_selection, x_convert_selection):
20598 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
20599 (some_frame_on_display): Delete unused function.
20600 (Fx_own_selection_internal, Fx_get_selection_internal)
20601 (Fx_disown_selection_internal, Fx_selection_owner_p)
20602 (Fx_selection_exists_p): New optional frame arg.
20603 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20604 (x_handle_selection_clear): Don't treat other terminals with the
20605 same keyboard specially. Use the terminal-local Vselection_alist.
20606 (x_clear_frame_selections): Use Frun_hook_with_args.
20607
20608 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20609
20610 * xterm.h: Add support for those atoms.
20611
e067f0c1
CY
206122011-05-26 Chong Yidong <cyd@stupidchicken.com>
20613
20614 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20615 (converted_selections, conversion_fail_tag): New global variables.
20616 (x_selection_request_lisp_error): Free the above.
20617 (x_get_local_selection): Remove unnecessary code.
20618 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
20619 of converted selections stored in converted_selections.
20620 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
20621 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20622 (x_convert_selection): New function.
20623 (x_handle_selection_event): Simplify.
20624 (x_get_foreign_selection): Don't ignore incoming requests while
20625 waiting for an answer; this will fail when we implement
20626 SAVE_TARGETS, and seems unnecessary anyway.
20627 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20628 (Vx_sent_selection_functions): Doc fix.
20629
0f4aebc0
LL
206302011-05-26 Leo Liu <sdl.web@gmail.com>
20631
20632 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20633
e61124cd
YM
206342011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20635
20636 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20637
20638 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20639 for fringe update if it has periodic bitmap.
ac389d0c 20640 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
20641 and fringe_bitmap_periodic_p.
20642
20643 * fringe.c (get_fringe_bitmap_data): New function.
20644 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20645 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20646 row. Mark glyph row for fringe update if periodicity changed.
20647
20648 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20649 for fringe update unless it has periodic bitmap.
20650
f16d9837
KH
206512011-05-25 Kenichi Handa <handa@m17n.org>
20652
20653 * xdisp.c (get_next_display_element): Set correct it->face_id for
20654 a static composition.
20655
e1b90ef6
LL
206562011-05-24 Leo Liu <sdl.web@gmail.com>
20657
20658 * deps.mk (fns.o):
20659 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20660
20661 * fns.c (crypto_hash_function, Fsha1): New function.
20662 (Fmd5): Use crypto_hash_function.
20663 (syms_of_fns): Add Ssha1.
20664
7400048f
PE
206652011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20666
20667 * gnutls.c: Remove unused macros.
20668 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20669 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20670 Remove macros that are defined and never used.
20671 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20672
abb71cf4
CY
206732011-05-22 Chong Yidong <cyd@stupidchicken.com>
20674
20675 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20676 (Fx_get_selection_internal): Minor cleanup.
20677 (Fx_own_selection_internal): Rename arguments for consistency with
20678 select.el.
20679
6307db39
PE
206802011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20681
20682 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20683
f3d4e0a4
CY
206842011-05-22 Chong Yidong <cyd@stupidchicken.com>
20685
20686 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20687
4d8ade89
YM
206882011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20689
20690 * dispnew.c (scrolling_window): Don't exclude the case that the
20691 last enabled row in the desired matrix touches the bottom boundary.
20692
32078c8d
GM
206932011-05-21 Glenn Morris <rgm@gnu.org>
20694
20695 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
20696 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20697 and add some more files.
32078c8d 20698
7285dc67
EZ
206992011-05-20 Eli Zaretskii <eliz@gnu.org>
20700
20701 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20702 report_file_error introduced by the change from 2011-05-07.
20703
89d1bd22
PE
207042011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20705
20706 * systime.h (Time): Define only if emacs is defined.
20707 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20708 where the include path doesn't have X11/X.h by default. See
20709 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20710
cd394be1 207112011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
20712
20713 * composite.c (find_automatic_composition): Fix previous change.
20714
b9704ad9
GM
207152011-05-20 Glenn Morris <rgm@gnu.org>
20716
20717 * lisp.mk: New file, split from Makefile.in.
20718 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20719 (shortlisp): Remove.
20720 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20721
4a720484
GM
207222011-05-19 Glenn Morris <rgm@gnu.org>
20723
20724 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20725 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20726 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20727 (lisp): Set the order to that of loadup.el.
20728 (shortlisp): Make it a copy of $lisp.
20729 (SOME_MACHINE_LISP): Remove.
20730 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20731 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20732
a28d4396
KH
207332011-05-18 Kenichi Handa <handa@m17n.org>
20734
20735 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20736 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20737 (find_automatic_composition): Mostly rewrite for efficiency.
20738
a2b1fa8e
JB
207392011-05-18 Juanma Barranquero <lekktu@gmail.com>
20740
20741 * makefile.w32-in: Update dependencies.
20742
8e1f5610
CS
207432011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20744
20745 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 20746 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 20747
7025ee00 207482011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 20749
cdfa6eab
PE
20750 Fix some integer overflow issues, such as string length overflow.
20751
06d6db33
PE
20752 * insdel.c (count_size_as_multibyte): Check for string overflow.
20753
2b4560a8
PE
20754 * character.c (lisp_string_width): Check for string overflow.
20755 Use EMACS_INT, not int, for string indexes and lengths; in
20756 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20757 the resulting string length overflows an EMACS_INT; instead,
20758 report a string overflow if no precision given. When checking for
20759 precision exhaustion, use a check that cannot possibly have
20760 integer overflow. (Bug#8675)
20761 * character.h (lisp_string_width): Adjust to new signature.
20762
cb93f9be
PE
20763 * alloc.c (string_overflow): New function.
20764 (Fmake_string): Use it. This doesn't change behavior, but saves
20765 a few bytes and will simplify future changes.
20766 * character.c (string_escape_byte8): Likewise.
20767 * lisp.h (string_overflow): New decl.
20768
1a1f3366
PE
20769 Fixups, following up to the user-interface timestamp change.
20770 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20771 for UI timestamps, instead of unsigned long.
9fbd6841
PE
20772 * msdos.c (mouse_get_pos): Likewise.
20773 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
20774 * w32gui.h (Time): Define by including "systime.h" rather than by
20775 declaring it ourselves. (Bug#8664)
20776
d4e3e4d3
PE
20777 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20778 * image.c (clear_image_cache): Likewise.
20779
f6a24d19
PE
20780 * term.c (term_mouse_position): Don't assume time_t wraparound.
20781
08dc5ae6
PE
20782 Be more systematic about user-interface timestamps.
20783 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
20784 and sometimes 'EMACS_UINT', to represent these timestamps.
20785 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
20786 This makes the code easier to follow, and makes it easier to catch
20787 integer overflow bugs such as Bug#8664.
20788 * frame.c (Fmouse_position, Fmouse_pixel_position):
20789 Use Time, not unsigned long, for user-interface timestamps.
20790 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20791 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20792 * keyboard.h (last_event_timestamp): Likewise.
20793 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20794 * menu.h (xmenu_show): Likewise.
20795 * term.c (term_mouse_position): Likewise.
20796 * termhooks.h (struct input_event.timestamp): Likewise.
20797 (struct terminal.mouse_position_hook): Likewise.
20798 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20799 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20800 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20801 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20802 what it was before.
20803 * menu.h, termhooks.h: Include "systime.h", for Time.
20804
8e55734a
PE
20805 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20806 Don't assume that the difference between two unsigned long values
20807 can fit into an integer. At this point, we know button_down_time
20808 <= event->timestamp, so the difference must be nonnegative, so
20809 there's no need to cast the result if double-click-time is
20810 nonnegative, as it should be; check that it's nonnegative, just in
20811 case. This bug is triggered when events are more than 2**31 ms
86db42d2 20812 apart (about 25 days). (Bug#8664)
8e55734a 20813
841f1b75 20814 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 20815 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 20816
3e26f69c
PE
20817 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20818 that always fit in int. Use a sentinel instead of a counter, to
20819 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
20820 * frame.h (struct frame): Use int for menu_bar_items_used
20821 instead of EMACS_INT, since it always fits in int.
3e26f69c 20822
5cc152c0
PE
20823 * menu.c (grow_menu_items): Check for int overflow.
20824
d89eb65e
PE
20825 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20826
5235bd3e
PE
20827 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20828 Before, the code was not consistent. These values cannot exceed
20829 2**31 - 1 so there's no need to make them unsigned.
20830 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20831 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20832 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20833 as modifiers.
20834 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20835
bc827e23
PE
20836 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20837 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20838 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20839 presumably because the widths might not match.
20840
78eb494e
PE
20841 * window.c (size_window): Avoid needless test at loop start.
20842
04f2d78b
CB
208432011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20844
20845 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20846
d2fc7e3d 208472011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
20848
20849 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20850
d2fc7e3d 208512011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
20852
20853 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20854 `width' to `bar_area_x' and `bar_area_width', respectively.
20855 (x_scroll_run): Take account of fringe background extension.
20856
04f2d78b
CB
20857 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20858 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
20859 `bar_area_width', respectively.
20860 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20861 background extension.
20862
79b70037
GM
208632011-05-10 Jim Meyering <meyering@redhat.com>
20864
20865 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20866
2f142cc5
JB
208672011-05-10 Juanma Barranquero <lekktu@gmail.com>
20868
20869 * image.c (Finit_image_library): Return t for built-in image types,
20870 like pbm and xbm. (Bug#8640)
20871
57679c86
AS
208722011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20873
20874 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20875
888c9e86
EZ
208762011-05-07 Eli Zaretskii <eliz@gnu.org>
20877
b0512a1d
EZ
20878 * w32console.c (Fset_screen_color): Doc fix.
20879 (Fget_screen_color): New function.
20880 (syms_of_ntterm): Defsubr it.
20881
7285dc67
EZ
20882 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20883 unlink the temporary file if Fcall_process didn't create it in the
20884 first place.
20885 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20886 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
20887 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20888 cue to call_process_cleanup not to close that handle.
20889
4d3fcc8e
BK
208902011-05-07 Ben Key <bkey76@gmail.com>
20891
20892 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20893 one of two shell specific rules, either bootstrap-temacs-CMD or
20894 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20895 to the previous implementation of the bootstrap-temacs rule.
20896 The bootstrap-temacs-CMD rule is similar to the previous
20897 implementation of the bootstrap-temacs rule except that it
20898 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20899 variable.
20900
20901 These changes, along with some changes to nt/configure.bat,
20902 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20903 earlier fix to add support for --cflags and --ldflags options
20904 that include quotes so that it works whether make uses cmd or
20905 sh as the shell.
20906
b4289b64
MA
209072011-05-06 Michael Albinus <michael.albinus@gmx.de>
20908
20909 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20910 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20911 is a constant.
20912 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20913 a string. Handle both cases.
20914 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20915 (Fdbus_register_method): Use Qinvalid_function.
20916
af4c0e28
JB
209172011-05-06 Juanma Barranquero <lekktu@gmail.com>
20918
20919 * makefile.w32-in: Update dependencies.
20920 (LISP_H): Add inttypes.h and stdin.h.
20921 (PROCESS_H): Add unistd.h.
20922
c51453d9
EZ
209232011-05-06 Eli Zaretskii <eliz@gnu.org>
20924
20925 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20926 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20927
8ff0ac3c 209282011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 20929
4c4b566b
PE
20930 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20931
aab2b9b5
PE
20932 * term.c (vfatal): Remove stray call to va_end.
20933 It's not needed and the C Standard doesn't allow it here anyway.
20934
c378da0b
PE
20935 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20936 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20937
288b08c7
PE
20938 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20939 bytes.
20940
e3601888
PE
20941 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20942
db6c0e74
PE
20943 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20944
dd5963ea
PE
20945 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20946
88c9450f
PE
20947 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20948
2f9442b8
PE
20949 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20950
c032b5f8
PE
20951 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20952 * charset.c (Fdefine_charset_internal): Don't initialize
20953 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 20954 32-bit int (Bug#8600).
a108c10b
PE
20955
20956 * lread.c (read_integer): Be more consistent with string-to-number.
20957 Use string_to_number to do the actual conversion; this avoids
20958 rounding errors and fixes some other screwups. Without this fix,
20959 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20960 (digit_to_number): Move earlier, for benefit of read_integer.
20961 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 20962 not a digit in any supported base. (Bug#8602)
a108c10b 20963
ad5f9eea
PE
20964 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20965
aec1708a
PE
20966 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20967 to match comment at start of function. This also removes a
20968 GCC warning about overflow in a 32+64-bit port.
20969
47be4ab5
PE
20970 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20971
371cac43
PE
20972 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20973 Reported by Stefan Monnier in
20974 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
20975 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20976 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 20977
d01a7826
PE
20978 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20979 (EMACS_UINTPTR): Likewise, with uintptr_t.
20980
7fd47d5c
PE
20981 * lisp.h: Prefer 64-bit EMACS_INT if available.
20982 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20983 on 32-bit hosts that have 64-bit int, so that they can access
20984 large files.
122b0c86
PE
20985 However, temporarily disable this change unless the temporary
20986 symbol WIDE_EMACS_INT is defined.
7fd47d5c 20987
8727937b
PE
20988 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20989
8ac068ac
PE
20990 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20991 This removes an assumption that EMACS_INT and long are the same
20992 width as pointers. The assumption is true for Emacs porting targets
20993 now, but we want to make other targets possible.
20994 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20995 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20996 In the rest of the code, change types of integers that hold casted
20997 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20998 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20999 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21000 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21001 No need to cast type when ORing.
21002 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21003 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21004 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21005 assume EMACS_INT is the same width as char *.
21006 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21007 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21008 Remove no-longer-needed casts.
21009 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21010 (xg_tool_bar_help_callback, xg_make_tool_item):
21011 Use EMACS_INTPTR to hold an integer
21012 that will be cast to void *; this can avoid a GCC warning
21013 if EMACS_INT is not the same width as void *.
21014 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21015 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21016 (current_message_1, set_message_1):
21017 Use a local to convert to proper width without a cast.
21018 * xmenu.c (dialog_selection_callback): Likewise.
21019
ede49d71
PE
21020 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21021 Also, don't assume VALBITS / RAND_BITS is less than 5,
21022 and don't rely on undefined behavior when shifting a 1 left into
21023 the sign bit.
21024 * lisp.h (get_random): Change signature to match.
21025
2f30ecd0
PE
21026 * lread.c (hash_string): Use size_t, not int, for hash computation.
21027 Normally we prefer signed values; but hashing is special, because
21028 it's better to use unsigned division on hash table sizes so that
21029 the remainder is nonnegative. Also, size_t is the natural width
21030 for hashing into memory. The previous code used 'int', which doesn't
21031 retain enough info to hash well into very large tables.
21032 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21033
2a866e7b
PE
21034 * dbusbind.c: Don't possibly lose pointer info when converting.
21035 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21036 Use XPNTR rather than XHASH, so that the high-order bits of
21037 the pointer aren't lost when converting through void *.
21038
51639eac
PE
21039 * eval.c (Fautoload): Don't double-shift a pointer.
21040
92394119
PE
21041 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21042
dbdb9a7c
JB
210432011-05-06 Juanma Barranquero <lekktu@gmail.com>
21044
21045 * gnutls.c (DEF_GNUTLS_FN):
21046 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21047
db7a0b4f
AS
210482011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21049
21050 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21051 marker. (Bug#8610)
21052
cd394be1 210532011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
21054
21055 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21056 New version that can reserve upto 2GB of heap space.
21057
f7ff1b0f 210582011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
21059
21060 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21061
639c109b
TZ
210622011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21063
21064 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21065 `gnutls_certificate_set_x509_key_file'.
21066
d2127135
JB
210672011-05-05 Juanma Barranquero <lekktu@gmail.com>
21068
21069 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21070 Update dependencies.
21071
e968f4f3
JB
210722011-05-04 Juanma Barranquero <lekktu@gmail.com>
21073
21074 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21075 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21076 Remove unused parameter `fildes'.
21077 * process.c (read_process_output, send_process): Don't pass it.
21078
84d358f0
JB
210792011-05-04 Juanma Barranquero <lekktu@gmail.com>
21080
21081 Fix previous change: the library cache is defined in w32.c.
21082 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21083 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21084
0898ca10
JB
210852011-05-04 Juanma Barranquero <lekktu@gmail.com>
21086
21087 Implement dynamic loading of GnuTLS on Windows.
21088
21089 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21090 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21091 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21092 Declare.
21093
21094 * gnutls.c (Qgnutls_dll): Define.
21095 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21096 (gnutls_*): Declare function pointers.
21097 (init_gnutls_functions): New function to initialize function pointers.
21098 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21099 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21100 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21101 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21102 (emacs_gnutls_write, emacs_gnutls_read)
21103 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21104 (Fgnutls_available_p): New function.
21105 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21106 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21107 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21108
21109 * image.c: Include w32.h.
21110 (Vimage_type_cache): Delete.
21111 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21112 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21113 (w32_delayed_load): Move to w32.c.
21114
21115 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21116
21117 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21118 (w32_delayed_load): Move from image.c. When loading a library, record
21119 its filename in the :loaded-from property of the library id.
21120 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21121 Initialize and staticpro them.
21122 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21123
21124 * process.c: Include lisp.h before w32.h, not after.
21125 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21126 instead of gnutls_record_check_pending.
21127
21128 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21129
ff4de4aa
TZ
211302011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21131
21132 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21133 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21134 as passed in.
21135
abe95abb
JD
211362011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21137
21138 * xterm.c (x_set_frame_alpha): Do not set property on anything
21139 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21140
e16e55d4
JB
211412011-05-02 Juanma Barranquero <lekktu@gmail.com>
21142
21143 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21144
bafcf6a5
JB
211452011-05-02 Juanma Barranquero <lekktu@gmail.com>
21146
21147 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21148 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21149 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21150 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21151 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21152 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21153 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21154 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21155 (Qgnutls_bootprop_callbacks_verify): Make static.
21156
e7a6747f
AS
211572011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21158
19ed11ba
AS
21159 * callproc.c: Indentation fixup.
21160
e7a6747f 21161 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
21162 (wait_for_termination, interruptible_wait_for_termination):
21163 Move after wait_for_termination_1.
e7a6747f 21164
1ef14cb4
LMI
211652011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21166
21167 * sysdep.c (interruptible_wait_for_termination): New function
21168 which is like wait_for_termination, but allows keyboard
21169 interruptions.
21170
21171 * callproc.c (Fcall_process): Add (:file "file") as an option for
21172 the STDOUT buffer.
21173 (Fcall_process_region): Ditto.
21174
330d880c
EZ
211752011-04-30 Eli Zaretskii <eliz@gnu.org>
21176
8db90b73
EZ
21177 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21178 rather than `XVECTOR (FOO)->size'.
21179
330d880c
EZ
21180 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21181 inttypes.h, as a gnulib replacement is used if it not available in
21182 system headers.
21183
15cbd324
EZ
211842011-04-21 Eli Zaretskii <eliz@gnu.org>
21185
21186 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21187 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21188 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21189
21190 * coding.c (coding_alloc_by_realloc): Error out if destination
21191 will grow beyond MOST_POSITIVE_FIXNUM.
21192 (decode_coding_emacs_mule): Abort if there isn't enough place in
21193 charbuf for the composition carryover bytes. Reserve an extra
21194 space for up to 2 characters produced in a loop.
21195 (decode_coding_iso_2022): Abort if there isn't enough place in
21196 charbuf for the composition carryover bytes.
21197
211982011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 21199
ae940cca
EZ
21200 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21201 aborting when %lld or %lll format is passed.
21202 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21203 %llo or %llx format is passed. (Bug#8545)
21204
03ab8921
EZ
21205 * window.c (window_scroll_line_based): Use a marker instead of
21206 simple variables to record original value of point. (Bug#7952)
21207
afda1437
EZ
21208 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21209 produced by %s or %c overflows available buffer space. (Bug#8545)
21210
f76dee0c
PE
212112011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21212
21213 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 21214 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 21215
fdc5744d
JB
212162011-04-28 Juanma Barranquero <lekktu@gmail.com>
21217
21218 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21219
638f053a
JB
212202011-04-28 Juanma Barranquero <lekktu@gmail.com>
21221
21222 * keyboard.c (Qdelayed_warnings_hook): Define.
21223 (command_loop_1): Run `delayed-warnings-hook'
21224 if Vdelayed_warnings_list is non-nil.
21225 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21226 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21227
d178f871
EZ
212282011-04-28 Eli Zaretskii <eliz@gnu.org>
21229
21230 * doprnt.c (doprnt): Don't return value smaller than the buffer
21231 size if the message was truncated. (Bug#8545).
21232
b124fd93
JB
212332011-04-28 Juanma Barranquero <lekktu@gmail.com>
21234
21235 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21236 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21237
e810457d
PE
212382011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21239
21240 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21241
ea51cceb
JB
212422011-04-27 Juanma Barranquero <lekktu@gmail.com>
21243
21244 * makefile.w32-in: Update dependencies.
21245
94dcfacf
EZ
212462011-04-27 Eli Zaretskii <eliz@gnu.org>
21247
21248 Improve `doprnt' and its usage. (Bug#8545)
21249 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21250 `format_end'. Remove support for %l as a conversion specifier.
21251 Don't use xrealloc. Improve diagnostics when the %l size modifier
21252 is used. Update the commentary.
21253
21254 * eval.c (verror): Simplify calculation of size_t.
21255
21256 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21257 messages.
21258
f61f41d7
PE
212592011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21260
21261 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21262 change.
21263
96fb4434
PE
212642011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21265
21266 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21267 This makes this file independent of the recent pseudovector change.
21268
671875da 212692011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 21270
69e9b5a3
PE
21271 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21272
b5f869a7 21273 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 21274 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 21275 Remove unused local.
c8926152 21276 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 21277
841a1577 21278 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
21279 GCC 4.6.0 optimizes based on type-based alias analysis.
21280 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
21281 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21282 != &v->size, and therefore "v->size = 1; b->size = 2; return
21283 v->size;" must therefore return 1. This assumption is incorrect
21284 for Emacs, since it type-puns struct Lisp_Vector * with many other
21285 types. To fix this problem, this patch adds a new type struct
f904488f 21286 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
21287 and pseudovectors, and helps optimizing compilers not get fooled
21288 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21289 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
21290 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21291 the size member.
eab3844f
PE
21292 (XSETPVECTYPE): Rewrite in terms of new macro.
21293 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21294 This is a bit clearer, and further avoids the possibility of
21295 undesirable aliasing.
21296 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 21297 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
21298 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21299 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
21300 (ASIZE): Now uses header.size rather than size.
21301 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
21302 to avoid the hassle of writing XVECTOR (foo)->header.size.
21303 (struct vectorlike_header): New type.
eab3844f
PE
21304 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21305 object, to help avoid aliasing.
21306 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21307 (SUBRP): Likewise, since Lisp_Subr is a special case.
21308 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21309 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21310 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 21311 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
21312 changed to be "header.size" and "header.next".
21313 * buffer.h (struct buffer): Likewise.
21314 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21315 * frame.h (struct frame): Likewise.
21316 * process.h (struct Lisp_Process): Likewise.
21317 * termhooks.h (struct terminal): Likewise.
21318 * window.c (struct save_window_data, struct saved_window): Likewise.
21319 * window.h (struct window): Likewise.
21320 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21321 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21322 * buffer.c (init_buffer_once): Likewise.
21323 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21324 special case.
21325 * process.c (Fformat_network_address): Use local var for size,
21326 for brevity.
21327
0df1eac5
PE
21328 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21329
847ab9d1 21330 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
21331 * data.c (atof): Remove decl; no longer used or needed.
21332 (digit_to_number): Move to lread.c.
21333 (Fstring_to_number): Use new string_to_number function, to be
21334 consistent with how the Lisp reader treats infinities and NaNs.
21335 Do not assume that floating-point numbers represent EMACS_INT
21336 without losing information; this is not true on most 64-bit hosts.
21337 Avoid double-rounding errors, by insisting on integers when
21338 parsing non-base-10 numbers, as the documentation specifies.
21339 * lisp.h (string_to_number): New decl, replacing ...
21340 (isfloat_string): Remove.
bc0a5c13 21341 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 21342 (read1): Do not accept +. and -. as integers; this
452f4150
PE
21343 appears to have been a coding error. Similarly, do not accept
21344 strings like +-1e0 as floating point numbers. Do not report
21345 overflow for integer overflows unless the base is not 10 which
21346 means we have no simple and reliable way to continue.
21347 Break out the floating-point parsing into a new
21348 function string_to_number, so that Fstring_to_number parses
21349 floating point numbers consistently with the Lisp reader.
04f2d78b 21350 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
21351 (E_CHAR, EXP_INT): Remove, replacing with ...
21352 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21353 (string_to_number): New function, replacing isfloat_string.
21354 This function checks for valid syntax and produces the resulting
21355 Lisp float number too. Rework it so that string-to-number
bc0a5c13 21356 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
21357 so that overflow for non-base-10 numbers is reported only when
21358 there's no portable and simple way to convert to floating point.
452f4150 21359
67769ffc
PE
21360 * textprop.c (set_text_properties_1): Rewrite for clarity,
21361 and to avoid GCC warning about integer overflow.
21362
c20db43f
PE
21363 * intervals.h (struct interval): Use EMACS_INT for members
21364 where EMACS_UINT might cause problems. See
21365 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21366 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21367 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21368 All uses changed.
37aa2f85
PE
21369 (offset_intervals): Tell GCC not to worry about length overflow
21370 when negating a negative length.
c20db43f 21371
2538aa2f
PE
21372 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21373 (overrun_check_free): Likewise.
21374
f2d3008d
PE
21375 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21376 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21377 word size.
21378
ec8df744
PE
21379 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21380 (gnutls_make_error): Rename local to avoid shadowing.
21381 (gnutls_emacs_global_deinit): ifdef out; not used.
21382 (Fgnutls_boot): Use const for pointer to readonly storage.
21383 Comment out unused local. Fix pointer signedness problems.
21384
640ee02d
PE
21385 * lread.c (openp): Don't stuff size_t into an 'int'.
21386 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21387 about possible signed overflow.
21388
6048fb2a
PE
21389 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21390 (GDK_KEY_g): Don't define if already defined.
21391 (xg_prepare_tooltip): Avoid pointer signedness problem.
21392 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21393
fa3c87e1
PE
21394 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21395 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21396
2172544b
PE
21397 * xfns.c (Fx_window_property): Simplify a bit,
21398 to make a bit faster and to avoid GCC 4.6.0 warning.
21399 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21400
9b821a21
PE
21401 * fns.c (internal_equal): Don't assume size_t fits in int.
21402
3c616cfa
PE
21403 * alloc.c (compact_small_strings): Tighten assertion a little.
21404
c2982e87
PE
21405 Replace pEd with more-general pI, and fix some printf arg casts.
21406 * lisp.h (pI): New macro, generalizing old pEd macro to other
21407 conversion specifiers. For example, use "...%"pI"d..." rather
21408 than "...%"pEd"...".
21409 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 21410 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
21411 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21412 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21413 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21414 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21415 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21416 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21417 64-bit hosts.
21418 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21419 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21420 * print.c (safe_debug_print, print_object): Likewise.
21421 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21422 to int.
6f04d126
PE
21423 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21424 avoiding the 0 flag, which is not portable.
c2982e87
PE
21425 * process.c (Fmake_network_process): Use pI to avoid cast.
21426 * region-cache.c (pp_cache): Likewise.
21427 * xdisp.c (decode_mode_spec): Likewise.
21428 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21429 behavior on 64-bit hosts with printf arg.
6f04d126 21430 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
21431 (x_stop_queuing_selection_requests): Likewise.
21432 (x_get_window_property): Don't truncate byte count to an 'int'
21433 when tracing.
0b432f21 21434
5e073ec7
PE
21435 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21436 here, since it parses constructs like leading '-' and spaces,
21437 which are not wanted; and it overflows with large numbers.
21438 Instead, simply match F[0-9]+, which is what is wanted anyway.
21439
36372bf9
PE
21440 * alloc.c: Remove unportable assumptions about struct layout.
21441 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21442 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21443 (allocate_vectorlike, make_pure_vector): Use the new macros,
21444 plus offsetof, to remove unportable assumptions about struct layout.
21445 These assumptions hold on all porting targets that I know of, but
21446 they are not guaranteed, they're easy to remove, and removing them
21447 makes further changes easier.
21448
0b432f21
PE
21449 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21450 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
21451 (string_overrun_cookie): Now const. Use initializers that
21452 don't formally overflow signed char, to avoid warnings.
000098c1
PE
21453 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21454 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
21455 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21456 multiple of sizeof (EMACS_INT); it need not be, if
21457 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 21458 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 21459
895009e1
JB
214602011-04-26 Juanma Barranquero <lekktu@gmail.com>
21461
21462 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21463
6a7a1b0b
TZ
214642011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21465
21466 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 21467 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
21468 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21469
841a1577 214702011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
21471
21472 * lisp.h (Qdebug): List symbol.
895009e1 21473 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
21474 * keyboard.c (debug-on-event): New variable.
21475 (handle_user_signal): Break into debugger when debug-on-event
21476 matches the current signal symbol.
21477
f2d3ba6f
DN
214782011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21479
21480 * alloc.c (check_sblock, check_string_bytes)
21481 (check_string_free_list): Convert to standard C.
21482
42ce4c63
TZ
214832011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21484
21485 * w32.c (emacs_gnutls_push): Fix typo.
21486
825cd63c
EZ
214872011-04-25 Eli Zaretskii <eliz@gnu.org>
21488
fb11d64d
EZ
21489 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21490 "cast to pointer from integer of different size".
21491
825cd63c
EZ
21492 Improve doprnt and its use in verror. (Bug#8545)
21493 * doprnt.c (doprnt): Document the set of format control sequences
21494 supported by the function. Use SAFE_ALLOCA instead of always
21495 using `alloca'.
21496
21497 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21498 is one byte too soon. Don't use xrealloc; instead xfree and
21499 xmalloc anew.
21500
e061a11b
TZ
215012011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21502
21503 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21504 callbacks stage.
21505
21506 * gnutls.c: Renamed global_initialized to
21507 gnutls_global_initialized. Added internals for the
21508 :verify-hostname-error, :verify-error, and :verify-flags
21509 parameters of `gnutls-boot' and documented those parameters in the
21510 docstring. Start callback support.
9173deec
JB
21511 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21512 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21513 on error. Return error code.
e061a11b
TZ
21514 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21515 (emacs_gnutls_read): Likewise.
21516 (Fgnutls_boot): Return handshake error code.
21517 (emacs_gnutls_handle_error): New function.
21518 (wsaerror_to_errno): Likewise.
21519
21520 * w32.h (emacs_gnutls_pull): Add prototype.
21521 (emacs_gnutls_push): Likewise.
21522
21523 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21524 (emacs_gnutls_push): Likewise.
21525
215262011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21527
21528 * process.c (wait_reading_process_output): Check if GnuTLS
21529 buffered some data internally if no FDs are set for TLS
21530 connections.
21531
21532 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21533 (LIBS): Link to USER_LIBS.
21534 ($(BLD)/gnutls.$(0)): New target.
21535
fa6996bc
EZ
215362011-04-24 Eli Zaretskii <eliz@gnu.org>
21537
eb35682e
EZ
21538 * xdisp.c (handle_single_display_spec): Rename the
21539 display_replaced_before_p argument into display_replaced_p, to
21540 make it consistent with the commentary. Fix typos in the
21541 commentary.
21542
e2ad650c
EZ
21543 * textprop.c (syms_of_textprop): Remove dead code.
21544 (copy_text_properties): Delete obsolete commentary about an
21545 interface that was deleted long ago. Fix typos in the description
21546 of arguments.
21547
1b2de274
EZ
21548 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21549 to changes in oldXMenu/XMenu.h from 2011-04-16.
21550 <menu_help_message, prev_menu_help_message>: Constify.
21551 (IT_menu_make_room): menu->help_text is now `const char **';
21552 adjust.
21553
21554 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21555 to changes in oldXMenu/XMenu.h from 2011-04-16.
21556 (struct XMenu): Declare `help_text' `const char **'.
21557
21558 * xfaces.c <Qunspecified>: Make extern again.
21559
21560 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 21561 required by POSIX.
1b2de274 21562
762b15be
EZ
21563 * doc.c (get_doc_string): Improve the format passed to `error'.
21564
21565 * doprnt.c (doprnt): Improve commentary.
21566
21567 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21568
21569 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21570 them with etags.
21571
f1052e5d
EZ
21572 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21573 changes in globals.h immediately force recompilation.
762b15be
EZ
21574 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21575 $(CURDIR)/s/ms-w32.h.
21576 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 21577
fa6996bc
EZ
21578 * character.c (Fchar_direction): Function deleted.
21579 (syms_of_character): Don't defsubr it.
21580 <char-direction-table>: Deleted.
21581
e6c3da20
EZ
215822011-04-23 Eli Zaretskii <eliz@gnu.org>
21583
21584 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21585 * doprnt.c: Include limits.h.
21586 (SIZE_MAX): New macro.
04f2d78b
CB
21587 (doprnt): Return a size_t value. 2nd arg is now size_t.
21588 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
21589 Improve overflow protection. Support `l' modifier for integer
21590 conversions. Support %l conversion. Don't assume an EMACS_INT
21591 argument for integer conversions and for %c.
21592
21593 * lisp.h (doprnt): Restore prototype.
21594
21595 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21596 $(SRC)/character.h.
21597
21598 * Makefile.in (base_obj): Add back doprnt.o.
21599
21600 * deps.mk (doprnt.o): Add back prerequisites.
21601 (callint.o): Depend on character.h.
21602
21603 * eval.c (internal_lisp_condition_case): Include the handler
21604 representation in the error message.
21605 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21606 when breaking from the loop.
21607
21608 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21609
21610 * callint.c (Fcall_interactively): When displaying error message
21611 about invalid control letter, pass the character's codepoint, not
21612 a pointer to its multibyte form. Improve display of the character
21613 in octal and display also its hex code.
21614
21615 * character.c (char_string): Use %x to display the (unsigned)
21616 codepoint of an invalid character, to avoid displaying a bogus
21617 negative value.
21618
21619 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21620 `error', not SYMBOL_NAME itself.
21621
21622 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21623 character arguments to `error'.
21624
21625 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21626 to `error' in error message about FINAL_CHAR argument. Make sure
21627 FINAL_CHAR is a character, and use %c when it is passed as
21628 argument to `error'.
21629
4ffd0d6b 216302011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
21631
21632 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21633
21634 * w32.c: Include <time.h>.
21635 (sys_localtime): New function.
21636
4ffd0d6b 216372011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
21638
21639 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21640
4ffd0d6b 21641 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 21642
4ffd0d6b 216432011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 21644
4ffd0d6b
GM
21645 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21646 zombies (Bug#8467).
aac0c6e3 21647
04c56954
EZ
216482011-04-19 Eli Zaretskii <eliz@gnu.org>
21649
21650 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21651 gl_state.e_property when gl_state.object is Qt.
21652
21653 * insdel.c (make_gap_larger): Remove limitation of buffer size
21654 to <= INT_MAX.
21655
16a43933
CY
216562011-04-18 Chong Yidong <cyd@stupidchicken.com>
21657
21658 * xdisp.c (lookup_glyphless_char_display)
21659 (produce_glyphless_glyph): Handle cons cell entry in
21660 glyphless-char-display.
21661 (Vglyphless_char_display): Document it.
21662
21663 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21664 glyphless-char-display.
21665
4581706e
CY
216662011-04-17 Chong Yidong <cyd@stupidchicken.com>
21667
21668 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21669
21670 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21671
21672 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21673 definition for no-X builds.
21674
4887c6e2 216752011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 21676
fd35b6f9
PE
21677 Static checks with GCC 4.6.0 and non-default toolkits.
21678
5c1ccb01
PE
21679 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21680
006c5daa
PE
21681 * process.c (keyboard_bit_set): Define only if SIGIO.
21682 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21683 (send_process): Repair possible setjmp clobbering.
21684
efc736d3
PE
21685 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21686
4e2fe2e6
PE
21687 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21688
f97334a2
PE
21689 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21690
4e75f29d
PE
21691 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21692 Define only if needed.
21693
90efadd1
PE
21694 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21695 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 21696 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 21697
3c647824
PE
21698 * dispextern.h (struct redisplay_interface): Rename param
21699 to avoid shadowing.
e264f262 21700 * termhooks.h (struct terminal): Likewise.
761383f4 21701 * xterm.c (xembed_send_message): Likewise.
3c647824 21702
b58c5c4a
PE
21703 * insdel.c (make_gap_smaller): Define only if
21704 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21705
cad59032
PE
21706 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21707 it.
21708
c339dc2e
PE
21709 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21710 so that we aren't warned about unused symbols.
21711
91a3e27b
PE
21712 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21713
399c71d3 21714 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 21715
8ffc96f5
PE
21716 * xfns.c (x_real_positions): Mark locals as initialized.
21717
eef9bc79
PE
21718 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21719
098db9dd
PE
21720 * xterm.c: Fix problems found by static analysis with other toolkits.
21721 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
21722 (x_dispatch_event): Declare static if USE_GTK, and
21723 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 21724 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 21725 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
21726 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21727 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 21728
eb18f6cc
PE
21729 * xmenu.c (menu_help_callback): Pointer type fixes.
21730 Use const pointers when pointing at readonly data. Avoid pointer
21731 signedness clashes.
21732 (FALSE): Remove unused macro.
21733 (update_frame_menubar): Remove unused decl.
21734
1fe72bf8
PE
21735 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21736
60d9e1db
PE
21737 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21738 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21739 (single_menu_item): Rename local to avoid shadowing.
21740
39261c26
PE
21741 * keyboard.c (make_lispy_event): Remove unused local var.
21742
018c5e19
PE
21743 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21744 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21745
63d2b86e
PE
21746 * bitmaps: Change bitmaps from unsigned char back to the X11
21747 compatible char. Avoid the old compiler warnings about
21748 out-of-range initializers by using, for example, '\xab' rather
21749 than 0xab.
21750
aefd87e1
PE
21751 * xgselect.c (xgselect_initialize): Check vs interface
21752 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21753
bf501fb9
PE
21754 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21755
e9829fdf
PE
21756 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21757 to read-only memory.
21758
1086c095
PE
21759 * fns.c (vector): Remove; this old hack is no longer needed.
21760
2baccd04 21761 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 21762 Remove unused var.
dde42981 21763 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 21764
72391843 21765 * xrdb.c (x_load_resources): Omit unused local.
3565b346 21766
436c16df 21767 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 21768 (x_window): Rename locals to avoid shadowing.
dc5ddd85 21769 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 21770
92bb796d 21771 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 21772 (x_term_init): Remove local to avoid shadowing.
92bb796d 21773
764430a3 21774 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
21775
21776 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21777 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21778
d1dfb56c
EZ
217792011-04-16 Eli Zaretskii <eliz@gnu.org>
21780
c4354cb4
EZ
21781 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21782
d1dfb56c
EZ
21783 Fix regex.c, syntax.c and friends for buffers > 2GB.
21784 * syntax.h (struct gl_state_s): Declare character position members
21785 EMACS_INT.
21786
21787 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21788
04f2d78b
CB
21789 * textprop.c (verify_interval_modification, interval_of):
21790 Declare arguments EMACS_INT.
d1dfb56c
EZ
21791
21792 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21793 EMACS_INT.
21794
21795 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21796
21797 * indent.c (Fvertical_motion): Local variable it_start is now
21798 EMACS_INT.
21799
21800 * regex.c (re_match, re_match_2, re_match_2_internal)
21801 (bcmp_translate, regcomp, regexec, print_double_string)
21802 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21803 (re_compile_pattern, re_exec): Declare arguments and local
21804 variables `size_t' and `ssize_t' and return values `regoff_t', as
21805 appropriate.
21806 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21807 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21808 <compile_stack_type>: `size' and `avail' are now `size_t'.
21809
21810 * regex.h <regoff_t>: Use ssize_t, not int.
21811 (re_search, re_search_2, re_match, re_match_2): Arguments that
21812 specify buffer/string position and length are now ssize_t and
21813 size_t. Return type is regoff_t.
21814
613052cd
BK
218152011-04-16 Ben Key <bkey76@gmail.com>
21816
21817 * nsfont.m: Fixed bugs in ns_get_family and
21818 ns_descriptor_to_entity that were caused by using free to
21819 deallocate memory blocks that were allocated by xmalloc (via
21820 xstrdup). This caused Emacs to crash when compiled with
21821 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21822 --enable-checking=xmallocoverrun). xfree is now used to
21823 deallocate these memory blocks.
21824
4170f62f 218252011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 21826
71b41406
PE
21827 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21828
9587a89d
PE
21829 emacs_write: Accept and return EMACS_INT for sizes.
21830 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21831 et seq.
21832 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21833 Accept and return EMACS_INT.
21834 (emacs_gnutls_write): Return the number of bytes written on
21835 partial writes.
21836 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
21837 (emacs_read, emacs_write): Remove check for negative size, as the
21838 Emacs source code has been audited now.
9587a89d
PE
21839 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21840 (emacs_read, emacs_write): Use it.
273a5f82
PE
21841 * process.c (send_process): Adjust to the new signatures of
21842 emacs_write and emacs_gnutls_write. Do not attempt to store
21843 a byte offset into an 'int'; it might overflow.
9587a89d 21844 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 21845
3e047f51
PE
21846 * sound.c: Don't assume sizes fit in 'int'.
21847 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 21848 Return EMACS_INT, not int.
3e047f51 21849 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
21850 Accept EMACS_INT, not int.
21851 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
21852 record read return values.
21853
cc39a9db
BK
218542011-04-15 Ben Key <bkey76@gmail.com>
21855
c9d0ec6d
JB
21856 * keyboard.c (Qundefined): Don't declare static since it is used
21857 in nsfns.m.
21858 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21859 static since they are used in nsfont.m.
cc39a9db 21860
6c60eb9f
SM
218612011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21862
21863 * process.c (Qprocessp): Don't declare static.
21864 * lisp.h (Qprocessp): Declare again.
21865
7990b61a
JB
218662011-04-15 Juanma Barranquero <lekktu@gmail.com>
21867
21868 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21869
5d4cb038
PE
218702011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21871
8bd7b830 21872 Improve C-level modularity by making more things 'static'.
cd64ea1d 21873
e3b27b31
PE
21874 Don't publish debugger-only interfaces to other modules.
21875 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21876 (verify_bytepos, count_markers): Move decls to the only modules
21877 that need them.
21878 * region-cache.h (pp_cache): Likewise.
21879 * window.h (check_all_windows): Likewise.
21880 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21881
5d4cb038
PE
21882 * sysdep.c (croak): Now static, if
21883 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21884 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
21885
21886 * alloc.c (refill_memory_reserve): Now static if
21887 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21888 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 21889
e87b6180
PE
21890 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21891 Define only if USE_LUCID.
21892
ac64929e
PE
21893 * xrdb.c (x_customization_string, x_rm_string): Now static.
21894
6f37259d
PE
21895 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21896 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21897
1683e3ab
PE
21898 * xdisp.c (draw_row_with_mouse_face): Now static.
21899 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21900
de9c2632
PE
21901 * window.h (check_all_windows): Mark externally visible.
21902
2b96acb7
PE
21903 * window.c (window_deletion_count): Now static.
21904
21905 * undo.c: Make symbols static if they're not exported.
21906 (last_undo_buffer, last_boundary_position, pending_boundary):
21907 Now static.
21908
50436f33
PE
21909 * textprop.c (interval_insert_behind_hooks): Now static.
21910 (interval_insert_in_front_hooks): Likewise.
21911
64520e5c
PE
21912 * term.c: Make symbols static if they're not exported.
21913 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21914 (max_frame_lines, tty_set_terminal_modes):
21915 (tty_reset_terminal_modes, tty_turn_off_highlight):
21916 (get_tty_terminal): Now static.
21917 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21918 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 21919 HAVE_WINDOW_SYSTEM.
64520e5c
PE
21920 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21921 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21922
1fa53021
PE
21923 * sysdep.c: Make symbols static if they're not exported.
21924 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21925 Now static.
21926 (sigprocmask_set, full_mask): Remove; unused.
21927 (wait_debugging): Mark as visible.
21928 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21929 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21930
d4b43b22
PE
21931 * syntax.c (syntax_temp): Define only if !__GNUC__.
21932
b7c513d0
PE
21933 * sound.c (current_sound_device, current_sound): Now static.
21934
989b29ad
PE
21935 * search.c (searchbufs, searchbuf_head): Now static.
21936
13a55a78
PE
21937 * scroll.c (scroll_cost): Remove; unused.
21938 * dispextern.h (scroll_cost): Remove decl.
21939
de68a1fc
PE
21940 * region-cache.h (pp_cache): Mark as externally visible.
21941
40ccffa6
PE
21942 * process.c: Make symbols static if they're not exported.
21943 (process_tick, update_tick, create_process, chan_process):
21944 (Vprocess_alist, proc_buffered_char, datagram_access):
21945 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21946 (deactivate_process): Mark defn as static, as well as decl.
21947 * lisp.h (create_process): Remove decl.
21948 * process.h (chan_process, Vprocess_alist): Remove decls.
21949
ad64fc97
PE
21950 * print.c: Make symbols static if they're not exported.
21951 (print_depth, new_backquote_output, being_printed, print_buffer):
21952 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21953 (print_interval, print_number_index, initial_stderr_stream):
21954 Now static.
21955 * lisp.h (Fprinc): Remove decl.
21956 (debug_output_compilation_hack): Mark as externally visible.
21957
adddb265
PE
21958 * sysdep.c (croak): Move decl from here to syssignal.h.
21959 * syssignal.h (croak): Put it here, so the API can be checked when
21960 'croak' is called from dissociate_if_controlling_tty.
21961
1717ede2
PE
21962 * minibuf.c: Make symbols static if they're not exported.
21963 (minibuf_save_list, choose_minibuf_frame): Now static.
21964 * lisp.h (choose_minibuf_frame): Remove decl.
21965
fa5fb2bc
PE
21966 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21967
1e3890d1
PE
21968 * lread.c: Make symbols static if they're not exported.
21969 (read_objects, initial_obarray, oblookup_last_bucket_number):
21970 Now static.
21971 (make_symbol): Remove; unused.
21972 * lisp.h (initial_obarray, make_symbol): Remove decls.
21973
8a1414fa
PE
21974 * keyboard.c: Make symbols static if they're not exported.
21975 (single_kboard, recent_keys_index, total_keys, recent_keys):
21976 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21977 (this_single_command_key_start, echoing, last_auto_save):
21978 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21979 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21980 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21981 (Vlispy_mouse_stem, double_click_count):
21982 Now static.
21983 (force_auto_save_soon): Define only if SIGDANGER.
21984 (ignore_mouse_drag_p): Now static if
21985 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21986 (print_help): Remove; unused.
21987 (stop_character, last_timer_event): Mark as externally visible.
21988 * keyboard.h (ignore_mouse_drag_p): Declare only if
21989 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21990 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21991 * lisp.h (echoing): Remove decl.
21992 (force_auto_save_soon): Declare only if SIGDANGER.
21993 * xdisp.c (redisplay_window): Simplify code, to make it more
21994 obvious that ignore_mouse_drag_p is not accessed if !defined
21995 USE_GTK && !defined HAVE_NS.
21996
93ea6e8f
PE
21997 * intervals.c: Make symbols static if they're not exported.
21998 (merge_properties_sticky, merge_interval_right, delete_interval):
21999 Now static.
22000 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22001
77382fcc
PE
22002 * insdel.c: Make symbols static if they're not exported.
22003 However, leave prepare_to_modify_buffer alone. It's never
22004 called from outside this function, but that appears to be a bug.
22005 (combine_after_change_list, combine_after_change_buffer):
4889fc82 22006 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
22007 (adjust_after_replace_noundo): Remove; unused.
22008 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 22009 (signal_before_change): Remove decls.
77382fcc 22010
9306c32e
PE
22011 * indent.c (val_compute_motion, val_vmotion): Now static.
22012
cd44d2eb
PE
22013 * image.c: Make symbols static if they're not exported.
22014 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22015 if USE_GTK.
22016 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22017 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22018
ad9a7a06
PE
22019 * fringe.c (standard_bitmaps): Now static.
22020 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22021
81626931
PE
22022 * frame.c: Make symbols static if they're not exported.
22023 (x_report_frame_params, make_terminal_frame): Now static.
22024 (get_frame_param): Now static, unless HAVE_NS.
22025 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22026 (x_get_resource_string): Remove; not used.
22027 * frame.h (make_terminal_frame, x_report_frame_params):
22028 (x_get_resource_string); Remove decls.
22029 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22030 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22031
239f9db9
PE
22032 * font.c, fontset.c: Make symbols static if they're not exported.
22033 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22034 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22035 * font.c (font_close_object): Now static.
22036 * font.h (font_close_object): Remove.
22037 * fontset.c (FONTSET_OBJLIST): Remove.
22038 (free_realized_fontset) #if-0 the body, which does nothing.
22039 (face_suitable_for_char_p): #if-0, as it's never called.
22040 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
22041 * xfaces.c (face_at_string_position):
22042 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
22043 since 0 is always ASCII.
22044
dfcf3579
PE
22045 * fns.c (weak_hash_tables): Now static.
22046
5045092b
PE
22047 * fileio.c: Make symbols static if they're not exported.
22048 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22049 (Vwrite_region_annotation_buffers): Now static.
22050
57a96f5c
PE
22051 * eval.c: Make symbols static if they're not exported.
22052 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22053 * lisp.h (backtrace_list): Remove decl.
22054
35f08c38
PE
22055 * emacs.c: Make symbols static if they're not exported.
22056 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22057 (fatal_error_code, fatal_error_signal_hook, standard_args):
22058 Now static.
22059 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22060 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22061 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22062 * lisp.h (fatal_error_signal_hook): Remove decl.
22063 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22064
f44bd759
PE
22065 * editfns.c: Move a (normally-unused) function to its only use.
22066 * editfns.c, lisp.h (get_operating_system_release): Remove.
22067 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22068 worth the hassle of breaking this out.
22069
b532497d
PE
22070 * xterm.c: Make symbols static if they're not exported.
22071 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22072 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22073 (x_destroy_window, x_delete_display):
22074 Now static.
22075 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22076 (x_mouse_leave): Remove; unused.
22077 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22078 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22079 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22080 Remove decls.
22081 (x_mouse_leave): Declare only if WINDOWSNT.
22082 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22083 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22084 USE_X_TOOLKIT.
22085
1675728f
PE
22086 * ftxfont.c: Make symbols static if they're not exported.
22087 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22088 HAVE_FREETYPE.
22089 * font.h (ftxfont_driver): Likewise.
22090
e4cebfca
PE
22091 * xfns.c: Make symbols static if they're not exported.
22092 (x_last_font_name, x_display_info_for_name):
22093 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22094 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22095 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22096 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22097 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22098 (last_show_tip_args): Now static.
22099 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22100 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22101 (x_screen_planes): Remove; unused.
22102 * dispextern.h (x_screen_planes): Remove decl.
22103
5bf46f05
PE
22104 * dispnew.c: Make symbols static if they're not exported.
22105 * dispextern.h (redraw_garbaged_frames, scrolling):
22106 (increment_row_positions): Remove.
22107 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22108 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22109 Now static.
22110 (redraw_garbaged_frames): Remove; unused.
22111
435f4c28
PE
22112 * xfaces.c: Make symbols static if they're not exported.
22113 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22114 Remove decls.
22115 * xterm.h (defined_color): Remove decls.
22116 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22117 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22118 (menu_face_changed_default, defined_color, free_realized_face):
22119 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22120 (ascii_face_of_lisp_face): Remove; unused.
22121
8524aef3
PE
22122 * xdisp.c: Make symbols static if they're not exported.
22123 * dispextern.h (scratch_glyph_row, window_box_edges):
22124 (glyph_to_pixel_coords, set_cursor_from_row):
22125 (get_next_display_element, set_iterator_to_next):
22126 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22127 (show_mouse_face): Remove decls
22128 * frame.h (message_buf_print): Likewise.
22129 * lisp.h (pop_message, set_message, check_point_in_composition):
22130 Likewise.
22131 * xterm.h (set_vertical_scroll_bar): Likewise.
22132 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22133 (message_buf_print, scratch_glyph_row, displayed_buffer):
22134 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22135 (get_next_display_element, show_mouse_face, window_box_edges):
22136 (frame_to_window_pixel_xy, check_point_in_composition):
22137 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22138 (glyph_to_pixel_coords): Remove; unused.
22139
16390cd2
PE
22140 * dired.c (file_name_completion): Now static.
22141
22142 * dbusbind.c (xd_in_read_queued_messages): Now static.
22143
a25f4dfa
PE
22144 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22145 * data.c (circular_list_error): Remove.
22146
14a9c8df
PE
22147 * commands.h (last_point_position, last_point_position_buffer):
22148 (last_point_position_window): Remove decls.
22149 * keyboard.c: Make these variables static.
22150
04f2d78b
CB
22151 * coding.h (coding, code_convert_region, encode_coding_gap):
22152 Remove decls.
74ab6df5
PE
22153 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22154 (iso_code_class, detect_coding, code_convert_region): Now static.
22155 (encode_coding_gap): Remove; unused.
22156
38dfbee1
PE
22157 * chartab.c (chartab_chars, chartab_bits): Now static.
22158
a2cb4e63
PE
22159 * charset.h (charset_iso_8859_1): Remove decl.
22160 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22161 Now static.
22162
127198fd
PE
22163 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22164 * ccl.c (Vccl_program_table): Now static.
22165 (check_ccl_update): Remove; unused.
22166
d85b608f
PE
22167 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22168 * category.h: ... from here.
22169 * category.c (check_category_table, set_category_set): Now static.
22170
31cd66f3
PE
22171 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22172 * lisp.h: Remove these decls.
22173
c358e587
PE
22174 * buffer.c (buffer_count): Remove unused var.
22175
e78aecca
PE
22176 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22177 so that it's not optimized away.
22178 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22179 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22180 exported only to the debugger.
22181
e192d7d3 22182 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 22183 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 22184
92470028
PE
22185 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22186 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22187 was inaccessible from Lisp.
22188 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22189 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22190
244ed907
PE
22191 alloc.c: Import and export fewer symbols, and remove unused items.
22192 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22193 is defined.
22194 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22195 it's not optimized away by whole-program optimization.
22196 (message_enable_multibyte, free_misc): Remove.
22197 (catchlist, handlerlist, mark_backtrace):
22198 Declare only if BYTE_MARK_STACK.
22199 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22200 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22201 (message_enable_multibyte): Remove decl.
22202 (free_misc, interval_free_list, float_block, float_block_index):
22203 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22204 (cons_free_list, last_marked_index):
22205 Now static.
22206 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22207 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22208 (mark_backtrace): Define only if BYTE_MARK_STACK.
22209 * xdisp.c (message_enable_multibyte): Now static.
22210
61c2b50e 22211 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
22212 This makes it easier for human readers (and static analyzers)
22213 to see whether these variables are used from other modules.
22214 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22215 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22216 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22217 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22218 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22219 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22220 * xmenu.c, xselect.c:
22221 Declare Q* vars static if they are not used in other modules.
22222 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22223 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22224 Remove decls of unexported vars.
22225 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22226
95c82688
PE
22227 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22228
16a97296
PE
22229 Make Emacs functions such as Fatom 'static' by default.
22230 This makes it easier for human readers (and static analyzers)
22231 to see whether these functions can be called from other modules.
22232 DEFUN now defines a static function. To make the function external
22233 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
22234 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22235 (Finit_image_library):
16a97296
PE
22236 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22237 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22238 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22239 Remove decls, since these functions are now static.
22240 (Funintern, Fget_internal_run_time): New decls, since these functions
22241 were already external.
95c82688 22242
16a97296
PE
22243 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22244 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22245 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22246 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22247 * keyboard.c, keymap.c, lread.c:
22248 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22249 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22250 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22251 Mark functions with DEFUE instead of DEFUN,
22252 if they are used in other modules.
22253 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22254 decls for now-static functions.
22255 * buffer.h (Fdelete_overlay): Remove decl.
22256 * callproc.c (Fgetenv_internal): Mark as internal.
22257 * composite.c (Fremove_list_of_text_properties): Remove decl.
22258 (Fcomposition_get_gstring): New forward static decl.
22259 * composite.h (Fcomposite_get_gstring): Remove decl.
22260 * dired.c (Ffile_attributes): New forward static decl.
22261 * doc.c (Fdocumntation_property): New forward static decl.
22262 * eval.c (Ffetch_bytecode): New forward static decl.
22263 (Funintern): Remove extern decl; now in .h file where it belongs.
22264 * fileio.c (Fmake_symbolic_link): New forward static decl.
22265 * image.c (Finit_image_library): New forward static decl.
22266 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22267 * intervals.h (Fprevious_property_change):
22268 (Fremove_list_of_text_properties): Remove decls.
22269 * keyboard.c (Fthis_command_keys): Remove decl.
22270 (Fcommand_execute): New forward static decl.
22271 * keymap.c (Flookup_key): New forward static decl.
22272 (Fcopy_keymap): Now static.
22273 * keymap.h (Flookup_key): Remove decl.
22274 * process.c (Fget_process): New forward static decl.
22275 (Fprocess_datagram_address): Mark as internal.
22276 * syntax.c (Fsyntax_table_p): New forward static decl.
22277 (skip_chars): Remove duplicate decl.
22278 * textprop.c (Fprevious_property_change): New forward static decl.
22279 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22280 Now internal.
22281 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22282 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22283
785bbd42
PE
22284 * editfns.c (Fformat): Remove unreachable code.
22285
8b913b57
AS
222862011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22287
22288 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22289 change. (Bug#8496)
22290
a6744a35
EZ
222912011-04-13 Eli Zaretskii <eliz@gnu.org>
22292
22293 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22294 when at ZV. (Bug#8487)
22295
e7974947
AS
222962011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22297
baad03f0
AS
22298 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22299 (Bug#8437)
22300 * keyboard.c (parse_tool_bar_item): Likewise.
22301 * sound.c (sound_cleanup, alsa_close): Likewise.
22302 * termcap.c (tgetent): Likewise.
22303 * xfns.c (x_default_font_parameter): Likewise.
22304 * xsettings.c (read_and_apply_settings): Likewise.
22305
e7974947
AS
22306 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22307 (overrun_check_free): Protoize.
22308
28272684
PE
223092011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22310
22311 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22312 since callers should never pass a negative size.
22313 Change the signature to match that of plain 'read' and 'write'; see
22314 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22315 * lisp.h: Update prototypes of emacs_write and emacs_read.
22316
11997c76
EZ
223172011-04-11 Eli Zaretskii <eliz@gnu.org>
22318
22319 * xdisp.c (redisplay_window): Don't try to determine the character
22320 position of the scroll margin if the window start point w->startp
e896f03c 22321 is outside the buffer's accessible region. (Bug#8468)
11997c76 22322
8a2cbd72
EZ
223232011-04-10 Eli Zaretskii <eliz@gnu.org>
22324
22325 Fix write-region and its subroutines for buffers > 2GB.
22326 * fileio.c (a_write, e_write): Modify declaration of arguments and
22327 local variables to support buffers larger than 2GB.
22328 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22329
22330 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22331 argument, local variables, and return value.
22332
22333 * lisp.h: Update prototypes of emacs_write and emacs_read.
22334
22335 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22336
4073e537 223372011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 22338
1ebfdcb6
PE
22339 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22340
b2ded58d
PE
22341 Fix more problems found by GCC 4.6.0's static checks.
22342
7d66342c
PE
22343 * xdisp.c (vmessage): Use a better test for character truncation.
22344
bbf47d44
PE
22345 * charset.c (load_charset_map): <, not <=, for optimization,
22346 and to avoid potential problems with integer overflow.
9248994d 22347 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 22348 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 22349 * editfns.c (Fformat): Likewise.
1e69125e 22350 * syntax.c (skip_chars): Likewise.
3befa583 22351
e3019616
PE
22352 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22353 This also lets GCC 4.6.0 generate slightly better loop code.
22354
becfa255
PE
22355 * callint.c (Fcall_interactively): <, not <=, for optimization.
22356 (Fcall_interactively): Count the number of arguments produced,
22357 not the number of arguments given. This is simpler and lets GCC
22358 4.6.0 generate slightly better code.
22359
dae0cd48
PE
22360 * ftfont.c: Distingish more carefully between FcChar8 and char.
22361 The previous code passed unsigned char * to a functions like
22362 strlen and xstrcasecmp that expect char *, which does not
22363 conform to the C standard.
22364 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22365 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22366 char * when the C standard requires it.
22367
76032d70
PE
22368 * keyboard.c (read_char): Remove unused var.
22369
eb3f1cc8
PE
22370 * eval.c: Port to Windows vsnprintf (Bug#8435).
22371 Include <limits.h>.
22372 (SIZE_MAX): Define if the headers do not.
22373 (verror): Do not give up if vsnprintf returns a negative count.
22374 Instead, grow the buffer. This ports to Windows vsnprintf, which
22375 does not conform to C99. Problem reported by Eli Zaretskii.
22376 Also, simplify the allocation scheme, by avoiding the need for
22377 calling realloc, and removing the ALLOCATED variable.
22378
70476b54
PE
22379 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22380
12020a9e
PE
22381 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22382 But keep the doprint source code for now, as we might revamp it
22383 and use it again (Bug#8435).
ea6c7ae6
PE
22384 * lisp.h (doprnt): Remove.
22385 * Makefile.in (base_obj): Remove doprnt.o.
22386 * deps.mk (doprnt.o): Remove.
22387
5fdb398c
PE
22388 error: Print 32- and 64-bit integers portably (Bug#8435).
22389 Without this change, on typical 64-bit hosts error ("...%d...", N)
22390 was used to print both 32- and 64-bit integers N, which relied on
22391 undefined behavior.
61bdb816 22392 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
22393 * lisp.h (error, verror): Mark as printf-like functions.
22394 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22395 Report overflow in size calculations when allocating printf buffer.
22396 Do not truncate output string at its first null byte.
22397 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22398 Truncate the output at a character boundary, since vsnprintf does not
22399 do that.
22400 * charset.c (check_iso_charset_parameter): Convert internal
22401 character to string before calling 'error', since %c now has the
22402 printf meaning.
22403 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22404 overflow when computing char to be passed to 'error'. Do not
22405 pass Lisp_Object to 'error'; pass the integer instead.
22406 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22407 formatted with plain %d.
22408
b189fa66
PE
22409 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22410
bff87ef0
PE
22411 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22412
7e2cac20
PE
22413 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22414
ce4d90b5
PE
22415 * xterm.c (x_catch_errors): Remove duplicate declaration.
22416
266c9547
PE
22417 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22418
79c49ad2
PE
22419 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22420
368f4090
JM
224212011-04-10 Jim Meyering <meyering@redhat.com>
22422
22423 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22424 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22425 return ssize_t not "int", and use size_t as the buffer length.
22426 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22427 * gnutls.h: Update declarations.
22428 * process.c (read_process_output): Use ssize_t, to match.
22429 (send_process): Likewise.
22430
a32d4040
CY
224312011-04-09 Chong Yidong <cyd@stupidchicken.com>
22432
22433 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22434
8546720e 224352011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 22436
04f2d78b
CB
22437 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22438 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 22439
8546720e
GM
22440 * xterm.c (handle_one_xevent):
22441 * xmenu.c (create_and_show_popup_menu):
22442 * xselect.c (x_decline_selection_request)
22443 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 22444
0a2f5c1a 224452011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
22446
22447 Fix some uses of `int' instead of EMACS_INT.
22448 * search.c (string_match_1, fast_string_match)
22449 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22450 (scan_buffer, find_next_newline_no_quit)
22451 (find_before_next_newline, search_command, Freplace_match)
22452 (Fmatch_data): Make some `int' variables be EMACS_INT.
22453
22454 * xdisp.c (display_count_lines): 3rd argument and return value now
22455 EMACS_INT. All callers changed.
22456 (pint2hrstr): Last argument is now EMACS_INT.
22457
22458 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22459 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22460 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22461 (decode_coding_utf_16, decode_coding_emacs_mule)
22462 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22463 (decode_coding_ccl, decode_coding_charset)
22464 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22465 (decode_coding_iso_2022, decode_coding_emacs_mule)
22466 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22467 <char_offset, last_offset>: Declare EMACS_INT.
22468 (encode_coding_utf_8, encode_coding_utf_16)
22469 (encode_coding_emacs_mule, encode_invocation_designation)
22470 (encode_designation_at_bol, encode_coding_iso_2022)
22471 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22472 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22473 Declare EMACS_INT.
22474 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22475 (encode_invocation_designation): Last argument P_NCHARS is now
22476 EMACS_INT.
22477 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22478 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22479
22480 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22481 All users changed.
22482
22483 * ccl.c (Fccl_execute_on_string): Declare some variables
22484 EMACS_INT.
22485
8546720e 224862011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
22487
22488 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22489
4e19a977
CS
224902011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22491
22492 * process.c (Fformat_network_address): Doc fix.
22493
87302331
R
224942011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22495
ee7683eb 22496 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 22497
cbb59342
CY
224982011-04-08 Chong Yidong <cyd@stupidchicken.com>
22499
22500 * keyboard.c (read_char): Call Lisp function help-form-show,
22501 instead of using internal_with_output_to_temp_buffer.
22502 (Qhelp_form_show): New var.
e0d38eeb 22503 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
22504
22505 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22506
22507 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22508
e67a13ab
CY
225092011-04-06 Chong Yidong <cyd@stupidchicken.com>
22510
04f2d78b
CB
22511 * process.c (Flist_processes): Remove to Lisp.
22512 (list_processes_1): Delete.
e67a13ab 22513
973f782d
EZ
225142011-04-06 Eli Zaretskii <eliz@gnu.org>
22515
7c106b1e
EZ
22516 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22517
973f782d
EZ
22518 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22519
41cf7d1a 225202011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 22521
ca23cc88
PE
22522 Fix more problems found by GCC 4.6.0's static checks.
22523
f390e2d5
PE
22524 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22525
42eea0d0
PE
22526 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22527
b69769da 22528 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 22529
f9541e84
PE
22530 * xdisp.c (vmessage): Mark as a printf-like function.
22531
13841b55
PE
22532 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22533
c136c10f
PE
22534 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22535
5e2d4a30
PE
22536 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22537 printf-like functions.
22538 (tiff_load): Add casts to remove these marks before passing them
22539 to system-supplied API.
22540
583f48b9
PE
22541 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22542
b25d760e
PE
22543 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22544 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
22545 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22546 directly, rather than having caller test rule sign. This avoids
22547 some unnecessary tests.
22548 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22549 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22550 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 22551
bc7b6697 22552 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 22553 (xfont_open): Avoid unnecessary tests.
bc7b6697 22554
27ccc379
PE
22555 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22556
dcd5c89a
PE
22557 * composite.h, composite.c (composition_gstring_put_cache):
22558 Use EMACS_INT, not int, for length.
22559
b13a45c6
PE
22560 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22561 breaking out part of COMPOSITION_DECODE_RULE.
22562 (COMPOSITION_DECODE_RULE): Use it.
22563 * composite.c (get_composition_id): Remove unused local vars,
22564 by using the new macro.
22565
1e792e4d
PE
22566 * textprop.c (set_text_properties_1): Change while to do-while,
22567 since the condition is always true at first.
22568
dc6c6455 22569 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
22570 (interval_deletion_adjustment): Return unsigned value.
22571 All uses changed.
dc6c6455 22572
aba7731a
PE
22573 * process.c (list_processes_1, create_pty, read_process_output):
22574 (exec_sentinel): Remove vars that were set but not used.
afd4052b 22575 (create_pty): Remove unnecessary "volatile"s.
bc57d757 22576 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 22577 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 22578 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 22579
fdfc4bf3
PE
22580 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22581
fca8fe46 22582 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 22583 (update_syntax_table): Use unsigned instead of int.
fca8fe46 22584
06a0259a 22585 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 22586 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 22587 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 22588
e7b9e80f
PE
22589 * print.c (print_error_message): Avoid int overflow.
22590
56201685
PE
22591 * font.c (font_list_entities): Redo for clarity,
22592 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22593
78834453 22594 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 22595 (font_score): Avoid potential overflow in diff calculation.
78834453 22596
0bc0b309 22597 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 22598 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 22599
e610eaca
PE
22600 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22601
b895abce
PE
22602 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22603 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22604 can always succeed if overflow has undefined behavior.
22605
1f1d9321 22606 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 22607 (wordify): Omit three unnecessary tests.
1f1d9321 22608
c59478bc
PE
22609 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22610 All callers changed. This avoids the need for an unused var.
22611
79b73827
PE
22612 * casefiddle.c (casify_region): Remove var that is set but not used.
22613
a4db5dfe
PE
22614 * dired.c (file_name_completion): Remove var that is set but not used.
22615
43aae36e
PE
22616 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22617
2a47c44d 22618 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 22619 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 22620
a37c69bf
PE
22621 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22622 Check for integer overflow on size calculations.
22623
328ab8e7
PE
22624 * buffer.c (Fprevious_overlay_change): Remove var that is set
22625 but not used.
22626
e5a2a5cb
PE
22627 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22628 Remove vars that are set but not used.
8d84a6eb 22629 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 22630 (timer_check_2): Mark vars as initialized.
e5a2a5cb 22631
a60e5f68
PE
22632 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22633
f661cb61 22634 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 22635 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 22636
f0397f5a
PE
22637 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22638 that are set but not used.
22639
8664db06 22640 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 22641 if XCreateBitmapFromData fails (Bug#8410).
8664db06 22642
6abdaa4a
PE
22643 * xselect.c (x_get_local_selection, x_handle_property_notify):
22644 Remove vars that are set but not used.
22645
0ce7538d 22646 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 22647 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 22648
9ae848fc
PE
22649 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22650 Remove var that is set but not used.
0b918413
PE
22651 (scroll_bar_windows_size): Now size_t, not int.
22652 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22653 Check for overflow.
9ae848fc 22654
a5a62657
PE
22655 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22656 (map_tty_color) [!defined MSDOS]: Likewise.
22657
5c5cdd39
PE
22658 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22659
66ebf983
PE
22660 * coding.c: Remove vars that are set but not used.
22661 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22662 All callers changed.
22663 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22664 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22665 (decode_coding_charset): Remove vars that are set but not used.
22666
1be4d761
PE
22667 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22668 that is set but not used.
22669
47553fa8
PE
22670 * print.c (print_object): Remove var that is set but not used.
22671
1f7196bf 22672 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
22673 The gnulib version avoids calling malloc in the usual case,
22674 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22675 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22676 * filelock.c (current_lock_owner): Likewise.
22677 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22678 * sysdep.c: Include allocator.h, careadlinkat.h.
22679 (emacs_no_realloc_allocator): New static constant.
22680 (emacs_readlink): New function.
fdb61804
PE
22681 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22682 ../lib/careadlinkat.h.
d1fdcab7 22683
f84c17c7
SM
226842011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22685
22686 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22687 first non-nil return value).
22688
ef3862ad
JD
226892011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22690
22691 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22692 if not defined (Bug#8403).
22693
376a7006
JB
226942011-04-02 Juanma Barranquero <lekktu@gmail.com>
22695
22696 * xdisp.c (display_count_lines): Remove parameter `start',
22697 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22698 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22699 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22700 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22701 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22702 and thereabouts. All callers changed.
22703 (get_per_char_metric): Remove parameter `f', unused since
22704 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22705
6ca3801d
JM
227062011-04-02 Jim Meyering <meyering@redhat.com>
22707
22708 do not dereference NULL upon failed strdup
22709 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22710 (ns_get_family): Likewise.
22711
d8e2b5ba
JB
227122011-04-02 Juanma Barranquero <lekktu@gmail.com>
22713
22714 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22715
8c74fcbd
JD
227162011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22717
22718 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22719 later (Bug#8403).
22720
7200d79c
SM
227212011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22722
03408648 22723 Add lexical binding.
7200d79c 22724
03408648
SM
22725 * window.c (Ftemp_output_buffer_show): New fun.
22726 (Fsave_window_excursion):
22727 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22728
22729 * lread.c (lisp_file_lexically_bound_p): New function.
22730 (Fload): Bind Qlexical_binding.
22731 (readevalloop): Remove `evalfun' arg.
22732 Bind Qinternal_interpreter_environment.
22733 (Feval_buffer): Bind Qlexical_binding.
22734 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22735 Mark as dynamic.
22736 (syms_of_lread): Declare `lexical-binding'.
22737
22738 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22739
22740 * keyboard.c (eval_dyn): New fun.
22741 (menu_item_eval_property): Use it.
ca105506
SM
22742
22743 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 22744
03408648
SM
22745 * fns.c (concat, mapcar1): Accept byte-code-functions.
22746
22747 * eval.c (Fsetq): Handle lexical vars.
22748 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22749 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22750 (FletX, Flet): Obey lexical binding.
22751 (Fcommandp): Handle closures.
22752 (Feval): New `lexical' arg.
22753 (eval_sub): New function extracted from Feval. Use it almost
22754 everywhere where Feval was used. Look up vars in lexical env.
22755 Handle closures.
22756 (Ffunctionp): Move from subr.el.
22757 (Ffuncall): Handle closures.
22758 (apply_lambda): Remove `eval_flags'.
22759 (funcall_lambda): Handle closures and new byte-code-functions.
22760 (Fspecial_variable_p): New function.
22761 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22762 but without exporting it to Lisp.
23aba0ea 22763
23aba0ea 22764 * doc.c (Fdocumentation, store_function_docstring):
03408648 22765 * data.c (Finteractive_form): Handle closures.
23aba0ea 22766
03408648
SM
22767 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22768 interactive spec.
ba83908c 22769
04f2d78b
CB
22770 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22771 New byte-codes.
03408648
SM
22772 (exec_byte_code): New function extracted from Fbyte_code to handle new
22773 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 22774
03408648 22775 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 22776
03408648 22777 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 22778
e2abce01
JB
227792011-03-31 Juanma Barranquero <lekktu@gmail.com>
22780
22781 * xdisp.c (redisplay_internal): Fix prototype.
22782
63696a73 227832011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 22784
63696a73 22785 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
22786 (try_scrolling): Use it when setting scroll_limit.
22787 Limit scrolling to 100 screen lines.
63696a73
EZ
22788 (redisplay_window): Even when falling back on "recentering",
22789 position point in the window according to scroll-conservatively,
22790 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22791
22792 (try_scrolling): When point is above the window, allow searching
22793 as far as scroll_max, or one screenful, to compute vertical
22794 distance from PT to the scroll margin position. This prevents
22795 try_scrolling from unnecessarily failing when
22796 scroll-conservatively is set to a value slightly larger than the
22797 window height. Clean up the case of PT below the margin at bottom
22798 of window: scroll_max can no longer be INT_MAX. When aggressive
22799 scrolling is in use, don't let point enter the opposite scroll
22800 margin as result of the scroll.
22801 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
22802 threshold of 100 lines for never-recentering scrolling.
22803
e4cc2dfc
JB
228042011-03-31 Juanma Barranquero <lekktu@gmail.com>
22805
22806 * dispextern.h (move_it_by_lines):
22807 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22808 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22809 (message_log_check_duplicate): Remove parameters `prev_bol' and
22810 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22811 (redisplay_internal): Remove parameter `preserve_echo_area',
22812 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22813
22814 * indent.c (Fvertical_motion):
22815 * window.c (window_scroll_pixel_based, Frecenter):
22816 Don't pass `need_y_p' to `move_it_by_lines'.
22817
1c470562
SM
228182011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22819
44f230aa
SM
22820 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22821 steal a few bits to be more compact.
22822 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22823 Remove unneeded casts.
22824
1c470562
SM
22825 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22826
888adce9
ZK
228272011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22828
22829 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22830 binding" message (bug#7967).
22831
f838ed7b
PE
228322011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22833
77861b95
PE
22834 Fix more problems found by GCC 4.6.0's static checks.
22835
de6dbc14
PE
22836 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22837 Remove unused local var.
22838
f838ed7b
PE
22839 * editfns.c (Fmessage_box): Remove unused local var.
22840
792c7b2b
PE
22841 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22842 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22843 Omit unused local vars.
c499e557 22844 * window.c (shrink_windows): Omit unused local var.
b01a1c29 22845 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
22846 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22847 Omit unused local var.
22848
ba0165e1
PE
22849 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22850 Don't assume string length fits in int.
32ad8845 22851 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 22852 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 22853
3c59b4c9
PE
22854 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22855 instead of alloca (Bug#8344).
22856
a3eed478 22857 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 22858 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 22859
eb4d412d
PE
22860 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22861
1658b401
PE
22862 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22863 concerns.
22864
22865 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22866
22867 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 22868
9a2c6e05
PE
22869 * keyboard.c (syms_of_keyboard): Use the same style as later
22870 in this function when indexing through an array. This also
22871 works around GCC bug 48267.
22872
03d0a109
PE
22873 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22874
44f730c8
PE
22875 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22876
fe75f926
PE
22877 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22878 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22879
ffa8c828
PE
22880 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22881 This avoids undefined behavior on integer overflow, and is a bit
22882 more convenient anyway since it is compared to a size_t variable.
22883
c5101a77
PE
22884 Variadic C functions now count arguments with size_t, not int.
22885 This avoids an unnecessary limitation on 64-bit machines, which
22886 caused (substring ...) to crash on large vectors (Bug#8344).
22887 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22888 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 22889 All variadic functions and their callers changed accordingly.
c5101a77
PE
22890 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22891 * data.c (arith_driver, float_arith_driver): Likewise.
22892 * editfns.c (general_insert_function): Likewise.
22893 * eval.c (struct backtrace.nargs, interactive_p)
22894 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22895 (funcall_lambda, mark_backtrace): Likewise.
22896 * fns.c (concat): Likewise.
22897 * frame.c (x_set_frame_parameters): Likewise.
22898 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22899 0 if not found, not -1. All callers changed.
22900
dd3f25f7
PE
22901 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22902 (stack_copy_size): Now size_t, not int.
22903 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22904
461c2ab9
JB
229052011-03-28 Juanma Barranquero <lekktu@gmail.com>
22906
22907 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22908 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22909 All callers changed.
22910
22911 * lisp.h (multibyte_char_to_unibyte):
22912 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22913 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22914 * character.h (CHAR_TO_BYTE8):
22915 * cmds.c (internal_self_insert):
22916 * editfns.c (general_insert_function):
22917 * keymap.c (push_key_description):
22918 * search.c (Freplace_match):
22919 * xdisp.c (message_dolog, set_message_1): All callers changed.
22920
f6d62986
SM
229212011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22922
22923 * keyboard.c (safe_run_hook_funcall): New function.
22924 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22925 don't set the hook to nil, but remove the offending function instead.
22926 (Qcommand_hook_internal): Remove, unused.
22927 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22928 Vcommand_hook_internal.
22929
22930 * eval.c (enum run_hooks_condition): Remove.
22931 (funcall_nil, funcall_not): New functions.
22932 (run_hook_with_args): Call each function through a `funcall' argument.
22933 Remove `cond' argument, now redundant.
22934 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22935 (Frun_hook_with_args_until_failure): Adjust accordingly.
22936 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22937
1db5b1ad
JB
229382011-03-28 Juanma Barranquero <lekktu@gmail.com>
22939
22940 * dispextern.h (string_buffer_position): Remove declaration.
22941
22942 * print.c (strout): Remove parameter `multibyte', unused since
22943 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22944
22945 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22946 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22947 All callers changed.
22948
22949 * w32.c (_wsa_errlist): Use braces for struct initializers.
22950
22951 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22952 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22953 All callers changed.
22954 (string_buffer_position): Likewise. Also, make static (it's never
22955 used outside xdisp.c).
22956 (cursor_row_p): Remove parameter `w', unused since
22957 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22958 (decode_mode_spec): Remove parameter `precision', introduced during
22959 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22960 All callers changed.
22961
5ffb62aa
JD
229622011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22963
22964 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22965
461c2ab9 229662011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
22967
22968 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22969 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22970 (ns_update_auto_hide_menu_bar): New functions.
22971 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22972 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22973 ns_constrain_all_frames.
22974 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22975 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22976
5c380ffb
JD
229772011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22978
22979 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22980
9af30bdf
GM
229812011-03-27 Glenn Morris <rgm@gnu.org>
22982
22983 * syssignal.h: Replace RETSIGTYPE with void.
22984 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22985 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22986 Replace SIGTYPE with void everywhere.
22987 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22988 * s/template.h (SIGTYPE): Remove commented out definition.
22989
e2abce01
JB
229902011-03-26 Eli Zaretskii <eliz@gnu.org>
22991
22992 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22993 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22994
f868cd8a
JB
229952011-03-26 Juanma Barranquero <lekktu@gmail.com>
22996
59eb0929
JB
22997 * w32.c (read_unc_volume): Use parameter `henum', instead of
22998 global variable `wget_enum_handle'.
22999
23000 * keymap.c (describe_vector): Remove parameters `indices' and
23001 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23002 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23003
f868cd8a
JB
23004 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23005
23006 * keyboard.c (timer_check): Remove parameter `do_it_now',
23007 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23008 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23009 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23010
23011 * keyboard.c (read_char):
23012 * w32menu.c (w32_menu_display_help):
23013 * xmenu.c (show_help_event, menu_help_callback):
23014 Adjust calls to `show_help_echo'.
23015
23016 * gtkutil.c (xg_maybe_add_timer):
23017 * keyboard.c (readable_events):
23018 * process.c (wait_reading_process_output):
23019 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23020
23021 * insdel.c (adjust_markers_gap_motion):
23022 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23023 (gap_left, gap_right): Don't call it.
23024
2ecf6fdb
CY
230252011-03-25 Chong Yidong <cyd@stupidchicken.com>
23026
23027 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23028 incurred during fontification.
23029
6b1f9ba4
JB
230302011-03-25 Juanma Barranquero <lekktu@gmail.com>
23031
23032 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23033 (DEFVAR_PER_BUFFER): Don't pass it.
23034
23035 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23036 (scrolling_window): Don't pass it.
23037
0f4a96b5
JB
230382011-03-25 Juanma Barranquero <lekktu@gmail.com>
23039
23040 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23041
23042 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23043 and `suffix'.
23044 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23045 of variables specific to SELinux and computation of `encoded_absname'.
23046
23047 * image.c (XPutPixel): Remove unused variable `height'.
23048
23049 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23050
23051 * unexw32.c (get_section_info): Remove unused variable `section'.
23052
23053 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23054 (system_process_attributes): Remove unused variable `sess'.
23055 (sys_read): Remove unused variable `err'.
23056
23057 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23058 (w32_wnd_proc): Remove unused variable `isdead'.
23059 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23060 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23061 (x_create_tip_frame): Remove unused variable `tem'.
23062
23063 * w32inevt.c (w32_console_read_socket):
23064 Remove unused variable `no_events'.
23065
23066 * w32term.c (x_draw_composite_glyph_string_foreground):
23067 Remove unused variable `width'.
23068
1149507c
JB
230692011-03-24 Juanma Barranquero <lekktu@gmail.com>
23070
23071 * w32term.c (x_set_glyph_string_clipping):
23072 Don't pass uninitialized region to CombineRgn.
23073
9c88f339
JB
230742011-03-23 Juanma Barranquero <lekktu@gmail.com>
23075
23076 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23077 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23078 (Fx_close_connection): Remove unused variable `i'.
23079
23080 * w32font.c (w32font_draw): Return number of glyphs.
23081 (w32font_open_internal): Remove unused variable `i'.
23082 (w32font_driver): Add missing initializer.
23083
23084 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23085 (fill_in_menu): Remove unused variable `items_added'.
23086
23087 * w32term.c (last_mouse_press_frame): Remove static global variable.
23088 (w32_clip_to_row): Remove unused variable `f'.
23089 (x_delete_terminal): Remove unused variable `i'.
23090
23091 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23092 (NOTHING): Remove unused static global variable.
23093 (uniscribe_check_otf): Remove unused variable `table'.
23094 (uniscribe_font_driver): Add missing initializers.
23095
dee091a3
JD
230962011-03-23 Julien Danjou <julien@danjou.info>
23097
23098 * term.c (Fsuspend_tty, Fresume_tty):
23099 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23100 * window.c (temp_output_buffer_show):
23101 * insdel.c (signal_before_change):
23102 * frame.c (Fhandle_switch_frame):
23103 * fileio.c (Fdo_auto_save):
23104 * emacs.c (Fkill_emacs):
23105 * editfns.c (save_excursion_restore):
23106 * cmds.c (internal_self_insert):
23107 * callint.c (Fcall_interactively):
23108 * buffer.c (Fkill_all_local_variables):
23109 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23110 Use Frun_hooks.
0f4a96b5 23111 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 23112 unconditionally since it does the check itself.
dee091a3 23113
2c520ab5 231142011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 23115
c9c49752
PE
23116 Fix more problems found by GCC 4.5.2's static checks.
23117
8abc3f12
PE
23118 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23119 the first time through the loop, since we know p0 < p1 then.
23120 This also avoids a gcc -Wstrict-overflow warning.
23121
a2d26660
PE
23122 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23123 leading to a memory leak, possible in functions like
23124 load_charset_map_from_file that can allocate an unbounded number
b12ef411 23125 of objects (Bug#8318).
a2d26660 23126
916c72e9
PE
23127 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23128 that could (at least in theory) be that large.
23129
19ab8a18
PE
23130 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23131 This is less likely to overflow, and avoids undefined behavior if
23132 overflow does occur. All callers changed. Use strtoul to scan
23133 for the unsigned long integer.
b7cbbd6f
PE
23134 (pint2hrstr): Simplify and tune code slightly.
23135 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 23136
f0641eff
PE
23137 * scroll.c (do_scrolling): Work around GCC bug 48228.
23138 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23139
7f650bb9
PE
23140 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23141 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
23142 (validate_x_resource_name): Simplify count usage.
23143 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 23144
37dd57d1
PE
23145 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23146 fail (Bug#8306).
81e56e61 23147
699979fc 23148 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 23149
401bf9b4
PE
23150 * process.c (Fmake_network_process): Use socklen_t, not int,
23151 where POSIX says socklen_t is required in portable programs.
23152 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 23153 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
23154 (Fmake_network_process, server_accept_connection):
23155 (wait_reading_process_output, read_process_output):
23156 Likewise.
23157
b93aacde
PE
23158 * process.c: Rename or move locals to avoid shadowing.
23159 (list_processes_1, Fmake_network_process):
23160 (read_process_output_error_handler, exec_sentinel_error_handler):
23161 Rename or move locals.
4dc343ee 23162 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 23163 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 23164 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 23165 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 23166 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 23167
af8a867c 23168 Make tparam.h and terminfo.c consistent.
44f230aa
SM
23169 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23170 Include tparam.h instead, since it declares them.
af8a867c
PE
23171 * cm.h (PC): Remove extern decl; tparam.h now does this.
23172 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23173 * terminfo.c: Include tparam.h, to check interfaces.
23174 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23175 (tparam): Adjust signature to match interface in tparam.h;
23176 this removes some undefined behavior. Check that outstring and len
23177 are zero, which they always are with Emacs.
23178 * tparam.h (PC, BC, UP): New extern decls.
23179
0248044d 23180 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 23181 (xftfont_open): Rename locals to avoid shadowing.
0248044d 23182
8ff096c1 23183 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
23184 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23185 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 23186 (ftfont_list): Remove unused local.
49eaafba
PE
23187 (get_adstyle_property, ftfont_pattern_entity):
23188 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23189 Rename locals to avoid shadowing.
8ff096c1 23190
e2be39f6
PE
23191 * xfont.c (xfont_list_family): Mark var as initialized.
23192
c9735e30
PE
23193 * xml.c (make_dom): Now static.
23194
8f5201ae
PE
23195 * composite.c (composition_compute_stop_pos): Rename local to
23196 avoid shadowing.
b246f932
PE
23197 (composition_reseat_it): Remove unused locals.
23198 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 23199 (composition_update_it): Mark var as initialized.
11b61122
PE
23200 (find_automatic_composition): Mark vars as initialized,
23201 with a FIXME (Bug#8290).
8f5201ae 23202
760fbc2c
PE
23203 character.h: Rename locals to avoid shadowing.
23204 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23205 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23206 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23207 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23208 to avoid shadowing.
23209
ff08eb85
PE
23210 * textprop.c (property_change_between_p): Remove; unused.
23211
fc7bf025
PE
23212 * intervals.c (interval_start_pos): Now static.
23213
235d7abc
PE
23214 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23215
44f230aa
SM
23216 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23217 Rename locals to avoid shadowing.
3e7d6594 23218
50060332
PE
23219 * sound.c (wav_play, au_play, Fplay_sound_internal):
23220 Fix pointer signedness.
d01f234b 23221 (alsa_choose_format): Remove unused local var.
c83b8872
PE
23222 (wav_play): Initialize a variable to 0, to prevent undefined
23223 behavior (Bug#8278).
50060332 23224
c4fc4e30
PE
23225 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23226
918436ed
PE
23227 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23228
c939f91b
PE
23229 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23230 clobbering (Bug#8298).
b9c7f648
PE
23231 * sysdep.c (sys_subshell): Likewise.
23232 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 23233
6bd8c144
PE
23234 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23235 This should get cleaned up, so that child_setup has the
23236 same signature on all platforms.
23237
7710357c 23238 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 23239 (relocate_fd): Rename locals to avoid shadowing.
7710357c 23240
c59da222
CY
232412011-03-22 Chong Yidong <cyd@stupidchicken.com>
23242
23243 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23244 not to be necessary, and produces flickering.
23245
66b87493
GM
232462011-03-20 Glenn Morris <rgm@gnu.org>
23247
23248 * config.in: Remove file.
23249
45b6f6d5
JB
232502011-03-20 Juanma Barranquero <lekktu@gmail.com>
23251
23252 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23253 are now in src/globals.h.
23254 (syms_of_minibuf): Remove spurious & from previous change.
23255
cd394be1 232562011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
23257
23258 * minibuf.c (completing-read-function): New variable.
23259 (completing-read-default): Rename from completing-read.
23260 (completing-read): Call completing-read-function.
23261
b14e3e21
CY
232622011-03-19 Juanma Barranquero <lekktu@gmail.com>
23263
23264 * xfaces.c (Fx_load_color_file):
23265 Read color file from absolute filename (bug#8250).
23266
f2b726e6
JB
232672011-03-19 Juanma Barranquero <lekktu@gmail.com>
23268
23269 * makefile.w32-in: Update dependencies.
23270
09f6ff02
EZ
232712011-03-17 Eli Zaretskii <eliz@gnu.org>
23272
23273 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23274
29a6015a
PE
232752011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23276
a3a6c54e
PE
23277 Fix more problems found by GCC 4.5.2's static checks.
23278
b766f867
PE
23279 * process.c (make_serial_process_unwind, send_process_trap):
23280 (sigchld_handler): Now static.
23281
be02381c
PE
23282 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23283 That way, the code declares only the vars that it needs.
23284 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23285 * s/cygwin.h (PTY_ITERATION): Likewise.
23286 * s/darwin.h (PTY_ITERATION): Likewise.
23287 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23288
57048744
PE
23289 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23290 * process.c (allocate_pty): Don't declare stb unless it's needed.
23291
7914961c 23292 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
23293 (CONSTANTLIM): Remove; unused.
23294 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23295 Define only if needed.
7914961c 23296
b3967b18
PE
23297 * unexelf.c (unexec): Name an expression,
23298 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
23299 Use a different way to cause a compilation error if anyone uses
23300 n rather than nn, a way that does not involve shadowing.
73366a00 23301 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 23302
29a6015a
PE
23303 * deps.mk (unexalpha.o): Remove; unused.
23304
43cfc33e 23305 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 23306 * unexec.h: New file.
ce701a33
PE
23307 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23308 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23309 Depend on unexec.h.
23310 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23311 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23312 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 23313 Change as necessary to match prototype in unexec.h.
ce701a33 23314
01f44d5a
PE
23315 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23316 shadowing.
4f63c6bb 23317 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 23318
a6670b0b
PE
23319 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23320 Rename locals to avoid shadowing.
23321
cef2010d 23322 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 23323 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 23324
d4d7173a
PE
23325 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23326
f08b802a
PE
23327 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23328 warning when compiling print.c.
23329
3ddb0639
PE
23330 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23331 instead of using an uninitialized var.
5ad03b97 23332 (font_sort_entities): Mark var as initialized.
3ddb0639 23333
170a2692
PE
23334 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23335
e663c700
PE
23336 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23337 pointers to constants.
89bc529a 23338 (font_parse_fcname): Remove unused vars.
7b81e2d0 23339 (font_delete_unmatched): Now static.
ea838e10 23340 (font_get_spec): Remove; unused.
13a547c6
PE
23341 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23342 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23343 Rename or move locals to avoid shadowing.
e663c700 23344
2a80c887 23345 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 23346 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 23347
1384fa33 23348 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 23349 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 23350
8b2c52e9
PE
23351 * alloc.c (mark_backtrace): Move decl from here ...
23352 * lisp.h: ... to here, so that it can be checked.
23353
475545b5 23354 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 23355 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
23356 (lisp_indirect_variable): Name an expression,
23357 to avoid gcc -Wbad-function-cast warning.
1faed8ae 23358 (Fdefvar): Rename locals to avoid shadowing.
475545b5 23359
b1349114 23360 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 23361 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 23362 Use const pointer when appropriate.
b1349114 23363
a2928364
PE
23364 * lisp.h (get_system_name, get_operating_system_release):
23365 Move decls here, to check interfaces.
23366 * process.c (get_operating_system_release): Move decl to lisp.h.
23367 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
23368 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23369 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23370 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
23371 (Fformat_time_string, Fencode_time, Finsert_char):
23372 (Ftranslate_region_internal, Fformat):
23373 Rename or remove local vars to avoid shadowing.
9710023e 23374 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 23375
a415e694
PE
23376 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23377 avoid shadowing.
23378
8ef4622d
PE
23379 * lisp.h (eassert): Check that the argument compiles, even if
23380 ENABLE_CHECKING is not defined.
23381
946f9a5b
PE
23382 * data.c (Findirect_variable): Name an expression, to avoid
23383 gcc -Wbad-function-cast warning.
112396d6 23384 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 23385 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
23386 (Fmake_variable_buffer_local, Fmake_local_variable):
23387 Mark variables as initialized.
52746918 23388 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 23389
e5aab7e7 23390 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
23391 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23392 Rename locals to avoid shadowing.
dff45157
PE
23393 (mark_stack): Move local variables into the #ifdef region where
23394 they're used.
7bc26fdb
PE
23395 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23396 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23397 needed otherwise.
23398 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23399 (GC_STRING_CHARS): Remove; not used.
d40d4be1 23400 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 23401
e5aab7e7
PE
23402 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23403 avoids undefined behavior in theory.
23404
4da60324
PE
23405 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23406
88043301
PE
23407 Use functions, not macros, for up- and down-casing (Bug#8254).
23408 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23409 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23410 to use the following functions instead of these macros.
23411 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23412 EMACS_INT, since callers assume the returned value fits in int.
23413 (upcase1): Likewise, for UPCASE_TABLE.
23414 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 23415 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 23416 the race-condition problem in the old DOWNCASE.
88043301 23417
19ed5445
PE
23418 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23419 Rename locals to avoid shadowing.
23420 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
23421 (regex_compile, re_search_2, re_match_2_internal):
23422 Remove unused local vars.
952db0d7
PE
23423 (FREE_VAR): Rewrite so as not to use empty "else",
23424 which gcc can warn about.
da053e48 23425 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
23426 (RETALLOC_IF): Define only if needed.
23427 (WORDCHAR_P): Likewise. This one is never needed, but is used
23428 only in a comment talking about a compiler bug, so put inside
23429 the #if 0 of that comment.
23430 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23431 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23432 Remove; unused.
19ed5445 23433
1f3561e4 23434 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
23435 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23436 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 23437
ded6f8f7
PE
23438 * search.c (simple_search): Remove unused var.
23439
dbd37a95
PE
23440 * dired.c (compile_pattern): Move decl from here ...
23441 * lisp.h: ... to here, so that it can be checked.
23442 (struct re_registers): New forward decl.
23443
7e47afad
PE
23444 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23445
85f24f61
PE
23446 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23447 All uses changed.
23448 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23449 Rename locals to avoid shadowing.
5671df8f 23450 (Fvertical_motion): Mark locals as initialized.
85f24f61 23451
181aa2be 23452 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 23453 (casify_region): Mark local as initialized.
181aa2be 23454
930d429c
PE
23455 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23456
7082eac6
PE
23457 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23458 New macros, so that the caller can use some names other than
23459 gcpro1, gcpro2, etc.
23460 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23461 of the new macros.
23462 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23463 argument, for consistency with GCPRO2_VAR, etc: it is now the
23464 prefix of the variable, not the variable itself. All uses
23465 changed.
38b2c076
PE
23466 * dired.c (directory_files_internal, file_name_completion):
23467 Rename locals to avoid shadowing.
23468
15206ed9
PE
23469 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23470 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23471 dired.c's scmp function, had undefined behavior.
23472 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23473 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23474 * buffer.h: ... to here, because these macros use current_buffer,
23475 and the new implementation with inline functions needs to have
23476 current_buffer in scope now, rather than later when the macros
23477 are used.
23478 (downcase, upcase1): New static inline functions.
23479 (DOWNCASE, UPCASE1): Reimplement using these functions.
23480 This avoids undefined behavior in expressions like
23481 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23482 from race conditions in accessing the global variables
23483 case_temp1 and case_temp2.
23484 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23485 * lisp.h (case_temp1, case_temp2): Remove their decls.
23486 * character.h (ASCII_CHAR_P): Move from here ...
23487 * lisp.h: ... to here, so that the inline functions mentioned
23488 above can use them.
23489
4a6bea26
PE
23490 * dired.c (directory_files_internal_unwind): Now static.
23491
f14b7e14
PE
23492 * fileio.c (file_name_as_directory, directory_file_name):
23493 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23494 Now static.
2893f146
PE
23495 (file_name_as_directory): Use const pointers when appropriate.
23496 (Fexpand_file_name): Likewise. In particular, newdir might
23497 point at constant storage, so make it a const pointer.
fd4ead52 23498 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
23499 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23500 signedness issues.
f839df0c
PE
23501 (Fset_file_times, Finsert_file_contents, auto_save_error):
23502 Rename locals to avoid shadowing.
f14b7e14 23503
5716756e 23504 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
23505 (Ftry_completion, Fall_completions): Rename or remove locals
23506 to avoid shadowing.
5716756e 23507
b4c3046a
PE
23508 * marker.c (bytepos_to_charpos): Remove; unused.
23509
b45db522
PE
23510 * lisp.h (verify_bytepos, count_markers): New decls,
23511 so that gcc does not warn that these functions aren't declared.
23512
85876d07
PE
23513 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23514 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 23515 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 23516 (copy_text): Remove unused local var.
85876d07 23517
03d78a21 23518 * filelock.c (within_one_second): Now static.
b3dd38ab 23519 (lock_file_1): Rename local to avoid shadowing.
03d78a21 23520
5df8f01b
PE
23521 * buffer.c (fix_overlays_before): Mark locals as initialized.
23522 (fix_start_end_in_overlays): Likewise. This function should be
23523 simplified by using pointers-to-pointers, but that's a different
23524 matter.
b1d876f1 23525 (switch_to_buffer_1): Now static.
8f54f30a
PE
23526 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23527 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 23528
a70072c9 23529 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 23530 Fix pointer signedness issue.
edced198
PE
23531 (sys_subshell): Mark local as volatile if checking for lint,
23532 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 23533 (MAXPATHLEN): Define only if needed.
a70072c9 23534
a0977c44
PE
23535 * process.c (serial_open, serial_configure): Move decls from here ...
23536 * systty.h: ... to here, so that they can be checked.
23537
a884fdcc
PE
23538 * fns.c (get_random, seed_random): Move extern decls from here ...
23539 * lisp.h: ... to here, so that they can be checked.
23540
604efe86 23541 * sysdep.c (reset_io): Now static.
b8950c94 23542 (wait_for_termination_signal): Remove; unused.
604efe86 23543
38fc62d9
PE
23544 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23545 (copy_keymap_item, append_key, push_text_char_description):
23546 Now static.
1004a21a 23547 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 23548 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
23549 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23550 (describe_map_tree):
23551 Rename locals to avoid shadowing.
38fc62d9 23552
2f2650da
PE
23553 * keyboard.c: Declare functions static if they are not used elsewhere.
23554 (echo_char, echo_dash, cmd_error, top_level_2):
23555 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
23556 (read_char, kbd_buffer_get_event, make_lispy_position):
23557 (make_lispy_event, make_lispy_movement, apply_modifiers):
23558 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23559 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23560 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 23561 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 23562 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 23563
a053e86c 23564 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
23565 (mark_kboards): Move decl here ...
23566 * alloc.c (mark_kboards): ... from here.
a053e86c 23567
4752793e
PE
23568 * lisp.h (force_auto_save_soon): New decl.
23569
74f10ca7 23570 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
23571 (DEFINE_DUMMY_FUNCTION): New macro.
23572 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23573 Use it.
c03cd23f
PE
23574 (main): Add casts to avoid warnings
23575 if GCC considers string literals to be constants.
74f10ca7 23576
022e70d4
PE
23577 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23578
59d6fe83
PE
23579 * dbusbind.c: Pointer signedness fixes.
23580 (xd_signature, xd_append_arg, xd_initialize):
23581 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23582 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23583 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23584 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23585
78320123
PE
23586 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23587 if GCC considers string literals to be constants.
49cebcca 23588 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 23589
35ac2a97
SM
235902011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23591
fb103ca9
SM
23592 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23593 (print_preprocess, print_object): New macro to fix last change.
23594
35ac2a97
SM
23595 * print.c (print_preprocess): Don't forget font objects.
23596
62973b41
JB
235972011-03-16 Juanma Barranquero <lekktu@gmail.com>
23598
23599 * emacs.c (USAGE3): Doc fixes.
23600
0e48bb22
AS
236012011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23602
23603 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23604 structure.
23605
7684e57b
JB
236062011-03-14 Juanma Barranquero <lekktu@gmail.com>
23607
23608 * lisp.h (VWindow_system, Qfile_name_history):
23609 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23610 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23611 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23612
23613 * w32select.c: Don't #include "keyboard.h".
c96bbc66 23614 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
23615
23616 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23617 * w32console.c (detect_input_pending, read_input_pending)
23618 (encode_terminal_code):
23619 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23620 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23621 (w32_system_caret_y, Qfile_name_history):
23622 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23623 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23624 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23625 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23626 * w32proc.c (Qlocal, report_file_error):
23627 * w32term.c (Vwindow_system, updating_frame):
23628 * w32uniscribe.c (initialized, uniscribe_font_driver):
23629 Remove unneeded extern declarations.
23630
2aa46d6c
CY
236312011-03-14 Chong Yidong <cyd@stupidchicken.com>
23632
c96bbc66 23633 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 23634
cffc6f3b
CY
236352011-03-13 Chong Yidong <cyd@stupidchicken.com>
23636
23637 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23638 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23639 These macros can no longer be used for assignment.
23640
44f230aa
SM
23641 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23642 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
23643 (record_buffer_markers, fetch_buffer_markers): New functions for
23644 recording and fetching special buffer markers.
23645 (set_buffer_internal_1, set_buffer_temp): Use them.
23646
23647 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23648
23649 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23650
23651 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23652 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23653
23654 * xdisp.c (hscroll_window_tree):
23655 (reconsider_clip_changes): Use PT instead of BUF_PT.
23656
d251f04b
EZ
236572011-03-13 Eli Zaretskii <eliz@gnu.org>
23658
23659 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23660 $(EMACS_ROOT)/lib/intprops.h.
23661
f0c77cd1
PE
236622011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23663
3eca4629
PE
23664 Fix more problems found by GCC 4.5.2's static checks.
23665
7c86ee98
PE
23666 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23667 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
23668 (xg_free_frame_widgets): Make it clear that a local variable is
23669 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
23670 (gdk_window_get_screen): Make it clear that this macro is needed
23671 only if USE_GTK_TOOLTIP.
1e5524e7
PE
23672 (int_gtk_range_get_value): New function, which avoids a diagnostic
23673 from gcc -Wbad-function-cast.
23674 (xg_set_toolkit_scroll_bar_thumb): Use it.
23675 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23676 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
23677 (get_utf8_string, xg_get_file_with_chooser):
23678 Rename locals to avoid shadowing.
23679 (create_dialog): Move locals to avoid shadowing.
7c86ee98 23680
41729b81
PE
23681 * xgselect.c (xg_select): Remove unused var.
23682
f0c77cd1
PE
23683 * image.c (four_corners_best): Mark locals as initialized.
23684 (gif_load): Initialize transparent_p to zero (Bug#8238).
23685 Mark another local as initialized.
ec6cf4c6 23686 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 23687
ce0ad53d 23688 * image.c (clear_image_cache): Now static.
d5d5a617 23689 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 23690 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
23691 (x_edge_detection): Remove unnecessary cast that
23692 gcc -Wbad-function-cast diagnoses.
2037898d 23693 (gif_load): Fix pointer signedness.
6ae141d6
PE
23694 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23695 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 23696
33383987 236972011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 23698
d32df629
PE
23699 Improve quality of tests for time stamp overflow.
23700 For example, without this patch (encode-time 0 0 0 1 1
23701 1152921504606846976) returns the obviously-bogus value (-948597
23702 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23703 reports time overflow. See
23704 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
23705 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23706 * editfns.c: Include limits.h and intprops.h.
23707 (TIME_T_MIN, TIME_T_MAX): New macros.
23708 (time_overflow): Move earlier, to before first use.
23709 (hi_time, lo_time): New functions, for an accurate test for
23710 out-of-range times.
23711 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23712 (Fget_internal_run_time): Don't assume time_t fits in int.
23713 (make_time): Use list2 instead of Fcons twice.
23714 (Fdecode_time): More accurate test for out-of-range times.
23715 (check_tm_member): New function.
23716 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
23717 (lisp_time_argument): Don't rely on undefined left-shift and
23718 right-shift behavior when checking for time stamp overflow.
8be6f318 23719
fe31d94c
PE
23720 * editfns.c (time_overflow): New function, refactoring common code.
23721 (Fformat_time_string, Fdecode_time, Fencode_time):
23722 (Fcurrent_time_string): Use it.
23723
8be6f318
PE
23724 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23725 * dired.c (make_time): Move to ...
23726 * editfns.c (make_time): ... here.
23727 * systime.h: Note the move.
23728
09d9db2c 237292011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 23730
126bc0dc
YM
23731 * fringe.c (update_window_fringes): Remove unused variables.
23732
c47cbdfd
YM
23733 * unexmacosx.c (copy_data_segment): Also copy __got section.
23734 (Bug#8223)
23735
7ac80be9
EZ
237362011-03-12 Eli Zaretskii <eliz@gnu.org>
23737
c96bbc66 23738 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
23739 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23740 Constify `char *' arguments and their references according to
23741 prototypes in tparam.h.
23742
ecb0f94d 23743 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 23744
7ac80be9
EZ
23745 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23746 Adapt all references accordingly.
23747
23748 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23749
ef1fd07e
TT
237502011-03-11 Tom Tromey <tromey@redhat.com>
23751
23752 * buffer.c (syms_of_buffer): Remove obsolete comment.
23753
7ef4b50c
EZ
237542011-03-11 Eli Zaretskii <eliz@gnu.org>
23755
23756 * termhooks.h (encode_terminal_code): Declare prototype.
23757
23758 * msdos.c (encode_terminal_code): Don't declare prototype.
23759
23760 * term.c (encode_terminal_code): Now external again, used by
23761 w32console.c and msdos.c.
23762
44f230aa
SM
23763 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23764 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 23765
4b1ec863 237662011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 23767
1714f52b 23768 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 23769
4b1ec863
PE
23770 * fringe.c (update_window_fringes): Mark locals as initialized
23771 (Bug#8227).
23772 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 23773
524c7aa6
PE
23774 * alloc.c (mark_fringe_data): Move decl from here ...
23775 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23776 to check its interface.
23777 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23778
a5c0af81 23779 * fontset.c (free_realized_fontset): Now static.
7519b8cd 23780 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 23781 (fontset_font): Mark local as initialized.
a9a06e0b 23782 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 23783
b4716021
PE
23784 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23785
811e9bac 23786 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 23787 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
23788 (x_own_selection, Fx_disown_selection_internal): Rename locals
23789 to avoid shadowing.
23790 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 23791
7e3ab302
PE
23792 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23793 so that the caller can use some name other than gcpro1.
23794 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
23795 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23796 (Fx_backspace_delete_keys_p):
23797 Use them to avoid shadowing, and rename vars to avoid shadowing.
23798 (x_decode_color, x_set_name, x_window): Now static.
6b437900 23799 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 23800 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
23801 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23802 Remove unused locals.
7e3ab302
PE
23803 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23804 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23805 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23806 macros.
f78faa98 23807
e2b13473
PE
23808 * xterm.h (x_mouse_leave): New decl.
23809
77f23912
PE
23810 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23811 Remove unused functions.
cdf4ba58
PE
23812 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23813 (x_calc_absolute_position): Now static.
7411c686 23814 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 23815 Don't declare local "event" unless it's used.
ed7bf3a5
PE
23816 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23817 unless they are used.
38d0b34a
PE
23818 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23819 (x_fatal_error_signal): Remove; not used.
a6067996
PE
23820 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23821 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23822 (x_error_catcher, x_connection_closed, x_error_handler):
23823 (x_error_quitter, xembed_send_message, x_iconify_frame):
23824 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 23825 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 23826 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 23827
44f230aa
SM
23828 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23829 Rename or move locals to avoid shadowing.
6b463e58 23830 (tty_defined_color, merge_face_heights): Now static.
5967d051 23831 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
23832 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23833 does not deduce is never used uninitialized.
73719eba
PE
23834 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23835 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 23836
426994c3 23837 * terminal.c (store_terminal_param): Now static.
5489860b 23838
032f1620 23839 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 23840 (set_frame_menubar): Remove unused local.
d4323972 23841 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
23842 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23843 since they might point to immutable storage.
281585b0
PE
23844 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23845 since it's unused otherwise.
032f1620 23846
367c19e5 23847 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 23848 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
23849 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23850 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 23851 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
23852 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23853 does not deduce are never used uninitialized.
70739cbe 23854
07b48fa9
PE
23855 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23856
8868a238 23857 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
23858 * window.c (window_loop, size_window):
23859 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 23860
7e5cf297 23861 * window.c (display_buffer): Now static.
d6550a9f
PE
23862 (size_window): Mark variables that gcc -Wuninitialized
23863 does not deduce are never used uninitialized.
a586633d
PE
23864 * window.h (check_all_windows): New decl, to forestall
23865 gcc -Wmissing-prototypes diagnostic.
5b555da1 23866 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 23867
f6095868
PE
23868 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23869 shadowing.
23870 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
23871 Include <limits.h>.
23872 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23873 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
23874 (load_charset_map): Mark variables that gcc -Wuninitialized
23875 does not deduce are never used uninitialized.
53df7c11 23876 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 23877
f38b440c
PE
23878 * coding.c (coding_set_source, coding_set_destination):
23879 Use "else { /* comment */ }" rather than "else /* comment */;"
23880 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
23881 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23882 a block, when the outer 'i' will do.
23883 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23884 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23885 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23886 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23887 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23888 Rename locals to avoid shadowing.
23889 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
23890 * coding.c (emacs_mule_char, encode_invocation_designation):
23891 Now static, since they're not used elsewhere.
413bb2db 23892 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 23893 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
23894 (decode_coding_emacs_mule): Mark variables that gcc
23895 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
23896 (detect_coding_iso_2022): Initialize a local variable that might
23897 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 23898 this initialization is needed. (Bug#8211)
5f58e762
PE
23899 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23900 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23901 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23902 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23903 Remove unused macros.
f38b440c 23904
232b38b9 23905 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 23906 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 23907 * character.c (string_count_byte8): Likewise.
232b38b9 23908
fb90da1b
PE
23909 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23910 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23911
fb93dbc2
PE
23912 * chartab.c (copy_sub_char_table): Now static, since it's not used
23913 elsewhere.
5c156ace
PE
23914 (sub_char_table_ref_and_range, char_table_ref_and_range):
23915 Rename locals to avoid shadowing.
bbcd0949 23916 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 23917
7d3b3862 23918 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 23919 (BIDI_BOB): Remove unused macro.
7d3b3862 23920
6be7d3da
PE
23921 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23922 deduce are never used uninitialized.
c2ed9c8b 23923 * term.c (encode_terminal_code): Likewise.
6be7d3da 23924
75f8807f 23925 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 23926
50938595
PE
23927 * tparam.h: New file.
23928 * term.c, tparam.h: Include it.
23929 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23930 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23931 Move these decls to tparam.h, and make them agree with what
23932 is actually in tparam.c. The previous trick of using incompatible
23933 decls in different modules does not conform to the C standard.
23934 All callers of tparam changed to use tparam's actual API.
23935 * tparam.c (tparam1, tparam, tgoto):
23936 Use const pointers where appropriate.
23937
fbceeba2
PE
23938 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23939 * cm.h (struct cm): Likewise.
23940 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23941 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23942 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23943 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23944 (turn_on_face, init_tty): Likewise.
23945 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 23946
7f3f1250
PE
23947 * term.c (term_mouse_position): Rename local to avoid shadowing.
23948
e6ca6543
PE
23949 * alloc.c (mark_ttys): Move decl from here ...
23950 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23951
c40f8d15
AS
239522011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23953
23954 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23955
cfe0661d
JB
239562011-03-09 Juanma Barranquero <lekktu@gmail.com>
23957
23958 * search.c (compile_pattern_1): Remove argument regp, unused since
23959 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23960 (compile_pattern): Don't pass it.
23961
0afb4571
J
239622011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23963
23964 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23965 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23966 for ! HAVE_GTK3.
23967 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23968
23969 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23970
23971 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23972 gdk_window_get_screen, gdk_window_get_geometry,
23973 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23974 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23975 (xg_get_pixbuf_from_pixmap): New function.
23976 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23977 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23978 Call xg_get_pixbuf_from_pixmap instead of
23979 gdk_pixbuf_get_from_drawable.
23980 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23981 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23982 (xg_check_special_colors): Use GtkStyleContext and its functions
23983 for HAVE_GTK3.
23984 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23985 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23986 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
23987 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23988 Call gtk_widget_get_preferred_size.
0afb4571
J
23989 (xg_frame_resized): gdk_window_get_geometry only takes 5
23990 parameters.
44f230aa
SM
23991 (xg_win_to_widget, xg_event_is_for_menubar):
23992 Call gdk_x11_window_lookup_for_display.
0afb4571
J
23993 (xg_set_widget_bg): New function.
23994 (delete_cb): New function.
895009e1 23995 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 23996 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
23997 (xg_set_background_color): Call xg_set_widget_bg.
23998 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23999 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24000 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24001 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24002 if ! HAVE_GTK3.
24003 (update_frame_tool_bar): Call gtk_widget_hide.
24004 (xg_initialize): Use GDK_KEY_g.
24005
24006 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24007 if ! HAVE_GTK3
24008 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24009
24010 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24011 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24012 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24013
1c2cc4ef
JB
240142011-03-08 Juanma Barranquero <lekktu@gmail.com>
24015
24016 * w32xfns.c (select_palette): Check success of RealizePalette against
24017 GDI_ERROR, not zero.
24018
33383987 24019See ChangeLog.11 for earlier changes.
aac0c6e3
MR
24020
24021;; Local Variables:
24022;; coding: utf-8
aac0c6e3
MR
24023;; End:
24024
ab422c4d 24025 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
24026
24027 This file is part of GNU Emacs.
24028
24029 GNU Emacs is free software: you can redistribute it and/or modify
24030 it under the terms of the GNU General Public License as published by
24031 the Free Software Foundation, either version 3 of the License, or
24032 (at your option) any later version.
24033
24034 GNU Emacs is distributed in the hope that it will be useful,
24035 but WITHOUT ANY WARRANTY; without even the implied warranty of
24036 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24037 GNU General Public License for more details.
24038
24039 You should have received a copy of the GNU General Public License
24040 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.