* make-dist (files): Add nt/Makefile.in, nt/gnulib.mk.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
df065a0b
EZ
12013-05-16 Eli Zaretskii <eliz@gnu.org>
2
04d360e7
EZ
3 * insdel.c (insert_1_both): Document the arguments, instead of
4 referring to insert_1, which no longer exists.
5
5bb98290
EZ
6 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
7 some window, increment windows_or_buffers_changed, so that
8 *Messages* display in that window is updated. (Bug#14408)
9
df065a0b
EZ
10 * w32.c: Include epaths.h.
11 (init_environment): Use cmdproxy.exe without leading directories.
12 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
13 case.
14 (gettimeofday): Adjust signature and return value to Posix
15 expectations.
16
17 * unexw32.c (open_output_file): Delete the existing emacs.exe
18 before creating it, to break the hard link to the versioned
19 executable.
20
21 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
22 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
23 (FIRSTFILE_OBJ): New variables.
24 (W32_RES): Rename to EMACSRES. All users changed.
25 (base_obj): Use $(CM_OBJ).
26 (ALLOBJS): Use $(FIRSTFILE_OBJ).
27 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
28 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
29 $(W32_RES_LINK) before $(LIBES).
30 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
31
1aa8d505
SM
322013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
33
6e911150
SM
34 * makefile.w32-in (DOC): Use just "DOC".
35
36 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
37
1aa8d505
SM
38 * process.c: Export default filters and sentinels to Elisp.
39 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
40 New constants.
41 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
42 (Fset_process_sentinel, Fformat_network_address):
43 Default to them instead of nil.
44 (server_accept_connection): Sentinels can't be nil any more.
45 (read_and_dispose_of_process_output): New function, extracted from
46 read_process_output.
47 (read_process_output): Use it; filters can't be nil.
48 (Finternal_default_process_filter): New function, extracted from
49 read_process_output.
50 (exec_sentinel_unwind): Remove function.
51 (exec_sentinel): Don't zilch sentinel while running.
52 (status_notify): Sentinels can't be nil.
53 (Finternal_default_process_sentinel): New function extracted from
54 status_notify.
55 (setup_process_coding_systems): Default filter is not nil any more.
56 (syms_of_process): Export new Elisp functions and initialize
57 new constants.
58 * lisp.h (make_lisp_proc): New function.
59
5ac2eb34
SM
602013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
61
62 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
63
eda9c7d7
EZ
642013-05-14 Eli Zaretskii <eliz@gnu.org>
65
66 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
5ac2eb34
SM
67 unless we know that the window w is a leaf window.
68 Another attempt at solving bug#14062.
eda9c7d7 69
8fdeaad5
JD
702013-05-14 Jan Djärv <jan.h.d@swipnet.se>
71
72 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
73 fdesc (Bug#14375).
74
44aa9ee6
PE
752013-05-12 Paul Eggert <eggert@cs.ucla.edu>
76
77 * image.c (gif_load): Check that subimages fit (Bug#14345).
78
759fd763
SM
792013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
80
81 * lread.c (skip_dyn_eof): New function.
82 (read1): Use it to skip the end of a file in response to #@00.
83
84 * doc.c (get_doc_string): Slightly relax the sanity checking.
85
4465bfb4
JD
862013-05-09 Jan Djärv <jan.h.d@swipnet.se>
87
88 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
89 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
90 (MonitorInfo): New struct.
91 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
92 (Fns_display_monitor_attributes_list): New functions.
93 (display-usable-bounds): Remove.
94 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
95 Qsource.
96
7583e2a0
PE
972013-05-09 Paul Eggert <eggert@cs.ucla.edu>
98
99 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
100 (GTK_CHECK_VERSION): New macro, if not already defined.
101 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
102 replaced by GTK_CHECK_VERSION.
103
ad75d77e
PE
1042013-05-08 Paul Eggert <eggert@cs.ucla.edu>
105
106 * xterm.h (GTK_PREREQ): New macro.
107 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
108 to use this macro instead, for consistency and clarity.
109
07525f77
EZ
1102013-05-08 Eli Zaretskii <eliz@gnu.org>
111
112 * xdisp.c (row_for_charpos_p): New function, with code of
113 cursor_row_p, but accepts an additional argument CHARPOS instead
114 of using a hardcoded PT.
115 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
116 (row_containing_pos): Call row_for_charpos_p instead of partially
117 doing the same. Fixes cursor positioning under longlines-mode
118 when longlines-show-effect includes more than one newline, when
119 moving the cursor vertically up.
120
d901fc8d
JB
1212013-05-08 Juanma Barranquero <lekktu@gmail.com>
122
123 * makefile.w32-in (ACL_H): New macro.
124 ($(BLD)/fileio.$(O)): Update dependencies.
125
f269bc61
PE
1262013-05-07 Paul Eggert <eggert@cs.ucla.edu>
127
ffdc270a
PE
128 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
129 * Makefile.in (LIB_ACL): New macro.
130 (LIBACL_LIBS): Remove.
131 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
132 * fileio.c: Include <acl.h>.
133 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
134 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
135 !acl_errno_valid.
136 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
137 it ourselves.
138
f269bc61
PE
139 * unexelf.c: Don't assume ElfW (Half) fits in int.
140 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
141 when dealing with ElfW (Half) values, since they can exceed 2**31
142 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
143 (entry_address): Omit unused NUM arg. All uses changed.
144
a261c53e
JL
1452013-05-07 Juri Linkov <juri@jurta.org>
146
147 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
148 to the string converted from number with `Fnumber_to_string'.
149 (Bug#14254)
150
2b66427d
PE
1512013-05-07 Paul Eggert <eggert@cs.ucla.edu>
152
153 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
154 This fixes a problem introduced by my previous change.
155
15acfe41
GM
1562013-05-07 Glenn Morris <rgm@gnu.org>
157
158 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
159
5ea03bf5
JD
1602013-05-07 Jan Djärv <jan.h.d@swipnet.se>
161
162 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
163
e0c9d565
PE
1642013-05-07 Paul Eggert <eggert@cs.ucla.edu>
165
166 Static checking by GCC 4.8.0.
167 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
168 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
169 (x_get_monitor_attributes_fallback)
170 (x_get_monitor_attributes_xinerama)
171 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
172 Define only if USE_GTK.
173 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
174 (x_get_monitor_attributes_fallback): Omit unused locals.
175 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
176 Use double, not float, to avoid mixed-mode floating point arithmetic.
177
4e3f9230
YM
1782013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
179 Jan Djärv <jan.h.d@swipnet.se>
180
181 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
182 (XINERAMA_CFLAGS): New macros.
183 (ALL_CFLAGS, LIBES): Use them.
184
185 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
186 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
187 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
188 (syms_of_xfns): DEFSYM them.
189 (struct MonitorInfo): New struct.
190 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
191 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
192 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
193 (x_get_monitor_attributes_xinerama): New functions.
194 (Fx_display_monitor_attributes_list): New primitive.
195 (syms_of_xfns): Defsubr it.
196
197 * xterm.h (x_display_info): Add Xatom_net_workarea and
198 Xatom_net_current_desktop.
199
200 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
201 and dpyinfo->Xatom_net_current_desktop.
202
05839b6a
EZ
2032013-05-06 Eli Zaretskii <eliz@gnu.org>
204
205 * xdisp.c (pos_visible_p): Use the special code for finding the
206 beginning of a display property or overlay for any "replacing"
207 display property, not just for display strings. This solves
208 incorrect reporting of position by posn-at-point. (Bug#14241)
209
dc4a2ee0
PE
2102013-05-06 Paul Eggert <eggert@cs.ucla.edu>
211
5ee94506
PE
212 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
213 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
214 Verify that ElfW (Half) fits in int.
215 (fatal): Use same signature as lisp.h.
216 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
217 configure and build with -DUNEXELF_DEBUG without worrying about
218 other modules that use DEBUG.
219 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
220 possibly-wide integers now uses it instead of plain fprintf.
221 (entry_address): New function, which avoids problems with 32-bit
222 overflow on 64-bit hosts.
223 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
224 (round_up): Don't assume the remainder fits in int.
225 (find_section): Use bool for boolean. Simplify debug code.
226 (unexec): Don't assume file sizes fit in int or size_t.
227 Omit unnecessary trailing newline in 'fatal' format.
228 Use strerror rather than outputting decimal error number.
229 Remove unused code when emacs is not defined;
230 this file relies on Emacs now.
231 Don't assume e_phnum and e_shnum are positive.
232
dc4a2ee0
PE
233 * regex.c: Fix problems when DEBUG is defined.
234 (extract_number, extract_number_and_incr): Define regardless of
235 whether DEBUG is defined; that's simpler and makes the code less
236 likely to go stale in the normal case when DEBUG is not defined.
237 Return int rather than taking an int * arg. All callers changed.
238 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
239 Remove, replacing with ...
240 (DEBUG_PRINT): New macro. All callers changed.
241 (DEBUG_COMPILES_ARGUMENTS): New macro.
242 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
243 (print_compiled_pattern, print_double_string) [DEBUG]:
244 Use prototype rather than old-style definition.
245 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
246 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
247 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
248 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
249 Don't assume ptrdiff_t, size_t, and long are the same width as int.
250 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
251 This matters only when DEBUG is defined.
252
14c7ed05
EZ
2532013-05-05 Eli Zaretskii <eliz@gnu.org>
254
255 * xdisp.c (set_iterator_to_next): Set the
256 ignore_overlay_strings_at_pos_p flag only if we are _really_
257 iterating over an overlay string, as indicated by the
258 current.overlay_string_index member. (Bug#14306)
259
e6076b1b
JD
2602013-05-05 Jan Djärv <jan.h.d@swipnet.se>
261
262 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
263 to where it is used, to avoid autorelease issues (Bug#14050).
264
cbee2131
PE
2652013-05-05 Paul Eggert <eggert@cs.ucla.edu>
266
267 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
268 * fileio.c (syms_of_fileio): Implement this.
269 * filelock.c (create_lock_file): If symbolic links don't work, so
270 we use a regular file as a lock file, do not fsync the lock file;
271 it's not needed.
272
30c7e542
SM
2732013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
274
275 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
276 (syms_of_minibuf): Adjust accodingly.
277 * lread.c (Fread):
278 * callint.c (Fcall_interactively): Adjust calls accordingly.
279
5bebd186
EZ
2802013-05-04 Eli Zaretskii <eliz@gnu.org>
281
282 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
30c7e542
SM
283 w->contents is a buffer before computing everything else.
284 Use parentheses to disambiguate last part of the condition.
5bebd186
EZ
285
286 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
287 assertion violations. (Bug#14062)
288
0fb0a4f3
DR
2892013-05-01 David Reitter <david.reitter@gmail.com>
290
291 * nsfns.m (ns_tooltip): Initialize.
292
9e63b4a5
EZ
2932013-04-28 Eli Zaretskii <eliz@gnu.org>
294
295 * coding.c (decode_coding_gap): Don't remove the character before
296 a newline unless it's a CR character. (Bug#14287)
297
ad60824e
DN
2982013-04-28 Dan Nicolaescu <dann@gnu.org>
299
300 * dispextern.h (struct face): Move enum face_underline_type
301 earlier so that bitfields can be in the same word.
302
edbdcec0
JD
3032013-04-28 Jan Djärv <jan.h.d@swipnet.se>
304
305 * nsfns.m (handlePanelKeys): New function.
306 (EmacsOpenPanel:performKeyEquivalent:)
307 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
308 arrows/function/control and copy/paste keys (Bug#14296).
309
0208ede7
JL
3102013-04-27 Juri Linkov <juri@jurta.org>
311
312 * callint.c (Fcall_interactively): Call `Qread_number' for
313 interactive code letter `n' instead of using duplicate code.
314 (Bug#14254)
315
b8dd59f7
PE
3162013-04-27 Paul Eggert <eggert@cs.ucla.edu>
317
318 * systime.h (make_timeval): Declare as 'const'.
319
8bd722db
KH
3202013-04-27 Kenichi Handa <handa@gnu.org>
321
322 * font.c (font_open_entity): Always open a font of manageable
323 size.
324
13d0e56f 3252013-04-26 Paul Eggert <eggert@cs.ucla.edu>
cbee2131 326
f780d632
PE
327 Port better to AIX (Bug#14258).
328 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
329 to pacify AIX xlc.
330
ec509856
KH
3312013-04-24 Kenichi Handa <handa@gnu.org>
332
333 * coding.c (decode_coding_iso_2022): When an invalid escape
334 sequence is encountered, reset the invocation and designation
335 status to the safest one.
336
84fc48e5
PE
3372013-04-22 Paul Eggert <eggert@cs.ucla.edu>
338
339 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
340 Without this fix, "make distclean" leaves stamp-h1 behind.
341
806bda47
EC
3422013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
343
344 * w32fns.c (w32_fullscreen_rect): New function to compute the
345 window rectangle for the given fullscreen mode.
346 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
347 longer tunes the window size. This keeps the window's edges flush
348 with the screen and allows the taskbar to hide itself in fullboth.
349
350 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
351 window decorations and uses the entire screen.
352
353 * w32term.h (w32_fullscreen_rect) Add prototype.
354 (struct w32_output): Replace normal_width, normal_height,
355 normal_top, and normal_left members with a single normal_placement
356 struct.
357 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
358 Remove macros.
359 (FRAME_NORMAL_PLACEMENT): New macro.
360
9cc2810b
JB
3612013-04-16 Juanma Barranquero <lekktu@gmail.com>
362
363 * minibuf.c (Ftest_completion): Silence compiler warning.
364
fd16b54c
EZ
3652013-04-15 Eli Zaretskii <eliz@gnu.org>
366
367 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
5fbcd237 368 bug#14062.
fd16b54c
EZ
369
370 * frame.h (WINDOW_FRAME): Protect macro and its argument with
371 parentheses.
372
373 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
374 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
375 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
376 parentheses where appropriate.
377
9e3379a0
PE
3782013-04-14 Paul Eggert <eggert@cs.ucla.edu>
379
380 * keyboard.c (timer_start_idle): Remove no-longer-used local.
381
ddd6b685
EZ
3822013-04-14 Eli Zaretskii <eliz@gnu.org>
383
384 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
385 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
386 Mention in the doc string that setting these variables takes
387 effect only after a call to set-window-buffer. (Bug#14200)
388
29b79ba1
EZ
3892013-04-13 Eli Zaretskii <eliz@gnu.org>
390
391 * indent.c (Fvertical_motion): Don't consider display strings on
392 overlay strings as display strings on the buffer position we
393 started from. This prevents vertical cursor motion from jumping
394 more than one line when there's an overlay string with a display
395 property at end of line.
396 Reported by Karl Chen <Karl.Chen@quarl.org> in
397 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
398
562c6ee9
SM
3992013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
400
401 * window.c (select_window): `record_buffer' even if window is
402 already selected (bug#14191).
403
fcc1fe85
EZ
4042013-04-11 Eli Zaretskii <eliz@gnu.org>
405
406 * window.c (Fwindow_end): Test more flags, including the buffer's
407 last_overlay_modified flag, to determine whether the window's
408 display is really up-to-date. Prevents the function from
409 returning a stale value. (Bug#14170)
410 (Fwindow_line_height): Fix the test for up-to-date-ness of the
411 current matrix.
412
f009190a
EZ
4132013-04-10 Eli Zaretskii <eliz@gnu.org>
414
415 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
562c6ee9
SM
416 garbaged only if it is not already the top frame on its TTY.
417 This prevents flickering due to constant redrawing of TTY frames when
f009190a
EZ
418 there are GUI frames open in the same session. (Bug#13864)
419
78ce603d
SM
4202013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
421
422 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
423 of marking the idle timers directly.
424
a8036e40
SM
4252013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
426
427 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
428 tables (bug#14054).
429
7ffe7ef6
SM
4302013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
431
432 * window.c (select_window): Don't record_buffer while the invariant is
433 temporarily broken (bug#14161).
434
435 * fns.c (Fdelq): Don't assume !NILP => CONSP.
436
7d9f6883
EZ
4372013-04-07 Eli Zaretskii <eliz@gnu.org>
438
439 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
440
5406cfd9
RF
4412013-04-07 Romain Francoise <romain@orebokech.com>
442
443 Ignore additional platform-specific ACL errors (Bug#13702).
444 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
445 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
446
95c0e83b
JD
4472013-03-31 Jan Djärv <jan.h.d@swipnet.se>
448
449 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
450 f->output_data.ns.
451
876da980
PE
4522013-04-07 Paul Eggert <eggert@cs.ucla.edu>
453
454 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
455 This bug was introduced by my 2013-02-25 change that simplified
456 data_start configuration. Without this change, on GNU/Linux
457 an Emacs configured with --enable-profiling fails immediately
458 due to a profiler signal.
459 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
460 with these flags. On platforms where special flags are needed
461 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
462 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
463 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
464
7452b7bd
DA
4652013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
466
467 Get rid of some platform-specific functions examining window
468 system and its capabilities. This is a partial rework of the
469 2013-04-05 change.
470 * lisp.h (have_menus_p): Remove prototype. This function is
471 replaced with platform-independent window_system_available.
472 (check_window_system): Move to...
473 * frame.h (decode_window_system_frame, window_system_available):
474 ...here, add new prototypes.
475 * frame.c (window_system_available, decode_window_system_frame):
476 New functions.
477 (check_window_system): Platform-independent now.
478 * xterm.h (x_in_use): Remove declaration.
479 (check_x_frame):
480 * w32term.h (check_x_frame):
481 * nsterm.h (check_x_frame): Remove prototypes. This function
482 is replaced with platform-independent decode_window_system_frame.
483 * msdos.c (have_menus_p): Remove.
484 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
485 Remove platform-specific functions. Use check_window_system,
486 decode_window_system_frame and check_ns_display_info where
487 appropriate. Minor style and comment tweaks.
488 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
489 (check_x_frame): Likewise.
490 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
491 Likewise.
492 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
493 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
494 * xmenu.c, xselect.c: All related users changed.
495
251e9147
KH
4962013-04-03 Kenichi Handa <handa@gnu.org>
497
498 The following changes is to optimize the code for reading UTF-8
499 files.
500
562c6ee9 501 * coding.c (check_ascii): Rename from detect_ascii. Return value
251e9147
KH
502 changed. Check EOL format. Do not call adjust_coding_eol_type
503 here.
504 (check_utf_8): New function.
505 (adjust_coding_eol_type): Do nothing if already adjusted.
506 (detect_coding): Compare the return value of check_ascii with
507 coding->src_bytes. Call adjust_coding_eol_type if necessary.
508 (decode_coding_gap): Optimize for valid UTF-8.
509
8bc369d4
KH
5102013-03-21 Kenichi Handa <handa@gnu.org>
511
512 * coding.c (syms_of_coding): Cancel previous change.
513
514 * insdel.c (insert_from_gap): Fix previous change.
515
73931ad1
DA
5162013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
517
518 Consistently use platform-specific function to detect window system.
519 * lisp.h (check_window_system): New prototype. This function is
520 going to replace check_x, check_w32 and check_ns.
521 (have_menus_p): Mention msdos.c in comment.
522 * fontset.c (check_window_system_func): Remove. Adjust all users.
523 * fontset.h (check_window_system_func): Remove prototype.
524 * nsterm.h (check_ns):
525 * xterm.h (check_x):
526 * w32term.h (check_w32): Likewise.
527 * menu.c (Fx_popup_menu): Use check_window_system.
528 * msdos.c (check_window_system): Define for MS-DOS.
529 * nsfns.m (check_window_system): Define for NS. Adjust all users.
530 * w32fns.c (check_window_system): Likewise for MS-Windows.
531 * xfns.c (check_window_system): Likewise for X.
532 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
533 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
534
7216e43b
PE
5352013-04-02 Paul Eggert <eggert@cs.ucla.edu>
536
537 Prefer < to > in range checks such as 0 <= i && i < N.
538 This makes it easier to visualize quantities on a number line.
539 This patch doesn't apply to all such range checks,
540 only to the range checks affected by the 2013-03-24 change.
541 This patch reverts most of the 2013-03-24 change.
542 * alloc.c (xpalloc, Fgarbage_collect):
543 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
544 * character.c (string_escape_byte8):
545 * charset.c (read_hex):
546 * data.c (cons_to_unsigned):
547 * dispnew.c (update_frame_1):
548 * doc.c (Fsubstitute_command_keys):
549 * doprnt.c (doprnt):
550 * editfns.c (hi_time, decode_time_components):
551 * fileio.c (file_offset):
552 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
553 * font.c (font_intern_prop):
554 * frame.c (x_set_alpha):
555 * gtkutil.c (get_utf8_string):
556 * indent.c (check_display_width):
557 * keymap.c (Fkey_description):
558 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
559 * lread.c (read1):
560 * minibuf.c (read_minibuf_noninteractive):
561 * process.c (wait_reading_process_output):
562 * search.c (Freplace_match):
563 * window.c (get_phys_cursor_glyph):
564 * xdisp.c (redisplay_internal):
565 * xsmfns.c (smc_save_yourself_CB):
566 Prefer < to > for range checks.
567 * dispnew.c (sit_for): Don't mishandle NaNs.
568 This fixes a bug introduced in the 2013-03-24 change.
569 * editfns.c (decode_time_components): Don't hoist comparison.
570 This fixes another bug introduced in the 2013-03-24 change.
571
92759988
DA
5722013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
573
574 * frame.h (struct frame): Drop scroll_bottom_vpos
575 member becaue all real users are dead long ago.
576 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
577 * xdisp.c (redisplay_internal): Adjust user.
578
9a1971bb
GM
5792013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
580
f38ab167
JD
581 * nsmenu.m (showAtX:Y:for:): setLevel to
582 NSPopUpMenuWindowLevel (Bug#13998).
583
6d01f1fe
JD
5842013-03-30 Jan Djärv <jan.h.d@swipnet.se>
585
586 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
587 (ns_check_pending_open_menu): Declare.
588
589 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
590 (x_activate_menubar): Update the menu with title that matches
591 ns_get_pending_menu_title, and call
592 ns_check_pending_openmenu (Bug#12698).
593 (menuWillOpen:): New method.
594 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
595
596 * nsterm.m (menu_will_open_state, menu_mouse_point)
597 (menu_pending_title): New varaibles.
598 (ns_get_pending_menu_title, ns_check_menu_open)
599 (ns_check_pending_open_menu): New functions.
600
781f4782
DA
6012013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
602
603 * indent.c (current_column_bol_cache): Remove leftover which is not
604 used in Fmove_to_column any more.
605 (current_column, scan_for_column): Adjust users.
606 * keyboard.c (last_point_position_buffer, last_point_position_window):
607 Remove leftovers which are not used for recording undo any more.
608 (command_loop_1, syms_of_keyboard): Adjust users.
609 * xdisp.c (last_max_ascent): Remove leftover which is not used in
610 redisplay_window any more.
611 (move_it_to): Adjust user.
612
1921c31b
JB
6132013-03-29 Juanma Barranquero <lekktu@gmail.com>
614
615 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
616 Update dependencies.
617
717b8bcd
SM
6182013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
619
620 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
621 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
622 forward references.
623
e74aeda8
DA
6242013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
625
626 * window.h (struct window): Replace hchild, vchild and buffer slots
627 with the only contents slot. This is possible because each valid
628 window may have either the child window (in vertical or horizontal
629 combination) or buffer to display (for the leaf window). Using that,
630 a lof of operations to traverse and/or change window hierarchies may
631 be simplified. New member horizontal is used to distinguish between
632 horizontal and vertical combinations of internal windows.
633 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
634 (WINDOW_VERTICAL_COMBINATION_P): New macros.
635 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
636 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
637 Use contents slot, not buffer, where appropriate.
638 (wset_combination): New function.
639 (wset_buffer): Add eassert.
640 (Fframe_first_window): Simplify the loop reaching first window.
641 (Fwindow_buffer): Use WINDOW_LEAF_P.
642 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
643 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
644 (unshow_buffer): Convert initial debugging check to eassert.
645 (replace_window, recombine_windows, Fdelete_other_windows_internal)
646 (make_parent_window, window_resize_check, window_resize_apply)
647 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
648 (Fset_window_configuration, delete_all_child_windows, save_window_save):
649 Adjust to match struct window changes.
650 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
651 (mark_window_cursors_off, count_windows, get_leaf_windows)
652 (foreach_window_1): Simplify the loop.
653 * alloc.c (mark_object): Do not check for the leaf window because
654 internal windows has no glyph matrices anyway.
655 * dispnew.c (clear_window_matrices, showing_window_margins_p)
656 (allocate_matrices_for_window_redisplay, fake_current_matrices)
657 (allocate_matrices_for_frame_redisplay, free_window_matrices)
658 (build_frame_matrix_from_window_tree, mirror_make_current)
659 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
660 (update_window_tree, set_window_update_flags): Simplify the loop.
661 (sync_window_with_frame_matrix_rows): Enforce live window.
662 Use contents slot, not buffer, where appropriate.
663 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
664 and WINDOW_HORIZONTAL_COMBINATION_P.
665 (make_frame_visible_1): Simplify the loop.
666 Use contents slot, not buffer, where appropriate.
667 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
668 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
669 (expose_window_tree): Likewise.
670 Use contents slot, not buffer, where appropriate.
671 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
672 to avoid deleted windows. Use contents slot instead of buffer.
673 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
674 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
675 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
676 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
677
121ab1cd
EZ
6782013-03-28 Eli Zaretskii <eliz@gnu.org>
679
ef454cf7
EZ
680 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
681 identify the reasons for assertion violations in bug#14062 and
682 similar ones.
21e930f8
EZ
683 (Fx_show_tip): Fix compilation error under
684 "--enable-check-lisp-object-type". (Bug#14073)
ef454cf7 685
121ab1cd
EZ
686 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
687 Reported by <rzl24ozi@gmail.com>.
688
5c89ca24
DA
6892013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
690
691 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
692 start marker...
562c6ee9
SM
693 (unwind_with_echo_area_buffer): ...to restore it here.
694 This is needed to ensure that...
5c89ca24
DA
695 (redisplay_window): ...both window markers are valid here,
696 which is verified by eassert.
697 * editfns.c (save_excursion_save): Do not assume that
698 selected_window always displays the buffer.
c7f53895
DA
699 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
700 Fix comment.
5c89ca24 701
f557c1b1
SM
7022013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
703
704 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
705 the upcase table.
706
40693bba 7072013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
708
709 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
710
c86f791f
EZ
7112013-03-27 Eli Zaretskii <eliz@gnu.org>
712
713 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
714 since MinGW's w32api headers do. This avoids compiler warnings.
715
716 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
717 if already defined.
718
c6e72e17
EZ
7192013-03-26 Eli Zaretskii <eliz@gnu.org>
720
721 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
722
54e95010
JD
7232013-03-26 Jan Djärv <jan.h.d@swipnet.se>
724
725 * gtkutil.c (style_changed_cb): Check if frame is live and an
726 X frame (Bug#14038).
727
b88b62de
EZ
7282013-03-26 Eli Zaretskii <eliz@gnu.org>
729
a18d7de6
EZ
730 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
731 Define only for _WIN32_WINNT less than 0x0500.
da9dcbb8
EZ
732 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
733 MinGW64.
8f5e14c8
EZ
734 Move inclusion of time.h before sys/time.h, so that MinGW64 could
735 see its own definitions of 'struct timeval' and 'struct timezone'.
a18d7de6 736
b88b62de
EZ
737 Fix incompatibilities between MinGW.org and MinGW64 headers.
738 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
739
740 * w32.c (REPARSE_DATA_BUFFER): Guard with
741 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
742
c074e458
JD
7432013-03-25 Jan Djärv <jan.h.d@swipnet.se>
744
745 * xterm.c: Include X11/XKBlib.h
746 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
747
908589fd
AS
7482013-03-24 Andreas Schwab <schwab@linux-m68k.org>
749
750 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
751 written backwards.
752 * blockinput.h (input_blocked_p): Likewise.
753 * bytecode.c (exec_byte_code): Likewise.
754 * callproc.c (call_process_kill, call_process_cleanup)
755 (Fcall_process): Likewise.
756 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
757 (Fccl_execute_on_string): Likewise.
758 * character.c (string_escape_byte8): Likewise.
759 * charset.c (read_hex): Likewise.
760 * cm.c (calccost): Likewise.
761 * data.c (cons_to_unsigned): Likewise.
762 * dired.c (directory_files_internal, file_name_completion):
763 Likewise.
764 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
765 (sit_for): Likewise.
766 * doc.c (Fsubstitute_command_keys): Likewise.
767 * doprnt.c (doprnt): Likewise.
768 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
769 * emacsgtkfixed.c: Likewise.
770 * fileio.c (file_offset, Fwrite_region): Likewise.
771 * floatfns.c (Fexpt, fmod_float): Likewise.
772 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
773 Likewise.
774 * font.c (font_intern_prop): Likewise.
775 * frame.c (x_set_alpha): Likewise.
776 * gtkutil.c (get_utf8_string): Likewise.
777 * indent.c (check_display_width): Likewise.
778 * intervals.c (create_root_interval, rotate_right, rotate_left)
779 (split_interval_right, split_interval_left)
780 (adjust_intervals_for_insertion, delete_node)
781 (interval_deletion_adjustment, adjust_intervals_for_deletion)
782 (merge_interval_right, merge_interval_left, copy_intervals)
783 (set_intervals_multibyte_1): Likewise.
784 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
785 * keymap.c (Fkey_description): Likewise.
786 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
787 * lread.c (openp, read_integer, read1, string_to_number):
788 Likewise.
789 * menu.c (ensure_menu_items): Likewise.
790 * minibuf.c (read_minibuf_noninteractive): Likewise.
791 * print.c (printchar, strout): Likewise.
792 * process.c (create_process, Faccept_process_output)
793 (wait_reading_process_output, read_process_output, send_process)
794 (wait_reading_process_output): Likewise.
795 * profiler.c (make_log, handle_profiler_signal): Likewise.
796 * regex.c (re_exec): Likewise.
797 * regex.h: Likewise.
798 * search.c (looking_at_1, Freplace_match): Likewise.
799 * sysdep.c (get_child_status, procfs_ttyname)
800 (procfs_get_total_memory): Likewise.
801 * systime.h (EMACS_TIME_VALID_P): Likewise.
802 * term.c (dissociate_if_controlling_tty): Likewise.
803 * window.c (get_phys_cursor_glyph): Likewise.
804 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
805 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
806 Likewise.
807 * xfns.c (Fx_window_property): Likewise.
808 * xmenu.c (set_frame_menubar): Likewise.
809 * xselect.c (x_get_window_property, x_handle_dnd_message):
810 Likewise.
811 * xsmfns.c (smc_save_yourself_CB): Likewise.
812 * xterm.c (x_scroll_bar_set_handle): Likewise.
813
2bf7d27a
DA
8142013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
815
816 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
817 to be optional or nil. Adjust comment and convert it to docstring.
818 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
819 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
820
a9ebfa0b
PE
8212013-03-24 Paul Eggert <eggert@cs.ucla.edu>
822
823 Static checking by GCC 4.8-20130319.
824 * image.c (gif_load): Assume pass < 3 to pacify GCC.
825 * process.c (Fset_process_datagram_address)
826 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
827 * xdisp.c (get_char_face_and_encoding):
828 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
829 (get_glyph_face_and_encoding): Prepare face before possibly using it.
830 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
831
4f3576ee
KB
8322013-03-24 Ken Brown <kbrown@cornell.edu>
833
789b5e9a
KB
834 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
835 fix compilation on 64-bit Cygwin, where underscores are not
836 automatically prepended.
837
4f3576ee
KB
838 * w32term.c (w32_initialize): Silence compiler warning.
839
b5b7745f
EZ
8402013-03-23 Eli Zaretskii <eliz@gnu.org>
841
cdc0d0bd
EZ
842 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
843 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
562c6ee9
SM
844 variables, to save and restore frame dimensions.
845 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
846 after returning from a 'fullscreen' configuration.
847 use SendMessage instead of PostMessage to send the SC_RESTORE message,
cdc0d0bd
EZ
848 to avoid races between the main thread and the input thread.
849
850 * w32term.h (struct w32_output): New members normal_width,
851 normal_height, normal_top, normal_left, and prev_fsmode.
852 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
853 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
854 members of a frame.
855
b5b7745f
EZ
856 * w32term.c (w32fullscreen_hook): Record last value of the frame's
857 'fullscreen' parameter. Always record previous width and height
858 of the frame, except when switching out of maximized modes, so
859 that they could be restored correctly, instead of resetting to the
860 default frame dimensions. Send SC_RESTORE command to the frame,
861 unless we are going to send SC_MAXIMIZE, to restore the frame
862 resize hints in the mouse pointer shown by the window manager.
863 (Bug#14032)
864
865 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
866
867 * lisp.h (get_frame_param): Adjust conditions for prototype
868 declaration.
869
a3454eed
KB
8702013-03-22 Ken Brown <kbrown@cornell.edu>
871
872 * unexcw.c: Drop unneeded inclusion of w32common.h.
873 (report_sheap_usage): Declare.
874 (read_exe_header): Add magic numbers for x86_64.
875 (fixup_executable): Fix printf format specifier for unsigned long
876 argument.
877
5a49b79c
DA
8782013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
879
880 * frame.h (struct frame): Put menu_bar_window under #ifdef
881 because this member is not needed when X toolkit is in use.
882 (fset_menu_bar_window):
883 * dispnew.c (clear_current_matrices, clear_desired_matrices)
884 (free_glyphs, update_frame):
885 * xdisp.c (expose_frame): Likewise.
886 (display_menu_bar): Likewise. Remove redundant eassert.
887 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
888 toolkit is in use.
889
d6723bf7
PE
8902013-03-21 Paul Eggert <eggert@cs.ucla.edu>
891
7b1123d8
PE
892 Use functions and constants to manipulate Lisp_Save_Value objects.
893 This replaces code that used macros and strings and token-pasting.
894 The change makes the C source a bit easier to follow,
895 and shrinks the Emacs executable a bit.
896 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
897 (make_save_value): Change 1st arg from string to enum. All callers
898 changed.
899 (INTX): Remove.
900 (mark_object): Use if, not #if, for GC_MARK_STACK.
901 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
902 (XSAVE_OBJECT): Now functions, not macros.
903 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
904 the constant was never used.
905 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
906 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
907 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
908 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
909 New constants.
910 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
911 type3 with a single member save_type. All uses changed.
912 (save_type, set_save_pointer, set_save_integer): New functions.
913 * print.c (PRINTX): Remove.
914
d6723bf7
PE
915 * alloc.c: Remove redundant static declarations.
916
5f24fa51
DA
9172013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
918
919 * window.h (struct window): Convert left_col, top_line, total_lines
920 and total_cols from Lisp_Objects to integers. Adjust comments.
921 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
922 Remove.
923 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
924 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
925 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
926 Adjust users where appropriate.
927
42143acd
DA
9282013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
929
930 * frame.h (struct frame): Drop resx and resy because the same data is
931 available from window system-specific output context. Adjust users.
562c6ee9
SM
932 (default_pixels_per_inch_x, default_pixels_per_inch_y):
933 New functions to provide defaults when no window system available.
42143acd 934 (FRAME_RES_X, FRAME_RES_Y): New macros.
562c6ee9 935 (NUMVAL): Move from xdisp.c.
42143acd
DA
936 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
937 (Ffont_face_attributes, Fopen_font):
938 * image.c (gs_load):
939 * w32font.c (fill_in_logfont):
940 * xdisp.c (calc_pixel_width_or_height):
941 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
942 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
943
c0a17406
KH
9442013-03-20 Kenichi Handa <handa@gnu.org>
945
946 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
947 to 1 (temporary workaround until a bug related to ASCII
948 optimization is fixed).
949
095d384d
DA
9502013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
951
952 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
953 Signal error if window is not internal. Adjust docstring.
954 (delete_all_child_windows): Use combination_limit to save the buffer.
955 (Fset_window_configuration): Adjust accordingly.
cf4bb06d
DA
956 * print.c (syms_of_print): Initialize debugging output not here...
957 (init_print_once): ...but in a new function here.
958 * lisp.h (init_print_once): Add prototype.
959 * emacs.c (main): Add call to init_print_once. Adjust comments.
095d384d 960
748fa866
DA
9612013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
962
963 * window.c (window_resize_check, window_resize_apply)
964 (window_from_coordinates, recombine_windows, set_window_buffer)
965 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
966 (Fsplit_window_internal, Fdelete_window_internal)
967 (freeze_window_starts): Use bool for booleans.
968 * window.h (window_frame_coordinates, resize_frame_windows)
969 (freeze_window_starts, set_window_buffer): Adjust prototypes.
970
81519fd2
SM
9712013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
972
973 * dispnew.c (bitch_at_user): Use `user-error'.
974
6db423a9
KB
9752013-03-17 Ken Brown <kbrown@cornell.edu>
976
977 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
978 as return type of image_background. (Bug#13981)
979 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
980
8f2906f5
JD
9812013-03-16 Jan Djärv <jan.h.d@swipnet.se>
982
960ce480 983 * nsterm.m (updateFrameSize:): Change resize increments if needed.
6615748a 984 (ns_select): Don't return with result uninitialized.
960ce480 985
8f2906f5
JD
986 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
987 and getDirectory.
988
81519fd2
SM
989 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
990 New functions.
8f2906f5
JD
991 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
992 directories. If filename is nil, get directory name (Bug#13932).
993 Use getFilename and getDirectory.
994 (getFilename, getDirectory): New methods for EmacsSavePanel and
995 EmacsOpenPanel.
996 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
997
cded56c1
PE
9982013-03-15 Paul Eggert <eggert@cs.ucla.edu>
999
1000 * coding.c (decode_coding_gap): Fix typo caught by static checking.
1001
251e9147 10022013-03-15 Kenichi Handa <handa@gnu.org>
8a44e6d1
KH
1003
1004 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
1005 (adjust_after_replace): Make it back to static. Delete the third
1006 arg text_at_gap_tail. Cancel the code for handling it.
1007
1008 * coding.h (struct coding_system): New member eol_seen.
1009
1010 * coding.c (detect_ascii): New function.
1011 (detect_coding): Set coding->head_ascii and coding->eol_seen only
1012 when the source bytes are actually scanned. On detecting for
1013 coding_category_utf_8_auto, call detect_ascii instead of scanning
1014 source bytes directly.
1015 (produce_chars): Call insert_from_gap with the new arg 0.
1016 (encode_coding): Likewise.
1017 (decode_coding_gap): Control ASCII optimization by the variable
1018 disable_ascii_optimization instead of #ifndef .. #endif.
1019 Deccode EOL format according to coding->eol_seen.
1020 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
1021 variable.
1022
8a44e6d1
KH
1023 * lisp.h (adjust_after_replace): Cancel externing it.
1024 (insert_from_gap): Adjust prototype.
1025
5f795e34
EZ
10262013-03-15 Eli Zaretskii <eliz@gnu.org>
1027
1028 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
1029 FULLSCREEN_MAXIMIZED. (Bug#13935)
1030
f258b4be
DA
10312013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
1032
1033 * region-cache.c (find_cache_boundary, move_cache_gap)
1034 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
1035 Simplify debugging check and convert to eassert. Adjust comment.
1036 (pp_cache): Put under ENABLE_CHECKING.
1037
a5cc4dde
EZ
10382013-03-14 Eli Zaretskii <eliz@gnu.org>
1039
1040 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
1041 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
1042 and WM_ACTIVATEAPP.
1043 (w32fullscreen_hook): If the frame is visible, reset
1044 f->want_fullscreen flag after changing the frame size. If the
1045 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
1046 (Bug#13953)
1047
3fc5e44a
DC
10482013-03-13 Daniel Colascione <dancol@dancol.org>
1049
1050 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
1051 too so that these builds can use Cygwin's file conversion
1052 functions. (We've been building and linking cygw32.o all along
1053 and just not using it.)
1054
47d7532e
PE
10552013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1056
1057 File synchronization fixes (Bug#13944).
1058 * Makefile.in (LIB_FDATASYNC): New macro.
1059 (LIBES): Use it.
1060 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
1061 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
1062 Don't worry about HAVE_FSYNC, since a substitute fsync is
1063 available if the system lacks one.
1064 (Fwrite_regin): Retry fsync if interrupted.
1065
c7ffccaf
EZ
10662013-03-13 Eli Zaretskii <eliz@gnu.org>
1067
4e2df81d 1068 * w32term.c (w32_read_socket): If the Emacs frame is being
c7ffccaf
EZ
1069 activated, call w32fullscreen_hook, to make sure the new frame
1070 dimensions are in effect. (Bug#13937)
1071
8a7debc1
DA
10722013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
1073
1074 * xdisp.c (init_iterator): Simplify because both character and byte
1075 positions are either specified or -1. Add eassert. Adjust comment.
ffcd945e
DA
1076 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
1077 character and byte positions can be obtained from marker.
8a7debc1 1078
7fd8c501
PE
10792013-03-13 Paul Eggert <eggert@cs.ucla.edu>
1080
d9df6f40
PE
1081 Static checking by Sun C 5.12.
1082 * alloc.c (buffer_memory_full) [REL_ALLOC]:
1083 * bytecode.c (exec_byte_code):
1084 * dispnew.c (init_display):
1085 * eval.c (error):
1086 * fileio.c (Fsubstitute_in_file_name):
1087 * keyboard.c (Fevent_convert_list):
1088 * keymap.c (Fsingle_key_description):
1089 * term.c (maybe_fatal, fatal):
1090 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
1091 * xsmfns.c (Fhandle_save_session):
1092 Omit unreachable code.
1093 * keymap.c (map_keymap_char_table_item): Cast void * to
1094 a function pointer type; the C Standard requires this.
1095
7fd8c501
PE
1096 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
1097 Include <sys/param.h> unconditionally, as that works elsewhere and
1098 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
1099 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
1100 and FreeBSD now.
1101
cb0290df
PE
11022013-03-11 Paul Eggert <eggert@cs.ucla.edu>
1103
1104 * insdel.c (adjust_after_replace): Use bool for boolean.
1105
cbae07d5
SM
11062013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
1107
1108 * keyboard.c: Move keyboard decoding to read_key_sequence.
1109 (decode_keyboard_code): Remove.
1110 (tty_read_avail_input): Don't try to decode input.
1111 (read_decoded_char): New function.
1112 (read_key_sequence): Use it.
1113
819e2da9
DC
11142013-03-10 Daniel Colascione <dancol@dancol.org>
1115
1116 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
1117 (GUI_SDATA, guichar_t): Macros to abstract out differences between
1118 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
1119 w32fns.c.
1120
1121 * w32term.c (construct_drag_n_drop): Use the above macros to make
1122 drag-and-drop work for non-ASCII filenames in cygw32 builds.
1123
1124 * w32fns.c (x_set_name, x_set_title): Use the above macros to
1125 properly display non-ASCII frame titles in cygw32 builds.
1126
1127 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
1128 call ShellExecute in cygw32 builds.
1129
1130 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
1131 common file dialog code.
1132
1133 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
1134 can just use du like other systems.
1135
1136 * coding.c (from_unicode_buffer): Declare.
1137 * coding.c (from_unicode_buffer): Implement.
1138
99ec1647
SM
11392013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
1140
d2e24f92
SM
1141 * lread.c: Minor cleanup.
1142 (FROM_FILE_P): New macro.
1143 (skip_dyn_bytes, unreadchar, read1): Use it.
1144 (read_list): Consolidate duplicated code.
1145
99ec1647
SM
1146 * bytecode.c (struct byte_stack): Remove `constants' when unused.
1147
138c0ae8
EZ
11482013-03-10 Eli Zaretskii <eliz@gnu.org>
1149
1150 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
1151 (redisplay_internal, set_cursor_from_row, try_window)
1152 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
1153 (display_line, notice_overwritten_cursor)
99ec1647
SM
1154 (mouse_face_from_buffer_pos, note_mouse_highlight):
1155 Use MATRIX_ROW_DISPLAYS_TEXT_P.
138c0ae8 1156 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
99ec1647
SM
1157 (mouse_face_from_string_pos, fast_find_string_pos):
1158 Use MATRIX_ROW_VPOS.
138c0ae8
EZ
1159
1160 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1161
1162 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
1163
1164 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
1165 MATRIX_MODE_LINE_ROW.
1166
1167 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
1168
c230dd7d
KH
11692013-03-10 handa <handa@gnu.org>
1170
1171 * lisp.h (adjust_after_replace): Extern it.
1172
1173 * coding.c (detect_coding): Cound the heading ASCII bytes in the
1174 case of detection for coding_category_utf_8_auto.
99ec1647
SM
1175 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
1176 Skip decoding if all bytes are ASCII.
c230dd7d
KH
1177
1178 * insdel.c (adjust_after_replace): Make it public. New arg
1179 text_at_gap_tail.
1180 (adjust_after_insert): Call adjust_after_replace with the new arg
1181 value 0.
1182
27a98a62
SM
11832013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
1184
1185 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
1186 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
1187 from Elisp via unread-command-events.
1188
1189 * keyboard.c (access_keymap_keyremap): Accept nil return value from
1190 functions to mean "no change".
1191
457882c2
PE
11922013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1193
1194 region-cache.c, scroll.c, search.c: Use bool for booleans.
1195 * lisp.h (compile_pattern):
1196 * scroll.c (do_scrolling, do_direct_scrolling):
1197 * search.c (struct regexp_cache, compile_pattern_1)
1198 (compile_pattern, string_match_1, search_command)
1199 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
1200 (search_regs_saved, Fregexp_quote):
1201 Use bool for boolean.
1202 * region-cache.c (region_cache_forward, region_cache_backward):
1203 Fix comments to match code: these functions return int, not boolean.
1204
b5426561
DA
12052013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1206
1207 * search.c (find_newline): Accept start and end byte positions
1208 as arguments and allow -1 if not known.
1209 (find_newline_no_quit): Likewise for start position.
1210 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
1211 * bidi.c (bidi_find_paragraph_start): Pass byte position to
1212 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
27a98a62
SM
1213 * editfns.c (Fconstrain_to_field): Break long line.
1214 Adjust call to find_newline.
b5426561
DA
1215 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
1216 Use DEC_BOTH to start next search from the previous buffer
1217 position, where appropriate.
1218 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1219 (get_visually_first_element, move_it_vertically_backward): Likewise.
1220 Obtain byte position from the display iterator, where appropriate.
1221
0bce5d9e
PE
12222013-03-08 Paul Eggert <eggert@cs.ucla.edu>
1223
1224 print.c, process.c: Use bool for booleans.
1225 * lisp.h (wait_reading_process_output):
1226 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
1227 (strout, debug_output_compilation_hack, float_to_string, print)
1228 (print_object):
1229 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
1230 (decode_status, status_message, create_process, create_pty)
1231 (Fmake_network_process, Fnetwork_interface_info)
1232 (wait_reading_process_output, read_process_output)
1233 (write_queue_push, write_queue_pop, process_send_signal)
1234 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
1235 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
1236 Use bool for booleans.
1237 * process.c (Fnetwork_interface_list): Remove unused local.
1238 (connect_counter): Now EMACS_INT, not int.
1239
36075a19
DA
12402013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
1241
1242 * bidi.c (bidi_fetch_char): Swap first and second arguments
1243 to match other functions accepting character and byte positions.
1244 Adjust comment.
1245 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
1246 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
1247 when you need just to move to the previous buffer position.
1248 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
1249
4aae1914
EZ
12502013-03-07 Eli Zaretskii <eliz@gnu.org>
1251
1252 * .gdbinit (prowlims): Display the enabled_p flag of the row.
1253
c54aa166
DA
12542013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1255
1256 Avoid character to byte conversions in motion subroutines.
1257 * indent.h (compute_motion, vmotion): Add byte position argument.
1258 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
1259 Add eassert.
1260 (Fcompute_motion): Break long line. Adjust call to compute_motion.
1261 Use list5 for return value.
1262 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
1263 Adjust comments, style and calls to compute_motion.
1264 (Fvertical_motion): Adjust call to vmotion.
1265 * window.c (Fdelete_other_windows_internal): Record window start
1266 byte position and adjust call to vmotion.
1267 (window_scroll_line_based): Likewise with call to compute_motion.
1268 Use SET_PT_BOTH.
1269 (Frecenter): Adjust calls to vmotion.
1270
3de717bd
DA
12712013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
1272
1273 * lisp.h (list2i, list3i): New functions.
1274 (list4i): Move from window.c and make LISP_INLINE.
1275 * editfns.c (make_lisp_time):
1276 * fns.c (Flocale_info):
1277 * keyboard.c (parse_modifiers):
1278 * xterm.c (x_ewmh_activate_frame): Use list2i.
1279 * instel.c (signal_after_change):
1280 * nsfns.m (Fx_server_version, Fxw_color_values):
1281 * w32fns.c (Fxw_color_values, Fx_server_version):
1282 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
1283 * fileio.c (Fvisited_file_modtime):
1284 * nsfns.m (Fns_display_usable_bounds):
1285 * w32.c (ltime): Use list4i.
1286
d26e478e
EZ
12872013-03-06 Eli Zaretskii <eliz@gnu.org>
1288
a611149e
EZ
1289 * search.c (find_newline_no_quit): Rename from find_next_newline.
1290 Add commentary.
1291
1292 * lisp.h (find_newline_no_quit): Rename prototype.
1293
1294 * xdisp.c (back_to_previous_line_start)
1295 (forward_to_next_line_start, get_visually_first_element)
1296 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
1297 * indent.c (vmotion): Callers of find_newline_no_quit changed.
1298 * bidi.c (bidi_find_paragraph_start): Callers of
1299 find_newline_no_quit changed.
1300
d26e478e
EZ
1301 * msdos.c: Change encoding to cp850. (Bug#13879)
1302 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
1303
1af1a51a
DA
13042013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1305
1306 Coding system support cleanup and minor refactoring.
1307 * coding.h (enum coding_result_code): Remove
1308 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
1309 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
1310 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
1311 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
1312 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
1313 (decode_coding_region, encode_coding_region, decode_coding_string):
1314 Remove unused compatibility macros.
1315 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
1316 (record_conversion_result): Adjust user.
1317 (syms_of_coding): Likewise.
1318 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
1319 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
1320 (decode_coding_object): Simplify since xrealloc never returns NULL.
1321 Add eassert.
1322
0bafabe7 13232013-03-06 Paul Eggert <eggert@cs.ucla.edu>
725eb027 1324
9b1c3271 1325 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
0845a75c
PE
1326 * sysdep.c (list_system_processes)
1327 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
9b1c3271 1328 Make it a stub in this case; otherwise the build might fail,
0845a75c 1329 and this code hasn't been tested on such hosts anyway.
725eb027 1330 Problem reported by Nelson H. F. Beebe in
9b1c3271
PE
1331 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
1332 and analyzed by Jérémie Courrèges-Anglas in
1333 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
725eb027 1334
ffc65bee
DA
13352013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
1336
1337 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
1338 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
1339 (get_visually_first_element, move_it_vertically_backward): Ajust users.
1340 * bidi.c (bidi_find_paragraph_start): Likewise.
1341 * indent.c (vmotion): Likewise.
1342
70743157
PE
13432013-03-05 Paul Eggert <eggert@cs.ucla.edu>
1344
1345 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
1346 * filelock.c: Include <c-ctype.h>.
1347 (MAX_LFINFO): New top-level constant.
1348 (lock_info_type): Remove members pid, boot_time. Add members at,
1349 dot, colon. Change user member to be the entire buffer, not a
1350 pointer. This allows us to handle the case where a foreign
1351 pid or boot time exceeds the local range. All uses changed.
1352 (LINKS_MIGHT_NOT_WORK): New constant.
1353 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
1354 (defined_WINDOWSNT): Remove.
1355 (MAKE_LOCK_NAME, file_in_lock_file_name):
1356 Always use .#FILE (not .#-FILE) for the file lock,
1357 even if it is a regular file.
1358 (rename_lock_file): New function.
1359 (create_lock_file): Use it.
1360 (create_lock_file, read_lock_data):
1361 Prefer a symbolic link for the lock file, falling back on a
1362 regular file if symlinks don't work. Do not try to create
1363 symlinks on MS-Windows, due to security hassles. Stick with
1364 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
1365 link, rename, unlink, mkstemp) when creating locks, as a GNUish
1366 host may be using a Windowsish file system, and cannot use
1367 MS-Windows-only system calls. Fall back on mktemp if mkstemp
1368 doesn't work. Don't fail merely because of a symlink-contents
1369 length limit in the current file system; fall back on regular
1370 files. Increase the symlink contents length limit to 8 KiB, this
1371 should be big enough for any real use and doesn't crunch the
1372 stack.
1373 (create_lock_file, lock_file_1, read_lock_data):
1374 Simplify allocation of lock file buffers now that they fit in 8 KiB.
1375 (lock_file_1): Return error number, not bool. All callers changed.
1376 (ELOOP): New macro, if not already defined.
1377 (read_lock_data): Return size of lock file contents, not Lisp object.
1378 All callers changed. Handle a race condition if some other process
1379 replaces a regular-file lock with a symlink lock or vice versa,
1380 while we're trying to read the lock.
1381 (current_lock_owner): Parse contents more carefully, to help avoid
1382 confusing a regular-file lock with some other application's use
1383 of the file. Check for lock file contents being too long, or
1384 not parsing correctly.
1385 (current_lock_owner, lock_file):
1386 Allow foreign pid and boot times that exceed the local range.
1387 (current_lock_owner, lock_if_free, lock_file):
1388 Simplify allocation of lock file contents.
1389 * w32.c (sys_rename_replace): New function, containing most of
1390 the contents of the old sys_rename.
1391 (sys_rename): Use it.
1392 (fchmod): New dummy function.
1393 * w32.h (sys_rename_replace, fchmod): New decls.
1394
05e193f1
EZ
13952013-03-05 Eli Zaretskii <eliz@gnu.org>
1396
1397 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
1398 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
1399 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
1400 <dmantipov@yandex.ru>.
1401
3bfc46eb
DA
14022013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
1403
1404 * composite.c (get_composition_id, fill_gstring_header):
1405 Use make_uninit_vector where appropriate.
1406 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
1407 * xselect.c (clean_local_selection_data): Likewise.
1408
84ac6f9d
PE
14092013-03-04 Paul Eggert <eggert@cs.ucla.edu>
1410
1411 Fix misuse of ImageMagick that caused core dump (Bug#13846).
1412 * image.c (imagemagick_load_image): Calculate height and width
1413 after flattening the image, not before.
1414
42926ec8
DA
14152013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
1416
1417 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
1418 * ftfont.c (ftfont_shape_by_flt): Likewise.
1419 * w32uniscribe.c (uniscribe_shape): Likewise.
1420
b5029e23
PE
14212013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1422
1423 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
1424 The old approach, which fell back on DIR/.#FILE.0 through
1425 DIR/.#FILE.9, had race conditions that could not be easily fixed.
1426 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
1427 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
1428 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
1429 because the locking mechanism was never reliable in that case).
1430 This patch fixes this and other bugs discovered by a code
1431 inspection that was prompted by
1432 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
1433 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
1434 to avoid interoperability problems between the MS-Windows and
1435 non-MS-Windows implementations. MS-Windows and non-MS-Windows
1436 instances of Emacs now ignore each others' locks.
1437 * filelock.c (defined_WINDOWSNT): New constant.
1438 (MAKE_LOCK_NAME, fill_in_lock_file_name):
1439 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
1440 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
1441 regular files on MS-Windows hosts.
1442 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
1443 Use SAFE_ALLOCA to avoid problems with long file names.
1444 (MAX_LFINFO): Now a local constant, not a global macro.
1445 (IS_LOCK_FILE): Remove.
1446 (lock_file_1): Don't inspect errno if symlink call succeeds;
1447 that's not portable.
1448 (lock_file): Document that this function can return if lock
1449 creation fails.
2db41375 1450 (lock_file): Don't access freed storage.
b5029e23 1451
b270d116
AS
14522013-03-02 Andreas Schwab <schwab@linux-m68k.org>
1453
1454 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
1455
81c23309
PE
14562013-03-02 Paul Eggert <eggert@cs.ucla.edu>
1457
1458 * textprop.c: Use bool for booleans.
1459 (validate_interval_range, Fadd_text_properties)
1460 (Fremove_text_properties): Prefer bool to int when either works.
1461
18f2ac09
EZ
14622013-03-02 Eli Zaretskii <eliz@gnu.org>
1463
27a98a62
SM
1464 * textprop.c (Fadd_text_properties, Fremove_text_properties):
1465 If the interval tree changes as a side effect of calling
18f2ac09
EZ
1466 modify_region, re-do processing starting from the call to
1467 validate_interval_range. (Bug#13743)
1468
929aeac6 14692013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
1470
1471 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
1472 (Bug#13546).
1473
531e70ec
EZ
14742013-02-27 Eli Zaretskii <eliz@gnu.org>
1475
1476 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
1477 _SH_DENYRW flag, instead of emacs_open, to deny any other process
1478 access to the lock file until it is written and closed.
1479 (Bug#13807)
1480
6e65b9cc
PE
14812013-02-27 Paul Eggert <eggert@cs.ucla.edu>
1482
1483 * callint.c (Qcall_interactively):
1484 * macros.c (Qexecute_kbd_macro):
1485 Now static.
1486
3b166f09
BG
14872013-02-26 Bastien Guerry <bzg@gnu.org>
1488
1489 * window.c (Frecenter): Tiny docstring enhancement.
1490
ecc0fdd4
PE
14912013-02-26 Paul Eggert <eggert@cs.ucla.edu>
1492
1493 Minor textprop integer cleanup.
1494 * intervals.h, textprop.c (add_text_properties_from_list):
1495 Return void, not int, since nobody uses the return value.
1496 * textprop.c (validate_plist, add_properties, remove_properties)
1497 (Fadd_text_properties):
1498 Don't assume list length fits in int.
1499 (interval_has_all_properties, interval_has_some_properties)
1500 (interval_has_some_properties_list, add_properties, remove_properties)
1501 (Fadd_text_properties, Fremove_text_properties)
1502 (Fremove_list_of_text_properties, text_property_stickiness):
1503 Use bool for booleans.
1504 (Fadd_text_properties, Fremove_text_properties):
1505 (Fremove_list_of_text_properties):
1506 Reindent do-while as per GNU style.
1507
0248b0d7
EZ
15082013-02-25 Eli Zaretskii <eliz@gnu.org>
1509
343a2aef
EZ
1510 Implement CLASH_DETECTION for MS-Windows.
1511
1512 * filelock.c [WINDOWSNT]: Include w32.h.
1513 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
1514 function of that name. Up-case the macro arguments.
1515 (IS_LOCK_FILE): New macro.
1516 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
1517 (create_lock_file): New function, with body extracted from
1518 lock_file_1.
1519 [WINDOWSNT]: Implement lock files by writing a regular file with
1520 the lock information as its contents.
1521 (read_lock_data): New function, on Posix platforms just calls
1522 emacs_readlinkat.
1523 [WINDOWSNT]: Read the lock info from the file.
1524 (current_lock_owner): Call read_lock_data instead of calling
1525 emacs_readlinkat directly.
1526 (lock_file) [WINDOWSNT]: Run the file name through
1527 dostounix_filename.
1528
1529 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
1530 just check if the process by that PID exists.
1531
1532 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
1533 also present, as doing so will fail to error out if the file
1534 already exists.
1535
1536 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
1537
0248b0d7
EZ
1538 * textprop.c (Fadd_text_properties, Fremove_text_properties)
1539 (Fremove_list_of_text_properties): Skip all of the intervals in
1540 the region between START and END that already have resp. don't
27a98a62
SM
1541 have the requested properties, not just the first one.
1542 Add assertions that the loop afterwards always modifies the
0248b0d7
EZ
1543 properties. (Bug#13743)
1544
b5071fc7
SM
15452013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
1546
1547 * callint.c (Fcall_interactively): Use the right lexical environment
1548 for `interactive' specs (bug#13811).
1549 * eval.c (Feval): Accept a lexical environment.
1550
1ddc2bd6
PE
15512013-02-25 Paul Eggert <eggert@cs.ucla.edu>
1552
1553 Simplify data_start configuration (Bug#13783).
1554 This is a followon simplification to the fix for Bug#13650.
1555 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
1556 (START_FILES): Remove. All uses removed.
1557 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
1558 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
1559 (buildobj.h): Use it.
1560 ($(ALLOBJS)): Depend on globals.h.
1561 (temacs$(EXEEXT)): Use $(ALLOBJS).
1562 * autodeps.mk (ALLOBJS): Move to Makefile.in.
1563 * deps.mk (vm-limit.o):
1564 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
1565 Do not depend on mem-limits.h.
1566 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
1567 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
1568 [__GNUC__ && !ORDINARY_LINK]: Remove.
1569 * mem-limits.h, pre-crt0.c: Remove.
1570 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
1571 * unexcoff.c (etext): New decl.
1572 (make_hdr): Use DATA_START instead of start_of_data.
1573 * vm-limit.c: Move most of mem-limits.h's contents here.
1574 (data_start): New decl. It's OK if this is approximate,
1575 so simplify-away some unnecessary exactness.
1576 (POINTER): Remove; all uses removed.
1577 (data_space_start): Now char *, to avoid casts.
1578 (exceeds_lisp_ptr): New function, replacing the old
1579 EXCEEDS_LISP_PTR macro. All uses changed.
1580 (check_memory_limits): Simplify and remove casts.
1581 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
1582 (memory_warnings): Use data_start instead of start_of_data.
1583
51aa2a8b
AS
15842013-02-24 Andreas Schwab <schwab@linux-m68k.org>
1585
1586 * xdisp.c (set_message): Only check for debug-on-message if STRING
1587 is a string. (Bug#13797)
1588
1938d88c
PE
15892013-02-24 Paul Eggert <eggert@cs.ucla.edu>
1590
1591 Fix regression introduced by July 10 filelock.c patch.
1592 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
1593 2012-07-10 patch to this file. Reported by Eli Zaretskii in
1594 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
1595 and diagnosed by Andreas Schwab in
1596 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
1597
fcee5028
PE
15982013-02-22 Paul Eggert <eggert@cs.ucla.edu>
1599
1600 Assume C89 or better.
1601 * ralloc.c (SIZE, POINTER, NIL):
1602 * vm-limit.c (POINTER):
1603 Remove, replacing all uses with C89 equivalents. These old
1604 symbols were present only for porting to pre-C89 platforms.
1605
d78cf5ed
CB
16062013-02-22 Claudio Bley <claudio.bley@gmail.com>
1607
1608 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
1609 This avoids warning messages reported as part of Bug#13546.
1610
6bcd97a4
KB
16112013-02-21 Ken Brown <kbrown@cornell.edu>
1612
1613 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
1614
b6c2bfff
SM
16152013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
1616
e11dacb5
SM
1617 * sheap.c (report_sheap_usage): Prefer message1_nolog.
1618
b6c2bfff
SM
1619 * keyboard.c (Qcommand_execute): New var.
1620 (command_loop_1, read_char): Use it.
1621 (Fcommand_execute): Remove, replace by an Elisp implementation.
1622 (syms_of_keyboard): Adjust accordingly.
1623
f4ad7ea1 16242013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 1625
d69f1120
DC
1626 * sheap.c (report_sheap_usage): Use message, not message1, so
1627 that we don't try to create a buffer while we're in the middle
1628 of dumping Emacs. Explain why.
b6c2bfff 1629
2a14a4f1 16302013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 1631
2a14a4f1
DA
1632 * search.c (find_newline): Return byte position in bytepos.
1633 Adjust comment.
b6c2bfff
SM
1634 (find_next_newline_no_quit, find_before_next_newline):
1635 Add bytepos argument.
2a14a4f1
DA
1636 * lisp.h (find_newline, find_next_newline_no_quit)
1637 (find_before_next_newline): Adjust prototypes.
1638 * bidi.c (bidi_find_paragraph_start):
1639 * editfns.c (Fconstrain_to_field, Fline_end_position):
1640 * indent.c (compute_motion, vmotion):
1641 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
1642 (get_visually_first_element, move_it_vertically_backward):
1643 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
1644
872faefb 16452013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
1646
1647 * w32proc.c (new_child): Avoid leaking handles if the subprocess
1648 resources were not orderly released.
1649
fd80c659
EZ
16502013-02-17 Eli Zaretskii <eliz@gnu.org>
1651
1652 * xdisp.c (x_draw_vertical_border): For a window that is neither
1653 the leftmost nor the rightmost, redraw both the left and the right
1654 vertical borders. (Bug#13723)
1655
2f73da9c
SM
16562013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
1657
1658 * xml.c (init_libxml2_functions):
1659 * sound.c (sound_warning):
1660 * sheap.c (report_sheap_usage):
1661 * process.c (wait_reading_process_output):
1662 * msdos.c (XMenuActivate):
1663 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
1664 * keyboard.c (top_level_1):
1665 * editfns.c (Fmessage, Fmessage_box):
1666 * callint.c (Fcall_interactively):
1667 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
1668
fd9547e8
JD
16692013-02-17 Jan Djärv <jan.h.d@swipnet.se>
1670
1671 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
1672 * frame.c (syms_of_frame): ... to here.
1673
f277993b
EZ
16742013-02-16 Eli Zaretskii <eliz@gnu.org>
1675
c7939585
EZ
1676 * w32.c (sys_chown): Remove unused function.
1677
cd91fb4b
EZ
1678 * w32term.c <input_signal_count>: Declare 'volatile'
1679 unconditionally. (Bug#9066)
1680
f277993b
EZ
1681 * w32.c (set_errno): Reset h_errno and don't set it to any other
1682 value. Set errno instead.
1683 (check_errno): Reset h_errno.
1684 (sys_socket, socket_to_fd, sys_bind, sys_connect)
1685 (sys_gethostname, sys_getservbyname, sys_getpeername)
1686 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1687 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
1688 h_errno.
1689 (sys_gethostbyname): Set h_errno only errors detected.
1690
e454145b
PE
16912013-02-15 Paul Eggert <eggert@cs.ucla.edu>
1692
1693 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
1694
bcf7fe2a
EZ
16952013-02-15 Eli Zaretskii <eliz@gnu.org>
1696
ef9c57e2
EZ
1697 * keyboard.c (read_char): Fix calculation of auto-save time out
1698 when auto-save-timeout is less than 4. (Bug#13720)
1699
ef862e20 1700 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 1701 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 1702
bcf7fe2a
EZ
1703 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
1704 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
1705 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
1706 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
1707 make sure errno is set to an appropriate value. (Bug#13546)
1708 (socket_to_fd): Add assertion against indexing fd_info[] with a
1709 value that is out of bounds.
1710 (sys_accept): If fd is negative, do not set up the child_process
1711 structure for reading.
1712
0063fdb1
DA
17132013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
1714
1715 * composite.c (fill_gstring_header): Remove useless prototype.
1716 Break long line.
1717 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
1718 * print.c (PRINTDECLARE, print_object):
1719 * search.c (compile_pattern, fast_looking_at, search_buffer):
1720 (simple_search, boyer_moore, Freplace_match):
1721 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
1722 (get_overlay_arrow_glyph_row, display_mode_element):
1723 (decode_mode_spec_coding, message3):
1724 * xfaces.c (face_at_string_position): Use bool for booleans.
1725 Adjust comments.
1726
648e5523 17272013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 1728
35b3a27e
PE
1729 Fix AIX port (Bug#13650).
1730 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
1731 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
1732 was #undeffed earlier, so it cannot be used as a macro here.
1733 Use the constant and not the macro.
35b3a27e 1734
648e5523 17352013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 1736
0e4e7b74
EZ
1737 * w32proc.c (new_child): If no vacant slots are found in
1738 child_procs[], make another pass looking for slots whose process
1739 has exited or died. (Bug#13546)
1740
6e432f0c
EZ
1741 * w32.c (sys_pipe): When failing due to file descriptors above
1742 MAXDESC, set errno to EMFILE.
1743 (_sys_read_ahead): Update cp->status when failing to read serial
1744 communications input, so that the status doesn't stay at
1745 STATUS_READ_IN_PROGRESS. (Bug#13546)
1746
51b3a99c
JD
17472013-02-14 Jan Djärv <jan.h.d@swipnet.se>
1748
1749 * gtkutil.c (tb_size_cb): New function.
1750 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
1751
e31560a7
SM
17522013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
1753
1754 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
1755 an event.
1756
fe336261
SM
17572013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
1758
1759 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
1760
5a655b9f
DA
17612013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
1762
1763 * font.c (font_range): Add pos_byte argument. Adjust comment
1764 and break long line.
1765 * font.h (font_range): Adjust prototype.
1766 * composite.c (autocmp_chars): Pass byte position to font_range.
1767 Break long line. Remove useless prototype and format comment.
1768
1a359750
GM
17692013-02-13 Glenn Morris <rgm@gnu.org>
1770
1771 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
1772
01fcc3a5 17732013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 1774
f53f992a
PE
1775 Improve AIX port some more (Bug#13650).
1776 With this, it should be as good as it was in 23.3, though it's
1777 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
1778 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
1779 * unexaix.c (start_of_text): Remove.
1780 (_data, _text): Declare as char[], not int, as AIX manual suggests.
1781 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
1782 (orig_load_scnptr, orig_data_scnptr):
1783 Now off_t, not long, since they are file offsets.
1784 (make_hdr): Use _data, not start_of_data ().
1785 This is the key part of the fix.
1786 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
1787 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
1788
4458c255
PE
1789 * pre-crt0.c (data_start): Initialize to 1.
1790 This ports to compilers that optimize the external declaration
1791 'int x = 0;' as if it were 'int x;' to shrink the executable.
1792
227be86d
PE
1793 Improve AIX port (Bug#13650).
1794 This doesn't fix the bug, but it makes progress: Emacs builds now.
1795 * unexaix.c: Include inttypes.h, stdarg.h.
1796 (report_error, report_error_1): Mark as _Noreturn.
1797 (report_error): Don't report the wrong errno.
1798 (report_error_1): Now varargs. All callers changed.
1799 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
1800 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
1801 (write_ptr): Use %p to print address rather than %lx and a cast
1802 to unsigned long. Grow buffer a bit, to be safer.
1803
01fcc3a5 18042013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
1805
1806 * bidi.c (bidi_resolve_neutral): After finding the next
1807 non-neutral character, accept NEUTRAL_ON type as well, because
1808 directional control characters, such as LRE and RLE, have their
1809 type converted to that by bidi_resolve_weak. This avoids aborts
1810 when LRE/RLE follows a run of neutrals.
1811 (bidi_move_to_visually_next): Assert that return value of
1812 bidi_peek_at_next_level is non-negative. Negative values will
1813 cause an infloop.
1814
83be8524
PE
18152013-02-13 Paul Eggert <eggert@cs.ucla.edu>
1816
1817 Minor getenv-related fixes.
1818 * callproc.c (Fcall_process_region) [!DOS_NT]:
1819 Avoid unnecessary duplicate call to getenv.
1820 * callproc.c (init_callproc):
1821 * dispnew.c (init_display):
1822 * sysdep.c (sys_subshell):
1823 Omit unnecessary cast of getenv or egetenv.
1824
45b2b768
JB
18252013-02-13 Juanma Barranquero <lekktu@gmail.com>
1826
1827 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1828 Update dependencies.
1829
33b49d71
EZ
18302013-02-12 Eli Zaretskii <eliz@gnu.org>
1831
1832 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1833 marker's position.
1834 (display_line): Set w->region_showing to the value of
1835 it->region_beg_charpos, not to -1. This fixes redisplay
1836 optimization when cursor is moved up after M->. (Bug#13623)
1837 (Bug#13626)
c4131562
EZ
1838 (try_scrolling): Scroll text up more if point is too close to ZV
1839 and inside the scroll margin. This makes sure point is moved
1840 outside the scroll margin in these cases.
33b49d71
EZ
1841
1842 * window.h (struct window): region_showing can no longer be
1843 negative.
1844
b09a4810
PE
18452013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1846
a84b7c53
PE
1847 Tune by using memchr and memrchr.
1848 * doc.c (Fsnarf_documentation):
1849 * fileio.c (Fsubstitute_in_file_name):
1850 * search.c (find_newline, scan_newline):
1851 * xdisp.c (pos_visible_p, display_count_lines):
1852 Use memchr and memrchr rather than scanning byte-by-byte.
1853 * search.c (find_newline): Rename from scan_buffer.
1854 Omit first arg TARGET, as it's always '\n'. All callers changed.
1855
b09a4810
PE
1856 Clean up read_key_sequence a tiny bit more.
1857 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1858 (read_key_sequence): Remove unused locals.
1859
99d0d6dc
SM
18602013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1861
1862 Clean up read_key_sequence a bit; reread active keymaps after first event.
1863 * keyboard.c (read_char, read_char_x_menu_prompt)
1864 (read_char_minibuf_menu_prompt):
1865 Replace nmaps+maps with a single `map' arg.
1866 (follow_key): Operate on a single map.
1867 (active_maps): New function.
1868 (test_undefined): Also return true for nil bindings.
1869 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1870 a single (composed) keymap. Remember `first_event' to choose the right
1871 set of active keymaps. Recompute the set of keymaps after receiving
1872 the first event. Remove GOBBLE_FIRST_EVENT.
1873 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1874 * keyboard.h (read_char): Update declaration.
1875 * lread.c (read_filtered_event): Adjust call to read_char.
1876
f5e1b680
EZ
18772013-02-11 Eli Zaretskii <eliz@gnu.org>
1878
99d0d6dc
SM
1879 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1880 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
1881 in the window. (Bug#13675)
1882
f74de345
DA
18832013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1884
1885 * marker.c (set_marker_internal): If desired position is passed
1886 as a marker, avoid call to buf_charpos_to_bytepos.
1887 * window.c (Fset_window_point): Omit redundant type checking.
1888 (Fset_window_start): Likewise. Format comment.
1889 (window_scroll_pixel_based): Use set_marker_restricted_both
1890 with character and byte positions obtained from an iterator.
1891 (Fset_window_configuration): Use set_marker_restricted_both.
1892 * xdisp.c (message_dolog): Likewise.
1893
a4ba3963
EZ
18942013-02-10 Eli Zaretskii <eliz@gnu.org>
1895
99d0d6dc
SM
1896 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1897 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
1898 too far. This speeds up some redisplay operations. (Bug#13675)
1899
68643cde
DA
19002013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1901
1902 * syntax.c (scan_sexps_forward): Fix byte position calculation
1903 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1904
7ba11bee
PE
19052013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1906
1907 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1908 that was not needed.
1909
eff1c190
PE
19102013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1911
1912 Minor hashing refactoring.
1913 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1914 (sxhash_float): Return EMACS_UINT, for consistency with the other
1915 hash functions.
1916 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1917 non-static inline function and therefore can't use static vars.
1918 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1919 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1920 with the other hash functions.
1921
6b48c831
EZ
19222013-02-09 Eli Zaretskii <eliz@gnu.org>
1923
4dde2087
EZ
1924 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1925 XXXXXX part of the temporary file pattern is not downcased even
1926 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 1927
8549f9e8
EZ
1928 * xdisp.c (decode_mode_spec): Remove handling of %t.
1929
6b48c831
EZ
1930 * msdos.c (careadlinkatcwd): Remove.
1931
75a65c7e
SM
19322013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1933
1934 * lread.c (skip_dyn_bytes): New function (bug#12598).
1935 (read1): Use it. Use getc instead of READCHAR to read bytes.
1936 (load_each_byte): Remove. Update users.
1937
8ca30920
DA
19382013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1939
1940 * search.c (scan_buffer): Calculate end byte position just once.
1941 (scan_newline): Do not recalculate start_byte.
1942 (search_command): Use eassert.
1943 * syntax.c (struct lisp_parse_state): New member location_byte.
1944 (scan_sexps_forward): Record from_byte and avoid redundant
1945 character to byte position calculation ...
1946 (Fparse_partial_sexp): ... here. Break too long line.
1947
25721f5b
DA
19482013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1949
1950 * lisp.h (make_uninit_vector): New function.
1951 * alloc.c (Fvector, Fmake_byte_code):
1952 * ccl.c (Fregister_ccl_program):
1953 * charset.c (Fdefine_charset_internal, define_charset_internal):
1954 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1955 * composite.c (syms_of_composite):
1956 * font.c (Fquery_font, Ffont_info, syms_of_font):
1957 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1958 * ftfont.c (ftfont_shape_by_flt):
1959 * indent.c (recompute_width_table):
1960 * nsselect.m (clean_local_selection_data):
1961 * syntax.c (init_syntax_once):
1962 * w32unsubscribe.c (uniscribe_shape):
1963 * window.c (Fcurrent_window_configuration):
1964 * xfaces.c (Fx_family_fonts):
1965 * xselect.c (selection_data_to_lisp_data): Use it.
1966
9a9d91d9
DA
19672013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1968
1969 * coding.c (Fdefine_coding_system_internal): Use AREF where
1970 argument is known to be a vector.
1971 * fns.c (Flocale_info): Likewise for ASET.
1972 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1973 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1974
6871e574
JD
19752013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1976
1977 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1978 height.
1979
1980 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1981 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1982 updateCollectionBehaviour.
1983
1984 * nsterm.m (NEW_STYLE_FS): Remove.
1985 (ns_last_use_native_fullscreen): New variable.
1986 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1987 (x_set_window_size): Do not take title bar and tool bar into account
1988 if isFullscreen returns YES.
1989 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1990 (check_native_fs): New function.
1991 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1992 (ns_term_init): Remove NEW_STYLE_FS.
1993 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1994 and tool bar if isFullscreen returns NO.
1995 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1996 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1997 with HAVE_NATIVE_FS.
1998 (window:willUseFullScreenPresentationOptions:): New method.
1999 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
2000 Hide toolbar if not enabled (Bug#13444).
2001 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
2002 Restore tool bar if enabled, hide it otherwise (Bug#13444).
2003 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
2004 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
2005 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
2006 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
2007 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
2008 (syms_of_nsterm): Add ns-use-native-fullscreen.
2009
3f011c7f
PE
20102013-02-04 Paul Eggert <eggert@cs.ucla.edu>
2011
2012 * fileio.c (Qchoose_write_coding_system): Now static.
2013
86f7c0fe
EZ
20142013-02-04 Eli Zaretskii <eliz@gnu.org>
2015
2016 * xdisp.c (window_buffer_changed): region_showing can be negative,
2017 which still means region is being displayed.
2018 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
2019 whole window when showing region and the mark has changed.
2020 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
2021 (display_line): If it->region_beg_charpos is non-zero, set the
2022 window's region_showing member to -1. (Bug#13623) (Bug#13626)
2023
2024 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
2025 not bitfield of 1 bit.
2026
5257b701
DC
20272013-02-03 Daniel Colascione <dancol@dancol.org>
2028
2029 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
2030 daemon mode works on cygw32 when Emacs is installed and not just
2031 during development.
2032
8ea41ea9
PE
20332013-02-02 Paul Eggert <eggert@cs.ucla.edu>
2034
2035 Avoid file time stamp bug on MS-Windows (Bug#13149).
2036 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
2037 as FAT32 doesn't update time stamps when truncating them.
2038 Also, check that a file time stamp is not a multiple of 100 ns;
2039 this should catch all instances of the problem on MS-Windows,
2040 as its native file system resolution is 100 ns or worse, and
2041 checking for a non-multiple of 100 ns should impose only a small
2042 overhead on systems with ns resolution.
2043
94fbc901 20442013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 2045
e7ac588e
EZ
2046 Avoid encoding file names on MS-Windows when they need to be run
2047 through dostounix_filename.
2048 * w32.c (normalize_filename): Accept an additional argument
2049 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
2050 downcase it even if w32-downcase-file-names is non-nil.
2051 (dostounix_filename): Accept an additional argument MULTIBYTE and
2052 pass it to normalize_filename.
2053 (emacs_root_dir): Adjust.
2054
2055 * msdos.h (dostounix_filename): Adjust prototype.
2056
2057 * w32.h (dostounix_filename): Adjust prototype.
2058
2059 * msdos.c (dostounix_filename): Accept an additional argument and
2060 ignore it.
2061 (init_environment): Adjust callers of dostounix_filename.
2062
2063 * fileio.c (Ffile_name_directory, file_name_as_directory)
2064 (directory_file_name, Fexpand_file_name)
2065 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
2066 dostounix_filename.
2067 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
2068 non-nil.
2069 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
2070 variables, as egetenv is case-insensitive for DOS_NT.
2071
2072 * dired.c (file_name_completion): Don't call Fdirectory_file_name
2073 with an encoded file name.
2074
99d0d6dc
SM
2075 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
2076 Adjust calls to dostounix_filename.
e7ac588e
EZ
2077
2078 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
2079
2080 * unexw32.c (unexec): Adjust call to dostounix_filename.
2081
2082 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
2083
2084 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
2085 dostounix_filename.
2086
2087 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
2088 dostounix_filename.
2089
e7c3fb06
EZ
2090 * callproc.c (Fcall_process): Make sure program name in PATH and
2091 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
2092 is passed to exec/spawnve, which fails unless the file-name
2093 encoding is UTF-8.
2094
18a80473
EZ
2095 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
2096 even if w32-quote-process-args is nil.
2097
35e85499
PE
20982013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2099
2100 Fix timestamp bug when write-region appends nothing (Bug#13149).
2101 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
2102 the file's time stamp doesn't change if Emacs happens to write nothing
2103 to the file, and on a buggy file system this could cause Emacs to
2104 incorrectly infer that the file system doesn't have the bug.
2105 Avoid this problem by inhibiting the inference in this case.
2106
422ff52b
DA
21072013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
2108
2109 * window.h (struct window): Convert base_line_number, base_line_pos
2110 and column_number_displayed members from Lisp_Object to ptrdiff_t.
2111 Convert region_showing member from Lisp_Object to bitfield.
2112 Remove sequence_number member. Adjust comments.
2113 * window.c (sequence_number): Remove.
2114 (make_window): Initialize column_number_displayed.
2115 * print.c (print_object): Follow the printed representation of
2116 frames and print window pointer to distinguish between windows.
2117 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
2118 * xdisp.c (wset_base_line_number, wset_base_line_pos)
2119 (wset_column_number_displayed, wset_region_showing): Remove.
2120 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
2121 (try_scrolling, try_cursor_movement, redisplay_window)
2122 (try_window_reusing_current_matrix, try_window_id, display_line)
2123 (display_mode_lines, decode_mode_spec): Adjust users.
2124 * .gdbinit (pwinx): Do not print sequence_number.
2125
8654f9d7
PE
21262013-02-01 Paul Eggert <eggert@cs.ucla.edu>
2127
2128 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
2129 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
2130 * dired.c: Include <fcntl.h>.
2131 (open_directory): New function, which uses open and fdopendir
2132 rather than opendir. DOS_NT platforms still use opendir, though.
2133 (directory_files_internal, file_name_completion): Use it.
2134 (file_attributes): New function, with most of the old Ffile_attributes.
2135 (directory_files_internal, Ffile_attributes): Use it.
2136 (file_attributes, file_name_completion_stat): First arg is now fd,
2137 not dir name. All uses changed. Use fstatat rather than lstat +
2138 stat.
2139 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
2140 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
2141 (emacs_readlinkat): New function, with much of the old
2142 Ffile_symlink_p, but with an fd argument for speed.
2143 It uses readlinkat rather than careadlinkatcwd, so that it
2144 need not assume the working directory.
2145 (Ffile_symlink_p): Use it.
2146 * filelock.c (current_lock_owner): Use emacs_readlinkat
2147 rather than emacs_readlink.
2148 * lisp.h (emacs_readlinkat): New decl.
2149 (READLINK_BUFSIZE, emacs_readlink): Remove.
2150 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
2151 (emacs_norealloc_allocator, emacs_readlink): Remove.
2152 This stuff is moved to fileio.c.
2153 * w32.c (fstatat, readlinkat): New functions.
2154 (careadlinkat): Don't check that fd == AT_FDCWD.
2155 (careadlinkatcwd): Remove; no longer needed.
2156
9dbda100
GM
21572013-01-31 Glenn Morris <rgm@gnu.org>
2158
2159 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
2160 (Fwrite_region): Update for new choose_write_coding_system args.
2161 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
2162 (syms_of_fileio): Add choose-write-coding-system.
2163
3f82a88a 21642013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
2165
2166 * w32.c (sys_open): Zero out the flags for the new file descriptor.
2167 (sys_close): Zero out the flags for the file descriptor before
2168 closing it. (Bug#13546)
2169
806fed21 2170 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
2171 (logon_network_drive, stat_worker, symlink, chase_symlinks):
2172 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
2173 DBCS. (Bug#13553)
2174
6ee4509a
EZ
2175 * w32.c (w32_get_long_filename, init_environment, readlink):
2176 Support file names encoded in DBCS codepages.
26854e9c
EZ
2177 (readlink): Use the current file-name-coding-system, not the ANSI
2178 codepage, to decode and handle targets of symlinks.
6ee4509a 2179
cf01a359
EZ
21802013-01-28 Eli Zaretskii <eliz@gnu.org>
2181
2182 * w32.c (opendir): Now accepts a 'const char *'.
2183
6fd326b7
DA
21842013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
2185
2186 Remove obsolete redisplay code. See the discussion at
2187 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
2188 * dispnew.c (preemption_period, preemption_next_check): Remove.
2189 (Vredisplay_preemption_period): Likewise.
2190 (update_frame, update_single_window, update_window, update_frame_1):
2191 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
2192 used, following the 2012-06-22 change.
2193
d8cd7742
EZ
21942013-01-25 Eli Zaretskii <eliz@gnu.org>
2195
2196 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
2197
266fee4f
DA
21982013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
2199
2200 * font.c (num_fonts): Remove the leftover from old
2201 debugging code. Adjust comment style here and there.
59e624b3
DA
2202 * insdel.c (insert_1): Remove.
2203 * lisp.h (insert_1): Remove prototype.
2204 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 2205
830e46e6 22062013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
2207
2208 * w32.c (max_filename_mbslen): New function.
2209 (normalize_filename, readdir): Use it to detect locales where ANSI
2210 encoding of file names uses a double-byte character set (DBCS).
2211 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
2212 CharNextExA, instead of incrementing a 'char *' pointer.
2213 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 2214
81abbb95
EZ
2215 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
2216 request of memory reservation to 1.7GB. (Bug#13065)
2217
830e46e6 22182013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
2219
2220 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
2221 at check_extra_latin label. (Bug#13505)
2222
fd3ceb09
DA
22232013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2224
2225 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
2226 Avoid redundant calls to strlen.
2227
edfa7fa0
DA
22282013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2229
2230 Drop async_visible and async_iconified fields of struct frame.
2231 This is possible because async input is gone; for details, see
2232 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
2233 * frame.h (struct frame): Remove async_visible and async_iconified
2234 members, convert garbaged to unsigned bitfield. Adjust comments.
2235 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
2236 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
2237 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
2238 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
2239 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
2240 * w32term.c: Ditto.
2241 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
2242 properly. Likewise for obscured.
2243 * xterm.c: Ditto.
266fee4f 2244 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
2245 properly.
2246 * nsterm.m: Ditto.
2247 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
2248
5ad86e34
DA
22492013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
2250
2251 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
2252 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
2253
b09cca6a
SM
22542013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
2255
2256 * xdisp.c (message2, message2_nolog): Remove functions.
2257 (message3, message3_nolog): Extract nbytes and multibyteness directly
2258 from the string. Change all callers.
2259 (message3_nolog): Don't set message_enable_multibyte since set_message
2260 will reset it anyway.
2261 (message1, message1_nolog): Use message3.
2262 (vmessage): Use a stack allocated buffer rather than f->message_buf.
2263 (with_echo_area_buffer): Remove last two arguments. Update all callers.
2264 (set_message): Drop all but the second arg, which has to be a string.
2265 (set_message_1): Simplify now that we know that a1 is NULL and the
2266 second arg is a string.
2267 * frame.h (struct frame): Remove `message_buf' field.
2268 Use glyphs_initialized_p instead.
2269 (FRAME_MESSAGE_BUF): Remove macro.
2270 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
2271 * lisp.h (message2, message2_nolog): Remove declarations.
2272 (message3, message3_nolog): Update declarations.
2273 * keyboard.c (read_char_minibuf_menu_text)
2274 (read_char_minibuf_menu_width): Remove vars.
2275 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
2276 to correctly handle multibyte strings.
2277 * frame.c (delete_frame): Don't free message_buf any more.
2278 * editfns.c (message_text, message_length): Remove vars.
2279 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
2280 * fileio.c (auto_save_error): Use message3 instead of message2.
2281 * dispnew.c (adjust_frame_message_buffer): Remove function.
2282
54ab1c5a
EZ
22832013-01-23 Eli Zaretskii <eliz@gnu.org>
2284
2285 * w32term.c (w32fullscreen_hook): Account correctly for the screen
2286 real estate used for the tool bar and the menu bar.
2287
6c27465b
DA
22882013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
2289
2290 * insdel.c (prepare_to_modify_buffer): Force redisplay if
2291 hidden buffer is prepared to modification (Bug#13164).
2292
9d93ce29
DA
22932013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2294
2295 * window.h (struct window): Change window_end_valid member from
2296 Lisp_Object to a bitfield. Adjust comments.
2297 (wset_window_end_valid): Remove.
2298 * window.c (adjust_window_count): Clear window_end_valid.
2299 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
2300 (Fwindow_line_height, set_window_buffer, Frecenter)
2301 (Fsplit_window_internal, Fdelete_other_windows_internal)
2302 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
2303 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
2304 * xdisp.c (check_window_end, reconsider_clip_changes)
2305 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
2306 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
2307 (find_first_unchanged_at_end_row, try_window_id): Likewise.
2308
1dcb8ea2
DA
23092013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
2310
2311 * xdisp.c (mark_window_display_accurate): Simplify the loop
2312 assuming that the only one of vchild, hchild or buffer window
2313 slots is non-nil. Call mark_window_display_accurate_1 for
2314 the leaf windows only.
2315 (mark_window_display_accurate_1): Always assume leaf window.
2316 Adjust comment.
2317
b41b8a7e
PE
23182013-01-22 Paul Eggert <eggert@cs.ucla.edu>
2319
593a5f2e
PE
2320 * emacs.c (Qkill_emacs_hook): Now static.
2321
b41b8a7e
PE
2322 * fileio.c (Finsert_file_contents): Simplify.
2323 Remove unnecessary assignments and tests.
2324
84e5ed96
EZ
23252013-01-21 Eli Zaretskii <eliz@gnu.org>
2326
2327 * w32.c (acl_set_file): Don't test for errors unless
2328 set_file_security returns FALSE. Avoids spurious errors when
2329 saving files.
2330
2ef88fd4
DA
23312013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
2332
2333 * fileio.c (Finsert_file_contents): Revert code introduced at
2334 2013-01-18 in favor of the simpler and generally better fix.
2335 Save stack space by removing 'buffer' and reusing 'read_buf'
2336 where appropriate.
2337
d7a0a7c9
PE
23382013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2339
2340 * lisp.h (eabs): Define unconditionally (Bug#13419).
2341 The old "#if !defined (eabs)" was an unnecessary revenant of back
2342 when this macro was called "abs". Document 'eabs' better.
2343
795e7a5b 23442013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
2345
2346 * fns.c (Frandom): Doc fix.
2347
59ac2d13
EZ
23482013-01-19 Eli Zaretskii <eliz@gnu.org>
2349
2350 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
2351 segfault when there are lots of overlays.
2352
2353 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
2354 when there are lots of overlays.
2355 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
2356 for the details and a way to reproduce.
2357
b3fbb395
PE
23582013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2359
3a955a1f
PE
2360 * fileio.c: Use O_APPEND to append.
2361 This corresponds better to the natural interpretation of "append",
2362 and avoids the need to open the output file twice, or to invoke
2363 lseek when APPEND is neither nil nor a number.
2364 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
2365 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
2366 file possibly twice, and lseeking to its end; this avoids the
2367 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
2368 at the same time: the combination is never needed and apparently
2369 it doesn't work with DOS_NT.
2370
21cd50b8
PE
2371 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
2372 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
2373
b3fbb395
PE
2374 Allow floating-point file offsets.
2375 Problem reported by Vitalie Spinu in
2376 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
2377 * fileio.c (emacs_lseek): Remove.
2378 (file_offset): New function.
2379 (Finsert_file_contents, Fwrite_region): Use it.
2380
73c14218
CY
23812013-01-19 Chong Yidong <cyd@gnu.org>
2382
2383 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
2384 aborting on Fsignal (Bug#13289).
2385
6a9465f3
EZ
23862013-01-19 Eli Zaretskii <eliz@gnu.org>
2387
2388 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
2389 set_file_security as failure due to insufficient privileges.
2390 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 2391 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 2392
fa705c99
PE
23932013-01-19 Paul Eggert <eggert@cs.ucla.edu>
2394
9fe43ff6
PE
2395 Work around bug in CIFS and vboxsf file systems (Bug#13149).
2396 The bug was observed on Ubuntu operating inside a virtual machine,
2397 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
2398 The workaround introduces a race condition on non-buggy hosts,
2399 but it's an unlikely race and anyway there's a nearly identical
2400 nearby race that can't be fixed.
2401 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
2402 New static vars.
2403 (Fwrite_region): Test for file system time stamp bug.
2404 (init_fileio): New function.
2405 * lisp.h (init_fileio): Declare it.
2406 * emacs.c (main): Call it.
2407
fa705c99
PE
2408 * fileio.c (Finsert_file_contents): Simplify new diagnostic
2409 and make it more consistent with other stat-failure diagnostics.
2410
e07469fa
DA
24112013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
2412
99d0d6dc
SM
2413 Fix crash when inserting data from non-regular files.
2414 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
2415 for the error description produced by valgrind.
2416 * fileio.c (read_non_regular): Rename to read_contents.
2417 Free Lisp_Save_Value object used to pass parameters.
2418 (read_non_regular_quit): Rename to read_contents_quit.
2419 (Finsert_file_contents): Redesign internal file reading loop to adjust
2420 gap and end positions after each read and so help make_gap to work
2421 properly. Do not signal an I/O error too early and so do not leave
2422 not yet decoded characters in a buffer, which was the reason of
2423 redisplay crash. Use list2 to build return value. Adjust comments.
2424
67722112
PE
24252013-01-17 Paul Eggert <eggert@cs.ucla.edu>
2426
2427 Close a race when statting and reading files (Bug#13149).
2428 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
2429 This avoids a race if the file is renamed between stat and open.
2430 This race is not the problem originally noted in Bug#13149;
2431 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
2432
468afbac
DA
24332013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2434
2435 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
2436 objects, related functions and macros.
2437 (make_save_value): Adjust prototype.
2438 (make_save_pointer): New prototype.
2439 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
2440 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
2441 * alloc.c (format_save_value): Rename to make_save_value.
2442 (make_save_pointer): New function.
2443 (record_xmalloc): Use make_save_pointer.
2444 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
2445 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
2446 Change users of make_save_value to make_save_pointer.
2447 Likewise for format_save_value and make_save_value.
2448
0e70695a
DA
24492013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
2450
2451 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
2452 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
2453 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
2454 debugging stubs.
2455
963ea40f
PE
24562013-01-15 Paul Eggert <eggert@cs.ucla.edu>
2457
2458 * alloc.c (free_save_value): Now static.
2459
3346c1d0
DA
24602013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2461
2462 * keymap.c (map_keymap_internal): Use format_save_value.
2463 (map_keymap_char_table_item): Adjust accordingly.
2464 * fileio.c (non_regular_fd, non_regular_inserted)
2465 (non_regular_nbytes): Remove.
99d0d6dc
SM
2466 (Finsert_file_contents): Convert trytry to ptrdiff_t.
2467 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
2468 (read_non_regular): Use XSAVE_ macros to extract parameters.
2469 Adjust comment.
2470 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
2471 format_save_value.
2472 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
2473
2b30549c
DA
24742013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2475
2476 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
2477 extraction from any Lisp_Save_Value slot. Add type checking.
2478 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
2479 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
2480 * xselect.c: All users changed.
2481
1b971ac1
DA
24822013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
2483
2484 Some convenient bits to deal with Lisp_Save_Values.
2485 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
2486 (allocate_misc): Remove prototype.
2487 (format_save_value): New prototype.
2488 * alloc.c (allocate_misc): Revert back to static.
2489 (format_save_value): New function to build Lisp_Save_Value
2490 object with the specified internal structure.
2491 (make_save_value): Reimplement using format_save_value.
2492 * editfns.c (save_excursion_save): Use format_save_value.
2493 (save_excursion_restore): Use XSAVE_OBJECT.
2494
c50cf2ea
PE
24952013-01-14 Paul Eggert <eggert@cs.ucla.edu>
2496
2497 Avoid needless casts with XSAVE_POINTER.
2498 * alloc.c (mark_object) [GC_MARK_STACK]:
2499 * dired.c (directory_files_internal_unwind):
2500 * fileio.c (do_auto_save_unwind):
2501 * gtkutil.c (pop_down_dialog):
2502 * keymap.c (map_keymap_char_table_item):
2503 * lread.c (load_unwind):
2504 * nsmenu.m (pop_down_menu):
2505 * print.c (print_object) [GC_MARK_STACK]:
2506 * xfns.c (clean_up_file_dialog):
2507 * xmenu.c (cleanup_widget_value_tree):
2508 Omit casts between XSAVE_POINTER and a pointer type.
2509
9d5a1260
DA
25102013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2511
2512 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
2513 * eval.c (eval_sub): Protect `form' from being GCed before its
2514 car and cdr becomes protected with the backtrace entry.
2515
73ebd38f
DA
25162013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
2517
2518 Make Lisp_Save_Value more versatile storage for up to four objects.
2519 * lisp.h (toplevel): Enumeration to describe types of saved objects.
2520 (struct Lisp_Save_Value): New layout. Adjust comments.
2521 (XSAVE_POINTER): New macro.
2522 (XSAVE_INTEGER): Likewise.
2523 (allocate_misc): Add prototype.
2524 (free_misc): Likewise.
2525 * alloc.c (allocate_misc): Now global.
2526 (free_misc): Likewise. Adjust comment.
2527 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
2528 (free_save_value): Likewise.
2529 (mark_object): Likewise.
2530 * editfns.c (save_excursion_save): Pack everything within
2531 Lisp_Save_Value and so avoid xmalloc.
2532 (save_excursion_restore): Adjust to match new layout. Use free_misc
2533 because we do not allocate extra memory any more. Add eassert.
2534 * print.c (print_object): New code to print Lisp_Save_Value. Do not
2535 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
2536 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
2537 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
2538 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
2539
b826986f
JD
25402013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2541
2542 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
2543 (nsfont_draw): Remove disabling of LCD smoothing.
2544 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 2545 Bug#11484 with LCD smoothing on.
b826986f 2546
c0511b57 25472013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 2548
b6f960a0
PE
2549 Fix SIGDANGER handlers, for AIX (Bug#13408).
2550 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
2551 Move handlers here from emacs.c; they were out of place.
2552
616763d5
JD
25532013-01-11 Jan Djärv <jan.h.d@swipnet.se>
2554
2555 * xterm.c (syms_of_xterm): Adjust documentation for
2556 scroll-bar-adjust-thumb-portion.
2557
0b59090b 25582012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
2559
2560 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
2561 determine whether scroll bar thumb size should be adjusted or
2562 not. Use variable for MOTIF.
2563
2564 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
2565 GTK.
2566
7bc916b4
JD
25672013-01-13 Jan Djärv <jan.h.d@swipnet.se>
2568
eac4d08f
JD
2569 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
2570 event is generated.
2571 (doCommandBySelector:): Set processingCompose to NO.
2572
7bc916b4
JD
2573 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
2574 Remove check for fkeys count > zero, block/unblock fixes the real bug.
2575 (nsfont_list_family): Add block/unblock_input calls.
2576 (nsfont_open): Move block_input earlier. Add unblock_input before early
2577 return.
2578 (nsfont_draw): Add block/unblock_input calls.
2579
bdc9b756
PE
25802013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
2581
2582 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
2583 for old_charpos and old_bytepos.
2584
ee56a6dc
PE
25852013-01-12 Paul Eggert <eggert@cs.ucla.edu>
2586
2587 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
2588 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
2589 Clear tzvalbuf_in_environ if this workaround is in effect.
2590 Problem and fix reported by Kazuhiro Ito.
2591
9fc9a531
AH
25922013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
2593
99d0d6dc
SM
2594 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
2595 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
2596
2597 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
2598 doc string cross-reference(s).
2599
2600 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
2601 string cross-reference(s).
2602
6020559a
DA
26032013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
2604
2605 Avoid unnecessary byte position calculation for the gap movement.
2606 Since all users of move_gap do CHAR_TO_BYTE for other purposes
2607 anyway, all of them should use move_gap_both instead.
2608 * lisp.h (move_gap): Remove prototype.
2609 * insdel.c (move_gap): Remove.
2610 (move_gap_both): Add eassert.
2611 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
2612 * xml.c (parse_region): Likewise.
2613
b8956427
PE
26142013-01-11 Paul Eggert <eggert@cs.ucla.edu>
2615
2616 emacsclient -t should not suspend Emacs server (Bug#13387)
2617 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
2618 New functions.
2619 * term.c (init_tty): Use them instead of rolling our own code.
2620 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
2621 switches from 'signal' to 'pthread_sigmask', which is safer in
2622 multithreaded applications.
2623 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
2624 which has already arranged for that.
2625 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
2626 This is the main part of the bug fix.
2627
0b59090b 26282013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
2629
2630 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
2631 x_last_font_name (Bug#13403).
2632
58cc0a01
DA
26332013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
2634
2635 Omit buffer_slot_type_mismatch and use generic predicates to enforce
2636 the type of per-buffer values where appropriate.
2637 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
2638 predicate, which is how it's really used now. Adjust comment.
2639 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
2640 * buffer.c (buffer_slot_type_mismatch): Remove.
2641 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
2642 predicate. Adjust comment.
2643 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
2644 fill-column, left-margin, tab-width, buffer-saved-size,
2645 left-margin-width, right-margin-width, left-fringe-width,
2646 right-fringe-width, scroll-bar-width and buffer-display-count.
2647 Use Qstringp for default-directory, buffer-file-name,
2648 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
2649 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
2650 line-spacing.
2651 * data.c (store_symval_forwarding): Adjust to call the predicate.
2652
5104861e
JB
26532013-01-09 Juanma Barranquero <lekktu@gmail.com>
2654
2655 * w32.c (get_name_and_id, acl_set_file):
2656 * w32term.c (w32fullscreen_hook): Remove unused local variables.
2657
eefd7278
DA
26582013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
2659
2660 * lisp.h (make_gap_1): New prototype.
2661 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
2662 gap size values.
2663 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
2664 naming convention.
2665 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 2666 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
2667 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
2668 (make_gap_1): New function to adjust the gap of any buffer.
2669 * coding.c (coding_alloc_by_making_gap): Use it.
2670 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
2671 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
2672
073ca75b
JL
26732013-01-08 Juri Linkov <juri@jurta.org>
2674
2675 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
2676 of (supports :underline (:style wave)). (Bug#13000)
2677
3bace969
AH
26782013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
2679
2680 * undo.c (Fprimitive_undo): Move to simple.el.
2681 (syms_of_undo): Remove declarations for Sprimitive_undo.
2682
63a63bd4
SM
26832013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
2684
2685 * keyboard.c (echo_add_key): Rename from echo_add_char.
2686
56ed110a
CY
26872013-01-06 Chong Yidong <cyd@gnu.org>
2688
2689 * keyboard.c (echo_add_char): New function, factored out from
2690 echo_char. Don't add a space if the previous echo string was
2691 empty (Bug#13255).
2692 (echo_char): Use it.
2693 (read_key_sequence): When echoing mock input, ensure that the
2694 trailing dash is properly added.
2695
b630991b
EZ
26962013-01-05 Eli Zaretskii <eliz@gnu.org>
2697
2698 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
2699 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
2700 digits for buffer positions, before misalignment starts.
2701 Display "0" for integer "object" field.
b630991b
EZ
2702 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
2703 Display the newline glyph more unambiguously.
2704
f032a318
YM
27052013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2706
2707 * nsterm.m (ns_draw_underwave):
2708 * w32term.c (w32_draw_underwave):
2709 * xterm.c (x_draw_underwave): Make underwave look more triangular
2710 and also degrade gracefully for small fonts. (Bug#13000)
2711
4240dd3c
YM
2712 * nsterm.m (ns_draw_text_decoration):
2713 * w32term.c (x_draw_glyph_string):
2714 * xterm.c (x_draw_glyph_string): Don't use previous underline
2715 thickness and position if previous underline type is underwave.
2716
553081a5
SM
27172013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
2718
2719 * fileio.c (Ffile_acl): Undocument return format.
2720
9539d465 27212013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
2722
2723 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
2724
71376d4b
PE
27252013-01-02 Paul Eggert <eggert@cs.ucla.edu>
2726
2727 Simplify via eabs.
2728 * dired.c (file_name_completion):
2729 * doc.c (get_doc_string):
2730 * floatfns.c (round2):
2731 * font.c (font_score, font_delete_unmatched):
2732 * fringe.c (compute_fringe_widths):
2733 * lread.c (read_list):
2734 * minibuf.c (Ftry_completion):
2735 * term.c (tty_ins_del_lines):
2736 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
2737 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
2738
a7f11948
EZ
27392012-12-31 Eli Zaretskii <eliz@gnu.org>
2740
2741 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
2742 correctly.
2743 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
2744 for the bug this caused.
2745
84cc1ab6
PE
27462012-12-30 Paul Eggert <eggert@cs.ucla.edu>
2747
2748 * coding.c (Qmac): Now static.
2749
5a1d858b
JD
27502012-12-30 Jan Djärv <jan.h.d@swipnet.se>
2751
2752 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
2753 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
2754 handlebox_widget. Set toolbar_in_hbox to false/true, set
2755 toolbar_is_packed to true.
2756 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
2757 (update_frame_tool_bar): Check toolbar_is_packed for packing.
2758 Show all on TOOLBAR_TOP_WIDGET.
2759 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
2760 by TOOLBAR_TOP_WIDGET.
2761 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
2762 Check toolbar_is_packed.
8b745d92
JD
2763 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
2764 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2765 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
2766 false.
2767 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2768 (xg_update_menubar): Update title only if
2769 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2770 (xg_update_submenu): Skip tearoff only if
2771 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
2772 (xg_initialize): Initialize xg_detached_menus only if
2773 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
2774
2775 * xterm.h (struct x_output): Surround handlebox_widget with
2776 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
2777 toolbar_in_hbox is bool.
2778
d5e5e7b4 27792012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
2780
2781 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
2782 (LIBS_GNUSTEP): Define.
2783 (LIBES): Add $(LIBS_GNUSTEP).
2784 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
2785
d5e5e7b4 27862012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
2787
2788 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
2789 continuation glyph on a TTY with an indication of an empty line.
2790 (Bug#13277)
2791
e7ae8039
EZ
27922012-12-29 Eli Zaretskii <eliz@gnu.org>
2793
ccad023b
EZ
2794 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
2795 file's SELinux context or ACLs successfully set, nil otherwise.
2796 (Bug#13298)
8d23a331 2797 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 2798
e7ae8039
EZ
2799 * w32proc.c (reader_thread): Avoid passing NULL handles to
2800 SetEvent and WaitForSingleObject.
2801
7456e13f
PE
28022012-12-28 Paul Eggert <eggert@cs.ucla.edu>
2803
2804 Port EXTERNALLY_VISIBLE to Clang 3.2.
2805 * conf_post.h (__has_attribute): New macro.
2806 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
2807
1ab0c851
GM
28082012-12-27 Glenn Morris <rgm@gnu.org>
2809
2810 * cygw32.c (Fcygwin_convert_file_name_to_windows)
2811 (Fcygwin_convert_file_name_from_windows): Doc fixes.
2812
82e2a1f0 28132012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 2814
63a63bd4
SM
2815 * fileio.c (file_name_as_directory, directory_file_name):
2816 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
2817 came from a multibyte or a unibyte Lisp string; all callers
2818 adjusted. Don't assume the input string is always multibyte.
2819 (Bug#13262)
2820 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2821 don't ENCODE_FILE them, and return a unibyte string if the input
2822 was unibyte.
2823 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2824 don't assume the input strings will always be multibyte. If the
2825 input strings are multibyte, decode strings obtained from C
2826 library functions.
2827
8847a0de
DA
28282012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2829
2830 * lisp.h (toplevel): Add two notices to the comment about
2831 defining a new Lisp data type.
6cda572a
DA
2832 * print.c (print_object): If Lisp_Save_Value object's pointer
2833 is the address of a memory area containing Lisp_Objects, try
2834 to print them.
2835 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 2836
4b298d5a
DA
28372012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2838
2839 * keyboard.c (record_asynch_buffer_change): Initialize an event
2840 only if it's really needed.
2841 * frame.h (enum output_method): Remove output_mac member since
2842 it's a leftover from the deleted code.
2843 * frame.c (Fframep): Adjust user here ...
2844 * terminal.c (Fterminal_live_p): ... and here.
2845 * coding.c (Qmac): Now here because it's only used to denote
2846 end-of-line encoding type.
2847 (syms_of_coding): DEFSYM it.
2848 * frame.h (Qmac): Remove duplicated declaration.
2849
12384b01
PE
28502012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2851
2852 * window.c (select_window_1): Now static, since it's used only here.
2853
f1665bdc
EZ
28542012-12-25 Eli Zaretskii <eliz@gnu.org>
2855
2856 * window.c (window_body_cols): Subtract display margins from the
2857 window body width on TTYs as well. See
2858 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2859 for the original report.
2860
9a0d4f34
DA
28612012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2862
2863 * xdisp.c (redisplay_window): Remove inner local variable
2864 because the outer shadowed one has the same meaning.
cd78d9b1
DA
2865 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2866 set but never used.
2867 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2868 (xg_create_tool_bar): Adjust users.
9a0d4f34 2869
f9e7c67e
DA
28702012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2871
2872 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2873 * buffer.c (Fget_buffer_create): Use it to set compact field of
2874 struct buffer_text to avoid accessing an uninitialized value
2875 when compact_buffer is called for the first time.
2876 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
2877 (Fset_buffer_modified_p): Use buffer_window_count to check
2878 whether the buffer is displayed in some window.
2879 * xdisp.c (message_dolog): Likewise.
f9e7c67e 2880
299614f3
EZ
28812012-12-23 Eli Zaretskii <eliz@gnu.org>
2882
40ff07a5
EZ
2883 * w32.c (acl_set_file): If setting the file security descriptor
2884 fails, and the new DACL is identical to the existing one, silently
2885 return success. This fixes problems for users backing up their
2886 own files without having the necessary privileges for setting
2887 security descriptors.
2888
299614f3
EZ
2889 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2890 values.
2891 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2892 after WaitForSingleObject returns normally. This expedites reader
2893 thread shutdown when delete_child triggers it.
2894 (reap_subprocess): More accurate commentary for why we call
2895 delete_child only when cp->fd is negative.
2896
2897 * w32.c (sys_close): Do not call delete_child on a subprocess
2898 whose handle is not yet closed. Instead, set its file descriptor
2899 to a negative value, so that reap_subprocess will call
63a63bd4
SM
2900 delete_child on that subprocess when its SIGCHLD arrives.
2901 This avoids closing handles used for communications between sys_select
299614f3
EZ
2902 and reader_thread, which doesn't give sys_select a chance to
2903 notice that the process exited and invoke the SIGCHLD handler for
2904 it.
2905
cf162aee
JD
29062012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2907
2908 * nsfns.m (Fns_do_applescript): Run event loop until script has
2909 been executed (Bug#12969).
2910 (ns_run_ascript): Chech as_script for nil, set to nil after
2911 executing script.
2912
94900bfe
MR
29132012-12-22 Martin Rudalics <rudalics@gmx.at>
2914
2915 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2916
b2faf49c
EZ
29172012-12-22 Eli Zaretskii <eliz@gnu.org>
2918
2919 * w32term.c (w32fullscreen_hook): New function.
2920 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2921
7efa3fb3
EZ
29222012-12-21 Eli Zaretskii <eliz@gnu.org>
2923
bb085aed
EZ
2924 * fileio.c (Finsert_file_contents): Doc fix.
2925
7efa3fb3
EZ
2926 * w32proc.c (new_child, delete_child, find_child_pid): For a
2927 subprocess, consider its slot being in use as long as its process
2928 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2929 slot when a new process is started immediately after killing
2930 another one, without waiting enough time for the first process to
2931 be reaped and resources allocated for it be orderly freed.
2932 (Bug#13086)
2933 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2934
c1f02afa
CY
29352012-12-21 Chong Yidong <cyd@gnu.org>
2936
2937 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2938
5bec25eb
CY
2939 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2940
a4b0cca1 29412012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
2942
2943 * w32.c (get_name_and_id): Always pass NULL as the first argument
2944 of lookup_account_sid. Avoids crashes with UNC file names that
2945 refer to DFS domains, not to specific machine names. (Bug#12621)
2946 Remove now unused argument FNAME; all callers changed.
2947 (get_file_owner_and_group): Remove now unused argument FNAME; all
2948 callers changed.
2949
34b4b7eb
CY
29502012-12-21 Chong Yidong <cyd@gnu.org>
2951
2952 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2953 error for invalid chars, don't check for a nil return value.
2954
13002885
DA
29552012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2956
2957 Avoid calls to CHAR_TO_BYTE if byte position is known.
2958 * editfns.c (make_buffer_string_both): Use move_gap_both.
2959 (Fbuffer_string): Use make_buffer_string_both.
2960 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2961 Adjust comment.
2962 (buf_bytepos_to_charpos): Likewise.
2963 (charpos_to_bytepos): Remove.
2964 * fileio.c (Finsert_file_contents): Use move_gap_both.
2965 * search.c (Freplace_match): Likewise.
9a0d4f34 2966 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
2967 names for byte positions.
2968 * lisp.h (charpos_to_bytepos): Remove prototype.
2969 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2970 * insdel.c (move_gap): Likewise.
2971
99e9311c
PE
29722012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2973
2974 * xdisp.c (redisplay_internal): Remove now-unused local.
2975
e02230bf
SM
29762012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2977
2978 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2979 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 2980 proper value of frame-local variables (bug#13225).
e02230bf 2981
1687fb14
DA
29822012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2983
2984 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2985 Rename 4th argument since it may be buffer or string. Adjust comment.
2986 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2987
a2f07cd2
DA
29882012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2989
2990 * coding.c (Fdetect_coding_region): Do not check start and end with
2991 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2992 (code_convert_region): Likewise.
2993
474d441e
EZ
29942012-12-18 Eli Zaretskii <eliz@gnu.org>
2995
2996 * w32.c (acl_get_file, acl_set_file): Run the file name through
2997 map_w32_filename, and resolve any symlinks in the file name, like
2998 Posix platforms do.
2999 (acl_set_file): Call revert_to_self, if any privileges were
3000 enabled.
3001
8725c076
JB
30022012-12-17 Juanma Barranquero <lekktu@gmail.com>
3003
3004 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
3005 ($(BLD)/w32.$(O)): Update dependencies.
3006
1e101a4b
SM
30072012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
3008
3009 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
3010 propagate redisplay's scrolling (if any) to the right window.
3011 (redisplay_internal): Use ensure_selected_frame.
3012 (display_mode_lines): Complete last fix.
3013 * window.c (select_window_1): New func, extracted from select_window.
3014 (select_window): Use it.
3015 * window.h (select_window_1): Declare.
3016
66447e07
EZ
30172012-12-17 Eli Zaretskii <eliz@gnu.org>
3018
3019 Emulate Posix ACL APIs on MS-Windows.
3020 * w32.c: Include sddl.h and sys/acl.h.
3021 (SDDL_REVISION_1): Define if not already defined.
3022 (g_b_init_get_security_descriptor_dacl)
3023 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
3024 (g_b_init_is_valid_security_descriptor)
3025 (g_b_init_set_file_security): New static flags.
3026 (globals_of_w32): Initialize them to zero.
3027 (SetFileSecurity_Name): New string constant.
3028 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
3029 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
3030 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
3031 (IsValidSecurityDescriptor_Proc): New typedefs.
3032 (get_file_security, get_security_descriptor_owner)
3033 (get_security_descriptor_group): Set errno to ENOTSUP.
3034 (set_file_security, get_security_descriptor_dacl)
3035 (is_valid_security_descriptor, convert_sd_to_sddl)
3036 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
3037 (acl_free, acl_get_file, acl_set_file): New functions.
3038
3039 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
3040
207a7ef0
PE
30412012-12-17 Paul Eggert <eggert@cs.ucla.edu>
3042
3043 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
3044 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
3045 for some of that bug's symptoms can now cause Emacs to abort.
3046 Remove the workaround.
3047 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
3048 The bug that caused SIGCHLD to get lost has been fixed, and the
3049 workaround for it can now cause Emacs to abort.
3050
17fdfc15
PE
30512012-12-16 Paul Eggert <eggert@cs.ucla.edu>
3052
3053 * sysdep.c (emacs_abort): Bump backtrace size to 40.
3054 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
3055 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
3056
7c3d167f
RF
30572012-12-16 Romain Francoise <romain@orebokech.com>
3058
3059 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
3060 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 3061 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
3062 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
3063
3064 * Makefile.in (LIBACL_LIBS): New macro.
3065 (LIBES): Use it.
3066
7d80ea23
PE
30672012-12-15 Paul Eggert <eggert@cs.ucla.edu>
3068
3069 * fileio.c (internal_delete_file): Use bool for boolean.
3070
b0728617
EZ
30712012-12-15 Eli Zaretskii <eliz@gnu.org>
3072
3073 Fix bug #13079 on MS-Windows with temp files not being deleted.
3074 * w32.h (_child_process): New members input_file and
3075 pending_deletion.
3076 (register_child): First argument is now pid_t.
3077 (record_infile, record_pending_deletion): New prototypes.
3078
3079 * w32proc.c (new_child): Initialize input_file and
3080 pending_deletion members of the child.
3081 (delete_child): Delete the child's temporary input file, if any,
3082 that is pending deletion.
3083 (register_child): First argument is now pid_t.
3084 (record_infile, record_pending_deletion): New functions.
3085 (reap_subprocess): Fix a typo in DebPrint string.
3086 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
3087
3088 * fileio.c (internal_delete_file): Return an int again: non-zero
3089 if delete-file succeeds, zero otherwise.
3090
3091 * lisp.h (internal_delete_file): Adjust prototype.
3092
3093 * callproc.c (Fcall_process): Don't overwrite infile with result
3094 of DECODE_FILE.
3095 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
3096 asynchronous subprocess, record the name of the input file name,
3097 if any.
3098 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
3099 delete the file, record it as pending deletion when the subprocess
3100 exits.
3101
7e90af26
EZ
31022012-12-14 Eli Zaretskii <eliz@gnu.org>
3103
3104 * editfns.c [HAVE_PWD_H]: Include grp.h.
3105
3106 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
3107
97976f9f
PE
31082012-12-14 Paul Eggert <eggert@cs.ucla.edu>
3109
3110 Fix permissions bugs with setgid directories etc. (Bug#13125)
3111 * dired.c (Ffile_attributes): Return t as the 9th attribute,
3112 to mark it as a placeholder. The old value was often wrong.
3113 The only user of this attribute has been changed to use
3114 file-ownership-preserved-p instead, with its new group arg.
3115 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
3116
26ec1f49
SM
31172012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
3118
ad966fe7
SM
3119 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
3120 Keep selected_window and selected_frame in sync.
26ec1f49 3121
5c207910
EZ
31222012-12-14 Eli Zaretskii <eliz@gnu.org>
3123
3124 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
3125 try to get accurate owner and group information from NT file
3126 security APIs. This is to make most callers of 'stat' and
3127 'lstat', which don't need that information, much faster.
3128
26ec1f49
SM
3129 * dired.c (Ffile_attributes) [WINDOWSNT]:
3130 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
3131 owner and group information from 'lstat'.
3132
893f52d8
PE
31332012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3134
4c95c9a5
PE
3135 * fileio.c (Finsert_file_contents): Don't put tail into head area,
3136 as that confuses set-auto-coding, so insist on the head-read
3137 returning the full 1024 bytes. Let lseek compute the tail offset;
3138 less work for us. Do not ignore I/O errors when reading the tail.
3139
893f52d8
PE
3140 * xdisp.c: Minor style fixes.
3141 (init_iterator): Hoist assignment out of if-expression.
3142 (markpos_of_region): Callers now test for sign, not for -1.
3143
40d1e434
DA
31442012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
3145
3146 Minor redisplay optimization when the region length is zero.
3147 * xdisp.c (markpos_of_region): New function.
3148 (init_iterator): Do not highlight the region of zero length.
3149 (redisplay_window): Check whether the region is of non-zero length.
3150 (try_cursor_movement): Allow if the region length is zero.
3151 (try_window_reusing_current_matrix, try_window_id): Likewise.
3152
727f9739 31532012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
3154
3155 * search.c (search_buffer): Check the inverse translations of each
3156 character in pattern when the buffer being searched is unibyte.
3157 (Bug#13084)
3158
727f9739 31592012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
3160
3161 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
3162 files, fixing a regression from 24.2.
645c6a30 3163 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 3164
d20704ef
PE
31652012-12-13 Paul Eggert <eggert@cs.ucla.edu>
3166
3167 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
3168 fstat shouldn't fail, and if it does fail copy-file should not proceed.
3169 Remove unnecessary S_ISLNK test, as (contra the comments) this
3170 function can't copy symlinks. Improve quality of error message
3171 when attempting to copy files that are neither regular files nor
3172 directories.
3173
2dd61a9b
DA
31742012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
3175
3176 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
3177 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
3178 * window.c (Frecenter):
3179 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
3180 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
3181
cc98b684
DC
31822012-12-12 Daniel Colascione <dancol@dancol.org>
3183
1e101a4b 3184 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
3185 the dumped Emacs is not a sparse file, greatly improving Cygwin
3186 "make bootstrap" performance.
3187
38e791fd
MA
31882012-12-11 Michael Albinus <michael.albinus@gmx.de>
3189
3190 * inotify.c (inotify_callback): Generate an Emacs event for every
3191 incoming inotify event.
3192
f9d1448f
EZ
31932012-12-11 Eli Zaretskii <eliz@gnu.org>
3194
3195 * xdisp.c (handle_face_prop): Fix logic of computing
3196 it->start_of_box_run_p.
3197 (append_space_for_newline): If the glyph row is R2L, reset the
3198 iterator's end_of_box_run_p flag before prepending the space glyph.
3199 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
3200 iterator's start_of_box_run_p flag before prepending the stretch.
3201 (append_glyph, produce_image_glyph, append_composite_glyph)
3202 (append_stretch_glyph, append_glyphless_glyph): Reverse the
3203 left_box_line_p and right_box_line_p flags of the glyph for R2L
3204 glyph rows. (Bug#13011)
3205
c6afe371
DA
32062012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3207
3208 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
3209 if changed buffer is not shown in a window.
3210 * insdel.c (prepare_to_modify_buffer): Likewise.
3211 * window.c (replace_buffer_in_windows_safely): Do nothing
3212 if buffer is not shown in a window.
3213 (Fforce_window_update): Likewise if string or buffer argument
3214 is passed.
3215
1b47babd
EZ
32162012-12-11 Eli Zaretskii <eliz@gnu.org>
3217
3218 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
3219 encoded_file_name, which is what it is.
3220
4c1acb95
DA
32212012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
3222
3223 Consistently use marker_position and marker_byte_position.
3224 * fringe.c (Ffringe_bitmaps_at_pos):
3225 * indent.c (Fvertical_motion):
3226 * insdel.c (prepare_to_modify_buffer):
3227 * keyboard.c (make_lispy_position):
3228 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
3229 (window_scroll_pixel_based, displayed_window_lines)
3230 (Fset_window_configuration):
3231 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
3232 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
3233 Replace direct access to marker fields with calls
3234 to marker_position and/or marker_byte_position.
3235
0eeb69fe
JB
32362012-12-11 Juanma Barranquero <lekktu@gmail.com>
3237
3238 * makefile.w32-in (SIG2STR_H): New macro.
3239 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
3240 ($(BLD)/w32notify.$(O)): Update dependencies.
3241
1cf1bbd5
DC
32422012-12-10 Daniel Colascione <dancol@dancol.org>
3243
8db4b52f
DC
3244 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
3245 Windows file notification functionality unless WINDOWSNT.
3246
1cf1bbd5
DC
3247 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
3248 declarations.
3249
3250 * w32fns.c (cache_system_info): Initialize the global hinst
3251 variable here so various initialization calls DTRT.
3252
1e101a4b 3253 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
3254 (hinst): Remove unneeded extern declaration.
3255 (_start): Remove initialization of above variables; remove
3256 initialization of hinst, as cache_system_info now does that.
3257
3258 * emacs.c (main): Call cache_system_info early in startup; we
3259 previously weren't calling it in Cygwin builds.
3260
26ec1f49
SM
3261 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
3262 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
3263 and link it to Emacs.
3264
98a07056
DA
32652012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
3266
3267 Per-buffer window counters.
3268 * buffer.h (struct buffer): New member window_count.
3269 (buffer_window_count): New function.
3270 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
3271 Initialize window_count.
3272 (Fkill_buffer): Verify window_count for the buffer being killed.
3273 (modify_overlay): Do not force redisplay if buffer is not shown
3274 in any window.
3275 (init_buffer_once): Initialize window_count for buffer_defaults
3276 and buffer_local_symbols.
3277 * window.h (buffer_shared): Remove declaration.
3278 (wset_buffer): Convert from inline ...
3279 * window.c (wset_buffer): ... to an ordinary function.
3280 (adjust_window_count): New function.
3281 (make_parent_window): Use it.
3282 * xdisp.c (buffer_shared): Remove.
3283 (redisplay_internal, redisplay_window): Adjust users.
3284 (buffer_shared_and_changed): Use per-buffer window counter.
3285
2b8c9064
EZ
32862012-12-10 Eli Zaretskii <eliz@gnu.org>
3287
3288 Support for filesystem notifications on MS-Windows.
3289 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
3290 and this is a TTY frame, signal the caller that keyboard input is
3291 available.
3292
3293 * w32xfns.c (drain_message_queue): Now returns an int: an
3294 indication whether any WM_EMACS_FILENOTIFY messages were found in
3295 the queue.
3296
3297 * w32inevt.c (handle_file_notifications): New function.
3298 (w32_console_read_socket): Call it to process file notifications.
3299
3300 * w32console.c (initialize_w32_display): Record the main thread ID
3301 in dwMainThreadId.
3302
3303 * deps.mk (inotify.o): New dependency list.
3304
3305 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
3306
3307 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
3308 (WM_EMACS_END): Bump value by 1.
3309 (notification_buffer_in_use, file_notifications)
3310 (notifications_size, notifications_desc): Declare.
3311 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
3312 Add prototypes.
3313
3314 * w32term.c (lispy_file_action, queue_notifications): New functions.
3315 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
3316 <Qrenamed_to>: New symbols.
3317 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
3318
3319 * w32notify.c: New file, implements file event notifications for
3320 MS-Windows.
3321
3322 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
3323 by posting it to the w32_read_socket queue.
3324
1e101a4b 3325 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
3326
3327 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
3328 (GLOBAL_SOURCES): Add w32notify.c
3329 ($(BLD)/w32notify.$(O)): New set of dependencies.
3330
3331 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
3332
1e101a4b
SM
3333 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
3334 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
3335 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
3336 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
3337 w32notify-handle-event by default.
3338
3339 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
3340 syms_of_w32notify.
3341
81606b10
RS
33422012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3343
2b8c9064 3344 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 3345 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
3346
3347 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
3348
3349 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
3350 (syms_of_keyboard): DEFSYM it.
3351 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
3352 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
3353 Qfile_inotify events.
3354 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
3355 special-event-map to inotify-handle-event.
3356
3357 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
3358
3359 * Makefile.in (base_obj): Add inotify.o.
3360
3361 * inotify.c: New file.
3362
265c2fbf 33632012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
3364
3365 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
3366
265c2fbf 33672012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
3368
3369 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
3370 DWORD_PTR, for compatibility with 64-bit builds.
3371
a06ae17d 3372 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
3373 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
3374 (system_process_attributes): Use SIZE_T rather than DWORD, for
3375 compatibility with 64-bit builds.
3376
265c2fbf 33772012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
3378
3379 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
3380
265c2fbf 33812012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
3382
3383 * indent.c (Fvertical_motion): If a display string will be
3384 displayed on the left or the right margin, don't consider it as a
3385 factor in cursor positioning. (Bug#13108)
3386
265c2fbf 33872012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
3388
3389 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
3390
5f460827
PE
33912012-12-10 Paul Eggert <eggert@cs.ucla.edu>
3392
3393 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
3394 for string length.
3395
a16e75cd
EZ
33962012-12-08 Eli Zaretskii <eliz@gnu.org>
3397
3398 * w32.c (unsetenv): Return 0 if the input string is too long.
3399
5745a7df
PE
34002012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3401
3402 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
3403 * alloc.c (xputenv): New function.
3404 * dbusbind.c (Fdbus_init_bus):
3405 * emacs.c (main):
3406 * xterm.c (x_term_init):
3407 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
3408 * editfns.c (initial_tz): Move static var decl up.
3409 (tzvalbuf_in_environ): New static var.
3410 (init_editfns): Initialize these two static vars.
3411 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
3412 Save old TZ value on stack, if it's small.
3413 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
3414 instead, use xputenv+unsetenv to set and restore TZ.
3415 (environbuf): Remove static var. All uses removed.
3416 (Fset_time_zone_rule): Do not save TZ and environ;
3417 no longer needed here.
3418 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
3419 Move to inside set_time_zone_rule; they don't need file scope any more.
3420 (set_time_zone_rule): Maintain the TZ=value string separately.
3421 (syms_of_editfns): Don't initialize initial_tz;
3422 init_editfns now does it.
3423 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
3424 * lisp.h (xputenv): New decl.
3425
c56efa40
FP
34262012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
3427
3428 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
3429
75ceee05
EZ
34302012-12-08 Eli Zaretskii <eliz@gnu.org>
3431
3432 * w32.c (unsetenv, sys_putenv): New functions.
3433
1b6dbfeb
CY
34342012-12-08 Chong Yidong <cyd@gnu.org>
3435
3436 * editfns.c (Finsert_char): Make the error message more
3437 informative (Bug#12992).
3438
d983a10b
PE
34392012-12-08 Paul Eggert <eggert@cs.ucla.edu>
3440
7be78020
PE
3441 Simplify get_lim_data.
3442 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
3443 Remove USG and vlimit methods; no longer used these days.
3444 Add #error catchall just in case.
3445
d983a10b
PE
3446 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
3447 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
3448 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
3449 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
3450 (deleted_pid_list, Fdelete_process, create_process)
3451 (record_child_status_change, handle_child_signal, deliver_child_signal)
3452 (init_process_emacs, syms_of_process):
3453 Assume SIGCHLD is defined.
3454 (parse_signal): Remove. All uses removed.
3455 (abbr_to_signal): New static function.
3456 (Fsignal_process): Use it to convert signal names to ints.
3457 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
3458 kill (getpgrp (), ...).
3459 (emacs_sigaction_init): Assume SIGCHLD is defined.
3460 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
3461 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
3462 * syssignal.h (EMACS_KILLPG): Remove.
3463 All uses replaced by 'kill' with a negative pid.
3464 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
3465 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
3466
9cdde1e2
PE
34672012-12-07 Paul Eggert <eggert@cs.ucla.edu>
3468
3469 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
3470 This will cause a production Emacs to dump core instead of
3471 infinite-looping.
3472
822995f8
DA
34732012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3474
3475 * frame.c (make_frame): Do not set window's buffer to t.
3476 * window.c (Fsplit_window_internal): Likewise. Previously it was
3477 used to indicate that the window is being set up. Now we use
3478 set_window_buffer for all new windows, so the condition in ...
3479 (Fset_window_buffer): ... is always true and can be removed.
3480
ed08365b
DA
34812012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
3482
3483 Convenient macro to check whether the buffer is hidden.
3484 * buffer.h (BUFFER_HIDDEN_P): New macro.
3485 * frame.c (make_frame): Use it. Adjust comment.
3486 * buffer.c (candidate_buffer): New function.
3487 (Fother_buffer, other_buffer_safely): Use it.
3488
e86f5134
EZ
34892012-12-06 Eli Zaretskii <eliz@gnu.org>
3490
3491 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
3492 if the child process is still running. Instead, exit the wait
3493 loop and return zero. (Bug#13086)
3494
1700db3c
DA
34952012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3496
3497 * frame.h (x_char_width, x_char_height): Remove prototypes.
3498 * w32term.h (x_char_width, x_char_height): Likewise.
3499 * xfns.c (x_char_width, x_char_height): Remove.
3500 * w32fns.c (x_char_width, x_char_height): Likewise.
3501 * nsfns.c (x_char_width, x_char_height): Likewise.
3502 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
3503 all window frames.
3504 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
3505 * keyboard.c (command_loop_1): Remove prototype.
3506 (command_loop_2, top_level_1): Add static to match prototype.
3507
35fb8050
PE
35082012-12-06 Paul Eggert <eggert@cs.ucla.edu>
3509
3510 Fix a recently-introduced delete-process race condition.
3511 * callproc.c, process.h (record_kill_process):
3512 New function, containing part of the old call_process_kill.
3513 (call_process_kill): Use it.
3514 This does not change call_process_kill's behavior.
3515 * process.c (Fdelete_process): Use record_kill_process to fix a
3516 race condition that could cause Emacs to lose track of a child.
3517
565212e5
DA
35182012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
3519
3520 Avoid code duplication between prev_frame and next_frame.
3521 * frame.c (candidate_frame): New function. Add comment.
3522 (prev_frame, next_frame): Use it. Adjust comment.
3523
d8ad4d3f 35242012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
3525
3526 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
3527 fails, signal an error instead of continuing with an empty
3528 string. (Bug#13079)
7c2fcf9b
EZ
3529 Encode expanded temp file pattern before passing it to mkstemp or
3530 mktemp.
d3cefd13 3531
2e7cddd3
EZ
3532 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
3533 Encode the file name before passing it to dostounix_filename, in
3534 case it will downcase it (under w32-downcase-file-names).
3535 (Bug#12933)
3536
644d3f0d
PE
35372012-12-05 Paul Eggert <eggert@cs.ucla.edu>
3538
3539 Minor call-process cleanups.
3540 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
3541 at the same time as other platforms, to simplify analysis.
3542 No need for fd0_volatile since we have synch_process_fd.
3543 Avoid needless emacs_close; arg is always negative.
3544
396376f1
AS
35452012-12-04 Andreas Schwab <schwab@linux-m68k.org>
3546
3547 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
3548 processes.
3549
350f51ad
DA
35502012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
3551
3552 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
3553 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
3554 and mouse_face_hidden members to a bitfields.
3555 * frame.h (struct frame): Remove set-but-not-used space_width member.
3556 (FRAME_SPACE_WIDTH): Remove.
3557 * nsterm.m, w32term.c, xterm.c: Adjust users.
3558 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
3559 member. Adjust users. Convert term_initted, delete_in_insert_mode,
3560 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
3561 members to a bitfields.
3562
bc9dbce6
PE
35632012-12-03 Paul Eggert <eggert@cs.ucla.edu>
3564
bb5f74ee
PE
3565 Don't let call-process be a zombie factory (Bug#12980).
3566 Fixing this bug required some cleanup of the signal-handling code.
3567 As a side effect, this change also fixes a longstanding rare race
3568 condition whereby Emacs could mistakenly kill unrelated processes,
3569 and it fixes a bug where a second C-g does not kill a recalcitrant
3570 synchronous process in GNU/Linux and similar platforms.
3571 The patch should also fix the last vestiges of Bug#9488,
3572 a bug which has mostly been fixed on the trunk by other changes.
3573 * callproc.c, process.h (synch_process_alive, synch_process_death)
3574 (synch_process_termsig, sync_process_retcode):
3575 Remove. All uses removed, to simplify analysis and so that
3576 less consing is done inside critical sections.
3577 * callproc.c (call_process_exited): Remove. All uses replaced
3578 with !synch_process_pid.
3579 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
3580 These take the role of what used to be in unwind-protect arg.
3581 All uses changed.
3582 (block_child_signal, unblock_child_signal):
3583 New functions, to avoid races that could kill innocent-victim processes.
3584 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
3585 (call_process_kill): Record killed processes as deleted, so that
3586 zombies do not clutter up the system. Do this inside a critical
3587 section, to avoid a race that would allow the clutter.
3588 (call_process_cleanup): Fix code so that the second C-g works again
3589 on common platforms such as GNU/Linux.
3590 (Fcall_process): Create the child process in a critical section,
3591 to fix a race condition. If creating an asynchronous process,
3592 record it as deleted so that zombies do not clutter up the system.
3593 Do unwind-protect for WINDOWSNT too, as that's simpler in the
3594 light of these changes. Omit unnecessary call to emacs_close
3595 before failure, as the unwind-protect code does that.
3596 * callproc.c (call_process_cleanup):
3597 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
3598 * process.c (record_deleted_pid): New function, containing
3599 code refactored out of Fdelete_process.
3600 (Fdelete_process): Use it.
3601 (process_status_retrieved): Remove. All callers changed to use
3602 child_status_change.
3603 (record_child_status_change): Remove, folding its contents into ...
3604 (handle_child_signal): ... this signal handler. Now, this
3605 function is purely a handler for SIGCHLD, and is not called after
3606 a synchronous waitpid returns; the synchronous code is moved to
3607 wait_for_termination. There is no need to worry about reaping
3608 more than one child now.
3609 * sysdep.c (get_child_status, child_status_changed): New functions.
3610 (wait_for_termination): Now takes int * status and bool
3611 interruptible arguments, too. Do not record child status change;
3612 that's now the caller's responsibility. All callers changed.
3613 Reimplement in terms of get_child_status.
3614 (wait_for_termination_1, interruptible_wait_for_termination):
3615 Remove. All callers changed to use wait_for_termination.
3616 * syswait.h: Include <stdbool.h>, for bool.
3617 (record_child_status_change, interruptible_wait_for_termination):
3618 Remove decls.
3619 (record_deleted_pid, child_status_changed): New decls.
3620 (wait_for_termination): Adjust to API changes noted above.
3621
bc9dbce6
PE
3622 * bytecode.c, lisp.h (Qbytecode): Remove.
3623 No longer needed after 2012-11-20 interactive-p changes.
3624
3cf3c607
EZ
36252012-12-03 Eli Zaretskii <eliz@gnu.org>
3626
3627 * xdisp.c (redisplay_window): If the cursor is visible, but inside
3628 the scroll margin, move point outside the margin. (Bug#13055)
3629
005c8d13
JD
36302012-12-03 Jan Djärv <jan.h.d@swipnet.se>
3631
3632 * gtkutil.c (my_log_handler): New function.
3633 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
3634
20edc1c9
DA
36352012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3636
3637 * lisp.h (modify_region): Rename to...
3638 (modify_region_1): ...new prototype.
3639 * textprop.c (modify_region): Now static. Adjust users.
3640 * insdel.c (modify_region): Rename to...
3641 (modify_region_1): ...new function to work with current buffer.
3642 Adjust comment and users. Use true and false for booleans.
3643
62c2e5ed
DA
36442012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
3645
3646 * alloc.c (free_save_value): New function.
3647 (safe_alloca_unwind): Use it.
3648 * lisp.h (free_save_value): New prototype.
3649 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
3650 Add comment.
3651 (save_excursion_restore): Adjust to match saved data structure.
3652 Use free_save_value to offload some work from GC. Drop obsolete
3653 #if 0 code.
3654
c5bc2d1d 36552012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
3656
3657 * fileio.c (Vauto_save_list_file_name): Doc fix.
3658
c5bc2d1d 36592012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
3660
3661 * w32fns.c: Remove prototype of atof.
1e101a4b 3662 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 3663 builds.
1e101a4b 3664 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
3665
3666 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
3667 with 64-bit builds.
3668
3669 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3670 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
3671 defined.
3672
c5bc2d1d 36732012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 3674
a9de9f0c 3675 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 3676
21e54a94
PE
36772012-12-02 Paul Eggert <eggert@cs.ucla.edu>
3678
2dd2e622
PE
3679 Fix xpalloc confusion after memory is exhausted.
3680 * alloc.c (xpalloc): Comment fix.
3681 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
3682 and signals an error, do not clear charset_table_size, as
3683 charset_table is still valid.
3684 * doprnt.c (evxprintf): Clear *BUF after freeing it.
3685
21e54a94
PE
3686 Use execve to avoid need to munge environ (Bug#13054).
3687 * callproc.c (Fcall_process):
3688 * process.c (create_process):
3689 Don't save and restore environ; no longer needed.
3690 * callproc.c (child_setup):
3691 Use execve, not execvp, to preserve environ.
3692
3e5490f7
PE
36932012-12-01 Paul Eggert <eggert@cs.ucla.edu>
3694
3695 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
3696
75b4f59c
YM
36972012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3698
3699 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
3700 display for sliced images (Bug#10500).
3701
3702 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
3703
f8aff4c6
JB
37042012-11-30 Juanma Barranquero <lekktu@gmail.com>
3705
3706 * doc.c (Fdocumentation): Re-add handling of function-documentation,
3707 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
3708
3940b924
DA
37092012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
3710
3711 * xdisp.c (window_outdated): Remove eassert since it hits
3712 some suspicious corner cases (see Bug#13007 and Bug#13012).
3713 (mode_line_update_needed): New function.
3714 (redisplay_internal, redisplay_window): Use it.
3715 (ensure_selected_frame): New function.
3716 (redisplay_internal, unwind_redisplay): Use it.
3717 (redisplay_internal): Move comment about buffer_shared...
3718 (buffer_shared_and_changed): ...near to its real use.
3719
4a9204fe
PE
37202012-11-29 Paul Eggert <eggert@cs.ucla.edu>
3721
3722 * callproc.c (Fcall_process): Don't misreport vfork failure.
3723
60aeceb8
PE
37242012-11-28 Paul Eggert <eggert@cs.ucla.edu>
3725
3726 * callproc.c (Fcall_process): Fix vfork portability problems.
3727 Do not assume that fd[0], count, filefd, and save_environ survive
3728 vfork. Fix bug whereby wrong errno value could be reported for
3729 pipe failure. Some minor cleanups, too, as follows. Move buf and
3730 bufsize to the context where they're needed. Change new_argv to
3731 be of type char **, as this is more convenient and avoids casts.
3732 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
3733 Now local constants, not macros.
3734
00dc3ead
KH
37352012-11-18 Kenichi Handa <handa@gnu.org>
3736
3737 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
3738 for the variable "f".
3739
e1bf05c1
KH
37402012-11-13 Kenichi Handa <handa@gnu.org>
3741
3742 * font.c (font_unparse_xlfd): Exclude special characters from the
3743 generating XLFD name.
3744
22626a85
PE
37452012-11-27 Paul Eggert <eggert@cs.ucla.edu>
3746
350e0088
PE
3747 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
3748 * dired.c (stat_uname, stat_gname):
3749 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
3750
22626a85
PE
3751 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
3752 * dired.c (directory_files_internal, file_name_completion):
3753 Assume EAGAIN and EINTR are defined.
350e0088 3754
22626a85
PE
3755 * fileio.c (Fcopy_file): Assume EISDIR is defined.
3756 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
3757 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
3758 * lread.c (readbyte_from_file): Assume EINTR is defined.
3759 * process.c (wait_reading_process_output, send_process) [subprocesses]:
3760 Assume EIO and EAGAIN are defined.
3761 * unexcoff.c (write_segment): Assume EFAULT is defined.
3762
5c9cf0a3 37632012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
3764
3765 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
3766 (Bug#11964)
3767
22294a56
EZ
3768 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
3769 highlighting on the frame was cleared. Prevents assertion
3770 violations when repeatedly clicking on the "Top" link of the
3771 "bread-crumbs" in Info buffers.
3772
5fbab051
PE
37732012-11-25 Paul Eggert <eggert@cs.ucla.edu>
3774
3775 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
3776
bcd77a2b
KB
37772012-11-24 Ken Brown <kbrown@cornell.edu>
3778
3779 * keyboard.c (HAVE_MOUSE):
3780 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
3781 were always defined.
3782
d125ca15 37832012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 3784
24becea4
EZ
3785 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
3786 between bpos_covered and bpos_max. This fixes cursor display when
3787 several display strings follow each other.
3788
8654a41b
EZ
3789 * .gdbinit (pgx): If the glyph's object is a string, display the
3790 pointer to string data, rather than the value of the string object
3791 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
3792
cb5867b1
EZ
3793 * indent.c (Fvertical_motion): If the starting position is covered
3794 by a display string, return to one position before that, to avoid
3795 overshooting it inside move_it_to. (Bug#12930)
3796
f418b22e
DA
37972012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
3798
3799 * frame.h (struct frame): Remove display_preempted member
3800 since all users are dead long ago.
3801 * nsterm.h (struct x_output): Use the only dummy member.
3802 * w32menu.c (pending_menu_activation): Remove since not
3803 really used.
3804 (set_frame_menubar): Adjust user.
3805 * w32term.h (struct x_output): Drop outdated #if 0 code.
3806 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
3807 asked_for_visible and menubar_active members.
3808 Drop unused pending_menu_activation member.
f418b22e
DA
3809 * xterm.h (struct x_output): Drop outdated #if 0 code.
3810 Use bitfields for explicit_parent, asked_for_visible,
3811 has_been_visible and net_wm_state_hidden_seen members.
3812
a879f0ea
EZ
38132012-11-23 Eli Zaretskii <eliz@gnu.org>
3814
3815 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
3816 of a literal "/". (Bug#12955)
3817 (gl-stamp): Invoke fc.exe directly, not through cmd.
3818
95ef7787
PE
38192012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3820
3821 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3822 * dired.c: Assume HAVE_DIRENT_H.
3823 (NAMLEN): Remove, replacing with ...
3824 (dirent_namelen): New function. All uses changed. Use the GNU macro
3825 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3826 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3827 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3828 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3829 $(NT_INC)/dirent.h.
3830 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3831 * ndir.h: Rename to ../nt/inc/dirent.h.
3832 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3833 Do not include <dirent.h>; no longer needed.
3834 * w32.c: Include <dirent.h> rather than "ndir.h".
3835
12645ae6
CY
38362012-11-23 Chong Yidong <cyd@gnu.org>
3837
3838 * xftfont.c (xftfont_open): Remove duplicate assignment.
3839
5c747675
DA
38402012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3841
3842 * alloc.c (Fgarbage_collect): Unblock input after clearing
3843 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3844 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3845 * msdos.c (IT_frame_up_to_date): Use it here...
3846 * w32term.c (w32_frame_up_to_date): ...here...
3847 * xterm.c (XTframe_up_to_date): ...and here...
3848 * nsterm.m (ns_frame_up_to_date): ...but not here.
3849 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3850 Adjust users.
3851 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3852 Do not check whether GC is in progress.
3853
6ceeb5f1
DA
38542012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3855
3856 * xdisp.c (window_buffer_changed): New function.
3857 (update_menu_bar, update_tool_bar): Use it to
3858 simplify large 'if' statements.
3859 (redisplay_internal): Generalize commonly used
3860 'tail' and 'frame' local variables.
3861
ec84768f
EZ
38622012-11-22 Eli Zaretskii <eliz@gnu.org>
3863
3864 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3865 with Windows system header.
3866
9239d970
PE
38672012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3868
3869 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3870 * alloc.c: Assume unistd.h exists.
3871 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3872 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3873 (getwd) [USG]: Remove; no longer needed.
3874 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3875 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3876 * w32.h (getcwd): Remove decl.
3877
954bba56
SM
38782012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3879
3880 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3881 Make it set selected_window as well.
3882 (update_tool_bar): Use it.
3883
6ef2e5ef 38842012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
3885
3886 * emacs.c (main): Set the G_SLICE environment variable for all
3887 Cygwin builds, not just GTK builds. See
3888 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3889
6ef2e5ef 38902012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
3891
3892 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3893 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3894 Define for the MSVC compiler.
3895
6ef2e5ef 3896 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
3897
3898 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3899 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3900 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
3901 dostounix_filename assumes it gets a unibyte string.
3902 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
3903 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3904
eadf1faa
SM
39052012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3906
3907 Conflate Qnil and Qunbound for `symbol-function'.
3908 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3909 * lread.c (init_obarray): Set `function' fields to Qnil.
3910 * eval.c (Fcommandp): Ignore Qunbound.
3911 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3912 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3913 Test NILP rather than Qunbound.
3914 (Ffmakunbound): Set to Qnil.
3915 (Fsymbol_function): Never signal an error.
3916 (Finteractive_form): Ignore Qunbound.
3917
b83fdfa9
PE
39182012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3919
3920 * eval.c (interactive_p): Remove no-longer-used decl.
3921
952580c5
DA
39222012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3923
3924 * xdisp.c (buffer_shared): Adjust comment.
3925 (buffer_shared_and_changed): New function.
3926 (prepare_menu_bars, redisplay_internal): Use it to
3927 decide whether all windows or frames should be updated.
ea6de9b1
DA
3928 (window_outdated): New function.
3929 (text_outside_line_unchanged_p, redisplay_window): Use it.
3930 (redisplay_internal): Likewise. Fix indentation.
952580c5 3931
23ba2705
SM
39322012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3933
3934 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3935 (syms_of_eval): Remove corresponding defsubr.
3936 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3937
6e9f7997
DC
39382012-11-19 Daniel Colascione <dancol@dancol.org>
3939
3940 * w32fns.c (Fx_file_dialog):
3941 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3942 cygwin_convert_file_name*.
3943
3944 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3945 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3946
552a1590
PE
39472012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3948
3949 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3950
2ac9538d 39512012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
3952
3953 * w32select.c: Include w32common.h before w32term.h, so that
3954 windows.h gets included before w32term.h uses some of its
3955 features, see below.
3956
23ba2705
SM
3957 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3958 New typedefs.
3959 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3960 New prototypes.
d8715cdf
EZ
3961 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3962
2ac9538d 39632012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
3964
3965 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3966 (ns_select): Return at once if events are held (Bug#12834).
3967
2ac9538d 39682012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 3969
3970 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3971 Needed following 2012-10-20 change. (Bug#12902)
3972
c1f7ba3a
JB
39732012-11-18 Juanma Barranquero <lekktu@gmail.com>
3974
3975 * w32proc.c (waitpid): Remove unused label get_result.
3976
a75ce9d3
JB
39772012-11-17 Juanma Barranquero <lekktu@gmail.com>
3978
3979 * makefile.w32-in (SYSWAIT_H): New macro.
3980 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3981 ($(BLD)/sysdep.$(O)): Update dependencies.
3982
49cdacda
PE
39832012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3984
3985 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3986 * callproc.c (relocate_fd): Assume F_DUPFD.
3987 * emacs.c, term.c (O_RDWR): Remove.
3988 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3989 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3990 * nsterm.m: Assume <fcntl.h> exists.
3991 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3992 (create_pty, Fmake_network_process, server_accept_connection)
3993 (wait_reading_process_output, init_process_emacs):
3994 Assume O_NONBLOCK.
3995 (wait_reading_process_output): Put in a special case for WINDOWSNT
3996 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3997 It's not clear this is needed, but it's a more-conservative change.
3998 (create_process): Assume FD_CLOEXEC.
3999 (create_process, create_pty): Assume O_NOCTTY.
4000 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
4001 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
4002 Omit if not DOS_NT, since F_GETFL is not defined there.
4003 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
4004 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
4005 (O_NOCTTY): Remove.
4006 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
4007 lack it, since gnulib guarantees this.
4008 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
4009
22bae83f
EZ
40102012-11-17 Eli Zaretskii <eliz@gnu.org>
4011
6ad30855
EZ
4012 * w32.c (faccessat): Pretend that directories have the execute bit
4013 set. Emacs expects that, e.g., in files.el:cd-absolute.
4014
22bae83f
EZ
4015 * w32proc.c (create_child): Don't clip the PID of the child
4016 process to fit into an Emacs integer, as this is no longer a
4017 restriction.
4018 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
4019 reaping only the process specified by PID argument, if that is
4020 positive. Use PID instead of dead_child to know which process to
4021 reap. Wait for the child to die only if WNOHANG is not in
4022 OPTIONS.
4023 (sys_select): Don't set dead_child.
4024
4025 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
4026 as it is no longer needed.
4027
4028 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
4029 no longer needed.
4030 (record_child_status_change): Remove the setting of
4031 record_at_most_one_child for the !WNOHANG case.
4032
a631d0e0
PE
40332012-11-17 Paul Eggert <eggert@cs.ucla.edu>
4034
4035 Fix problems in ns port found by static checking.
4036 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
4037 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
4038 not to process group.
4039 (ns_select): Use emacs_write, not write, as that's more robust
4040 in the presence of signals.
4041 (fd_handler:): Check for read errors.
4042
d56f2e49
GM
40432012-11-16 Glenn Morris <rgm@gnu.org>
4044
4045 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
4046
96e05507 40472012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
4048
4049 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
4050
96e05507 40512012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
4052
4053 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
4054 use the same value of thread handle.
4055 (start_timer_thread): If the timer thread exited (due to error),
4056 clean up by closing the two handles it used. Duplicate the caller
4057 thread's handle here, so it gets duplicated only once, when
4058 launching the timer thread. Set priority of the timer thread, not
4059 the caller thread.
4060 (getitimer): Don't duplicate the caller thread's handle here.
4061 (Bug#12832)
4062
96e05507 40632012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
4064
4065 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
4066 called (Bug#12834).
4067
3d082a26
PE
40682012-11-16 Paul Eggert <eggert@cs.ucla.edu>
4069
4070 Remove no-longer-used pty_max_bytes variable.
4071 * process.c (pty_max_bytes): Remove; unused.
4072 (send_process): Do not set it.
4073
b72c161c
JB
40742012-11-15 Juanma Barranquero <lekktu@gmail.com>
4075
4076 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
4077 Update dependencies.
4078
bf20ea80
PE
40792012-11-15 Paul Eggert <eggert@cs.ucla.edu>
4080
4081 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
4082 This follows up on the 2012-09-29 patch that removed indirection
4083 for the 'function' field. Reported by Sergey Vinokurov in
4084 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
4085
14f20728
EZ
40862012-11-14 Eli Zaretskii <eliz@gnu.org>
4087
4088 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
4089 different name, as the MS runtime does not have such a function,
4090 and probably never will.) All callers changed. Ignore DIRFD
4091 value if PATH is an absolute file name, to match Posix spec
4092 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
4093 symlinks.
4094
77731919
DA
40952012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
4096
4097 * xdisp.c (echo_area_display, redisplay_internal):
4098 Omit redundant check whether frame_garbaged is set.
4099
73dcdb9f
PE
41002012-11-14 Paul Eggert <eggert@cs.ucla.edu>
4101
4102 Use faccessat, not access, when checking file permissions (Bug#12632).
4103 This fixes a bug that has been present in Emacs since its creation.
4104 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
4105 which must set some sort of record. (Torek's bug report was against
4106 a predecessor of GNU Emacs, but GNU Emacs happened to have the
4107 same common flaw.) See Torek's Usenet posting
4108 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
4109 Posted: Fri Apr 8 14:18:56 1983.
4110 * Makefile.in (LIB_EACCESS): New macro.
4111 (LIBES): Use it.
4112 * callproc.c (init_callproc):
4113 * charset.c (init_charset):
4114 * fileio.c (check_existing, check_executable, check_writable)
4115 (Ffile_readable_p):
4116 * lread.c (openp, load_path_check):
4117 * process.c (allocate_pty):
4118 * xrdb.c (file_p):
4119 Use effective UID when checking permissions, not real UID.
4120 * callproc.c (init_callproc):
4121 * charset.c (init_charset):
4122 * lread.c (load_path_check, init_lread):
4123 Test whether directories are accessible, not merely whether they exist.
4124 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
4125 * fileio.c (check_existing, check_executable, check_writable)
4126 (Ffile_readable_p):
4127 Use symbolic names instead of integers for the flags, as they're
4128 portable now.
4129 (check_writable): New arg AMODE. All uses changed.
4130 Set errno on failure.
4131 (Ffile_readable_p): Use faccessat, not stat + open + close.
4132 (Ffile_writable_p): No need to call check_existing + check_writable.
4133 Just call check_writable and then look at errno. This saves a syscall.
4134 dir should never be nil; replace an unnecessary runtime check
4135 with an eassert. When checking the parent directory of a nonexistent
4136 file, check that the directory is searchable as well as writable, as
4137 we can't create files in unsearchable directories.
4138 (file_directory_p): New function, which uses 'stat' on most platforms
4139 but faccessat with D_OK (for efficiency) if WINDOWSNT.
4140 (Ffile_directory_p, Fset_file_times): Use it.
4141 (file_accessible_directory_p): New function, which uses a single
4142 syscall for efficiency.
4143 (Ffile_accessible_directory_p): Use it.
4144 * xrdb.c (file_p): Use file_directory_p.
4145 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
4146 * lread.c (openp): When opening a file, use fstat rather than
4147 stat, as that avoids a permissions race. When not opening a file,
4148 use file_directory_p rather than stat.
4149 (dir_warning): First arg is now a usage string, not a format.
4150 Use errno. All uses changed.
4151 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
4152 that merely introduced a race.
4153 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
4154 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
4155 and similarly for the other O_* flags.
4156 * w32.c (sys_faccessat): Rename from sys_access and switch to
4157 faccessat's API. All uses changed.
4158 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
4159 (magic_db): Rename from magic_file_p.
4160 (magic_db, search_magic_path): Return an XrmDatabase rather than a
4161 char *, so that we don't have to test for file existence
4162 separately from opening the file for reading. This removes a race
4163 fixes a permission-checking problem, and simplifies the code.
4164 All uses changed.
4165 (file_p): Remove; no longer needed.
4166
2a14f83b
DA
41672012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
4168
4169 Omit glyphs initialization at startup.
4170 * dispnew.c (glyphs_initialized_initially_p): Remove.
4171 (adjust_frame_glyphs_initially): Likewise. Adjust users.
4172 (Fredraw_frame): Move actual code from here...
c7085245 4173 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
4174 (Fredraw_display): Use redraw_frame.
4175 * xdisp.c (clear_garbaged_frames): Likewise.
4176
f78ee6af 41772012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
4178
4179 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
4180 passed to pint2str and pint2hrstr to be at most the size of the
4181 frame's decode_mode_spec_buffer. This avoids crashes with very
4182 large values of FIELD_WIDTH argument to decode_mode_spec.
4183 (Bug#12867)
4184
b95a9c0c
PE
41852012-11-13 Paul Eggert <eggert@cs.ucla.edu>
4186
4187 Fix a race with verify-visited-file-modtime (Bug#12863).
4188 Since at least 1991 Emacs has ignored an mtime difference of no
4189 more than one second, but my guess is that this was to work around
4190 file system bugs that were fixed long ago. Since the race is
4191 causing problems now, let's remove that code.
4192 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
4193 whose time stamp is off by no more than a second. Insist that the
4194 file time stamps match exactly.
4195
be49ba74
DA
41962012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4197
4198 * frame.h (struct frame): Convert external_tool_bar member to
4199 1-bit unsigned bitfield.
4200 * termhooks.h (struct terminal): Remove mouse_moved member since
4201 all users are long dead. Adjust comment on mouse_position_hook.
4202
5b04e9f9
DA
42032012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
4204
4205 Simplify by using FOR_EACH_FRAME here and there.
4206 * frame.c (next_frame, prev_frame, other_visible_frames)
4207 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
4208 * w32term.c (x_window_to_scroll_bar): Likewise.
4209 * window.c (window_list): Likewise.
4210 * xdisp.c (x_consider_frame_title): Likewise.
4211 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
4212 * xfns.c (x_window_to_frame, x_any_window_to_frame)
4213 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
4214 * xmenu.c (menubar_id_to_frame): Likewise.
4215 * xselect.c (frame_for_x_selection): Likewise.
4216 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
4217 (x_window_to_menu_bar): Likewise.
4218 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
4219
76ae24d7
PE
42202012-11-12 Paul Eggert <eggert@cs.ucla.edu>
4221
12cc4337
PE
4222 * data.c (Qdefalias_fset_function): Now static.
4223
76ae24d7
PE
4224 Another tweak to vectorlike_header change.
4225 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
4226 Remove, and replace all uses with ...
4227 (next_in_free_list, set_next_in_free_list):
4228 New functions, which respect C's aliasing rules better.
4229
1479c557
PE
42302012-11-11 Paul Eggert <eggert@cs.ucla.edu>
4231
4232 * window.c (list4i): Rename from 'quad'. All uses changed.
4233 Needed because <sys/types.h> defines 'quad' on Solaris 10.
4234
11235c03
JB
42352012-11-11 Juanma Barranquero <lekktu@gmail.com>
4236
4237 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
4238 warning about mixing declarations and code in ISO C90.
4239
6baf66d5 42402012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
4241
4242 * window.c (Fsplit_window_internal): Set combination limit of
4243 new parent window to t iff Vwindow_combination_limit is t;
4244 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 4245 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 4246
6baf66d5 42472012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
4248
4249 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
4250 amount when the scroll margins are too large. When scrolling
4251 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
4252 scroll margin within a reasonable number of screen lines.
4253 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
4254 point is positioned many lines beyond the window top/bottom.
4255 (Bug#12811)
4256
508f51f5
EZ
4257 * ralloc.c (relinquish): If real_morecore fails to return memory
4258 to the system, don't crash; instead, leave the last heap
4259 unchanged and return. (Bug#12774)
4260
32e5c58c
SM
42612012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4262
4263 * lisp.h (AUTOLOADP): New macro.
4264 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
4265 * data.c (Ffset): Remove special ad-advice-info handling.
4266 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
4267 (Fsubr_arity): CSE.
4268 (Finteractive_form): Simplify.
4269 (Fquo): Don't insist on having at least 2 arguments.
4270 (Qdefalias_fset_function): New var.
4271
719b0aa5
JD
42722012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4273
4ab15c3e
JD
4274 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
4275
719b0aa5
JD
4276 * nsfont.m (Qcondensed, Qexpanded): New variables.
4277 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
4278 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
4279
535cc8e9
DA
42802012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4281
4282 Fix recently introduced crash on MS-Windows (Bug#12839).
4283 * w32term.h (struct scroll_bar): Use convenient header.
4284 (SCROLL_BAR_VEC_SIZE): Remove.
4285 * w32term.c (x_scroll_bar_create): Use VECSIZE.
4286
7d377c48
DA
42872012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
4288
4289 Tweak last vectorlike_header change.
4290 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
4291 vectorlike object on the free list. This is introduced to avoid
4292 some (but not all) pointer casting and aliasing problems, see
4293 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
4294 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
4295 objects.
4296 (xvectype, xvecsize): Use them to examine Lisp_Object values.
4297
7ad27466
JD
42982012-11-09 Jan Djärv <jan.h.d@swipnet.se>
4299
32e5c58c 4300 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
4301 been removed, so remove them here also.
4302
57618ecf
SM
43032012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
4304
4305 * doc.c (Fdocumentation): Handle new property
4306 dynamic-docstring-function to replace the old ad-advice-info.
4307
53371430
PE
43082012-11-09 Paul Eggert <eggert@cs.ucla.edu>
4309
4310 * fns.c (Qeql, hashtest_eq): Now static.
4311
61ddb1b9
SM
43122012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4313
4314 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
4315 * fns.c (hashfn_eq, hashfn_eql, sxhash):
4316 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
4317 * buffer.c (compare_overlays): Use XLI rather than XHASH.
4318
04a2d0d3
PE
43192012-11-08 Paul Eggert <eggert@cs.ucla.edu>
4320
4321 Use same hash function for hashfn_profiler as for hash_string etc.
4322 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
4323 * lisp.h (sxhash_combine): New inline function, with the contents
4324 of the old SXHASH_COMBINE.
4325 * profiler.c (hashfn_profiler): Use it, instead of having a
4326 special hash function containing a comparison that always yields 1.
4327
de5ef41a
SM
43282012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4329
4330 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
4331 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
4332 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
4333 Remove unused vars.
4334
a23c4171
JD
43352012-11-08 Jan Djärv <jan.h.d@swipnet.se>
4336
4337 * image.c (xpm_make_color_table_h): Fix compiler error because
4338 make_hash_table changed.
4339
0b59090b 43402012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
4341
4342 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
4343
b7432bb2
SM
43442012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
4345
4346 Use ad-hoc comparison function for the profiler's hash-tables.
4347 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
4348 (make_log): Use them.
4349 (handle_profiler_signal): Don't inhibit quit any longer since we don't
4350 call Fequal any more.
4351 (Ffunction_equal): New function.
4352 (cmpfn_profiler, hashfn_profiler): New functions.
4353 (syms_of_profiler): Initialize them.
4354 * lisp.h (struct hash_table_test): New struct.
4355 (struct Lisp_Hash_Table): Use it.
4356 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
4357 * fns.c (make_hash_table): Take a struct to describe the test.
4358 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
4359 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
4360 (hash_lookup, hash_remove_from_table): Move assertion checking of
4361 hashfn result here. Check hash-equality before calling cmpfn.
4362 (Fmake_hash_table): Adjust call to make_hash_table.
4363 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
4364 (syms_of_fns): Initialize them.
4365 * emacs.c (main): Move syms_of_fns earlier.
4366 * xterm.c (syms_of_xterm):
4367 * category.c (hash_get_category_set): Adjust call to make_hash_table.
4368 * print.c (print_object): Adjust to new hash-table struct.
4369 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
4370
88002743
EZ
43712012-11-08 Eli Zaretskii <eliz@gnu.org>
4372
4373 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
4374 value of w32-scroll-lock-modifier is neither nil nor one of the
4375 known key modifiers. (Bug#12806)
4376
914adc42
DA
43772012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4378
4379 Shrink struct vectorlike_header to the only size field.
4380 * lisp.h (enum pvec_type): Avoid explicit enum member values.
4381 Adjust comment.
4382 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
4383 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
4384 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
4385 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
4386 information from the vector header. Adjust comment.
4387 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
4388 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
4389 layout.
4390 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
4391 (struct vectorlike_header): Remove next member. Adjust comment.
4392 (struct Lisp_Subr): Add convenient header. Adjust comment.
4393 (allocate_pseudovector): Adjust prototype.
4394 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
4395 (sweep_string, lisp_malloc): Remove useless prototypes.
4396 (enum mem_type): Adjust comment.
4397 (NEXT_IN_FREE_LIST): New macro.
4398 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
4399 (Fmake_bool_vector): Likewise.
4400 (struct large_vector): New type to represent allocation unit for
4401 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
4402 (large_vectors): Change type to struct large_vector.
4403 (allocate_vector_from_block): Simplify.
4404 (PSEUDOVECTOR_NBYTES): Replace with...
4405 (vector_nbytes): ...new function. Adjust users.
4406 (sweep_vectors): Adjust processing of large vectors.
4407 (allocate_vectorlike): Likewise.
4408 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
4409 Add easserts. Adjust XSETPVECTYPESIZE usage.
4410 (allocate_buffer): Use BUFFER_PVEC_INIT.
4411 (live_vector_p): Adjust to match large vector.
4412 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
4413 * buffer.h (struct buffer): Add next member.
4414 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
4415 New macros.
4416 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
4417 * fns.c (internal_equal): Adjust to match enum pvec_type change.
4418 (copy_hash_table): Adjust to match vector header change.
4419 * lread.c (defsubr): Use XSETPVECTYPE.
4420 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
4421 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
4422 (xvecsize): New command.
4423
c66f21ea
DA
44242012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
4425
4426 * keyboard.c (event_to_kboard): Do not dereference
4427 frame_or_window field of SELECTION_REQUEST_EVENT
4428 and SELECTION_CLEAR_EVENT events (Bug#12814).
4429 * xterm.h (struct selection_input_event): Adjust comment.
4430
eb147960
EZ
44312012-11-07 Eli Zaretskii <eliz@gnu.org>
4432
dab72075
EZ
4433 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
4434 such as Scroll Lock, if the respective keys are treated as
4435 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 4436 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 4437
5890e400
DA
44382012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
4439
4440 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
4441
b6b3b294
PE
44422012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4443
4444 Restore some duplicate definitions (Bug#12814).
4445 This undoes part of the 2012-11-03 changes. Some people build
4446 with plain -g rather than with -g3, and they need the duplicate
4447 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
4448 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
4449 Define as macros, as well as as enums or as constants.
4450
e770aad5
JD
44512012-11-06 Jan Djärv <jan.h.d@swipnet.se>
4452
4453 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
4454 to keypad keys (Bug#12816).
4455
68f8f1c0
PE
44562012-11-06 Paul Eggert <eggert@cs.ucla.edu>
4457
4458 Minor adjustments of recently-changed frame functions.
4459 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
4460 known to be a frame (we're in the FRAMEP branch).
4461 * lisp.h (Qframep): Remove decl. frame.h declares this.
4462 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
4463 since they're meant for Lisp fixnum values.
4464
72f94d4b
DA
44652012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4466
4467 * window.c (Fwindow_combination_limit): Revert to the only
4468 required argument and adjust docstring as suggested in
4469 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
4470 by Martin Rudalics <rudalics@gmx.at>.
4471
d9f07150
DA
44722012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4473
4474 Widely used frame validity and checking functions.
4475 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
4476 * frame.c (decode_live_frame, decode_any_frame): New functions.
4477 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
4478 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
4479 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
4480 (Fframe_pointer_visible_p): Use decode_any_frame.
4481 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
4482 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
4483 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
4484 (Fframe_focus): Likewise. Allow zero number of arguments.
4485 Adjust docstring.
4486 (frame_buffer_list, frame_buffer_predicate): Remove.
4487 * lisp.h (frame_buffer_predicate): Remove prototype.
4488 * buffer.c (Fother_buffer): Use decode_any_frame.
4489 * xdisp.c (Ftool_bar_lines_needed): Likewise.
4490 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
4491 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
4492 (Fclose_font, Ffont_info): Use decode_live_frame.
4493 * fontset.c (check_fontset_name): Likewise.
4494 * terminal.c (Fframe_terminal): Likewise.
4495 * w32fns.c (check_x_frame): Likewise.
4496 * window.c (Fminibuffer_window, Fwindow_at)
4497 (Fcurrent_window_configuration): Likewise.
4498 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
4499 Likewise. Allow zero number of arguments. Adjust docstring.
4500 * dispnew.c (Fredraw_frame): Likewise.
4501 * xfaces.c (frame_or_selected_frame): Remove.
4502 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
4503 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
4504 (Fframe_face_alist): Use decode_live_frame.
4505 * xfns.c (check_x_frame): Likewise.
4506
89bc0592
DA
45072012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
4508
4509 * window.c (quad): New function.
4510 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
4511 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
4512 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
4513 (Fwindow_line_height): Use it.
4514 (Fwindow_fringes): Use list3.
4515 (Fwindow_scroll_bars): Use list4.
4516 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
4517 (Fwindow_combination_limit): Allow zero number of arguments.
4518
c8e3a9c3
EZ
45192012-11-05 Eli Zaretskii <eliz@gnu.org>
4520
4521 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
4522
8e2417bf 4523 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 4524 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 4525 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 4526
209c6a58
CY
45272012-11-05 Chong Yidong <cyd@gnu.org>
4528
4529 * process.c (wait_reading_process_output): Revert previous change.
4530
8148369c
PE
45312012-11-05 Paul Eggert <eggert@cs.ucla.edu>
4532
dd0333b6
PE
4533 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
4534 This removes code that has been obsolete since around 1990.
4535 * callproc.c (Fcall_process):
4536 * emacs.c (main):
4537 * process.c (create_process):
4538 * term.c (dissociate_if_controlling_tty):
4539 Assume setsid exists.
4540 * callproc.c (child_setup): Assume setpgid exists and behaves as
4541 per POSIX.1-1988 or later.
4542 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
4543 * emacs.c (shut_down_emacs):
4544 * sysdep.c (sys_suspend, init_foreground_group):
4545 Assume getpgrp behaves as per POSIX.1-1998 or later.
4546 * msdos.c (setpgrp): Remove.
4547 (tcgetpgrp, setpgid, setsid): New functions.
4548 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
4549 * term.c (no_controlling_tty): Remove; unused.
4550 * w32proc.c (setpgrp): Remove.
4551 (setsid, tcgetpgrp): New functions.
4552
8148369c
PE
4553 Simplify by assuming __fpending.
4554 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
4555 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
4556 Do not assume that __fpending's result fits in int.
4557
76abf5e5
PE
45582012-11-04 Paul Eggert <eggert@cs.ucla.edu>
4559
06b63c9b
PE
4560 Remove EMACS_OUTQSIZE+sleep hack.
4561 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
4562 than 2400 bps, which throttled Emacs by having it sleep.
4563 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
4564 was added, and anyway those old terminals are long dead.
4565 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
4566 without the dispnew.c change, as dispnew.c doesn't include systty.h.
4567
76abf5e5
PE
4568 Fix data-loss with --version (Bug#9574).
4569 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
4570 as we can't assume that emacs_strerror is initialized, and strerror
4571 is good enough here.
4572 (main): Invoke atexit earlier, to catch earlier instances of
4573 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
4574
8f31e74b
MM
45752012-11-04 Michael Marchionna <tralfaz@pacbell.net>
4576
4577 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
4578 (keyDown): Remap keypad keys to X11 virtual key codes.
4579
0d879dca
PE
45802012-11-03 Paul Eggert <eggert@cs.ucla.edu>
4581
7ccfb720
PE
4582 Fix data-loss with --batch (Bug#9574).
4583 * emacs.c: Include <close-stream.h>.
4584 (close_output_streams): New function.
4585 (main): Pass it to atexit, so that Emacs closes stdout and stderr
4586 and handles errors appropriately.
4587 (Fkill_emacs): Don't worry about flushing, as close_output_stream
4588 does that now.
4589
0b3d4a47
PE
4590 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
4591 The symptom is a diagnostic "GLib-WARNING **: In call to
4592 g_spawn_sync(), exit status of a child process was requested but
4593 SIGCHLD action was set to SIG_IGN and ECHILD was received by
4594 waitpid(), so exit status can't be returned." The diagnostic
4595 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
4596 The real bug is a race condition between Emacs and glib: Emacs
4597 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
4598 so that glib can't find it. Work around the bug by invoking
4599 waitpid only on subprocesses that Emacs itself creates.
4600 * process.c (create_process, record_child_status_change):
4601 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
4602 know the pid rather than having the callee infer it.
4603 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
4604 (create_process): Set new 'alive' member if child is created.
4605 (process_status_retrieved): New function.
4606 (record_child_status_change): Use it.
4607 Accept negative 1st argument, which means to wait for the
4608 processes that Emacs already knows about. Move special-case code
4609 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
4610 processes that have already been waited for, by testing and
4611 clearing new 'alive' member.
4612 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
4613 now does this internally.
4614 (handle_child_signal): Let record_child_status_change do all
4615 the work, since we do not want to reap all exited child processes,
4616 only the child processes that Emacs itself created.
4617 * process.h (Lisp_Process): New boolean member 'alive'.
4618
0d879dca
PE
4619 Omit duplicate definitions no longer needed with gcc -g3.
4620 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
4621 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
4622 Define only as macros. There's no longer any need to also define
4623 these symbols as enums or as constants, since we now assume
4624 gcc -g3 when debugging.
4625
3478f4b5
EZ
46262012-11-03 Eli Zaretskii <eliz@gnu.org>
4627
4628 * lisp.mk: Adjust comments to the fact that term/internal is now
4629 loaded from loadup.el.
4630
4631 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
4632 (msdos_fatal_signal): New function.
4633 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
4634 its argument list.
4635
4636 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
4637 for GCC versions before 4.
4638 (emacs_raise): Define to call msdos_fatal_signal.
4639
4640 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
4641 iterator when starting in the middle of a display or overlay
4642 string. (Bug#12745)
4643
85fabcb7
CY
46442012-11-03 Chong Yidong <cyd@gnu.org>
4645
4646 * process.c (wait_reading_process_output): Clean up the last
4647 change.
4648
893cc455
CY
46492012-11-03 Jim Paris <jim@jtan.com> (tiny change)
4650
4651 * process.c (wait_reading_process_output): Avoid a race condition
4652 with SIGIO delivery (Bug#11536).
4653
0f7b074f
CY
46542012-11-03 Chong Yidong <cyd@gnu.org>
4655
4656 * buffer.c (cursor_type): Untabify docstring.
4657
3737fee7
DA
46582012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4659
4660 * frame.h (struct frame): Drop can_have_scroll_bars member
4661 which is meaningless for a long time. Adjust comments.
4662 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
4663 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
4664
b6a9e8b1
DA
46652012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
4666
4667 * window.c (decode_next_window_args): Update window arg after
4668 calling decode_live_window and so fix crash reported at
4669 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
4670 by Juanma Barranquero <lekktu@gmail.com>.
4671 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
4672 * font.c (Ffont_at): Likewise.
4673
600d4768
JD
46742012-11-01 Jan Djärv <jan.h.d@swipnet.se>
4675
4676 * widget.c (resize_cb): New function.
4677 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
4678 (EmacsFrameResize): Check if all is up to date before changing frame
4679 size.
4680
1005b4b9
EZ
46812012-11-02 Eli Zaretskii <eliz@gnu.org>
4682
4683 Implement backtrace output for fatal errors on MS-Windows.
4684 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
4685 (BACKTRACE_LIMIT_MAX): New macro.
4686 (w32_backtrace): New function.
4687 (emacs_abort): Use w32_backtrace when the user chooses not to
4688 attach a debugger. Update the text of the abort dialog.
4689
b9e9df47
DA
46902012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4691
4692 Window-related stuff cleanup here and there.
4693 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
4694 Use decode_any_window.
4695 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
4696 * xdisp.c (Fformat_mode_line): Likewise.
4697 * font.c (Ffont_at): Use decode_live_window.
4698 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
4699 * window.c (decode_next_window_args): Likewise.
4700 (decode_any_window): Remove static.
4701 * window.h (decode_any_window): Add prototype.
4702 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
4703 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
4704 respectively.
4705
2b371ff7
DA
47062012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
4707
4708 Remove pad from struct input_event.
4709 * termhooks.h (struct input_event): Remove padding field.
4710 Adjust comment.
4711 * keyboard.c (event_to_kboard): Simplify because frame_or_window
4712 member is never cons for a long time. Adjust comment.
4713 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
4714 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
4715 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
4716 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
4717
7e8b50d9
EZ
47182012-11-01 Eli Zaretskii <eliz@gnu.org>
4719
4720 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
4721
322aea6d
PE
47222012-10-31 Paul Eggert <eggert@cs.ucla.edu>
4723
4724 Fix crash when using Emacs as commit editor for git (Bug#12697).
4725 * callproc.c (setpgrp): Remove macro, as we now use setpgid
4726 and it is configured in conf_post.h.
4727 (Fcall_process): Don't invoke both setsid and setpgid; the former
4728 is enough, if it exists.
4729 * callproc.c (Fcall_process, child_setup):
4730 * process.c (create_process): Use setpgid.
4731 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
4732 for the real thing.
4733 * dispnew.c (init_display): Initialize the foreground group
4734 if we are running a tty display.
4735 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
4736 * lisp.h (init_foreground_group): New decl.
4737 * sysdep.c (inherited_pgroup): New static var.
4738 (init_foreground_group, tcsetpgrp_without_stopping)
4739 (narrow_foreground_group, widen_foreground_group): New functions.
4740 (init_sys_modes): Narrow foreground group.
4741 (reset_sys_modes): Widen foreground group.
4742
220cb2bd
MA
47432012-10-31 Michael Albinus <michael.albinus@gmx.de>
4744
4745 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
4746
218e997a
MR
47472012-10-31 Martin Rudalics <rudalics@gmx.at>
4748
4749 * minibuf.c (read_minibuf): Restore current buffer since
4750 choose_minibuf_frame calling Fset_frame_selected_window may
4751 change it (Bug#12766).
4752
02615da0
JD
47532012-10-30 Jan Djärv <jan.h.d@swipnet.se>
4754
4755 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
4756
aee5b18e
KH
47572012-10-30 Kenichi Handa <handa@gnu.org>
4758
4759 * font.c (Ffont_at): If WINDOW is specified and it is not
4760 displaying the current buffer, signal an error.
4761
ba116008
DC
47622012-10-29 Daniel Colascione <dancol@dancol.org>
4763
de5ef41a
SM
4764 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
4765 In preparation for fixing bug#12739, move these functions from
ba116008
DC
4766 here...
4767
4768 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
4769 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
4770 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 4771
640bf8ad
EZ
47722012-10-28 Eli Zaretskii <eliz@gnu.org>
4773
4774 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
4775 (timer_loop, getitimer, setitimer): Use it instead of
4776 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
4777 'clock'.
4778 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
4779 literal 10000.
4780
64ccff5f
JD
47812012-10-28 Jan Djärv <jan.h.d@swipnet.se>
4782
4783 * nsterm.m (NO_APPDEFINED_DATA): New define.
4784 (last_appdefined_event_data): New variable
4785 (last_appdefined_event): Remove.
4786 (ns_select): Initialize t from last_appdefined_event_data instead
4787 of [last_appdefined_event data1].
4788 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
4789 remove last_appdefined_event (Bug#12698).
4790
e483264c
SM
47912012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4792
4793 * frame.c (x_set_font): Catch internal error.
4794
6c16c13e
EZ
47952012-10-27 Eli Zaretskii <eliz@gnu.org>
4796
e483264c
SM
4797 Avoid overflow in w32 implementation of interval timers.
4798 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
4799 actually executes.
4800 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
4801 'volatile ULONGLONG' types. All the other data which was
4802 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
4803 (GetThreadTimes_Proc): New typedef.
4804 (w32_get_timer_time): New function, returns a suitable time value
4805 for the timer.
4806 (timer_loop): Enter critical section when accessing ULONGLONG
4807 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
4808 atomic. Call 'w32_get_timer_time' instead of 'clock'.
4809 Remove unused variable.
6c16c13e
EZ
4810 (init_timers): Initialize s_pfn_Get_Thread_Times.
4811 (start_timer_thread): Don't assign itimer->caller_thread here.
4812 (getitimer): Assign itimer->caller_thread here.
4813 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 4814 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 4815
ccc83f50
EZ
48162012-10-26 Eli Zaretskii <eliz@gnu.org>
4817
4818 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
4819 mouse movement events if the menu bar is active. This avoids
4820 producing a busy "hour-glass" cursor by Windows if the mouse
4821 pointer is positioned over a tooltip shown for some menu item.
4822
69deda53
PE
48232012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4824
4825 Don't assume process IDs fit in int.
4826 * emacs.c (shut_down_emacs) [!DOS_NT]:
4827 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4828 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4829 Use pid_t, not int, to store process IDs, as 'int'
4830 is not wide enough on a few platforms (e.g., AIX and IRIX).
4831
7e70a152
KH
48322012-10-23 Kenichi Handa <handa@gnu.org>
4833
4834 The following change is to make face-font-rescale-alist work
4835 correctly for non-ASCII fonts.
4836
4837 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4838 (font_open_for_lface): Handle Vface_font_rescale_alist.
4839
49238e7f
CY
48402012-10-23 Chong Yidong <cyd@gnu.org>
4841
4842 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4843
5ec86886
JD
48442012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4845
ef446959
JD
4846 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4847 for screen font.
4848 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4849
5ec86886
JD
4850 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4851 event (Bug#12681).
4852
ee7a418d
GM
48532012-10-21 Glenn Morris <rgm@gnu.org>
4854
4855 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4856
4973679b
PE
48572012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4858
4859 Port to OpenBSD 5.1.
4860 * frame.c (Fmouse_position, Fmouse_pixel_position):
4861 * xdisp.c (produce_stretch_glyph):
4862 Declare local vars only when they're needed.
4863 This is clearer and avoids a warning on OpenBSD about unused vars.
4864 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4865 This is safer, and avoids OpenBSD warnings about unused vars.
4866 * keyboard.c (record_menu_key): Remove unnecessary decl.
4867 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4868 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4869 as our definition clashes with OpenBSD's.
4870 * xfaces.c (load_face_colors, check_lface_attrs)
4871 (get_lface_attributes_no_remap, get_lface_attributes)
4872 (lface_fully_specified_p, x_supports_face_attributes_p)
4873 (tty_supports_face_attributes_p, face_fontset, realize_face)
4874 (realize_x_face, realize_tty_face):
4875 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4876 merely Lisp_Object *. This is more informative and avoids
4877 a warning on OpenBSD about accessing beyond an object's size.
4878
c664f463
CY
48792012-10-20 Chong Yidong <cyd@gnu.org>
4880
4881 * lread.c (Fload): Doc fix (Bug#12592).
4882
6ec83f92 48832012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
4884
4885 * font.c (Ffont_at): Fix previous change.
4886
d2824928
EZ
48872012-10-19 Eli Zaretskii <eliz@gnu.org>
4888
e483264c
SM
4889 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4890 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
4891 for the reasons.
4892
d2824928
EZ
4893 * alloc.c (NSTATICS): Decrease to 0x800.
4894
f60d391f
SM
48952012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4896
4a0e1924 4897 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
4898 error (bug#12677).
4899
1a9327d5
JD
49002012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4901
4902 * nsterm.m (ns_select): Check writefds before call to
4903 FD_ISSET (Bug#12668).
4904
14145a1e
DC
49052012-10-18 Daniel Colascione <dancol@dancol.org>
4906
4907 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4908 (staticpro): If we run out of staticpro slots, die with an
4909 informative error instead of just calling emacs_abort.
4910
1f76f6f5
MR
49112012-10-18 Martin Rudalics <rudalics@gmx.at>
4912
4913 Fix two flaws reported by Dmitry Antipov.
4914 * window.c (Ftemp_output_buffer_show): Remove.
4915 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4916 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4917
fcf14875
EZ
49182012-10-17 Eli Zaretskii <eliz@gnu.org>
4919
1f76f6f5
MR
4920 * makefile.w32-in ($(BLD)/w32.$(O)):
4921 ($(BLD)/vm-limit.$(O)):
4922 ($(BLD)/term.$(O)):
4923 ($(BLD)/unexw32.$(O)):
4924 ($(BLD)/fileio.$(O)):
a68089e4
EZ
4925 ($(BLD)/dispnew.$(O)): Update dependencies.
4926
4927 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4928 Add prototypes.
4929
4930 * w32proc.c: Include ctype.h.
4931
4932 * w32.h (init_environment, check_windows_init_file)
4933 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4934 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4935 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4936 (sys_link): Add prototypes.
4937
4938 * w32.c: Include w32select.h.
4939 (sys_access, e_malloc, sys_select): Add prototypes.
4940 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4941
4942 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4943
4944 * unexw32.c: Include lisp.h and w32.h.
4945
4946 * term.c [WINDOWSNT]: Include w32term.h.
4947
4948 * process.c [WINDOWSNT]: Add prototype of sys_select.
4949
4950 * fileio.c [WINDOWSNT]: Include w32.h.
4951
4952 * dispnew.c [WINDOWSNT]: Include w32.h.
4953
fcf14875
EZ
4954 * cygw32.c (Fcygwin_convert_path_to_windows)
4955 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4956 Lisp_Object values. (Bug#12661)
4957
4958 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4959 to Lisp_Object. (Bug#12661)
4960
fe0b1ec4
KH
49612012-10-17 Kenichi Handa <handa@gnu.org>
4962
4963 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4964 invalidate.
4965
d556ebf9
DA
49662012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4967
4968 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 4969 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 4970
f0863a54
DA
49712012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4972
4973 Do not verify indirection counters of killed buffers (Bug#12579).
4974 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4975 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4976
12fbe755
DA
49772012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4978
4979 * alloc.c (Fmake_byte_code): Fix typo in comment.
4980 * print.c (print_interval): Define as static to match prototype.
4981 * indent.c (disptab_matches_widthtab, recompute_width_table):
4982 Convert to eassert.
4983
61655b89
DA
49842012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4985
4986 * editfns.c (get_system_name): Remove.
4987 * lisp.h (get_system_name): Remove prototype.
4988 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4989 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4990
9520f2f2
DC
49912012-10-15 Daniel Colascione <dancol@dancol.org>
4992
4993 * dbusbind.c: Add comment explaining reason for previous change.
4994
dca778d5
MR
49952012-10-15 Martin Rudalics <rudalics@gmx.at>
4996
4997 * window.c (Fwindow_end): Rewrite check whether cached position
4998 can be used (Bug#12600).
4999 (resize_frame_windows, grow_mini_window, shrink_mini_window):
5000 Set windows_or_buffers_changed.
5001
3e0341b0
DC
50022012-10-15 Daniel Colascione <dancol@dancol.org>
5003
5004 * dbusbind.c: Fix cygw32 build break when compiling with dbus
5005 enabled by undefining the symbol "interface", which the platform
5006 headers define to something incompatible.
5007
33d4113c
DC
50082012-10-14 Daniel Colascione <dancol@dancol.org>
5009
5010 * image.c (init_tiff_functions, init_imagemagick_functions)
5011 (init_svg_functions): Fix cygw32 build break by using these
5012 functions only when WINDOWSNT _and_ HAVE_NTGUI.
5013
a36fb15e
JD
50142012-10-14 Jan Djärv <jan.h.d@swipnet.se>
5015
5016 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
5017
537f336d
JD
50182012-10-13 Jan Djärv <jan.h.d@swipnet.se>
5019
5020 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
5021
0ba06a77
KH
50222012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
5023
5024 * coding.c (detect_coding): Set coding->id before calling
5025 this->detector.
5026
ce2fe65a
AS
50272012-10-13 Andreas Schwab <schwab@linux-m68k.org>
5028
5029 * fileio.c: Formatting fixes.
5030
d6453ce4
PE
50312012-10-13 Paul Eggert <eggert@cs.ucla.edu>
5032
5033 Fix some stat-related races.
5034 * fileio.c (Fwrite_region): Avoid race condition if a file is
5035 removed or renamed by some other process immediately after Emacs
5036 writes it but before Emacs stats it. Do not assume that stat (or
5037 fstat) succeeds.
5038 * image.c (slurp_file): Resolve the file name with fopen + fstat
5039 rather than stat + fopen.
5040 (pbm_read_file) [0]: Remove unused code with stat race.
5041 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
5042 Remove ineffective code with stat race.
5043
06485aa8
SM
50442012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
5045
5046 * doc.c (get_doc_string): Don't signal an error if the file is missing.
5047
167e3640
JD
50482012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5049
5050 * nsterm.m (hold_event_q): New static variable.
5051 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
5052 ! q_event_ptr.
5053 (hold_event): New function.
5054 (ns_read_socket): If hold_event_q have events, store them and
5055 return (Bug#12384).
5056 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
5057 is zero (Bug#12384).
5058
c40239df
JB
50592012-10-12 Juanma Barranquero <lekktu@gmail.com>
5060
5061 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
5062
bb385a92
EZ
50632012-10-12 Eli Zaretskii <eliz@gnu.org>
5064
2a9f1099
EZ
5065 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
5066
bb385a92
EZ
5067 * fileio.c (check_existing): New function.
5068 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
5069 instead of calling 'stat', when what's needed is to check whether
5070 a file exists. This avoids expensive system calls on MS-Windows.
5071 (Bug#12587)
5072
8599b23a 5073 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
5074
5075 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
5076 determine whether a file exists and is not a directory.
5077
5078 * lisp.h (check_existing): Add prototype.
5079
2b9c2e68
JD
50802012-10-12 Jan Djärv <jan.h.d@swipnet.se>
5081
5082 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
5083
81749a23
GM
50842012-10-12 Glenn Morris <rgm@gnu.org>
5085
5086 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
5087
5253a5fd
SM
50882012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
5089
389a94a5
SM
5090 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
5091
5253a5fd
SM
5092 * eval.c (Fautoload): Remember previous autoload status in load-history.
5093
7cded46f
PE
50942012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5095
5096 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
5097 * lread.c (load_each_byte, new_backquote_flag, readchar)
5098 (read_filtered_event, lisp_file_lexically_bound_p)
5099 (safe_to_load_version, Fload, complete_filename_p, openp)
5100 (build_load_history, readevalloop, read_escape, read1)
5101 (string_to_number, read_vector, read_list):
5102 * macros.c (Fstart_kbd_macro):
5103 * marker.c (CONSIDER):
5104 * menu.c (parse_single_submenu, digest_single_submenu)
5105 (find_and_return_menu_selection, Fx_popup_menu):
5106 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
5107 (Ftry_completion):
5108 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
5109 (ns_menu_show):
5110 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
5111 (xmenu_show, xdialog_show):
5112 Use bool for booleans.
5113 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
5114 as it's not a predicate. All uses changed. Omit unnecessary
5115 buffer termination.
5116
549c3414
DA
51172012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
5118
5119 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
5120 (save_excursion_restore): Do not restore mark if it was not saved.
5121
e85aafe7
PE
51222012-10-11 Paul Eggert <eggert@cs.ucla.edu>
5123
fd2f90cf
PE
5124 * marker.c (cached_modiff): EMACS_INT, not int.
5125
c1af190b
PE
5126 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
5127 instead of having a wrong decl.
e85aafe7
PE
5128 * nsmenu.m (waiting_for_input): Remove wrong decl.
5129
e738ca56
PE
51302012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5131
9fa1de30
PE
5132 keyboard.c, keymap.c: Use bool for booleans.
5133 * dispnew.c (sit_for): Distinguish between 3-way display_option
5134 and boolean do_display.
5135 * keyboard.c (single_kboard, this_command_key_count_reset)
5136 (waiting_for_input, echoing, immediate_quit, input_pending)
5137 (interrupt_input, interrupts_deferred, pop_kboard)
5138 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
5139 (command_loop_1, adjust_point_for_property)
5140 (safe_run_hooks_error, input_polling_used, read_char):
5141 (help_char_p, readable_events, kbd_buffer_events_waiting)
5142 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
5143 (lucid_event_type_list_p, get_input_pending):
5144 (gobble_input, menu_separator_name_p, menu_bar_item)
5145 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
5146 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
5147 (keyremap_step, test_undefined, read_key_sequence)
5148 (detect_input_pending, detect_input_pending_ignore_squeezables)
5149 (detect_input_pending_run_timers, requeued_events_pending_p)
5150 (quit_throw_to_read_char, Fset_input_interrupt_mode):
5151 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
5152 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
5153 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
5154 (accessible_keymaps_1, Fkey_description, push_key_description):
5155 (shadow_lookup, struct where_is_internal_data)
5156 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
5157 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
5158 (describe_map, describe_vector):
5159 * menu.c (single_menu_item):
5160 * nsmenu.m (ns_update_menubar):
5161 * process.c (wait_reading_process_output):
5162 * search.c (scan_buffer, scan_newline):
5163 Use bool for boolean.
5164 * keyboard.c (timers_run, swallow_events)
5165 (detect_input_pending_run_timers):
5166 * process.c (wait_reading_process_output):
5167 Use unsigned for counter where wraparound-on-overflow is desired,
5168 since unsigned is guaranteed to have that behavior and signed is not.
5169 (read_char): Use ptrdiff_t for string length.
5170 (get_input_pending): Remove first argument, since it was always
5171 the same pointer-to-int (now pointer-to-boolean) &input_pending,
5172 and behave as if it had that value. Return new value of
5173 input_pending. All callers changed.
5174 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
5175 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
5176 a string length.
5177 * keymap.c (push_key_description): Omit last arg, which was always 1.
5178 All callers changed.
5179
e738ca56
PE
5180 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
5181
29f21cdf
JB
51822012-10-10 Juanma Barranquero <lekktu@gmail.com>
5183
5184 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
5185 ($(BLD)/term.$(O)): Update dependencies.
5186
6aea7528
DA
51872012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5188
5189 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
5190 * lisp.h (enum pvec_type): Adjust comments and omit explicit
5191 initializer for PVEC_NORMAL_VECTOR.
5192
5f3f57be
PE
51932012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5194
5195 Clean out old termopts cruft.
5196 * termopts.h (flow_control, meta_key): Remove unused decls.
5197 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
5198 Don't include termopts.h.
5199
3e98c68e
DA
52002012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
5201
5202 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
5203
77e344e5
PE
52042012-10-10 Paul Eggert <eggert@cs.ucla.edu>
5205
5206 * commands.h (immediate_quit): Remove duplicate decl.
5207
5683d7cd
JD
52082012-10-09 Jan Djärv <jan.h.d@swipnet.se>
5209
5210 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
5211 caching.
5212 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 5213 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 5214
cf5fc6db
EZ
52152012-10-09 Eli Zaretskii <eliz@gnu.org>
5216
b15736e6
EZ
5217 * w32fns.c (w32_last_error): Change the return value to DWORD, to
5218 match what GetLastError returns. Explain why the function is
5219 needed.
5220
cf5fc6db
EZ
5221 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
5222 'is_tooltip_frame', to avoid confusion with its global namesake.
5223
f99714ce
DC
52242012-10-08 Daniel Colascione <dancol@dancol.org>
5225
5226 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
5227 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
5228 build that caused Emacs to display the hourglass cursor forever.
f99714ce 5229
fd59cb29
GM
5230 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
5231 which is broken under remote desktop, calculate the number of
5232 colors available for a display based on the display's number of
5233 planes and number of bits per pixel per plane. (bug#10397).
5234
62c480c9 52352012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 5236
62c480c9
JD
5237 * nsfont.m (Vfonts_in_cache): New variable.
5238 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
5239 are used. Add cached fonts to Vfonts_in_cache.
5240 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
5241
607446ba
JB
52422012-10-08 Juanma Barranquero <lekktu@gmail.com>
5243
fd5125ad
JB
5244 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
5245 in nt/config.nt.
46979e0b
JB
5246 (FONT_H): Define after FRAME_H.
5247 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
5248 Update dependencies.
fd5125ad 5249
607446ba
JB
5250 * w32term.c: Remove leftover declaration of keyboard_codepage.
5251
b6f4e300
EZ
52522012-10-08 Eli Zaretskii <eliz@gnu.org>
5253
c54ebba4
EZ
5254 * makefile.w32-in (FONT_H): Add $(FRAME_H).
5255 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
5256 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
5257 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
5258 ($(BLD)/unexw32.$(O)):
5259 ($(BLD)/w32.$(O)):
5260 ($(BLD)/w32console.$(O)):
5261 ($(BLD)/w32fns.$(O)):
5262 ($(BLD)/w32heap.$(O)):
5263 ($(BLD)/w32menu.$(O)):
15c720a3 5264 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 5265
b6f4e300
EZ
5266 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
5267 'const char *'.
5268 (x_to_w32_color): Don't modify the argument, modify a copy instead.
5269
501199a3
DC
52702012-10-08 Daniel Colascione <dancol@dancol.org>
5271
5272 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
5273 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
5274 accidental message numbering hole. Change other messages to
5275 match.
5276
5277 * w32select.h (HAVE_W32SELECT): Remove.
5278
5279 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 5280 w32common.h instead of w32heap.h.
501199a3
DC
5281
5282 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
5283 (get_allocation_unit, get_processor_type, get_w32_major_version)
5284 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5285 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5286 (OS_NT, os_subtype, cache_system_info): Move declarations to
5287 w32common.
5288
5289 * w32heap.c: Include w32common.h.
5290 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
5291 (w32_minor_version, w32_build_number, w32_subtype):
5292 Remove duplicate definitions.
501199a3
DC
5293
5294 * w32fns.c: Include w32common.h; include w32heap.h only in
5295 WINDOWSNT.
5296
5297 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
5298 Use `report_file_error' instead of `error' in order to better
5299 inform users of what went wrong. Increase NTGUI_UNICODE file
5300 dialog box file name length to 32k, the maximum allowed by the NT
5301 kernel.
5302
5303 * w32common.h: New file.
5304 (ROUND_UP, ROUND_DOWN, get_page_size)
5305 (get_allocation_unit, get_processor_type, get_w32_major_version)
5306 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
5307 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
5308 (OS_NT, os_subtype, cache_system_info): Move here.
5309
5310 * unexw32.c, unexcw.c: Include w32common.h.
5311
5312 * emacs.c (main): Use (defined (WINDOWSNT) || defined
5313 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
5314 to call syms_of_w32select.
5315
5316 * cygw32.h: Remove obsolete EXFUN declarations.
5317
5318 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
5319
5320 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
5321 of w32inevt.o from SOME_MACHINE_OBJECTS.
5322
93aa5c81
DC
53232012-10-08 Daniel Colascione <dancol@dancol.org>
5324
5325 * image.c: Permanent fix for JPEG compilation issue --- limit
5326 jpeglib `boolean' redefinition to Cygwin builds.
5327
d424f3d8
EZ
53282012-10-08 Eli Zaretskii <eliz@gnu.org>
5329
8ee4c6ce
EZ
5330 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
5331
d424f3d8
EZ
5332 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
5333 Cygwin.
5334
e08348a0
DC
53352012-10-08 Daniel Colascione <dancol@dancol.org>
5336
5337 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
5338 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
5339 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
5340 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
5341 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
5342 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
5343 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
5344 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
5345 now a supported configuration.
5346
5347 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 5348 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
5349
5350 * conf_post.h:
5351 (_DebPrint) declare tracing facility for W32 debugging. We need
5352 to unify tracing later.
5353
5354 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
5355 unconditional use of W32 Unicode functions. Cygwin runs only on
5356 100% Unicode operating systems.
5357
5358 * cygw32.c: New file. Define Cygwin-specific facilities.
5359 (Fcygwin_convert_path_to_windows)
5360 (Fcygwin_convert_path_from_windows): New user functions for
5361 accessing Cygwin path-munging routines.
5362
5363 * cygw32.h: New file.
5364 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
5365 UTF-16LE strings temporarily inside non-Lisp-visible string
5366 objects.
5367
5368 (w32_strerror): Just what it says on the tin.
5369
5370 * emacs.c: Make the NS fork-then-exec code for daemon-launching
5371 also run for Cygwin; both systems have the same problem with using
5372 GUI facilities in a forked child. Also call syms_of_cygw32,
5373 syms_of_w32select in correct places.
5374
5375 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
5376 needs fork-then-exec for daemon launching.
5377
5378 * font.h: Include frame.h.
5379
5380 * image.c: Use the image library cache machinery only when we're
5381 compiling for native WINDOWSNT; Cygwin can use shared libraries
5382 like any other Unixlike system.
5383
5384 * keyboard.c: Clarify a comment regarding the input loop.
5385
5386 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
5387 functions directly instead of trying to detect at runtime that our
5388 host operating system supports them. We make this change for two
5389 reasons: Cygwin lacks support for the multibyte character
5390 conversion functions used by the legacy menu code, and Cygwin
5391 never needs to rely on non-Unicode APIs.
5392
5393 * unexw32.c (hinst): Declare extern.
5394
5395 * w32.c: Change header order;
5396 (w32_strerror): Move to w32fns.c because we need it for
5397 non-WINDOWSNT builds.
5398
5399 * w32.h: Add #error macro to make sure we don't include w32.h for
5400 Cygwin builds. Remove w32select declarations.
5401
5402 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 5403 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
5404
5405 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
5406 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
5407 POSIXy alternative.
5408 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
5409 (w32_major_version, w32_minor_version, w32_build_number)
5410 (os_subtype, sound_type): Define here
5411 (w32_defined_color): Make color parameter const for consistency
5412 with other _defined_color functions.
5413 (w32_createwindow): Unconditionally call w32_init_class instead of
5414 doing so only when hprevinst is non-NULL. Plumbing hprevinst
5415 through the code is complex and unnecessary because class
5416 registration is practically free.
5417 (w32_name_of_message): New EMACSDEBUG-only function.
5418 (Fset_message_beep): Move here
5419 (Fx_open_connection): Require that the display name for Windows be
5420 "w32" for consistency, emacsclient disambiguation, and maybe, one
5421 day, multi-window-system support.
5422 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
5423 Cygwin files for W32 GUI facilities, since these clearly don't
5424 expect Cygwin names.
5425 (_DebPrint): Define.
5426 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
5427 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
5428 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
5429 (w32_last_error): Remove.
5430
5431 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
5432
5433 * w32heap.c (syspage_mask): Declare here.
5434 (cache_system_info): Remove.
5435
5436 * w32inevt.c (faked_key): Define globally, not statically.
5437 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
5438 (w32_console_toggle_lock_key): Move to w32fns.c.
5439
5440 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
5441
5442 * w32proc.c (_DebPrint): Move to w32fns.c.
5443 * w32select.c: Include string.h, stdio.h for Cygwin.
5444 * w32select.h: New File.
5445
5446 * w32term.c: Include io.h for non-CYGWIN builds; needed for
5447 get_osfhandle.
5448 (w32_message_fd): New variable. Under Cygwin, holds the file
5449 descriptor the system used to tell us about pending thread
5450 messages.
5451
5452 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
5453 that prevented compilation under non-WINDOWSNT systems.
5454
5455 (w32_initialize): Open /dev/windows and assign it to
5456 w32_message_fd. Provide w32 feature.
5457
5458 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
5459 (WM_EMACS_INPUT_READY): add.
5460 (prepend_msg, w32_message_fd): Declare globally.
5461
5462 * w32xfns.c:
5463 (keyboard_handle): Use only when WINDOWSNT.
5464 (notify_msg_ready): New function. Posts a message to the main
5465 thread's message queue under CYGWIN, which wakes up the main
5466 thread from select(2) by making the /dev/windows file descriptor
5467 ready. Under WINDOWSNT, it sets an event the same way the old
5468 code did.
5469
5470 (post, prepend_msg): Actually call notify_msg_ready instead of
5471 setting the input event directly.
5472
98daa893
EZ
54732012-10-07 Eli Zaretskii <eliz@gnu.org>
5474
5475 * ralloc.c (relinquish): If a heap is ready to be relinquished,
5476 but it still has blocs in it, don't return it to the system,
5477 instead of aborting. (Bug#12402)
5478
3bc0a2f7
JD
54792012-10-07 Jan Djärv <jan.h.d@swipnet.se>
5480
8ad5b73b 5481 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 5482
335f5ae4
JD
5483 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
5484 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
5485 (syms_of_nsterm): Remove comment about Panther and above for
5486 ns-antialias-text.
335f5ae4
JD
5487 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
5488 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
5489 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
5490
5491 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
5492 MAC_OS_X_VERSION_10_4.
5493
8ad5b73b
JD
5494 * nsmenu.m (fillWithWidgetValue:): Remove code for <
5495 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
5496
5497 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
5498
5499 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
5500 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
5501
3bc0a2f7
JD
5502 * nsterm.m (ns_in_resize): Remove (Bug#12479).
5503 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
5504 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
5505 Remove ns_in_resize check.
3bc0a2f7
JD
5506 (ns_clear_frame_area): Remove resize handle code.
5507
5508 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
5509 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
5510 Remove ns_in_resize check.
3bc0a2f7 5511
c622b48f
PE
55122012-10-07 Paul Eggert <eggert@cs.ucla.edu>
5513
5514 Improve sys_siglist detection.
5515 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
5516 defined as a macro, as is done in Solaris.
5517 (sys_siglist_entries): New macro.
5518 (save_strsignal): Use it.
5519 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
5520 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
5521
04fafa46
JD
55222012-10-06 Jan Djärv <jan.h.d@swipnet.se>
5523
5524 * nsfns.m (Fx_create_frame): Call x_default_parameter with
5525 fullscreen/Fullscreen.
5526
5527 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
5528 tobar_height is new.
5529
5530 * nsterm.m (x_make_frame_visible): Check for fullscreen.
5531 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
5532 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
5533 (windowDidResize:): Check for correct window if old style fullscreen.
5534 Capitalize word in comment. Remove incorrect comment.
5535 (initFrameFromEmacs:): tbar_height renamed tibar_height.
5536 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
5537 error in drawing background.
1f9f395d 5538 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
5539 Set toolbar values to zero, save old height in tobar_height.
5540 Restore tool bar height when leaving fullscreen.
5541 (canBecomeMainWindow): New function.
5542
c6e21c03
PE
55432012-10-06 Paul Eggert <eggert@cs.ucla.edu>
5544
5545 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
5546
0d9f584b
EZ
55472012-10-05 Eli Zaretskii <eliz@gnu.org>
5548
a65fbb5f
EZ
5549 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
5550
0d9f584b 5551 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
5552 that time stamps of directories could also be changed.
5553 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
5554 FILE_WRITE_ATTRIBUTES access rights.
5555
5556 * fileio.c (Fset_file_times): Special-case ignoring errors for
5557 directories only on MSDOS, not on MS-Windows.
5558
e8757f09 55592012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
5560
5561 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
5562
7604f298
EZ
55632012-10-04 Eli Zaretskii <eliz@gnu.org>
5564
5565 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
5566 see whether CreateFile failed.
5567
88d69b7d
PE
55682012-10-04 Paul Eggert <eggert@cs.ucla.edu>
5569
5570 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
5571 to avoid similar races.
5572 * keyboard.c (pending_signals): Now bool, not int.
5573
7509f454
PE
5574 Port timers to OpenBSD, plus check for timer failures.
5575 OpenBSD problem reported by Han Boetes.
5576 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
5577 and/or setitimer.
5578 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
5579 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
5580 like OpenBSD, which has timer_settime but does not declare it.
5581 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
5582 whether to use itimerspec-related primitives. All uses of
5583 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
5584
a3c5c0c5
PE
55852012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5586
5587 * profiler.c (handle_profiler_signal): Fix a malloc race
5588 that caused Emacs to hang on Fedora 17 when profiling Lisp.
5589
914e743b
JD
55902012-10-02 Jan Djärv <jan.h.d@swipnet.se>
5591
5592 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
5593
d8ab37a8
EZ
55942012-10-02 Eli Zaretskii <eliz@gnu.org>
5595
5596 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
5597 consistent with the change in return value of 'safe_strsignal'.
5598
b3ecad33
PE
55992012-10-02 Paul Eggert <eggert@cs.ucla.edu>
5600
0a99eee1
PE
5601 Prefer plain 'static' to 'static inline' (Bug#12541).
5602 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
5603 (bidi_set_sor_type, bidi_push_embedding_level)
5604 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
5605 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
5606 (bidi_cache_search, bidi_cache_ensure_space)
5607 (bidi_cache_iterator_state, bidi_cache_find)
5608 (bidi_peek_at_next_level, bidi_set_paragraph_end)
5609 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5610 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
5611 Now 'static', not 'static inline'.
5612
b3ecad33
PE
5613 Count overruns when profiling; change units to ns.
5614 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
5615 Give extra weight to samples after overruns, to attempt to count
5616 the time more accurately.
5617 (setup_cpu_timer): Change sampling interval units from ms to ns, since
5618 the underlying primitives nominally do ns.
5619 (Fprofiler_cpu_start): Document the change. Mention that
5620 the sampling intervals are only approximate.
5621
090cf9db
SM
56222012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
5623
5624 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
5625
5626 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
5627 case for the special 0 coding-system.
5628
5629 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
5630 (Fmake_overlay): Remove redundant tests.
64edc777 5631 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 5632
81550bf4
JB
56332012-10-02 Juanma Barranquero <lekktu@gmail.com>
5634
5635 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
5636 Update dependencies.
5637
aa1ba90e
PE
56382012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5639
5640 Fix a malloc race condition involving strsignal.
5641 A signal can arrive in the middle of a malloc, and Emacs's signal
5642 handler can invoke strsignal, which can invoke malloc, which is
5643 not portable. This race condition bug makes Emacs hang on GNU/Linux.
5644 Fix it by altering the signal handler so that it does not invoke
5645 strsignal.
5646 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
5647 * process.c (status_message): Use const pointer, in case strsignal
5648 is #defined to safe_strsignal.
5649 * sysdep.c (sys_siglist, init_signals): Always define and
5650 initialize a substitute sys_siglist if the system does not define
5651 one, even if HAVE_STRSIGNAL.
5652 (safe_strsignal): Rename from strsignal. Always define,
5653 using sys_siglist. Return a const pointer.
5654 * syssignal.h (safe_strsignal): New decl.
5655 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
5656
ace917bd
EZ
56572012-10-01 Eli Zaretskii <eliz@gnu.org>
5658
5659 * w32proc.c (timer_loop): Fix code that waits for timer
5660 expiration, to avoid high CPU usage.
5661
9eb71b9c
SM
56622012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
5663
5664 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
5665 (sweep_weak_table): Remove redundant prototypes.
5666
b3317662
FP
56672012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
5668
5669 * emacs.c: Move the inclusion of TERM_HEADER after including
5670 windows.h on WINDOWSNT. This avoids compilation problems with
5671 MSVC.
5672
f0e5f225
EZ
56732012-10-01 Eli Zaretskii <eliz@gnu.org>
5674
2d7d1608
EZ
5675 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
5676 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
5677 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
5678 as the previous version used 'void *'.
5679
5680 * ralloc.c (ROUNDUP): Fix last change.
5681 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
5682 'size_t'.
5683
f0e5f225
EZ
5684 * w32proc.c <disable_itimers>: New static flag.
5685 (init_timers): Initialize it to zero, after creating the critical
5686 sections used by the timer threads.
5687 (term_timers): Set to 1 before deleting the critical sections.
5688 (getitimer, setitimer): If disable_itimers is non-zero, return an
5689 error indication without doing anything. Reported by Fabrice
5690 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
5691 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
5692 return results.
5693 [!HAVE_SETITIMER]: Behave as the previous version that didn't
5694 support timers.
f0e5f225
EZ
5695
5696 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
5697 term_ntproc after all the other bookkeeping, to get timers working
5698 as long as possible.
5699
82ef37c1
PE
57002012-10-01 Paul Eggert <eggert@cs.ucla.edu>
5701
b3a4c387
PE
5702 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
5703 Suggested by Juri Linkov in
5704 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
5705
b0ab8123
PE
5706 Prefer plain 'static' to 'static inline' (Bug#12541).
5707 With static functions, modern compilers inline pretty well by
5708 themselves; advice from programmers often hurts as much as it helps.
5709 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
5710 this change shrinks the text size of the Emacs executable by 1.1%
5711 without affecting CPU significantly in my benchmark.
5712 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
5713 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
5714 (mark_maybe_object, mark_maybe_pointer, bounded_number):
5715 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
5716 (bset_auto_fill_function, bset_auto_save_file_format)
5717 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
5718 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
5719 (bset_cache_long_line_scans, bset_case_fold_search)
5720 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
5721 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
5722 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
5723 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
5724 (bset_header_line_format, bset_indicate_buffer_boundaries)
5725 (bset_indicate_empty_lines, bset_invisibility_spec)
5726 (bset_left_fringe_width, bset_major_mode, bset_mark)
5727 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
5728 (bset_name, bset_overwrite_mode, bset_pt_marker)
5729 (bset_right_fringe_width, bset_save_length)
5730 (bset_scroll_bar_width, bset_scroll_down_aggressively)
5731 (bset_scroll_up_aggressively, bset_selective_display)
5732 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
5733 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
5734 (set_buffer_overlays_after):
5735 * category.c (bset_category_table):
5736 * charset.c (read_hex):
5737 * coding.c (produce_composition, produce_charset)
5738 (handle_composition_annotation, handle_charset_annotation)
5739 (char_encodable_p):
5740 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
5741 (assign_row, set_frame_matrix_frame, make_current)
5742 (add_row_entry):
5743 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
5744 * fns.c (maybe_resize_hash_table):
5745 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
5746 * gmalloc.c (register_heapinfo):
5747 * image.c (lookup_image_type):
5748 * intervals.c (set_interval_object, set_interval_left)
5749 (set_interval_right, copy_interval_parent, rotate_right)
5750 (rotate_left, balance_possible_root_interval):
5751 * keyboard.c (kset_echo_string, kset_kbd_queue)
5752 (kset_keyboard_translate_table, kset_last_prefix_arg)
5753 (kset_last_repeatable_command, kset_local_function_key_map)
5754 (kset_overriding_terminal_local_map, kset_real_last_command)
5755 (kset_system_key_syms, clear_event, set_prop):
5756 * lread.c (digit_to_number):
5757 * marker.c (attach_marker, live_buffer, set_marker_internal):
5758 * nsterm.m (ns_compute_glyph_string_overhangs):
5759 * process.c (pset_buffer, pset_command)
5760 (pset_decode_coding_system, pset_decoding_buf)
5761 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
5762 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
5763 (pset_status, pset_tty_name, pset_type, pset_write_queue):
5764 * syntax.c (bset_syntax_table, dec_bytepos):
5765 * terminal.c (tset_param_alist):
5766 * textprop.c (interval_has_some_properties)
5767 (interval_has_some_properties_list):
5768 * window.c (wset_combination_limit, wset_dedicated)
5769 (wset_display_table, wset_hchild, wset_left_fringe_width)
5770 (wset_left_margin_cols, wset_new_normal, wset_new_total)
5771 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
5772 (wset_right_fringe_width, wset_right_margin_cols)
5773 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
5774 (wset_vertical_scroll_bar_type, wset_window_parameters):
5775 * xdisp.c (wset_base_line_number, wset_base_line_pos)
5776 (wset_column_number_displayed, wset_region_showing)
5777 (window_box_edges, run_window_scroll_functions)
5778 (append_glyph_string_lists, prepend_glyph_string_lists)
5779 (append_glyph_string, set_glyph_string_background_width)
5780 (append_glyph, append_composite_glyph)
5781 (take_vertical_position_into_account):
5782 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
5783 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
5784 (lface_hash, lface_same_font_attributes_p, lookup_face):
5785 * xml.c (libxml2_loaded_p):
5786 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
5787 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
5788 Now 'static', not 'static inline'.
5789
05584c31
PE
5790 * bidi.c: Tune.
5791 (bidi_copy_it): Do the whole copy with a single memcpy.
5792 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
5793
86ec63ba
PE
5794 Revert the FOLLOW-SYMLINKS change for file-attributes.
5795 Doing it right would require several changes to Tramp, and there's
5796 not enough time to get that tested before the freeze today.
5797 * dired.c (directory_files_internal, Ffile_attributes):
5798 Undo last change.
5799
82ef37c1
PE
5800 * frame.c (x_report_frame_params): Port better to wider ints.
5801 Do not assume that EMACS_UINT is the same width as uprintmax_t,
5802 or that pointers can be printed in 15 decimal digits.
5803 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
5804
62aba0d4
FP
58052012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
5806
5807 Support x64 build on MS-Windows.
5808 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
5809 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
5810 compatibility with x64.
5e4daaf3 5811 (x_get_focus_frame): Add prototype.
62aba0d4
FP
5812
5813 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
5814 defining an XRectangle structure.
5815
5816 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
5817 arithmetics for compatibility with x64.
5818
5819 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5820 compatibility with x64.
5821
5822 * w32heap.h: Adjust prototypes and declarations.
5823
5824 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5825 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5826 DWORD, long, and unsigned long, for compatibility with x64.
5827 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5828 (sbrk): Argument is now of type ptrdiff_t.
5829
5830 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5831 less than 0x0500.
5832 (w32_msg_pump): Use WPARAM type for 'result'.
5833
5834 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5835 architecture.
5836 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5837 compatibility with x64.
5838
5839 * vm-limit.c (lim_data): Now size_t.
5840 (check_memory_limits): Adjust prototypes of real_morecore and
5841 __morecore to receive argument of type ptrdiff_t. Use size_t for
5842 five_percent and data_size.
5843
5844 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5845 variables, for compatibility with x64.
5846 (rva_to_section, offset_to_section, relocate_offset)
5847 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5848 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5849 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5850 for compatibility with x64.
5851
5852 * sysdep.c (STDERR_FILENO): Define if not already defined.
5853
5854 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5855 (__morecore): Argument type is now ptrdiff_t.
5856 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5857 (relinquish): Use ptrdiff_t type for 'excess'.
5858 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5859
5860 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5861 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5862 instead of a literal number.
5863
5864 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5865 (min): Define only if not already defined.
5866
5867 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5868 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5869 hosts.
5870
5871 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5872 'bitmaps' is a pointer.
5873
5874 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5875
5876 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5877
e7a2937b
PE
58782012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5879
5880 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5881 * dired.c (directory_files_internal, Ffile_attributes):
5882 New arg follow_symlinks. All uses changed.
5883
b43d62ae
SM
58842012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5885
5886 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5887
c06c382a
EZ
58882012-09-30 Eli Zaretskii <eliz@gnu.org>
5889
5890 Support atimers and CPU profiler via profile.c on MS-Windows.
5891 * w32proc.c (sig_mask, crit_sig): New static variables.
5892 (sys_signal): Support SIGALRM and SIGPROF.
5893 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 5894 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
5895 sigfillset, and sigprocmask are no longer no-ops.
5896 (sigismember): New function.
5897 (struct itimer_data): New definition.
5898 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5899 (crit_prof): New static variables.
5900 (MAX_SINGLE_SLEEP): New definition.
5901 (timer_loop, stop_timer_thread, term_timers, init_timers)
5902 (start_timer_thread, getitimer, setitimer): New functions.
5903 (alarm): No longer a no-op, calls setitimer.
5904
5905 * w32.c (term_ntproc): Call term_timers.
5906 (init_ntproc): Make sure all signals are unblocked at startup, to
5907 erase any traces of dumping. Call init_timers.
5908
5909 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5910 Windows-specific code to display the hourglass mouse pointer is no
5911 longer used.
5912 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5913 to hourglass timer expiration.
5914 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5915 Remove, no longer used.
b43d62ae
SM
5916 (w32_note_current_window, show_hourglass, hide_hourglass):
5917 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
5918 window systems.
5919 (syms_of_w32fns): Don't initialize hourglass_timer.
5920
5921 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5922 WINDOWSNT as well.
5923 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5924
5925 * w32.h (init_timers, term_timers): Add prototypes.
5926
95402d5f
KH
59272012-09-30 Kenichi Handa <handa@gnu.org>
5928
5929 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5930 to the buffer relocation which may be caused by ccl_driver.
5931
dd946752
JD
59322012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5933
d7e642cc
JD
5934 * xfns.c (Fx_file_dialog): Update comment.
5935
5936 * w32fns.c (Fx_file_dialog): Update comment.
5937
5938 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5939 Initialize panel name field if OSX >= 10.6.
5940
5941 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5942
dd946752
JD
5943 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5944
5945 * nsterm.m (NEW_STYLE_FS): New define.
5946 (ns_fullscreen_hook, windowWillEnterFullScreen)
5947 (windowDidEnterFullScreen, windowWillExitFullScreen)
5948 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5949 (setFSValue): New functions.
5950 (EmacsFSWindow): New implementation.
5951 (canBecomeKeyWindow): New function for EmacsFSWindow.
5952 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5953 (dealloc): Release nonfs_window if in fullscreen.
5954 (updateFrameSize:): Call windowDidMove to update top/left.
5955 (windowWillResize:toSize:): Check if frame is still maximized.
5956 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5957 next_maximized, maximized_width, maximized_height and nonfs_window.
5958 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5959 tbar_height.
5960 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 5961 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
5962
5963 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5964 (EmacsView): Add variables for fullscreen.
5965 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5966 (EmacsFSWindow): New interface for fullscreen.
5967
427730eb
JB
59682012-09-30 Juanma Barranquero <lekktu@gmail.com>
5969
5970 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5971
48de8b12
CY
59722012-09-30 Chong Yidong <cyd@gnu.org>
5973
5974 * fns.c (Frandom): Doc fix.
5975
5938d519
MR
59762012-09-30 Martin Rudalics <rudalics@gmx.at>
5977
5978 * window.c (Vwindow_combination_limit): New default value.
5979 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5980
cb5b0266
PE
59812012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5982
5983 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5984 Suggested by Eli Zaretskii in
5985 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5986
84f72efd
EZ
59872012-09-30 Eli Zaretskii <eliz@gnu.org>
5988
5989 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5990 HAVE_TIMER_SETTIME is defined.
5991
9d4dcdc9
PE
59922012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5993
d89460ed
PE
5994 Profiler improvements: more-accurate timers, overflow checks.
5995 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5996 signal.h, setjmp.h. Include systime.h instead.
5997 (saturated_add): New function.
5998 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5999 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
6000 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
6001 New static vars.
84f72efd 6002 (enum profiler_cpu_running): New enum.
d89460ed
PE
6003 (profiler_cpu_running): Now of that enum type, not bool.
6004 All uses changed to store the new value.
6005 (handle_profiler_signal): Rename from sigprof_handler_1,
6006 for consistency with other handlers. Do not check whether
6007 cpu_log is a hash-table if garbage collecting, since it
6008 doesn't matter in that case.
6009 (deliver_profiler_signal): Rename from sigprof_handler,
6010 for consistency with other handlers.
6011 (setup_cpu_timer): New function, with much of what used to be in
6012 Fprofiler_cpu_start. Check for out-of-range argument.
6013 Prefer timer_settime if available, and prefer
6014 thread cputime clocks, then process cputime clocks, then
6015 monotonic clocks, to the old realtime clock. Use make_timeval
6016 to round more-correctly when falling back to setitimer.
6017 (Fprofiler_cpu_start): Use it.
6018 (Fprofiler_cpu_stop): Prefer timer_settime if available.
6019 Don't assume that passing NULL as the 2nd argument of setitimer
6020 is the same as passing a pointer to all-zero storage.
6021 Ignore SIGPROF afterwards.
6022 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
6023 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
6024 non-fatal signal handlers. Ignore SIGPROF on startup.
6025 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
6026 in profiler.c, since sysdep.c now uses it.
6027
9d4dcdc9
PE
6028 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
6029 Suggested by Eli Zaretskii in
6030 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
6031
8e5691a0
JB
60322012-09-29 Juanma Barranquero <lekktu@gmail.com>
6033
6034 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6035
e7c1b6ef
SM
60362012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
6037
6038 * lisp.h (struct backtrace): Remove indirection for `function' field.
6039 * xdisp.c (redisplay_internal):
6040 * profiler.c (record_backtrace, sigprof_handler_1):
6041 * alloc.c (Fgarbage_collect):
6042 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
6043 (Fbacktrace_frame): Adjust accordingly.
6044
e61d39cd 60452012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
6046
6047 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
6048 (Frun_hook_with_args_until_failure): Doc fixes.
6049
404043ea
EZ
60502012-09-28 Eli Zaretskii <eliz@gnu.org>
6051
6052 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
6053 Qautomatic_redisplay and change the symbol name. All users changed.
6054
704d3f45
TM
60552012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
6056
6057 * profiler.c (sigprof_handler): Fix race condition.
6058
757140ff
GM
60592012-09-28 Glenn Morris <rgm@gnu.org>
6060
6061 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
6062
a615a3ae
PE
60632012-09-27 Paul Eggert <eggert@cs.ucla.edu>
6064
6065 Check more robustly for timer_settime.
89d17fd0
PE
6066 * Makefile.in (LIB_TIMER_TIME): New macro.
6067 (LIBES): Add it.
a615a3ae
PE
6068 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
6069 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
6070 call timer_settime.
6071
3670daf7
TM
60722012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
6073
6074 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
6075
6a586b7f
JB
60762012-09-26 Juanma Barranquero <lekktu@gmail.com>
6077
6078 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
6079
41c8bfcf
PE
60802012-09-26 Paul Eggert <eggert@cs.ucla.edu>
6081
6082 * character.h (MAYBE_UNIFY_CHAR): Remove.
6083 * charset.c, charset.h (maybe_unify_char): Now static.
6084 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
6085 Since this stuff is now private to charset.c, there's no need for
6086 a public macro and no need to inline by hand.
6087
3a880af4 60882012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
908589fd
AS
6089 Stefan Monnier <monnier@iro.umontreal.ca>
6090 Juanma Barranquero <lekktu@gmail.com>
611b7507 6091
3a880af4
SM
6092 * profiler.c: New file.
6093 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
6094 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
6095 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
6096 * emacs.c (main): Call syms_of_profiler.
6097 * alloc.c (Qautomatic_gc): New constant.
6098 (MALLOC_PROBE): New macro.
6099 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
6100 (total_bytes_of_live_objects): New function.
6101 (Fgarbage_collect): Use it. Record itself in backtrace_list.
6102 Call malloc_probe for the memory profiler.
6103 (syms_of_alloc): Define Qautomatic_gc.
6104 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
6105 race condition.
6106 (struct backtrace): Move definition...
6107 * lisp.h (struct backtrace): ..here.
6108 (Qautomatic_gc, profiler_memory_running): Declare vars.
6109 (malloc_probe, syms_of_profiler): Declare functions.
6110 * xdisp.c (Qautomatic_redisplay): New constant.
6111 (redisplay_internal): Record itself in backtrace_list.
6112 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 6113
5938d519 61142012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
61152012-09-25 Juanma Barranquero <lekktu@gmail.com>
6116
6117 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
6118
e26fd2e4
PE
61192012-09-25 Paul Eggert <eggert@cs.ucla.edu>
6120
6121 Prefer POSIX timers if available.
6122 They avoid a race if the timer is too close to the current time.
6123 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
6124 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 6125 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 6126
eedec3ee
EZ
61272012-09-25 Eli Zaretskii <eliz@gnu.org>
6128
6129 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
6130 CHAR_STRING_ADVANCE.
6131 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
6132 STRING_CHAR_ADVANCE.
6133
aa15c6bb
JB
61342012-09-25 Juanma Barranquero <lekktu@gmail.com>
6135
6136 Move Vlibrary_cache to emacs.c and reset before dumping.
6137
6138 * lisp.h (reset_image_types): Declare.
6139 [WINDOWSNT] (Vlibrary_cache): Declare.
6140
6141 * image.c (reset_image_types): New function.
6142
6143 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
6144 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
6145 (Fdump_emacs): Reset Vlibrary_cache and image_types.
6146
6147 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
6148 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
6149
6150 * w32.h (Vlibrary_cache): Do not declare.
6151
54d629be
EZ
61522012-09-25 Eli Zaretskii <eliz@gnu.org>
6153
16b22fef
EZ
6154 * w32proc.c (sys_signal): Handle all signals defined by the
6155 MS-Windows runtime, not just SIGCHLD. Actually install the signal
6156 handlers for signals supported by Windows. Don't override
6157 term_ntproc as the handler for SIGABRT.
6158 (sigaction): Rewrite to call sys_signal instead of duplicating its
6159 code.
6160 (sys_kill): Improve commentary.
6161
6162 * w32.c (term_ntproc): Accept (and ignore) one argument, for
6163 consistency with a signature of a signal handler. All callers
6164 changed.
6165 (init_ntproc): Accept an argument DUMPING. If dumping, don't
6166 install term_ntproc as a signal handler for SIGABRT, as that
6167 should be done by the dumped Emacs.
6168
6169 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
6170
6171 * w32select.c (term_w32select): Protect against repeated
6172 invocation by setting clipboard_owner to NULL after calling
6173 DestroyWindow.
6174
6175 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
6176 and term_ntproc to their modified signatures.
6177
54d629be
EZ
6178 * character.c (char_string, string_char): Remove calls to
6179 MAYBE_UNIFY_CHAR. See the discussion starting at
6180 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
6181 for the details.
6182
59f7af81
CY
61832012-09-25 Chong Yidong <cyd@gnu.org>
6184
6185 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
6186
22e8cf4a
SM
61872012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
6188
6189 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
6190 when encountering an unknown bytecode.
6191
578098f3
PE
61922012-09-24 Paul Eggert <eggert@cs.ucla.edu>
6193
6194 image.c, indent.c: Use bool for booleans.
6195 * dispextern.h (struct image_type): Members valid_p, load, init
6196 now return bool, not int. All uses changed.
6197 * image.c: Omit unnecessary static decls.
6198 (x_create_bitmap_mask, x_build_heuristic_mask):
6199 Return void, not int, since callers don't care about the return value.
6200 (x_create_bitmap_mask, define_image_type, valid_image_p)
6201 (struct image_keyword, parse_image_spec, image_spec_value)
6202 (check_image_size, image_background)
6203 (image_background_transparent, x_clear_image_1)
6204 (postprocess_image, lookup_image, x_check_image_size)
6205 (x_create_x_image_and_pixmap, xbm_image_p)
6206 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
6207 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
6208 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
6209 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
6210 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
6211 (png_image_p, init_png_functions, png_load_body, png_load)
6212 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
6213 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
6214 (init_gif_functions, gif_load, imagemagick_image_p)
6215 (imagemagick_load_image, imagemagick_load, svg_image_p)
6216 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
6217 (gs_load):
6218 * nsimage.m (ns_load_image):
6219 * nsterm.m (ns_defined_color):
6220 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
6221 * xfns.c (x_defined_color):
6222 * xterm.c (x_alloc_lighter_color_for_widget)
6223 (x_alloc_nearest_color_1, x_alloc_nearest_color)
6224 (x_alloc_lighter_color):
6225 * indent.c (disptab_matches_widthtab, current_column)
6226 (scan_for_column, string_display_width, indented_beyond_p)
6227 (compute_motion, vmotion, Fvertical_motion):
6228 Use bool for booleans.
6229
a5f2b6ec
CY
62302012-09-24 Chong Yidong <cyd@gnu.org>
6231
6232 * chartab.c (Fset_char_table_default): Obsolete function removed.
6233
18e27ea8
PE
62342012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6235
afea8a8a
PE
6236 Move pid_t related decls out of lisp.h.
6237 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
6238 (interruptible_wait_for_termination):
6239 Move these decls from lisp.h to syswait.h, since they use pid_t.
6240 Needed on FreeBSD; see Herbert J. Skuhra in
6241 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
6242 * callproc.c: Include syswait.h.
6243
18e27ea8
PE
6244 gnutls.c, gtkutil.c: Use bool for boolean.
6245 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
6246 (emacs_gnutls_handle_error):
6247 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
6248 (xg_hide_tooltip, xg_create_frame_widgets)
6249 (create_dialog, xg_uses_old_file_dialog)
6250 (xg_get_file_with_chooser, xg_get_file_with_selection)
6251 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
6252 (xg_item_label_same_p, xg_update_menubar)
6253 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
6254 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
6255 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
6256 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
6257 (update_frame_tool_bar, free_frame_tool_bar):
6258 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
6259 * nsmenu.m (ns_update_menubar):
6260 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
6261 * xfns.c (Fx_show_tip) [USE_GTK]:
6262 Use bool for boolean.
6263 * gtkutil.c (xg_update_frame_menubar):
6264 * xmenu.c (update_frame_menubar):
6265 Return void, not int, since caller ignores return value.
6266 * gtkutil.c (xg_change_toolbar_position):
6267 Return void, not 1.
6268
af0e9f75
JB
62692012-09-23 Juanma Barranquero <lekktu@gmail.com>
6270
6271 * makefile.w32-in (BLOCKINPUT_H): Remove.
6272 (SYSSIGNAL_H): New macro.
6273 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
6274 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
6275 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
6276 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
6277 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
6278 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
6279 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
6280 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
6281 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
6282 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
6283 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
6284 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
6285 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
6286 ($(BLD)/w32xfns.$(O)): Update dependencies.
6287
5101529e
EZ
62882012-09-23 Eli Zaretskii <eliz@gnu.org>
6289
6290 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
6291 fatal_error_backtrace.
6292
6293 * w32proc.c (sys_kill): Undo last change: don't do anything when
6294 invoked to deliver SIGABRT to our own process. This is now
6295 handled by emacs_raise.
6296
2c3ee0ad
JB
62972012-09-23 Juanma Barranquero <lekktu@gmail.com>
6298
6299 * w32term.c (w32_read_socket): Remove leftover reference to
6300 interrupt_input_pending.
6301
62a1d661
PE
63022012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6303
6304 Do not use SA_NODEFER.
6305 Problem reported by Dani Moncayo in
6306 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
6307 * alloc.c (die):
6308 * sysdep.c (emacs_abort): Do not reset signal handler.
6309 * emacs.c (terminate_due_to_signal): Reset signal handler here.
6310 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
6311 wanted even on POSIXish hosts, and it doesn't work on Windows.
6312
a0942b9a
JD
63132012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6314
6315 * xterm.c (x_term_init): Call fixup_locale before and after calling
6316 gtk_init (Bug#12392).
6317
d07ff9db
CY
63182012-09-23 Chong Yidong <cyd@gnu.org>
6319
6320 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
6321 Vdynamic_library_alist.
6322
6323 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
6324 (Fgnutls_available_p): Caller changed.
6325
6326 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
6327 (Flibxml_parse_xml_region): Likewise.
6328
6329 * dispextern.h (struct image_type): Remove arg from init function.
6330
6331 * image.c (Finit_image_library, lookup_image_type)
6332 (define_image_type): Remove now-unneeded second arg.
6333 (init_xpm_functions, init_png_functions, init_jpeg_functions)
6334 (init_tiff_functions, init_gif_functions, init_svg_functions):
6335 Arglist and w32_delayed_load calling convention changed.
6336 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 6337 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 6338
4d7e6e51
PE
63392012-09-23 Paul Eggert <eggert@cs.ucla.edu>
6340
6341 Simplify and avoid signal-handling races (Bug#12471).
6342 * alloc.c (die):
6343 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
6344 Avoid recursive loop if there's a fatal error in the function itself.
6345 * atimer.c (pending_atimers):
6346 * blockinput.h: Don't include "atimer.h"; no longer needed.
6347 (interrupt_input_pending): Remove. All uses removed.
6348 pending_signals now counts both atimers and ordinary interrupts.
6349 This is less racy than having three separate pending-signal flags.
6350 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
6351 (input_blocked_p):
6352 Rename from their upper-case counterparts BLOCK_INPUT,
6353 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
6354 INPUT_BLOCKED_P, and turn into functions. All uses changed.
6355 This makes it easier to access volatile variables more accurately.
6356 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
6357 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
6358 that's more reliable if the code is buggy and sets
6359 interrupt_input_blocked to a negative value. All uses changed.
6360 * atimer.c (deliver_alarm_signal):
6361 Remove. No need to deliver this to the parent; any thread can
6362 handle this signal now. All uses replaced by underlying handler.
6363 * atimer.c (turn_on_atimers):
6364 * dispnew.c (handle_window_change_signal):
6365 * emacs.c (handle_danger_signal):
6366 * keyboard.c (kbd_buffer_get_event):
6367 Don't reestablish signal handler; not needed with sigaction.
6368 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
6369 (UNBLOCK_INPUT_TO):
6370 Rework to avoid unnecessary accesses to volatile variables.
6371 (UNBLOCK_INPUT_TO): Now a function.
6372 (totally_unblock_input, unblock_input): New decls.
6373 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
6374 (init_data): Remove. Necessary stuff now done in init_signal.
6375 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
6376 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
6377 (fatal_error_code): Remove; no longer needed.
6378 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
6379 it doesn't always backtrace. All uses changed. No need to reset
6380 signal to default, since sigaction and/or die does that for us now.
6381 Use emacs_raise (FOO), not kill (getpid (), FOO).
6382 (main): Check more-accurately whether we're dumping.
6383 Move fatal-error setup to sysdep.c
6384 * floatfns.c: Do not include "syssignal.h"; no longer needed.
6385 * gtkutil.c (xg_get_file_name, xg_get_font):
6386 Remove no-longer-needed signal-mask manipulation.
6387 * keyboard.c, process.c (POLL_FOR_INPUT):
6388 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
6389 * keyboard.c (read_avail_input): Remove.
6390 All uses replaced by gobble_input.
6391 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
6392 (kbd_buffer_store_event_hold, gobble_input):
6393 (record_asynch_buffer_change) [USABLE_SIGIO]:
6394 (store_user_signal_events):
6395 No need to mess with signal mask.
6396 (gobble_input): If blocking input and there are terminals, simply
6397 set pending_signals to 1 and return. All hooks changed to not
6398 worry about whether input is blocked.
6399 (process_pending_signals): Clear pending_signals before processing
6400 them, in case a signal comes in while we're processing.
6401 By convention callers now test pending_signals before calling us.
6402 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
6403 New functions, to support changes to blockinput.h.
6404 (handle_input_available_signal): Now extern.
6405 (reinvoke_input_signal): Remove. All uses replaced by
6406 handle_async_input.
6407 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
6408 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
6409 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
6410 Clear sigmask reliably, even if Fsignal returns, which it can.
6411 Omit unnecessary accesses to volatile var.
6412 (quit_throw_to_read_char): No need to restore sigmask.
6413 * keyboard.c (gobble_input, handle_user_signal):
6414 * process.c (wait_reading_process_output):
6415 Call signal-handling code rather than killing ourselves.
6416 * lisp.h: Include <float.h>, for...
6417 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
6418 (pending_signals): Now volatile.
6419 (syms_of_data): Now const if IEEE floating point.
6420 (handle_input_available_signal) [USABLE_SIGIO]:
6421 (terminate_due_to_signal, record_child_status_change): New decls.
6422 * process.c (create_process): Avoid disaster if memory is exhausted
6423 while we're processing a vfork, by tightening the critical section
6424 around the vfork.
6425 (send_process_frame, process_sent_to, handle_pipe_signal)
6426 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
6427 ignores SIGPIPE.
6428 (send_process): No need for setjmp/longjmp any more, since the
6429 SIGPIPE stuff is now gone. Instead, report an error if errno
6430 is EPIPE.
6431 (record_child_status_change): Now extern. PID and W are now args.
6432 Return void, not bool. All callers changed.
6433 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
6434 Remove. All uses removed. This bug should be fixed now in a
6435 different way.
6436 (wait_for_termination_1): Use waitpid rather than sigsuspend,
6437 and record the child status change directly. This avoids the
6438 need to futz with the signal mask.
6439 (process_fatal_action): Move here from emacs.c.
6440 (emacs_sigaction_flags): New function, containing
6441 much of what used to be in emacs_sigaction_init.
6442 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
6443 caught by emacs, to make races less likely.
6444 (deliver_process_signal): Rename from handle_on_main_thread.
6445 All uses changed.
6446 (BACKTRACE_LIMIT_MAX): Now at top level.
6447 (thread_backtrace_buffer, threadback_backtrace_pointers):
6448 New static vars.
6449 (deliver_thread_signal, deliver_fatal_thread_signal):
6450 New functions, for more-accurate delivery of thread-specific signals.
6451 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
6452 (deliver_arith_signal): Handle in this thread, not
6453 in the main thread, since it's triggered by this thread.
6454 (maybe_fatal_sig): New function.
6455 (init_signals): New arg DUMPING so that we can be more accurate
6456 about whether we're dumping. Caller changed.
6457 Treat thread-specific signals differently from process-general signals.
6458 Block all signals while handling fatal error; that's safer.
6459 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
6460 on IEEE hosts.
6461 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
6462 Ignore SIGPIPE unless batch.
6463 (emacs_backtrace): Output backtrace for the appropriate thread,
6464 which is not necessarily the main thread.
6465 * syssignal.h: Include <stdbool.h>.
6466 (emacs_raise): New macro.
6467 * xterm.c (x_connection_signal): Remove; no longer needed
6468 now that we use sigaction.
6469 (x_connection_closed): No need to mess with sigmask now.
6470 (x_initialize): No need to reset SIGPIPE handler here, since
6471 init_signals does this for us now.
6472
8f4635e9
JD
64732012-09-23 Jan Djärv <jan.h.d@swipnet.se>
6474
6475 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 6476 background rect may be larger (Bug#12245).
8f4635e9 6477
3296976d
CY
64782012-09-23 Chong Yidong <cyd@gnu.org>
6479
6480 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
6481
d41e491e
PE
64822012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6483
6484 * .gdbinit: Just stop at fatal_error_backtrace.
6485 See Stefan Monnier's request in
6486 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
6487 Remove no-longer-used query of system type.
6488
c88b867f
CY
64892012-09-22 Chong Yidong <cyd@gnu.org>
6490
6491 * search.c (Freplace_match): Doc fix (Bug#12325).
6492
6493 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
6494
6495 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
6496 (Fline_end_position): Doc fix.
6497
6498 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
6499
bb4d86b4
CY
65002012-09-22 Chong Yidong <cyd@gnu.org>
6501
6502 * dispextern.h (struct image_type): Add new slot, storing a type
6503 initialization function.
6504
6505 * image.c (define_image_type): Call the image initializer function
6506 if it is defined. Arguments and return value changed.
6507 (valid_image_p, make_image): Callers changed.
6508 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
6509 (gif_type, imagemagick_type, svg_type, gs_type):
6510 Add initialization functions.
bb4d86b4
CY
6511 (Finit_image_library): Call lookup_image_type.
6512 (CHECK_LIB_AVAILABLE): Macro deleted.
6513 (lookup_image_type): Call define_image_type here, rather than via
6514 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
6515 (syms_of_image): Move define_image_type calls for xbm_type and
6516 pbm_type to lookup_image_type.
6517
df9685f3
EZ
65182012-09-22 Eli Zaretskii <eliz@gnu.org>
6519
6520 * keyboard.c (timer_check_2): Move calculation of 'timers' and
6521 'idle_timers' from here ...
6522 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
6523 lists, to avoid infloops when the timer does something stupid,
6524 like reinvoke itself with the same or smaller time-out.
6525 (Bug#12447)
6526
8e17c9ba
MR
65272012-09-22 Martin Rudalics <rudalics@gmx.at>
6528
6529 * window.c (Fsplit_window_internal): Handle only Qt value of
6530 Vwindow_combination_limit separately.
6531 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
6532 (Vwindow_combination_limit): New default value.
6533 Rewrite doc-string.
8e17c9ba 6534
589bd69b
EZ
65352012-09-22 Eli Zaretskii <eliz@gnu.org>
6536
6537 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
6538 the new overlay string. (Bug#10159)
6539
01108e3f
PE
65402012-09-22 Paul Eggert <eggert@cs.ucla.edu>
6541
6542 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
6543 or that fprintf is async-signal-safe. POSIX doesn't require
6544 either assumption.
6545
82f8cd94
CY
65462012-09-22 Chong Yidong <cyd@gnu.org>
6547
6548 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
6549 (Bug#8207).
6550
3cccbd87
KH
65512012-09-22 Kenichi Handa <handa@gnu.org>
6552
6553 * composite.c (composition_reseat_it): Handle the case that a
6554 grapheme cluster is not covered by a single font (Bug#12352).
6555
09c01941
CY
65562012-09-21 Chong Yidong <cyd@gnu.org>
6557
6558 * image.c (define_image_type): Avoid adding duplicate types to
6559 image_types (Bug#12463). Suggested by Jörg Walter.
6560
acfa068f 65612012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
6562
6563 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
6564 (print_load_command_name): Add case LC_DATA_IN_CODE.
6565 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
6566
acfa068f 65672012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
6568
6569 * eval.c (Frun_hook_with_args_until_success)
6570 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
6571
acfa068f 65722012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
6573
6574 * fileio.c (Ffile_selinux_context): Only call freecon when
6575 lgetfilecon succeeded.
6576 (Fset_file_selinux_context): Likewise. (Bug#12444)
6577
acfa068f 65782012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
6579
6580 * xdisp.c (try_window_reusing_current_matrix): Under bidi
6581 reordering, locate the cursor by calling set_cursor_from_row; if
6582 that fails, clear the desired glyph matrix before returning a
6583 failure indication to the caller. Fixes leaving garbled display
6584 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
6585 (compute_stop_pos_backwards): Fix a typo that caused crashes while
6586 scrolling through multibyte text.
aa36e4d2 6587
e99f70c8
SM
65882012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
6589
6590 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
6591 calling mark_vectorlike since that's the one that marks the window.
6592 (mark_discard_killed_buffers): Mark the final cdr.
6593 * window.h (struct window): Move prev/next_buffers to the
6594 non-standard fields.
6595 * window.c (make_window): Initialize prev/next_buffers manually.
6596
f75beb47
PE
65972012-09-20 Paul Eggert <eggert@cs.ucla.edu>
6598
6599 Omit unused arg EXPECTED from socket hooks.
6600 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
6601 * nsterm.m (ns_term_init):
6602 * termhooks.h (struct terminal.read_socket_hook):
6603 * w32inevt.c (w32_console_read_socket):
6604 * w32term.c (w32_read_socket):
6605 * xterm.c (XTread_socket):
6606 Omit unused arg EXPECTED. All callers changed.
6607 (store_user_signal_events): Return void, not int, since callers no
6608 longer care about the return value. All uses changed.
6609
b019b76a
JB
66102012-09-20 Juanma Barranquero <lekktu@gmail.com>
6611
6612 * w32gui.h (XParseGeometry): Do not declare.
6613
05642592
PE
66142012-09-19 Paul Eggert <eggert@cs.ucla.edu>
6615
e4bce92a 6616 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 6617 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
6618 <http://bugs.gnu.org/12471#8> (last line).
6619
05642592
PE
6620 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
6621 (XParseGeometry): Now static. Substitute extremal values for
6622 values that are out of range.
6623
e543ae91
JD
66242012-09-19 Jan Djärv <jan.h.d@swipnet.se>
6625
6626 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
6627
6628 * nsfns.m (XParseGeometry): Remove.
6629 (Fx_create_frame): Call x_set_offset to correctly interpret
6630 top_pos in geometry.
6631
3a880af4 6632 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
6633 (Fx_parse_geometry): If there is a space in string, call
6634 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
6635
45ba16c7
EZ
66362012-09-17 Eli Zaretskii <eliz@gnu.org>
6637
c8b9f1bc
EZ
6638 * search.c (scan_buffer): Use character positions in calls to
6639 region_cache_forward and region_cache_backward, not byte
6640 positions. (Bug#12196)
6641
b4c932a2
EZ
6642 * w32term.c (w32_read_socket): Set pending_signals to 1, like
6643 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
6644
45ba16c7
EZ
6645 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
6646 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
6647 emacs_blocked_malloc, now deleted.
6648
eeceac93
PE
66492012-09-17 Paul Eggert <eggert@cs.ucla.edu>
6650
6651 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
6652 The workaround was for improving performance on Solaris 2.4, but
6653 is getting in the way now. Emacs will still work if someone is
6654 still running Solaris 2.4 in a museum somewhere; Sun dropped
6655 support for Solaris 2.4 in 2003.
6656 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
6657 * process.c (create_process) [HAVE_WORKING_VFORK]:
6658 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
6659 since Emacs no longer uses vfork on that platform.
6660
78f83752
GM
66612012-09-17 Glenn Morris <rgm@gnu.org>
6662
6663 * emacs.c: Use COPYRIGHT.
6664
634b8cac
PE
66652012-09-16 Paul Eggert <eggert@cs.ucla.edu>
6666
0caaedb1
PE
6667 Remove configure's --without-sync-input option (Bug#12450).
6668 When auditing signal-handling in preparation for cleaning it up,
6669 I found that SYNC_INPUT has race conditions and would be a real
6670 pain to fix. Since it's an undocumented and deprecated
6671 configure-time option, now seems like a good time to remove it.
6672 Also see <http://bugs.gnu.org/11080#16>.
6673 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
6674 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
6675 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6676 (malloc_hysteresis):
6677 (check_depth) [XMALLOC_OVERRUN_CHECK]:
6678 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
6679 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
6680 (dont_register_blocks, bytes_used_when_reconsidered)
6681 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
6682 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
6683 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 6684 Remove. All uses removed.
0caaedb1
PE
6685 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
6686 implementation, one that depends on whether the new macro
6687 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
6688 is defined.
6689 * atimer.c (run_timers, handle_alarm_signal):
6690 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
6691 (handle_async_input, process_pending_signals)
6692 (handle_input_available_signal, init_keyboard):
6693 * nsterm.m (ns_read_socket):
6694 * process.c (wait_reading_process_output):
6695 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
6696 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
6697 (emacs_write):
6698 * xterm.c (XTread_socket):
6699 Assume SYNC_INPUT.
6700 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
6701 * eval.c (handling_signal): Remove. All uses removed.
6702 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
6703 All uses replaced with the SYNC_INPUT version.
6704 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
6705 Remove decls.
6706 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6707 Now static.
6708
634b8cac
PE
6709 * font.c (Ffont_shape_gstring): Remove unused local.
6710
83da1b55
GM
67112012-09-16 Glenn Morris <rgm@gnu.org>
6712
518650a5
GM
6713 * Makefile.in (clean): No longer run nextstep's clean.
6714
83da1b55
GM
6715 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
6716 (ns_frag): Remove.
6717 (ns-app): Move here from ns.mk, and simplify.
6718 (clean): Simplify nextstep entry.
6719 * ns.mk: Remove file.
6720
85a43e2e
KH
67212012-09-17 Kenichi Handa <handa@gnu.org>
6722
6723 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
6724 not covert the last few charactes.
6725
ba13e616 67262012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
6727
6728 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
6729 here, but just check the validity of glyphs in the glyph-string.
6730
a8c729af
MR
67312012-09-16 Martin Rudalics <rudalics@gmx.at>
6732
3a880af4
SM
6733 * window.c (Fwindow_parameter, Fset_window_parameter):
6734 Accept any window as argument (Bug#12452).
a8c729af 6735
c077c059
JD
67362012-09-16 Jan Djärv <jan.h.d@swipnet.se>
6737
6738 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
6739 to ns_term_init to avoid memory leak.
6740
6741 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
6742 explicit retain/release.
6743 (ns_term_init): Only allow one display. Initialize outerpool and
6744 ns_*_types.
6745
39a57ad0
PE
67462012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6747
6748 Port _setjmp fix to POSIXish hosts as well as Microsoft.
6749 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
6750 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
6751 the Microsoft problem in a different way, by altering ../nt/config.nt.
6752
7105c8cb
EZ
67532012-09-15 Eli Zaretskii <eliz@gnu.org>
6754
6755 * w32xfns.c:
6756 * w32uniscribe.c:
6757 * w32term.c:
6758 * w32select.c:
6759 * w32reg.c:
6760 * w32proc.c:
6761 * w32menu.c:
6762 * w32inevt.c:
6763 * w32heap.c:
6764 * w32font.c:
6765 * w32fns.c:
6766 * w32console.c:
6767 * w32.c:
6768 * w16select.c: Remove inclusion of setjmp.h, as it is now included
6769 by lisp.h. This completes removal of setjmp.h inclusion
6770 erroneously announced in the previous commit. (Bug#12446)
6771
6772 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
6773 more accurate.
6774
6775 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
6776 not defined as a macro. The latter happens on MS-Windows.
6777 (Bug#12446)
6778
0328b6de
PE
67792012-09-15 Paul Eggert <eggert@cs.ucla.edu>
6780
6781 Port better to POSIX hosts lacking _setjmp (Bug#12446).
6782 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 6783 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
6784 only reason for the instance was because "lisp.h" was included.
6785 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
6786 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
6787 and _longjmp with the new symbols. Emacs already uses _setjmp if
6788 available, so this change affects only POSIXish hosts that have
6789 sigsetjmp but not _setjmp, such as some versions of Solaris and
6790 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
6791 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
6792 (png_load_body) [HAVE_PNG]:
6793 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
6794 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
6795 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
6796 since PNG requires jmp_buf. This is the only exception to the
6797 general rule that we now use sys_setjmp and sys_longjmp.
6798 This exception is OK since this code does not change the signal
6799 mask or longjmp out of a signal handler.
6800
2af03429
PE
68012012-09-14 Paul Eggert <eggert@cs.ucla.edu>
6802
6803 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
6804 Include "syssignal.h", for 'main_thread'.
6805
2f294edf
DA
68062012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
6807
6808 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
6809 * insdel.c (replace_range, replace_range_2):
6810 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
6811 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
6812 Remove redundant check before calling offset_intervals.
6813
6b533e9c
MR
68142012-09-14 Martin Rudalics <rudalics@gmx.at>
6815
6816 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
6817 current buffer (Bug#12387).
6818
2a7931e3
JB
68192012-09-14 Juanma Barranquero <lekktu@gmail.com>
6820
6821 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6822
c18e885b
PE
68232012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6824
6825 Use a more backwards-compatible timer format (Bug#12430).
6826 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6827 vector element, not from the 4th, since PSECS is now at the end.
6828 (Fcurrent_idle_time): Doc fix.
6829
d59a1afb
DA
68302012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6831
6832 Function to mark objects and remove killed buffers at once.
6833 * alloc.c (discard_killed_buffers): Rename to ...
6834 (mark_discard_killed buffers) ... new name. Add marking
6835 of remaining objects. Fix comment. Adjust users.
6836 (mark_object): Do not touch frame buffer lists here.
6837 * frame.c (delete_frame): Reset frame buffer lists here.
6838
5f0cb45a
PE
68392012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6840
8ea47e3a
PE
6841 Better workaround for GNOME bug when --enable-gcc-warnings.
6842 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6843 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6844 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6845
4a4bbad2
PE
6846 Simplify SIGIO usage (Bug#12408).
6847 The code that dealt with SIGIO was crufty and confusing, e.g., it
6848 played tricks like "#undef SIGIO" but these tricks were not used
6849 consistently. Simplify mostly by not #undeffing standard symbols,
6850 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6851 or not as we please) rather than "defined SIGIO" (standard symbol
6852 that we probably shouldn't #undef).
6853 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6854 Modules that need it can include it.
6855 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6856 * dispextern.h (ignore_sigio): New decl.
6857 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6858 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6859 * emacs.c (shut_down_emacs):
6860 * keyboard.c (kbd_buffer_store_event_hold):
6861 Use ignore_sigio rather than invoking 'signal' directly.
6862 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6863 for FIONREAD.
6864 (FIONREAD, SIGIO): Do not #undef.
6865 (tty_read_avail_input): Use #error rather than a syntax error.
6866 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6867 for I_PIPE, used by SETUP_SLAVE_PTY.
6868 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6869 * sysdep.c (croak): Remove; no longer needed. This bit of
6870 temporary code, with Fred N. Fish's comment that it's temporary,
6871 has been in Emacs since at least 1992!
6872 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6873 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6874 * syssignal.h (croak): Remove decl.
6875 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6876 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6877 now that we're termios-only.
6878 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6879 * term.c (dissociate_if_controlling_tty): Use #error rather than
6880 a run-time error.
6881
5f0cb45a
PE
6882 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6883 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6884 to work around GNOME bug 683906.
6885 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6886 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6887 This works around GCC bug 54561.
6888
40bce90b
PE
68892012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6890
6891 More fixes for 'volatile' and setjmp/longjmp.
6892 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6893 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6894 (png_load_body) [HAVE_PNG]:
6895 (jpeg_load_body) [HAVE_JPEG]:
6896 New function, with most of the old parent function's body.
6897 (png_load) [HAVE_PNG]:
6898 (jpeg_load) [HAVE_JPEG]:
6899 Invoke the new function, to avoid longjmp munging our locals.
6900 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6901 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6902 longjmp is passed 2, as the C standard doesn't guarantee this.
6903 Instead, store the failure code into mgr->failure_code.
6904
bfeae2cf
SM
69052012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6906
6907 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6908 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6909 (syms_of_keyboard): Remove support for unread-command-char.
6910
8099e36b
EZ
69112012-09-12 Eli Zaretskii <eliz@gnu.org>
6912
6913 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6914 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6915 violation. (Bug#12426)
6916
92547ff9
PE
69172012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6918
6919 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6920
45b82ad0
SM
69212012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6922
6923 * eval.c: Add `inhibit-debugger'.
6924 (Qinhibit_debugger): New symbol.
6925 (call_debugger): Bind it instead of Qdebug_on_error.
6926 (maybe_call_debugger): Test Vinhibit_debugger.
6927 (syms_of_eval): Define inhibit-debugger.
6928 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6929 (syms_of_xdisp): Remove inhibit-debug-on-message.
6930
5779a1dc
PE
69312012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6932
50f2e553
PE
6933 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6934 If a nonvolatile local variable is written before a _longjmp to
6935 the frame containing the variable, and is read after the _longjmp,
6936 the value read is indeterminate. Some local variables of type
6937 'struct handler' and 'struct catchtag' are used in this way, so
6938 mark each of their slots as volatile if the slot can be set before
6939 _longjmp and read afterwards.
6940 * lisp.h (struct handler): var and chosen_clause are now volatile.
6941 (struct catchtag): val, next, and pdlcount are now volatile.
6942
ae1d87e2
PE
6943 * bidi.c (bidi_push_it, bidi_pop_it):
6944 * fns.c (copy_hash_table):
6945 * image.c (define_image_type):
6946 * keyboard.c (kbd_buffer_store_event_hold):
6947 * process.c (Fprocess_send_eof):
6948 * xfaces.c (x_create_gc) [HAVE_NS]:
6949 * xgselect.c (xg_select):
6950 Prefer assignment to memcpy when either will do.
6951
5779a1dc
PE
6952 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6953 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6954 time an item is removed. No need to mark this function 'inline';
6955 the compiler knows better than we do.
6956
c4c9756b
JD
69572012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6958
6959 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6960 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6961 to change_frame_size (Bug#12388).
6962 (windowDidResize:): Pass YES to updateFrameSize.
6963
6964 * nsterm.h: Add delay parameter to updateFrameSize.
6965
d73e321c
DA
69662012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6967
6968 Discard killed buffers from deleted window and frame objects.
6969 This reduces an amount of references to killed buffers and
6970 helps GC to reclaim them faster.
6971 * alloc.c (discard_killed_buffers): New function.
6972 (mark_object): Use it for deleted windows and frames.
6973 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 6974 or deleted frame, restore its global binding.
d73e321c
DA
6975 * data.c (swap_in_global_binding): Add GC notice.
6976 (swap_in_symval_forwarding): Use convenient set_blv_where.
6977 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6978 * window.h: ... to here.
6979
e578f381
DA
69802012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6981
6982 Convenient macro to check whether the buffer is live.
6983 * buffer.h (BUFFER_LIVE_P): New macro.
6984 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6985 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6986
3057e615
YM
69872012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6988
6989 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6990 composition cases (Bug#12364).
6991
6992 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6993 overhang of succeeding glyphs overlapping box cursor.
6994
6995 * w32term.c (x_draw_glyph_string): Likewise.
6996
6fda35f2
PE
69972012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6998
c990426a
PE
6999 Simplify, document, and port floating-point (Bug#12381).
7000 The porting part of this patch fixes bugs on non-IEEE platforms
7001 with frexp, ldexp, logb.
7002 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
7003 Now static.
7004 * floatfns.c: Simplify discussion of functions that Emacs doesn't
7005 support, by removing commented-out code and briefly listing the
7006 C89 functions excluded. The commented-out stuff was confusing
7007 maintenance, e.g., we thought we needed cbrt but it was commented out.
7008 (logb): Remove decl; no longer needed.
7009 (isfinite): New macro, if not already supplied.
7010 (isnan): Don't replace any existing macro.
7011 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
7012 are present on all C89 platforms.
7013 (Ffrexp): Do not special-case zero, as frexp does the right thing
7014 for that case.
7015 (Flogb): Do not use logb, as it doesn't have the desired meaning
7016 on hosts that use non-base-2 floating point. Instead, stick with
7017 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
7018 frexp, to avoid getting an unspecified result.
7019
6fda35f2
PE
7020 * xdisp.c (Qinhibit_debug_on_message): Now static.
7021
16130a58
JD
70222012-09-10 Jan Djärv <jan.h.d@swipnet.se>
7023
7024 * nsterm.m (ns_update_begin): Set clip path to whole view by using
7025 NSBezierPath (Bug#12131).
7026
d105a573
CY
70272012-09-10 Chong Yidong <cyd@gnu.org>
7028
7029 * fns.c (Fdelq, Fdelete): Doc fix.
7030
ff55dfe8
PE
70312012-09-10 Paul Eggert <eggert@cs.ucla.edu>
7032
7033 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
7034 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
7035
e7032e7c
SM
70362012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
7037
7038 * lisp.h (make_lisp_ptr): New macro to replace XSET.
7039 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
7040 Use it.
7041
e9957956
EZ
70422012-09-09 Eli Zaretskii <eliz@gnu.org>
7043
aba05ce9
EZ
7044 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
7045 left fringe if the window has a left margin. This avoids leaving
7046 traces of the cursor because its leftmost pixel is not drawn over.
7047
e9957956
EZ
7048 * dispnew.c (update_window_line): When the left margin area of a
7049 screen line is updated, set the redraw_fringe_bitmaps_p flag of
7050 that screen line. (Bug#12277)
7051
f6196b87
PE
70522012-09-09 Paul Eggert <eggert@cs.ucla.edu>
7053
7054 Assume C89 or later for math functions (Bug#12381).
7055 This simplifies the code, and makes it a bit smaller and faster,
7056 and (most important) makes it easier to clean up signal handling
7057 since we can stop worring about floating-point exceptions in
7058 library code. That was a problem before C89, but the problem
7059 went away many years ago on all practical Emacs targets.
7060 * data.c, image.c, lread.c, print.c:
7061 Don't include <math.h>; no longer needed.
7062 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
7063 might be autoconfigured, as that never happens.
7064 * data.c (fmod):
7065 * doprnt.c (DBL_MAX_10_EXP):
7066 * print.c (DBL_DIG):
7067 Remove. C89 or later always defines these.
7068 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
7069 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
7070 (arith_error, domain_error, domain_error2):
7071 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
7072 no longer needed -- we simply return what C returns. All uses removed.
7073 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
7074 the wrapped code.
7075 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
7076 Remove. All uses expanded, as these macros are no longer used
7077 more than once and are now more trouble than they're worth.
7078 (Ftan): Use tan, not sin / cos.
7079 (Flogb): Assume C89 frexp.
7080 (fmod_float): Assume C89 fmod.
7081 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
7082 (init_floatfns): Remove. All uses removed.
7083
9d7f1863
JD
70842012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7085
7086 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
7087 compositeToPoint for OSX < 10.6 (Bug#12390).
7088
eabf0404
PE
70892012-09-08 Paul Eggert <eggert@cs.ucla.edu>
7090
7091 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
7092 This produces more-accurate results.
7093
0b3b1d23
JD
70942012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7095
7096 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
7097 changes (Bug#12088).
7098
6dcef6ec
CY
70992012-09-08 Chong Yidong <cyd@gnu.org>
7100
7101 * syntax.c (Fstring_to_syntax): Doc fix.
7102
aa7d57c5
JD
71032012-09-08 Jan Djärv <jan.h.d@swipnet.se>
7104
7105 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
7106 in the internal border.
7107 (x_set_window_size): Remove static variables and their usage.
7108 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
7109 (ns_after_update_window_line, ns_draw_fringe_bitmap):
7110 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
7111 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
7112 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
7113 (ns_fix_rect_ibw): Remove.
7114 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
7115 (ns_dumpglyphs_box_or_relief): Ditto.
7116 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
7117 adjustment.
7118 (ns_dumpglyphs_image): Ditto.
fc0c31f8 7119 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
7120 border adjustment.
7121 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
7122 their usage. Add fringe_extended_p and its use as in other terms.
7123 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
7124 scroll bar was removed.
7125 (updateFrameSize): New function.
7126 (windowDidResize): Move code to updateFrameSize and call it.
7127
7128 * nsterm.h (EmacsView): Add updateFrameSize.
7129
1a5432bc
CY
71302012-09-07 Chong Yidong <cyd@gnu.org>
7131
b4f5313e
CY
7132 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
7133
1a5432bc
CY
7134 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
7135
1a4f1e9b
PE
71362012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7137
7138 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
7139 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
7140 Problem introduced when merging patches. Noted by Eli Zaretskii in
7141 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
7142 * floatfns.c: Comment fix.
7143 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
7144 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
7145 and anyway the declaration is harmless even if SIGDANGER is not defined.
7146 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
7147 defined BROKEN_FIONREAD). systty.h formerly did this, but other
7148 source files not surprisingly expected syssignal.h to define, or
7149 not define, SIGIO, and it's cleaner to do it that way, for consistency.
7150 Include <sys/ioctl.h>, for FIONREAD.
7151 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
7152 This eliminates a problem whereby other files mysteriously had
7153 to include "syssignal.h" before including "systty.h" if they
7154 wanted to use "#ifdef SIGIO".
7155
bc8000ff
EZ
71562012-09-07 Eli Zaretskii <eliz@gnu.org>
7157
3e6d6928
EZ
7158 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
7159
7160 * w32.c (sigemptyset): Empty the set.
7161 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
7162
bc8000ff
EZ
7163 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
7164
b4fa72f2
DA
71652012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
7166
7167 * alloc.c (mark_buffer): Revert unsafe marking optimization.
7168 (mark_object): Likewise for frame objects.
7169
30730c93
PE
71702012-09-07 Paul Eggert <eggert@cs.ucla.edu>
7171
7172 * syssignal.h (handle_on_main_thread): Always declare,
7173 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
7174 This ports to platforms without HAVE_PTHREAD.
7175
2fe28299
PE
71762012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7177
7178 Signal-handler cleanup (Bug#12327).
7179 Emacs's signal handlers were written in the old 4.2BSD style with
7180 sigblock and sigmask and so forth, and this led to some
7181 inefficiencies and confusion. Rewrite these to use
7182 pthread_sigmask etc. without copying signal sets around. Also,
7183 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
7184 'signal', and instead use functions that do not attempt to take
7185 over the system name space. This patch causes Emacs's text
7186 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
7187 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
7188 Do not include <signal.h> or "syssignal.h", as these
7189 modules do not use signals.
7190 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
7191 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
7192 Do not include <signal.h>, as "syssignal.h" does that for us now.
7193 * atimer.c (sigmask_atimers): New function.
7194 (block_atimers, unblock_atimers): New functions,
7195 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
7196 All uses replaced.
7197 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
7198 no longer needed here.
7199 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 7200 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
7201 * sysdep.c (struct save_signal): New member 'action', replacing
7202 old member 'handler'.
7203 (save_signal_handlers, restore_signal_handlers):
7204 Use sigaction instead of 'signal' to save and restore.
7205 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
7206 New function. All users of 'signal' modified to use set_sighandler
7207 if they're writeonly, and to use sys_signal if they're read+write.
7208 (emacs_sigaction_init, forwarded_signal): New functions.
7209 (sys_signal): Remove. All uses replaced by calls to sigaction
7210 and emacs_sigaction_init, or by direct calls to 'signal'.
7211 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
7212 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
7213 all uses replaced by pthread_sigmask etc. calls.
7214 * syssignal.h: Include <signal.h>.
7215 (emacs_sigaction_init, forwarded_signal): New decls.
7216 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
7217 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
7218 (sigmask, sys_sigmask): Remove; no longer needed.
7219 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
7220 (sigblock, sigunblock, sigfree):
7221 (sigsetmask) [!defined sigsetmask]:
7222 Remove. All uses replaced by pthread_sigmask.
7223 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
7224 no longer need to be replaced, and its typical old uses
7225 are now done via emacs_sigaction_init and sigaction.
7226 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
7227 (sys_sigdel): Remove; unused.
7228 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
7229
0216c128
EZ
72302012-09-06 Eli Zaretskii <eliz@gnu.org>
7231
7232 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
7233 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
7234
c752cfa9
DA
72352012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7236
7237 Explicitly mark buffer_defaults and buffer_local_symbols.
7238 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
7239 mark_local_symbols here.
7240 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
7241 since special buffers aren't marked here any more.
7242 (allocate_buffer): Chain new buffer with all_buffers here...
7243 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
7244 not here.
7245 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
7246 (syms_of_buffer): Remove staticpro of the above.
7247 (init_buffer_once): Set names for buffer_defaults and
7248 buffer_local_symbols.
7249
a864ef14
PE
72502012-09-06 Paul Eggert <eggert@cs.ucla.edu>
7251
7252 Use bool for booleans in font-related modules.
7253 * font.c (font_intern_prop, font_style_to_value)
7254 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
7255 (generate_otf_features, font_check_otf_features, font_check_otf)
7256 (font_match_p, font_list_entities, font_at):
7257 * fontset.c (fontset_id_valid_p, reorder_font_vector
7258 (fontset_find_font, Fset_fontset_font)
7259 (face_suitable_for_char_p) [0]:
7260 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
7261 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
7262 (m17n_flt_initialized, ftfont_shape_by_flt):
7263 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
7264 * nsfont.m (nsfont_draw):
7265 * w32font.c (w32font_draw):
7266 * w32term.c (x_draw_glyphless_glyph_string_foreground):
7267 Use bool for booleans.
7268 * font.h: Adjust to above API changes.
7269 (struct font, struct font_driver, struct font_driver_list):
7270 Use bool for booleans.
7271 (struct font): Remove useless member encoding_type.
7272 All users removed.
7273 * fontset.c, xftfont.c: Omit unnecessary static decls.
7274
0699fc18
DA
72752012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
7276
7277 * alloc.c (mark_object): Revert window marking code
7278 since it's unsafe for the Fset_window_configuration.
7279
20ef56db
PE
72802012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7281
2fe28299 7282 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
7283 Be more systematic about preserving errno whenever a signal
7284 handler returns, even if it's not in the main thread. Do this by
7285 renaming signal handlers to distinguish between signal delivery
7286 and signal handling. All uses changed.
7287 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
7288 * data.c (deliver_arith_signal): Rename from arith_error.
7289 * dispnew.c (deliver_window_change_signal): Rename from
7290 window_change_signal.
7291 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
7292 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
7293 * keyboard.c (deliver_input_available_signal): Rename from
7294 input_available_signal.
7295 (deliver_user_signal): Rename from handle_user_signal.
7296 (deliver_interrupt_signal): Rename from interrupt_signal.
7297 * process.c (deliver_pipe_signal): Rename from send_process_trap.
7298 (deliver_child_signal): Rename from sigchld_handler.
7299 * atimer.c (handle_alarm_signal):
7300 * data.c (handle_arith_signal):
7301 * dispnew.c (handle_window_change_signal):
7302 * emacs.c (handle_fatal_signal, handle_danger_signal):
7303 * keyboard.c (handle_input_available_signal):
7304 * keyboard.c (handle_user_signal, handle_interrupt_signal):
7305 * process.c (handle_pipe_signal, handle_child_signal):
7306 New functions, with the actual signal-handling code taken from the
7307 original respective signal handlers, sans the sporadic attempts to
7308 preserve errno, since that's now done by handle_on_main_thread.
7309 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
7310 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
7311 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7312 Move to sysdep.c.
7313 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7314 Move initialization of main_thread to sysdep.c's init_signals.
7315 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
7316 our usage, and simplifies the mainline code.
7317 (record_child_status_change): New static function, as a helper
7318 for handle_child_signal, and with most of the old child handler's
7319 contents.
7320 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
7321 (handle_child_signal): Use the above.
7322 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
7323 Moved here from emacs.c.
7324 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
7325 code moved here from emacs.c's main function.
7326 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
7327 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
7328 This lets callers save and restore errno properly.
20ef56db 7329
e3ccf108
DA
73302012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7331
7332 Remove redundant or unused things here and there.
7333 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
7334 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
7335 * editfns.c (Fcompare_buffer_substrings): Likewise.
7336 * frame.h (struct terminal, struct font_driver_list):
7337 Remove redundant declarations.
7338 * window.h (Qleft, Qright): Likewise.
7339
697e1e39
DA
73402012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7341
7342 Do not mark objects from deleted buffers, windows and frames.
7343 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
7344 (mark_object): Likewise for windows and frames.
7345
c1ca42ca
DA
73462012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
7347
7348 * alloc.c (valid_lisp_object_p): Treat killed buffers,
7349 buffer_defaults and buffer_local_symbols as valid objects.
7350 Return special value to denote them.
7351
014d93be
PE
73522012-09-05 Paul Eggert <eggert@cs.ucla.edu>
7353
f75d7a91
PE
7354 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
7355 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
7356 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
7357 (file_name_absolute_p, Fsubstitute_in_file_name):
7358 (check_executable, check_writable, Ffile_accessible_directory_p)
7359 (Fset_file_selinux_context, Fdefault_file_modes)
7360 (Finsert_file_contents, choose_write_coding_system)
7361 (Fwrite_region, build_annotations, a_write, e_write)
7362 (Fdo_auto_save):
7363 * filelock.c (boot_time_initialized, get_boot_time)
7364 (get_boot_time_1, lock_file_1, within_one_second):
7365 * floatfns.c (in_float):
7366 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
7367 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
7368 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
7369 * lisp.h (struct Lisp_Hash_Table.cmpfn):
7370 * window.c (compare_window_configurations):
7371 Use bool for booleans.
7372 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
7373 (Fdefault_file_modes): Now mode_t, not int, for modes.
7374 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
7375 (internal_delete_file): Now returns void, not a (boolean) int,
7376 since nobody was looking at the return value.
7377 * lisp.h, window.h: Adjust to above API changes.
7378
014d93be
PE
7379 * xdisp.c (set_message): Simplify and reindent last change.
7380
776f29e1
JB
73812012-09-05 Juanma Barranquero <lekktu@gmail.com>
7382
7383 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
7384
7f7e0167
LI
73852012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
7386
7387 * eval.c (call_debugger): Make the function non-static so that we
7388 can call it from set_message.
7389
7390 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
7391 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
7392
cf29dd84
PE
73932012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7394
7395 Give more-useful info on a fatal error (Bug#12328).
7396 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
7397 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
7398 of doing the work ourselves.
7399 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
7400 do most of the work.
7401 (fatal_error_backtrace): New function, taken from the guts
7402 of the old fatal_error_signal, but with a new option to output
7403 a backtrace.
7404 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
7405 info about the signal than just its number.
7406 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
7407 * sysdep.c: Include <execinfo.h>
7408 (emacs_backtrace): New function, taken partly from the previous
7409 code of the 'die' function.
7410 (emacs_abort): Call fatal_error_backtrace rather than abort.
7411
972debf2
SM
74122012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
7413
7414 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
7415 eager (load-time) macro-expansion.
7416 * lisp.mk (lisp): Add macroexp.
7417
1088b922
PE
74182012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7419
7420 Simplify redefinition of 'abort' (Bug#12316).
7421 Do not try to redefine the 'abort' function. Instead, redo
7422 the code so that it calls 'emacs_abort' rather than 'abort'.
7423 This removes the need for the NO_ABORT configure-time macro
7424 and makes it easier to change the abort code to do a backtrace.
7425 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
7426 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
7427 Remove; sysdep.c's emacs_abort now takes its place.
7428 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
7429 'abort' changed to use 'emacs_abort'.
7430 * msdos.c (dos_abort) [defined abort]: Remove; not used.
7431 (abort) [!defined abort]: Rename to ...
7432 (emacs_abort): ... new name.
7433 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
7434 the place of the old 'abort' in emacs.c.
7435 * w32.c, w32fns.c (abort): Do not #undef.
7436 * w32.c (emacs_abort): Rename from w32_abort.
7437
30934d33
EZ
74382012-09-04 Eli Zaretskii <eliz@gnu.org>
7439
7440 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
7441 offsets[j].dv, since the y axis of the screen coordinates points
7442 down, while the y axis of the font definition coordinates points
7443 up. This fixes display of Arabic diacritics such as KASRA and
7444 KASRATAN. (Bug#11860)
7445
af26b72c
PE
74462012-09-04 Paul Eggert <eggert@cs.ucla.edu>
7447
7448 Be more systematic about _setjmp vs setjmp.
7449 * alloc.c (test_setjmp, mark_stack):
7450 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
7451 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
7452 (png_load, my_error_exit, jpeg_load):
7453 * process.c (send_process_trap, send_process):
7454 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
7455 The underscored versions are up to 30x faster on some hosts.
7456 Formerly, the code used setjmp+longjmp sometimes and
7457 _setjmp+_longjmp at other times, with no particular reason to
7458 prefer setjmp+longjmp.
7459
26d4541d
PE
74602012-09-03 Paul Eggert <eggert@cs.ucla.edu>
7461
d42f4f0f 7462 Fix minor problem found by static checking.
26d4541d 7463 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 7464
c5e28e39
MR
74652012-09-03 Martin Rudalics <rudalics@gmx.at>
7466
7467 * buffer.c (Fdelete_all_overlays): New function.
7468
3eab3ca9
CY
74692012-09-03 Chong Yidong <cyd@gnu.org>
7470
7471 * gtkutil.c: Add extern decl for Qxft.
7472
c04889f8
PE
74732012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7474
1882aa38
PE
7475 * emacs.c, eval.c: Use bool for boolean.
7476 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
7477 (malloc_using_checking) [DOUG_LEA_MALLOC]:
7478 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
7479 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
7480 (main, decode_env_path, Fdaemon_initialized):
7481 * eval.c (call_debugger, Finteractive_p, interactive_p):
7482 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
7483 (maybe_call_debugger, Fbacktrace):
7484 * process.c (read_process_output, exec_sentinel):
7485 Use bool for booleans.
7486 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
7487 All callers changed.
7488 * eval.c (interactive_p): Omit always-true boolean argument
7489 EXCLUDE_SUBRS_P. All callers changed.
7490 * dispextern.h, lisp.h: Reflect above API changes.
7491 * firstfile.c (dummy): Use the address of 'main', whose signature
7492 won't change, instead of the address of 'initialize', whose
7493 signature just changed from int to bool.
7494 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
7495 * msdos.c (fatal_error_in_progress): ... from here.
7496 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
7497 of incrementing it.
7498 (redisplay_internal, unwind_redisplay): Simply clear
7499 REDISPLAYING_P when unwinding, instead of saving its previous,
7500 always-false value and then restoring it.
7501
a411ac43
PE
7502 Clean up some extern decls.
7503 Mostly, this hoists extern decls out of .c files and into .h files.
7504 That way, we're more likely to catch errors if the interfaces change.
7505 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
7506 declare xg_mark_data.
7507 * dispextern.h (x_frame_parm_handlers):
7508 * font.h (Qxft):
7509 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
7510 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
7511 (Qultra_bold, Qoblique, Qitalic):
7512 Move extern decl here from .c file.
7513 * alloc.c (xg_mark_data) [USE_GTK]:
7514 * doc.c (Qclosure):
7515 * eval.c (Qlexical_binding):
7516 * fns.c (time) [!HAVE_UNISTD_H]:
7517 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
7518 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
7519 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
7520 * lread.c (Qinternal_interpreter_environment):
7521 * minibuf.c (Qbuffer):
7522 * process.c (QCfamily, QCfilter):
7523 * widget.c (free_frame_faces):
7524 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
7525 * xfont.c (x_clear_errors):
7526 * xterm.c (x_frame_parm_handlers):
7527 Remove now-redundant extern decls.
7528 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
7529 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
7530 Now static.
7531 * xfaces.c: Remove unnecessary static decls.
7532 * xterm.c (updating_frame): Remove decl of nonexistent object.
7533
c04889f8
PE
7534 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
7535 when building globals.h, as the objects that are not built on
7536 this host are not needed to compile C files on this host.
7537
8b339673
JD
75382012-09-02 Jan Djärv <jan.h.d@swipnet.se>
7539
7540 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
7541
7542 * frame.h: Add missing prototype for x_wm_set_size_hint.
7543
a08d4ba7
PE
75442012-09-02 Paul Eggert <eggert@cs.ucla.edu>
7545
7546 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
7547 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
7548 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
7549 (Fsubstitute_command_keys):
7550 * editfns.c (region_limit, find_field, Fconstrain_to_field)
7551 (save_excursion_save, save_excursion_restore)
7552 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
7553 (format_time_string, general_insert_function)
7554 (make_buffer_string, make_buffer_string_both)
7555 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
7556 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
7557 (copy_text, insert_1, insert_1_both, insert_from_string)
7558 (insert_from_string_before_markers, insert_from_string_1)
7559 (insert_from_buffer, insert_from_buffer_1, replace_range)
7560 (replace_range_2, del_range_1, del_range_byte, del_range_both)
7561 (del_range_2, modify_region):
7562 * intervals.c (intervals_equal, balance_possible_root_interval)
7563 (adjust_intervals_for_insertion, merge_properties_sticky)
7564 (graft_intervals_into_buffer, lookup_char_property)
7565 (adjust_for_invis_intang, set_point_both)
7566 (get_property_and_range, compare_string_intervals)
7567 (set_intervals_multibyte_1, set_intervals_multibyte):
7568 * keyboard.c (decode_timer):
7569 Use bool for boolean.
7570 * intervals.h, lisp.h, systime.h: Reflect above API changes.
7571 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
7572
48c948de
CY
75732012-09-02 Chong Yidong <cyd@gnu.org>
7574
7575 * keymap.c (push_key_description): Print M-TAB as C-M-i
7576 (Bug#11758).
7577
6c49a40b
JB
75782012-09-02 Juanma Barranquero <lekktu@gmail.com>
7579
7580 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
7581 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
7582 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
7583 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
7584 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
7585 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
7586 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7587
4dfbd238
EZ
75882012-09-01 Eli Zaretskii <eliz@gnu.org>
7589
7e510e28
EZ
7590 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
7591 more than one grapheme cluster passed to the shaper: compute the
7592 offset adjustment values separately for each cluster. (Bug#11860)
7593
4dfbd238
EZ
7594 * image.c: Restore mistakenly removed inclusion of w32.h. Without
7595 it, GCC doesn't see prototypes of w32_delayed_load, and complains
7596 about implicit conversions from integer to pointer.
7597
86571ae0
DC
75982012-09-01 Daniel Colascione <dancol@dancol.org>
7599
7600 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
7601 system used too early.
7602
0e23ef9d
PE
76032012-09-01 Paul Eggert <eggert@cs.ucla.edu>
7604
7605 Better seed support for (random).
7606 * emacs.c (main): Call init_random.
7607 * fns.c (Frandom): Set the seed from a string argument, if given.
7608 Remove long-obsolete Gentzel cruft.
7609 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
7610 (init_random): New function.
7611
17a2cbbd
DC
76122012-09-01 Daniel Colascione <dancol@dancol.org>
7613
7614 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
7615 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
7616 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
7617 x_wm_set_size_hint, x_query_colors, x_real_positions,
7618 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
7619 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
7620 all of which have been moved to common code.
7621
7622 * xfaces.c: Include TERM_HEADER instead of listing all possible
7623 window-system headers.
7624
7625 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
7626 to match header.
7627
7628 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
7629 directly accessing frame internals.
7630
f18cbb28 7631 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
7632 globals_of_w32font.
7633
7634 * process.c: Include TERM_HEADER instead of listing all possible
7635 window-system headers.
7636
3a880af4
SM
7637 * nsterm.h: Remove declarations now in frame.h.
7638 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
7639
7640 * menu.c: Include TERM_HEADER instead of listing all possible
7641 window-system headers.
7642
7643 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
7644 window system.
7645
7646 * keyboard.c: Include TERM_HEADER instead of listing all possible
7647 window-system headers.
7648
7649 * image.c: Include TERM_HEADER instead of listing all possible
7650 window-system headers. Declare Vlibrary_cache when compiling for
7651 Windows.
7652
7653 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
7654 window system declarations.
7655
7656 * frame.h: Move common functions here: set_frame_menubar,
7657 x_set_window_size, x_sync, x_get_focus_frame,
7658 x_set_mouse_position, x_set_mouse_pixel_position,
7659 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
7660 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
7661 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
7662 x_activate_menubar, x_real_positions, x_bitmap_icon,
7663 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
7664 and x_query_colors.
7665
7666 * frame.c: Include TERM_HEADER instead of listing all possible
7667 window-system headers.
7668
7669 * font.c: Include TERM_HEADER instead of listing all possible
7670 window-system headers.
7671
7672 * emacs.c: Include TERM_HEADER.
7673
f18cbb28
EZ
7674 * dispnew.c: Include TERM_HEADER instead of listing all possible
7675 window-system headers.
17a2cbbd 7676
f18cbb28 7677 * ccl.h: Include character.h.
17a2cbbd
DC
7678
7679 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
7680 the current window system; include in list of objects to link into
7681 Emacs.
7682
c650a5de
DA
76832012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7684
7685 Remove mark_ttys function and fix tty_display_info initialization.
7686 * lisp.h (mark_ttys): Remove prototype.
7687 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
7688 to mark_ttys because all possible values of 'top_frame' slot are
7689 the frames which are reachable from Vframe_list.
7690 * term.c (mark_ttys): Remove.
7691 (init_tty): Safely initialize 'top_frame' slot with Qnil.
7692
4e0f6479
DA
76932012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7694
7695 Change struct frame bitfields from unsigned char to unsigned.
7696 * frame.h (struct frame): Change type of 'display_preempted',
7697 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
7698 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
7699 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
7700 bitfields from unsigned char to unsigned.
7701
8b96a52c
DA
77022012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
7703
7704 Remove unused member of struct x_output and struct w32_output.
7705 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
7706 * w32term.h (struct w32_output): Likewise.
7707
b4444c8a
JD
77082012-08-30 Jan Djärv <jan.h.d@swipnet.se>
7709
7710 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
7711 does not become zero (Bug#12234).
7712
b98521db
PE
77132012-08-30 Paul Eggert <eggert@cs.ucla.edu>
7714
7715 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
7716 for GCC 4.7.1 x86-64.
7717
31d02438
GM
77182012-08-30 Glenn Morris <rgm@gnu.org>
7719
7720 * lread.c (init_lread): For out-of-tree builds, only add the
7721 source directory's site-lisp dir to the load-path if it exists,
7722 consistent with in-tree builds. (Bug#12302)
7723
7f8941d8
JD
77242012-08-28 Jan Djärv <jan.h.d@swipnet.se>
7725
7726 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 7727 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
7728 (windowShouldClose:): Set window_closed.
7729 (dealloc): New member, free button_values.
fc0c31f8
JB
7730 (process_dialog:): Make member function. Remove window argument,
7731 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
7732 in button_values.
7733 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 7734 with tag. Remove return self, declare return value as void.
7f8941d8
JD
7735 (addString:row:): Remove return self, declare return value as void.
7736 (addSplit): Remove return self, declare return value as void.
7737 (clicked:): Remove return self, declare return value as void.
fc0c31f8 7738 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
7739 (initFromContents:isQuestion:): Adjust call to process_dialog.
7740 Code formatting change.
7741 (timeout_handler:): Set timer_fired to YES.
7742 (runDialogAt:): Set timer_fired to NO.
7743 Handle click on close button as quit.
7744
7745 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
7746 Add window_closed and button_values. Add void as return value for
7747 add(Button|String|Split). addButton takes int instead of Lisp_Object.
7748 Add process_dialog as new member.
7749
eada0861 77502012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 7751
eada0861
GM
7752 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
7753 is not one of the heaps we manage. (Bug#12242)
7754
77552012-08-28 Glenn Morris <rgm@gnu.org>
7756
7757 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
7758
457294dd
MR
77592012-08-28 Martin Rudalics <rudalics@gmx.at>
7760
7761 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
7762 auto-buffer-name window parameter. Install revision of reverted
7763 fix.
457294dd 7764
4f2daf31
DA
77652012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7766
7767 Do not allow to set major mode for a dead buffer.
7768 * buffer.c (Fset_buffer_major_mode): Signal an error
7769 if the buffer is dead.
7770 (Fother_buffer, other_buffer_safely): Remove redundant
7771 nested declaration.
7772
66322887
DA
77732012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7774
7775 Always use set_buffer_if_live to restore original buffer at unwind.
7776 * buffer.h (record_unwind_current_buffer): New function.
7777 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
7778 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
7779 * undo.c, window.c: Adjust users.
7780 * buffer.c (set_buffer_if_live): Fix comment.
7781
a3d794a1
DA
77822012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
7783
7784 Fix usage of set_buffer_internal.
7785 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
7786 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
7787 * coding.c (decode_coding): Omit redundant test.
7788 * fileio.c (decide_coding_unwind): Likewise.
7789 * fns.c (secure_hash): Likewise.
7790 * insdel.c (modify_region): Likewise.
7791 * keyboard.c (command_loop_1): Likewise.
7792 * print.c (PRINTFINISH): Likewise.
7793 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
7794
59ea14cd
PE
77952012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7796
7797 * dispnew.c: Use bool for boolean.
7798 (frame_garbaged, display_completed, delayed_size_change)
7799 (fonts_changed_p, add_window_display_history)
7800 (add_frame_display_history, verify_row_hash)
7801 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
7802 (row_equal_p, realloc_glyph_pool)
7803 (allocate_matrices_for_frame_redisplay)
7804 (showing_window_margins_p)
7805 (adjust_frame_glyphs_for_frame_redisplay)
7806 (build_frame_matrix_from_leaf_window, make_current)
7807 (mirrored_line_dance, mirror_line_dance, update_frame)
7808 (update_window_tree, update_single_window)
7809 (check_current_matrix_flags, update_window, update_text_area)
7810 (update_window_line, set_window_update_flags, scrolling_window)
7811 (update_frame_1, scrolling, buffer_posn_from_coords)
7812 (do_pending_window_change, change_frame_size)
7813 (change_frame_size_1, sit_for):
7814 Use bool for boolean.
7815 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
7816 and remove last int (actually boolean) argument, which was always 0.
7817 All callers changed.
7818 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
7819 * dispextern.h (struct composition_it): Use bool for boolean.
7820 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7821 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7822 * dired.c (file_name_completion):
7823 Use bool for boolean. (This was missed in an earlier change.)
7824
95072a94
MR
78252012-08-27 Martin Rudalics <rudalics@gmx.at>
7826
7827 * window.c (Fset_window_configuration): Revert first part of
7828 last change.
7829
0f19feff
JD
78302012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7831
7832 * nsterm.h (NSPanel): New class variable dialog_return.
7833
3a880af4
SM
7834 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7835 Initialize dialog_return.
0f19feff
JD
7836 (windowShouldClose:): Use stop instead of stopModalWithCode.
7837 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7838 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7839 event.
7840 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7841 modal loop returns.
7842
f10fe38f
PE
78432012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7844
de1339b0
PE
7845 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7846 * composite.c (find_composition, composition_gstring_p)
7847 (composition_reseat_it, find_automatic_composition):
7848 * data.c (let_shadows_buffer_binding_p)
7849 (let_shadows_global_binding_p, set_internal, make_blv)
7850 (Fmake_variable_buffer_local, Fmake_local_variable)
7851 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7852 (cons_to_signed, arith_driver):
7853 * dbusbind.c (xd_in_read_queued_messages):
7854 * dired.c (directory_files_internal, file_name_completion):
7855 Use bool for booleans.
7856 * dired.c (file_name_completion):
7857 * process.h (fd_callback):
7858 Omit int (actually boolean) argument. It wasn't being used.
7859 All uses changed.
7860 * composite.h, lisp.h: Reflect above API changes.
7861
f10fe38f
PE
7862 * cmds.c, coding.c: Use bool for booleans.
7863 * cmds.c (move_point, Fself_insert_command):
7864 * coding.h (struct composition status, struct coding_system):
7865 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7866 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7867 (emacs_mule_char, decode_coding_emacs_mule)
7868 (encode_coding_emacs_mule, detect_coding_iso_2022)
7869 (decode_coding_iso_2022, encode_invocation_designation)
7870 (encode_designation_at_bol, encode_coding_iso_2022)
7871 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7872 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7873 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7874 (encode_coding_raw_text, detect_coding_charset)
7875 (decode_coding_charset, encode_coding_charset, detect_eol)
7876 (detect_coding, get_translation_table, produce_chars)
7877 (consume_chars, reused_workbuf_in_use)
7878 (make_conversion_work_buffer, code_conversion_save)
7879 (decode_coding_object, encode_coding_object)
7880 (detect_coding_system, char_encodable_p)
7881 (Funencodable_char_position, code_convert_region)
7882 (code_convert_string, code_convert_string_norecord)
7883 (Fset_coding_system_priority):
7884 * fileio.c (Finsert_file_contents):
7885 Use bool for booleans.
7886 * coding.h, lisp.h: Reflect above API changes.
7887 * coding.c: Remove unnecessary static function decls.
7888 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7889 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7890 not a boolean 'int', since callers never look at the return value.
7891 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7892 * coding.h (decoding_buffer_size, encoding_buffer_size)
7893 (emacs_mule_string_char): Remove unused extern decls.
7894 (struct iso_2022_spec, struct coding_system):
7895 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7896 (struct emacs_mule_spec): Remove unused field 'full_support'.
7897 All initializations removed.
7898 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7899
5474c384
DA
79002012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7901
f10fe38f 7902 Fix spare memory change (Bug#12286).
5474c384
DA
7903 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7904 (valid_lisp_object_p): Likewise.
7905
c4b6914d
MR
79062012-08-27 Martin Rudalics <rudalics@gmx.at>
7907
7908 * window.c (Fset_window_configuration): Record any window's old
7909 buffer if it's replaced (see Bug#8789). If the new current
7910 buffer doesn't appear in the selected window, go to its old
7911 point (Bug#12208).
7912
35aaa1ea
DA
79132012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7914
7915 Special MEM_TYPE_SPARE to denote reserved memory.
7916 * alloc.c (enum mem_type): New memory type.
7917 (refill_memory_reserve): Use new type for spare memory.
7918 This prevents live_cons_p and live_string_p from incorrect
7919 detection of uninitialized objects from spare memory as live.
7920
6af64513
PE
79212012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7922
8b2e00a3
PE
7923 Spelling fixes.
7924 * Makefile.in (.PHONY): versioclean -> versionclean.
7925
b52d6985
PE
7926 Remove unused external symbols.
7927 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7928 * window.c (Qwindow_valid_p, decode_valid_window):
7929 Now static, not extern.
7930 * data.c (Qinterval): Remove; unused.
7931 (syms_of_data): Do not define 'interval'.
7932 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7933 * window.h (decode_valid_window):
7934 Remove decls.
7935
d5172d4f
PE
7936 * character.c, charset.c, chartab.c: Use bool for booleans.
7937 * character.c (lisp_string_width, string_count_byte8)
7938 (string_escape_byte8):
7939 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7940 (load_charset_map_from_file, map_charset_chars)
7941 (Fdefine_charset_internal, define_charset_internal)
7942 (Fdeclare_equiv_charset, find_charsets_in_text)
7943 (Ffind_charset_region, char_charset, Fiso_charset):
7944 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7945 (sub_char_table_set, sub_char_table_set_range)
7946 (char_table_set_range, optimize_sub_char_table)
7947 (map_sub_char_table):
7948 Use bool for boolean.
7949 * character.c (str_to_unibyte): Omit last boolean argument; it was
7950 always 0. All callers changed.
7951 * character.h, charset.h: Adjust to match previous changes.
7952 * character.h (char_printable_p): Remove decl of nonexistent function.
7953 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7954 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7955 are all boolean, so make them single-bit bitfields.
7956
6af64513
PE
7957 * lisp.h (ASET): Remove attempt to detect side effects.
7958 It was meant to be temporary and it often doesn't work,
7959 because when IDX has side effects the behavior of IDX==IDX
7960 is undefined. See Stefan Monnier in
7961 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7962
e1f29348
BR
79632012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7964
7965 * lisp.h (functionp): New function (extracted from Ffunctionp).
7966 (FUNCTIONP): Use it.
7967 * eval.c (Ffunctionp): Use it.
7968
17c05d74
PE
79692012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7970
0f46bc75
PE
7971 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7972 as that's faster and simpler than static storage. Don't bother
7973 with the g_main_context_query overhead if g_main_context_pending
7974 says no events are pending.
7975 (gfds, gfds_size): Remove these static vars.
7976 (xgselect_initialize): Remove; no longer needed.
7977 All uses and decls removed.
7978
ee4c0f69
PE
7979 * emacs.c (fatal_error_signal_hook): Remove.
7980 All uses removed. This leftover from old code was always 0.
7981
17c05d74
PE
7982 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7983 * casefiddle.c (casify_object, casify_region):
7984 * casetab.c (set_case_table):
7985 * category.c, category.h (word_boundary_p):
7986 * category.h (CHAR_HAS_CATEGORY):
7987 Use bool for booleans, instead of int.
7988
391ceac5
EZ
79892012-08-25 Eli Zaretskii <eliz@gnu.org>
7990
7991 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7992
2f221583
PE
79932012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7994
f4a681b0
PE
7995 On assertion failure, print backtrace if available.
7996 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7997 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7998 * Makefile.in (LIB_EXECINFO): New macro.
7999 (LIBES): Use it.
8000
2f221583
PE
8001 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
8002 * bytecode.c (exec_byte_code):
8003 * callint.c (check_mark, Fcall_interactively):
8004 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
8005 (getenv_internal, sync_process_alive, call_process_exited):
8006 * lisp.h (USE_SAFE_ALLOCA):
8007 Use bool for booleans, instead of int.
8008 * lisp.h, process.h: Adjust prototypes to match above changes.
8009 * callint.c (Fcall_interactively): Don't assume the mark's
8010 offset fits in 'int'.
8011
37ef52bb
PE
80122012-08-24 Paul Eggert <eggert@cs.ucla.edu>
8013
8014 * buffer.c, buffer.h: Use bool for boolean.
8015 * buffer.c (reset_buffer_local_variables)
8016 (buffer_lisp_local_variables, Fset_buffer_modified_p)
8017 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
8018 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
8019 (overlay_touches_p, overlay_strings, Foverlay_put)
8020 (report_overlay_modification, call_overlay_mod_hooks):
8021 (mmap_enlarge, mmap_set_vars):
8022 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
8023 Use bool for booleans, instead of int.
8024 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
8025 since the 1-or-0 return value is always ignored anyway.
8026 (mmap_initialized_p):
8027 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
8028 * buffer.h, lisp.h: Adjust prototypes to match above changes.
8029
2cc21167
PE
80302012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8031
8032 * bidi.c: Use bool for boolean.
8033 This is a bit more readable, and makes the text segment of bidi.o
8034 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
8035 Presumably it's faster too.
8036 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
8037 Now bool.
8038 (bidi_cache_find_level_change, bidi_cache_iterator_state)
8039 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
8040 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
8041 (bidi_explicit_dir_char, bidi_level_of_next_char)
8042 (bidi_find_other_level_edge, bidi_move_to_visually_next):
8043 Use bool for booleans, instead of int.
8044 * dispextern.h (bidi_init_it, bidi_paragraph_init)
8045 (bidi_unshelve_cache): Adjust decls to match code.
8046
7db4ddf4
MR
80472012-08-23 Martin Rudalics <rudalics@gmx.at>
8048
8049 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
8050 argument.
8051
b1bb8011
PE
80522012-08-23 Paul Eggert <eggert@cs.ucla.edu>
8053
8054 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
8055 * atimer.h: Include <stdbool.h>.
8056
ff687885
DN
80572012-08-22 Dan Nicolaescu <dann@gnu.org>
8058
8059 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
8060 compile time tests instead of run time tests on systems that do
8061 not use them.
8062 (FRAME_MAC_P): Remove leftover from deleted code.
8063 * frame.c (syms_of_frame): Remove leftover from deleted code.
8064
4ce7a138
JD
80652012-08-22 Jan Djärv <jan.h.d@swipnet.se>
8066
8067 * nsterm.m (insertText:): Don't clear modifiers if code is space.
8068
d733ec6d
PE
80692012-08-22 Paul Eggert <eggert@cs.ucla.edu>
8070
8071 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
8072 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 8073 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
8074 (fontset_add): Return void, for FONTSET_ADD.
8075
d0d2d26f
PE
80762012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8077
fce31d69
PE
8078 * alloc.c: Use bool for booleans.
8079 (gc_in_progress, abort_on_gc)
8080 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8081 (dont_register_blocks) [GC_MALLOC_CHECK]:
8082 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
8083 (check_string_bytes, make_specified_string, memory_full)
8084 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
8085 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
8086 (mark_stack, valid_pointer_p, make_pure_string)
8087 (Fgarbage_collect, survives_gc_p, gc_sweep):
8088 Use bool for booleans, instead of int.
8089 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
8090 Remove unused local.
8091 * alloc.c (PURE_POINTER_P):
8092 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
8093 * editfns.c (Fformat):
8094 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
8095 (Fdo_auto_save):
8096 * fns.c (sweep_weak_table):
8097 * lisp.h (suppress_checking, push_message, survives_gc_p)
8098 (make_pure_string, gc_in_progress, abort_on_gc):
8099 * lread.c (readchar, read1):
8100 * print.c (Fprin1_to_string):
8101 * xdisp.c (push_message):
8102 Use bool for booleans affected directly or indirectly by
8103 alloc.c's changes.
8104
d0d2d26f
PE
8105 Make recently-introduced setters macros.
8106 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
8107 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
8108 (set_fontset_default, set_fontset_fallback): Rename from their
8109 upper-case counterparts, and make them functions rather than macros.
8110 This is more consistent with the other recently-introduced setters.
8111 These don't need to be inline, since they're local.
8112
d18e2bb6
JD
81132012-08-21 Jan Djärv <jan.h.d@swipnet.se>
8114
8115 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
8116 the loop (Bug#12247).
8117
1b9d9d16
PE
81182012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8119
8120 * lisp.h (vcopy): Use memcpy rather than our own loop.
8121 This fixes a performance regression introduced by the recent
8122 addition of vcopy. This means 'vcopy' will need to be modified
8123 for a copying collector, but that's OK. Also, tighten the
8124 checking in the assertion.
8125
b2f09701
EZ
81262012-08-21 Eli Zaretskii <eliz@gnu.org>
8127
8128 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
8129 components for RTL text (Bug#11860). Adjust X-OFFSET of each
8130 non-base glyph for the width of the base character, according to
e1f29348
BR
8131 what x_draw_composite_glyph_string_foreground expects.
8132 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
8133 expectations, to produce correct width of the composed character.
8134 Reverse the sign of the DU offset produced by ScriptPlace.
8135
9b994fed
PE
81362012-08-21 Paul Eggert <eggert@cs.ucla.edu>
8137
8138 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
8139
086ca913
DA
81402012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8141
8142 Avoid direct writes to contents member of struct Lisp_Vector.
8143 * lisp.h (vcopy): New function to copy data into vector.
8144 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
8145 * fns.c (Ffillarray): Use ASET.
8146 * keyboard.c (timer_check_2): Use AREF and ASET.
8147 (append_tool_bar_item, Frecent_keys): Use vcopy.
8148 * lread.c (read_vector): Use ASET.
8149 * msdos.c (Frecent_doskeys): Use vcopy.
8150 * xface.c (Finternal_copy_lisp_face): Use vcopy.
8151 (Finternal_merge_in_global_face): Use ASET and vcopy.
8152 * xfont.c (xfont_list_pattern): Likewise.
8153
5481664a
MR
81542012-08-21 Martin Rudalics <rudalics@gmx.at>
8155
8156 * window.c (Fwindow_point): For the selected window always return
8157 the position of its buffer's point.
8158 (Fset_window_point): For the selected window always go in its
8159 buffer to the specified position.
8160
6d470bdd
DA
81612012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
8162
8163 Setter macros for fontsets.
8164 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
8165 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
8166 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
8167 Adjust users.
8168
24564fe1
GM
81692012-08-20 Glenn Morris <rgm@gnu.org>
8170
8171 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8172 Don't assume that `ln -f' works.
8173
0a05a035
EZ
81742012-08-20 Eli Zaretskii <eliz@gnu.org>
8175
8176 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
8177 and later about non-assignments with no effect. See discussion at
8178 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
8179 details.
8180
e46f2325
DA
81812012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8182
8183 Inline setter functions for Lisp_Objects slots of struct specbinding.
8184 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
8185 Adjust users.
8186
734fbd86
MR
81872012-08-20 Martin Rudalics <rudalics@gmx.at>
8188
8189 * window.c (select_window): Always make selected window's buffer
8190 current.
8191
f1a95992
DA
81922012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8193
8194 Use AREF and ASET for docstrings of category tables.
8195 * category.h (CATEGORY_DOCSTRING): Use AREF.
8196 (SET_CATEGORY_DOCSTRING): Use ASET.
8197 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
8198
e83064be
DA
81992012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8200
8201 Inline setter functions for hash table members.
8202 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
8203 (set_hash_hash, set_hash_index): Rename with _slot suffix.
8204 (set_hash_key_and_value, set_hash_index, set_hash_next)
8205 (set_hash_hash): New functions.
8206 * charset.c, fns.c: Adjust users.
8207
4ce60d2e
DA
82082012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
8209
8210 Inline getter and setter functions for per-buffer values.
8211 * buffer.h (per_buffer_default, set_per_buffer_default)
8212 (per_buffer_value, set_per_buffer_value): New functions.
8213 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
8214 * buffer.c, data.c: Adjust users.
8215
c06c9690
JB
82162012-08-20 Juanma Barranquero <lekktu@gmail.com>
8217
8218 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
8219
32bd4250
PE
82202012-08-19 Paul Eggert <eggert@cs.ucla.edu>
8221
bad03192 8222 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
8223 as gnulib does this if the system doesn't.
8224 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
8225 Remove declaration. MS-Windows declares it on stdlib.h which is
8226 included by conf_post.h.
b69a6d22
PE
8227 * emacs.c (environ) [DOUG_LEA_MALLOC]:
8228 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
8229 * vm-limit.c: Include <unistd.h>, for 'environ'.
8230
22d7feb2
PE
8231 * unexaix.c, unexcoff.c: Include "mem-limits.h".
8232 (start_of_data): Remove decl; mem-limits.h provides it.
8233
32bd4250
PE
8234 * xdisp.c (handle_invisible_prop): Make it a bit faster
8235 and avoid a gcc -Wmaybe-uninitialized diagnostic.
8236
450809af
CY
82372012-08-19 Chong Yidong <cyd@gnu.org>
8238
8239 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
8240 ends (Bug#3874).
8241
9e677988
AS
82422012-08-19 Andreas Schwab <schwab@linux-m68k.org>
8243
6b1319ce
AS
8244 * .gdbinit: Use call instead of set when calling a function in the
8245 inferior.
8246
9e677988
AS
8247 * data.c (set_internal): Don't use set_blv_found.
8248 (Fkill_local_variable): Likewise.
8249
d7191076
AA
82502012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
8251
8252 * nsfont.m (ns_ascii_average_width): Ensure the string
8253 ascii_printable is initialized with a null-terminated character
8254 array. Otherwise, it can contain undesired extra characters.
8255
e757f1c6
PE
82562012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8257
8258 port new setting code to Sun C 5.8 2005/10/13
8259 * chartab.c, lisp.h (char_table_set, char_table_set_range):
8260 Return void, not Lisp_Object. Otherwise, the compiler
8261 complains about (A?B:C) where B is void and C is Lisp_Object
8262 when compiling CHAR_TABLE_SET, due to the recent change to
8263 the API of sub_char_table_set_contents.
8264
a999ce26
CY
82652012-08-18 Chong Yidong <cyd@gnu.org>
8266
8267 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
8268 for the string case (Bug#3874).
8269
3f22b86f
PE
82702012-08-18 Paul Eggert <eggert@cs.ucla.edu>
8271
39eb03f1
PE
8272 * buffer.h (BSET): Remove (Bug#12215).
8273 Replace all uses with calls to new setter functions.
8274 (bset_bidi_paragraph_direction, bset_case_canon_table)
8275 (bset_case_eqv_table, bset_directory, bset_display_count)
8276 (bset_display_time, bset_downcase_table)
8277 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
8278 (bset_last_selected_window, bset_local_var_alist)
8279 (bset_mark_active, bset_point_before_scroll, bset_read_only)
8280 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
8281 (bset_width_table):
8282 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
8283 (bset_auto_fill_function, bset_auto_save_file_format)
8284 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
8285 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
8286 (bset_cache_long_line_scans, bset_case_fold_search)
8287 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
8288 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
8289 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
8290 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
8291 (bset_header_line_format, bset_indicate_buffer_boundaries)
8292 (bset_indicate_empty_lines, bset_invisibility_spec)
8293 (bset_left_fringe_width, bset_major_mode, bset_mark)
8294 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
8295 (bset_name, bset_overwrite_mode, bset_pt_marker)
8296 (bset_right_fringe_width, bset_save_length)
8297 (bset_scroll_bar_width, bset_scroll_down_aggressively)
8298 (bset_scroll_up_aggressively, bset_selective_display)
8299 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
8300 (bset_word_wrap, bset_zv_marker):
8301 * category.c (bset_category_table):
8302 * syntax.c (bset_syntax_table):
8303 New setter functions.
8304
6a09a33b
PE
8305 * process.h (PSET): Remove (Bug#12215).
8306 Replace all uses with calls to new setter functions.
8307 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8308 (PROCESS_INLINE): New macro.
8309 (pset_childp): New setter function.
8310 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
8311 * process.c (PROCESS_INLINE):
8312 Define to EXTERN_INLINE, so that the corresponding functions
8313 are compiled into code.
8314 (pset_buffer, pset_command, pset_decode_coding_system)
8315 (pset_decoding_buf, pset_encode_coding_system)
8316 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
8317 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
8318 (pset_type, pset_write_queue): New setter functions.
8319
e8c17b81
PE
8320 * window.h (WSET): Remove (Bug#12215).
8321 Replace all uses with calls to new setter functions.
8322 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8323 (WINDOW_INLINE): New macro.
8324 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
8325 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
8326 (wset_total_lines, wset_vertical_scroll_bar)
8327 (wset_window_end_pos, wset_window_end_valid)
8328 (wset_window_end_vpos): New setter functions.
8329 * window.c (WINDOW_INLINE):
8330 Define to EXTERN_INLINE, so that the corresponding functions
8331 are compiled into code.
8332 (wset_combination_limit, wset_dedicated, wset_display_table)
8333 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
8334 (wset_new_normal, wset_new_total, wset_next_buffers)
8335 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
8336 (wset_prev_buffers, wset_right_fringe_width)
8337 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
8338 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
8339 (wset_window_parameters):
8340 * xdisp.c (wset_base_line_number, wset_base_line_pos)
8341 (wset_column_number_displayed, wset_region_showing):
8342 New setter functions.
8343
3f22b86f
PE
8344 * termhooks.h (TSET): Remove (Bug#12215).
8345 Replace all uses with calls to new setter functions.
8346 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8347 (TERMHOOKS_INLINE): New macro.
8348 (tset_charset_list, tset_selection_alist): New setter functions.
8349 * terminal.c (TERMHOOKS_INLINE):
8350 Define to EXTERN_INLINE, so that the corresponding functions
8351 are compiled into code.
8352 (tset_param_alist): New setter function.
8353
742af32f
PE
83542012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8355
15dbb4d6
PE
8356 * keyboard.h (KSET): Remove (Bug#12215).
8357 Replace all uses with calls to new setter functions.
8358 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8359 (KEYBOARD_INLINE): New macro.
8360 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
8361 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
8362 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
8363 New setter functions.
8364 * keyboard.c (KEYBOARD_INLINE):
8365 Define to EXTERN_INLINE, so that the corresponding functions
8366 are compiled into code.
8367 (kset_echo_string, kset_kbd_queue)
8368 (kset_keyboard_translate_table, kset_last_prefix_arg)
8369 (kset_last_repeatable_command, kset_local_function_key_map)
8370 (kset_overriding_terminal_local_map, kset_real_last_command)
8371 (kset_system_key_syms): New setter functions.
8372
f00af5b1
PE
8373 * frame.h (FSET): Remove (Bug#12215).
8374 Replace all uses with calls to new setter functions.
8375 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8376 (FRAME_INLINE): New macro.
8377 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
8378 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
8379 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
8380 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
8381 (fset_param_alist, fset_root_window, fset_scroll_bars)
8382 (fset_selected_window, fset_title, fset_tool_bar_items)
8383 (fset_tool_bar_position, fset_tool_bar_window): New functions.
8384 * frame.c (FRAME_INLINE):
8385 Define to EXTERN_INLINE, so that the corresponding functions
8386 are compiled into code.
8387 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
8388
0c94c8d6
PE
8389 A few more naming-convention fixes for getters and setters.
8390 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
8391 and rename from buffer_overlays_set_before.
8392 (set_buffer_overlays_after): Move here from buffer.h, and rename
8393 from buffer_overlays_set_after.
8394 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
8395 All uses changed.
8396 (set_buffer_intervals): Rename from buffer_set_intervals.
8397 * intervals.c (set_interval_object): Move here from intervals.h,
8398 and rename from interval_set_object.
8399 (set_interval_left): Move here from intervals.h, and rename from
8400 interval_set_left.
8401 (set_interval_right): Move here from intervals.h, and rename from
8402 interval_set_right.
8403 (copy_interval_parent): Move here from intervals.h, and rename from
8404 interval_copy_parent.
8405 * intervals.h (set_interval_parent): Rename from interval_set_parent.
8406 (set_interval_plist): Rename from interval_set_plist.
8407 Return void, not Lisp_Object, since no caller uses the result.
8408 * lisp.h (string_intervals): Rename from string_get_intervals.
8409 (set_string_intervals): Rename from string_set_intervals.
8410
34dabdb7
PE
8411 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
8412 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 8413 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
8414 All uses changed. See the end of
8415 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
8416
742af32f
PE
8417 * lisp.h (CSET): Remove (Bug#12215).
8418 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
8419 (set_char_table_purpose): New functions,
8420 replacing CSET. All uses changed. For example, replace
8421 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 8422 "set_char_table_parent (char_table, parent);".
742af32f
PE
8423 The old version was confusing because it used the same name
8424 'parent' for two different things.
8425
a04e2c62
DA
84262012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8427
8428 Functions to get and set Lisp_Object fields of buffer-local variables.
8429 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
8430 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
8431 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
8432 * data.c, eval.c, frame.c: Adjust users.
8433
383dcbf9
CY
84342012-08-17 Chong Yidong <cyd@gnu.org>
8435
8436 * xfaces.c (merge_face_vectors): If the target font specfies a
8437 font spec, make the font's attributes take precedence over
8438 directly-specified attributes.
8439 (merge_face_ref): Recognize :font.
8440
44386687
DA
84412012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
8442
8443 Do not use memcpy for copying intervals.
8444 * intervals.c (reproduce_interval): New function.
8445 (reproduce_tree, reproduce_tree_obj): Use it.
8446 (reproduce_tree_obj): Remove prototype.
8447
927c7216
PE
84482012-08-17 Paul Eggert <eggert@cs.ucla.edu>
8449
8450 * lisp.h (duration_to_sec_usec): Remove unused decl.
8451
93044f7b
AA
84522012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
8453
8454 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
8455 to an allocated instance of NSString, not to the class itself.
8456
9851e4a5
JB
84572012-08-17 Juanma Barranquero <lekktu@gmail.com>
8458
8459 * makefile.w32-in (C_CTYPE_H): New macro.
8460 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
8461 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
8462 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
8463
620f13b0
PE
84642012-08-16 Paul Eggert <eggert@cs.ucla.edu>
8465
8466 Use ASCII tests for character types.
8467 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
8468 * xfns.c, xterm.c:
8469 Don't include <ctype.h>; was not needed.
8470 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
8471 * sysdep.c, xfaces.c:
8472 Include <c-ctype.h> instead of <ctype.h>.
8473 * nsterm.m: Include <c-ctype.h>.
8474 * charset.c (read_hex):
8475 * doc.c (Fsnarf_documentation):
8476 * fileio.c (IS_DRIVE) [WINDOWSNT]:
8477 (DRIVE_LETTER) [DOS_NT]:
8478 (Ffile_name_directory, Fexpand_file_name)
8479 (Fsubstitute_in_file_name):
8480 * font.c (font_parse_xlfd, font_parse_fcname):
8481 * frame.c (x_set_font_backend):
8482 * gtkutil.c (xg_get_font):
8483 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
8484 * nsimage.m (hexchar):
8485 * nsterm.m (ns_xlfd_to_fontname):
8486 * sysdep.c (system_process_attributes):
8487 * xfaces.c (hash_string_case_insensitive):
8488 Use C-locale tests instead of locale-specific tests for character
8489 types, since we want the ASCII interpretation here, not the
8490 interpretation suitable for whatever happens to be the current locale.
8491
52162052
MR
84922012-08-16 Martin Rudalics <rudalics@gmx.at>
8493
8494 Consistently check windows for validity/liveness
8495 (Bug#11984, Bug#12025, Bug#12026).
8496 * lisp.h (CHECK_VALID_WINDOW): New macro.
8497 * window.c (decode_window): Rename to decode_live_window.
8498 (decode_valid_window, Fwindow_valid_p): New functions.
8499 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
8500 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
8501 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
8502 (Fwindow_prev_sibling, Fwindow_combination_limit)
8503 (Fset_window_combination_limit, Fwindow_use_time)
8504 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
8505 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
8506 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
8507 (Fwindow_hscroll, Fset_window_hscroll)
8508 (Fwindow_redisplay_end_trigger)
8509 (Fset_window_redisplay_end_trigger, Fwindow_edges)
8510 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
8511 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
8512 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
8513 (Fwindow_end, Fset_window_point, Fset_window_start)
8514 (Fpos_visible_in_window_p, Fwindow_line_height)
8515 (Fwindow_dedicated_p, Fset_window_dedicated_p)
8516 (Fwindow_prev_buffers, Fset_window_prev_buffers)
8517 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
8518 (Fset_window_parameter, Fwindow_display_table)
8519 (Fset_window_display_table, Fdelete_other_windows_internal)
8520 (Fset_window_buffer, Fset_window_new_total)
8521 (Fset_window_new_normal, Fdelete_window_internal)
8522 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
8523 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
8524 (Fwindow_scroll_bars): Check whether argument window is a valid or
8525 live window. Update doc-strings.
8526 (syms_of_window): New symbol Qwindow_valid_p.
8527 * keyboard.c (Fposn_at_x_y): Check whether argument
8528 frame_or_window denotes a valid window.
8529
2751c80f
DA
85302012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8531
8532 Fix previous char table change.
8533 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
8534 * chartab.c (optimize_sub_char_table): Likewise.
8535
032a42c8
CY
85362012-08-16 Chong Yidong <cyd@gnu.org>
8537
a2d19368
CY
8538 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
8539
032a42c8
CY
8540 * xfont.c (xfont_open):
8541 * xftfont.c (xftfont_open): Set the font's max_width field.
8542
8543 * nsfont.m (nsfont_open): Similar to the Xft backend, set
8544 min_width to space_width and average_width to the average over
8545 printable ASCII characters.
8546 (ns_char_width): Code cleanup.
8547 (ns_ascii_average_width): New utility function.
8548
8549 * font.h (struct font): Update comments.
8550
a098c930
DA
85512012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
8552
032a42c8 8553 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
8554 * lisp.h (CSET): New macro.
8555 (char_table_set_extras, char_table_set_contents)
8556 (sub_char_table_set_contents): New function.
8557 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
8558 * syntax.c: Adjust users.
8559
8be3a09c
SM
85602012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
8561
8562 * eval.c (eval_sub): Bind lexical-binding.
8563 * lread.c (Qlexical_binding): Make non-static.
8564
ac4845a6
JD
85652012-08-15 Jan Djärv <jan.h.d@swipnet.se>
8566
ddee6515
JD
8567 * nsmenu.m (popupSession): Remove.
8568 (pop_down_menu): Remove endModalSession.
8569 (timeout_handler:): New method.
8570 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
8571 Call runModalForWindow. Check timer_fired when it returns.
8572 If not set, cancel timer and break out of loop.
8573 Otherwise loop again, with a new timeout.
8574
8575 * nsterm.m: Include fcntl.h if present.
8576 (fd_entry, t_readfds, inNsSelect): Remove.
8577 (select_writefds, select_valid, select_timeout, selfds)
8578 (select_mutex, apploopnr): Add.
8579 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
8580 Otherwise call kbd_buffer_store_event.
8581 (ns_send_appdefined): Remove release of fd_entry.
8582 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
8583 Increment and decrement apploopnr.
8584 (ns_select): If no file descriptors, just do a NSTimer.
8585 Otherwise copy read/write masks and start select thread (fd_handler).
8586 Start main loop and wait for application defined event.
8587 Inform select thread to stop selecting after main loop is exited.
8588 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 8589 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
8590 (fd_handler:): Loop forever, wait for info from the main thread
8591 to either start or stop selecting. When select returns, send
8592 and appdefined event.
8593 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
8594 If not call kbd_buffer_store_event.
8595
8596 * nsterm.h (EmacsApp): fd_handler takes id argument.
8597 (EmacsDialogPanel): Add timer_fired and timeout_handler.
8598
ac4845a6
JD
8599 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
8600
eb424fe3
EZ
86012012-08-15 Eli Zaretskii <eliz@gnu.org>
8602
8603 * region-cache.c (move_cache_gap): Update gap_len using the actual
8604 growth of the boundaries array. Do not change cache_len.
8605 (Bug#12196)
8606
4e6a86c6
DA
86072012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8608
8609 Generalize and cleanup font subsystem checks.
8610 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
8611 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
8612 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 8613
5bf192ca
DA
86142012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
8615
8616 * gtkutil.c (xg_get_font): Use pango_units_to_double.
8617
f2045622
CY
86182012-08-15 Chong Yidong <cyd@gnu.org>
8619
8be3a09c
SM
8620 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
8621 When using the new font chooser, use gtk_font_chooser_get_font_desc to
8622 extract the font descriptor instead of just the font name.
8623 In that case, return a font spec instead of a string.
f2045622
CY
8624 (x_last_font_name): Move to this file from xfns.c.
8625
8626 * xfns.c (Fx_select_font): The return value can also be a font
8627 spec. Move x_last_font_name management to gtkutil.c.
8628
8629 * xfaces.c: Make font weight and style symbols non-static.
8630
7f6feb56
SM
86312012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
8632
8633 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
8634 (bug#12117).
8635
fecbd8ff
SM
86362012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
8637
8638 * alloc.c (Fgarbage_collect): Use plural form consistently.
8639
9b8d5165
EZ
86402012-08-14 Eli Zaretskii <eliz@gnu.org>
8641
8642 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
8643 iteration through the command loop. Fixes a problem whereby mouse
8644 movements are ignored until the first mouse click.
8645
f5d9e83a
PE
86462012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8647
8648 Use bool, not int, for Lisp booleans.
8649 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
8650 makes Emacs a bit smaller and presumably a bit faster.
8651 * lisp.h: Include <stdbool.h>.
8652 (struct Lisp_Boolfwd, defvar_bool):
8653 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
8654 * regex.c [!emacs]: Include <stdbool.h>.
8655 (false, true): Remove; <stdbool.h> does this for us now.
8656
55802e4a
CY
86572012-08-14 Chong Yidong <cyd@gnu.org>
8658
4abcdac8
CY
8659 * character.c (Fcharacterp): Doc fix (Bug#12076).
8660
8661 * data.c (Findirect_variable): Doc fix (Bug#11040).
8662
55802e4a
CY
8663 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
8664
8665 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 8666 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 8667
8e99d072
BR
86682012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
8669
8670 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
8671 (bug#12022).
8672
08908aca
MR
86732012-08-14 Martin Rudalics <rudalics@gmx.at>
8674
8675 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
8676 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
8677 * minibuf.c (choose_minibuf_frame, read_minibuf):
8678 * w32fns.c (x_create_tip_frame):
8679 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
8680 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
8681
56120d6f
PE
86822012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8683
8684 * intervals.c (offset_intervals): Remove obsolete comment.
8685
67b77c0b
AS
86862012-08-14 Andreas Schwab <schwab@linux-m68k.org>
8687
8688 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
8689
f48b82fd
GR
86902012-08-14 Gergely Risko <gergely@risko.hu>
8691
8692 * coding.c (decode_coding): Record buffer modification before
8693 disabling undo_list (Bug#11773).
8694
fd318b54
DA
86952012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8696
8697 Revert and cleanup some recent overlay changes.
8698 * buffer.h (enum overlay_type): Remove.
8699 (buffer_get_overlays, buffer_set_overlays): Likewise.
8700 (buffer_set_overlays_before, buffer_set_overlays_after):
8701 New function. Adjust users.
8702 (unchain_both): Add eassert.
8703
41a62dd9
DA
87042012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
8705
8706 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
8707
5884c324
PE
87082012-08-14 Paul Eggert <eggert@cs.ucla.edu>
8709
8710 * gtkutil.c (xg_mark_data): Don't assume C99.
8711
ca06f160
JD
87122012-08-13 Jan Djärv <jan.h.d@swipnet.se>
8713
8714 * gtkutil.c (xg_frame_tb_info): New struct.
8715 (TB_INFO_KEY): New define.
8716 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
8717 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
8718 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
8719 if not present.
8720 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 8721 is up to date. Otherwise store new data.
ca06f160
JD
8722 (free_frame_tool_bar): Free xg_frame_tb_info if present.
8723
7864a3f7
DA
87242012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8725
8726 Use KSET for write access to Lisp_Object members of struct kboard.
8727 * keyboard.h (KSET): New macro.
8728 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
8729 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
8730 * xterm.c: Adjust users.
8731
4c31be61
DA
87322012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
8733
8734 Use BSET for write access to Lisp_Object members of struct buffer.
8735 * buffer.h (BSET): New macro.
8736 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
8737 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
8738 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
8739 * window.c, xdisp.c, xfns.c: Adjust users.
8740
14ae4239
BT
87412012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
8742
8743 * lread.c (syms_of_lread): Initialize Vlexical_binding.
8744
32bcadb4
JD
87452012-08-11 Jan Djärv <jan.h.d@swipnet.se>
8746
3d29b2ce 8747 * nsterm.m (not_in_argv): New function.
fc0c31f8 8748 (application:openFile, application:openTempFile:):
3d29b2ce
JD
8749 (application:openFileWithoutUI:, application:openFiles:): Open file
8750 if not_in_argv returns non-zero (bug#12171).
8751
32bcadb4 8752 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
8753 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
8754 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
8755 (xg_get_font_name): Use those functions/macros here.
8756 Reported by Frans Oilinki <moilinki@gmail.com>.
8757
9ff9402d 87582012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
8759
8760 * unexmacosx.c (copy_data_segment): Copy initialized data in
8761 statically linked libraries from input file rather than memory.
8762
db74a5fc
YM
8763 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
8764 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
8765 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
8766
25e65510
GM
87672012-08-10 Glenn Morris <rgm@gnu.org>
8768
8769 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
8770 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
8771
7961135c
DA
87722012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8773
8774 Fix last change to allow compilation with low optimization levels.
8775 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
8776 Reported by Jan Djärv <jan.h.d@swipnet.se>.
8777
42b3a444
DA
87782012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8779
8780 Use common inline syntax in intervals.h.
8781 * intervals.h (INTERVALS_INLINE): New macro.
8782 Change all users from LISP_INLINE.
8783
9fb0c957
DA
87842012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8785
8786 Define Qnone once for all platforms.
8787 * frame.c (Qnone): Define here.
8788 (syms_of_frame): DEFSYM it.
8789 * lisp.h (Qnone): New declaration.
8790 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
8791 * xfns.c: Remove duplication. Adjust users.
8792
65e8ee52
DA
87932012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
8794
8795 Remove unused macros from intervals.h.
8796 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
8797 * intervals.c: Adjust comment.
8798
9b855fd6
EZ
87992012-08-10 Eli Zaretskii <eliz@gnu.org>
8800
8801 * w32fns.c <w32_unicode_gui>: New static variable.
8802 (globals_of_w32fns): Initialize it according to os_subtype.
8803 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
8804 testing os_subtype.
8805
39cb9e56 88062012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
8807 Eli Zaretskii <eliz@gnu.org>
8808
8809 Fix bug #10299 with Unicode characters sent by customized
8810 keyboards created by MSKLC.
8811 * w32fns.c (INIT_WINDOW_CLASS): New macro.
8812 (w32_init_class): Use it to initialize the Emacs class with either
8813 ANSI or Unicode API calls.
8814 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
8815 later.
8816 (w32_wnd_proc): If the character code sent by WM_CHAR or
8817 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
8818 original message. Call DefWindowProcW on NT and later.
8819
9374581a
GM
88202012-08-10 Glenn Morris <rgm@gnu.org>
8821
4b94e8cf
GM
8822 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8823
9374581a
GM
8824 * lisp.h (DIRECTORY_SEP): Let configure set it.
8825
a2752828
DA
88262012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8827
8828 Use TSET for write access to Lisp_Object slots of struct terminal.
8829 * termhooks.h (TSET): New macro.
8830 * coding.c, terminal.c, xselect.c: Adjust users.
8831
cc92c454
SM
88322012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8833
8834 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8835 the failing expression, include them in the error message.
8836 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8837 * lisp.h (internal_condition_case_n): Update declaration.
8838
4cb3e6b3
DA
88392012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8840
8841 Inline functions to examine and change buffer overlays.
8842 * buffer.c (unchain_both): New function.
8843 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8844 (buffer_has_overlays): New function.
8845 (enum overlay_type): New enum.
8846 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8847 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8848
8707c1e5
DA
88492012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8850
8851 Inline functions to examine and change buffer intervals.
8852 * alloc.c (mark_interval_tree): Remove.
8853 (MARK_INTERVAL_TREE): Simplify.
8854 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8855 * intervals.c (buffer_balance_intervals): New function.
8856 (graft_intervals_into_buffer): Adjust indentation.
8857 (set_intervals_multibyte): Simplify.
8858 * buffer.h (BUF_INTERVALS): Remove.
8859 (buffer_get_intervals, buffer_set_intervals): New function.
8860 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8861 * intervals.c, textprop.c: Adjust users.
8862
ad8c997f
DA
88632012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8864
8865 Inline functions to examine and change string intervals.
8866 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8867 (string_get_intervals, string_set_intervals): New function.
8868 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8869 * lread.c, print.c, textprop.c: Adjust users.
8870
32ac3a6b
GM
88712012-08-08 Glenn Morris <rgm@gnu.org>
8872
8873 * lisp.mk (lisp): Remove language/persian.elc.
8874
77c7bcb1
DA
88752012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8876
8877 Cleanup intervals.
8878 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8879 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
8880 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8881 Adjust comment. Move under #if 0.
77c7bcb1
DA
8882 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8883 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8884
9c08a8d4
DA
88852012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8886
8887 Check total length of intervals with eassert.
8888 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8889 * intervals.c: Change all users to eassert.
8890
26d16b35
EZ
88912012-08-07 Eli Zaretskii <eliz@gnu.org>
8892
14ae4239
BT
8893 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8894 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
8895 INTERNAL_FIELD in Lisp_Cons.
8896
c644523b
DA
88972012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8898
8899 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8900 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8901 name since all xname users are fixed long time ago. Do not
8902 use INTERNAL_FIELD.
8903 (set_symbol_name, set_symbol_function, set_symbol_plist):
8904 (set_symbol_next, set_overlay_plist): New function.
8905 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8906 (struct Lisp_Overlay): Likewise.
8907 (CVAR, MVAR, SVAR): Remove.
8908 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8909 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8910 * xterm.c: Adjust users.
8911 * .gdbinit: Change to use name field of struct Lisp_Symbol
8912 where appropriate.
8913
6a3d20cc
DA
89142012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8915
8916 Basic functions to set Lisp_Object and pointer slots of intervals.
8917 * intervals.h (interval_set_parent, interval_set_object):
8918 (interval_set_left, interval_set_right, interval_set_plist):
8919 (interval_copy_parent): New function.
8920 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
8921 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8922 Adjust indentation.
6a3d20cc
DA
8923 (INTERVAL_SIZE): Remove. Adjust users.
8924 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8925
4d2b044c
DA
89262012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8927
8928 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8929 * process.h (PGET): Remove.
8930 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8931 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8932
d3d50620
DA
89332012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8934
8935 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8936 * window.h (WGET): Remove.
8937 (struct window): Do not use INTERNAL_FIELD.
8938 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8939 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8940 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8941 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8942 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8943 Adjust users.
8944
d10a51dc
CY
89452012-08-07 Chong Yidong <cyd@gnu.org>
8946
8947 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8948 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8949 (Fdelete_window_internal): Signal an error if the window is not on
8950 a live frame (Bug#12025).
8951
e69b0960
DA
89522012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8953
8954 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8955 * frame.h (FGET): Remove.
8956 (struct frame): Do not use INTERNAL_FIELD.
8957 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8958 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8959 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8960 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8961
25a20a3a
JB
89622012-08-06 Juanma Barranquero <lekktu@gmail.com>
8963
8964 * w32.c: Silence compiler warnings.
8965 (map_w32_filename): Remove unused variable `is_fat'.
8966 (chase_symlinks): Add parentheses around expression.
8967
1c6f11f4
GM
89682012-08-06 Glenn Morris <rgm@gnu.org>
8969
1db4583a
GM
8970 * sysdep.c: Respect BROKEN_GETWD.
8971
1c6f11f4
GM
8972 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8973 Let configure handle it.
8974 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8975
2b90362b
DA
89762012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8977
8978 Use GCALIGNMENT where appropriate.
8979 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8980 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8981 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8982
5f50daf2
EZ
89832012-08-06 Eli Zaretskii <eliz@gnu.org>
8984
14ae4239
BT
8985 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8986 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 8987
cbcc7007
SM
89882012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8989
8990 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8991 that should be sufficient for everyone.
8992
4d365fa4
JD
89932012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8994
8995 * keyboard.c (timer_check_2): Add break so timer_check returns next
8996 timeout.
8997
dd86bd82
DA
89982012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8999
9000 Fix Windows build errors introduced after converting to WGET and WSET.
9001 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
9002 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9003
054e1668
JD
90042012-08-06 Jan Djärv <jan.h.d@swipnet.se>
9005
9006 * nsterm.m (ns_frame_rehighlight): Use FSET.
9007
9008 * nsmenu.m (ns_update_menubar): Use FSET.
9009
21238f11
DA
90102012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9011
9012 Separate read and write access to Lisp_Object slots of Lisp_Process.
9013 * process.h (PGET, PSET): New macros similar to AREF and ASET.
9014 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
9015
077288cf
DA
90162012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9017
9018 Separate read and write access to Lisp_Object slots of struct window.
9019 * window.h (WGET, WSET): New macros similar to AREF and ASET.
9020 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9021 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9022 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
9023 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
9024 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
9025 Adjust users.
9026
71688bd7
DA
90272012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9028
9029 Fix Windows build errors introduced after converting to FGET and FSET.
9030 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
9031 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
9032 (w32_judge_scroll_bars): Change to use FSET.
9033 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
9034
f99bac93
DA
90352012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9036
9037 Fix replacement typo.
9038 * window.c (replace_window): Set root_window instead of
9039 selected_window. This fixes a total window subsystem
9040 malfunction reported by Bastien Guerry <bzg@gnu.org>.
9041
8c2a0f2d
GM
90422012-08-06 Glenn Morris <rgm@gnu.org>
9043
9044 * lisp.mk (lisp): Add language/persian.elc.
9045
edd74c35
DA
90462012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
9047
9048 Separate read and write access to Lisp_Object slots of struct frame.
9049 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
9050 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
9051 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
9052 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
9053 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
9054
8671676c
AS
90552012-08-05 Andreas Schwab <schwab@linux-m68k.org>
9056
9057 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
9058
663e2b3f
DA
90592012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
9060
9061 Generalize common compile-time constants.
9062 * lisp.h (header_size, bool_header_size, word_size): Now here.
9063 (struct Lisp_Vector): Add comment.
9064 (struct Lisp_Bool_Vector): Move up to define handy constants.
9065 (VECSIZE, PSEUDOVECSIZE): Simplify.
9066 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
9067 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
9068 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
9069 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
9070 * xfont.c, xmenu.c: Use word_size where appropriate.
9071
d32e47af
LM
90722012-08-05 Lawrence Mitchell <wence@gmx.li>
9073
9074 * search.c (Freplace_match): Treat \? in the replacement text
9075 literally (Bug#8161).
9076
e5d9c0d1
CY
90772012-08-05 Chong Yidong <cyd@gnu.org>
9078
9079 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
9080 * frame.c (Vdelete_frame_functions):
9081 * emacs.c (Vkill_emacs_hook): Doc fix.
9082
8da0576b
EZ
90832012-08-04 Eli Zaretskii <eliz@gnu.org>
9084
9085 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
9086 --with-x-toolkit=no builds.
9087 Reported by Carsten Mattner <carstenmattner@gmail.com>.
9088
02676e5d
CY
90892012-08-04 Chong Yidong <cyd@gnu.org>
9090
9091 * syntax.c (Fmodify_syntax_entry): Doc fix.
9092
97147da9
EZ
90932012-08-04 Eli Zaretskii <eliz@gnu.org>
9094
76151e2c
EZ
9095 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
9096 * w32.c (init_environment): Change the default values of many
9097 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
9098 them into environment when they were not already defined.
9099 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 9100 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
9101 (check_windows_init_file): Now external, not static.
9102 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
9103 called when Vload_path is already set up.
9104
9105 * w32.h (check_windows_init_file): Add prototype.
9106
9107 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
9108 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
9109 compatibility with Posix platforms.
9110 (main): Move the call to check_windows_init_file to here from
9111 w32.c.
9112 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
9113 any, in the DEFALT argument into the root of the Emacs build or
9114 installation tree, as appropriate.
9115
9116 * callproc.c (init_callproc_1): Call decode_env_path instead of
9117 doing its equivalent by hand.
9118 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
9119 the code that sets Vexec_path run on MS-Windows.
9120
9121 * lread.c (init_lread): Add comments to #ifdef's.
9122
97147da9
EZ
9123 * msdos.c (dos_set_window_size, IT_update_begin)
9124 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
9125 instead of direct references.
9126
185ee146
PE
91272012-08-04 Paul Eggert <eggert@cs.ucla.edu>
9128
9129 Export DEFAULT_REHASH_* to GDB.
9130 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
9131 Now constants, not macros.
9132
8834c57a
PE
91332012-08-03 Paul Eggert <eggert@cs.ucla.edu>
9134
98c6f1e3
PE
9135 Remove unnecessary casts involving pointers.
9136 These casts are no longer needed now that we assume C89 or later,
9137 since they involve casting to or from void *.
9138 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
9139 (make_pure_float, make_pure_vector):
9140 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
9141 * macros.c (Fstart_kbd_macro):
9142 * menu.c (find_and_return_menu_selection):
9143 * minibuf.c (read_minibuf_noninteractive):
9144 * sysdep.c (closedir):
9145 * xdisp.c (x_produce_glyphs):
9146 * xfaces.c (compare_fonts_by_sort_order):
9147 * xfns.c (x_real_positions, select_visual):
9148 * xselect.c (x_stop_queuing_selection_requests)
9149 (x_get_window_property, x_get_window_property_as_lisp_data):
9150 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
9151 Remove unnecessary pointer casts.
9152 * alloc.c (record_xmalloc): New function.
9153 * lisp.h (record_xmalloc): New decl.
9154 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
9155 more like a function. This is because the pointer cast is not
9156 needed. All uses changed.
9157 * print.c (print_string, print_error_message): Avoid length recalc.
9158
8834c57a
PE
9159 Improve fix for macroexp crash with debugging (Bug#12118).
9160 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
9161 ARRAY_MARK_FLAG when checking subscripts, because ASET is
9162 not supposed to be invoked from the garbage collector.
9163 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
9164 (gc_aset): New function, which is like ASET but can be
9165 used in the garbage collector.
9166 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9167 (set_hash_index): Use it instead of ASET.
9168
6dad7178
EZ
91692012-08-03 Eli Zaretskii <eliz@gnu.org>
9170
9171 Support symlinks on latest versions of MS-Windows.
9172 * w32.c: Include winioctl.h and aclapi.h.
9173 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
9174 (revert_to_self): Forward declarations of static functions.
9175 <static BOOL g_b_init_get_security_info>:
9176 <g_b_init_create_symbolic_link>: New static flags.
9177 (globals_of_w32): Initialize them to zero.
9178 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
9179 (map_w32_filename): Improve commentary. Simplify switch.
9180 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
9181 headers (most versions of MinGW w32api don't).
9182 (get_security_info, create_symbolic_link)
9183 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
9184 New functions.
9185 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
9186 in the argument file name.
9187 (sys_access): Call unc_volume_file_attributes only if
9188 GetFileAttributes fails with network-related error codes.
9189 (sys_rename): Diagnose renaming of a symlink when the user doesn't
9190 have the required privileges.
14ae4239 9191 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
9192 get_file_security_desc.
9193 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
9194 with addition of handling of symlinks and support for 'lstat'.
9195 If possible, get file's attributes and security information by
6dad7178
EZ
9196 handle, not by name. Produce S_IFLNK bit for symlinks, when
9197 called from 'lstat'.
9198 (stat, lstat): New functions, call 'stat_worker'.
9199 (symlink, readlink, careadlinkat): Rewritten to create and resolve
9200 symlinks when the underlying filesystem supports them.
9201
f162bcc3
PE
92022012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9203
79ea6c20
PE
9204 Fix macroexp crash on Windows with debugging (Bug#12118).
9205 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
9206 checking subscripts; problem introduced with the recent
9207 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
9208 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
9209 since it's used in non-static inline functions now.
9210
c0ce93fd
PE
9211 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
9212 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 9213
f162bcc3
PE
9214 Use C99-style 'extern inline' if available.
9215 * buffer.h (BUFFER_INLINE):
9216 * category.h (CATEGORY_INLINE):
9217 * character.h (CHARACTER_INLINE):
9218 * charset.h (CHARSET_INLINE):
9219 * composite.h (COMPOSITE_INLINE):
9220 * dispextern.h (DISPEXTERN_INLINE):
9221 * lisp.h (LISP_INLINE):
9222 * systime.h (SYSTIME_INLINE):
9223 New macro, replacing 'static inline' in this header.
9224 * buffer.h, category.h, character.h, charset.h, composite.h:
9225 * dispextern.h, lisp.h, systime.h:
9226 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
9227 * alloc.c (LISP_INLINE):
9228 * buffer.c (BUFFER_INLINE):
9229 * category.c (CATEGORY_INLINE):
9230 * character.c (CHARACTER_INLINE):
9231 * charset.c (CHARSET_INLINE):
9232 * composite.c (COMPOSITE_INLINE):
9233 * dispnew.c (DISPEXTERN_INLINE):
9234 * sysdep.c (SYSTIME_INLINE):
9235 Define to EXTERN_INLINE, so that the corresponding functions
9236 are compiled into code.
9237 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
9238 (INLINE_HEADER_END): New macros.
9239 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
9240 since it's used in non-static inline functions now.
a8333d03 9241 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 9242
837b365b
GM
92432012-08-02 Glenn Morris <rgm@gnu.org>
9244
d66b744d
GM
9245 * s/: Remove empty directory.
9246
837b365b
GM
9247 * s/ms-w32.h: Move to ../nt/inc.
9248 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
9249 Update for new ms-w32.h location.
9250
13294f95
PE
92512012-08-02 Paul Eggert <eggert@cs.ucla.edu>
9252
9253 Port to Solaris 8.
9254 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
9255
90df0db3
GM
92562012-08-02 Glenn Morris <rgm@gnu.org>
9257
9258 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
9259 hard-coding the path separator.
9260
4939150c
PE
92612012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9262
9263 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
9264 This how ASET and AREF are supposed to work, and makes
9265 it easier to think about future improvements. See
9266 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
9267 * charset.h (set_charset_attr): New function.
9268 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
9269 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
9270 (aref_addr): New function. All uses of &AREF(...) changed.
9271 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
9272 (set_hash_index): New functions. All lvalue-style uses of
9273 HASH_KEY etc. changed.
9274 * keyboard.c (set_prop): New function. All lvalue-style uses
9275 of PROP changed.
9276
947b2afd
AA
92772012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
9278
9279 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
9280 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 9281 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
9282 * nsfns.m (ns_set_name_as_filename): Likewise.
9283 * nsmenu.m (ns_update_menubar): Likewise.
9284 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
9285
4f5d0325
EZ
92862012-08-01 Eli Zaretskii <eliz@gnu.org>
9287
2008beae
EZ
9288 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
9289 Adapt to latest changes in field names of the corresponding Lisp
288479f6 9290 objects.
2008beae 9291
4f5d0325
EZ
9292 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
9293
fe3cc771
GM
92942012-08-01 Glenn Morris <rgm@gnu.org>
9295
9296 * s/msdos.h: Remove file.
9297 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
9298 * Makefile.in (S_FILE): Remove.
9299 (config_h): Remove S_FILE.
9300
c90acc54
JB
93012012-08-01 Juanma Barranquero <lekktu@gmail.com>
9302
9303 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
9304 Remove; moved to nt/config.nt.
9305
d8a05828
DA
93062012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9307
9308 Use INTERNAL_FIELD for conses and overlays.
9309 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
9310 Remove obsolete comment.
9311 (MVAR): New macro.
9312 (struct Lisp_Overlay): Use INTERNAL_FIELD.
9313 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
9314
8271d590
DA
93152012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9316
9317 Use INTERNAL_FIELD for symbols.
9318 * lisp.h (SVAR): New macro. Adjust users.
9319 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
9320 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
9321
3193acd2
DA
93222012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9323
9324 Use INTERNAL_FIELD for processes.
9325 * process.h (PVAR): New macro. Adjust style.
9326 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
9327 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
9328
3a45383a
DA
93292012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
9330
9331 Use INTERNAL_FIELD for windows.
9332 * window.h (WVAR): New macro.
9333 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
9334 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
9335 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
9336 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
9337 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
9338 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9339
c1dbc63c
PE
93402012-08-01 Paul Eggert <eggert@cs.ucla.edu>
9341
9342 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
9343
5c0c0e8a
GM
93442012-08-01 Glenn Morris <rgm@gnu.org>
9345
9346 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
9347 Move to configure.ac.
9348
552a99b4
JB
93492012-08-01 Juanma Barranquero <lekktu@gmail.com>
9350
9351 * makefile.w32-in (CONFIG_H): Update dependencies.
9352 (CONF_POST_H): New macro.
9353
9354 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
9355
8d8e2dfe
GM
93562012-07-31 Glenn Morris <rgm@gnu.org>
9357
bc96620a
GM
9358 * Makefile.in (S_FILE): No longer set by configure.
9359
476b1b2d
GM
9360 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
9361 is available.
9362 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
9363
b2c7a106
GM
9364 * process.h (NULL_DEVICE):
9365 * emacs.c (SEPCHAR):
9366 * editfns.c (USER_FULL_NAME): Let configure set them.
9367
d53d062a
GM
9368 * s/README, s/template.h: Remove files.
9369
4515017f
GM
9370 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
9371
8d8e2dfe
GM
9372 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
9373 Move to configure.ac.
9374
5b20b3cc
EZ
93752012-07-31 Eli Zaretskii <eliz@gnu.org>
9376
1e0afd9a
EZ
9377 * .gdbinit (xframe): Adapt to introduction of FVAR and the
9378 resulting renaming of 'struct frame' members.
9379
5b20b3cc
EZ
9380 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
9381
9382 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
9383 after introduction of FVAR.
9384
f1310128
JD
93852012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9386
79e721e0
JD
9387 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
9388
9389 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
9390 instead of compositeToPoint.
9391 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
9392
8d7c7eed 9393 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 9394
e34f7f79
DA
93952012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9396
9397 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
9398 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 9399 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
9400 (BVAR): Change to use INTERNAL_FIELD.
9401 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
9402 (KVAR): Change to use INTERNAL_FIELD.
9403 * frame.h (FVAR): New macro.
9404 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
9405 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
9406 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
9407 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
9408 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
9409
c09bfb2f
DA
94102012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
9411
9412 Miscellaneous fixes for non-default X toolkits.
9413 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
9414 * xterm.c (x_frame_of_widget): Remove redundant prototype.
9415 Move under #ifdef USE_LUCID.
9416 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
9417 definition and usage to avoid warnings.
9418
14c114ae
JD
94192012-07-31 Jan Djärv <jan.h.d@swipnet.se>
9420
9421 * nsterm.m (openFiles): Fix previous checkin.
9422
3bd21e82
PE
94232012-07-31 Paul Eggert <eggert@cs.ucla.edu>
9424
9425 * indent.c (compute_motion): Remove unused local.
9426
c1529ded
GM
94272012-07-31 Glenn Morris <rgm@gnu.org>
9428
400d5621
GM
9429 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
9430
268e2432
GM
9431 * conf_post.h [USG5_4]:
9432 Move remaining contents of s/usg5-4-common.h here.
9433 * s/usg5-4-common.h: Remove file.
9434
7552f3ee
GM
9435 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
9436 * s/irix6-5.h: Remove file.
9437
6a381852
GM
9438 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
9439 * s/darwin.h: Remove file.
9440
c1529ded
GM
9441 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
9442 * s/hpux10-20.h: Remove file, which is now empty.
9443
b429a4ee
GM
94442012-07-30 Glenn Morris <rgm@gnu.org>
9445
9446 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
9447 * Makefile.in (config_h): Add conf_post.h.
9448 * makefile.w32-in (CONFIG_H): Add conf_post.h.
9449
adff3182
JD
94502012-07-30 Jan Djärv <jan.h.d@swipnet.se>
9451
9452 * nsterm.m (ns_do_open_file): New variable.
b9031d69 9453 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
9454 (openFile, openTempFile, openFileWithoutUI, openFiles):
9455 Open files only if ns_do_open_file.
adff3182 9456
c32af1e4
PE
94572012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9458
7393bcbb
PE
9459 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
9460 This no-op macro hasn't been needed for many years.
9461 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
9462
c32af1e4
PE
9463 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
9464 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
9465 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
9466 gdb_make_enums_visible.
9467 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
9468 (DIRECTORY_SEP): Now a constant, not a macro.
9469
302fc036
EZ
94702012-07-30 Eli Zaretskii <eliz@gnu.org>
9471
9472 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
9473 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
9474
9475 * w32term.c <w32_keyboard_codepage>: Renamed from
9476 keyboard_codepage and now external. All users changed.
9477
9478 * w32term.h: Add declaration of w32_keyboard_codepage.
9479
9480 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
9481 the codepage to translate keys to Unicode. If this argument is
9482 -1, use the value returned by GetConsoleCP. All callers changed.
9483
88fb40b4
PE
94842012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9485
0aee6912
PE
9486 Update .PHONY listings in makefiles.
9487 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
9488 bootstrap-clean, distclean, maintainer-clean, versioclean,
9489 extraclean, frc.
9490
88fb40b4
PE
9491 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
9492 This is a bit clearer. Fix some commentary typos.
9493
0a763bd1
GM
94942012-07-30 Glenn Morris <rgm@gnu.org>
9495
32bac6d6
GM
9496 * s/netbsd.h: Let configure include signal.h if needed.
9497 Remove file, which is now empty.
9498
b65e7c46
GM
9499 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
9500 Let configure set them.
9501 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
9502 No more need to undefine.
0a763bd1 9503
169304bd
AS
95042012-07-30 Andreas Schwab <schwab@linux-m68k.org>
9505
9506 * keymap.c (Fkey_description): Don't remove 0x80 bit from
9507 non-single-byte char when adding meta modifier. (Bug#12090)
9508
6cd7a139
DA
95092012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9510
9511 Convert safe_call to use variable number of arguments.
9512 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
9513 (safe_call2): Fix comment.
9514 * lisp.h (safe_call): Adjust prototype.
9515 * coding.c (encode_coding_object): Change to use safe_call2.
9516 * xfaces.c (merge_face_heights): Change to use safe_call1.
9517
d34d6ffc
GM
95182012-07-30 Glenn Morris <rgm@gnu.org>
9519
7b8a48e4 9520 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 9521 does that unconditionally. Remove file, which is now empty.
7b8a48e4 9522
d34d6ffc
GM
9523 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
9524 Remove empty files.
9525
03a660a6
PE
95262012-07-30 Paul Eggert <eggert@cs.ucla.edu>
9527
9528 Export to GDB most of lisp.h's remaining object-like macros.
9529 * lisp.h (min, max): Move earlier, because they're used earlier now.
9530 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
9531 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
9532 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
9533 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
9534 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
9535 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
9536 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
9537 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
9538 Now constants, for GDB. They need not be macros.
9539 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
9540 Now constants, for GDB, as well as macros, for static initializers.
9541 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
9542 Move to after the definition of struct Lisp_Char_Table,
9543 since the former now needs that type defined.
9544 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
9545 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
9546 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
9547 New enums, for gdb_make_enums_visible.
9548 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 9549 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
9550 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
9551 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
9552 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
9553 enum maxargs, enum MAX_ALLOCA.
9554 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
9555 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
9556 no longer needed, now that they are done in lisp.h.
9557
e499d0ee
DA
95582012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
9559
9560 Cleanup string bytes checking.
9561 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
9562 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
9563 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
9564 (check_sblock, compact_small_strings): Simplify.
9565
d5040d2d
PE
95662012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9567
9568 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
9569 These macros are confusing and no longer need to be defined, as
9570 the enum values now suffice. All uses replaced with definiens.
9571 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
9572
7f259ae6
JB
95732012-07-29 Juanma Barranquero <lekktu@gmail.com>
9574
9575 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
9576 ($(BLD)/w32console.$(O)): Update dependencies.
9577
7e63e0c3
DA
95782012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9579
9580 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
9581 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
9582 time. Adjust users.
9583 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
9584
ffd817eb
JD
95852012-07-29 Jan Djärv <jan.h.d@swipnet.se>
9586
9587 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
9588 setting sitelisp (Bug#12010).
9589
417a7a0e
EZ
95902012-07-29 Eli Zaretskii <eliz@gnu.org>
9591
14ae4239 9592 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
9593
9594 * w32heap.c (cache_system_info):
9595 * w32.c (sys_rename):
9596 * w32proc.c (find_child_console, sys_kill): All users changed.
9597
387d4d92
PE
95982012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9599
9600 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
9601
55a6cca6
EZ
96022012-07-29 Eli Zaretskii <eliz@gnu.org>
9603
9604 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
9605
dbcf001c
DA
96062012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9607
9608 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
9609 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
9610 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 9611
e2688e4a
DA
96122012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
9613
9614 Generalize marker debugging code under MARKER_DEBUG and use eassert.
9615 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
9616 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
9617 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
9618 (replace_range, replace_range_2, del_range_2): Change to eassert.
9619 * marker.c (byte_char_debug_check): Adjust style.
9620
b46a6a83
PE
96212012-07-29 Paul Eggert <eggert@cs.ucla.edu>
9622
9623 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
9624 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
9625 long-ago-commented-out code that talks about "WIN32".
9626 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
9627 All uses changed.
9628
e32a5799
PE
96292012-07-28 Paul Eggert <eggert@cs.ucla.edu>
9630
9631 Use Gnulib stdalign module (Bug#9772, Bug#9960).
9632 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
9633 Simplify by using alignof.
9634 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
9635 * lisp.h: Include <stdalign.h>.
9636 (GCALIGNMENT): New macro and constant.
9637 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
9638 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
9639 (stdalign): New macro, if not already defined.
9640
df81cd29
EZ
96412012-07-28 Eli Zaretskii <eliz@gnu.org>
9642
01bd1b0d
EZ
9643 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
9644 * w32inevt.c: Include w32inevt.h.
9645 (w32_read_console_input): New inline function, calls either
9646 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
9647 w32_console_unicode_input.
9648 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
9649 (w32_kbd_patch_key, key_event): Use the codepage returned by
9650 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
9651 (key_event): use uChar.UnicodeChar only if
9652 w32_console_unicode_input is non-zero.
9653
9654 * w32console.c: Include w32heap.h.
9655 <w32_console_unicode_input>: New global variable.
9656 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
9657 family of Windows, zero otherwise.
9658
9659 * w32inevt.h: Declare w32_console_unicode_input.
9660
df81cd29
EZ
9661 * xdisp.c (init_iterator): Don't reference tip_frame in a build
9662 --without-x. (Bug#11742)
9663
c20fdd9e
PE
96642012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9665
9666 Adjust GDB to reflect pvec_type changes (Bug#12036).
9667 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
9668 2012-07-04 changes to pseudovector representation.
9669 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 9670
32770973 96712012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
9672
9673 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
9674 bus address.
9675 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
9676
3438fe21
EZ
96772012-07-27 Eli Zaretskii <eliz@gnu.org>
9678
bcfbc9de
EZ
9679 * alloc.c (listn): Fix the order the arguments are consed onto the
9680 list.
9681
3438fe21
EZ
9682 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
9683 enumeration constants, as PURE and HEAP are too general, and clash
9684 with other headers and sources, such as gmalloc.c and the
9685 MS-Windows system headers. All users changed.
9686
eeaea515
DA
96872012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9688
9689 Revert last save_excursion_save and save_excursion_restore changes.
9690 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
9691 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
9692
073c88c2
DA
96932012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9694
9695 Fix recently-introduced typos in Windows port.
9696 Reported by Martin Rudalics <rudalics@gmx.at>.
9697 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 9698 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 9699
4706125e
PE
97002012-07-27 Paul Eggert <eggert@cs.ucla.edu>
9701
9702 Improve GDB symbol export (Bug#12036).
9703 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
9704 arms of an 'if', not using conditional expressions; otherwise GDB
9705 complains about the types in the unevaluated arm when the argument
9706 is an integer literal.
9707 (xgetint): Simplify expression.
9708 * alloc.c (gdb_make_enums_visible): New constant. This ports to
9709 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
9710 Zaretskii in <http://bugs.gnu.org/12036#13>.
9711 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
9712 needed now that we have gdb_make_enums_visible.
9713 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
9714 (enum enum_USE_LSB_TAG):
9715 New enum types, packaging up enums that need to be exported to GDB.
9716
694b6c97
DA
97172012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9718
9719 Utility function to make a list from specified amount of objects.
9720 * lisp.h (enum constype): New datatype.
9721 (listn): New prototype.
9722 * alloc.c (listn): New function.
9723 (Fmemory_use_count, syms_of_alloc): Use it.
9724 * buffer.c (syms_of_buffer): Likewise.
9725 * callint.c (syms_of_callint): Likewise.
9726 * charset.c (define_charset_internal): Likewise.
9727 * coding.c (syms_of_coding): Likewise.
9728 * keymap.c (syms_of_keymap): Likewise.
9729 * search.c (syms_of_search): Likewise.
9730 * syntax.c (syms_of_syntax): Likewise.
9731 * w32.c (init_environment): Likewise.
9732 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
9733 * xdisp.c (syms_of_xdisp): Likewise.
9734 * xfns.c (syms_of_xfns): Likewise.
9735
6195f384
DA
97362012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
9737
9738 Fast save_excursion_save and save_excursion_restore.
9739 * lisp.h (struct Lisp_Excursion): New data type.
9740 (PVEC_EXCURSION): New pseudovector type.
9741 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
9742 to deal with it. Adjust comments.
9743 (init_marker, attach_marker): New prototype.
9744 (unchain_marker): Adjust prototype.
9745 * marker.c (attach_marker): Change to global.
9746 (init_marker): New function.
9747 * alloc.c (Fmake_marker, build_marker): Use it.
9748 (build_marker): More easserts.
9749 (mark_object): Handle struct Lisp_Excursion.
9750 * editfns.c (save_excursion_save, save_excursion_restore):
9751 Reimplement to use struct Lisp_Excursion. Add comments.
9752
5eceb8fb
PE
97532012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9754
9755 Fix export of symbols to GDB (Bug#12036).
9756 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
9757 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
9758 emacs.c, as this is a more-suitable home. Had this been done earlier
9759 the fix for 12036 would have avoided some of the problems noted in
9760 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
9761 would have been more obvious.
562157c8
PE
9762 * emacs.c: Do not include <verify.h>; no longer needed.
9763 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
9764 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
9765 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9766 Remove; now done in lisp.h.
9767 * lisp.h (PUBLISH_TO_GDB): New macro.
9768 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
9769 (DATA_SEG_BITS): Use it.
9770 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
9771 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
9772 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
9773 not be usable in #if. This simplifies things.
9774
d6749401
JB
97752012-07-26 Juanma Barranquero <lekktu@gmail.com>
9776
9777 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
9778
1781b9e9
PE
97792012-07-26 Paul Eggert <eggert@cs.ucla.edu>
9780
d89518db 9781 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
9782 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
9783 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
9784 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
9785 Adjust to changes in lisp.h and emacs.c, by using
9786 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
9787 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
9788 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
9789 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
9790 instead of gdb_valbits.
9791 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
9792 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
9793 instead of gdb_array_mark_flag.
9794 (xboolvector): Get size from $->size, not $->header.size.
9795 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
9796 (xreload, hook-run, hookpost-run): Remove.
9797 * emacs.c: Include <verify.h>.
9798 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
9799 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
9800 Remove.
9801 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
9802 (gdb_USE_LSB_TAG): New enum constants.
9803 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
9804 Also define these as enum constants, so they're visible to GDB.
9805 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
9806 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
9807 as constants, so they're visible to GDB.
9808 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
9809 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
9810 Now enum constants, not macros, so they're visible to GDB.
9811 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
9812 more convenient now. All uses changed.
9813 (VALMASK) [USE_LSB_TAG]: Also define in this case.
9814 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
9815
3628596a
DA
98162012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
9817
9818 Explicitly free restriction data that are not needed anymore.
9819 * editfns.c (save_restriction_restore): Free restriction data.
9820
7abaf5cc
SM
98212012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9822
9823 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9824 add argument, tune behavior, and adjust all callers.
9825
71f88e00
PE
98262012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9827
9828 Use typedef for EMACS_INT, EMACS_UINT.
9829 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9830 than macros. This simplifies debugging in the usual case, since
9831 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9832 and it allows expressions involving EMACS_INT casts.
9833 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9834
57ec3034
JD
98352012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9836
9837 * nsterm.m (ns_read_socket): Return early if there is a modal
9838 window (Bug#12043).
9839
8137e7b3
MR
98402012-07-25 Martin Rudalics <rudalics@gmx.at>
9841
9842 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9843 that FOCUS-FRAME can be omitted.
9844
04e9897c
DA
98452012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9846
9847 Adjust buffer text indirection counters at the end of Fkill_buffer.
9848 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9849 buffer is definitely dead. This should really fix an issue reported
9850 by Christoph Scholtes again. (Bug#12007).
9851 (init_buffer_once): Initialize indirection counters of
9852 buffer_defaults and buffer_local_symbols (for sanity and safety).
9853
8a0484e1
EZ
98542012-07-24 Eli Zaretskii <eliz@gnu.org>
9855
9856 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9857 and continuation glyphs on tooltip frames, leave them at zero.
9858 Avoids continued lines in tooltips. (Bug#11832)
9859
fa691a83
DA
98602012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9861
9862 Simplify copy_overlay.
04e9897c 9863 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
9864 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9865
436bc8e0
EZ
98662012-07-23 Eli Zaretskii <eliz@gnu.org>
9867
9868 * print.c (print_object): Don't crash when a frame's name is nil
9869 or invalid. (Bug#12025)
9870
9871 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9872 it signals an error when a tooltip frame is being created.
9873
d7a7fda3
DA
98742012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9875
9876 Cleanup miscellaneous objects allocation and initialization.
9877 * alloc.c (allocate_misc): Change to static. Add argument to
9878 specify the subtype. Adjust comment and users.
9879 (build_overlay): New function.
9880 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9881 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9882 (allocate_misc): Remove prototype.
9883 (build_overlay): Add prototype.
9884
98852012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
9886
9887 Swap buffer text indirection counters in Fbuffer_swap_text.
9888 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9889 This avoids crash reported by Christoph Scholtes at
9890 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9891
9d7fa573
JD
98922012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9893
9894 * nsmenu.m (Popdown_data): New struct.
9895 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9896 free Popdown_data.
9897 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9898 (initWithContentRect): Make imgView and contentView non-static
9899 and autorelease them. Also autorelease img and matrix (Bug#12005).
9900 (dealloc): Remove (Bug#12005).
9901
0dd6d66d
DA
99022012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9903
9904 Adjust consing_since_gc when objects are explicitly freed.
9905 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9906 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9907 (free_cons, free_misc): Subtract object size from consing_since_gc.
9908
d36d71df
DA
99092012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9910
9911 Simplify and cleanup markers positioning code.
9912 * marker.c (attach_marker): More useful eassert.
9913 (live_buffer, set_marker_internal): New function.
9914 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9915 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9916
fb9ea40f
PE
99172012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9918
9919 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9920 as it's limited by the amount of memory, not by INT_MAX.
9921
2d5c5f7d
EZ
99222012-07-21 Eli Zaretskii <eliz@gnu.org>
9923
07fb592e
EZ
9924 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9925 in special-event-map. See the discussion at
9926 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9927 for the reasons.
9928
37a9eac8 9929 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
9930 info.dwItemData. Fixes crashes on 64-bit Windows.
9931 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 9932
c4328746
JD
99332012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9934
fc0c31f8 9935 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 9936 (conversationIdentifier): Return value is NSInteger.
784051c4 9937 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 9938
6e5d1c12
CY
99392012-07-21 Chong Yidong <cyd@gnu.org>
9940
9941 * window.c (decode_any_window): Signal an error if the window is
9942 on a dead frame (Bug#11984).
9943
9928463d
DA
99442012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9945
9946 Add indirection counting to speed up Fkill_buffer.
9947 * buffer.h (struct buffer): New member.
9948 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9949 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9950 base buffer indirection counter.
9951 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9952 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9953 through buffer list if indirection counter is 0.
9954
f8643a6b
DA
99552012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9956
9957 Extend the value returned by Fgarbage_collect with heap statistics.
9958 * alloc.c (Qheap): New symbol.
9959 (syms_of_alloc): DEFSYM it.
9960 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9961 (Fmemory_free): Remove.
9962 (syms_of_alloc): Don't defsubr it.
9963 * buffer.c (Fcompact_buffer): Remove.
9964 (syms_of_buffer): Don't defsubr it.
9965
dac616ff
DA
99662012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9967
9968 Make maybe_gc inline.
9969 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9970 * lisp.h (consing_since_gc, gc_relative_threshold)
9971 (memory_full_cons_threshold): Revert declaration.
9972 (maybe_gc): Remove prototype, define as inline.
9973 * alloc.c: Remove old commented-out code.
9974 (consing_since_gc, gc_relative_threshold)
9975 (memory_full_cons_threshold): Revert to global.
9976 (maybe_gc): Remove.
9977
d7ea76b4
DA
99782012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9979
9980 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9981 * lisp.h (build_unibyte_string): New function.
9982 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9983 * sysdep.c, w32fns.c, xfns.c: Use it.
9984 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9985 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9986 Adjust users accordingly.
9987 * font.h (font_open_by_name): Adjust prototype.
9988
765e61e3
DA
99892012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9990
9991 Cleanup calls to Fgarbage_collect.
9992 * lisp.h (maybe_gc): New prototype.
9993 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9994 Remove declarations.
9995 * alloc.c (maybe_gc): New function.
9996 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9997 Make them static.
9998 * bytecode.c (MAYBE_GC): Use maybe_gc.
9999 * eval.c (eval_sub, Ffuncall): Likewise.
10000 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
10001 to avoid dependency from auto-save feature.
10002
52b852c7
PE
100032012-07-19 Paul Eggert <eggert@cs.ucla.edu>
10004
10005 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
10006 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
10007 'for_each_per_buffer_object_at'.
10008 All uses changed. It's better to use upper-case for macros that
10009 cannot be implemented as functions, to give the reader a clue
10010 that they're special.
10011
5db81e33
SM
100122012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
10013
10014 * alloc.c (Fgarbage_collect): Tweak docstring.
10015
5b835e1d
DA
100162012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10017
10018 Tweak the value returned from Fgarbage_collect again.
10019 * alloc.c (Fgarbage_collect): New return value, as confirmed in
10020 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
10021 Adjust documentation.
10022 (total_vector_bytes): Rename to total_vector_slots, adjust
10023 accounting.
10024 (total_free_vector_bytes): Rename to total_free_vector_slots,
10025 adjust accounting.
10026 (Qstring_bytes, Qvector_slots): New symbols.
10027 (syms_of_alloc): DEFSYM them.
10028
9cd47b72
DA
100292012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10030
10031 Buffer compaction primitive which may be used from Lisp.
10032 * buffer.c (compact_buffer, Fcompact_buffer): New function.
10033 (syms_of_buffer): Register Fcompact_buffer.
10034 * alloc.c (Fgarbage_collect): Use compact_buffer.
10035 * buffer.h (compact_buffer): New prototype.
10036 (struct buffer_text): New member.
10037
d17337e5
DA
100382012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
10039
10040 New macro to iterate over all buffers, miscellaneous cleanups.
10041 * lisp.h (all_buffers): Remove declaration.
10042 * buffer.h (all_buffers): Add declaration, with comment.
10043 (for_each_buffer): New macro.
10044 * alloc.c (Fgarbage_collect, mark_object): Use it.
10045 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
10046 (init_buffer): Likewise.
10047 * data.c (Fset_default): Likewise.
10048 * coding.c (code_conversion_restore): Remove redundant check
10049 for dead buffer.
10050 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
10051
60cfd278
AS
100522012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10053
10054 Fix bug that created negative-length intervals.
10055 * intervals.c (merge_interval_right, merge_interval_left):
10056 Do not zero out this interval if it is absorbed by its children,
10057 as this interval's total length doesn't change in that case. See
10058 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
10059
d06714cb
PE
100602012-07-18 Paul Eggert <eggert@cs.ucla.edu>
10061
83713154
PE
10062 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
10063 when invoking (make-bool-vector N t) and N is a positive
10064 multiple of 8 -- the last 8 bits were mistakenly cleared.
10065
d06714cb
PE
10066 Remove some struct layout assumptions in bool vectors.
10067 * alloc.c (bool_header_size): New constant.
10068 (header_size, word_size): Move earlier, as they're now used earlier.
10069 Use 'word_size' in a few more places, where it's appropriate.
10070 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
10071 padding before the data member of a bool vector.
10072 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
10073 than doing the check by hand with an abort ().
10074
464d5a5e
SM
100752012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10076
5fbc0409
SM
10077 * eval.c (Fdefvar): Don't check constants since we only set the var if
10078 it's not yet defined anyway (bug#11904).
10079
464d5a5e
SM
10080 * lisp.h (last_undo_boundary): Declare new var.
10081 * keyboard.c (command_loop_1): Set it.
10082 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
10083 were auto-added by the command loop (bug#11774).
10084
8dc2e44a
AS
100852012-07-18 Andreas Schwab <schwab@linux-m68k.org>
10086
10087 * w32font.c (Qsymbol): Remove local definition.
10088 (syms_of_w32font): Don't DEFSYM it.
10089
169925ec
DA
100902012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10091
10092 Fix sweep_vectors to handle large bool vectors correctly.
10093 * alloc.c (sweep_vectors): Account total_vector_bytes for
10094 bool vectors larger than VBLOCK_BYTES_MAX.
10095
5fbfb018
CY
100962012-07-18 Chong Yidong <cyd@gnu.org>
10097
10098 * frame.c (x_set_frame_parameters): Revert bogus change introduced
10099 in 2012-05-25 commit by Paul Eggert (Bug#11738).
10100
3ab6e069
DA
101012012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
10102
10103 Return more descriptive data from Fgarbage_collect.
10104 Suggested by Stefan Monnier in
10105 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
10106 * alloc.c (bounded_number): New function.
10107 (total_buffers, total_vectors): New variable.
10108 (total_string_size): Rename to total_string_bytes, adjust users.
10109 (total_vector_size): Rename to total_vector_bytes, adjust users.
10110 (sweep_vectors): Account total_vectors and total_vector_bytes.
10111 (Fgarbage_collect): New return value. Adjust documentation.
10112 (gc_sweep): Account total_buffers.
10113 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
10114 (VECTOR_SIZE): Remove.
10115 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
10116 (Qinterval, Qmisc): New symbols.
10117 (syms_of_data): Initialize them.
10118 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
10119 (Qcons, Qbuffer): New declarations.
10120
6d02fe5b
PE
101212012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10122
10123 * alloc.c (Fmemory_free): Account for memory-free's own storage.
10124 Round up, not down. Improve doc.
10125
b7ffe040
DA
101262012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10127
10128 Restore old code in allocate_string_data to avoid Faset breakage.
10129 Reported by Julien Danjou <julien@danjou.info> in
10130 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
10131 * alloc.c (allocate_string_data): Restore old code with minor
10132 adjustments, fix comment to explain this subtle issue.
10133
4dc7c8d5
SM
101342012-07-17 Eli Zaretskii <eliz@gnu.org>
10135
10136 Remove FILE_SYSTEM_CASE.
10137 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
10138
10139 * fileio.c (FILE_SYSTEM_CASE): Don't define.
10140 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
10141 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
10142 call-process-region passes it through expand-file-name.
10143
10144 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
10145
101462012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10147
10148 Fix crash when creating indirect buffer (Bug#11917)
10149 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
10150 Don't handle unbound variables specially if non-zero.
10151 (Fbuffer_local_variables): Pass zero.
10152 (clone_per_buffer_values): Pass non-zero.
10153
101542012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10155
10156 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
10157 to make the loop interruptible.
10158
101592012-07-17 Andreas Schwab <schwab@linux-m68k.org>
10160
10161 * gnutls.c (emacs_gnutls_handshake): Only retry if
10162 GNUTLS_E_INTERRUPTED.
10163
cce7fefc
DA
101642012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10165
10166 Cleanup and convert miscellaneous checks to eassert.
10167 * alloc.c (mark_interval): Fix comment, partially rephrase
10168 old comment from intervals.h (see below).
10169 * intervals.c (find_interval, adjust_intervals_for_insertion)
10170 (delete_interval, adjust_intervals_for_deletion)
10171 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
10172 Convert to eassert.
10173 (adjust_intervals_for_insertion, make_new_interval):
10174 Remove obsolete and unused code.
10175 * intervals.h (struct interval): Remove obsolete comment.
10176 * textprotp.c (erase_properties): Remove unused code.
10177 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
10178 (Fremove_list_of_text_properties): Convert to eassert.
10179
9ea10cc3
CY
101802012-07-17 Chong Yidong <cyd@gnu.org>
10181
10182 * editfns.c (Finsert_char): Doc fix.
10183
3900d5de
DA
101842012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10185
10186 Fix previous change to make Fmemory_free always accurate.
10187 * alloc.c (make_interval): Update total_free_intervals.
10188 (make_float): Likewise for total_free_floats.
10189 (free_cons, Fcons): Likewise for total_free_conses.
10190 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
10191 Likewise for total_free_vector_bytes.
10192 (Fmake_symbol): Likewise for total_free_symbols.
10193 (bytes_free): Remove.
10194
7098646f
DA
101952012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10196
10197 Simple free memory accounting feature.
10198 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
10199 (sweep_vectors): Accumulate size of free vectors.
10200 (Fgarbage_collect): Setup bytes_free.
10201 (Fmemory_free): New function.
10202 (syms_of_alloc): Register it.
10203
22657b40
DA
102042012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
10205
10206 Cleanup overlays checking.
10207 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
10208 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
10209 eassert and OVERLAYP.
10210 (sort_overlays): Change to use OVERLAYP.
10211
ddfc8813
RK
102122012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
10213
10214 * editfns.c (Finsert_char): Make it interactive, and make the
10215 second arg optional. Copy interactive spec and docstring from
10216 ucs-insert.
10217
7c26cf3c
PE
102182012-07-17 Paul Eggert <eggert@cs.ucla.edu>
10219
10220 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
10221 Unlike the other wrapped functions, fabs has an unspecified
10222 effect on errno.
10223
5d127af9
JD
102242012-07-16 Jan Djärv <jan.h.d@swipnet.se>
10225
10226 * nsterm.m (keyDown): Interpret flags without left/right bits
10227 as the left key (Bug#11670).
10228
6a0dd1d7
DA
102292012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10230
10231 Remove empty and useless init functions.
10232 * lisp.h (init_character_once, init_fns, init_image)
10233 (init_filelock, init_sound): Remove prototype.
10234 * character.c (init_character_once): Remove.
10235 * filelock.c (init_filelock): Likewise.
10236 * fns.c (init_fns): Likewise.
10237 * image.c (init_image): Likewise.
10238 * sound.c (init_sound): Likewise.
10239 * emacs.c (main): Adjust accordingly.
10240
7a6136fd
DA
102412012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
10242
10243 * gtkutil.h: Tiny cleanups.
10244 (use_old_gtk_file_dialog): Remove useless declaration.
10245 (xg_uses_old_file_dialog): Add suggested const attribute.
10246
ce811ad9
EZ
102472012-07-15 Eli Zaretskii <eliz@gnu.org>
10248
10249 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
10250 (bidi_paragraph_init): Use it to limit search forward for a strong
10251 directional character in abnormally large paragraphs full of
10252 neutral or weak characters. (Bug#11943)
10253
c9adfeaa
SF
102542012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
10255
10256 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
10257 the toolbar (Bug#9451).
10258 (xg_make_tool_item): Give the widget event box a transparent
10259 background.
10260
fff62aa9
DA
102612012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10262
10263 Cleanup basic allocation variables and functions.
10264 * alloc.c (ignore_warnings, init_intervals, init_float)
10265 (init_cons, init_symbol, init_marker): Remove.
10266 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
10267 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
10268 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
10269 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
10270 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
10271 (staticidx, init_alloc_once, init_strings, free_ablock):
10272 Remove redundant initialization.
10273 * fns.c (init_weak_hash_tables): Remove.
10274 * lisp.h (init_weak_hash_tables): Remove prototype.
10275
9730daca
DA
102762012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
10277
10278 Use zero_vector where appropriate.
10279 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
10280 accordingly.
10281 * lisp.h (zero_vector): New declaration.
10282 * font.c (null_vector): Remove.
10283 (syms_of_font): Remove initialization and staticpro.
10284 (font_list_entities, font_find_for_lface): Change to use zero_vector.
10285 * keymap.c (Faccessible_keymaps): Likewise.
10286
2e2d2a13
LL
102872012-07-15 Leo Liu <sdl.web@gmail.com>
10288
10289 * fringe.c: Fix typo in comments.
10290
cd276f6e
LL
102912012-07-14 Leo Liu <sdl.web@gmail.com>
10292
10293 * fringe.c: Add a new bitmap exclamation-mark.
10294
5a1131d9
EZ
102952012-07-14 Eli Zaretskii <eliz@gnu.org>
10296
10297 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
10298
10299 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
10300 (HAVE_MENUS): Don't define, defined by editing config.in with
10301 msdos/sed2v2.inp.
10302 (GMALLOC_INHIBIT_VALLOC): Don't define.
10303 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
10304
22e983b7
JB
103052012-07-14 Juanma Barranquero <lekktu@gmail.com>
10306
10307 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
10308
5b3f250f
GM
103092012-07-14 Glenn Morris <rgm@gnu.org>
10310
10311 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
10312 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
10313 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
10314
33d63ff4
GM
103152012-07-13 Glenn Morris <rgm@gnu.org>
10316
5b633342
GM
10317 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
10318
33d63ff4
GM
10319 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
10320 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
10321
b55b9f85
JD
103222012-07-13 Jan Djärv <jan.h.d@swipnet.se>
10323
0dc8cf50
JD
10324 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
10325 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
10326 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
10327 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
10328 where appropriate.
10329 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
10330 as boolean expression.
10331 (x_set_window_size): Remove unused variable toolbar.
10332 (ns_get_color_default, ns_mod_to_lisp): Remove.
10333 (ns_mouse_position): Remove unused variables xchar and ychar.
10334 (ns_compute_glyph_string_overhangs): Remove unused variable face.
10335 (ns_set_vertical_scroll_bar): Remove unused variable count.
10336 (ns_delete_terminal): Remove unused variable i.
10337 (ns_term_init): Remove unused variables r, g and b.
10338 (mouseDown): Remove unused variable window.
10339 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
10340 (initFrameFromEmacs): Remove unused variable vbextra.
10341 (mouseEntered): Remove unused variables p and dpyinfo.
10342 (mouseExited): Remove unused variables p and r.
10343 (ns_define_frame_cursor, ns_clear_frame_area)
10344 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
10345 (menuDown): Assign [sender tag] to variable and cast the variable.
10346
10347 * nsterm.h (menuDown): Add id as type to argument sender.
10348 (ns_display_info_for_name): Add Lisp_Object argument.
10349 (ns_term_init): Add Lisp_Object argument.
10350 (ns_map_event_to_object): Add void argument.
10351 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
10352 prototype with arguments and only declare if __OBJC__.
10353 (nxatoms_of_nsselect): Add void argument.
10354 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
10355 (ns_alloc_autorelease_pool): Add void argument.
10356 (ns_release_autorelease_pool): Add void* argument.
10357 (ns_get_defaults_value): Add const char* argument.
10358
10359 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
10360 (initFromContents): Use SSDATA where appropriate.
10361 (ns_update_menubar): Add braces to ambigous if-else.
10362 (initWithTitle): Put () around assignment in if statement.
10363 (ns_menu_show): Remove unused variables window and keymap.
10364 (update_frame_tool_bar): Remove unused variable selected_p.
10365 (initWithContentRect): Remove unused variable this_cmd_name.
10366
10367 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
10368 appropriate.
10369 (setXBMColor): Remove unused variable len.
10370 (setPixmapData): Put () around assignment in loop statement.
10371
10372 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
10373 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
10374 where appropriate.
10375 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
10376 around assignment in loop statement.
10377 (nsfont_open): Remove unused variable i.
10378 (nsfont_open): Remove unused variable len.
10379 (nsfont_draw): Remove unused variable cs.
10380
10381 * nsfns.m (x_set_icon_name, ns_set_name_internal)
10382 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
10383 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
10384 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
10385 (Fns_font_name, Fns_perform_service)
10386 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
10387 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
10388 (ns_set_name): Remove unused variable view.
10389 (x_set_menu_bar_lines): Remove unused variable olines.
10390 (x_set_tool_bar_lines): Remove unused variable root_window.
10391 (Fns_list_colors): Put () around assignment in while statement.
10392 (Fns_perform_service): Remove unused variable len.
10393 (Fns_display_usable_bounds): Remove unused variable top.
10394 (syms_of_nsfns): Remove unused variable i.
10395
b55b9f85
JD
10396 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
10397 memcpy (Bug#11907).
10398
ed9265fc 103992012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
10400
10401 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
10402 and free it with DestroyExceptionInfo (Bug#11558).
10403
ef099b57
JB
104042012-07-13 Juanma Barranquero <lekktu@gmail.com>
10405
10406 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
10407 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
10408 Set here, not in nt/config.nt.
10409
ea814a5d
EZ
104102012-07-13 Eli Zaretskii <eliz@gnu.org>
10411
10412 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
10413 cursor overflow into the last glyph on display line when the right
10414 fringe is off. (Bug#11832)
10415
1a952767
PE
104162012-07-13 Paul Eggert <eggert@cs.ucla.edu>
10417
10418 * xdisp.c (produce_special_glyphs): Now static.
10419 * dispextern.h (produce_special_glyphs): Remove decl.
10420
983188fd
GM
104212012-07-13 Glenn Morris <rgm@gnu.org>
10422
8d7c7eed 10423 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
10424 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
10425
983188fd
GM
10426 * s/usg5-4-common.h (USG, USG5):
10427 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
10428 * s/sol2-6.h (SOLARIS2):
10429 * s/irix6-5.h (IRIX6_5):
10430 * s/hpux10-20.h (USG, USG5, HPUX):
10431 * s/gnu-linux.h (USG, GNU_LINUX):
10432 * s/freebsd.h (BSD_SYSTEM):
10433 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
10434 * s/cygwin.h (CYGWIN):
10435 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
10436 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
10437
d1e68667 104382012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
10439
10440 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 10441
6de0e799
GM
104422012-07-13 Glenn Morris <rgm@gnu.org>
10443
739ae010
GM
10444 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
10445
dbee5793
GM
10446 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
10447
6de0e799
GM
10448 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
10449 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
10450
b82da769
GM
104512012-07-12 Glenn Morris <rgm@gnu.org>
10452
4fae5a7a 10453 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
10454
10455 * process.c (init_process_emacs): Rename from init_process.
10456 The old name is also the name of a Mach system call.
10457 * lisp.h, emacs.c: Update for this name change.
10458 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
10459 longer needed.
10460
5a979817
EZ
104612012-07-12 Eli Zaretskii <eliz@gnu.org>
10462
10463 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
10464 memmove call that removes glyphs covered by the left truncation
10465 glyph. Improve commentary.
10466 (display_line): Fix display of continuation glyphs on GUI frames
10467 when the right fringe is turned off and variable-size fonts are
10468 used in the window. Move the code that appends a stretch glyph to
10469 produce_special_glyphs, so that it could be used for truncation
10470 and continuation glyphs alike.
10471 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
10472 glyph of a suitably computed width, to align the special glyphs at
10473 the window margin. Code moved from display_line. (Bug#11832)
10474
3e91a053
GM
104752012-07-12 Glenn Morris <rgm@gnu.org>
10476
ba9e4b84
GM
10477 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
10478
10479 * s/gnu-linux.h, s/hpux10-20.h:
10480 Do not unconditionally define HAVE_XRMSETDATABASE.
10481
3e91a053
GM
10482 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
10483
b300b1f4
PE
104842012-07-12 Paul Eggert <eggert@cs.ucla.edu>
10485
10486 Fix typos that broke OS X build.
10487 Reported by Randal L. Schwartz in
10488 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
10489 * nsterm.m (ns_timeout): Add missing local decl.
10490 (ns_get_color): snprintf -> sprintf, to fix typo.
10491
6e777848
GM
104922012-07-12 Glenn Morris <rgm@gnu.org>
10493
3f922c37
GM
10494 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
10495 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
10496 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
10497 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
10498
0ab7b23a
GM
10499 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
10500 Move PTY_OPEN to configure.
10501
6e777848
GM
10502 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10503 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
10504 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
10505
4a7edc24
DA
105062012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
10507
10508 Use empty_unibyte_string where applicable.
10509 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
10510 * lread.c (read1): Likewise.
10511 * xsettings.c (syms_of_xsettings): Likewise.
10512
308aab79
GM
105132012-07-12 Glenn Morris <rgm@gnu.org>
10514
42bd1719
GM
10515 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
10516 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
10517 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
10518 * s/hpux10-20.h (RUN_TIME_REMAP):
10519 * s/bsd-common.h (TABDLY): Move to configure.
10520
10521 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
10522
10523 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
10524
ea0bbd17 10525 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 10526 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
10527
10528 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 10529
308aab79
GM
10530 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
10531 * s/template.h: Move NARROWPROTO to configure.
10532
ee1cf5cf
GM
105332012-07-11 Glenn Morris <rgm@gnu.org>
10534
30fe9bf4
GM
10535 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
10536 unused since 2011-01-17 change to systty.h.
10537
ee1cf5cf
GM
10538 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
10539 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10540 Move HAVE_PTYS and HAVE_SOCKETS to configure.
10541
63e47e07
PE
105422012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10543
10544 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
10545
c43fb4c3
GM
105462012-07-11 Glenn Morris <rgm@gnu.org>
10547
10548 * s/darwin.h, s/gnu-linux.h, s/template.h:
10549 Move INTERRUPT_INPUT to configure.
10550
e8df9267
DA
105512012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10552
10553 Minor adjustments to interning code.
10554 * lisp.h (intern, intern_c_string): Redefine as static inline
10555 wrappers for intern_1 and intern_c_string_1, respectively.
10556 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
10557 * lread.c (intern_1, intern_c_string_1, oblookup):
10558 Simplify Vobarray checking.
e8df9267
DA
10559 * font.c (font_intern_prop): Likewise. Adjust comment.
10560 * w32font.c (intern_font_name): Likewise.
10561
34348bd4
AS
105622012-07-11 Andreas Schwab <schwab@linux-m68k.org>
10563
d96a1e0c
AS
10564 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
10565
34348bd4
AS
10566 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
10567 of Fcar/Fcdr if possible.
10568 * font.c (check_otf_features): Likewise.
10569 * fontset.c (Fnew_fontset): Likewise.
10570 * gnutls.c (Fgnutls_boot): Likewise.
10571 * minibuf.c (read_minibuf): Likewise.
10572 * msdos.c (IT_set_frame_parameters): Likewise.
10573 * xmenu.c (Fx_popup_dialog): Likewise.
10574 * w32menu.c (Fx_popup_dialog): Likewise.
10575
c8add24e
GM
105762012-07-11 Glenn Morris <rgm@gnu.org>
10577
4b575b3c
GM
10578 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
10579 since nothing has defined it on these platforms.
10580
09f4e3b0
GM
10581 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
10582 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
10583
172bedef
GM
10584 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
10585 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
10586 Move CLASH_DETECTION to configure.
10587
249685df
GM
10588 * s/gnu.h: Remove file, which is now empty.
10589
c8add24e
GM
10590 * s/gnu.h, s/gnu-linux.h:
10591 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
10592
b41253a3
JW
105932012-07-11 John Wiegley <johnw@newartisans.com>
10594
10595 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
10596 function attribute, so we only use it if it exists in the
10597 compiler.
10598
d923b542
DA
105992012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10600
10601 Avoid call to strlen in fast_c_string_match_ignore_case.
10602 * search.c (fast_c_string_match_ignore_case): Change to use
10603 length argument. Adjust users accordingly.
10604 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
10605
5ebbef1d
PE
106062012-07-11 Paul Eggert <eggert@cs.ucla.edu>
10607
bb352260
PE
10608 Assume mkdir, rmdir.
10609 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
10610 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
10611
57054ddd
PE
10612 Assume rename.
10613 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
10614
b747d3f7
PE
10615 Assume perror.
10616 * s/hpux10-20.h (HAVE_PERROR): Remove.
10617 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
10618 Remove dummy definition, as this problem was obsolete long ago.
10619
5ebbef1d
PE
10620 Assume strerror.
10621 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
10622
984e7f30
DA
106232012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
10624
10625 Avoid calls to strlen in font processing functions.
10626 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
10627 (font_open_by_name): Change to use length argument.
10628 Adjust users accordingly.
d923b542
DA
10629 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
10630 Adjust prototypes.
10631 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
10632 Change to return ptrdiff_t.
984e7f30
DA
10633 (xfont_list_pattern, xfont_match): Use length returned by
10634 xfont_decode_coding_xlfd.
10635 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
10636
20e94fdd
GM
106372012-07-11 Glenn Morris <rgm@gnu.org>
10638
9d596af3
GM
10639 * s/darwin.h, s/freebsd.h, s/netbsd.h:
10640 Move DONT_REOPEN_PTY to configure.
10641
20e94fdd
GM
10642 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
10643 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
10644
e99a530f
PE
106452012-07-10 Paul Eggert <eggert@cs.ucla.edu>
10646
22ffb973
PE
10647 Remove "#define unix" that is no longer needed (Bug#11905).
10648 * s/aix4-2.h (unix): Remove; no longer needed.
10649
e9a9ae03
PE
10650 EMACS_TIME simplification (Bug#11875).
10651 This replaces macros (which typically do not work in GDB)
10652 with functions, typedefs and enums, making the code easier to debug.
10653 The functional style also makes code easier to read and maintain.
10654 * systime.h: Include <sys/time.h> on all hosts, not just if
10655 WINDOWSNT, since 'struct timeval' is needed in general.
10656 (EMACS_TIME): Now a typedef, not a macro.
10657 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
10658 not macros.
10659 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
10660 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
10661 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
10662 (EMACS_TIME_LE): Now functions, not macros.
10663 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
10664 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
10665 which are not functions. All uses rewritten to use:
10666 (make_emacs_time): New function.
10667 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
10668 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
10669 not functions. All uses rewritten to use the following, respectively:
10670 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
10671 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 10672 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
10673 * fileio.c (Fcopy_file):
10674 * xterm.c (XTflash): Get the current time closer to when it's used.
10675 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
10676
ffacb126
PE
10677 * bytecode.c (targets): Suppress -Woverride-init warnings.
10678
e99a530f
PE
10679 Simplify by avoiding confusing use of strncpy etc.
10680 * doc.c (Fsnarf_documentation):
10681 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
10682 * frame.c (Fmake_terminal_frame):
10683 * gtkutil.c (get_utf8_string):
10684 * lread.c (openp):
10685 * nsmenu.m (ns_update_menubar):
10686 * regex.c (regerror):
10687 Prefer memcpy to strncpy and strncat when either will do.
10688 * fileio.c (Fsubstitute_in_file_name):
10689 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
10690 (menu_separator_name_p):
10691 * nsmenu.m (ns_update_menubar):
10692 Prefer memcmp to strncmp when either will do.
10693 * nsterm.m: Include <ftoastr.h>.
10694 (ns_get_color):
10695 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
10696 Prefer snprintf to strncpy.
10697 * nsterm.m (ns_term_init):
10698 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
10699 * nsterm.m (ns_term_init):
10700 Avoid the need for strncpy, by using build_string or
10701 make_unibyte_string directly. Use dtoastr, not snprintf.
10702 * process.c (Fmake_network_process): Diagnose service names that
10703 are too long, rather than silently truncating them or creating
10704 non-null-terminated names.
10705 (Fnetwork_interface_info): Likewise, for interface names.
10706 * sysdep.c (system_process_attributes) [GNU_LINUX]:
10707 Prefer sprintf to strncat.
10708 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
10709 Prefer vsnprintf to vsprintf + strncpy.
10710
c59592b3
GM
107112012-07-10 Glenn Morris <rgm@gnu.org>
10712
10713 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
10714 Clarify fallback case.
10715
7d7bbefd
DA
107162012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10717
10718 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
10719 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
10720 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 10721 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
10722 where argument type is known to be a Lisp_Cons.
10723
3a4c8000
TT
107242012-07-10 Tom Tromey <tromey@redhat.com>
10725
10726 * bytecode.c (BYTE_CODE_THREADED): New macro.
10727 (BYTE_CODES): New macro. Replaces all old byte-code defines.
10728 (enum byte_code_op): New type.
10729 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
10730 (exec_byte_code): Use them. Use token threading when applicable.
10731
2a0213a6
DA
107322012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10733
10734 Optimize pure C strings initialization.
10735 * lisp.h (make_pure_string): Fix prototype.
10736 (build_pure_c_string): New function, defined as static inline. This
10737 provides a better opportunity to optimize away calls to strlen when
10738 the function is called with compile-time constant argument.
10739 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
10740 argument, adjust users accordingly. Use build_pure_c_string where
10741 appropriate.
10742 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
10743 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
10744 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
10745
cb1caeaf
DA
107462012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10747
10748 Avoid calls to strlen in miscellaneous functions.
10749 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
10750 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
10751 * lread.c (openp): Likewise.
10752
c293e30c
DA
107532012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
10754
10755 Avoid calls to strlen in path processing functions.
10756 * fileio.c (file_name_as_directory): Add comment. Change to add
10757 srclen argument and return the length of result. Adjust users
10758 accordingly.
10759 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
10760 swap 1st and 2nd arguments to obey the common convention.
10761 Adjust users accordingly.
c293e30c
DA
10762 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
10763
9e059e3f
GM
107642012-07-10 Glenn Morris <rgm@gnu.org>
10765
d02eb359
GM
10766 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
10767 Move PENDING_OUTPUT_COUNT definition to configure.
10768
882cf227
GM
10769 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
10770 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
10771 * s/gnu.h (DATA_START): Move definitions to configure.
10772
af6e839f
GM
10773 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
10774 We include usg5-4-common.h, which defines them both.
10775
40289a12
GM
10776 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
10777 O_RDONLY already includes it).
10778
9e059e3f
GM
10779 Stop ns builds setting the EMACSLOADPATH environment variable.
10780 * nsterm.m (ns_load_path): Rename from ns_init_paths.
10781 Now it does not set EMACSLOADPATH, just returns the load-path string.
10782 * nsterm.h: Update accordingly.
10783 * lread.c [HAVE_NS]: Include nsterm.h.
10784 (init_lread) [HAVE_NS]: Use ns_load_path.
10785 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
10786
7c4e8ec0
GM
107872012-07-09 Glenn Morris <rgm@gnu.org>
10788
d4f600ff
GM
10789 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
10790 since the included bsd-common.h does so.
10791
cbb31951
GM
10792 Stop ns builds setting the EMACSPATH environment variable.
10793 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
10794 (ns_init_paths): Do not set EMACSPATH.
10795 * nsterm.h (ns_exec_path): Add it.
10796 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
10797 Use ns_exec_path.
10798
7c4e8ec0
GM
10799 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
10800
26bccfae
PE
108012012-07-09 Paul Eggert <eggert@cs.ucla.edu>
10802
a0bee46f
PE
10803 * process.c (wait_reading_process_output): 'waitchannels' was unset
10804 when read_kbd || !NILP (wait_for_cell); fix this.
10805
5994c183
PE
10806 Add GCC-style 'const' attribute to functions that can use it.
10807 * character.h (char_resolve_modifier_mask):
10808 * keyboard.h (make_ctrl_char):
10809 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
10810 (init_character_once, next_almost_prime, init_fns, init_image)
10811 (flush_pending_output, init_sound):
10812 * mem-limits.h (start_of_data):
10813 * menu.h (finish_menu_items):
10814 Add ATTRIBUTE_CONST.
10815 * emacs.c (DEFINE_DUMMY_FUNCTION):
10816 Declare the dummy function with ATTRIBUTE_CONST.
10817 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
10818 Add decls with ATTRIBUTE_CONST.
10819
26bccfae
PE
10820 Minor improvements to make_formatted_string.
10821 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10822 where int is good enough, as vsprintf returns an int.
10823 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10824
a8290ec3
DA
108252012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10826
10827 Use make_formatted_string to avoid double length calculation.
10828 * lisp.h (make_formatted_string): New prototype.
10829 * alloc.c (make_formatted_string): New function.
10830 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 10831 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
10832 * editfns.c (Fcurrent_time_zone): Likewise.
10833 * filelock.c (get_boot_time): Likewise.
10834 * frame.c (make_terminal_frame, set_term_frame_name)
10835 (x_report_frame_params): Likewise.
10836 * image.c (gs_load): Likewise.
10837 * minibuf.c (get_minibuffer): Likewise.
10838 * msdos.c (dos_set_window_size): Likewise.
10839 * process.c (make_process): Likewise.
10840 * xdisp.c (ensure_echo_area_buffers): Likewise.
10841 * xsettings.c (apply_xft_settings): Likewise.
10842
d01ba2f1
GM
108432012-07-09 Glenn Morris <rgm@gnu.org>
10844
10845 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10846 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10847 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10848 * nsterm.h (ns_etc_directory): Add it.
10849 * callproc.c [HAVE_NS]: Include nsterm.h.
10850 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10851
f1f924b6
DA
108522012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10853
10854 Move marker debugging code under MARKER_DEBUG.
10855 * marker.c (MARKER_DEBUG): Move marker debugging code under
10856 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10857 for bootstrap with --enable-checking (~3x slowdown reported
10858 by Juanma Barranquero <lekktu@gmail.com>).
10859 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10860
ab531b66
PE
108612012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10862
10863 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10864 See <http://bugs.gnu.org/11825#29>.
10865
c4b3bc8a
EZ
108662012-07-08 Eli Zaretskii <eliz@gnu.org>
10867
10868 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10869 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
10870 (display_line): Add commentary about displaying truncation glyphs
10871 on GUI frames.
10872 (produce_special_glyphs): Move here from term.c.
10873
10874 * term.c (produce_special_glyphs): Move to xdisp.c.
10875
10876 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10877 section.
c4b3bc8a 10878
b676b881
AS
108792012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10880
f17c5273
AS
10881 * xdisp.c (display_line): Avoid warning about implicit declaration
10882 of FRAME_FONT.
10883
298819b9
AS
10884 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10885
b676b881
AS
10886 * lisp.h: Remove empty conditional.
10887
6045c4fd
PE
108882012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10889
b3350bf9
PE
10890 * lread.c (load_path_check): Now static.
10891
6045c4fd
PE
10892 Fix some minor --with-ns problems found by static checking.
10893 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10894 (x_set_font) [!HAVE_X_WINDOWS]:
10895 * image.c (xpm_load_image) [HAVE_NS]:
10896 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10897 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10898 Remove unused local.
10899 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10900 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10901 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10902 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10903 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10904 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10905 Fix pointer signedness problem.
10906 * xfaces.c (FRAME_X_FONT_TABLE):
10907 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10908
929e7845
GM
109092012-07-07 Glenn Morris <rgm@gnu.org>
10910
10911 * lread.c (load_path_check): New function, split from init_lread.
10912 (init_lread): Reorganize. Motivation:
10913 If EMACSLOADPATH is set, check/warn about that rather than the
10914 defaults, which we are not going to use. Hence we can remove
10915 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10916 Don't warn if site-lisp directories are missing.
10917 If not installed, start from a blank load-path, since
10918 PATH_LOADSEARCH refers to the eventual installation directories.
10919
58dd0aa4
EZ
109202012-07-07 Eli Zaretskii <eliz@gnu.org>
10921
10922 Support truncation and continuation glyphs on GUI frames, when
10923 fringes are disabled. (Bug#11832)
10924 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
10925 continuation glyphs even if on GUI frames.
10926 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
10927 or both, are absent.
10928 (start_display, move_it_in_display_line_to): Handle the case of a
10929 GUI frame without a fringe to display continuation or truncation
10930 glyphs.
10931 (insert_left_trunc_glyphs): Support GUI frames: make sure
10932 truncation glyphs overwrite enough glyphs from the current line to
10933 have sufficient space in pixels.
10934 (display_line): Support truncation and continuation glyphs on GUI
10935 frames. If some spare pixels are left on the line after inserting
10936 the truncation glyphs, fill that space with a stretch glyph of a
10937 suitably computed width.
10938
10939 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10940 produce_glyphs, to support GUI sessions.
10941
31571fd7
PE
109422012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10943
5a16b9bc
PE
10944 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10945
f3047c75
PE
10946 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10947
31571fd7
PE
10948 Do not require float-time's arg to fit in time_t (Bug#11825).
10949 This works better on hosts where time_t is unsigned, and where
10950 float-time is applied to the (negative) difference between two times.
10951 * editfns.c (decode_time_components): Last arg is now double *,
10952 not int *, and means to store all the result as a double, without
10953 worrying about whether the seconds part fits in time_t.
10954 All callers changed.
10955 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10956 All callers changed.
10957 (Ffloat_time): Do not fail merely because the specified time falls
10958 outside of time_t range.
10959
4516fbef
GM
109602012-07-07 Glenn Morris <rgm@gnu.org>
10961
10962 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10963 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10964 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10965
07adc2c6
JB
109662012-07-07 Juanma Barranquero <lekktu@gmail.com>
10967
10968 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10969 Update dependencies.
10970
10971 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10972
fd573f31
PE
109732012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10974
fee5959d
PE
10975 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10976 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10977 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10978 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10979 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10980 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10981
fd573f31
PE
10982 * xfont.c (compare_font_names): Redo to omit the need for casts.
10983
ddadbc0e
AS
109842012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10985
fca8d6b6
AS
10986 * xfns.c (Fx_change_window_property): Doc fix.
10987 * w32fns.c (Fx_change_window_property): Doc fix.
10988
ddadbc0e
AS
10989 * w32fns.c (Fx_window_property): Accept the same arguments as the
10990 X Windows version. Doc fix.
10991 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10992
ed9265fc 109932012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
10994 Eli Zaretskii <eliz@gnu.org>
10995
10996 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10997 Windows-specific code from nt/config.nt moved here.
10998 Obsolete settings removed.
10999
216ee680
PE
110002012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11001
11002 * process.c: Avoid unnecessary calls to gettime.
11003 (wait_reading_process_output): Don't get the time of day
11004 when gobbling data immediately and not waiting, as there's no need
11005 for it in that case. This removes a FIXME.
11006
bdd091e4
JD
110072012-07-06 Jan Djärv <jan.h.d@swipnet.se>
11008
11009 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
11010 is defined (Bug#11768).
11011
9d44f8ce
DA
110122012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11013
11014 Fix marker debugging code.
11015 * marker.c (byte_char_debug_check): Do not perform the check
11016 if buffer is not multibyte.
090bd7cb
JB
11017 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11018 Call byte_char_debug_check with correct arguments.
9d44f8ce 11019
90fc4786
DA
110202012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11021
11022 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
11023 * marker.c (byte_char_debug_check, count_markers):
11024 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
11025 (byte_debug_flag): Remove.
11026 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
11027 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
11028
7b7ae965
DA
110292012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11030
4e57b342
DA
11031 Avoid code repetition in marker-related functions.
11032 * marker.c (attach_marker): New function.
11033 (Fset_marker, set_marker_restricted, set_marker_both)
11034 (set_marker_restricted_both): Use it.
11035 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
11036 Consistently rename charno to charpos.
11037 (marker_position): Add eassert.
11038 (marker_byte_position): Convert to eassert.
11039
110402012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11041
11042 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 11043 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 11044 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 11045
657924ff
DA
110462012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11047
11048 Introduce fast path for the widely used marker operation.
11049 * alloc.c (build_marker): New function.
11050 * lisp.h (build_marker): New prototype.
11051 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
11052 * composite.c (autocmp_chars): Likewise.
11053 * editfns.c (buildmark): Remove.
11054 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
11055 (save_restriction_save): Use build_marker.
11056 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
11057 * window.c (save_window_save): Likewise.
11058
041a49a6
DA
110592012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
11060
11061 Do not use Fdelete_overlay in delete_all_overlays
11062 to avoid redundant calls to unchain_overlay.
11063 * buffer.c (drop_overlay): New function.
11064 (delete_all_overlays, Fdelete_overlay): Use it.
11065 * minibuf.c (get_minibuffer): Fix comment.
11066
7dca65a4
PE
110672012-07-06 Paul Eggert <eggert@cs.ucla.edu>
11068
11069 Port to OpenBSD 5.1 amd64.
11070 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
11071 This is needed for OpenBSD, and should be harmless on all BSD systems.
11072 Also, include <sys/sysctl.h>, as it should be available on all
11073 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
11074 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
11075 use p_pid member, not kp_proc.pid.
11076
8eb876e2
GM
110772012-07-06 Glenn Morris <rgm@gnu.org>
11078
11079 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
11080
38182d90
PE
110812012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11082
11083 More xmalloc and related cleanup.
11084 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
11085 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
11086 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
11087 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
11088 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
11089 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
11090 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
11091 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
11092 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
11093 * xterm.c:
11094 Omit needless casts involving void * pointers and allocation.
11095 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
11096 as the former is more robust if P's type is changed.
11097 Prefer xzalloc to xmalloc + memset 0.
11098 Simplify malloc-or-realloc to realloc.
11099 Don't worry about xmalloc returning a null pointer.
11100 Prefer xstrdup to xmalloc + strcpy.
11101 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
11102 growing it.
11103 * keyboard.c (apply_modifiers_uncached): Prefer local array to
11104 alloca of a constant.
11105
6dd5a677
EZ
111062012-07-05 Eli Zaretskii <eliz@gnu.org>
11107
11108 * xdisp.c (display_line): Fix horizontal pixel coordinates when
11109 hscroll is larger than the line width. Fixes long and futile
11110 looping inside extend_face_to_end_of_line (on a TTY) producing
11111 glyphs that are not needed and thrown away.
11112
6b312f0f
DA
111132012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11114
11115 * marker.c (set_marker_restricted_both): Simplify by using
11116 clip_to_bounds.
11117
f520ef9b
PE
111182012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11119
11120 * editfns.c (region_limit): Simplify by using clip_to_bounds.
11121
383b7c95
JD
111222012-07-05 Jan Djärv <jan.h.d@swipnet.se>
11123
11124 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
11125 not defined (Bug#11768).
11126 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
11127 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
11128 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
11129 followed by gtk_box_set_homogeneous (Bug#11768).
11130 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
11131 (update_theme_scrollbar_width, xg_create_scroll_bar):
11132 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
11133 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
11134 (is_box_type): New function (Bug#11768).
11135 (xg_tool_item_stale_p): Call is_box_type.
5293d758 11136 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
11137 with default display (Bug#11768).
11138
d6e7bf45
EZ
111392012-07-05 Eli Zaretskii <eliz@gnu.org>
11140
11141 * xdisp.c (window_hscroll_limited): New function.
11142 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
11143 coordinates when window's hscroll is set to insanely large
11144 values. (Bug#11857)
11145
431391ec
JB
111462012-07-05 Juanma Barranquero <lekktu@gmail.com>
11147
11148 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
11149 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
11150
23f86fce
DA
111512012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
11152
11153 Cleanup xmalloc.
11154 * lisp.h (xzalloc): New prototype. Omit needless casts.
11155 * alloc.c (xzalloc): New function. Omit needless casts.
11156 * charset.c: Omit needless casts. Convert all calls to
11157 xmalloc with following memset to xzalloc.
11158 * dispnew.c: Likewise.
11159 * fringe.c: Likewise.
11160 * image.c: Likewise.
11161 * sound.c: Likewise.
11162 * term.c: Likewise.
11163 * w32fns.c: Likewise.
11164 * w32font.c: Likewise.
11165 * w32term.c: Likewise.
11166 * xfaces.c: Likewise.
11167 * xfns.c: Likewise.
11168 * xterm.c: Likewise.
11169 * atimer.c: Omit needless casts.
11170 * buffer.c: Likewise.
11171 * callproc.c: Likewise.
11172 * ccl.c: Likewise.
11173 * coding.c: Likewise.
11174 * composite.c: Likewise.
11175 * doc.c: Likewise.
11176 * doprnt.c: Likewise.
11177 * editfns.c: Likewise.
11178 * emacs.c: Likewise.
11179 * eval.c: Likewise.
11180 * filelock.c: Likewise.
11181 * fns.c: Likewise.
11182 * gtkutil.c: Likewise.
11183 * keyboard.c: Likewise.
11184 * lisp.h: Likewise.
11185 * lread.c: Likewise.
11186 * minibuf.c: Likewise.
11187 * msdos.c: Likewise.
11188 * print.c: Likewise.
11189 * process.c: Likewise.
11190 * region-cache.c: Likewise.
11191 * search.c: Likewise.
11192 * sysdep.c: Likewise.
11193 * termcap.c: Likewise.
11194 * terminal.c: Likewise.
11195 * tparam.c: Likewise.
11196 * w16select.c: Likewise.
11197 * w32.c: Likewise.
11198 * w32reg.c: Likewise.
11199 * w32select.c: Likewise.
11200 * w32uniscribe.c: Likewise.
11201 * widget.c: Likewise.
11202 * xdisp.c: Likewise.
11203 * xmenu.c: Likewise.
11204 * xrdb.c: Likewise.
11205 * xselect.c: Likewise.
11206
0497dc44
PE
112072012-07-05 Paul Eggert <eggert@cs.ucla.edu>
11208
11209 * fileio.c (time_error_value): Check the right error number.
11210 Problem reported by Troels Nielsen in
11211 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
11212
356e7178
PE
112132012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11214
4e71fd89
PE
11215 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
11216 This should be fixed in a better way; see Eli Zaretskii in
11217 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
11218 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
11219
f0941253
PE
11220 * fileio.c (time_error_value): Rename from special_mtime.
11221 The old name's problems were noted by Eli Zaretskii in
11222 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
11223
065c9eb4
PE
11224 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
11225 This variable's comment says Emacs needs at least one GDB-visible
11226 symbol of type enum pvec_type, to work around GDB problems.
11227 The symbol's value doesn't matter.
11228
356e7178
PE
11229 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
11230 that causes compilation to fail on pre-C99 compilers.
11231
ed9265fc 112322012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
11233
11234 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
11235 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
11236
3884d954
DA
112372012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11238
d209e2fb 11239 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
11240 headers for buffer_defaults and buffer_local_symbols.
11241 Reported by Juanma Barranquero <lekktu@gmail.com>.
11242
ee28be33
SM
112432012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11244
11245 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
11246 * lisp.h (enum pvec_type): Use fewer bits.
11247 (PSEUDOVECTOR_SIZE_BITS): New constant.
11248 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
11249 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
11250 change in pvec_type.
11251 (PSEUDOVECTOR_TYPEP): New macro.
11252 (TYPED_PSEUDOVECTORP): Use it.
11253 * fns.c (internal_equal): Adapt code to extract pvectype.
11254 * emacs.c (gdb_pvec_type): Update type.
11255 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
11256 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
11257 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
11258 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
11259 (sweep_vectors): Use it. Use local var `total_bytes' instead of
11260 abusing vector->header.next.nbytes.
11261 (live_vector_p): Use PVEC_TYPE.
11262 (mark_object): Adapt code to extract pvectype. Use switch.
11263
c7f2cd7f
PE
112642012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11265
11266 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
11267 Tighten new eassert a bit.
11268
8ce70ed2
DA
112692012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11270
11271 Fix compilation with --enable-gcc-warnings and -O1
11272 optimization level.
11273 * doprnt.c (doprnt): Change type of tem to int, initialize
11274 to avoid compiler warning. Add eassert.
11275 * search.c (simple_search): Initialize match_byte to avoid
11276 compiler warning. Add eassert.
11277
dea7f1e5
PE
112782012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11279
24a212eb
PE
11280 Avoid weird behavior with large horizontal scrolls.
11281 Without this change, for example, large hscroll values would
11282 mess up Emacs's display on Fedora 15 x86, presumably due to
11283 overflows in int calculations in the display code.
11284 Also, if buffers had long lines, Emacs would freeze.
11285 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
11286 (set_window_hscroll): New function, containing the old guts of
11287 Fset_window_hscroll. Return the clipped value.
11288 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
11289 This avoids the need to check against PTRDIFF_MAX.
11290
dea7f1e5
PE
11291 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
11292
76046526
DA
112932012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
11294
11295 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
11296
39adff0d
PE
112972012-07-04 Paul Eggert <eggert@cs.ucla.edu>
11298
63807d47
PE
11299 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
11300 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
11301 since GCC 4.4.6 issues a bogus warning for them.
11302
39adff0d
PE
11303 Fix bugs in file timestamp newness comparisons.
11304 * fileio.c (Ffile_newer_than_file_p):
11305 * lread.c (Fload): Use full timestamp resolution of files,
11306 not just the 1-second resolution, so that files that are only
11307 slightly newer still count as newer.
11308 * fileio.c (Ffile_newer_than_file_p): Don't assume file
11309 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
11310
dbeed9a6
PE
113112012-07-03 Paul Eggert <eggert@cs.ucla.edu>
11312
11313 * fileio.c: Improve handling of file time marker. (Bug#11852)
11314 (special_mtime): New function.
11315 (Finsert_file_contents, Fverify_visited_file_modtime):
11316 Use it to set special mtime values consistently.
11317
636334d6
AS
113182012-07-03 Andreas Schwab <schwab@linux-m68k.org>
11319
11320 * fileio.c (Finsert_file_contents): Properly handle st_mtime
11321 marker for non-existing file. (Bug#11852)
11322
e2017fe2
GM
113232012-07-03 Glenn Morris <rgm@gnu.org>
11324
11325 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
11326 and did not make it into globals.h).
11327
404dbd37
TT
113282012-07-03 Tom Tromey <tromey@redhat.com>
11329
11330 * window.c (Fset_window_margins, Fset_window_fringes)
11331 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
11332 * textprop.c (Fprevious_property_change): No longer static.
11333 * syntax.c (Fsyntax_table_p): No longer static.
11334 * process.c (Fget_process, Fprocess_datagram_address): No longer
11335 static.
11336 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
11337 * keyboard.c (Fcommand_execute): No longer static.
11338 Remove EXFUN.
11339 * insdel.c (Fcombine_after_change_execute): No longer static.
11340 * image.c (Finit_image_library): No longer static.
11341 * fileio.c (Fmake_symbolic_link): No longer static.
11342 * eval.c (Ffetch_bytecode): No longer static.
11343 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
11344 * doc.c (Fdocumentation_property, Fsnarf_documentation):
11345 No longer static.
404dbd37
TT
11346 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
11347 static.
11348 * dired.c (Ffile_attributes): No longer static.
11349 * composite.c (Fcomposition_get_gstring): No longer static.
11350 * callproc.c (Fgetenv_internal): No longer static.
11351
11352 * ccl.h: Remove EXFUNs.
11353 * buffer.h: Remove EXFUNs.
11354 * dispextern.h: Remove EXFUNs.
11355 * intervals.h: Remove EXFUNs.
11356 * fontset.h: Remove EXFUN.
11357 * font.h: Remove EXFUNs.
11358 * dosfns.c (system_process_attributes): Remove EXFUN.
11359 * keymap.h: Remove EXFUNs.
11360 * lisp.h: Remove EXFUNs.
11361 * w32term.h: Remove EXFUNs.
11362 * window.h: Remove EXFUNs.
11363 * xsettings.h: Remove EXFUN.
11364 * xterm.h: Remove EXFUN.
11365
8e4fd1e1
GM
113662012-07-03 Glenn Morris <rgm@gnu.org>
11367
11368 * lisp.h (Frandom): Make it visible to C.
11369 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
11370 buffer for invisible buffers. (Bug#1229)
11371
ca95b3eb
DA
113722012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11373
11374 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
11375 values which aren't power of 2.
14ae4239 11376 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 11377 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
11378 accordingly.
11379
7555c33f
SM
113802012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
11381
11382 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
11383
11384 * alloc.c (mark_object): Revert part of last patch to use `switch'.
11385
d12e8f5a
DA
113862012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11387
11388 * alloc.c (allocate_vector_block): Remove redundant
11389 calls to mallopt if DOUG_LEA_MALLOC is defined.
11390 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
11391 avoid calls to mallopt if zero_vector is returned.
11392
296094c3
DA
113932012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11394
11395 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
11396 is enabled, avoid dereferencing NULL current_sblock if
11397 running undumped.
11398
36429c89
DA
113992012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
11400
11401 Cleanup basic buffer management.
11402 * buffer.h (struct buffer): Change layout to use generic vector
11403 marking code. Fix some comments. Change type of 'clip_changed'
11404 to bitfield. Remove unused #ifndef old.
11405 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
11406 (GET_OVERLAYS_AT): Fix indentation.
11407 (for_each_per_buffer_object_at): New macro.
11408 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
11409 (Fbuffer_local_variables): Use it.
11410 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
11411 * alloc.c (allocate_buffer): Adjust to match new layout of
11412 struct buffer. Fix comment.
11413 (mark_overlay): New function.
11414 (mark_buffer): Use it. Use mark_vectorlike to mark normal
11415 Lisp area of struct buffer.
11416 (mark_object): Use it. Adjust marking of misc objects
11417 and related comments.
11418
3b3e4cac
PE
114192012-07-02 Paul Eggert <eggert@cs.ucla.edu>
11420
11421 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
11422 wrapper that is not needed because the wrapped code is a no-op (zero
11423 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
11424 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
11425
cf5c0175
DA
114262012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
11427
11428 * alloc.c (mark_buffer): Simplify. Remove prototype.
11429 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 11430 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
11431 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
11432 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 11433
ca26824c
GM
114342012-06-30 Glenn Morris <rgm@gnu.org>
11435
2e4c5312
GM
11436 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
11437
ca26824c
GM
11438 * epaths.in (PATH_SITELOADSEARCH): New.
11439 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
11440 This is rather than relying on --enable-locallisppath elements
11441 having "site-lisp" in their names. (Bug#10208#25, 11658)
11442
0d23c240
EZ
114432012-06-30 Eli Zaretskii <eliz@gnu.org>
11444
c9240d7a
EZ
11445 * w32proc.c (sys_select): Accept and ignore one more argument.
11446
11447 * w32.c (emacs_gnutls_pull): Call select with one more argument.
11448
0d23c240 11449 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 11450 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
11451
11452 * sysdep.c: Don't include dos.h and dosfns.h.
11453
11454 * process.c (sys_select):
11455 * msdos.c (sys_select): Accept one more argument and ignore it.
11456
11457 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
11458 adapt data types and code to that.
11459
11460 * dosfns.c:
11461 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
11462 which clashes with the gnulib function of the same name.
11463
af5a5a98
AS
114642012-06-30 Andreas Schwab <schwab@linux-m68k.org>
11465
c5e4379c
AS
11466 * font.c (font_style_to_value, font_style_symbolic)
11467 (font_prop_validate_style): Add type checks for values in
11468 font_style_table.
11469
af5a5a98
AS
11470 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
11471 argument.
11472 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
11473 uses.
11474
8d38f461
EZ
114752012-06-29 Eli Zaretskii <eliz@gnu.org>
11476
2e5a6631
EZ
11477 * xdisp.c (try_window_id): Undo last change.
11478
8d38f461
EZ
11479 * w32.c (getwd): Adjust commentary about startup_dir.
11480 (init_environment): Always call sys_access, even in non-MSVC
11481 builds. Don't chdir to the directory of the Emacs executable.
11482 This undoes code from 1997 which was justified by the need to
11483 "avoid conflicts when removing and renaming directories". But its
11484 downside was that every relative file name was being interpreted
11485 relative to the directory of the Emacs executable, which can never
11486 be TRT. In particular, it broke sys_access when called with
11487 relative file names.
11488 (sys_access): Map GetLastError to errno.
11489
2af3565e
DA
114902012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11491
11492 * window.h (struct window): Change type of 'fringes_outside_margins'
11493 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 11494 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
11495 Adjust comment.
11496 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
11497 to ptrdiff_t.
11498
c8d3a25c 114992012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 11500
c8d3a25c
GM
11501 * gnutls.c (emacs_gnutls_handshake):
11502 Add QUIT to make the loop interruptible.
57570cd3 11503
c8d3a25c 115042012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 11505
c8d3a25c
GM
11506 * charset.c (init_charset): Make lack of etc/charsets fatal.
11507
3e984ee8
DA
115082012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11509
11510 * editfns.c (region_limit): Fix type mismatch.
11511
ef884f23
DA
115122012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
11513
11514 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
11515 undefined. Convert from xassert to eassert.
11516 * nsmenu.m: Convert from xassert to eassert.
11517 * nsterm.m: Likewise.
11518
7d7e0027
SM
115192012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
11520
11521 * editfns.c (region_limit): Clip to narrowing (bug#11770).
11522
aa754e6a
PE
115232012-06-28 Paul Eggert <eggert@cs.ucla.edu>
11524
11525 Avoid integer overflow on scroll-left and scroll-right.
11526 * window.c (HSCROLL_MAX): New macro.
11527 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
11528 overflow when requested scroll falls outside ptrdiff_t range.
11529
80b00b08
DA
115302012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11531
11532 * window.h (struct window): Change type of 'hscroll',
11533 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
11534 'last_modified' and 'last_overlay_modified' to EMACS_INT.
11535 Adjust users accordingly.
11536 * xdisp.c (try_cursor_movement): Replace type check with eassert.
11537 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
11538 from EMACS_INT to ptrdiff_t.
11539 (make_window): Omit redundant initialization.
11540
62b2bcf6
JB
115412012-06-28 Juanma Barranquero <lekktu@gmail.com>
11542
11543 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
11544
45942c7d
DA
115452012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11546
11547 * window.h (struct window): Change type of 'use_time' and
11548 'sequence_number' from Lisp_Object to int.
11549 * frame.c (make_frame): Adjust users accordingly.
11550 * print.c (print_object): Likewise.
11551 * window.c (select_window, Fwindow_use_time, make_parent_window)
11552 (make_window): Likewise.
11553
e509cfa6
DA
115542012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11555
11556 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
11557 enabled with --enable-checking=[all,glyphs] configure option.
11558 Fix GLYPH_DEBUG usage assuming that it may be undefined,
11559 adjust comments accordingly.
11560 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
11561 undefined, adjust comments accordingly.
11562 * image.c: Likewise.
11563 * scroll.c: Likewise.
11564 * w32fns.c: Likewise.
11565 * w32term.c: Likewise.
11566 * xdisp.c: Likewise.
11567 * xfaces.c: Likewise.
11568 * xfns.c: Likewise.
11569 * xterm.c: Likewise.
11570
a54e2c05
DA
115712012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
11572
11573 Generalize run-time debugging checks.
11574 * dispextern.h (XASSERTS): Remove.
11575 * fontset.c (xassert): Remove.
11576 Convert from xassert to eassert.
11577 * alloc.c: Convert from xassert to eassert.
11578 * bidi.c: Likewise.
11579 * dispnew.c: Likewise.
11580 * fns.c: Likewise.
11581 * fringe.c: Likewise.
11582 * ftfont.c: Likewise.
11583 * gtkutil.c: Likewise.
11584 * image.c: Likewise.
11585 * keyboard.c: Likewise.
11586 * menu.c: Likewise.
11587 * process.c: Likewise.
11588 * scroll.c: Likewise.
11589 * sound.c: Likewise.
11590 * term.c: Likewise.
11591 * w32console.c: Likewise.
11592 * w32fns.c: Likewise.
11593 * w32term.c: Likewise.
11594 * window.c: Likewise.
11595 * xdisp.c: Likewise.
11596 * xfaces.c: Likewise.
11597 * xfns.c: Likewise.
11598 * xselect.c: Likewise.
11599 * xterm.c: Likewise.
11600
1ec4b7b2
SM
116012012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
11602
11603 * fns.c (maybe_resize_hash_table): Output message when growing the
11604 purify-hashtable.
11605
2014308a
DA
116062012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11607
11608 * alloc.c (allocate_string_data): Remove dead code.
11609 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
11610 avoid GCC warning about unused macro.
11611
246155eb
DA
116122012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11613
11614 * alloc.c (allocate_string): Omit intervals initialization.
11615 * alloc.c (make_uninit_multibyte_string): Initialize intervals
11616 as in make_pure_string and make_pure_c_string.
11617
43184b7b
DA
116182012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11619
d209e2fb 11620 * alloc.c (allocate_string): Fix last change.
43184b7b 11621
3fe6dd74
DA
116222012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
11623
d209e2fb 11624 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
11625 to memset, add explicit initialization where appropriate.
11626
1ba6038a
GM
116272012-06-27 Glenn Morris <rgm@gnu.org>
11628
11629 * lisp.mk (lisp): Remove paths.elc.
11630
c89926a5
CY
116312012-06-27 Chong Yidong <cyd@gnu.org>
11632
11633 * doc.c (Fsubstitute_command_keys): Fix punctuation.
11634
ed6b3510
JW
116352012-06-26 John Wiegley <johnw@newartisans.com>
11636
1ec4b7b2 11637 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
11638 on Mac OS X Lion: __mod_init_func and __mod_term_func.
11639
ed6b3510
JW
11640 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
11641 when building with Clang.
11642
8edd4a2b
SM
116432012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
11644
11645 * eval.c (Fapply): Allow calling it with a single argument.
11646
f6f62d1b
EZ
116472012-06-26 Eli Zaretskii <eliz@gnu.org>
11648
11649 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
11650 _stricmp and _strnicmp.
11651 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
11652
62efea5e
DA
116532012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11654
11655 * alloc.c (allocate_window): Zero out non-Lisp part of newly
11656 allocated window.
11657 (allocate_process): Likewise for new process.
8edd4a2b 11658 (allocate_terminal): Change to use offsetof.
62efea5e
DA
11659 (allocate_frame): Likewise.
11660 * frame.c (make_frame): Omit redundant initialization.
11661 * window.c (make_parent_window): Use memset.
11662 (make_window): Omit redundant initialization.
11663 * process.c (make_process): Omit redundant initialization.
11664 * terminal.c (create_terminal): Likewise.
11665
42997f4d
DA
116662012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11667
11668 * term.c (delete_tty): Remove redundant call to memset.
11669
1130ecfc
DA
116702012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
11671
11672 * alloc.c: Remove build_string.
11673 * lisp.h: Define build_string as static inline. This provides
11674 a better opportunity to optimize away calls to strlen when the
11675 function is called with compile-time constant argument.
11676 * image.c (imagemagick_error): Convert to build_string.
11677 * w32proc.c (sys_spawnve): Likewise.
11678 * xterm.c (x_term_init): Likewise.
11679
cf38a720
PE
116802012-06-26 Paul Eggert <eggert@cs.ucla.edu>
11681
99027bdd
PE
11682 Use sprintf return value instead of invoking strlen on result.
11683 In the old days this wasn't portable, since some sprintf
11684 implementations returned char *. But they died out years ago and
11685 Emacs already assumes sprintf returns int.
11686 Similarly for float_to_string.
11687 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
11688 * ccl.c (ccl_driver):
11689 * character.c (string_escape_byte8):
11690 * data.c (Fnumber_to_string):
11691 * doprnt.c (doprnt):
11692 * print.c (print_object):
11693 * xdisp.c (message_dolog):
11694 * xfns.c (syms_of_xfns):
11695 Use sprintf or float_to_string result to avoid need to call strlen.
11696 * data.c (Fnumber_to_string):
11697 Use make_unibyte_string, since the string must be ASCII.
11698 * lisp.h, print.c (float_to_string): Now returns int length.
11699 * term.c (produce_glyphless_glyph):
11700 Use sprintf result rather than recomputing it.
11701
cf38a720
PE
11702 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
11703 * Makefile.in (ALL_CFLAGS):
11704 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
11705 * gmalloc.c, regex.c: Include <config.h> unconditionally.
11706
3511c784
DA
117072012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11708
0a08eb21 11709 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
11710 strcasecmp if available.
11711 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
11712
fb7da12e
AS
117132012-06-25 Andreas Schwab <schwab@linux-m68k.org>
11714
11715 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
11716 Avoid comma operator.
11717 * menu.c (push_submenu_start, push_submenu_end)
11718 (push_left_right_boundary, push_menu_pane): Likewise.
11719 * msdos.c (dos_rawgetc): Likewise.
11720
afa2ffd8
DA
117212012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11722
11723 * xfns.c (xic_create_fontsetname): Remove redundant calls
11724 to memset.
11725
b3b4476b
PE
117262012-06-25 Paul Eggert <eggert@cs.ucla.edu>
11727
4495ff38
PE
11728 * gtkutil.c (get_utf8_string): Remove redundant assignment.
11729 sprintf already null-terminates its output.
11730
b3b4476b
PE
11731 * xfns.c (x_window): Remove redundant cast.
11732
b00876c9
DA
117332012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
11734
11735 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
11736 `const char *' to `char *' to avoid compiler warning.
11737
d188e26b
PE
117382012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11739
885d1d74
PE
11740 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
11741 instead of truncating it to 63 (admittedly a generous limit).
11742
d188e26b
PE
11743 * process.c: Fix spelling and caps in comments.
11744
e2f560b1
DN
117452012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
11746
e86db54b 11747 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
11748 * sysdep.c (setpgrp): Remove definition, not used in this file.
11749
7583a3a1
JB
117502012-06-24 Juanma Barranquero <lekktu@gmail.com>
11751
11752 * makefile.w32-in: Update dependencies.
11753
696056c2
EZ
117542012-06-24 Eli Zaretskii <eliz@gnu.org>
11755
11756 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
11757 (SYSTIME_H): Add nt/inc/sys/time.h.
11758
11759 * systime.h [WINDOWSNT]: Include sys/time.h.
11760
11761 * s/ms-w32.h (struct timespec): Definition moved from
11762 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
11763
845ca893
PE
117642012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11765
11766 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
11767 * buffer.h (buffer_slot_type_mismatch):
11768 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11769 * eval.c (unwind_to_catch):
11770 * image.c (my_png_error, my_error_exit):
11771 * keyboard.c (quit_throw_to_read_char, user_error)
11772 (Fexit_recursive_edit, Fabort_recursive_edit):
11773 * lisp.h (die, args_out_of_range, args_out_of_range_3)
11774 (wrong_type_argument, buffer_overflow, __executable_start)
11775 (memory_full, buffer_memory_full, string_overflow, Fthrow)
11776 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
11777 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
11778 (fatal):
11779 (child_setup) [!DOS_NT]:
11780 * lread.c (end_of_file_error, invalid_syntax):
11781 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
11782 * puresize.h (pure_write_error):
11783 * search.c (matcher_overflow):
11784 * sound.c (sound_perror, alsa_sound_perror):
11785 * sysdep.c, syssignal.h (croak):
11786 * term.c (maybe_fatal, vfatal):
11787 * textprop.c (text_read_only):
11788 * undo.c (user_error):
11789 * unexmacosx.c (unexec_error):
11790 * xterm.c (x_ins_del_lines, x_delete_glyphs):
11791 Use _Noreturn rather than NO_RETURN.
11792 No need for separate decl merely because of _Noreturn.
11793 * sound.c (sound_warning, parse_sound):
11794 Remove unnecessary forward decls.
11795
f1dd8073
PE
117962012-06-24 Paul Eggert <eggert@cs.ucla.edu>
11797
11798 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
11799 * lisp.h (WAIT_READING_MAX): New macro.
11800 * dispnew.c (Fsleep_for, sit_for):
11801 * keyboard.c (kbd_buffer_get_event):
11802 * process.c (Faccept_process_output):
11803 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
11804 This improves on the previous patch, which introduced a bug
11805 when time_t is unsigned and as wide as intmax_t.
11806 See <http://bugs.gnu.org/9000#51>.
11807
b82c1755
EZ
118082012-06-23 Eli Zaretskii <eliz@gnu.org>
11809
11810 * dispnew.c (sit_for, Fsleep_for):
11811 * keyboard.c (kbd_buffer_get_event):
11812 * process.c (Faccept_process_output): Avoid compiler warnings when
11813 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
11814
ca300656
JB
118152012-06-23 Juanma Barranquero <lekktu@gmail.com>
11816
049ec95b
JB
11817 * makefile.w32-in: Update dependencies.
11818
ca300656
JB
11819 * w32.c (ltime): Add return type and declare static.
11820 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11821
db7b8d06
PE
118222012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11823
11824 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11825 Privately reported by Herbert J. Skuhra.
11826 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11827 All uses changed.
11828 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11829 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11830
0bd8297f
EZ
118312012-06-23 Eli Zaretskii <eliz@gnu.org>
11832
96512555
EZ
11833 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11834 last argument of make_unibyte_string.
11835
0bd8297f
EZ
11836 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11837 language ID in the event parameters.
11838
11839 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11840 event.code, not the obscure "character set ID".
11841
63def6b6
CY
118422012-06-23 Chong Yidong <cyd@gnu.org>
11843
11844 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11845
e8a02204
EZ
118462012-06-23 Eli Zaretskii <eliz@gnu.org>
11847
388cdec0
EZ
11848 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11849 * w32.c (fdutimens): New function.
11850
11851 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11852
11853 * s/ms-w32.h (pselect): Redirect to sys_select.
11854
11855 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11856
e8a02204
EZ
11857 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11858 in the logic of incrementing and decrementing the value of
11859 use_relocatable_buffers.
11860
d054f3fb
PE
118612012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11862
11863 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11864 Privately reported by Herbert J. Skuhra.
11865 [__FreeBSD__]: Remove "*/" typo after "#include".
11866 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11867 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11868 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11869 Don't assume EMACS_TIME and struct timeval are the same type.
11870
d35af63c
PE
118712012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11872
11873 Support higher-resolution time stamps (Bug#9000).
11874 The time stamps are only nanosecond-resolution at the C level,
11875 since that's the best that any real-world system supports now.
11876 But they are picosecond-resolution at the Lisp level, as that's
11877 easy, and leaves room for future OS improvements.
11878
11879 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11880 (LIBES): Use it.
11881
11882 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11883 Don't get current time unless it's needed.
11884
11885 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11886 now provides it if it's absent.
11887 (start_atimer): Port to higher-res time stamps.
11888 Check for time stamp overflow. Don't get current time more
11889 often than is needed.
11890
11891 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11892 Include systime.h, not time.h.
11893 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11894
11895 * dired.c: Include stat-time.h.
11896 (Ffile-attributes): File times now have higher resolution.
11897
11898 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11899 (struct image): Timestamp now has higher resolution.
11900
11901 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11902 has at least microseconds now. All uses removed.
11903 (update_frame, update_single_window, update_window, update_frame_1)
11904 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 11905 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
11906
11907 * editfns.c (time_overflow): Now extern.
11908 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11909 (float-time, Fformat_time_string, Fcurrent_time_string)
11910 (Fcurrent_time_zone): Accept and generate higher-resolution
11911 time stamps.
11912 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11913 (decode_time_components, lisp_seconds_argument): New functions.
11914 (make_time): Now static.
11915 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11916 Report an error if the time is invalid, rather than having the caller
11917 do that.
11918
11919 * fileio.c: Include <stat-time.h>
11920 (Fcopy_file): Copy higher-resolution time stamps.
11921 Prefer to set the time stamp via a file descriptor if that works.
11922 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11923 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11924 (Fvisited_file_modtime, Fset_visited_file_modtime):
11925 Support higher-resolution time stamps.
11926
11927 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11928
11929 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11930
11931 * image.c (prepare_image_for_display, clear_image_cache)
11932 (lookup_image): Port to higer-resolution time stamps.
11933
11934 * keyboard.c (start_polling, bind_polling_period):
11935 Check for time stamp overflow.
11936 (read_char, kbd_buffer_get_event, timer_start_idle)
11937 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11938 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11939 Port to higher-resolution time stamps. Do not assume time_t is signed.
11940 (decode_timer): New function. Timers are now vectors of length 9,
11941 not 8, to accommodate the picosecond component.
11942 (timer_check_2): Use it.
11943
11944 * nsterm.m (select_timeout, timeval_subtract): Remove.
11945 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11946 as they're a bit more accurate and handle overflow better.
11947 (ns_select): Change prototype to be compatible with pselect.
11948 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11949 * nsterm.h (ns_select): Adjust prototype.
11950
11951 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11952 us-resolution time stamps.
11953 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11954
11955 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11956
11957 * lisp.h (time_overflow): New decl.
11958 (wait_reading_process_output): First arg is now intmax_t, not int,
11959 to accommodate larger waits.
11960
11961 * process.h (struct Lisp_Process.read_output_delay):
11962 Now counts nanoseconds, not microseconds.
11963 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11964 EMACS_HAS_USECS.
11965 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11966 (wait_reading_process_output):
11967 Port to ns-resolution time stamps.
11968 (Faccept_process_output, wait_reading_process_output):
11969 Check for time stamp overflow. Do not assume time_t is signed.
11970 (select_wrapper): Remove; we now use pselect.
11971 (Fprocess_attributes): Now generates ns-resolution time stamps.
11972
11973 * sysdep.c: Include utimens.h. Don't include utime.h
11974 or worry about struct utimbuf; gnulib does that for us now.
11975 (gettimeofday): Remove; gnulib provides a substitute.
11976 (make_timeval): New function.
11977 (set_file_times): Now sets ns-resolution time stamps.
11978 New arg FD; all uses changed.
11979 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11980 (system_process_attributes):
11981 Now returns ns-resolution time stamp. All uses changed.
11982 Check for time stamp overflow.
11983
11984 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11985 provides a substitute now.
11986
11987 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11988 since it guarantees struct timespec.
11989 (EMACS_TIME): Now struct timespec, so that we can support
11990 ns-resolution time stamps.
11991 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11992 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11993 (EMACS_USECS): Remove.
11994 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11995 so multiply the arg by 1000 before storing it.
11996 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11997 New macros.
11998 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11999 Port to ns-resolution time stamps.
12000 (EMACS_TIME_NEG_P): Remove; replaced by....
12001 (EMACS_TIME_SIGN): New macro.
12002 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
12003 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
12004 (set_file_times, make_time, lisp_time_argument): Adjust signature.
12005 (make_timeval, make_lisp_time, decode_time_components): New decls.
12006 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
12007 that it mishandled time_t overflow. You can't compare by subtracting!
12008 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
12009 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
12010
12011 * term.c: Include <sys/time.h>.
12012 (timeval_to_Time): New function, for proper overflow wraparound.
12013 (term_mouse_position, term_mouse_click): Use it.
12014
12015 * undo.c (record_first_change): Support higher-resolution time stamps
12016 in the undo buffer.
12017 (Fprimitive_undo): Use them when restoring time stamps.
12018
12019 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
12020 (w32_get_internal_run_time):
12021 Port to higher-resolution Emacs time stamps.
12022 (ltime): Now accepts single 64-bit integer, as that's more convenient
12023 for callers.
12024
12025 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
12026
12027 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
12028 for compatibility with pselect. Support ns-resolution time stamps.
12029
12030 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
12031
12032 * xselect.c (wait_for_property_change, x_get_foreign_selection):
12033 Check for time stamp overflow, and support ns-resolution time stamps.
12034
12035 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
12036 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
12037 (timeval_subtract): Remove; no longer needed.
12038 (XTflash, XTring_bell, x_wait_for_event):
12039 Port to ns-resolution time stamps. Don't assume time_t is signed.
12040
b6a92dfe
CY
120412012-06-22 Chong Yidong <cyd@gnu.org>
12042
12043 * xdisp.c (x_consider_frame_title): Revert last change.
12044
d251c37c
EZ
120452012-06-22 Eli Zaretskii <eliz@gnu.org>
12046
12047 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
12048 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
12049 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
12050 staticidx goes up to 1597 out of 1600 = 0x640.)
12051
f10deafb
PE
120522012-06-20 Paul Eggert <eggert@cs.ucla.edu>
12053
12054 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
12055 Otherwise, the umask might be mistakenly 0 while handling input signals.
12056
ec6de1e2
SM
120572012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
12058
12059 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
12060
28be1ada
DA
120612012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
12062
12063 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
12064 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
12065 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
12066 access to `contents' member of Lisp_Vector objects with AREF and ASET
12067 where appropriate.
12068
c6bf3022
CY
120692012-06-19 Chong Yidong <cyd@gnu.org>
12070
12071 * frame.c (delete_frame): When selecting a frame on a different
12072 text terminal, do not alter the terminal's top-frame.
12073
12074 * xdisp.c (format_mode_line_unwind_data): Record the target
12075 frame's selected window and its terminal's top-frame.
12076 (unwind_format_mode_line): Restore them.
12077 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
12078 Callers changed.
12079 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
12080 since tty frames can be explicitly named.
12081 (prepare_menu_bars): Likewise.
12082
12083 * term.c (Ftty_top_frame): New function.
12084
defd4196
PE
120852012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12086
12087 Port byte-code-meter to modern targets.
12088 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
12089 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 12090 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
12091 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
12092 (METER_1, METER_2): Simplify.
12093
1053a871
SM
120942012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
12095
12096 * data.c (Fdefalias): Return `symbol' (bug#11686).
12097
b7e8d081
MR
120982012-06-18 Martin Rudalics <rudalics@gmx.at>
12099
12100 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
12101 gets killed during executing of this function (Bug#11665).
12102 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
12103 (Vkill_buffer_query_functions): In doc-string say that functions
12104 run by this hook should not change the current buffer.
12105
7ea2b339
PE
121062012-06-18 Paul Eggert <eggert@cs.ucla.edu>
12107
12108 Fix recently-introduced process.c problems found by static checking.
12109 * process.c (write_queue_push, write_queue_pop, send_process):
12110 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
12111 (write_queue_pop): Fix pointer signedness problem.
12112 (send_process): Remove unused local.
12113
96a313a1
CY
121142012-06-17 Chong Yidong <cyd@gnu.org>
12115
12116 * xdisp.c (redisplay_internal): No need to redisplay terminal
12117 frames that are not on top.
12118
20ca2e94
TN
121192012-06-17 Troels Nielsen <bn.troels@gmail.com>
12120
12121 * process.c (make_process): Initialize write_queue.
12122 (write_queue_push, write_queue_pop): New functions.
12123 (send_process): Use them to maintain correct ordering of process
12124 writes (Bug#10815).
12125
9a900ca9
PE
121262012-06-17 Paul Eggert <eggert@cs.ucla.edu>
12127
310fbfa8
PE
12128 * lisp.h (eassert): Assume C89 or later.
12129 This removes the need for CHECK.
12130 (CHECK): Remove. Its comments about always evaluating its
12131 argument were confusing, as 'eassert' typically does not evaluate
12132 its argument.
12133
27bb1ca4
PE
12134 * coding.c (produce_chars): Use ptrdiff_t, not int.
12135
9a900ca9
PE
12136 * xterm.c (x_draw_underwave): Check for integer overflow.
12137 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
12138
41b7f8bc 121392012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
12140
12141 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
12142 referenced (Bug#11583).
12143
9b0e3eba
AA
121442012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
12145
12146 Implement wave-style variant of underlining.
12147 * dispextern.h (face_underline_type): New enum.
12148 (face): Add field for underline type.
12149 * nsterm.m (ns_draw_underwave): New function.
12150 (ns_draw_text_decoration): Use it.
12151 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
12152 New functions.
12153 (x_draw_glyph_string): Use them.
12154 * xfaces.c (Qline, Qwave): New Lisp objects.
12155 (check_lface_attrs, merge_face_ref)
1053a871
SM
12156 (Finternal_set_lisp_face_attribute, realize_x_face):
12157 Handle wave-style underline face attributes.
9b0e3eba
AA
12158 * xterm.c (x_draw_underwave): New function.
12159 (x_draw_glyph_string): Use it.
12160
0fb52f11
JB
121612012-06-16 Juanma Barranquero <lekktu@gmail.com>
12162
12163 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
12164 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
12165 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
12166 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
12167 ($(BLD)/w32select.$(O)): Update dependencies.
12168
e5560ff7
AS
121692012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12170
12171 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
12172 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
12173 * character.c (_fetch_multibyte_char_p): Remove.
12174 * alloc.c: Include "character.h" before "buffer.h".
12175 * bidi.c: Likewise.
12176 * buffer.c: Likewise.
12177 * bytecode.c: Likewise.
12178 * callint.c: Likewise.
12179 * callproc.c: Likewise.
12180 * casefiddle.c: Likewise.
12181 * casetab.c: Likewise.
12182 * category.c: Likewise.
12183 * cmds.c: Likewise.
12184 * coding.c: Likewise.
12185 * composite.c: Likewise.
12186 * dired.c: Likewise.
12187 * dispnew.c: Likewise.
12188 * doc.c: Likewise.
12189 * dosfns.c: Likewise.
12190 * editfns.c: Likewise.
12191 * emacs.c: Likewise.
12192 * fileio.c: Likewise.
12193 * filelock.c: Likewise.
12194 * font.c: Likewise.
12195 * fontset.c: Likewise.
12196 * fringe.c: Likewise.
12197 * indent.c: Likewise.
12198 * insdel.c: Likewise.
12199 * intervals.c: Likewise.
12200 * keyboard.c: Likewise.
12201 * keymap.c: Likewise.
12202 * lread.c: Likewise.
12203 * macros.c: Likewise.
12204 * marker.c: Likewise.
12205 * minibuf.c: Likewise.
12206 * nsfns.m: Likewise.
12207 * nsmenu.m: Likewise.
12208 * print.c: Likewise.
12209 * process.c: Likewise.
12210 * regex.c: Likewise.
12211 * region-cache.c: Likewise.
12212 * search.c: Likewise.
12213 * syntax.c: Likewise.
12214 * term.c: Likewise.
12215 * textprop.c: Likewise.
12216 * undo.c: Likewise.
12217 * unexsol.c: Likewise.
12218 * w16select.c: Likewise.
12219 * w32fns.c: Likewise.
12220 * w32menu.c: Likewise.
12221 * window.c: Likewise.
12222 * xdisp.c: Likewise.
12223 * xfns.c: Likewise.
12224 * xmenu.c: Likewise.
12225 * xml.c: Likewise.
12226 * xselect.c: Likewise.
12227
2f07e6af
EZ
122282012-06-16 Eli Zaretskii <eliz@gnu.org>
12229
1053a871
SM
12230 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
12231 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 12232 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
12233 row.
12234 (handle_face_prop): Use chunk-relative overlay string index when
12235 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
12236 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
12237 the rightmost. (Bug#11720)
2f07e6af 12238
29b83cec
AS
122392012-06-16 Andreas Schwab <schwab@linux-m68k.org>
12240
12241 * category.h (CHAR_HAS_CATEGORY): Define as inline.
12242 (CATEGORY_MEMBER): Enforce 1/0 value.
12243 * category.c (_temp_category_set): Remove.
12244
4c5501e9
EZ
122452012-06-16 Eli Zaretskii <eliz@gnu.org>
12246
12247 * window.c (Fdelete_other_windows_internal)
12248 (Fdelete_window_internal): Don't access frame's mouse highlight
12249 info of the initial frame. (Bug#11677)
12250
2b570124
PE
122512012-06-14 Paul Eggert <eggert@cs.ucla.edu>
12252
e93864f9
PE
12253 * .gdbinit (xgetint): Fix recently-introduced paren typo.
12254 Assume USE_2_TAGS_FOR_INTS.
12255 (xreload): Adjust $tagmask width to match recent lisp.h change.
12256
2b570124
PE
12257 Simplify lisp.h in minor ways that should not affect code.
12258 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
12259 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
12260 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
12261 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
12262 (INTTYPEBITS): New macro, for clarity.
12263 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
12264 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
12265 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
12266 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
12267 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
12268
81755f69
JB
122692012-06-13 Juanma Barranquero <lekktu@gmail.com>
12270
12271 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
12272
16192a57
GM
122732012-06-13 Glenn Morris <rgm@gnu.org>
12274
12275 * s/bsd-common.h (BSD4_3):
12276 * s/usg5-4-common.h (USG5_4): No longer define; unused.
12277
646b5f55
AS
122782012-06-13 Andreas Schwab <schwab@linux-m68k.org>
12279
12280 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
12281 instead of union.
12282 (XLI, XIL): Define.
1053a871
SM
12283 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
12284 Use them.
12285 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 12286 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 12287 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
12288 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
12289 * frame.c (delete_frame): Remove outdated comment.
12290 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
12291 USE_LISP_UNION_TYPE.
12292 (Fw32_unregister_hot_key): Likewise.
12293 (Fw32_toggle_lock_key): Likewise.
12294 * w32menu.c (add_menu_item): Likewise.
12295 (w32_menu_display_help): Use XIL instead of checking
12296 USE_LISP_UNION_TYPE.
12297 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
12298 (init_heap): Likewise.
12299 * w32term.c (w32_read_socket): Update comment.
12300
1d3823c9
GM
123012012-06-13 Glenn Morris <rgm@gnu.org>
12302
c62ff706
GM
12303 * s/usg5-4-common.h, src/s/unixware.h:
12304 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
12305
1d3823c9
GM
12306 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
12307
bfe3e0a2
PE
123082012-06-13 Paul Eggert <eggert@cs.ucla.edu>
12309
12310 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
12311 * alloc.c (make_number) [!defined make_number]:
12312 Remove, as lisp.h always defines this now.
12313 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
12314 (roundup_size): Verify that it is a power of 2.
12315 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
12316 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
12317 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
12318 -DUSE_LSB_TAG=0, to override the automatically-selected default.
12319 USE_LSB_TAG now is always defined to be either 0 or 1.
12320 All uses changed.
12321 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
12322 code works fine either way, and efficiency is not a concern here,
12323 as the union type is for debugging, not for production.
12324 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
12325 Use an inline function on all platforms when using the union type,
12326 since this is simpler and 'static inline' can be used portably
12327 within Emacs now.
12328 (LISP_INITIALLY_ZERO): New macro.
12329 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
12330 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
12331
45fa9c0f
GM
123322012-06-12 Glenn Morris <rgm@gnu.org>
12333
b4492cba
GM
12334 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
12335
12336 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 12337
45fa9c0f
GM
12338 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
12339 Move BROKEN_SIGIO to configure.
12340
12341 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
12342 Move NO_TERMIO to configure.
12343
0e25d334
CY
123442012-06-12 Chong Yidong <cyd@gnu.org>
12345
12346 * image.c (imagemagick_load_image): Use MagickFlattenImage if
12347 MagickMergeImageLayers is undefined. Use pixel pusher loop if
12348 MagickExportImagePixels is undefined.
12349
43682bb6
PE
123502012-06-12 Paul Eggert <eggert@cs.ucla.edu>
12351
12352 * image.c (imagemagick_load_image): Remove unused label.
12353
a9be7d2b
GM
123542012-06-11 Glenn Morris <rgm@gnu.org>
12355
12356 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
12357 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
12358 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
12359 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
12360
3017f87f
SM
123612012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
12362
12363 * alloc.c (make_byte_code): New function.
12364 (Fmake_byte_code): Use it. Don't purify here.
12365 * lread.c (read1): Use it as well to avoid extra allocation.
12366
1b9b4cf4
CY
123672012-06-11 Chong Yidong <cyd@gnu.org>
12368
12369 * image.c (imagemagick_load_image): Implement transparency.
12370
95988fcf
AS
123712012-06-10 Andreas Schwab <schwab@linux-m68k.org>
12372
12373 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
12374 account for preceding backslashes. (Bug#11663)
12375
cd4eb164
CY
123762012-06-09 Chong Yidong <cyd@gnu.org>
12377
12378 * term.c: Support italics in capable terminals (Bug#9652).
12379 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
12380 (turn_on_face): Output using TS_enter_italic_mode if available.
12381 Don't handle unused blinking and alt-charset cases.
12382 (turn_off_face): Handle italic case; discard unused tty_blinking_p
12383 and tty_alt_charset_p cases.
12384 (tty_capable_p, init_tty): Support italics.
12385
12386 * termchar.h (struct tty_display_info): Add field for italics.
12387 Remove unused blink field.
12388
12389 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
12390 Handle slant.
12391
12392 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
12393 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
12394 tty_alt_charset_p. Add tty_italic_p.
12395
ff88beb8
MA
123962012-06-09 Michael Albinus <michael.albinus@gmx.de>
12397
12398 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
12399 dbus_type_is_basic if available.
12400 (xd_extract_signed, xd_extract_unsigned): Rename from
12401 extract_signed and extract_unsigned, respectively. Adapt callers.
12402
44286096
CY
124032012-06-09 Chong Yidong <cyd@gnu.org>
12404
1682701f
CY
12405 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
12406
44286096
CY
12407 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
12408 case (Bug#9752).
12409
d86feb17
PE
124102012-06-08 Paul Eggert <eggert@cs.ucla.edu>
12411
12412 * xdisp.c (vmessage): Treat frame message as multibyte.
12413 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
12414 would generate the diagnostic "Making \302\247 buffer-local while
12415 let-bound!".
12416
d5c20fe8
EZ
124172012-06-08 Eli Zaretskii <eliz@gnu.org>
12418
12419 * dispnew.c (showing_window_margins_p): Undo last change, which
12420 was done due to an inadvertent commit.
12421 (adjust_frame_glyphs_for_frame_redisplay): Do call
12422 showing_window_margins_p.
12423
513749ee
SM
124242012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12425
12426 * eval.c (Fmake_var_non_special): New primitive.
12427 (syms_of_eval): Defsubr it.
12428 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
12429
d4a8f5c1
JB
124302012-06-08 Juanma Barranquero <lekktu@gmail.com>
12431
12432 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
12433 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
12434
8bbbc977
EZ
124352012-06-08 Eli Zaretskii <eliz@gnu.org>
12436
12437 * alloc.c (allocate_vectorlike): Fix last change.
12438
f3372c87
DA
124392012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
12440
12441 Block-based vector allocation of small vectors.
12442 * lisp.h (struct vectorlike_header): New field `nbytes',
12443 adjust comment accordingly.
12444 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 12445 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
12446 mark_maybe_pointer, valid_lisp_object_p) accordingly.
12447 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
f4ad7ea1
JB
12448 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES)
12449 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX)
12450 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST)
f3372c87
DA
12451 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
12452 (roundup_size): New constant.
12453 (struct vector_block): New data type.
12454 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 12455 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
12456 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
12457 (sweep_vectors): New functions.
12458 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 12459 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
12460 or equal to VBLOCK_BYTES_MAX.
12461 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
12462 (init_alloc_once): Add call to init_vectors.
12463
4f18a4ed
SM
124642012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
12465
12466 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
12467
86f158bc
PE
124682012-06-07 Paul Eggert <eggert@cs.ucla.edu>
12469
12470 * doprnt.c (doprnt): Truncate multibyte char correctly.
12471 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
12472 would mishandle a string argument "Xc" if X was a multibyte
12473 character of length 2: it would truncate after X's first byte
12474 rather than including all of X.
12475
c5cfcbe0
CY
124762012-06-06 Chong Yidong <cyd@gnu.org>
12477
12478 * buffer.c (word_wrap): Doc fix.
12479
c05cf390
PE
124802012-06-04 Paul Eggert <eggert@cs.ucla.edu>
12481
12482 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
12483
0c3461de
GM
124842012-06-03 Glenn Morris <rgm@gnu.org>
12485
12486 * xdisp.c (tool-bar-style): Doc fix.
12487
c71232db
UM
124882012-06-03 Ulrich Müller <ulm@gentoo.org>
12489
12490 * Makefile.in (PAXCTL): Define.
12491 (temacs$(EXEEXT)): Disable memory randomization for the temacs
12492 binary via PaX flags if the paxctl utility is available.
12493 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
12494 Restore PaX flags to their default. (Bug#11398)
12495
383f7350
CY
124962012-06-03 Chong Yidong <cyd@gnu.org>
12497
12498 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
12499 buffer (Bug#11226).
12500
5f2c76c6
CY
125012012-06-03 Chong Yidong <cyd@gnu.org>
12502
12503 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
12504 (note_mode_line_or_margin_highlight): If there is no help echo,
12505 use mode-line-default-help-echo. Handle the case where the mouse
12506 position is past the end of the mode line string.
12507
12508 * buffer.c (buffer_local_value_1): New function, split from
12509 Fbuffer_local_value; can return Qunbound.
12510 (Fbuffer_local_value): Use it.
12511 (Vmode_line_format): Docstring tweaks.
12512
773d47f6
PE
125132012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12514
12515 * sysdep.c (system_process_attributes): Improve comment.
12516
f2d6a3df
SM
125172012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
12518
12519 * keyboard.c: Export real-this-command to Elisp.
12520 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
12521 and DEFVAR it. Update all users.
12522
63810350
PE
125232012-06-02 Paul Eggert <eggert@cs.ucla.edu>
12524
7bd5c1f4
PE
12525 * minibuf.c (Fassoc_string): Remove duplicate declaration.
12526
63810350
PE
12527 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
12528 Convert pctcpu and pctmem to Lisp float properly.
12529 Let the compiler fold better, as 100.0/0x8000 is exact.
12530
a2821611
AS
125312012-06-02 Andreas Schwab <schwab@linux-m68k.org>
12532
12533 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
12534 cons_block.
12535
5fceba1d
PE
125362012-06-01 Paul Eggert <eggert@cs.ucla.edu>
12537
12538 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
12539
c98ff5dd
DA
125402012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
12541
12542 For a 'struct window', replace some Lisp_Object fields to
12543 bitfields where appropriate, remove unused fields.
12544 * window.h (struct window): Remove unused 'last_mark_x' and
12545 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 12546 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
12547 Change type of 'force_start', 'optional_new_start',
12548 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 12549 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 12550
ca34e0be
PE
125512012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12552
12553 Pacify gcc -Wdouble-precision when using Xaw.
12554 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
12555 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
12556 Use 'float' consistently, rather than 'float' in most places
12557 and 'double' in a couple of places.
12558
efc00ab1 125592012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
12560
12561 * xdisp.c (handle_stop): Detect whether we have overlay strings
12562 loaded by testing it->current.overlay_string_index to be
12563 non-negative, instead of checking whether n_overlay_strings is
12564 positive. (Bug#11587)
12565
efc00ab1 125662012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
12567
12568 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
12569
12570 * doc.c (Fsubstitute_command_keys): Doc fix.
12571
efc00ab1 125722012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
12573
12574 * search.c (search_buffer): Remove calls to
12575 r_alloc_inhibit_buffer_relocation, as it is now called by
12576 maybe_unify_char, which was the cause of relocation of buffer text
12577 in bug#11519.
12578
efc00ab1 125792012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
12580
12581 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
12582 for the duration of call to load_charset, to avoid problems with
12583 callers of maybe_unify_char that access buffer text through C
12584 pointers.
12585
12586 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
12587 decrement the inhibition flag, instead of just setting or
12588 resetting it.
12589
ba93a187
PE
125902012-05-31 Paul Eggert <eggert@cs.ucla.edu>
12591
12592 Remove obsolete '#define static' cruft.
12593 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
12594 This #undef was "temporary" in 2000; it is no longer needed
12595 now that '#define static' has gone away.
12596 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
12597 (gray_bitmap_bits): Remove; no longer needed.
12598 All uses replaced with definiens.
12599 * xterm.c: Include "bitmaps/gray.xbm".
12600
9e4bf381
PE
126012012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12602
12603 Clean up __executable_start, monstartup when --enable-profiling.
12604 The following changes affect the code only when profiling.
12605 * dispnew.c (__executable_start): Rename from safe_bcopy.
12606 Define only on platforms that need it.
12607 * emacs.c: Include <sys/gmon.h> when profiling.
12608 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
12609 (__executable_start): Remove decl, since lisp.h does it now.
12610 (safe_bcopy): Remove decl; no longer has that name.
12611 (main): Coalesce #if into single bit of code, for simplicity.
12612 Cast pointers to uintptr_t, since standard libraries want integers
12613 and not pointers.
12614 * lisp.h (__executable_start): New decl.
12615
32d72c2f
GM
126162012-05-31 Glenn Morris <rgm@gnu.org>
12617
12618 * image.c (Fimagemagick_types): Doc fix.
12619
baac5bc7
JM
126202012-05-30 Jim Meyering <meyering@redhat.com>
12621
12622 * callproc.c (Fcall_process_region): Include directory component
12623 in mkstemp error message (Bug#11586).
12624
72cb32cf
PE
126252012-05-30 Paul Eggert <eggert@cs.ucla.edu>
12626
12627 * alloc.c, lisp.h (make_pure_vector): Now static.
12628
61b108cc
SM
126292012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
12630
12631 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
12632 Move to byte-run.el.
12633 (Fautoload): Do the hash-doc more carefully.
12634 * data.c (Fdefalias): Purify definition, except for keymaps.
12635 (Qdefun): Move from eval.c.
12636 * lisp.h (Qdefun): Remove.
12637 * lread.c (read1): Tiny simplification.
12638
471fe23d
TN
126392012-05-29 Troels Nielsen <bn.troels@gmail.com>
12640
934f3f58 12641 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
12642 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
12643 Bug#9642, but explicitly check that the buffer the overlay would
12644 be moved to is live and rearrange lines to make sure that errors
12645 will not put the overlay in an inconsistent state.
12646 (Fdelete_overlay): Cosmetics.
12647
85d0efd1
EZ
126482012-05-28 Eli Zaretskii <eliz@gnu.org>
12649
12650 * w32term.c (my_bring_window_to_top): New function.
12651 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
12652 could be different from the original one.
12653 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
12654 (Bug#11513)
12655
12656 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
12657 by calling BringWindowToTop.
12658
12659 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
12660 (WM_EMACS_END): Increase by one.
12661
da92a98c
PE
126622012-05-28 Paul Eggert <eggert@cs.ucla.edu>
12663
12664 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
12665 This avoids undefined behavior that might cause the eassert
12666 to not catch an out-of-range value.
12667
74d1f848
JB
126682012-05-28 Juanma Barranquero <lekktu@gmail.com>
12669
12670 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
12671 Update dependencies.
12672
9e1a06fc
EZ
126732012-05-27 Eli Zaretskii <eliz@gnu.org>
12674
12675 * bidi.c (bidi_mirror_char): Fix last change.
12676
f3dd7312
AS
126772012-05-27 Andreas Schwab <schwab@linux-m68k.org>
12678
12679 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
12680 when referring to sectname field in printf format.
12681
81899c91
PE
126822012-05-27 Paul Eggert <eggert@cs.ucla.edu>
12683
57b81a9f
PE
12684 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
12685 Only r_alloc_inhibit_buffer_relocation needed to be added;
12686 the others were already declared.
12687
81899c91
PE
12688 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
12689 before checking whether it's out of range. Put the check inside
12690 eassert. See
12691 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
12692
33017faf 126932012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
12694
12695 * callproc.c (Fcall_process): Restore a line that was accidentally
12696 commented out in the 2011-02-13 change (bug#11547).
12697
33017faf 126982012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
12699
12700 * lisp.h [REL_ALLOC]: Add prototypes for external functions
12701 defined on ralloc.c.
12702
12703 * buffer.c [REL_ALLOC]: Remove prototypes of
12704 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
12705 they are now on lisp.h.
12706
12707 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
12708
12709 * search.c (search_buffer): Use it to inhibit relocation of buffer
12710 text while re_search_2 is doing its job, because re_search_2 is
12711 passed C pointers to buffer text. (Bug#11519)
12712
23415acf
EZ
12713 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
12714 Update value to 24.
12715
44e27368
EZ
12716 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
12717 state after an additional call to move_it_in_display_line_to, keep
12718 the values of it->max_ascent and it->max_descent found for the
12719 entire line.
12720 (pos_visible_p): Revert the comparison against bottom_y to what it
12721 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
12722 (Bug#11464)
12723
c1892f11
PE
127242012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12725
12726 Fix coding-related core dumps with gcc -ftrapv.
12727 The code was computing A - B, where A and B are pointers, and B is
12728 random garbage. This can lead to core dumps on platforms that
12729 have special pointer registers, and it also leads to core dumps on
12730 x86-64 when compiled with gcc -ftrapv. The fix is to compute
12731 A - B only when B is initialized properly.
12732 * coding.c (coding_set_source, coding_set_destination): Return void.
12733 (coding_change_source, coding_change_destinations): New functions,
12734 with the old behaviors of coding_set_source and coding_set_destination.
12735 All callers that need an offset changed to use these new functions.
12736
eb7afdad
GM
127372012-05-26 Glenn Morris <rgm@gnu.org>
12738
12739 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
12740
f12fdf02
EZ
127412012-05-26 Eli Zaretskii <eliz@gnu.org>
12742
53a63be6 12743 Extend mouse support on W32 text-mode console.
61b108cc
SM
12744 * xdisp.c (draw_row_with_mouse_face):
12745 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 12746
eb3f6f01 12747 * w32console.c: Include window.h.
61b108cc
SM
12748 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
12749 New functions.
eb3f6f01
EZ
12750 (initialize_w32_display): Initialize mouse-highlight data.
12751
53a63be6
EZ
12752 * w32inevt.c: Include termchar.h and window.h.
12753 (do_mouse_event): Support mouse-autoselect-window. When the mouse
12754 moves, call note_mouse_highlight. If help_echo changed, call
12755 gen_help_event to produce help-echo message in the echo area.
12756 Call clear_mouse_face if mouse_face_hidden is set in the mouse
12757 highlight info.
12758
4cfd81f6
PE
127592012-05-26 Paul Eggert <eggert@cs.ucla.edu>
12760
12761 * lread.c (read1): Simplify slightly to avoid an overflow warning
12762 with GCC 4.7.0 on x86-64.
12763
4446092a
EZ
127642012-05-26 Eli Zaretskii <eliz@gnu.org>
12765
12766 * bidi.c (bidi_mirror_char): Revert last change: an int is
12767 definitely wide enough here.
12768
42b2a986 127692012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 12770
42b2a986 12771 Fix integer width and related bugs (Bug#9874).
eb106a49 12772 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
12773 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
12774 (string_bytes, check_sblock, allocate_string_data):
12775 (compact_small_strings, Fmake_bool_vector, make_string)
12776 (make_unibyte_string, make_multibyte_string)
12777 (make_string_from_bytes, make_specified_string)
12778 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
12779 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
12780 (mark_vectorlike):
12781 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12782 (allocate_pseudovector):
12783 Use int, not EMACS_INT, where int is wide enough.
12784 (inhibit_garbage_collection, Fgarbage_collect):
12785 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12786 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
12787 int might not be wide enough.
12788 (bidi_cache_search, bidi_cache_find, bidi_init_it)
12789 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
12790 (bidi_at_paragraph_end, bidi_find_paragraph_start)
12791 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12792 (bidi_level_of_next_char, bidi_move_to_visually_next):
12793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12794 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
12795 (Fkill_buffer, Fset_buffer_major_mode)
12796 (advance_to_char_boundary, Fbuffer_swap_text)
12797 (Fset_buffer_multibyte, overlays_at, overlays_in)
12798 (overlay_touches_p, struct sortvec, record_overlay_string)
12799 (overlay_strings, recenter_overlay_lists)
12800 (adjust_overlays_for_insert, adjust_overlays_for_delete)
12801 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
12802 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
12803 (Foverlay_recenter, last_overlay_modification_hooks_used)
12804 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
12805 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
12806 (validate_region): Omit unnecessary test for b <= e,
12807 since that's guaranteed by the previous test.
d311d28c
PE
12808 (adjust_overlays_for_delete): Avoid pos + length overflow.
12809 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
12810 (report_overlay_modification):
12811 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12812 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
12813 Omit pointer cast, which isn't needed anyway, and doesn't work
12814 after the EMACS_INT -> ptrdiff_t change.
02481186 12815 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
12816 * buffer.h: Adjust decls to match defn changes elsewhere.
12817 (struct buffer_text, struct buffer):
12818 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12819 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
12820 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12821 not int, to avoid needless 32-bit limit on 64-bit hosts.
12822 (exec_byte_code): Use tighter memory-full test, one that checks
12823 for alloca overflow. Don't compute the address of the object just
12824 before an array, as that's not portable. Use EMACS_INT, not
12825 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
12826 * callint.c (Fcall_interactively):
12827 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12828 * callproc.c (call_process_kill, Fcall_process):
12829 Don't assume pid_t fits into an Emacs fixnum.
12830 (call_process_cleanup, Fcall_process, child_setup):
12831 Don't assume pid_t fits into int.
12832 (call_process_cleanup, Fcall_process, delete_temp_file)
12833 (Fcall_process_region):
12834 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12835 (Fcall_process): Simplify handling of volatile integers.
12836 Use int, not EMACS_INT, where int will do.
12837 * casefiddle.c (casify_object, casify_region, operate_on_word)
12838 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12839 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12840 (casify_object): Avoid integer overflow when overallocating buffer.
12841 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 12842 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
12843 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12844 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12845 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12846 integers are now checked earlier. All uses replaced with XINT.
12847 (ccl_driver):
12848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12849 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
12850 (ccl_driver, Fregister_code_conversion_map):
12851 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
12852 (resolve_symbol_ccl_program): Check that vector header is in range.
12853 Always copy the vector, so that we can check its contents reliably
12854 now rather than having to recheck each instruction as it's being
12855 executed. Check that vector words fit in 'int'.
12856 (ccl_get_compiled_code, Fregister_ccl_program)
12857 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12858 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12859 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12860 contents are in range.
12861 (Fccl_execute_on_string): Check that status is in range.
12862 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12863 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12864 Accept and return EMACS_INT, not int, because callers can pass values
12865 out of 'int' range.
12866 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12867 (multibyte_chars_in_text, parse_str_as_multibyte)
12868 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12869 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12870 (string_escape_byte8, Fget_byte):
12871 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 12872 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
12873 avoid mishandling large integers.
12874 * character.h: Adjust decls to match defn changes elsewhere.
12875 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12876 (Ffind_charset_region):
12877 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12878 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12879 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 12880 Don't assume fixnum fits in int.
d311d28c
PE
12881 (load_charset_map_from_vector, Fmap_charset_chars):
12882 Remove now-unnecessary CHECK_NATNUMs.
12883 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
12884 Don't rely on undefined behavior with signed left shift overflow.
12885 Don't assume unsigned int fits into fixnum, or that fixnum fits
12886 into unsigned int. Don't require max_code to be a valid fixnum;
12887 that's not true for gb10830 4-byte on a 32-bit host. Allow
12888 invalid_code to be a cons, for the same reason. Require code_offset
12889 to be a character. Avoid int overflow if max_char is close
12890 to INT_MAX.
12891 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12892 this is intended anyway and avoids some undefined behavior.
12893 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12894 INDEX_TO_CODE_POINT, as that's what it expects.
12895 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
12896 * charset.h (DECODE_CHAR): Return int, not unsigned;
12897 this is what was intended anyway, and it avoids undefined behavior.
12898 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12899 integer-overflow issues.
12900 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12901 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12902 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
12903 * chartab.c (Fmake_char_table, Fset_char_table_range)
12904 (uniprop_get_decoder, uniprop_get_encoder):
12905 Don't assume fixnum fits in int.
12906 * cmds.c (move_point): New function, that does the gist of
12907 Fforward_char and Fbackward_char, but does so while checking
12908 for integer overflow more accurately.
c96e5d6a 12909 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
12910 (Fforward_line, Fend_of_line, internal_self_insert)
12911 (internal_self_insert):
12912 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12913 Fix a FIXME, by checking for integer overflow when calculating
12914 target_clm and actual_clm.
12915 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 12916 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
12917 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12918 (coding_alloc_by_making_gap, alloc_destination)
12919 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12920 (encode_coding_utf_16, detect_coding_emacs_mule)
12921 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12922 (detect_coding_iso_2022, decode_coding_iso_2022)
12923 (encode_invocation_designation, encode_designation_at_bol)
12924 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12925 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12926 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12927 (encode_coding_ccl, encode_coding_raw_text)
12928 (detect_coding_charset, decode_coding_charset)
12929 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12930 (produce_composition, produce_charset, produce_annotation)
12931 (decode_coding, handle_composition_annotation)
12932 (handle_charset_annotation, consume_chars, decode_coding_gap)
12933 (decode_coding_object, encode_coding_object, detect_coding_system)
12934 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12935 (code_convert_region, code_convert_string)
8f50130c
PE
12936 (Fdefine_coding_system_internal)
12937 (coding_set_source, coding_set_destination):
d311d28c
PE
12938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12939 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12940 (Fdefine_coding_system_internal):
12941 Don't assume fixnums fit in int.
12942 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 12943 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
12944 (Funencodable_char_position, Fcheck_coding_systems_region)
12945 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 12946 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 12947 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 12948 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 12949 Don't access memory outside of the args array.
d311d28c 12950 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
12951 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12952 result of ENCODE_CHAR.
d311d28c
PE
12953 * coding.h: Adjust decls to match defn changes elsewhere.
12954 (struct coding_system):
12955 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12956 * composite.c (get_composition_id, find_composition)
12957 (run_composition_function, update_compositions)
12958 (compose_text, composition_gstring_put_cache)
12959 (composition_gstring_p, composition_gstring_width)
12960 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12961 (composition_compute_stop_pos, composition_reseat_it)
12962 (composition_update_it, struct position_record)
12963 (find_automatic_composition, composition_adjust_point)
12964 (Fcomposition_get_gstring, Ffind_composition_internal):
12965 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12966 (update_compositions):
12967 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12968 * composite.h: Adjust decls to match defn changes elsewhere.
12969 (struct composition):
12970 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12971 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12972 Do not attempt to compute the address of the object just before a
12973 buffer; this is not portable.
12974 (Faref, Faset):
12975 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12976 (Faset): Use int, not EMACS_INT, where int is wide enough.
12977 (Fstring_to_number): Don't assume fixnums fit in int.
12978 (Frem): Don't assume arg is nonnegative.
12979 * dbusbind.c (xd_append_arg): Check for integers out of range.
12980 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 12981 (extract_signed, extract_unsigned): New functions.
243e0530
PE
12982 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12983 (xd_get_connection_references): Return ptrdiff_t, not int.
12984 All uses changed.
12985 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12986 (xd_read_message_1):
12987 Use int, not unsigned, where the dbus API uses int.
12988 (Fdbus_message_internal): Don't overflow mtype.
12989 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
12990 * dired.c (directory_files_internal, file_name_completion, scmp)
12991 (file_name_completion_stat):
12992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12993 (file_name_completion): Don't overflow matchcount.
12994 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12995 * dispextern.h: Adjust decls to match defn changes elsewhere.
12996 (struct text_pos, struct glyph, struct bidi_saved_info)
12997 (struct bidi_string_data, struct bidi_it, struct composition_it)
12998 (struct it):
12999 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13000 (struct display_pos, struct composition_it, struct it):
13001 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13002 * dispnew.c (increment_matrix_positions)
13003 (increment_row_positions, mode_line_string)
13004 (marginal_area_string):
13005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 13006 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
13007 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13008 (duration_to_sec_usec): New function, to check for overflow better.
13009 (Fsleep_for, sit_for): Use it.
13010 * doc.c (get_doc_string, store_function_docstring):
13011 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13012 (get_doc_string, Fsnarf_documentation):
13013 Use int, not EMACS_INT, where int is wide enough.
13014 (get_doc_string):
13015 Use SAFE_ALLOCA, not alloca.
13016 Check for overflow when converting EMACS_INT to off_t.
13017 * doprnt.c (doprnt):
13018 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13019 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
13020 Don't assume uid_t fits into fixnum.
13021 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
13022 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
13023 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
13024 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
13025 (general_insert_function)
13026 (Finsert_char, make_buffer_string, make_buffer_string_both)
13027 (update_buffer_properties, Fbuffer_substring)
13028 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
13029 (Fsubst_char_in_region, check_translation)
13030 (Ftranslate_region_internal, save_restriction_restore, Fformat)
13031 (transpose_markers, Ftranspose_regions):
13032 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13033 (clip_to_bounds): Move to lisp.h as an inline function).
13034 (Fconstrain_to_field): Don't assume integers are nonnegative.
13035 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
13036 (Fsubst_char_in_region, Fsave_restriction):
13037 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13038 (Femacs_pid): Don't assume pid_t fits into fixnum.
13039 (lo_time): Use int, not EMACS_INT, when int suffices.
13040 (lisp_time_argument): Check for usec out of range.
13041 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
13042 (Fuser_login_name, Fuser_full_name): Signal an error
13043 if a uid argument is out of range, rather than relying on
13044 undefined behavior.
c8d5c857
PE
13045 (Fformat_time_string): Remove now-unnecessary check.
13046 lisp_time_argument checks for out-of-range usec now.
243e0530 13047 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
13048 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
13049 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
13050 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
13051 (init_cmdargs, Fdump_emacs):
13052 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13053 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
13054 the bottom (typically) 32 bits of the fixnum.
13055 * eval.c (specpdl_size, call_debugger):
13056 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13057 (when_entered_debugger, Fbacktrace_debug):
13058 Don't assume fixnum can fit in int.
13059 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
13060 the object just before a buffer; this is not portable.
13061 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
13062 (grow_specpdl, unbind_to):
13063 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13064 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
13065 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 13066 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
13067 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
13068 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
13069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13070 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
13071 (a_write, e_write):
13072 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13073 (Fcopy_file, non_regular_nbytes, read_non_regular)
13074 (Finsert_file_contents):
13075 Use int, not EMACS_INT, where int is wide enough.
13076 (READ_BUF_SIZE): Verify that it fits in int.
13077 (Finsert_file_contents): Check that counts are in proper range,
13078 rather than assuming fixnums fit into ptrdiff_t etc.
13079 Don't assume fixnums fit into int.
125b3835 13080 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
13081 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
13082 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
13083 (string_char_to_byte, string_byte_to_char)
13084 (string_make_multibyte, string_to_multibyte)
13085 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
13086 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
13087 (substring_both, Fdelete, internal_equal, Ffillarray)
13088 (Fclear_string, mapcar1)
13089 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
13090 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
13091 (larger_vector, make_hash_table, maybe_resize_hash_table)
13092 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
13093 (Fmaphash, secure_hash):
13094 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13095 (concat): Check for string index and length overflow.
13096 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
13097 (Frequire):
13098 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13099 (larger_vector): New API (vec, incr_min, size_max) replaces old
13100 one (vec, new_size, init). This catches size overflow.
13101 INIT was removed because it was always Qnil.
13102 All callers changed.
13103 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
13104 the upper bound on a hash table index size.
13105 (make_hash_table, maybe_resize_hash_table): Use it.
13106 (secure_hash): Computer start_byte and end_byte only after
13107 they're known to be in ptrdiff_t range.
13108 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
13109 (Ffont_get_glyphs, Ffont_at):
13110 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13111 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
13112 (Flist_fonts, Fopen_font):
13113 Don't assume fixnum can fit in int.
13114 (check_gstring): Don't assume index can fit in int.
13115 (font_match_p): Check that fixnum is a character, not a nonnegative
13116 fixnum, since the later code needs to stuff it into an int.
13117 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
13118 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
13119 conversion overflow issues.
13120 (Fopen_font): Check for integer out of range.
13121 (Ffont_get_glyphs): Don't assume index can fit in int.
13122 * font.h: Adjust decls to match defn changes elsewhere.
13123 * fontset.c (reorder_font_vector): Redo score calculation to avoid
13124 integer overflow.
13125 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
13126 printmax_t, where ptrdiff_t is wide enough.
13127 (Finternal_char_font):
13128 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13129 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
13130 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
13131 (Fset_frame_position, x_set_frame_parameters)
13132 (x_set_line_spacing, x_set_border_width)
13133 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
13134 Check that fixnums are in proper range for system types.
13135 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
13136 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13137 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
13138 Use SAFE_ALLOCA_LISP, not alloca.
13139 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
13140 intptr_t is wide enough.
13141 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
13142 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
13143 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
13144 Check for fixnum out of range.
13145 * ftfont.c (ftfont_list): Don't assume index fits in int.
13146 Check that fixnums are in proper range for system types.
13147 (ftfont_shape_by_flt):
13148 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
13149 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13151 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
13152 Check that fixnums are in proper range for system types.
13153 * gnutls.h: Adjust decls to match defn changes elsewhere.
13154 * gtkutil.c (xg_dialog_run):
13155 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13156 (update_frame_tool_bar):
13157 Check that fixnums are in proper range for system types.
13158 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 13159 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
13160 * indent.c (last_known_column, last_known_column_point):
13161 (current_column_bol_cache):
13162 (skip_invisible, current_column, check_display_width):
13163 (check_display_width, scan_for_column, current_column_1)
13164 (Findent_to, Fcurrent_indentation, position_indentation)
13165 (indented_beyond_p, Fmove_to_column, compute_motion):
13166 (Fcompute_motion, Fvertical_motion):
13167 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13168 (last_known_column_modified): Use EMACS_INT, not int.
13169 (check_display_width):
13170 (Fcompute_motion):
13171 Check that fixnums and floats are in proper range for system types.
13172 (compute_motion): Don't assume index or fixnum fits in int.
13173 (compute_motion, Fcompute_motion):
13174 Use int, not EMACS_INT, when it is wide enough.
13175 (vmotion): Omit local var start_hpos that is always 0; that way
13176 we don't need to worry about overflow in expressions involving it.
13177 * indent.h: Adjust decls to match defn changes elsewhere.
13178 (struct position):
13179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13180 Use int, not EMACS_INT, where int is wide enough.
13181 Remove unused members ovstring_chars_done and tab_offset;
13182 all uses removed.
13183 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
13184 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
13185 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
13186 (make_gap, copy_text, insert, insert_and_inherit)
13187 (insert_before_markers, insert_before_markers_and_inherit)
13188 (insert_1, count_combining_before, count_combining_after)
13189 (insert_1_both, insert_from_string)
13190 (insert_from_string_before_markers, insert_from_string_1)
13191 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
13192 (adjust_after_replace, adjust_after_insert, replace_range)
13193 (replace_range_2, del_range, del_range_1, del_range_byte)
13194 (del_range_both, del_range_2, modify_region)
13195 (prepare_to_modify_buffer, signal_before_change)
13196 (signal_after_change, Fcombine_after_change_execute):
13197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13198 * intervals.c (traverse_intervals, rotate_right, rotate_left)
13199 (balance_an_interval, split_interval_right, split_interval_left)
13200 (find_interval, next_interval, update_interval)
13201 (adjust_intervals_for_insertion, delete_node, delete_interval)
13202 (interval_deletion_adjustment, adjust_intervals_for_deletion)
13203 (static_offset_intervals, offset_intervals)
13204 (merge_interval_right, merge_interval_left, make_new_interval)
13205 (graft_intervals_into_buffer, temp_set_point_both)
13206 (temp_set_point, set_point, adjust_for_invis_intang)
13207 (set_point_both, move_if_not_intangible, get_property_and_range)
13208 (get_local_map, copy_intervals, copy_intervals_to_string)
13209 (compare_string_intervals, set_intervals_multibyte_1):
13210 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13211 * intervals.h: Adjust decls to match defn changes elsewhere.
13212 (struct interval):
13213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13214 * keyboard.c (this_command_key_count, this_single_command_key_start)
13215 (before_command_key_count, before_command_echo_length, echo_now)
13216 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
13217 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
13218 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
13219 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
13220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13221 (last_non_minibuf_size, last_point_position, echo_truncate)
13222 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
13223 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
13224 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
13225 (stuff_buffered_input):
13226 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13227 (last_auto_save, command_loop_1, read_char):
13228 Use EMACS_INT, not int, to avoid integer overflow.
13229 (record_char): Avoid overflow in total_keys computation.
13230 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
13231 * keyboard.h: Adjust decls to match defn changes elsewhere.
13232 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
13233 (Fkey_description, Fdescribe_vector, Flookup_key):
13234 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13235 (click_position): New function, to check that positions are in range.
13236 (Fcurrent_active_maps):
13237 (describe_command):
13238 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13239 (Faccessible_keymaps, Fkey_description):
13240 (preferred_sequence_p):
13241 Don't assume fixnum can fit into int.
13242 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
13243 Check for integer overflow in size calculations.
13244 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
13245 avoid mishandling large integers.
13246 * lisp.h: Adjust decls to match defn changes elsewhere.
13247 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
13248 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
13249 (struct Lisp_Marker):
13250 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13251 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
13252 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
13253 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
13254 All callers changed.
13255 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
13256 Assume the arg has valid form, since it always does.
13257 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
13258 unsigned integer system type.
13259 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
13260 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
13261 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13262 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
13263 (duration_to_sec_usec): New decl.
13264 * lread.c (read_from_string_index, read_from_string_index_byte)
13265 (read_from_string_limit, readchar, unreadchar, openp)
13266 (read_internal_start, read1, oblookup):
13267 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13268 (Fload, readevalloop, Feval_buffer, Feval_region):
13269 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13270 (openp): Check for out-of-range argument to 'access'.
13271 (read1): Use int, not EMACS_INT, where int is wide enough.
13272 Don't assume fixnum fits into int.
6efdadfd 13273 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
13274 (read_filtered_event): Use duration_to_sec_usec
13275 to do proper overflow checking on durations.
d311d28c
PE
13276 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
13277 in size calculation.
13278 (Fexecute_kbd_macro):
13279 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13280 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
13281 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
13282 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
13283 (set_marker_both, set_marker_restricted_both, marker_position)
13284 (marker_byte_position, Fbuffer_has_markers_at):
13285 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13286 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 13287 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
13288 It now merely ensures that the menu is large enough, without
13289 necessarily growing it, as this avoids some integer overflow issues.
13290 All callers changed.
13291 (keymap_panes, parse_single_submenu, Fx_popup_menu):
13292 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13293 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
13294 Use SAFE_ALLOCA_LISP, not alloca.
13295 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
13296 to EMACS_INT. Check that fixnums are in proper range for system types.
13297 * minibuf.c (minibuf_prompt_width, string_to_object)
13298 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
13299 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
13300 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13301 (get_minibuffer, read_minibuf_unwind):
13302 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13303 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
13304 this simplifies overflow checking. All callers changed.
13305 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
13306 (Ftest_completion):
13307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13308 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
13309 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
13310 Check that fixnums are in proper range for system types.
13311 (Fx_create_frame, Fx_show_tip):
13312 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13313 * nsfont.m (ns_findfonts, nsfont_list_family):
13314 Don't assume fixnum fits in long.
13315 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
13316 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13317 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
13318 wide enough.
17fdb222 13319 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
13320 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13321 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
13322 (PRINTDECLARE, PRINTPREPARE):
13323 (strout, print_string):
13324 (print, print_preprocess, print_check_string_charset_prop)
13325 (print_object):
13326 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13327 (PRINTDECLARE):
13328 (temp_output_buffer_setup, Fprin1_to_string, print_object):
13329 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13330 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 13331 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 13332 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
13333 (print_error_message): Use SAFE_ALLOCA, not alloca.
13334 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
13335 (print_depth, new_backquote_output, print_number_index):
13336 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
13337 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
13338 (Fset_process_window_size, Fformat_network_address)
13339 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 13340 (sigchld_handler):
d311d28c 13341 Check that fixnums are in proper range for system types.
d44287d4 13342 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
13343 Check for process-ids out of pid_t range rather than relying on
13344 undefined behavior.
e4d81efc 13345 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
13346 (Fformat_network_address, read_process_output, send_process)
13347 (Fprocess_send_region, status_notify):
13348 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13349 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
13350 (wait_reading_process_output, read_process_output, exec_sentinel):
13351 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13352 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
13353 (Faccept_process_output): Use duration_to_sec_usec to do proper
13354 overflow checking on durations.
dde14581
PE
13355 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
13356 Don't assume pid_t fits in int.
02481186
PE
13357 * process.h (struct Lisp_Process): Members tick and update_tick
13358 are now of type EMACS_INT, not int.
b62b53e8
PE
13359 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
13360 configured --with-wide-int.
d311d28c
PE
13361 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
13362 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
13363 * search.c (looking_at_1, string_match_1):
13364 (fast_string_match, fast_c_string_match_ignore_case)
13365 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
13366 (scan_newline, find_before_next_newline, search_command)
13367 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
13368 (set_search_regs, wordify):
13369 (Freplace_match):
13370 (Fmatch_data):
13371 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13372 (string_match_1, search_buffer, set_search_regs):
13373 (Fmatch_data):
13374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13375 (wordify): Check for overflow in size calculation.
13376 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
13377 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
13378 Check that fixnums are in proper range for system types.
13379 * sound.c (struct sound_device)
13380 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
13381 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13382 (Fplay_sound_internal):
13383 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 13384 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
13385 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
13386 (Fparse_partial_sexp):
13387 Don't assume fixnums can fit in int.
13388 (struct lisp_parse_state, find_start_pos, find_start_value)
13389 (find_start_value_byte, find_start_begv)
13390 (update_syntax_table, char_quoted, dec_bytepos)
13391 (find_defun_start, prev_char_comend_first, back_comment):
13392 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
13393 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
13394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13395 (Finternal_describe_syntax_value): Check that match_lisp is a
13396 character, not an integer, since the code stuffs it into int.
13397 (scan_words, scan_sexps_forward):
13398 Check that fixnums are in proper range for system types.
13399 (Fforward_word):
13400 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13401 (scan_sexps_forward):
13402 Use CHARACTERP, not INTEGERP, since the value must fit into int.
13403 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
13404 * syntax.h: Adjust decls to match defn changes elsewhere.
13405 (struct gl_state_s):
13406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
13407 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
13408 MOST_POSITIVE_FIXNUM.
d311d28c
PE
13409 * sysdep.c (wait_for_termination_1, wait_for_termination)
13410 (interruptible_wait_for_termination, mkdir):
13411 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
13412 (emacs_read, emacs_write):
13413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
13414 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
13415 and double all fit in int.
d311d28c
PE
13416 * term.c (set_tty_color_mode):
13417 Check that fixnums are in proper range for system types.
13418 * termhooks.h (struct input_event):
13419 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13420 * textprop.c (validate_interval_range, interval_of)
13421 (Fadd_text_properties, set_text_properties_1)
13422 (Fremove_text_properties, Fremove_list_of_text_properties)
13423 (Ftext_property_any, Ftext_property_not_all)
13424 (copy_text_properties, text_property_list, extend_property_ranges)
13425 (verify_interval_modification):
13426 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13427 (Fnext_single_char_property_change)
13428 (Fprevious_single_char_property_change):
13429 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
13430 (copy_text_properties):
13431 Check for integer overflow in index calculation.
d311d28c
PE
13432 * undo.c (last_boundary_position, record_point, record_insert)
13433 (record_delete, record_marker_adjustment, record_change)
13434 (record_property_change):
13435 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13436 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
13437 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13438 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13439 (Fx_hide_tip, Fx_file_dialog):
13440 * w32menu.c (set_frame_menubar):
13441 Use ptrdiff_t, not int, for consistency with rest of code.
13442 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
13443 (select_window, Fdelete_other_windows_internal)
13444 (window_scroll_pixel_based, window_scroll_line_based)
13445 (Frecenter, Fset_window_configuration):
13446 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13447 (Fset_window_hscroll, run_window_configuration_change_hook)
13448 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 13449 (Fscroll_other_window, Frecenter):
d311d28c
PE
13450 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13451 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
13452 Don't assume fixnum fits in int.
13453 (Fset_window_scroll_bars):
13454 Check that fixnums are in proper range for system types.
13455 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
13456 (string_pos, c_string_pos, number_of_chars, init_iterator)
13457 (in_ellipses_for_invisible_text_p, init_from_display_pos)
13458 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
13459 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
13460 (face_before_or_after_it_pos, handle_invisible_prop)
13461 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
13462 (display_prop_intangible_p, string_buffer_position_lim)
13463 (string_buffer_position, handle_composition_prop, load_overlay_strings)
13464 (get_overlay_strings_1, get_overlay_strings)
13465 (iterate_out_of_display_property, forward_to_next_line_start)
13466 (back_to_previous_visible_line_start, reseat, reseat_to_string)
13467 (get_next_display_element, set_iterator_to_next)
13468 (get_visually_first_element, compute_stop_pos_backwards)
13469 (handle_stop_backwards, next_element_from_buffer)
13470 (move_it_in_display_line_to, move_it_in_display_line)
13471 (move_it_to, move_it_vertically_backward, move_it_by_lines)
13472 (add_to_log, message_dolog, message_log_check_duplicate)
13473 (message2, message2_nolog, message3, message3_nolog
13474 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
13475 (current_message_1, truncate_echo_area, truncate_message_1)
13476 (set_message, set_message_1, store_mode_line_noprop)
13477 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
13478 (text_outside_line_unchanged_p, check_point_in_composition)
13479 (reconsider_clip_changes)
13480 (redisplay_internal, set_cursor_from_row, try_scrolling)
13481 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
13482 (redisplay_window, find_last_unchanged_at_beg_row)
13483 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
13484 (trailing_whitespace_p, find_row_edges, display_line)
13485 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
13486 (display_mode_element, store_mode_line_string)
13487 (pint2str, pint2hrstr, decode_mode_spec)
13488 (display_count_lines, display_string, draw_glyphs)
13489 (x_produce_glyphs, x_insert_glyphs)
13490 (rows_from_pos_range, mouse_face_from_buffer_pos)
13491 (fast_find_string_pos, mouse_face_from_string_pos)
13492 (note_mode_line_or_margin_highlight, note_mouse_highlight):
13493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13494 (safe_call, init_from_display_pos, handle_fontified_prop)
13495 (handle_single_display_spec, load_overlay_strings)
13496 (with_echo_area_buffer, setup_echo_area_for_printing)
13497 (display_echo_area, echo_area_display)
13498 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
13499 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
13500 (redisplay_window, dump_glyph_row, display_mode_line)
13501 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 13502 (handle_display_spec, display_prop_string_p):
d311d28c
PE
13503 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13504 (handle_single_display_spec, build_desired_tool_bar_string)
13505 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
13506 (get_specified_cursor_type):
13507 Check that fixnums are in proper range for system types.
13508 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
13509 (Flookup_image_map):
13510 Don't assume fixnums fit in int.
13511 (compare_overlay_entries):
13512 Avoid mishandling comparisons due to subtraction overflow.
13513 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
13514 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
13515 (handle_tool_bar_click):
13516 Use int, not unsigned, since we prefer signed and the signedness
13517 doesn't matter here.
13518 (get_next_display_element, next_element_from_display_vector):
13519 Use int, not EMACS_INT, when int is wide enough.
13520 (start_hourglass): Use duration_to_sec_usec to do proper
13521 overflow checking on durations.
13522 * xfaces.c (Fbitmap_spec_p):
13523 Check that fixnums are in proper range for system types.
13524 (compare_fonts_by_sort_order):
13525 Avoid mishandling comparisons due to subtraction overflow.
13526 (Fx_family_fonts, realize_basic_faces):
13527 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13528 (Fx_family_fonts):
13529 Don't assume fixnum fits in int.
13530 Use SAFE_ALLOCA_LISP, not alloca.
13531 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
13532 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
13533 (face_at_buffer_position, face_for_overlay_string)
13534 (face_at_string_position):
13535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13536 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
13537 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
13538 (Fx_show_tip):
13539 Check that fixnums are in proper range for system types.
13540 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
13541 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
13542 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13543 (Fx_change_window_property): Don't assume fixnums fit in int.
13544 * xfont.c (xfont_chars_supported):
13545 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13546 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
13547 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
13548 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13549 * xml.c (parse_region):
13550 * xrdb.c (magic_file_p):
13551 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
13552 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
13553 (x_get_local_selection, x_reply_selection_request)
13554 (x_handle_selection_request, wait_for_property_change):
13555 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13556 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
13557 short is wide enough.
13558 (x_send_client_event): Don't assume fixnum fits in int.
13559 * xterm.c (x_x_to_emacs_modifiers):
13560 Don't assume EMACS_INT overflows nicely into int.
13561 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
13562 may come from Lisp.
13563 (handle_one_xevent): NATNUMP can eval its arg twice.
13564 (x_connection_closed):
13565 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
13566 * xterm.h: Adjust decls to match defn changes elsewhere.
13567 (struct scroll_bar): Use struct vectorlike_header
13568 rather than rolling our own approximation.
13569 (SCROLL_BAR_VEC_SIZE): Remove; not used.
13570
c6574eb5
GM
135712012-05-25 Glenn Morris <rgm@gnu.org>
13572
13573 * lisp.mk (lisp): Update for more files being compiled now.
13574
e8d32c7e
SM
135752012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
13576
48def666
SM
13577 * lread.c: Remove `read_pure' which makes no difference.
13578 (read_pure): Remove var.
13579 (unreadpure): Remove function.
13580 (readevalloop): Don't call read_list with -1 flag.
13581 (read1, read_vector): Don't test read_pure any more.
13582 (read_list): Simplify.
13583
e8d32c7e
SM
13584 * fileio.c, character.h: Minor style tweaks.
13585
4b2addb7
DA
135862012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
13587
13588 * window.h (clip_changed): Remove useless declaration.
13589
584461b2
JB
135902012-05-22 Juanma Barranquero <lekktu@gmail.com>
13591
13592 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
13593 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
13594
34374650
PE
135952012-05-22 Paul Eggert <eggert@cs.ucla.edu>
13596
13597 Remove src/m/*.
13598 This directory predates autoconf and is no longer needed nowadays.
13599 Move its few remaining bits of functionality to where they're needed.
13600 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
13601 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
13602 * m/template.h: Remove.
13603 * Makefile.in (M_FILE): Remove. All uses removed.
13604 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
13605 * lisp.h (USE_LSB_TAG):
13606 * mem-limits.h (EXCEEDS_LISP_PTR):
13607 Use VAL_MAX, not VALBITS, in #if.
13608 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
13609 (EMACS_UINT): Define unconditionally now.
13610 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
13611 (BITS_PER_EMACS_INT): New constants, replacing
13612 what used to be in config.h, but not useful in #if.
13613 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
13614 define them any more.
13615 (VAL_MAX): New macro.
13616 (VALMASK): Use it.
13617 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
13618 BITS_PER_EMACS_INT, in #if.
13619 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
13620 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
13621 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
13622 * s/ms-w32.h (DATA_START):
13623 Move here from removed file m/intel386.h.
13624 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
13625 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
13626
261cb4bb
PE
136272012-05-21 Paul Eggert <eggert@cs.ucla.edu>
13628
13629 Assume C89 or later.
13630 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
13631 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
13632 (xrealloc):
13633 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
13634 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
13635 * textprop.c, tparam.c (NULL): Remove.
13636 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
13637 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
13638 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
13639 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
13640 * xterm.c (input_signal_count): Assume volatile works.
13641
ff23cd9f
KB
136422012-05-21 Ken Brown <kbrown@cornell.edu>
13643
13644 * xgselect.c (xg_select): Fix first argument in call to 'select'
13645 (bug#11508).
13646
1b170bc6
KB
136472012-05-20 Ken Brown <kbrown@cornell.edu>
13648
13649 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 13650 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 13651
b2f4d39f
KB
136522012-05-19 Ken Brown <kbrown@cornell.edu>
13653
13654 * xfns.c (x_in_use): Remove `static' qualifier.
13655 * xterm.h (x_in_use): Declare.
13656 * xgselect.c: Include xterm.h.
13657 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
13658 and `display_arg' (bug#9754).
13659
003fdae2
PE
136602012-05-19 Paul Eggert <eggert@cs.ucla.edu>
13661
9232a6d9
PE
13662 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
13663
003fdae2
PE
13664 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
13665 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
13666
784b56e2
EZ
136672012-05-18 Eli Zaretskii <eliz@gnu.org>
13668
13669 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
13670
13671 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 13672 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
13673
13674 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
13675 reference to image_cache->refcount.
13676 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
13677
a0a79cde
JL
136782012-05-17 Juri Linkov <juri@jurta.org>
13679
13680 * search.c (Fword_search_regexp, Fword_search_backward)
13681 (Fword_search_forward, Fword_search_backward_lax)
13682 (Fword_search_forward_lax): Move functions to isearch.el
13683 (bug#10145, bug#11381).
13684
b0572523
PE
136852012-05-16 Paul Eggert <eggert@cs.ucla.edu>
13686
13687 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
13688
9660f5fc
SM
136892012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
13690
13691 * lread.c (init_obarray): Declare Qt and Qnil as special.
13692
4374de83
GM
136932012-05-14 Glenn Morris <rgm@gnu.org>
13694
13695 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 13696 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 13697
dc44c39a
PE
136982012-05-14 Paul Eggert <eggert@cs.ucla.edu>
13699
078c97cb
PE
13700 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
13701
dc44c39a
PE
13702 * unexaix.c: Port to more-recent AIX compilers.
13703 (report_error, report_error_1, make_hdr, copy_sym)
13704 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
13705 Make arguments const char *, not char *, to avoid violations of C
13706 standard and to fix some AIX warnings reported by Gilles Pion.
13707
e18afed7 137082012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
13709
13710 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
13711 already have overlays loaded.
13712 (handle_single_display_spec): Before returning without displaying
13713 fringe bitmap, synchronize the bidi iterator with the main display
13714 iterator, by calling iterate_out_of_display_property.
13715 (iterate_out_of_display_property): Detect buffer iteration by
13716 testing that it->string is a Lisp string.
13717 (get_next_display_element): When the current object is exhausted,
13718 and there's something on it->stack, call set_iterator_to_next to
13719 proceed with what's on the stack, instead of returning zero.
13720 (set_iterator_to_next): If called at the end of a Lisp string,
13721 proceed to consider_string_end without incrementing string
13722 position. Don't increment display vector index past the end of
13723 the display vector. (Bug#11417)
c8fb9dc6
EZ
13724 (pos_visible_p): Don't report a position visible when move_it_to
13725 stopped at the last line of window, which happens to be scanned
13726 backwards by the bidi iteration. (Bug#11464)
ac268e67 13727
e18afed7 137282012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
13729
13730 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
13731 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
13732 are on a TTY, and thus unable to display on the fringes.
13733 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
13734 so we need to signal to the caller that this is a "replacing"
13735 display spec. This fixes display when the spec is invalid or we
13736 are on a TTY.
13737
e18afed7 137382012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
13739
13740 * unexaix.c (make_hdr): Fix typo in prototype.
13741 This bug broke the build on AIX. Problem reported by Gilles Pion.
13742
9d0a235a
MA
137432012-05-14 Michael Albinus <michael.albinus@gmx.de>
13744
13745 * keyboard.c (kbd_buffer_get_event): Read special events also in
13746 batch mode. (Bug#11415)
13747
9e6b06ed
GM
137482012-05-12 Glenn Morris <rgm@gnu.org>
13749
13750 * ns.mk: Update for ns_appbindir no longer having trailing "/".
13751
c1a1d7a3
EZ
137522012-05-12 Eli Zaretskii <eliz@gnu.org>
13753
13754 * lisp.mk (lisp): Add newcomment.elc.
13755
3fe7cdc8
GM
137562012-05-12 Glenn Morris <rgm@gnu.org>
13757
13758 * Makefile.in (MKDIR_P): New, set by configure.
13759 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
13760
53f7d2c0
PE
137612012-05-11 Paul Eggert <eggert@cs.ucla.edu>
13762
13763 Remove unused function hourglass_started.
13764 * dispextern.h (hourglass_started):
13765 * w32fns.c (hourglass_started):
13766 * xdisp.c (hourglass_started): Remove.
13767
75aafb17
JB
137682012-05-10 Juanma Barranquero <lekktu@gmail.com>
13769
13770 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
13771 Update dependencies.
13772
12959e8e
PE
137732012-05-10 Paul Eggert <eggert@cs.ucla.edu>
13774
97107e2e
PE
13775 * xgselect.c (xg_select): Put maxfds+1 into a var.
13776 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
13777
12959e8e
PE
13778 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
13779
836d29b3
DA
137802012-05-10 Dave Abrahams <dave@boostpro.com>
13781
13782 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
13783 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
13784
5cb67954
MA
137852012-05-09 Michael Albinus <michael.albinus@gmx.de>
13786
13787 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 13788 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
13789 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
13790 Initialize xd_registered_buses.
13791
3478ec45
PE
137922012-05-09 Paul Eggert <eggert@cs.ucla.edu>
13793
b263a6b0
PE
13794 Untag more efficiently if USE_LSB_TAG.
13795 This is based on a proposal by YAMAMOTO Mitsuharu in
13796 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
13797 For an admittedly artificial (nth 8000 longlist) benchmark on
13798 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
13799 Emacs's overall text size by 1%.
13800 * lisp.h (XUNTAG): New macro.
13801 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
13802 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
13803 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
13804 * eval.c (Fautoload):
13805 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
13806 * frame.h (XFRAME): Use XUNTAG.
13807
3478ec45
PE
13808 Port recent dbusbind.c changes to 32-bit --with-wide-int.
13809 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
13810 Remove unportable assumptions about print widths of types like
13811 dbus_uint32_t.
13812 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
13813 intptr_t when converting between pointer and integer, to avoid GCC
13814 warnings about wrong width.
13815
666b903b 138162012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
13817
13818 * w32proc.c (new_child): Force Windows to reserve only 64KB of
13819 stack for each reader_thread, instead of defaulting to 8MB
13820 determined by the linker. This avoids failures in creating
13821 subprocesses on Windows 7, see the discussion in this thread:
13822 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13823
b120cc17
JC
138242012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13825
13826 Fix up display of the *Minibuf-0* buffer in the mini window.
13827 * keyboard.c (read_char): Don't clear the echo area if there's no
13828 message to clear.
13829 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 13830 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 13831
9a4b36f8
MA
138322012-05-07 Michael Albinus <michael.albinus@gmx.de>
13833
13834 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13835 batch mode.
13836
e5f9458f
CY
138372012-05-06 Chong Yidong <cyd@gnu.org>
13838
13839 * lisp.mk (lisp): Update.
13840
eceeb5fc 138412012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
13842
13843 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13844
71873e2b
SM
138452012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13846
13847 * data.c (PUT_ERROR): New macro.
13848 (syms_of_data): Use it. Add new error type `user-error'.
13849 * undo.c (user_error): New function.
13850 (Fprimitive_undo): Use it.
13851 * print.c (print_error_message): Adjust print style for `user-error'.
13852 * keyboard.c (user_error): New function.
13853 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13854
ab0fa4e4
PE
138552012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13856
13857 Do not limit current-time-string to years 1000..9999.
13858 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13859 (Fcurrent_time_string): Support any year that is supported by the
13860 underlying localtime representation. Don't use asctime, as it
13861 has undefined behavior for years outside the range -999..9999.
13862
7ed806a7
PE
138632012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13864
13865 Fix race conditions involving setenv, gmtime, localtime, asctime.
13866 Without this fix, interrupts could mess up code that uses these
13867 nonreentrant functions, since setting TZ invalidates existing
13868 tm_zone or tzname values, and since most of these functions return
13869 pointers to static storage.
13870 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13871 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13872 Grow the critical sections to include not just invoking
13873 localtime/gmtime, but also accessing these functions' results
13874 including their tm_zone values if any, and any related TZ setting.
13875 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
13876 so that the struct tm is saved in the critical section.
13877 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
13878 motivated by the fact that memory allocation needs to be outside
13879 the critical section.
13880
0c16dfed
DA
138812012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13882
13883 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13884 with RESET_INTERVAL.
13885
13886 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13887 Remove duplicated buffer name initialization.
13888
3f83ace8
JM
138892012-05-02 Jim Meyering <jim@meyering.net>
13890
13891 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13892
c7b8541e
JM
13893 * xfns.c (x_window): Use xstrdup (Bug#11375).
13894
90207a15 138952012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
13896
13897 * xdisp.c (pos_visible_p): If already at a newline from the
13898 display string before the 'while' loop, don't walk back the glyphs
13899 from it3.glyph_row. Solves assertion violation when the display
13900 string begins with a newline (egg.el). (Bug#11367)
13901
b593d6a9
AH
139022012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13903
13904 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13905 Move to simple.el.
13906
4737362e
GM
139072012-05-01 Glenn Morris <rgm@gnu.org>
13908
99cf43f9
GM
13909 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13910 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13911 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13912 All were removed before 23.1.
13913
9311dcff
GM
13914 * dispnew.c: Remove HAVE_LIBNCURSES test;
13915 it is always true on relevant platforms.
13916
4d5c6349
GM
13917 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13918 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13919
4737362e
GM
13920 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13921
74dd3a6b
AS
139222012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13923
13924 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13925 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13926 Remove.
13927
13c379ee
PE
139282012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13929
13930 Do not avoid creating empty evaporating overlays (Bug#9642).
13931 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13932 That is, do not delete an evaporating overlay if it becomes
13933 empty after its bounds are adjusted to fit within its buffer.
13934 This fix caused other problems, and I'm reverting it until we get
13935 to the bottom of them.
13936
a8e7d6d7 139372012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
13938
13939 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13940
a8e7d6d7 139412012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
13942
13943 * xdisp.c (pos_visible_p): If the window start position is beyond
13944 ZV, start the display from buffer beginning. Prevents assertion
13945 violation in init_iterator when the minibuffer window is scrolled
13946 via the scroll bar.
13947
13948 * window.c (window_scroll_pixel_based): Likewise.
13949
a8e7d6d7 139502012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
13951
13952 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13953
a8e7d6d7 139542012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
13955
13956 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13957 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13958
a8e7d6d7 139592012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 13960
b593d6a9
AH
13961 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13962 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 13963
1c6900d9
EZ
139642012-04-26 Eli Zaretskii <eliz@gnu.org>
13965
4c3fa1d9
EZ
13966 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13967 display element, check also the underlying string or buffer
13968 character. (Bug#11341)
13969
1c6900d9
EZ
13970 * w32menu.c: Include w32heap.h.
13971 (add_menu_item): If the call to AppendMenuW (via
13972 unicode_append_menu) fails, disable Unicode menus only if we are
13973 running on Windows 9X/Me.
13974
42bf8205
AS
139752012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13976
13977 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13978 (xgetint): Add missing shift for LSB tags.
13979
b1bac16e
MR
139802012-04-24 Martin Rudalics <rudalics@gmx.at>
13981
13982 * keyboard.c (read_char): Don't wipe echo area for select window
13983 events: These might get delayed via `mouse-autoselect-window'
13984 (Bug#11304).
13985
d69621cc
JB
139862012-04-24 Juanma Barranquero <lekktu@gmail.com>
13987
13988 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13989 manipulation of :loaded-from data.
13990
02fd101b
JB
139912012-04-23 Juanma Barranquero <lekktu@gmail.com>
13992
13993 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13994 now a cons (bug#11311).
13995
888bec30
PE
139962012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13997
89a438bd
PE
13998 Do not create empty overlays with the evaporate property (Bug#9642).
13999 * buffer.c (Fmove_overlay): Delete an evaporating overlay
14000 if it becomes empty after its bounds are adjusted to fit within
14001 its buffer. Without this fix, in a nonempty buffer (let ((o
14002 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
14003 yields an empty overlay that has the evaporate property, which is
14004 not supposed to happen.
14005
1068fe4d
PE
14006 Fix minor GTK3 problems found by static checking.
14007 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14008 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14009 (struct _EmacsFixedClass, emacs_fixed_get_type):
14010 Move decls here from emacsgtkfixed.h, since they needn't be public.
14011 (emacs_fixed_get_type): Now static.
14012 (emacs_fixed_class_init): Omit unused local.
14013 (emacs_fixed_child_type): Remove; unused.
14014 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
14015 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
14016 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
14017 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
14018 (EMACS_FIXED_GET_CLASS): Remove; unused.
14019 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
14020
888bec30
PE
14021 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
14022 Problem reported by Juanma Barranquero for Windows -Wunused-function.
14023
de85e130
PE
140242012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14025
d0baac98 14026 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 14027 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
14028 (__malloc_size_t, __malloc_ptrdiff_t):
14029 Remove. All uses removed, replaced by the definiens if needed,
14030 since we can assume C89 or better now.
14031 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
14032 (protect_malloc_state, align, get_contiguous_space)
14033 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
14034 (malloc_atfork_handler_child, malloc_enable_thread)
14035 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
14036 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
14037 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
14038 (special_realloc, _realloc_internal_nolock, _realloc_internal)
14039 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
14040 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
14041 Define using prototypes, not old style.
14042 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
14043 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
14044 (align): Don't assume that signed integer overflow wraps around.
14045 Omit unused local var.
14046 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
14047 (_free_internal_nolock, memalign, mallochook, reallochook):
14048 Omit no-longer-needed casts.
14049 (valloc): Use getpagesize, not __getpagesize.
14050 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
14051 (struct hdr): The 'magic' member is now size_t, not unsigned long.
14052
de85e130
PE
14053 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
14054
dcbf5805
MA
140552012-04-22 Michael Albinus <michael.albinus@gmx.de>
14056
14057 Move functions from C to Lisp. Make non-blocking method calls
14058 the default. Implement further D-Bus standard interfaces.
14059
14060 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
14061 (QCdbus_request_name_allow_replacement)
14062 (QCdbus_request_name_replace_existing)
14063 (QCdbus_request_name_do_not_queue)
14064 (QCdbus_request_name_reply_primary_owner)
14065 (QCdbus_request_name_reply_in_queue)
14066 (QCdbus_request_name_reply_exists)
14067 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
14068 (QCdbus_registered_serial, QCdbus_registered_method)
14069 (QCdbus_registered_signal): New Lisp objects.
14070 (XD_DEBUG_MESSAGE): Use sizeof.
14071 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
14072 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
14073 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
14074 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
14075 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
14076 (xd_signature, xd_append_arg): Allow float for integer types.
14077 (xd_get_connection_references): New function.
b593d6a9
AH
14078 (xd_get_connection_address): Rename from xd_initialize.
14079 Return cached address.
dcbf5805
MA
14080 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
14081 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
14082 level.
14083 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 14084 Return number of refcounts.
dcbf5805
MA
14085 (Fdbus_get_unique_name): Make stronger parameter check.
14086 (Fdbus_message_internal): New defun.
14087 (Fdbus_call_method, Fdbus_call_method_asynchronously)
14088 (Fdbus_method_return_internal, Fdbus_method_error_internal)
14089 (Fdbus_send_signal, Fdbus_register_service)
14090 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
14091 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
14092 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
14093 (Vdbus_compiled_version, Vdbus_runtime_version)
14094 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
14095 (Vdbus_message_type_method_return, Vdbus_message_type_error)
14096 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
14097 (Vdbus_registered_buses, Vdbus_registered_objects_table):
14098 Adapt docstring.
dcbf5805 14099
52828e02
PE
141002012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14101
da05bc4c
PE
14102 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
14103 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
14104 Do not assume ptrdiff_t is the same width as 'int'.
14105
52828e02
PE
14106 * alloc.c: Handle unusual debugging option combinations.
14107 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
14108 since the two debugging options are incompatible.
14109 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
14110 is defined.
14111 (mem_init, mem_insert, mem_insert_fixup):
14112 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
14113 (NEED_MEM_INSERT): Remove; no longer needed.
14114
f01769f9
LL
141152012-04-22 Leo Liu <sdl.web@gmail.com>
14116
14117 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
14118
5790543d
PE
141192012-04-22 Paul Eggert <eggert@cs.ucla.edu>
14120
14121 * sysdep.c [__FreeBSD__]: Minor cleanups.
14122 (list_system_processes, system_process_attributes) [__FreeBSD__]:
14123 Use Emacs indenting style more consistently. Avoid some casts.
14124 Use 'double' consistently rather than mixing 'float' and 'double'.
14125
b91b7e4d
EW
141262012-04-21 Eduard Wiebe <usenet@pusto.de>
14127
b593d6a9
AH
14128 * sysdep.c (list_system_processes, system_process_attributes):
14129 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 14130
6114eb15
AS
141312012-04-21 Andreas Schwab <schwab@linux-m68k.org>
14132
14133 * lisp.mk (lisp): Update.
14134
2f38dff7
PE
141352012-04-20 Paul Eggert <eggert@cs.ucla.edu>
14136
14137 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
14138 It is never used otherwise.
14139
4ae29f89
SM
141402012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
14141
14142 * print.c (print_preprocess): Only check print_depth if print-circle
14143 is nil.
14144 (print_object): Check for cycles even when print-circle is nil and
14145 print-gensym is t, but only check print_depth if print-circle is nil.
14146
f30d612a
CY
141472012-04-20 Chong Yidong <cyd@gnu.org>
14148
14149 * process.c (wait_reading_process_output): If EIO occurs on a pty,
14150 set the status to "failed" and ensure that sentinel is run.
14151
c07a4c0b 141522012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
14153
14154 * process.c (Fset_process_inherit_coding_system_flag)
14155 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 14156 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 14157
c07a4c0b 141582012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
14159
14160 * xdisp.c (string_buffer_position_lim): Limit starting position to
14161 BEGV.
14162 (set_cursor_from_row): If called for a mode-line or header-line
14163 row, return zero immediately.
14164 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
14165 farther than the first row after the header line, if any.
14166 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
14167 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
14168
c07a4c0b 141692012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 14170
4ae29f89
SM
14171 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
14172 (bug#11238).
ad3a2b41 14173
c07a4c0b 141742012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 141752012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
14176
14177 configure: new option --enable-gcc-warnings (Bug#11207)
14178 * Makefile.in (C_WARNINGS_SWITCH): Remove.
14179 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
14180 (ALL_CFLAGS): Use new macros rather than old.
14181 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
14182 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
14183 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
14184 -Wunused-result, -Wunused-variable. This should go away once
14185 the Emacs and Gnulib regex code is merged.
14186 (xmalloc, xrealloc): Now static.
14187
aba027e8
PE
141882012-04-17 Paul Eggert <eggert@cs.ucla.edu>
14189
14190 * dired.c (Fsystem_groups): Remove unused local.
14191
e5a36063
GM
141922012-04-17 Glenn Morris <rgm@gnu.org>
14193
14194 * dired.c (Fsystem_users): Doc fix.
14195
316411f0
DA
141962012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
14197
14198 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
14199 (syms_of_dired): Add them.
14200
9426aba4
PE
142012012-04-16 Paul Eggert <eggert@cs.ucla.edu>
14202
b62a57be
PE
14203 Fix minor alloc.c problems found by static checking.
14204 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
14205 New extern decls, to avoid calling undeclared functions.
14206 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
14207 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
14208 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
14209 (NEED_MEM_INSERT): New macro.
14210 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 14211 Remove one incorrect comment and fix another.
b62a57be 14212
3539f31f
PE
14213 Fix minor ralloc.c problems found by static checking.
14214 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14215 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
14216 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
14217 (r_alloc_sbrk): Now static.
14218
a041960a
PE
14219 Improve ralloc.c interface checking.
14220 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
14221 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
14222 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
14223 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
14224 [REL_ALLOC]: ... to here, to check interface.
14225 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
14226 Remove decls. This fixes an "It stinks!".
14227
9426aba4
PE
14228 * alloc.c (which_symbols): Fix alignment issue / type clash.
14229
d55c12ed
AS
142302012-04-15 Andreas Schwab <schwab@linux-m68k.org>
14231
14232 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
14233 (struct Lisp_Misc_Any): Likewise.
14234 (struct Lisp_Free): Likewise.
14235 * alloc.c (union aligned_Lisp_Symbol): Define.
14236 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
14237 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
14238 (union aligned_Lisp_Misc): Define.
14239 (MARKER_BLOCK_SIZE, struct marker_block): Use union
14240 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 14241 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 14242
b948ce8b
PE
142432012-04-14 Paul Eggert <eggert@cs.ucla.edu>
14244
14245 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
14246 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
14247 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
14248 * s/netbsd.h, s/sol2-6.h:
14249 Remove definition of GC_MARK_STACK, since the default now works.
14250 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
14251 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
14252 no longer the default.
14253 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
14254
35dc09a1 142552012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 14256
35dc09a1
GM
14257 * lread.c (lisp_file_lexically_bound_p):
14258 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 14259
35dc09a1
GM
142602012-04-14 Eli Zaretskii <eliz@gnu.org>
14261
14262 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
14263 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
14264
142652012-04-14 Jan Djärv <jan.h.d@swipnet.se>
14266
14267 * nsterm.m (constrainFrameRect): Always constrain when there is only
14268 one screen (Bug#10962).
14269
bcd86815
KB
142702012-04-13 Ken Brown <kbrown@cornell.edu>
14271
14272 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
14273
c25df26e
RT
142742012-04-13 Reuben Thomas <rrt@sc3d.org>
14275
14276 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
14277
0fc59f1e
DC
142782012-04-11 Daniel Colascione <dancol@dancol.org>
14279
14280 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
14281 against is gone. It's better to use vfork now so that when Cygwin
14282 gains a new, working vfork, we use it automatically (bug#10398).
14283
de8c03dc
SM
142842012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14285
14286 * window.c (save_window_save): Obey window-point-insertion-type.
14287
2f097256
GM
142882012-04-11 Glenn Morris <rgm@gnu.org>
14289
14290 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
14291
453b951e
SM
142922012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
14293
14294 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
14295
75f1671a 142962012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
14297
14298 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
14299 (force_quit_count): New var.
14300 (handle_interrupt): Use it.
14301
2a8ce227
JB
143022012-04-10 Juanma Barranquero <lekktu@gmail.com>
14303
14304 * w32.c (w32_delayed_load): Record the full path of the library
14305 being loaded (bug#10424).
14306
935396c0
GM
143072012-04-09 Glenn Morris <rgm@gnu.org>
14308
05920a43
GM
14309 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
14310 not just in the obarray, before snarfing them. (Bug#11036)
14311
935396c0
GM
14312 * Makefile.in ($(leimdir)/leim-list.el):
14313 Pass EMACS rather than BUILT_EMACS.
14314
a18ecafa
TZ
143152012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
14316
14317 * process.c (make_process):
14318 * process.h: Add integer `gnutls_handshakes_tried' member to
14319 process struct.
14320
6bbef4e5
JC
14321 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
14322 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
14323
14324 * gnutls.c (gnutls_log_function2i): Convenience log function.
14325 (emacs_gnutls_read): Use new log functions,
14326 `gnutls_handshakes_tried' process member, and
14327 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
14328 attempts per process (connection).
14329
b4d3bc10
CY
143302012-04-09 Chong Yidong <cyd@gnu.org>
14331
14332 * eval.c (Fuser_variable_p, user_variable_p_eh)
14333 (lisp_indirect_variable): Functions deleted.
14334 (Fdefvar): Caller changed.
14335
14336 * callint.c (Finteractive, Fcall_interactively):
14337 * minibuf.c (Fread_variable): Callers changed.
14338
70f4d973
EZ
143392012-04-09 Eli Zaretskii <eliz@gnu.org>
14340
14341 * xdisp.c (set_cursor_from_row): If the display string appears in
14342 the buffer at position that is closer to point than the position
14343 after the display string, display the cursor on the first glyph of
14344 the display string. Fixes cursor display when a 'display' text
14345 property immediately follows invisible text. (Bug#11094)
14346
cb3c2e3e
PE
143472012-04-09 Paul Eggert <eggert@cs.ucla.edu>
14348
14349 composite.c: use 'double' consistently
14350 * composite.c (get_composition_id): Use 'double' consistently
14351 instead of converting 'float' to 'double' and vice versa; this is
14352 easier to understand and avoids a GCC warning.
14353
fd06db5d
GM
143542012-04-09 Glenn Morris <rgm@gnu.org>
14355
50fe702a
GM
14356 * Makefile.in: Generate leim-list with bootstrap-emacs, in
14357 preparation for dumping it with emacs. (Bug#4789)
14358 (leimdir): New variable.
14359 ($(leimdir)/leim-list.el): New rule.
14360 (emacs$(EXEEXT)): Depend on leim-list.el.
14361
fd06db5d
GM
14362 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
14363 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
14364 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
14365
55c131ee
AS
143662012-04-08 Andreas Schwab <schwab@linux-m68k.org>
14367
14368 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
14369 proper alignment.
14370
9209588f
JB
143712012-04-07 Juanma Barranquero <lekktu@gmail.com>
14372
14373 * xml.c (init_libxml2_functions) [WINDOWSNT]:
14374 Remove unused local variable.
14375
e3fb2efb
PE
143762012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14377
14378 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
14379 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
14380 (mark_memory): Mark Lisp_Objects only if pointers might hide in
14381 objects, as mark_maybe_pointer will catch them otherwise.
14382 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
14383 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
14384
b5385551
PE
143852012-04-07 Paul Eggert <eggert@cs.ucla.edu>
14386
14387 Fix typo that broke non-Windows builds.
14388 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
14389
9078ead6
EZ
143902012-04-07 Eli Zaretskii <eliz@gnu.org>
14391
14392 Support building on MS-Windows with libxml2.
14393
14394 * makefile.w32-in (OBJ2): Add xml.$(O).
14395 (GLOBAL_SOURCES): Add xml.c.
14396 ($(BLD)/xml.$(O)): New dependency list.
14397
14398 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
14399 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
14400 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
14401 [!WINDOWSNT]: New macros.
14402 (init_libxml2_functions, libxml2_loaded_p): New functions.
14403 (parse_region): Call fn_xmlCheckVersion instead of using the macro
14404 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
14405 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
14406 Calls xmlCleanupParser only if libxml2 was loaded (or statically
14407 linked in).
6bbef4e5
JC
14408 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
14409 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
14410 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
14411
14412 * emacs.c: Don't include libxml/parser.h.
14413 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
14414 xmlCleanupParser directly.
14415
14416 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
14417
3811fdf3
EZ
144182012-04-07 Eli Zaretskii <eliz@gnu.org>
14419
14420 * indent.c (Fvertical_motion): If there is a display string at
14421 point, use it.vpos to compute how many lines to backtrack after
14422 move_it_to point. (Bug#11133)
14423
2f8e16b2
EZ
144242012-04-06 Eli Zaretskii <eliz@gnu.org>
14425
14426 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
14427 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
14428 about subtle differences between FETCH_CHAR* and STRING_CHAR*
14429 macros related to unification of CJK characters. For the details,
14430 see the discussion following the message here:
14431 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
14432
3d439cd1
CY
144332012-04-04 Chong Yidong <cyd@gnu.org>
14434
14435 * keyboard.c (Vdelayed_warnings_list): Doc fix.
14436
8bc53d00
EZ
144372012-04-01 Eli Zaretskii <eliz@gnu.org>
14438
14439 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
14440 instead of alloca. (Bug#11138)
14441
3b0512a3
AS
144422012-04-01 Andreas Schwab <schwab@linux-m68k.org>
14443
14444 * w32menu.c (is_simple_dialog): Properly check lisp types.
14445 (Bug#11141)
14446
8427ddd2
EZ
144472012-03-31 Eli Zaretskii <eliz@gnu.org>
14448
979022ef
EZ
14449 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
14450 position we get to after a call to move_it_to fails the
14451 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
14452 only if we wind up in a string from display property. (Bug#11063)
14453
a6b1c7cc
EZ
14454 * window.c (Fdelete_other_windows_internal): Invalidate the row
14455 and column information about mouse highlight, so that redisplay
14456 restores it after reallocating the glyph matrices. (Bug#7464)
14457
8427ddd2
EZ
14458 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
14459 string comes from a `display' text property, use the buffer
14460 position of that property as if we actually saw that position in
14461 the row's glyphs.
697ba24b
EZ
14462 (move_it_by_lines): Remove the assertion that
14463 "it->current_x == 0 && it->hpos == 0" which can be legitimately
14464 violated when there's a before-string at the beginning of a line.
14465 (Bug#11063)
8427ddd2 14466
65a0a738
EZ
144672012-03-30 Eli Zaretskii <eliz@gnu.org>
14468
14469 * xdisp.c (append_space_for_newline): If the default face was
14470 remapped, use the remapped face for the appended newline.
14471 (extend_face_to_end_of_line): Use the remapped default face for
14472 extending the face to the end of the line.
14473 (display_line): Call extend_face_to_end_of_line when the default
14474 face was remapped. (Bug#11068)
14475
581355cc
EZ
144762012-03-29 Eli Zaretskii <eliz@gnu.org>
14477
14478 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
14479
e8fc049f
SM
144802012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14481
14482 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
14483
4fb9a543
GM
144842012-03-27 Glenn Morris <rgm@gnu.org>
14485
14486 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
14487 Doc fixes.
14488
679910f1
KH
144892012-03-26 Kenichi Handa <handa@m17n.org>
14490
14491 * dispextern.h (struct glyph): Fix previous change. Change the
14492 bit length of glyphless.ch to 25 (Bug#11082).
14493
90d49b7f
CY
144942012-03-26 Chong Yidong <cyd@gnu.org>
14495
14496 * keyboard.c (Vselection_inhibit_update_commands): New variable.
14497 (command_loop_1): Use it; inhibit selection update for
14498 handle-select-window too (Bug#8996).
14499
f514f6f0
FP
145002012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
14501
e8fc049f 14502 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 14503
bf43fa51
KH
145042012-03-25 Kenichi Handa <handa@m17n.org>
14505
14506 * dispextern.h (struct glyph): Change the bit length of
14507 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
14508
8a0c01dd
EZ
145092012-03-24 Eli Zaretskii <eliz@gnu.org>
14510
14511 * s/ms-w32.h (tzname): Include time.h before redirecting to
14512 _tzname. Fixes the MSVC build. (Bug#9960)
14513
7d1c3a76
AS
145142012-03-24 Andreas Schwab <schwab@linux-m68k.org>
14515
8ed79523
AS
14516 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
14517 characters.
14518
7d1c3a76
AS
14519 * xterm.c (XTread_socket): Only modify handling_signal if
14520 !SYNC_INPUT. (Bug#11080)
14521
e99a9b8b
EZ
145222012-03-23 Eli Zaretskii <eliz@gnu.org>
14523
14524 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
14525 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
14526 when fetching a multibyte character consumes more bytes than
14527 CHAR_BYTES returns, due to unification of CJK characters in
14528 string_char. (Bug#11073)
14529
5063c0e1
TN
145302012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
14531
14532 * process.c (wait_reading_process_output): Handle pty disconnect
14533 by refraining from sending oneself a SIGCHLD (bug#10933).
14534
9f851fbd
CY
145352012-03-22 Chong Yidong <cyd@gnu.org>
14536
14537 * dispextern.h (struct it): New member string_from_prefix_prop_p.
14538
5063c0e1 14539 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
14540 Mark string as coming from a prefix property.
14541 (handle_face_prop): Use default face for prefix strings (Bug#4281).
14542 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
14543
fb5b8aca
CY
145442012-03-21 Chong Yidong <cyd@gnu.org>
14545
14546 * xfaces.c (Vface_remapping_alist): Doc fix.
14547
62356a1b
EZ
145482012-03-20 Eli Zaretskii <eliz@gnu.org>
14549
14550 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
14551 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
14552 Doc fixes.
62356a1b 14553
025de85b
CY
145542012-03-20 Chong Yidong <cyd@gnu.org>
14555
14556 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
14557 to reflect default non-nil value of redisplay-dont-pause.
14558
4827f94e
KH
145592012-03-19 Kenichi Handa <handa@m17n.org>
14560
14561 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
14562 it fit in a valid range (Bug#11003).
14563
e50a24a2
EZ
145642012-03-18 Eli Zaretskii <eliz@gnu.org>
14565
14566 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
14567 that is not from display property, accept the row as a "cursor
14568 row" if one of the string's character has a non-nil `cursor'
14569 property. Fixes cursor positioning when there are newlines in
14570 overlay strings, e.g. in icomplete.el. (Bug#11035)
14571
9af5ed87
PE
145722012-03-12 Paul Eggert <eggert@cs.ucla.edu>
14573
14574 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
14575
d1f55f16
CY
145762012-03-12 Chong Yidong <cyd@gnu.org>
14577
14578 * eval.c (inhibit_lisp_code): Rename from
14579 inhibit_window_configuration_change_hook; move from window.c.
14580
14581 * xfns.c (unwind_create_frame_1, Fx_create_frame):
14582 * window.c (run_window_configuration_change_hook)
14583 (syms_of_window): Callers changed.
14584
66c5eebd
CY
145852012-03-11 Chong Yidong <cyd@gnu.org>
14586
413df973
CY
14587 * keymap.c (Fkey_description): Doc fix (Bug#9700).
14588
66c5eebd
CY
14589 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
14590
1de11f56
CY
145912012-03-10 Chong Yidong <cyd@gnu.org>
14592
14593 * frame.c (other_visible_frames): Don't assume the selected frame
14594 is visible (Bug#10955).
14595
cae07000
SM
145962012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
14597
14598 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
14599
89c94350
JD
146002012-03-08 Jan Djärv <jan.h.d@swipnet.se>
14601
14602 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
14603 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
14604 zero (Bug#10954).
14605
999dd333
GM
146062012-03-03 Glenn Morris <rgm@gnu.org>
14607
01a6dcc8 14608 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 14609
de0100f2
EZ
146102012-03-02 Eli Zaretskii <eliz@gnu.org>
14611
14612 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
14613 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
14614 (redisplay_window, next_element_from_string): Fix typos in
14615 comments.
3e441275
EZ
14616 (redisplay_window): Pass to move_it_vertically the margin in
14617 pixels, not in screen lines.
de0100f2 14618
96a72ee9
GM
146192012-03-02 Glenn Morris <rgm@gnu.org>
14620
14621 * buffer.c (buffer-list-update-hook): Doc fix.
14622
312508d7
EZ
146232012-02-29 Eli Zaretskii <eliz@gnu.org>
14624
14625 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
14626 push_it before setting up the iterator for the first overlay
14627 string, even if we have an empty string loaded.
14628 (next_overlay_string): If there's an empty string on the iterator
14629 stack, pop the stack. (Bug#10903)
14630
27f3c637
PE
146312012-02-25 Paul Eggert <eggert@cs.ucla.edu>
14632
14633 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
14634 Suggested by Stefan Monnier in
14635 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
14636 * alloc.c (widen_to_Lisp_Object): New static function.
14637 (mark_memory): Also mark Lisp_Objects by fetching pointer words
14638 and widening them to Lisp_Objects. This would work even if
14639 USE_LSB_TAG is defined and wide integers are used, which might
14640 happen in a future version of Emacs.
14641
3c9dfce6
CY
146422012-02-25 Chong Yidong <cyd@gnu.org>
14643
fa74b241
CY
14644 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
14645 Doc fix.
14646
3c9dfce6
CY
14647 * xselect.c (Fx_selection_exists_p): Doc fix.
14648 (x_clipboard_manager_save_all): Print an informative message
14649 before saving to clipboard manager.
14650
9486df08
CY
146512012-02-24 Chong Yidong <cyd@gnu.org>
14652
14653 * keyboard.c (process_special_events): Handle all X selection
14654 requests in kbd_buffer, not just the next one (Bug#8869).
14655
f01d3321
CY
146562012-02-23 Chong Yidong <cyd@gnu.org>
14657
14658 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
14659 call when setting menu-bar-lines and tool-bar-lines parameters.
14660 (unwind_create_frame_1): New helper function.
14661
14662 * window.c (inhibit_window_configuration_change_hook): New var.
14663 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 14664 (syms_of_window): Initialize it.
f01d3321 14665
86b847b6
CY
146662012-02-22 Chong Yidong <cyd@gnu.org>
14667
14668 * xterm.c (x_draw_image_relief): Add missing type check for
14669 Vtool_bar_button_margin (Bug#10743).
14670
a59225b1
CY
146712012-02-21 Chong Yidong <cyd@gnu.org>
14672
14673 * fileio.c (Vfile_name_handler_alist): Doc fix.
14674
14675 * buffer.c (Fget_file_buffer): Protect against invalid file
14676 handler return value.
14677
310f5bd4
PE
146782012-02-20 Paul Eggert <eggert@cs.ucla.edu>
14679
cb3a28cc
PE
14680 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
14681 when computing $valmask.
14682
310f5bd4
PE
14683 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
14684 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
14685 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
14686 It's useless in that case, and it can cause problems on hosts
14687 that allocate halves of EMACS_INT values separately.
14688 Reported by Dan Horák. Diagnosed by Andreas Schwab in
14689 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
14690 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
14691 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
14692 it avoids undefined behavior on hosts where shifting right by more
14693 than the word width has undefined behavior.
14694
2375c96a
CY
146952012-02-19 Chong Yidong <cyd@gnu.org>
14696
14697 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
14698 (Funhandled_file_name_directory, Ffile_name_as_directory)
14699 (Fdirectory_file_name, Fexpand_file_name)
14700 (Fsubstitute_in_file_name): Protect against invalid file handler
14701 return values (Bug#10845).
14702
3eb49e71
EZ
147032012-02-18 Eli Zaretskii <eliz@gnu.org>
14704
14705 * .gdbinit (pitx): Fix incorrect references to fields of the
14706 iterator stack.
14707
7b926f3f
CY
147082012-02-17 Chong Yidong <cyd@gnu.org>
14709
14710 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
14711
11273115
PE
147122012-02-15 Paul Eggert <eggert@cs.ucla.edu>
14713
14714 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
14715 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
14716
c3a70e2b
CY
147172012-02-15 Chong Yidong <cyd@gnu.org>
14718
14719 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
14720 marked as special. Also, starting docstrings with * is obsolete.
14721
0ca43699
AS
147222012-02-13 Andreas Schwab <schwab@linux-m68k.org>
14723
14724 * gnutls.c (emacs_gnutls_write): Fix last change.
14725
2e8f3c56
LI
147262012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
14727
14728 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
14729 send_process.
14730
af70074f
SM
147312012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
14732
14733 * keymap.c (Fsingle_key_description): Handle char ranges.
14734
95986d52
CY
147352012-02-12 Chong Yidong <cyd@gnu.org>
14736
afd83bd1
CY
14737 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
14738 as that creates a dangerous corner case.
14739
95986d52
CY
14740 * window.c (Fdelete_window_internal): Invalidate the mouse
14741 highlight (Bug#9904).
14742
bd7da63e
GM
147432012-02-12 Glenn Morris <rgm@gnu.org>
14744
14745 * xselect.c (Fx_own_selection_internal)
14746 (Fx_get_selection_internal, Fx_disown_selection_internal)
14747 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
14748 * nsselect.m (Fx_own_selection_internal)
14749 (Fx_disown_selection_internal, Fx_selection_exists_p)
14750 (Fx_selection_owner_p, Fx_get_selection_internal):
14751 Sync docs and argument specs with the xselect.c versions.
14752
77abcbc2
LI
147532012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
14754
14755 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
14756
90b671e2
EZ
147572012-02-11 Eli Zaretskii <eliz@gnu.org>
14758
1c0ca0b7
EZ
14759 * w32select.c (Fx_selection_exists_p): Sync doc string and
14760 argument list with xselect.c. (Bug#10783)
14761
14762 * w16select.c (Fx_selection_exists_p): Sync doc string and
14763 argument list with xselect.c. (Bug#10783)
90b671e2 14764
49241268
GM
147652012-02-10 Glenn Morris <rgm@gnu.org>
14766
14767 * fns.c (Fsecure_hash): Doc fix.
14768
f998bbe7 147692012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
14770
14771 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
14772
0992bd9c
CY
147732012-02-07 Chong Yidong <cyd@gnu.org>
14774
14775 * buffer.c (Fbuffer_local_variables)
14776 (buffer_lisp_local_variables): Handle unbound vars correctly;
14777 don't let Qunbound leak into Lisp.
14778
af008560
GM
147792012-02-07 Glenn Morris <rgm@gnu.org>
14780
dd605cc4
GM
14781 * image.c (Fimagemagick_types): Doc fix.
14782
af008560
GM
14783 * image.c (imagemagick-render-type): Change it from a lisp object
14784 to an integer. Move the doc here from the lisp manual.
14785 Treat all values not equal to 0 the same.
14786
1449fa1d
CY
147872012-02-06 Chong Yidong <cyd@gnu.org>
14788
14789 * doc.c (store_function_docstring): Avoid applying docstring of
14790 alias to base function (Bug#2603).
14791
3723ec07
AS
147922012-02-04 Andreas Schwab <schwab@linux-m68k.org>
14793
14794 * .gdbinit (pp1, pv1): Remove redundant defines.
14795 (pr): Use pp.
14796
79c1cc1e
CY
147972012-02-04 Chong Yidong <cyd@gnu.org>
14798
14799 * nsterm.m: Declare a global (Bug#10694).
14800
d7f29f8e
EZ
148012012-02-04 Eli Zaretskii <eliz@gnu.org>
14802
cae07000
SM
14803 * w32.c (get_emacs_configuration_options):
14804 Include --enable-checking, if specified, in the return value.
d7f29f8e 14805
3b95a6f9
MR
148062012-02-04 Martin Rudalics <rudalics@gmx.at>
14807
14808 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
14809 after rounding frame sizes. (Bug#9723)
14810
d6fa96a6
EZ
148112012-02-04 Eli Zaretskii <eliz@gnu.org>
14812
14813 * keyboard.c (adjust_point_for_property): Don't position point
14814 before BEGV. (Bug#10696)
14815
df0b2940
PE
148162012-02-03 Paul Eggert <eggert@cs.ucla.edu>
14817
14818 Handle overflow when computing char display width (Bug#9496).
14819 * character.c (char_width): Return EMACS_INT, not int.
14820 (char_width, c_string_width): Check for overflow when
14821 computing the width; this is possible now that individual
14822 characters can have unbounded width. Problem introduced
14823 by merge from Emacs 23 on 2012-01-19.
14824
6bee44d6
MA
148252012-02-02 Michael Albinus <michael.albinus@gmx.de>
14826
14827 * dbusbind.c (Fdbus_register_method): Mention the return value
14828 :ignore in the docstring.
14829
44f92739
GM
148302012-02-02 Glenn Morris <rgm@gnu.org>
14831
1b9f60cc
GM
14832 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14833
44f92739
GM
14834 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14835 Unconditionally set to t. (Bug#10673)
14836 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14837 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14838 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14839
c5d3843c
KH
148402012-02-02 Kenichi Handa <handa@m17n.org>
14841
14842 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14843 0, do not call append_composite_glyph.
14844
159462d4 148452012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
14846
14847 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14848 NULL (Bug#6988).
14849 (x_produce_glyphs): If the component of a composition is a null
14850 string, set it->pixel_width to 1 to avoid zero-width glyph.
14851
78cef877
EZ
148522012-02-01 Eli Zaretskii <eliz@gnu.org>
14853
14854 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14855 first 2 arguments are identical. This makes inserting large
14856 output from a subprocess an order of magnitude faster on
14857 MS-Windows, where all sbrk'ed memory is always contiguous.
14858
97897668
GM
148592012-01-31 Glenn Morris <rgm@gnu.org>
14860
14861 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 14862 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
14863 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14864
31fd3586
GM
148652012-01-29 Glenn Morris <rgm@gnu.org>
14866
14867 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14868
0e24a8b2
CY
148692012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14870
14871 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14872
cc0adcb0
CY
148732012-01-28 Chong Yidong <cyd@gnu.org>
14874
14875 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14876
acc28cb9
CY
148772012-01-26 Chong Yidong <cyd@gnu.org>
14878
9c69cfb7
CY
14879 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14880
acc28cb9
CY
14881 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14882 repeat counts (Bug#10507).
14883
48da7392
GM
148842012-01-26 Glenn Morris <rgm@gnu.org>
14885
14886 * lread.c (syms_of_lread): Doc fix.
14887
14af5f7f
CY
148882012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14889
14890 * coding.c (encode_designation_at_bol): Change return value to
14891 EMACS_INT.
14892
0b21c100
CY
148932012-01-25 Chong Yidong <cyd@gnu.org>
14894
14895 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14896
3c2907f7
CY
148972012-01-21 Chong Yidong <cyd@gnu.org>
14898
14899 * floatfns.c (Fcopysign): Make the second argument non-optional,
14900 since nil is not allowed anyway.
14901
959ad23f
AS
149022012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14903
14904 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14905 (send_process): Likewise.
14906
34a02f46
MR
149072012-01-19 Martin Rudalics <rudalics@gmx.at>
14908
14909 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
14910 (Vwindow_persistent_parameters): Do not use Qstate.
14911 Rewrite doc-strings.
34a02f46 14912
1259009a 149132012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
14914
14915 * character.c (char_width): New function.
70d4fdf6
GM
14916 (Fchar_width, c_string_width, lisp_string_width):
14917 Use char_width (Bug#9496).
25ed9e61 14918
6a6ee00d
MR
149192012-01-16 Martin Rudalics <rudalics@gmx.at>
14920
14921 * window.c (Vwindow_persistent_parameters): New variable.
14922 (Fset_window_configuration, save_window_save): Handle persistent
14923 window parameters.
14924
c85efaf7
EZ
149252012-01-14 Eli Zaretskii <eliz@gnu.org>
14926
14927 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14928 thrashing the stack of the thread. (Bug#9087)
14929
5944709e
PE
149302012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14931
14932 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14933
e71f5d99
EZ
149342012-01-11 Eli Zaretskii <eliz@gnu.org>
14935
14936 * xdisp.c (rows_from_pos_range): Handle the case where the
14937 highlight ends on a newline. (Bug#10464)
14938 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14939 he end column for display of highlight that ends on a newline
14940 before a R2L line.
14941
ce316182
GM
149422012-01-11 Glenn Morris <rgm@gnu.org>
14943
14944 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14945 from load-path also when installation-directory is nil. (Bug#10208)
14946
5b43da69
GM
149472012-01-10 Glenn Morris <rgm@gnu.org>
14948
74cc8ff9
GM
14949 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14950
7d8d6e4e
GM
14951 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14952 Update template values to be closer to their typical values these days.
5b43da69 14953
a0db8d43
EZ
149542012-01-09 Eli Zaretskii <eliz@gnu.org>
14955
14956 * xdisp.c (rows_from_pos_range): Accept additional argument
14957 DISP_STRING, and accept any glyph in a row whose object is that
14958 string as eligible for mouse highlight. Fixes mouse highlight of
14959 display strings from overlays. (Bug#10464)
14960
9a0115ab 149612012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 14962
b9110d6a 14963 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
14964 * fileio.c (auto_saving_dir_umask): New static var.
14965 (Fmake_directory_internal): Use it.
14966 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14967 creating the directory. The old code temporarily assigns
14968 too-generous permissions to the directory.
14969 (do_auto_save_eh): Clear it.
b9110d6a 14970 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
14971 that the var is always cleared.
14972
6c1bd3f3
EZ
149732012-01-07 Eli Zaretskii <eliz@gnu.org>
14974
14975 * search.c (scan_buffer): Pass character positions to
14976 know_region_cache, not byte positions. (Bug#6540)
14977
069d2b50
L
149782012-01-07 LynX <_LynX@bk.ru> (tiny change)
14979
14980 * w32.c (sys_rename): Report EXDEV when rename of a directory
14981 fails because the target is on another logical disk. (Bug#10284)
14982
75bf0d33
DB
149832012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14984
14985 * xterm.c (x_embed_request_focus): New function.
14986
14987 * xterm.h: Add prototype.
14988
14989 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14990
1c6e5a32
GM
149912012-01-05 Glenn Morris <rgm@gnu.org>
14992
14993 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14994
651e947e
EZ
149952012-01-01 Eli Zaretskii <eliz@gnu.org>
14996
14997 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14998 Load gnutls_transport_set_lowat only if GnuTLS version is below
14999 2.11.1.
15000 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
15001 GnuTLS versions below 2.11.1.
15002
3778cdd8
AL
150032011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
15004
15005 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
15006 to the doc string advising against its use for altering the way
15007 windows are scrolled.
15008
0e5317f7
KH
150092011-12-28 Kenichi Handa <handa@m17n.org>
15010
15011 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
15012 coding-system ASCII compatible only when it does not produce BOM
15013 on encoding (Bug#10383).
15014
93d5ca1f
JD
150152011-12-26 Jan Djärv <jan.h.d@swipnet.se>
15016
15017 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
15018 can scroll.
15019 (create_and_show_popup_menu): Always use menu_position_func for
15020 Gtk3 (Bug#10361).
15021
ca22b785
AS
150222011-12-24 Andreas Schwab <schwab@linux-m68k.org>
15023
15024 * callint.c (Fcall_interactively): Don't truncate prompt string.
15025
d048e1e6
EZ
150262011-12-23 Eli Zaretskii <eliz@gnu.org>
15027
15028 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
15029 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 15030 resumed from there (after widening). (Bug#10360)
d048e1e6 15031
5ccaba1f
JD
150322011-12-22 Jan Djärv <jan.h.d@swipnet.se>
15033
15034 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
15035
204ee57f
JD
150362011-12-21 Jan Djärv <jan.h.d@swipnet.se>
15037
b81d40f0
JB
15038 * nsterm.m (x_free_frame_resources):
15039 Release f->output_data.ns->miniimage.
204ee57f
JD
15040 (ns_index_color): Fix indentation. Do not retain
15041 color_table->colors[i].
15042
15043 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
15044 before returning.
15045
15046 * nsfns.m (x_set_background_color): Assign return value from
15047 ns_index_color to face-background instead of NSColor*.
15048 (ns_implicitly_set_icon_type): Fix indentation.
15049 Change assignment in for loop to comparison.
15050
15051 * emacs.c (ns_pool): New variable.
15052 (main): Assign ns_pool.
15053 (Fkill_emacs): Call ns_release_autorelease_pool.
15054
15055 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
15056 autorelease fdesc, release fdAttrs and tdict.
15057 (ns_get_covering_families): Release charset.
15058 (ns_findfonts): Release NSFontDescriptor created with new.
15059 (ns_uni_to_glyphs): Fix indentation.
15060 (setString): Release attrStr before assigning new value.
15061
c803b2b7
JD
150622011-12-18 Jan Djärv <jan.h.d@swipnet.se>
15063
678f4426
JD
15064 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
15065 and NS_IMPL_COCOA.
15066 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
15067 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
15068
cd394be1 150692011-12-18 David Reitter <reitter@cmu.edu>
678f4426 15070
5fecd5fc
JD
15071 * nsterm.m (ns_term_init): Subscribe for notifications
15072 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
15073 to method trackingNotification in EmacsMenu.
15074
15075 * nsmenu.m (trackingMenu): New variable.
3771cb17 15076 (trackingNotification): New method (from Aquamacs).
5fecd5fc 15077 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 15078 from Aquamacs (Bug#7030).
678f4426
JD
15079
150802011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 15081
c803b2b7
JD
15082 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
15083 (symbol_to_nsstring): Fix indentation.
15084 (ns_symbol_to_pb): New function.
cae07000
SM
15085 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
15086 (Fns_rotate_cut_buffers_internal): Remove.
15087 (Fns_store_selection_internal): Rename from
c803b2b7
JD
15088 Fns_store_cut_buffer_internal.
15089 (ns_get_foreign_selection, Fx_own_selection_internal)
15090 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
15091 (Fns_get_selection_internal, Fns_store_selection_internal):
15092 Use ns_symbol_to_pb and check if return value is nil.
15093 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
15094 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
15095 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
15096 renamed to Sns_store_selection_internal.
15097 (ns_handle_selection_request): Move code to Fx_own_selection_internal
15098 and remove this function.
15099 (ns_handle_selection_clear): Remove, never used.
15100 (Fx_own_selection_internal): Move code from ns_handle_selection_request
15101 here.
15102
e1b01a3a
KB
151032011-12-17 Ken Brown <kbrown@cornell.edu>
15104
15105 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
15106 GID is unknown (Bug#10257).
15107
2adb6e85
PE
151082011-12-17 Paul Eggert <eggert@cs.ucla.edu>
15109
15110 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
15111 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
15112 which caused a build failure on GNU/Linux IA-64. This problem was
15113 introduced by my 2011-10-07 patch.
15114
d1d7b339
JL
151152011-12-15 Juri Linkov <juri@jurta.org>
15116
15117 * image.c (imagemagick_error): New function. (Bug#10112)
15118 (imagemagick_load_image): Comment out `MagickSetResolution' call.
15119 Use `imagemagick_error' where ImageMagick functions return
15120 `MagickFalse'.
15121 (Fimagemagick_types): Add `Fnreverse' to return the list in the
15122 proper order.
15123
100d5755
KH
151242011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15125
15126 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
15127 fill background (Bug#8992).
15128
454592a6
MR
151292011-12-13 Martin Rudalics <rudalics@gmx.at>
15130
15131 * window.c (Vwindow_combination_resize)
15132 (Vwindow_combination_limit): Use t instead of non-nil in
15133 doc-strings.
61d4b438
MR
15134 (Vrecenter_redisplay): Add first sentence of doc-string on
15135 separate line.
53524d93 15136 (Frecenter): Fix doc-string typo.
454592a6 15137
3633e3aa
KH
151382011-12-11 Kenichi Handa <handa@m17n.org>
15139
15140 * coding.c (Funencodable_char_position): Pay attention to the
15141 buffer text relocation (Bug#9389).
15142
7b9d523a 151432011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 15144
7b9d523a
JD
15145 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
15146 gtk_init (Bug#10100).
15147
b73189c6
EZ
151482011-12-10 Eli Zaretskii <eliz@gnu.org>
15149
15150 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
15151 IT->string is nil. (Bug#10263)
15152
f7dfe5d6
JD
151532011-12-10 Jan Djärv <jan.h.d@swipnet.se>
15154
83faebb4
JD
15155 * nsterm.h (x_free_frame_resources): Declare.
15156
f7dfe5d6
JD
15157 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
15158 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
15159
15160 * nsterm.h (ns_get_defaults_value): Declare.
15161
15162 * nsterm.m (ns_default): Call ns_get_defaults_value.
15163
7cd4e72c
EZ
151642011-12-09 Eli Zaretskii <eliz@gnu.org>
15165
15166 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
15167 (Bug#10170)
15168
b34d7317
YM
151692011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15170
15171 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
15172 that where the value of an _OBJC_* symbol points to is in the .bss
15173 section (Bug#10240).
15174
76470ad1
KH
151752011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15176
15177 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 15178 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 15179
745fff94
KH
151802011-12-08 Kenichi Handa <handa@m17n.org>
15181
15182 * ftfont.c (get_adstyle_property): Fix previous change
15183 (Bug#10233).
15184
6e44397c
JB
151852011-12-07 Juanma Barranquero <lekktu@gmail.com>
15186
15187 * w32.c (init_environment): If no_site_lisp, remove site-lisp
15188 dirs from the default value of EMACSLOADPATH (bug#10208).
15189
7efa6272
GM
151902011-12-07 Glenn Morris <rgm@gnu.org>
15191
15192 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
15193 installation and source directories as well. (Bug#10208)
15194
f6fc4d87
CY
151952011-12-06 Chong Yidong <cyd@gnu.org>
15196
15197 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
15198
2bf26180
GM
151992011-12-06 Glenn Morris <rgm@gnu.org>
15200
15201 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
15202 as an error, not just -1. (Bug#10217)
15203
3a6ad4f0
CY
152042011-12-05 Chong Yidong <cyd@gnu.org>
15205
15206 * keyboard.c (process_special_events): New function.
15207 (swallow_events, Finput_pending_p): Use it (Bug#10195).
15208
75a3b399
PE
152092011-12-05 Paul Eggert <eggert@cs.ucla.edu>
15210
15211 * coding.c (encode_designation_at_bol): Don't use uninitialized
15212 local variable (Bug#9318).
15213
c3c9e25e
KH
152142011-12-05 Kenichi Handa <handa@m17n.org>
15215
15216 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
15217 return Qnil (Bug#8046, Bug#10193).
15218
5eb05ea3
KH
152192011-12-05 Kenichi Handa <handa@m17n.org>
15220
15221 * coding.c (encode_designation_at_bol): New args charbuf_end and
15222 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
15223 (coding_set_source): Return how many bytes coding->source was
15224 relocated.
15225 (coding_set_destination): Return how many bytes
15226 coding->destination was relocated.
15227 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 15228 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
15229
152302011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
15231
15232 * coding.c (CODING_CHAR_CHARSET_P): New macro.
15233 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
15234 macro (Bug#9318).
15235
152362011-12-05 Andreas Schwab <schwab@linux-m68k.org>
15237
15238 The following changes are to fix Bug#9318.
15239
a79703f5 15240 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
15241 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
15242 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 15243 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 15244
7dbda6df
JB
152452011-12-05 Juanma Barranquero <lekktu@gmail.com>
15246
15247 * lisp.h (process_quit_flag): Fix external declaration.
15248
6d5eb5b0
SM
152492011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
15250
15251 Don't macro-inline non-performance-critical code.
15252 * eval.c (process_quit_flag): New function.
15253 * lisp.h (QUIT): Use it.
15254
a0c3fad0
JD
152552011-12-04 Jan Djärv <jan.h.d@swipnet.se>
15256
15257 * nsfns.m (get_geometry_from_preferences): New function.
15258 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
15259
6c07aac2
AS
152602011-12-04 Andreas Schwab <schwab@linux-m68k.org>
15261
15262 * emacs.c (Qkill_emacs): Define.
15263 (syms_of_emacs): Initialize it.
15264 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
15265 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
15266 (quit_throw_to_read_char): Add parameter `from_signal'.
15267 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
15268 * lisp.h (QUIT): Call Fkill_emacs if requested.
15269
c052ead4
JD
152702011-12-03 Jan Djärv <jan.h.d@swipnet.se>
15271
15272 * widget.c (update_wm_hints): Return if wmshell is null.
15273 (widget_update_wm_size_hints): New function.
15274
15275 * widget.h (widget_update_wm_size_hints): Declare.
15276
15277 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
15278 widget_update_wm_size_hints (Bug#10104).
15279
9e49252b
EZ
152802011-12-03 Eli Zaretskii <eliz@gnu.org>
15281
15282 * xdisp.c (handle_invisible_prop): If the invisible text ends just
15283 before a newline, prepare the bidi iterator for consuming the
15284 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 15285 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 15286
02b16839
JL
152872011-12-02 Juri Linkov <juri@jurta.org>
15288
15289 * search.c (Fword_search_regexp): New Lisp function created from
15290 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
15291 (Fword_search_backward, Fword_search_forward)
15292 (Fword_search_backward_lax, Fword_search_forward_lax):
15293 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
15294 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
15295
0068070e
SM
152962011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
15297
15298 * fileio.c (Finsert_file_contents): Move after-change-function call
15299 to before the "handled:" label, since all "goto handled" appear in
15300 cases where the *-change-functions have already been properly called
15301 (bug#10117).
15302
3360a3fc
AS
153032011-12-01 Andreas Schwab <schwab@linux-m68k.org>
15304
15305 * keyboard.c (interrupt_signal): Don't call kill-emacs when
15306 waiting for input. (Bug#10169)
15307
73d6c093
EZ
153082011-11-30 Eli Zaretskii <eliz@gnu.org>
15309
15310 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
15311 verifies glyph row's hash code--we have just reallocated the
15312 glyphs, so their contents can be complete garbage. (Bug#10164)
15313
febe6bea
JB
153142011-11-30 Juanma Barranquero <lekktu@gmail.com>
15315
15316 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
15317
801a4313
EZ
153182011-11-30 Eli Zaretskii <eliz@gnu.org>
15319
15320 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
15321 attributes are tested _before_ calling verify_row_hash, to protect
15322 against GCC re-ordering of the tests. (Bug#10164)
15323
2b56b87e
JD
153242011-11-29 Jan Djärv <jan.h.d@swipnet.se>
15325
15326 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
15327
15328 * xterm.c (handle_one_xevent): Only set async_visible and friends
15329 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 15330 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
15331 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
15332
dbf31225
PE
153332011-11-28 Paul Eggert <eggert@cs.ucla.edu>
15334
15335 Remove GCPRO-related macros that exist only to avoid shadowing locals.
15336 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
15337 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
15338 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15339 All uses changed to use GCPRO1 etc.
15340 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
15341 Revert to old implementation (i.e., before 2011-03-11).
15342
1305621b
YM
153432011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15344
15345 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
15346 of scroll runs so as to avoid assigning disabled bogus rows and
15347 unnecessary graphics copy operations.
15348
8c9afb46
EZ
153492011-11-27 Eli Zaretskii <eliz@gnu.org>
15350
15351 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
15352 (snprintf) [_MSC_VER]: Redirect to _snprintf.
15353 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
15354 (malloc, free, realloc, calloc): Redirect to e_* only when
15355 compiling Emacs.
15356
15357 * lisp.h (GCTYPEBITS): Move before first use.
15358 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
15359 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
15360 this macro definition.
15361
15362 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
15363 _MSC_VER.
15364
54e9e3bf
JD
153652011-11-27 Jan Djärv <jan.h.d@swipnet.se>
15366
6d5eb5b0
SM
15367 * gtkutil.c (xg_create_frame_widgets):
15368 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
15369 present with Gtk+ 2.0.
15370
83aca1cb
PE
153712011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15372
15373 * fileio.c (Finsert_file_contents): Undo previous change; see
15374 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
15375
5b76caa4
PE
153762011-11-26 Paul Eggert <eggert@cs.ucla.edu>
15377
15378 Rename locals to avoid shadowing.
15379 * fileio.c (Finsert_file_contents):
15380 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
15381 * process.c (wait_reading_process_output):
15382 Rename inner 'proc' to 'p' to avoid shadowing.
15383 Indent for consistency with usual Emacs style.
15384
8c535114
EZ
153852011-11-25 Eli Zaretskii <eliz@gnu.org>
15386
15387 * xdisp.c (redisplay_window): If cursor row is not fully visible
15388 after recentering, and scroll-conservatively is set to a large
15389 number, scroll window by a few more lines to make the cursor fully
15390 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
15391 (start_display): Don't move to the next line if the display should
15392 start at a newline that is part of a display vector or an overlay
15393 string. (Bug#10119)
8c535114 15394
fa4fdb5c
JL
153952011-11-24 Juri Linkov <juri@jurta.org>
15396
15397 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
15398 after the `MagickPingImage' call. (Bug#10112)
15399
90ec88df
CY
154002011-11-23 Chong Yidong <cyd@gnu.org>
15401
15402 * window.c (Fcoordinates_in_window_p): Accept only live windows.
15403
56e2e794
MR
154042011-11-23 Martin Rudalics <rudalics@gmx.at>
15405
15406 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
15407 making another buffer current. (Bug#10114)
15408
b6e64c41
GM
154092011-11-23 Glenn Morris <rgm@gnu.org>
15410
15411 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
15412
6b21de18
CY
154132011-11-23 Chong Yidong <cyd@gnu.org>
15414
15415 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
15416 using it (Bug#5984).
15417
b12cd789
EZ
154182011-11-22 Eli Zaretskii <eliz@gnu.org>
15419
15420 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
15421 and header-lines, as they don't have one computed for them.
15422 (Bug#10098)
15423
15424 * .gdbinit (prow): Make displayed values more self-explaining.
15425 Add row's hash code.
15426
261b6fd4
LMI
154272011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
15428
15429 * process.c (wait_reading_process_output): Fix asynchrounous
15430 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 15431 (wait_reading_process_output): Add comment and URL.
261b6fd4 15432
e7cfd277
JD
154332011-11-21 Jan Djärv <jan.h.d@swipnet.se>
15434
15435 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
15436
a9b9b7f5
CY
154372011-11-21 Chong Yidong <cyd@gnu.org>
15438
15439 * window.c (Fnext_window, Fprevious_window): Doc fix.
15440
b0d15b4f
SM
154412011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15442
15443 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
15444
fe7a3057
JB
154452011-11-20 Juanma Barranquero <lekktu@gmail.com>
15446
15447 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
15448
d2999b1a
MR
154492011-11-20 Martin Rudalics <rudalics@gmx.at>
15450
15451 * window.c (Fset_window_combination_limit): Rename argument
15452 STATUS to LIMIT.
15453 (Vwindow_combination_limit): Remove "status" from doc-string.
15454
d5ff9cd0
AS
154552011-11-20 Andreas Schwab <schwab@linux-m68k.org>
15456
15457 * m/ibms390.h: Remove.
15458 * m/ibms390x.h: Don't include "ibms390.h".
15459
a5bb9bd3
SM
154602011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
15461
15462 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
15463 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
15464
cd1181db
JB
154652011-11-20 Juanma Barranquero <lekktu@gmail.com>
15466
15467 * casetab.c (Fset_case_table):
15468 * charset.c (Fcharset_after): Fix typos.
15469
615a3b8d 154702011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 15471
17e845af
PE
15472 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
15473 Otherwise, valgrind does not work on some platforms.
15474 Problem reported by Andreas Schwab in
6a0bf43d
PE
15475 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
15476 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
15477 is set, removing the need for VIRT_ADDRESS_VARIES.
15478 (PURE_P): Use a more-efficient implementation that needs just one
15479 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
15480 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
15481 to 4 (xorl, subq, cmpq, setbe).
15482 * alloc.c (pure): Always extern now, since that's the
15483 VIRT_ADDR_VARIES behavior.
15484 (PURE_POINTER_P): Use a single comparison, not two, for
15485 consistency with the new puresize.h.
15486 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
15487 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
15488 Remove VIRT_ADDR_VARIES no longer needed.
15489
f8fe6f96
EZ
154902011-11-19 Eli Zaretskii <eliz@gnu.org>
15491
15492 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
15493 (erase_phys_cursor, update_window_cursor, show_mouse_face)
15494 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
15495 behave as if the cursor position were at the window margin.
15496
15497 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
15498 and the cursor position is out of bounds, behave as if the cursor
15499 position were at the window margin. (Bug#10075)
15500
df05a53c
CY
155012011-11-18 Chong Yidong <cyd@gnu.org>
15502
15503 * window.c (Fwindow_combination_limit): Make first argument
15504 non-optional, since it is meaningless for live windows like the
15505 selected window.
61ccba97 15506
2071918e
DA
155072011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
15508
15509 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
15510
b50a28de
SM
155112011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
15512
15513 * intervals.c: Fix grafting over the whole buffer (bug#10071).
15514 (graft_intervals_into_buffer): Simplify.
15515
015137db
EZ
155162011-11-18 Eli Zaretskii <eliz@gnu.org>
15517
15518 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
15519 hash values of the two rows.
15520 (copy_row_except_pointers): Preserve the used[] arrays and the
15521 hash values of the two rows. (Bug#10035)
68c95424 15522 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
15523
15524 * xdisp.c (row_hash): New function, body extracted from
15525 compute_line_metrics.
15526 (compute_line_metrics): Call row_hash, instead of computing the
15527 hash code inline.
15528
15529 * dispnew.c (verify_row_hash): Call row_hash for computing the
15530 hash code of a row, instead of duplicating code from xdisp.c.
15531
15532 * dispextern.h (row_hash): Add prototype.
15533
a2addb04
TH
155342011-11-18 Tassilo Horn <tassilo@member.fsf.org>
15535
15536 * frame.c (delete_frame): Don't delete the terminal when the last
15537 X frame is closed if emacs is built with GTK toolkit.
15538
df85d315
JB
155392011-11-17 Juanma Barranquero <lekktu@gmail.com>
15540
15541 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
15542
a0c2d0ae
MR
155432011-11-17 Martin Rudalics <rudalics@gmx.at>
15544
15545 * window.c (Vwindow_splits): Rename to
15546 Vwindow_combination_resize. Suggested by Juri Linkov.
15547 (Fsplit_window_internal): Use Vwindow_combination_resize instead
15548 of Vwindow_splits.
15549
58179cce
JB
155502011-11-16 Juanma Barranquero <lekktu@gmail.com>
15551
7877f373
JB
15552 * nsfns.m (Fns_font_name):
15553 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 15554
b6f67890
MR
155552011-11-16 Martin Rudalics <rudalics@gmx.at>
15556
15557 * window.h (window): Rename slot "nest" to "combination_limit".
15558 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
15559 (Fset_window_nest): Rename to Fset_window_combination_limit.
15560 (Vwindow_nest): Rename to Vwindow_combination_limit.
15561 (recombine_windows, make_parent_window, make_window)
15562 (Fsplit_window_internal, saved_window)
15563 (Fset_window_configuration, save_window_save): Rename all
15564 occurrences of window_nest to window_combination_limit.
15565
c7015153
JB
155662011-11-15 Juanma Barranquero <lekktu@gmail.com>
15567
15568 * image.c (imagemagick_load_image): Fix typo.
15569
322ad6ec
EZ
155702011-11-14 Eli Zaretskii <eliz@gnu.org>
15571
15572 * xdisp.c (display_line): Move the call to
15573 highlight_trailing_whitespace before the call to
15574 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
15575 faces of all the glyphs to compute ROW's hash value.
15576 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 15577
f067b8ec
JB
155782011-11-14 Juanma Barranquero <lekktu@gmail.com>
15579
15580 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
15581 just return (bug#10044).
15582
1e5b2111
EZ
155832011-11-12 Eli Zaretskii <eliz@gnu.org>
15584
7ef3cbd5
EZ
15585 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
15586 with user-defined heap size. Bump the default size of the temacs
15587 heap to 27MB, to avoid memory warning when running temacs.
15588 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
15589
1e5b2111
EZ
15590 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
15591 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
15592 (verify_row_hash) [XASSERTS]: New function.
15593 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
15594 that the hash value of glyph rows is correct.
1e5b2111 15595
89d61221
MR
155962011-11-12 Martin Rudalics <rudalics@gmx.at>
15597
15598 * window.h (window): Remove splits slot.
15599 * window.c (Fwindow_splits, Fset_window_splits): Remove.
15600 (Fdelete_other_windows_internal, make_parent_window)
15601 (make_window, Fsplit_window_internal, Fdelete_window_internal)
15602 (Fset_window_configuration, save_window_save): Don't deal with
15603 split status of windows.
15604 (saved_window): Remove splits slot.
15605 (Vwindow_splits): Rewrite doc-string.
15606
97f18cc8
JD
156072011-11-11 Jan Djärv <jan.h.d@swipnet.se>
15608
15609 * xfns.c (unwind_create_frame):
15610 * nsfns.m (unwind_create_frame):
15611 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
15612 Vframe_list (Bug#9999).
15613
22a648b4
DA
156142011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
15615
0b381c7e 15616 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 15617
659afede
KH
156182011-11-11 Kenichi Handa <handa@m17n.org>
15619
15620 * callproc.c (Fcall_process): Set the member dst_multibyte of
15621 process_coding.
15622
9ac0394b
KH
156232011-11-11 Johan Bockgård <bojohan@gnu.org>
15624
15625 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
15626 avoid a crash (bug#9496).
15627
2fbdc249
CY
156282011-11-09 Chong Yidong <cyd@gnu.org>
15629
15630 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
15631 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
15632
ac6b1f81
PE
156332011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15634
15635 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
15636
09db192c
PE
156372011-11-08 Paul Eggert <eggert@cs.ucla.edu>
15638
15639 Avoid some portability problems by eschewing 'extern inline' functions.
15640 The trivial performance wins aren't worth the portability hassles; see
15641 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
15642 et seq.
15643 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15644 (window_box_width, window_box_left, window_box_left_offset)
15645 (window_box_right, window_box_right_offset): Undo previous change,
15646 by removing the "extern"s.
15647 * intervals.c (adjust_intervals_for_insertion)
15648 (adjust_intervals_for_deletion): Undo previous change,
15649 making these static again.
15650 (offset_intervals, temp_set_point_both, temp_set_point)
15651 (copy_intervals_to_string): No longer inline.
15652 * xdisp.c (window_text_bottom_y, window_box_width)
15653 (window_box_height, window_box_left_offset)
15654 (window_box_right_offset, window_box_left, window_box_right)
15655 (window_box): No longer inline.
15656
105216ed
CY
156572011-11-08 Chong Yidong <cyd@gnu.org>
15658
15659 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
15660 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
15661 Signal an error if not a live window.
105216ed
CY
15662 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
15663 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
15664
ae9e237f
JB
156652011-11-07 Juanma Barranquero <lekktu@gmail.com>
15666
15667 * lisp.h (syms_of_abbrev): Remove declaration.
15668 Reported by CHENG Gao <chenggao@royau.me>.
15669
c7aa8333
EZ
156702011-11-07 Eli Zaretskii <eliz@gnu.org>
15671
15672 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
15673 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
15674 of temacs in GUI mode.
15675
be7f5545
MR
156762011-11-07 Martin Rudalics <rudalics@gmx.at>
15677
15678 * window.h: Declare delete_all_child_windows instead of
15679 delete_all_subwindows.
15680 * window.c (Fwindow_nest, Fset_window_nest)
15681 (Fset_window_new_total, Fset_window_new_normal)
15682 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
15683 (delete_all_subwindows): Rename to delete_all_child_windows.
15684 (Fdelete_other_windows_internal, Fset_window_configuration):
15685 Call delete_all_child_windows instead of delete_all_subwindows.
15686 * frame.c (delete_frame): Call delete_all_child_windows instead
15687 of delete_all_subwindows.
15688
ca78dc43
PE
156892011-11-07 Paul Eggert <eggert@cs.ucla.edu>
15690
15691 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
15692 This is also needed for porting to any host where GC_MARK_STACK is
15693 not GC_MAKE_GCPROS_NOOPS.
15694 (which_symbols): Use it.
15695
a0241d01
KH
156962011-11-07 Kenichi Handa <handa@m17n.org>
15697
15698 * coding.c (coding_set_destination): Check coding->src_pos only
15699 when coding->src_object is a buffer (bug#9910).
15700
15701 * process.c (send_process): Set the member src_multibyte of coding
15702 to 0 (bug#9911) when sending a unibyte text.
15703
15704 * callproc.c (Fcall_process): Set the member src_multibyte of
15705 process_coding to 0 (bug#9912).
15706
a64bfdfa 157072011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
15708
15709 * xmenu.c (cleanup_widget_value_tree): New function.
15710 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
15711 calling free_menubar_widget_value_tree directly (Bug#9830).
15712
cb41b32a
PE
157132011-11-06 Paul Eggert <eggert@cs.ucla.edu>
15714
15715 Fix some portability problems with 'inline'.
15716 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
15717 (window_box_width, window_box_left, window_box_left_offset)
15718 (window_box_right, window_box_right_offset): Declare extern.
15719 Otherwise, these inline functions do not conform to C99 and
15720 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
15721 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
15722 * intervals.c (adjust_intervals_for_insertion)
15723 (adjust_intervals_for_deletion): Now extern, because otherwise the
15724 extern inline functions 'offset_intervals' couldn't refer to it.
15725 (static_offset_intervals): Remove.
15726 (offset_intervals): Rewrite using the old contents of
15727 static_offset_intervals. The old version didn't conform to C99
15728 because an extern inline function contained a reference to an
15729 identifier with static linkage.
15730
b7041366
AS
157312011-11-06 Andreas Schwab <schwab@linux-m68k.org>
15732
15733 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
15734 GC.
15735
88a37c4d
EZ
157362011-11-06 Eli Zaretskii <eliz@gnu.org>
15737
15738 * xdisp.c (init_iterator, reseat_to_string): Don't set the
15739 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
15740 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
15741 return Qleft_to_right.
15742
49745b39
CY
157432011-11-06 Chong Yidong <cyd@gnu.org>
15744
15745 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
15746 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
15747 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
15748 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
15749 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
15750 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
15751 (Fwindow_vscroll): Doc fix.
15752 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
15753 argument, since it makes no sense to pass a live window and for
15754 consistency with window-child.
15755
1f05cd82
CS
157562011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
15757
15758 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
15759 support MSVC.
15760
22610910
JR
157612011-11-05 Jason Rumney <jasonr@gnu.org>
15762
15763 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
15764 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
15765 fonts (Bug#6029).
15766 (add_font_entity_to_list): Fix logic errors in mixed boolean and
15767 bitwise arithmetic preventing use of unicode-sip and non-truetype
15768 opentype fonts.
15769
a06776b2
EZ
157702011-11-05 Eli Zaretskii <eliz@gnu.org>
15771
3ad924ba
EZ
15772 * s/ms-w32.h (fstat, stat, utime): Move redirections to
15773 "emacs"-only part.
15774
a06776b2
EZ
15775 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
15776 initialization code to keep similarity to xfns.c after changes
15777 from 2011-11-05.
15778
c9e7db78
JD
157792011-11-05 Jan Djärv <jan.h.d@swipnet.se>
15780
a97f8f3f
JD
15781 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
15782 (unwind_create_frame): New function (Bug#9943).
15783 (Fx_create_frame): Restructure code to be more similar to the one in
15784 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
15785 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
15786 Move terminal->reference_count++ just before making the frame official
15787 (Bug#9943).
15788
15789 * nsterm.m (x_free_frame_resources): New function.
15790 (x_destroy_window): Move code to x_free_frame_resources.
15791
c9e7db78 15792 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
15793 (Fx_create_frame, x_create_tip_frame):
15794 Move terminal->reference_count++ just before making the frame
75f1671a 15795 official. Move initialization of image_cache_refcount and
c9e7db78
JD
15796 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
15797
a6fc3b5c
EZ
157982011-11-05 Eli Zaretskii <eliz@gnu.org>
15799
15800 Support MSVC build with newer versions of Visual Studio.
15801 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
15802 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
15803 nt/gmake.defs.
15804
15805 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
15806 which are not supported by MSVC.
15807 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
15808 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
15809 bitfields.
15810 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
15811 types in bitfields.
15812 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
15813
15814 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
15815
58179cce 158162011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
15817
15818 Support MSVC build with newer versions of Visual Studio.
15819 * w32.c: Don't include w32api.h for MSVC.
15820 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15821
15822 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15823 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15824 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15825 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15826 e_* cousins.
15827 (alloca) [_MSC_VER]: Define to _alloca.
15828
15829 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15830
15831 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15832
a58c13ed
EZ
158332011-11-04 Eli Zaretskii <eliz@gnu.org>
15834
15835 * xdisp.c (note_mouse_highlight): If either of
15836 previous/next-single-property-change returns nil, treat that as
15837 the beginning or the end of the buffer. (Bug#9955)
15838
fe0b6370
JD
158392011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15840
a58c13ed 15841 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
15842 label is not null (Bug#9951).
15843 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15844 may be NULL.
15845
89bd5ee1
EZ
158462011-11-04 Eli Zaretskii <eliz@gnu.org>
15847
15848 * window.c (Fwindow_body_size): Mention in the doc string that the
15849 return value is in frame's canonical units. (Bug#9949)
15850
84c3edb9
EZ
158512011-11-03 Eli Zaretskii <eliz@gnu.org>
15852
4e2fb5c7
EZ
15853 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15854
84c3edb9 15855 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 15856 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 15857 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 15858
bc17a887
EZ
158592011-11-01 Eli Zaretskii <eliz@gnu.org>
15860
15861 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15862 Don't stop backward scan on the continuation glyph, even though
15863 its CHARPOS is positive.
6d5eb5b0
SM
15864 (mouse_face_from_buffer_pos, note_mouse_highlight):
15865 Rename cover_string to disp_string.
bc17a887 15866
4ee88440
MR
158672011-11-01 Martin Rudalics <rudalics@gmx.at>
15868
15869 * window.c (temp_output_buffer_show): Don't use
15870 Vtemp_buffer_show_specifiers.
15871 (Vtemp_buffer_show_specifiers): Remove unused variable.
15872
c2ff3c02
EZ
158732011-10-30 Eli Zaretskii <eliz@gnu.org>
15874
15875 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15876 past the beginning of the current glyph matrix.
15877
58179cce 158782011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
15879
15880 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15881 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15882 HAVE_GTK3 (Bug#9869).
b77a6a7f 15883
3b574623
JD
15884 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15885 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15886
b77a6a7f
JD
15887 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15888
15889 * xterm.c: Declare x_handle_net_wm_state to return int.
15890 (handle_one_xevent): Check if we are iconified but don't have
15891 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15892 (get_current_wm_state): Return non-zero if not hidden,
15893 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15894 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15895 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15896 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15897
196e41e4
PE
158982011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15899
15900 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15901 so that this new function doesn't get optimized away by a
15902 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15903
021f2e1a
AS
159042011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15905
15906 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15907
8b058d44
EZ
159082011-10-29 Eli Zaretskii <eliz@gnu.org>
15909
15910 Fix the `xbytecode' command.
15911 * .gdbinit (xprintbytestr): New command.
b50a28de 15912 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
15913 (xbytecode): Print the byte-code string as well.
15914
4452fb80
EZ
159152011-10-29 Kim Storm <storm@cua.dk>
15916
8b058d44
EZ
15917 * alloc.c (which_symbols): New function.
15918
21b72067
AS
159192011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15920
15921 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15922 line. (Bug#9903)
15923
83ed7b5c
GM
159242011-10-29 Glenn Morris <rgm@gnu.org>
15925
15926 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15927 Not clear what it was for, and it causes various bugs. (Bug#9839)
15928
5a7a728b
EZ
159292011-10-28 Eli Zaretskii <eliz@gnu.org>
15930
15931 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15932 possible random value that matches one of those tested as
15933 condition to clear the mouse face.
15934
d3d0842f
CY
159352011-10-28 Chong Yidong <cyd@gnu.org>
15936
15937 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15938
31b39d13
DN
159392011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15940
15941 * window.c (make_window): Initialize phys_cursor_on_p.
15942
9aba6043
SM
159432011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15944
15945 * lisp.h (struct Lisp_Symbol): Update comments.
15946
c20992f4
JB
159472011-10-28 Juanma Barranquero <lekktu@gmail.com>
15948
15949 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15950
db4f02f2
EZ
159512011-10-28 Eli Zaretskii <eliz@gnu.org>
15952
15953 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15954 <oslsachem@gmail.com> for helping to debug this.
15955
15956 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15957 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15958 (g_b_init_get_glyph_outline_w): New static variables.
15959 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15960 (GetGlyphOutlineW_Proc): New typedefs.
15961 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
15962 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15963 New functions.
15964 (w32font_open_internal, compute_metrics):
15965 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
15966 instead of calling the "wide" APIs directly.
15967
15968 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15969
15970 * w32.h (syms_of_w32font): Add prototype.
15971
87e68db4
JB
159722011-10-27 Juanma Barranquero <lekktu@gmail.com>
15973
15974 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15975 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15976 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15977 (Fmove_to_window_line): Doc fix.
15978
435c1d67
CY
159792011-10-27 Chong Yidong <cyd@gnu.org>
15980
15981 * process.c (make_process): Set gnutls_state to NULL.
15982
15983 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15984 non-NULL, regardless of GNUTLS_INITSTAGE.
15985 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15986 an error. Set process slots as soon as we allocate them.
15987
15988 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15989
9c6c6f49
CY
159902011-10-27 Chong Yidong <cyd@gnu.org>
15991
9aba6043
SM
15992 * gnutls.c (emacs_gnutls_deinit): New function.
15993 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
15994 (Fgnutls_deinit, Fgnutls_boot): Use it.
15995
15996 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15997 (deactivate_process): Call emacs_gnutls_deinit.
15998
657d08d3
JB
159992011-10-27 Juanma Barranquero <lekktu@gmail.com>
16000
16001 * image.c (x_create_x_image_and_pixmap):
16002 * w32.c (sys_rename, w32_delayed_load):
16003 * w32font.c (fill_in_logfont):
16004 * w32reg.c (x_get_string_resource): Silence compiler warnings.
16005
5430d399
JB
160062011-10-26 Juanma Barranquero <lekktu@gmail.com>
16007
16008 * w32fns.c (w32_default_color_map): New function,
16009 extracted from Fw32_default_color_map.
a7ef684b 16010 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 16011
fe0055fa
PE
160122011-10-25 Paul Eggert <eggert@cs.ucla.edu>
16013
16014 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
16015
e6346438
SM
160162011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
16017
16018 * keyboard.c (test_undefined): New function (bug#9751).
16019 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
16020
e112cc37
ET
160212011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
16022
16023 * sysdep.c (init_sys_modes): Fix the check for the controlling
16024 terminal (Bug#6649).
16025
7b5d6677
EZ
160262011-10-20 Eli Zaretskii <eliz@gnu.org>
16027
16028 * dispextern.h (struct bidi_it): New member next_en_type.
16029
16030 * bidi.c (bidi_line_init): Initialize the next_en_type member.
16031 (bidi_resolve_explicit_1): When next_en_pos is valid for the
16032 current character, check also for next_en_type being WEAK_EN.
16033 (bidi_resolve_weak): Don't enter the expensive loop if the current
16034 position is before next_en_pos. Record the bidi type of the first
16035 non-ET, non-BN character we find, in addition to its position.
16036 (bidi_level_of_next_char): Invalidate next_en_type when
16037 next_en_pos is over-stepped.
16038
7da0b018
PE
160392011-10-20 Paul Eggert <eggert@cs.ucla.edu>
16040
16041 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
16042 * editfns.c: Rewrite current-time-zone so that it invokes
16043 the equivalent of (format-time-string "%Z") to get the time zone name.
16044 This fixes a bug when the time zone name contains characters that
16045 need converting from the system time locale to Emacs internal format.
16046 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
16047 that patch fixed format-time-string to do the conversion, but
16048 I forgot to fix current-time-zone.
16049 (format_time_string): New function, containing most of
16050 what Fformat_time_string used to contain.
16051 (Fformat_time_string): Rewrite in terms of format_time_string.
16052 This doesn't change this function's behavior.
16053 (current-time-zone): Rewrite to use format_time_string.
16054 This fixes the bug reported by Michael Schierl in
16055 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
16056 Jason Rumney's 2007-06-07 change worked around this bug, but
16057 didn't fix it.
16058 * systime.h (tzname, timezone): Remove no-longer-used declarations.
16059
8547b010
EZ
160602011-10-19 Eli Zaretskii <eliz@gnu.org>
16061
16062 * xdisp.c (start_display): If the character at POS is displayed
16063 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
16064 (try_window_reusing_current_matrix): If a line ends in a display
16065 vector or the next line starts in a display vector, continue
16066 redrawing the window even though the character position of
16067 start_row was reached.
8547b010
EZ
16068 (Bug#9771, part 2)
16069
4e948d15
CY
160702011-10-18 Chong Yidong <cyd@gnu.org>
16071
16072 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
16073 with nobreak-char-display too.
16074
4787455f
EZ
160752011-10-18 Eli Zaretskii <eliz@gnu.org>
16076
16077 Fix part 3 of bug#9771.
16078 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
16079 (bidi_resolve_neutral): Don't enter the expensive loop looking for
16080 non-neutral characters if the current character is a paragraph
16081 separator (a.k.a. Newline). This avoids running the same
16082 expensive loop twice, once when we consume the preceding newline
16083 and the other time when the line actually needs to be displayed.
16084 Avoid the loop when we see neutrals on the base embedding level
16085 following a character whose directionality is the same as the
16086 paragraph's. This avoids running the expensive loop when a line
16087 ends in a long sequence of neutrals, like control characters.
16088 Add assertion against STRONG_AL type. Slightly rearrange code
16089 that determines the type of a neutral given the first non-neutral
16090 that follows it.
16091 (bidi_level_of_next_char): Set next_en_pos to zero when
16092 invalidating its info.
16093
2c91f553
EZ
160942011-10-17 Eli Zaretskii <eliz@gnu.org>
16095
16096 * xdisp.c (push_display_prop): Determine whether to record string
16097 or buffer position by IT->string, not by IT->method. Allow
16098 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
16099 (move_it_vertically_backward): Don't look for character position
16100 immediately after the newline when in a continuation line.
16101 (Bug#9771, part 1)
2c91f553 16102
c7b08b0d
MR
161032011-10-15 Martin Rudalics <rudalics@gmx.at>
16104
16105 * window.c (coordinates_in_window): Rewrite and delabelize
16106 vertical border check. (Bug#5357) (Bug#9618)
16107
6b02f655
SM
161082011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
16109
16110 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
16111 errors in XSetWindowBorder (bug#9310).
16112
81d40c92
DA
161132011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
16114
16115 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
16116 avoid crash when xmalloc overrun checking is enabled.
16117
d4172c3b
EZ
161182011-10-13 Eli Zaretskii <eliz@gnu.org>
16119
16120 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
16121 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
16122 cursor motion with <left> and <right> arrow keys.
16123
16124 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
16125 some callers set that themselves.
16126
b00eea75
EZ
161272011-10-12 Eli Zaretskii <eliz@gnu.org>
16128
16129 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
16130 display string and the previous row comes from the same string and
16131 is empty. (Bug#9739) (Bug#9738)
16132
8fe012c4
SM
161332011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
16134
16135 * doc.c (get_doc_string): Encode file name (bug#9735).
16136
0074aef2
EZ
161372011-10-12 Eli Zaretskii <eliz@gnu.org>
16138
79beb178
EZ
16139 * bidi.c (bidi_level_of_next_char):
16140 * xdisp.c (get_visually_first_element): Remove old incorrect
16141 comments regarding the Unicode Line Separator character.
16142
0074aef2
EZ
16143 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
16144
6e4b3fbe
DA
161452011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
16146
16147 * alloc.c (Fgc_status): Do not access beyond zombies array
16148 boundary if nzombies > MAX_ZOMBIES.
16149 * alloc.c (dump_zombies): Add missing format specifier.
16150
0324f3af
PE
161512011-10-12 Paul Eggert <eggert@cs.ucla.edu>
16152
b5525cac
PE
16153 * xdisp.c (set_cursor_from_row): Simplify conditionals,
16154 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
16155
0324f3af
PE
16156 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
16157 Some packages use them to denote characters with modifiers.
16158
e9b5f888
AS
161592011-10-11 Andreas Schwab <schwab@linux-m68k.org>
16160
16161 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
16162 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
16163 matching a pp-number. Rename parameter var to var1.
16164
127827c0
SM
161652011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
16166
16167 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
16168
c8fd3bd0
GM
161692011-10-08 Glenn Morris <rgm@gnu.org>
16170
16171 * callint.c (Fcall_interactively): Give a more explicit error for the
16172 'c' case with a non-character input. (Bug#8479)
16173
352ec8ff
EZ
161742011-10-08 Eli Zaretskii <eliz@gnu.org>
16175
03669ccb
EZ
16176 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
16177 lines.
7061c986
EZ
16178 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
16179 lines that are hscrolled on the left.
03669ccb 16180
352ec8ff
EZ
16181 * dispnew.c (buffer_posn_from_coords): Account for a possible
16182 presence of header-line. (Bug#4426)
16183
a66cfb1c
SM
161842011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
16185
6b02f655
SM
16186 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
16187 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 16188
7c5ee88e
PE
161892011-10-07 Paul Eggert <eggert@cs.ucla.edu>
16190
16191 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
16192 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
16193 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
16194 this makes Emacs dump core during garbage collection on rare
16195 occasions. sizeof is obviously inferior to offsetof here, so
16196 stick with offsetof.
16197 (GC_POINTER_ALIGNMENT): New macro.
16198 (mark_memory): Omit 3rd (offset) arg; caller changed.
16199 Don't assume EMACS_INT alignment is the same as pointer alignment.
16200
df1bbe5b
SM
162012011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
16202
16203 * keyboard.c (read_key_sequence_remapped): New var.
16204 (read_key_sequence): Compute remapping in the right buffer.
16205 (command_loop_1): Use read_key_sequence's remapping directly.
16206
51553db6
SM
162072011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
16208
32c1fffd
SM
16209 * dired.c (file_name_completion): Don't expand file name.
16210 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
16211 before checking file name handler.
16212
51553db6
SM
16213 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
16214 they've been requested explicitly (bug#9591).
16215
b6bd1599 162162011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
16217
16218 * keymap.c (Fsingle_key_description): Use make_specified_string
16219 instead of build_string to build string from push_key_description.
16220 (Bug#5193)
16221
f701dc2a
PE
162222011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16223
4222c55d
PE
16224 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
16225 This fixes a Y2038 bug on 64-bit hosts.
16226 * buffer.c (reset_buffer):
16227 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
16228 (Fclear_buffer_auto_save_failure):
16229 Use 0, not -1, to represent an unset failure time, since time_t
16230 might not be signed.
16231
f701dc2a
PE
16232 Remove dependency on glibc malloc internals.
16233 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16234 Move back here from lisp.h, but with their new implementations.
16235 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16236 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
16237 * charset.c (charset_table_init): New static var.
16238 (syms_of_charset): Use it instead of xmalloc. This removes a
16239 dependency on glibc malloc internals. See Eli Zaretskii's comment in
16240 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
16241 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16242 Move back to alloc.c.
16243 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16244 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
16245
9ceebf39
JD
162462011-09-30 Jan Djärv <jan.h.d@swipnet.se>
16247
16248 * nsterm.m (windowDidResize): Call x_set_window_size only when
16249 ns_in_resize is true. Otherwise set pixelwidth/height and
16250 call change_frame_size (Bug#9628).
16251
cb993c58
PE
162522011-09-30 Paul Eggert <eggert@cs.ucla.edu>
16253
3930c88b
PE
16254 Port --enable-checking=all to Fedora 14 x86-64.
16255 * charset.c (syms_of_charset): Also account for glibc malloc's
16256 internal overhead when calculating the initial malloc maximum.
16257
cb993c58
PE
16258 Port --enable-checking=all to Fedora 14 x86.
16259 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16260 Move to lisp.h.
16261 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
16262 (overrun_check_realloc, overrun_check_free):
16263 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
16264 That way, xmalloc returns a properly-aligned pointer even if
16265 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
16266 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
16267 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
16268 into account when calculating the initial malloc maximum.
16269 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
16270 Move here from alloc.c, so that charset.c can use it too.
16271 Properly align; the old code wasn't right for common 32-bit hosts
16272 when configured with --enable-checking=all.
16273 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
16274 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
16275
31bed486
EZ
162762011-09-29 Eli Zaretskii <eliz@gnu.org>
16277
04c70788 16278 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
16279 use EDOM.
16280
fbcaa2f3
EZ
162812011-09-28 Eli Zaretskii <eliz@gnu.org>
16282
16283 * xdisp.c (compute_display_string_end): If there's no display
16284 string at CHARPOS, return -1.
16285
16286 * bidi.c (bidi_fetch_char): When compute_display_string_end
16287 returns a negative value, treat the character as a normal
16288 character not covered by a display string. (Bug#9624)
16289
a239d4e9
JB
162902011-09-28 Juanma Barranquero <lekktu@gmail.com>
16291
16292 * lread.c (Fread_from_string): Fix typo in docstring.
16293
88652fd5
EZ
162942011-09-27 Eli Zaretskii <eliz@gnu.org>
16295
16296 * xdisp.c (handle_invisible_prop): If invisible text ends on a
16297 newline, reseat the iterator instead of bidi-iterating there one
16298 character at a time. (Bug#9610)
32c1fffd
SM
16299 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
16300 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 16301
ed497dd4
AS
163022011-09-27 Andreas Schwab <schwab@linux-m68k.org>
16303
16304 * lread.c (readevalloop): Use correct code for NBSP.
16305 (read1): Likewise. (Bug#9608)
16306
b2bf61aa
MA
163072011-09-25 Michael Albinus <michael.albinus@gmx.de>
16308
16309 * dbusbind.c (Fdbus_register_signal): When service is not
16310 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
16311
32bbb17c
GM
163122011-09-25 Glenn Morris <rgm@gnu.org>
16313
16314 * buffer.c (truncate-lines): Doc fix.
16315
94e0933e
CY
163162011-09-24 Chong Yidong <cyd@stupidchicken.com>
16317
16318 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
16319 (Fset_window_next_buffers): Doc fix.
16320
cddde921
GM
163212011-09-24 Glenn Morris <rgm@gnu.org>
16322
16323 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
16324
1260aef1
PE
163252011-09-24 Paul Eggert <eggert@cs.ucla.edu>
16326
25b4bfa0
PE
16327 Fix minor problems found by static checking.
16328 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
16329 * indent.c (Fvertical_motion): Fix == vs = typo.
16330
e3cbd34b
EZ
163312011-09-24 Eli Zaretskii <eliz@gnu.org>
16332
a66cfb1c
SM
16333 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
16334 Default value is now t. Doc fix.
6bf7006f 16335
e3cbd34b 16336 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 16337 logic when moving up, not only when moving down. Fix the
e3cbd34b 16338 confusing name and values of the it_overshoot_expected variable;
32c1fffd 16339 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
16340
16341 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
16342 CHARPOS is covered by a display string which includes newlines.
16343 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
16344 is covered by a display string with embedded newlines.
16345
a3de0cbd
MA
163462011-09-24 Michael Albinus <michael.albinus@gmx.de>
16347
16348 * dbusbind.c (Fdbus_register_signal): Add match rule to
16349 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
16350 (Fdbus_register_method, Vdbus_registered_objects_table):
16351 Fix docstring.
a3de0cbd 16352
b260039d
JM
163532011-09-24 Jim Meyering <meyering@redhat.com>
16354
32c1fffd 16355 do not ignore write error for any output size
b260039d
JM
16356 The previous change was incomplete.
16357 While it makes emacs --batch detect the vast majority of stdout
16358 write failures, errors were still ignored whenever the output size is
16359 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
16360 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
16361 && echo FAIL: ignored write error
16362 FAIL: ignored write error
16363 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
16364 && echo FAIL: ignored write error
16365 FAIL: ignored write error
16366 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
16367
8eca8a7c
AS
163682011-09-23 Andreas Schwab <schwab@linux-m68k.org>
16369
16370 * emacs.c (Fkill_emacs): In noninteractive mode exit
16371 non-successfully if a write error occurred on stdout. (Bug#9574)
16372
3341db62
EZ
163732011-09-21 Eli Zaretskii <eliz@gnu.org>
16374
16375 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
16376 the xassert test.
16377
16378 * dispextern.h (struct it): Update the comment documenting what
16379 can it->OBJECT be.
16380
8c203dbf
EZ
163812011-09-20 Eli Zaretskii <eliz@gnu.org>
16382
16383 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
16384 a display string, extend search for cursor position to end of row.
16385 (find_row_edges): If the row ends in a newline from a display
16386 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
16387 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
16388 (Fcurrent_bidi_paragraph_direction): Fix search for previous
16389 non-empty line. Fixes confusing cursor motion with arrow keys at
16390 the beginning of a line that starts with whitespace.
8c203dbf 16391
a4824228
LMI
163922011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
16393
16394 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
16395 (bug#9493).
16396
33ed493b
CY
163972011-09-18 Chong Yidong <cyd@stupidchicken.com>
16398
16399 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
16400 boolean (Bug#9154).
16401
56cd55c8
EZ
164022011-09-18 Eli Zaretskii <eliz@gnu.org>
16403
16404 * xdisp.c (display_line): Record maximum and minimum buffer
16405 positions even if no glyphs were produced (e.g., by a zero-width
16406 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
16407 buffer positions that will be removed from the glyph row because
16408 they don't fit.
c02dcedf
EZ
16409 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
16410 column is beyond frame width: don't subtract 1 "pixel" when
16411 computing width of the stretch.
3e62b7e0
EZ
16412 (reseat_at_next_visible_line_start): Undo the change made on
16413 2011-09-17 that saved paragraph information and restored it after
16414 the call to `reseat'. (Bug#9545)
56cd55c8 16415
5ed99d36 164162011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
16417
16418 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
16419 and turn window cursor on if cleared (Bug#9415).
16420
5ed99d36 164212011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
16422
16423 * search.c (boyer_moore): Take unibyte characters from pattern
16424 literally. (Bug#9458)
16425
9bade7b2
EZ
164262011-09-18 Eli Zaretskii <eliz@gnu.org>
16427
16428 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
16429
e5e9d610
PE
164302011-09-18 Paul Eggert <eggert@cs.ucla.edu>
16431
87e4427a
PE
16432 Fix minor problem found by static checking.
16433 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
16434 initialized, to pacify gcc -Wuninitialized.
16435
e5e9d610
PE
16436 * fileio.c: Report proper errno when syscall falls.
16437 (Finsert_file_contents): Save and restore errno,
16438 so that report_file_error outputs the correct diagnostic.
16439 (Fwrite_region) [CLASH_DETECTION]: Likewise.
16440
a1674f0b
EZ
164412011-09-18 Eli Zaretskii <eliz@gnu.org>
16442
16443 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
16444
fbfb6dd4
EZ
164452011-09-17 Eli Zaretskii <eliz@gnu.org>
16446
16447 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
16448 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
16449
bb187662
EZ
164502011-09-17 Eli Zaretskii <eliz@gnu.org>
16451
1137e8b8 16452 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 16453 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
16454
16455 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
16456 (bidi_find_paragraph_start): Search back for paragraph beginning
16457 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
16458 (bidi_move_to_visually_next): Only trigger paragraph-related
16459 computations when the last character is a newline or at EOB, not
16460 just any NEUTRAL_B. (Bug#9470)
16461
bb187662
EZ
16462 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
16463 truncated lines if point is covered by a display string. (Bug#9524)
16464
2e621251
PE
164652011-09-16 Paul Eggert <eggert@cs.ucla.edu>
16466
16467 * xselect.c: Relax test for outgoing X longs (Bug#9498).
16468 (cons_to_x_long): New function.
16469 (lisp_data_to_selection_data): Use it. Correct the test for
16470 short-versus-long data; it was negated. Break out of vector
16471 loop, for efficiency, when a long datum is discovered.
16472
91a15bc6
SM
164732011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
16474
16475 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
16476
b41c3a35
EZ
164772011-09-16 Eli Zaretskii <eliz@gnu.org>
16478
16479 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
16480 GCC PR/17406) by declaring this function with external scope.
16481
7812ba2d
PE
164822011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16483
16484 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
16485 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
16486
cf7edc2a
AS
164872011-09-15 Andreas Schwab <schwab@linux-m68k.org>
16488
16489 * editfns.c (Fformat): Correctly handle text properties on "%%".
16490
bd01620e
EZ
164912011-09-15 Eli Zaretskii <eliz@gnu.org>
16492
16493 * xterm.c (x_draw_composite_glyph_string_foreground):
16494 * w32term.c (x_draw_composite_glyph_string_foreground):
16495 * term.c (encode_terminal_code):
16496 * composite.c (composition_update_it, get_composition_id):
16497 * xdisp.c (get_next_display_element)
16498 (fill_composite_glyph_string): Add comments about special meaning
16499 of TAB characters in a composition.
16500
a02719a3
PE
165012011-09-15 Paul Eggert <eggert@cs.ucla.edu>
16502
16503 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
16504 This occurs when processing a multibyte format.
16505 Problem reported by Wolfgang Jenker.
a02719a3 16506
72589a3c
JB
165072011-09-15 Johan Bockgård <bojohan@gnu.org>
16508
16509 * xdisp.c (try_cursor_movement): Only check for exact match if
16510 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
16511
1c14176c
PE
165122011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16513
16514 Remove unused external symbols.
16515 * dispextern.h (calc_pixel_width_or_height): Remove decl.
16516 * xdisp.c (calc_pixel_width_or_height): Now static.
16517 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
16518 * indent.c (check_display_width):
16519 * w32term.c: Fix comment to match code.
16520 * xterm.c, xterm.h (x_catching_errors): Remove.
16521
d2eea5b5
PE
165222011-09-14 Paul Eggert <eggert@cs.ucla.edu>
16523
16524 * xselect.c: Use signed conversions more consistently (Bug#9498).
16525 (selection_data_to_lisp_data): Assume incoming selection data are
16526 signed integers, not unsigned. This is to be consistent with
16527 outgoing selection data, which was modified to use signed integers
16528 in as part of the fix to Bug#9196 in response to Jan D.'s comment
16529 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
16530 expects long, not unsigned long.
16531
46888499
EZ
165322011-09-14 Eli Zaretskii <eliz@gnu.org>
16533
16534 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
16535 computation of loop end. Reported by Johan Bockgård
16536 <bojohan@gnu.org>.
16537
ef8ef9fb
CY
165382011-09-13 Chong Yidong <cyd@stupidchicken.com>
16539
16540 * frame.c (Fother_visible_frames_p): Function deleted.
16541
fa819fed
EZ
165422011-09-12 Eli Zaretskii <eliz@gnu.org>
16543
16544 * indent.c (compute_motion): Process display vector front to back
16545 rather than the other way around. (Bug#2496)
16546
2ba8e008
SM
165472011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
16548
16549 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
16550
20f53c69
CY
165512011-09-11 Chong Yidong <cyd@stupidchicken.com>
16552
16553 * minibuf.c (Fread_from_minibuffer): Doc fix.
16554
d562d7a4
EZ
165552011-09-11 Eli Zaretskii <eliz@gnu.org>
16556
16557 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
16558 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
16559
1c4d7f3d
LMI
165602011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
16561
16562 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
16563 value for non-existent files.
16564
b885bf36
EZ
165652011-09-11 Eli Zaretskii <eliz@gnu.org>
16566
16567 * fileio.c (Finsert_file_contents): If the file cannot be opened,
16568 set its "size" to -1. This will set the modtime_size field of
16569 the corresponding buffer to -1, which is what
16570 verify-visited-file-modtime expects for files that do not exist.
16571 (Bug#9139)
16572
6612f0bf
PE
165732011-09-11 Paul Eggert <eggert@cs.ucla.edu>
16574
16575 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
16576 here ...
16577 * lisp.h: ... from here. push_key_description is no longer
16578 defined in keyboard.c, so its declaration should not be in
16579 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
16580 logically belongs with push_key_description.
16581
dfb3f755
PE
165822011-09-10 Paul Eggert <eggert@cs.ucla.edu>
16583
16584 * buffer.h: Include <sys/types.h> instead of <time.h>.
16585 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
16586 Problem reported by Herbert J. Skuhra.
16587
3134906c
LMI
165882011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
16589
16590 * xml.c (parse_region): Make the parsing work for
16591 non-comment-starting XML files again (bug#9144).
16592
8d903f4e
AS
165932011-09-10 Andreas Schwab <schwab@linux-m68k.org>
16594
16595 * image.c (gif_load): Fix calculation of bottom and right corner.
16596 (Bug#9468)
16597
80ad64f4
EZ
165982011-09-10 Eli Zaretskii <eliz@gnu.org>
16599
16600 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
16601 redisplay in small windows.
16602
208a048d
EZ
166032011-09-09 Eli Zaretskii <eliz@gnu.org>
16604
16605 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
16606
9b1c252e
MR
166072011-09-08 Martin Rudalics <rudalics@gmx.at>
16608
16609 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
16610 Operate on live windows only.
16611
2949f33b
JB
166122011-09-08 Juanma Barranquero <lekktu@gmail.com>
16613
16614 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
16615
e08dcafd
EZ
166162011-09-07 Eli Zaretskii <eliz@gnu.org>
16617
16618 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
16619 only under bidi iteration.
16620
115b96bd
JD
166212011-09-07 Jan Djärv <jan.h.d@swipnet.se>
16622
16623 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
16624
c8199d0f
PE
166252011-09-06 Paul Eggert <eggert@cs.ucla.edu>
16626
16627 isnan: Fix porting problem to Solaris 10 with bundled gcc.
16628 Without this fix, the command to link temacs failed due to an
16629 undefined symbol __builtin_isnan. This is because
16630 /usr/include/iso/math_c99.h #defines isnan(x) to
16631 __builtin_isnan(x), but the bundled gcc, which identifies itself
16632 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
16633 a __builtin_isnan.
16634 * floatfns.c (isnan): #undef, and then #define to a clone of
16635 what's in data.c.
16636 (Fisnan): Always define, since it's always available now.
16637 (syms_of_floatfns): Always define isnan at the Lisp level.
16638
e39b275c 166392011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
16640
16641 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
16642
b2db44d9 166432011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 16644
f4af5137 16645 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
16646 The previous code assumed that file offsets (off_t values) fit in
16647 EMACS_INT variables, which is not true on typical 32-bit hosts.
16648 The code messed up by falsely reporting buffer overflow in cases
16649 such as (insert-file-contents "big" nil 1 2) into an empty buffer
16650 when "big" contains more than 2**29 bytes, even though this
16651 inserts just one byte and does not overflow the buffer.
16652 (Finsert_file_contents): Store file offsets as off_t
16653 values, not as EMACS_INT values. Check for overflow when
16654 converting between EMACS_INT and off_t. When checking for
16655 buffer overflow or for overlap, take the offsets into account.
16656 Don't use EMACS_INT for small values where int suffices.
16657 When checking for overlap, fix a typo: ZV was used where
16658 ZV_BYTE was intended.
16659 (Fwrite_region): Don't assume off_t fits into 'long'.
16660 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
16661
ecfc0a49
MA
166622011-09-05 Michael Albinus <michael.albinus@gmx.de>
16663
16664 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
16665
6511acf2 166662011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 16667
0999621a 16668 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
16669
16670 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 16671 (esprintf, exprintf, evxprintf): New functions.
62f19c19 16672 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 16673 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
16674 (modify_event_symbol): Do not assume that the length of
16675 name_alist_or_stem is safe to alloca and fits in int.
16676 (Fexecute_extended_command): Likewise for function name and binding.
16677 (Frecursion_depth): Wrap around reliably on integer overflow.
16678 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
16679 since some callers pass EMACS_INT values.
16680 (Fsingle_key_description): Don't crash if symbol name contains more
16681 than MAX_ALLOCA bytes.
16682 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
16683 (get_minibuffer): Arg is now EMACS_INT, not int.
16684 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 16685 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
16686 * window.h (command_loop_level, minibuf_level): Reflect API changes.
16687
2be7d702
PE
16688 * dbusbind.c (signature_cat): New function.
16689 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
16690 Do not overrun buffer; instead, report string overflow.
16691
9d1df220
PE
16692 * dispnew.c (add_window_display_history): Don't overrun buffer.
16693 Truncate instead; this is OK since it's just a log.
16694
33ef5c64
PE
16695 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
16696 even if the time zone offset is outlandishly large.
16697 Don't mishandle offset == INT_MIN.
16698
66c6fdd5
PE
16699 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
16700 when creating daemon; the previous buffer-overflow check was incorrect.
16701
d749b01b
PE
16702 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
16703 which has the guts of the old verror function.
16704
b5cd1905
PE
16705 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
16706 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
16707
6e1a67fb
PE
16708 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
16709 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 16710 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 16711 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
16712 length of string rather than counting it via multiple sprintfs;
16713 that's simpler and more reliable.
c21721cc
PE
16714 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
16715 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
16716 sprintf, in case result does not fit in int.
16717
c57b67fc
PE
16718 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
16719 (fontset_from_font): Print it.
16720
8a401434
PE
16721 * frame.c (tty_frame_count): Now printmax_t, not int.
16722 (make_terminal_frame, set_term_frame_name): Print it.
16723 (x_report_frame_params): In X, window IDs are unsigned long,
16724 not signed long, so print them as unsigned.
16725 (validate_x_resource_name): Check for implausibly long names,
16726 and don't assume name length fits in 'int'.
16727 (x_get_resource_string): Don't blindly alloca invocation name;
16728 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
16729 not fit in int.
16730
6e1a67fb
PE
16731 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
16732 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
16733 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
16734
0df02bf3
PE
16735 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
16736 Use esprintf, not sprintf, in case result does not fit in int.
16737
48e30793
PE
16738 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16739 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
16740 it as a large positive number.
16741 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
16742 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
16743
a66ff6d8
PE
16744 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
16745 in case result does not fit in int.
16746
aca216ff
PE
16747 * print.c (float_to_string): Detect width overflow more reliably.
16748 (print_object): Make sprintf buffer a bit bigger, to avoid potential
16749 buffer overrun. Don't assume list length fits in 'int'. Treat
16750 print length of 0 as 0, not as infinity; to be consistent with other
16751 uses of print length in this function. Don't overflow print length
16752 index. Don't assume hash table size fits in 'long', or that
16753 vectorlike size fits in 'unsigned long'.
16754
31c286f7
PE
16755 * process.c (make_process): Use printmax_t, not int, to format
16756 process-name gensyms.
16757
55e5faa1
PE
16758 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
16759
80f2e268
PE
16760 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
16761 to avoid potential buffer overrun.
16762
670741ab
PE
16763 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
16764 if X resource line is longer than 512 bytes.
16765
b7163a50
PE
16766 * xfns.c (x_window): Make sprintf buffer a bit bigger
16767 to avoid potential buffer overrun.
16768
ae58ff1f
PE
16769 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
16770
c43c8a6a
PE
16771 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
16772
3f8236f4
PE
167732011-09-04 Paul Eggert <eggert@cs.ucla.edu>
16774
53e9fe90 16775 Integer overflow fixes for scrolling, etc.
6511acf2
PE
16776 Without these, Emacs silently mishandles large integers sometimes.
16777 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
16778 it were "C-u 1 M-x recenter" on a typical 64-bit host.
16779
6511acf2
PE
16780 * xdisp.c (try_window_id): Check Emacs fixnum range before
16781 converting to 'int'.
806add1d 16782
6511acf2 16783 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
16784 Check that an Emacs fixnum is in range before assigning it to 'int'.
16785 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
16786 values converted from Emacs fixnums.
16787 (Frecenter): Don't wrap around a line count if it is out of 'int'
16788 range; instead, treat it as an extreme value.
16789 (Fset_window_configuration, compare_window_configurations):
16790 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
16791
6511acf2
PE
16792 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
16793 that can exceed INT_MAX. Check that EMACS_INT value is in range
16794 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
16795 (match_limit): Don't assume that a fixnum can fit in 'int'.
16796
6511acf2 16797 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
16798 exceed INT_MAX.
16799
6511acf2 16800 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
16801 (Fvertical_motion): Don't wrap around LINES values that don't fit
16802 in 'int'. Instead, treat them as extreme values. This is good
16803 enough for windows, which can't have more than INT_MAX lines anyway.
16804
fcb901a7
LMI
168052011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
16806
0f2f6b6d
LMI
16807 * Require libxml/parser.h to avoid compilation warning.
16808
fcb901a7
LMI
16809 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
16810
16811 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
16812 since this reportedly can destroy thread storage.
16813
6e20a0d4
CY
168142011-08-30 Chong Yidong <cyd@stupidchicken.com>
16815
16816 * syntax.c (find_defun_start): Update all cache variables if
16817 exiting early (Bug#9401).
16818
148ae00e
EZ
168192011-08-30 Eli Zaretskii <eliz@gnu.org>
16820
f6cfbd8f
EZ
16821 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16822
148ae00e
EZ
16823 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16824 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16825 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16826
16827 * term.c (tty_append_glyph): New function.
16828 (produce_stretch_glyph): Static function and its prototype deleted.
16829
a66cfb1c
SM
16830 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16831 Add prototypes.
148ae00e 16832
c4a07a4c
PE
168332011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16834
16835 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16836 when checking :margin (Bug#9390).
16837 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 16838 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
16839 so that the name doesn't mislead. All uses changed.
16840
6bc8cd65
JB
168412011-08-28 Johan Bockgård <bojohan@gnu.org>
16842
16843 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16844 set_tty_hooks.
16845
dca4927e
EZ
168462011-08-27 Eli Zaretskii <eliz@gnu.org>
16847
16848 * xdisp.c (move_it_to): Don't bail out early when reaching
16849 position beyond to_charpos, if we are scanning backwards.
16850 (move_it_vertically_backward): When DY == 0, make sure we get to
16851 the first character in the line after the newline.
16852
f2cad773
PE
168532011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16854
16855 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16856 (ccl_driver): Do not generate an out-of-range pointer.
16857 (Fccl_execute_on_string): Remove unnecessary check for
16858 integer overflow, noted by Stefan Monnier in
16859 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16860 Remove a FIXME that didn't need fixing.
16861 Simplify the newly-introduced buffer reallocation code.
16862
0cae2cdb
JB
168632011-08-27 Juanma Barranquero <lekktu@gmail.com>
16864
16865 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16866
5fc295a4 168672011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 16868
70c60eb2 16869 Integer and memory overflow issues (Bug#9196).
726e0ab1 16870
d31850da
PE
16871 * doc.c (get_doc_string): Rework so that
16872 get_doc_string_buffer_size is the actual buffer size, rather than
16873 being 1 less than the actual buffer size; this makes xpalloc more
16874 convenient.
16875
a69fbedb
PE
16876 * image.c (x_allocate_bitmap_record, cache_image):
16877 * xselect.c (Fx_register_dnd_atom):
16878 Simplify previous changes by using xpalloc.
16879
fe5c5d37
PE
16880 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16881 since either will do and ptrdiff_t is convenient with xpalloc.
16882
0065d054
PE
16883 * charset.c (charset_table_size)
16884 (struct charset_sort_data.priority): Now ptrdiff_t.
16885 (charset_compare): Don't overflow if priorities differ greatly.
16886 (Fsort_charsets): Don't assume list length fits in int.
16887 Check for size-calculation overflow when allocating sort data.
16888 (syms_of_charset): Allocate an initial charset table that is
16889 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16890
16891 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16892
16893 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16894 The actual value is always <= INT_MAX, and leaving it unsigned made
16895 overflow checking harder.
16896
16897 * dispextern.h (struct glyph_matrix.rows_allocated)
16898 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16899 with xpalloc. The values are still always <= INT_MAX.
16900
16901 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16902
16903 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16904 (SAFE_NALLOCA): New macro.
16905
16906 * region-cache.c (struct boundary.pos, find_cache_boundary)
16907 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16908 (set_cache_region, invalidate_region_cache)
16909 (revalidate_region_cache, know_region_cache, region_cache_forward)
16910 (region_cache_backward, pp_cache):
16911 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16912 so that ptrdiff_t * can be passed to xpalloc.
16913 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16914 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16915 (pp_cache): Don't assume cache_len fits in int.
16916 * region-cache.h: Adjust extern decls to match.
16917
16918 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16919 EMACS_INT, since either will do, for xpalloc.
16920
16921 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16922 (xnmalloc, xnrealloc, xpalloc): New functions.
16923
726e0ab1
PE
16924 * bidi.c (bidi_shelve_header_size): New constant.
16925 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16926 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16927
51f30bc5 16928 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
16929 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16930 (overlay_strings):
16931 Don't update size of array until after memory allocation succeeds,
16932 because xmalloc/xrealloc may not return.
0065d054
PE
16933 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16934 now that we have proper integer overflow checking.
16935 (record_overlay_string, overlay_strings): Catch overflows when
16936 calculating size of overlay_str_buf.
726e0ab1 16937
0065d054
PE
16938 * callproc.c (Fcall_process): Check for size overflow when
16939 calculating size of args2.
16940 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16941 Normally we prefer signed values, but sticking with ptrdiff_t would
16942 require adding more-complicated checks.
726e0ab1
PE
16943
16944 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16945 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16946 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 16947 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
16948
16949 * character.c (Fstring): Check for size-calculation overflow.
16950
16951 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16952 unnecessary integer overflow. Check for size overflow.
16953 (encode_coding_object): Don't update size until xmalloc succeeds.
16954
16955 * composite.c (get_composition_id): Check for overflow in glyph
16956 length calculations.
16957
16958 Integer and memory overflow fixes for display code.
16959 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16960 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16961 (scrolling_window): Check for overflow in size calculations.
16962 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16963 Don't assume glyph table len fits in int.
16964 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16965 (row_table_size): Now ptrdiff_t, not int.
16966 (scrolling_window): Avoid overflow in size calculations.
16967 Don't update size until allocation succeeds.
16968 * fns.c (concat): Check for overflow in size calculations.
16969 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16970 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16971 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16972
16973 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16974 (get_doc_string): Check for size calculation overflow.
16975 Don't update size until allocation succeeds.
16976 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16977 EMACS_INT, where ptrdiff_t will do.
16978 (Fsubstitute_command_keys): Check for string overflow.
16979
16980 * editfns.c (set_time_zone_rule): Don't assume environment length
16981 fits in int.
16982 (message_length): Now ptrdiff_t, not int.
16983 (Fmessage_box): Don't update size until allocation succeeds.
16984 Don't assume message length fits in int.
16985 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16986
0065d054
PE
16987 * emacs.c (main): Do not reallocate argv, since there is a null at
16988 the end that can be overwritten, and this way there's no need to
16989 worry about size-calculation overflow.
16990 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
16991
16992 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16993 alloc succeeds.
16994 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16995
16996 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16997 (x_set_scroll_bar_width, x_figure_window_size):
16998 Check for integer overflow.
16999 (x_set_alpha): Do not assume XINT fits in int.
17000
17001 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
17002 This is for the members text_lines, text_cols, total_lines, total_cols,
17003 where the system imposes an 'int' limit.
17004
17005 * fringe.c (Fdefine_fringe_bitmap):
17006 Don't update size until alloc works.
17007
17008 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
17009 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
17010
17011 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
17012 Check for size-calculation overflow.
17013 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
17014 do, as we prefer signed integers.
17015 (id_to_widget.max_size, id_to_widget.used)
17016 (xg_store_widget_in_map, xg_remove_widget_from_map)
17017 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
17018 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
17019 Use and return ptrdiff_t, not int.
17020 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
17021 * gtkutil.h: Change prototypes to match the above.
17022
17023 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
17024 are duplicate now that they've been promoted to lisp.h.
17025 (x_allocate_bitmap_record, x_alloc_image_color)
17026 (make_image_cache, cache_image, xpm_load):
17027 Don't update size until alloc is done.
17028 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
17029 (x_detect_edges):
3256efce 17030 Check for size calculation overflow.
726e0ab1
PE
17031 (ct_colors_allocated_max): New constant.
17032 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
17033 overflow.
3256efce 17034
726e0ab1
PE
17035 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
17036 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
17037 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
17038 Use ptrdiff_t, not int, to count maps.
17039 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
17040 calculations. Don't update size until allocation succeeds.
17041 Redo calculations to avoid overflow.
726e0ab1
PE
17042 * keyboard.h: Change prototypes to match the above.
17043
17044 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
17045 to count maps.
17046 (current_minor_maps): Check for size calculation overflow.
17047 * keymap.h: Change prototypes to match the above.
17048
17049 * lread.c (read1, init_obarray): Don't update size until alloc done.
17050
17051 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
17052 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
17053
726e0ab1
PE
17054 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
17055 Now ptrdiff_t, not int.
17056 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
17057 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
17058
17059 * process.c (Fnetwork_interface_list): Check for overflow
17060 in size calculation.
17061
17062 * region-cache.c (move_cache_gap): Check for size calculation overflow.
17063
17064 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
17065 overflow. Don't bother calling xmalloc when xrealloc will do.
17066
17067 * search.c (Freplace_match): Check for size calculation overflow.
17068 (Fset_match_data): Don't assume list lengths fit in 'int'.
17069
17070 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
17071 for command line length. Do not attempt to address one before the
17072 beginning of an array, as that's not portable.
17073
17074 * term.c (max_frame_lines): Remove; unused.
17075 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
17076 not int.
17077 (encode_terminal_code, calculate_costs): Check for size
17078 calculation overflow.
17079 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
17080 table lengths and related sizes. Don't update size until alloc
17081 done. Redo calculations to avoid overflow.
17082 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
17083
17084 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
17085 subtracting pointers.
17086 (gobble_line): Check for overflow more carefully. Don't update size
17087 until alloc done.
17088
17089 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
17090 Don't update size until alloc done.
17091 Redo size calculations to avoid overflow.
17092 Check for size calculation overflow.
0065d054 17093 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
17094
17095 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
17096 Use ptrdiff_t, not int, for sizes.
17097 (store_mode_line_noprop_char): Don't update size until alloc done.
17098
0065d054
PE
17099 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
17100 Use ptrdiff_t, not int, for sizes.
17101 (Finternal_make_lisp_face, cache_face):
17102 Check for size calculation overflow.
17103 (cache_face): Treat size calculation overflows as if they were
17104 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
17105
17106 * xfns.c (x_encode_text, x_set_name_internal)
17107 (Fx_change_window_property): Use ptrdiff_t, not int, to count
17108 sizes, since they can exceed INT_MAX in size. Check for size
17109 calculation overflow.
17110
0065d054
PE
17111 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
17112 (xg_select): Check for size calculation overflow.
726e0ab1
PE
17113 Don't update size until alloc done.
17114
0065d054 17115 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 17116 as sprintf is limited to int lengths.
1d526e2f 17117
252c5ee1
PE
17118 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
17119 (X_LONG_MIN): New macros.
864d7ce7
PE
17120 Use them to make the following changes clearer.
17121 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
17122 This change doesn't affect the value now, but it may help remind
17123 future maintainers not to raise the value too much later.
17124 (SELECTION_QUANTUM): Remove, replacing with ...
17125 (selection_quantum): ... new function, which avoids overflow.
17126 All uses changed.
17127 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
17128 assumption that selection length fits in 'int'.
17129 (x_reply_selection_request, x_handle_selection_request)
17130 (x_get_window_property, receive_incremental_selection)
17131 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
17132 (lisp_data_to_selection_data, clean_local_selection_data):
17133 Use ptrdiff_t, not int, to record length of selection.
17134 (x_reply_selection_request, x_get_window_property)
17135 (receive_incremental_selection, x_property_data_to_lisp):
17136 Redo calculations to avoid overflow.
17137 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 17138 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
17139 something.
17140 (x_get_window_property, receive_incremental_selection)
17141 (lisp_data_to_selection_data, x_property_data_to_lisp):
17142 Check for size-calculation overflow.
17143 (x_get_window_property, receive_incremental_selection)
17144 (lisp_data_to_selection_data, Fx_register_dnd_atom):
17145 Don't store size until memory allocation succeeds.
17146 (x_get_window_property): Plug memory leak on memory exhaustion.
17147 Don't double-block input; malloc is safe here. Don't assume 2**34
17148 - 4 fits in unsigned long. Add an xassert to check
17149 XGetWindowProperty overflow. Be more careful about overflow
17150 calculations, and distinguish size from memory overflow better.
17151 (receive_incremental_selection): When tracing, don't assume
17152 unsigned int is less than INT_MAX.
17153 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
17154 harmful) conversions of unsigned short to int.
17155 (lisp_data_to_selection_data): Don't assume that integers
17156 in the range -65535 through -1 fit in an X unsigned short.
17157 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
17158 result parameters unless successful. Rely on cons_to_unsigned
17159 to report problems with elements; the old code wasn't right anyway.
17160 (x_check_property_data): Check for int overflow; we cannot use
17161 a wider type due to X limits.
17162 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
17163
726e0ab1 17164 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 17165
0065d054
PE
17166 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
17167 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
17168 (x_color_cells): Don't store size until memory allocation succeeds.
17169 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 17170 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
17171 (x_term_init): Don't assume length fits in int (sprintf is limited
17172 to int size).
bc18e09d 17173
ebfa62c0
PE
17174 Use ptrdiff_t for composition IDs.
17175 * character.c (lisp_string_width):
17176 * composite.c (composition_table_size, n_compositions)
17177 (get_composition_id, composition_gstring_from_id):
17178 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
17179 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
17180 * window.c (Frecenter):
17181 Use ptrdiff_t, not int, for composition IDs.
17182 * composite.c (get_composition_id): Check for integer overflow.
17183 * composite.h: Adjust prototypes to match the above changes.
17184
d3411f89
PE
17185 Use ptrdiff_t for hash table indexes.
17186 * category.c (hash_get_category_set):
17187 * ccl.c (ccl_driver):
17188 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
17189 * coding.c (coding_system_charset_list, detect_coding_system):
17190 * coding.h (struct coding_system.id):
17191 * composite.c (get_composition_id, gstring_lookup_cache):
17192 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
17193 * image.c (xpm_get_color_table_h):
17194 * lisp.h (hash_lookup, hash_put):
17195 * minibuf.c (Ftest_completion):
17196 Use ptrdiff_t for hash table indexes, not int (which is too
17197 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
17198 32-bit --with-wide-int hosts).
17199
e097a6fa
PE
17200 * charset.c (Fdefine_charset_internal): Check for integer overflow.
17201 Add a FIXME comment about memory leaks.
17202 (syms_of_charset): Don't assume xmalloc returns.
17203
5637687f
PE
17204 Don't assume that stated character widths fit in int.
17205 * character.c (Fchar_width, c_string_width, lisp_string_width):
17206 * character.h (CHAR_WIDTH):
17207 * indent.c (MULTIBYTE_BYTES_WIDTH):
17208 Use sanitize_char_width to avoid undefined and/or bad behavior
17209 with outlandish widths.
a66cfb1c 17210 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
17211 now that we have two such functions. All uses changed.
17212 (sanitize_char_width): New inline function.
17213
a2271ba2
PE
17214 Don't assume that tab-width fits in int.
17215 * character.h (sanitize_width): New inline function.
17216 (SANE_TAB_WIDTH): New macro.
17217 (ASCII_CHAR_WIDTH): Use it.
17218 * indent.c (sane_tab_width): Remove. All uses replaced by
17219 SANE_TAB_WIDTH (current_buffer).
17220 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
17221
18c52557
PE
17222 * fileio.c: Integer overflow issues with file modes.
17223 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
17224
caeeedc1
PE
17225 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
17226 Remove unreachable code.
17227 (read_hex, load_charset_map_from_file): Check for integer overflow.
17228
6df6ae42 17229 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
17230 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
17231 (x_send_scroll_bar_event): Likewise. Check that the size does not
17232 exceed limits imposed by XClientMessageEvent, as well as the usual
17233 ptrdiff_t and size_t limits.
17234
b13995db
PE
17235 * keyboard.c: Overflow, signedness and related fixes.
17236 (make_lispy_movement): Use same integer type in forward decl
17237 that is used in the definition.
17238 (read_key_sequence, keyremap_step):
17239 Change bufsize argument back to int, undoing my 2011-03-30 change.
17240 We prefer signed types, and int is wide enough here.
17241 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
17242 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
17243 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
17244 length, not size_t. Use ptrdiff_t for index, not int.
17245 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
17246 possibility of integer overflow.
17247
13464394
PE
17248 Overflow, signedness and related fixes for images.
17249
17250 * dispextern.h (struct it.stack[0].u.image.image_id)
17251 (struct_it.image_id, struct image.id, struct image_cache.size)
17252 (struct image_cache.used, struct image_cache.ref_count):
17253 * gtkutil.c (update_frame_tool_bar):
17254 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
17255 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
17256 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
17257 * nsmenu.m (update_frame_tool_bar):
17258 * xdisp.c (calc_pixel_width_or_height):
17259 * xfns.c (image_cache_refcount):
17260 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
17261 on typical 64-bit hosts.
17262
17263 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
17264 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
17265 Omit unnecessary casts to int.
17266 (parse_image_spec): Check that integers fall into 'int' range
17267 when the callers expect that.
17268 (image_ascent): Redo ascent calculation to avoid int overflow.
17269 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
17270 (lookup_image): Remove unnecessary tests.
17271 (xbm_image_p): Locals are now of int, not EMACS_INT,
17272 since parse_image_check makes sure they fit into int.
17273 (png_load, gif_load, svg_load_image):
17274 Prefer int to unsigned where either will do.
17275 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
17276 old tiff_error_handler and tiff_warning_handler.
17277 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
17278 stack buffer overflows. It uses only the features of vsnprintf
17279 that are common to both POSIX and native Microsoft.
17280 (tiff_error_handler, tiff_warning_handler): Use it.
17281 (tiff_load, gif_load, imagemagick_load_image):
17282 Don't assume :index value fits in 'int'.
17283 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
17284 (imagemagick_load_image): Check that crop parameters fit into
17285 the integer types that MagickCropImage accepts. Don't assume
17286 Vimagemagick_render_type has a nonnegative value. Don't assume
17287 size_t fits in 'long'.
17288 (gs_load): Use printmax_t to print the widest integers possible.
17289 Check for integer overflow when computing image height and width.
17290
c11821d4
EZ
172912011-08-26 Eli Zaretskii <eliz@gnu.org>
17292
17293 * xdisp.c (redisplay_window): Don't force window start if point
17294 will be invisible in the resulting window. (Bug#9324)
17295
0c95fcf7
EZ
172962011-08-25 Eli Zaretskii <eliz@gnu.org>
17297
17298 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
17299 the display spec is of the form `(space ...)'.
17300 (handle_display_spec): Return the value returned by
17301 handle_single_display_spec, not just 1 or zero.
17302 (handle_single_display_spec): If the display spec is of the form
17303 `(space ...)', and specifies display in the text area, return 2
17304 rather than 1.
fee65a97 17305 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
17306 accurately, and prefer exact match for point under bidi.
17307 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
17308
17309 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
17310 into disp_prop; all users changed.
17311
17312 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
17313 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
17314 for the text covered by the display property.
17315
e4ed06f1
CY
173162011-08-25 Chong Yidong <cyd@stupidchicken.com>
17317
17318 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
17319 Change return value to nil.
17320 (Frecord_buffer): Delete unused function.
17321
f67cdd7f
EZ
173222011-08-24 Eli Zaretskii <eliz@gnu.org>
17323
5980d4c6
EZ
17324 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
17325 buffers, return left-to-right.
8610fe8b
EZ
17326 (set_cursor_from_row): Consider candidate row a win if its glyph
17327 represents a newline and point is on that newline. Fixes cursor
17328 positioning on the newline at EOL of R2L text within L2R
17329 paragraph, and vice versa.
17330 (try_cursor_movement): Check continued rows, in addition to
17331 continuation rows. Fixes unwarranted scroll when point enters a
17332 continued line of R2L text within an L2R paragraph, or vice versa.
17333 (cursor_row_p): Consider the case of point being equal to
17334 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
17335 from the end of a short line to the beginning of a continued line
17336 of R2L text within L2R paragraph.
17337 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
17338 composed characters.
5980d4c6 17339
f67cdd7f
EZ
17340 * bidi.c (bidi_check_type): Use xassert.
17341 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
17342 members.
17343
bca633fb
EZ
173442011-08-23 Eli Zaretskii <eliz@gnu.org>
17345
17346 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
17347 a character.
17348
4a5885a7
CY
173492011-08-23 Chong Yidong <cyd@stupidchicken.com>
17350
17351 * nsfont.m (ns_otf_to_script): Fix typo.
17352
0902a04e
KH
173532011-08-22 Kenichi Handa <handa@m17n.org>
17354
17355 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
17356 extra slot even if the purpose is char-code-property-table.
17357
1a2e6670
EZ
173582011-08-23 Eli Zaretskii <eliz@gnu.org>
17359
8ddde651
EZ
17360 * xdisp.c (redisplay_window): When computing centering_position,
17361 account for the height of the header line. (Bug#8874)
17362
425cc014
EZ
17363 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
17364 instead of CHAR_TO_BYTE. Fixes a crash when a completion
17365 candidate is selected by the mouse, and that candidate has a
17366 composed character under the mouse.
17367
1a2e6670
EZ
17368 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
17369 coordinates reported by pos-visible-in-window-p for a composed
17370 character in column zero.
17371
8b76d6f8
SM
173722011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
17373
17374 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
17375
dac347dd
EZ
173762011-08-22 Eli Zaretskii <eliz@gnu.org>
17377
17378 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
17379 consider it a hit if to_charpos is anywhere in the range of the
17380 composed buffer positions.
17381
e013fb34
CY
173822011-08-22 Chong Yidong <cyd@stupidchicken.com>
17383
17384 * image.c (gif_load): Don't assume that each subimage has the same
17385 dimensions as the base image. Handle disposal method that is
17386 "undefined" by the gif spec (Bug#9335).
17387
bd1ba3e8
CY
173882011-08-20 Chong Yidong <cyd@stupidchicken.com>
17389
17390 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 17391 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 17392
54a1215b
EZ
173932011-08-19 Eli Zaretskii <eliz@gnu.org>
17394
823564e5
EZ
17395 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
17396 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
17397 from an Org mode buffer to a Speedbar frame.
17398
54a1215b
EZ
17399 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
17400 a composition, take its buffer position from IT->cmp_it.charpos.
17401 Fixes cursor positioning at the beginning of a line that begins
17402 with a composed character.
17403
9778ebcc
EZ
174042011-08-18 Eli Zaretskii <eliz@gnu.org>
17405
0be6ee06
EZ
17406 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
17407 character bidirectional type, use STRONG_L instead. Fixes crashes
17408 in a buffer produced by `describe-categories'.
17409
9778ebcc
EZ
17410 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
17411 members before the level stack, so they would be saved and
17412 restored when copying iterator state. Fixes incorrect reordering
17413 around TABs covered by display properties.
17414
156bffbe
AS
174152011-08-18 Andreas Schwab <schwab@linux-m68k.org>
17416
6b02f655 17417 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 17418
72ad093b
CY
174192011-08-17 Chong Yidong <cyd@stupidchicken.com>
17420
17421 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
17422 (internal_condition_case_2, internal_condition_case_n):
17423 Remove unnecessary aborts (Bug#9081).
72ad093b 17424
35774242
EZ
174252011-08-17 Eli Zaretskii <eliz@gnu.org>
17426
17427 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
17428 has no `load' handler, try opening the file locally. (Bug#9311)
17429
db76dd85
KB
174302011-08-16 Ken Brown <kbrown@cornell.edu>
17431
17432 * gmalloc.c: Expand comment.
17433
b215eee5
EZ
174342011-08-16 Eli Zaretskii <eliz@gnu.org>
17435
17436 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
17437 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
17438
a4579d33
KB
174392011-08-16 Ken Brown <kbrown@cornell.edu>
17440
17441 Fix memory allocation problems in Cygwin build (Bug#9273).
17442
17443 * unexcw.c ( __malloc_initialized): Declare external variable.
17444 (fixup_executable): Force the dumped emacs to reinitialize malloc.
17445
8b76d6f8
SM
17446 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
17447 New variables.
a4579d33
KB
17448 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
17449 dumped emacs.
17450 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
17451 in the static heap.
17452 [CYGWIN] (special_realloc): New function.
17453 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
17454 requests to realloc storage in the static heap.
17455
3ebec551
PE
174562011-08-15 Paul Eggert <eggert@cs.ucla.edu>
17457
17458 * bidi.c (bidi_initialize): Remove unused local.
17459
9fd8be00
EZ
174602011-08-15 Eli Zaretskii <eliz@gnu.org>
17461
6b02f655
SM
17462 * bidimirror.h:
17463 * biditype.h: Remove file.
17464 * makefile.w32-in ($(BLD)/bidi.$(O)):
17465 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
17466
17467 * dispextern.h: Fix a typo in the comment to bidi_type_t.
17468
17469 * chartab.c: Improve commentary for the uniprop_table API.
17470
32413314
EZ
17471 * bidi.c (bidi_paragraph_init): Support zero value of
17472 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
17473 (bidi_initialize): Use uniprop_table instead of including
17474 biditype.h and bidimirror.h.
32413314 17475
9fd8be00
EZ
17476 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
17477 coordinates of the iterator when restoring from ppos_it.
17478 (Bug#9296)
17479
5cf2b69b
KH
174802011-08-14 Kenichi Handa <handa@m17n.org>
17481
17482 * process.c (create_process): Call setup_process_coding_systems
72ad093b 17483 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 17484
daf17d00
EZ
174852011-08-14 Eli Zaretskii <eliz@gnu.org>
17486
17487 * xdisp.c (move_it_in_display_line_to): Don't invoke
17488 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
17489 ppos_it. Fixes vertical cursor motion when line beginning is
17490 covered by an image. (Bug#9296)
17491
08e3161a
JD
174922011-08-14 Jan Djärv <jan.h.d@swipnet.se>
17493
17494 * nsterm.h (ns_run_ascript): Declare.
17495 (NSAPP_DATA2_RUNASSCRIPT): Define.
17496
17497 * nsfns.m (as_script, as_result, as_status): New static variables.
17498 (ns_run_ascript): New function.
5e617bc2 17499 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
17500 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
17501 the event loop. Get status from as_status (Bug#7276).
17502
17503 * nsterm.m (sendEvent): If event is NSApplicationDefined and
17504 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
17505 the event loop (Bug#7276).
17506
a3720aa2
AS
175072011-08-14 Andreas Schwab <schwab@linux-m68k.org>
17508
17509 * gnutls.c (QCgnutls_bootprop_priority)
17510 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
17511 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
17512 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
17513 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
17514 (QCgnutls_bootprop_verify_hostname_error)
17515 (QCgnutls_bootprop_callbacks_verify): Rename from
17516 Qgnutls_bootprop_..., all uses changed.
17517
17518 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
17519 uses changed.
17520
0a0d27fb
PE
175212011-08-14 Paul Eggert <eggert@cs.ucla.edu>
17522
19d5c50c
PE
17523 * xfaces.c (Qframe_set_background_mode): Now static.
17524 * dispextern.h (Qframe_set_background_mode): Remove decl.
17525
0a0d27fb
PE
17526 * process.c (Fnetwork_interface_info): Declare local only if needed.
17527
377538cb
JD
175282011-08-13 Jan Djärv <jan.h.d@swipnet.se>
17529
17530 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
17531 (Fnetwork_interface_list): Allocate in increments of bytes instead
17532 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
17533 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
17534 sockaddr.
17535 (struct ifflag_def): notrailers is smart on OSX.
17536 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
17537 Get hardware address with getifaddrs if available.
17538
08fff70c
EZ
175392011-08-12 Eli Zaretskii <eliz@gnu.org>
17540
17541 * xdisp.c (iterate_out_of_display_property): xassert that
17542 IT->position is set to within IT->object's boundaries. Break from
17543 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
17544 when IT->position is set up wrongly due to some bug.
17545 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
17546 (push_display_prop): Allow GET_FROM_STRING as IT->method on
17547 entry. Force push_it to save on the stack the current
17548 buffer/string position, to be restored by pop_it. Fix flags in
17549 the iterator structure wrt the object coming from a display
17550 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
17551 properties. (Bug#9284)
17552
7be1c708 175532011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 17554
7be1c708
CY
17555 * fontset.c (fontset_get_font_group): Add proper type checks.
17556 (Bug#9172)
aac0c6e3 17557
7be1c708 175582011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 17559
7be1c708
CY
17560 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
17561 and LC_VERSION_MIN_MACOSX.
17562 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
17563 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 17564
97bb72a6
EZ
175652011-08-08 Eli Zaretskii <eliz@gnu.org>
17566
17567 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
17568 no-display-properties-and-no-overlays under bidi display.
17569 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 17570 properties and overlays.
97bb72a6 17571
d5617611
CY
175722011-08-08 Chong Yidong <cyd@stupidchicken.com>
17573
37e11a63
CY
17574 * editfns.c (Fset_time_zone_rule): Document relationship with the
17575 setenv function.
17576
d5617611
CY
17577 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
17578 the font entity extracted from the cache (Bug#8109).
17579
58872834
CY
175802011-08-07 Chong Yidong <cyd@stupidchicken.com>
17581
17582 * composite.c (autocmp_chars): Don't reset point. That is done by
17583 restore_point_unwind (Bug#5984).
17584
75bfc667
JL
175852011-08-07 Juri Linkov <juri@jurta.org>
17586
17587 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
17588 to show the arg `TIME' instead of `TIMEVAL'.
17589
d1410150
EZ
175902011-08-06 Eli Zaretskii <eliz@gnu.org>
17591
17592 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
17593 display property strides EOL and includes a newline, as in
17594 longlines-mode. (Bug#9254)
75b771e4
EZ
17595 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
17596 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
17597
17598 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
17599 is non-zero, even if the data buffer is NULL. Fixes a crash in
17600 vertical-motion with longlines-mode. (Bug#9254)
17601
35928349
EZ
176022011-08-05 Eli Zaretskii <eliz@gnu.org>
17603
ec7cc85b
EZ
17604 * bidi.c <bidi_cache_total_alloc>: Now static.
17605 (bidi_initialize): Initialize bidi_cache_total_alloc.
17606
8b76d6f8 17607 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
17608 cache. (Bug#9221)
17609
17610 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
17611 amount allocated this far in `bidi_cache_total_alloc'.
17612 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
17613 non-zero, only free the data buffer without restoring the cache
17614 contents. All callers changed.
17615
17616 * dispextern.h (bidi_unshelve_cache): Update prototype.
17617
17618 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
17619 (move_it_in_display_line, move_it_to)
17620 (move_it_vertically_backward, move_it_by_lines): Replace the call
17621 to xfree to an equivalent call to bidi_unshelve_cache.
17622 (move_it_in_display_line_to): Fix logic of returning
412b6358 17623 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 17624
e2e2423b
EZ
176252011-08-05 Eli Zaretskii <eliz@gnu.org>
17626
17627 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
17628 came from a string character with a `cursor' property. (Bug#9229)
17629
ae9e757a
JD
176302011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17631
17632 * Makefile.in (LIB_PTHREAD): New variable.
17633 (LIBES): Add LIB_PTHREAD (Bug#9216).
17634
17635 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
17636 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
17637
213bd7f2
AS
176382011-08-04 Andreas Schwab <schwab@linux-m68k.org>
17639
6b02f655 17640 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 17641
99aaf75f
JD
176422011-08-04 Jan Djärv <jan.h.d@swipnet.se>
17643
17644 * xterm.c (x_find_topmost_parent): New function.
17645 (x_set_frame_alpha): Find topmost parent window with
17646 x_find_topmost_parent and set the property there also (bug#9181).
17647 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
17648
c74e9d86
PE
176492011-08-04 Paul Eggert <eggert@cs.ucla.edu>
17650
17651 * callproc.c (Fcall_process): Avoid vfork clobbering
17652 the local vars buffer, coding_systems, current_dir.
17653
640c8776
SM
176542011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
17655
17656 * keymap.c (Fmake_composed_keymap): Move to subr.el.
17657
f26d0e4c
PE
176582011-08-03 Paul Eggert <eggert@cs.ucla.edu>
17659
8a10d76c
PE
17660 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
17661 so that it is not optimized away.
17662
f26d0e4c
PE
17663 * xdisp.c (compute_display_string_pos): Remove unused local.
17664
55439c61
EZ
176652011-08-02 Eli Zaretskii <eliz@gnu.org>
17666
17667 Fix slow cursor motion and scrolling in large buffers with
17668 selective display, like Org Mode buffers. (Bug#9218)
17669
17670 * dispextern.h (struct bidi_it): New member disp_prop_p.
17671
17672 * xdisp.c: Remove one-slot cache of display string positions.
17673 (compute_display_string_pos): Accept an additional argument
5e617bc2 17674 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
17675 for a display string or property. If found, set DISP_PROP_P
17676 non-zero.
17677
17678 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
17679 DISP_PROP_P, and pass it to compute_display_string_pos.
17680 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
17681 non-zero. All callers of bidi_fetch_char changed.
17682
fb33fa43
SM
176832011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
17684
17685 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
17686
b099e063
DM
176872010-12-03 Don March <don@ohspite.net>
17688
17689 * keymap.c (Fdefine_key): Fix non-prefix key error message when
17690 last character M-[char] is translated to ESC [char] (bug#7541).
17691
5cc7f7af
KH
176922011-08-02 Kenichi Handa <handa@m17n.org>
17693
d0fffa3f 17694 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
17695
17696 * chartab.c (uniprop_table): Make it non-static.
17697
525d5e6e
EZ
176982011-08-01 Eli Zaretskii <eliz@gnu.org>
17699
17700 * xdisp.c (forward_to_next_line_start): Accept additional argument
17701 BIDI_IT_PREV, and store into it the state of the bidi iterator had
17702 on the newline.
17703 (reseat_at_next_visible_line_start): Use the bidi iterator state
17704 returned by forward_to_next_line_start to restore the state of
17705 it->bidi_it after backing up to previous newline. (Bug#9212)
17706
31011111
AS
177072011-07-30 Andreas Schwab <schwab@linux-m68k.org>
17708
17709 * regex.c (re_comp): Protoize.
17710 (re_exec): Fix return type.
17711 (regexec): Fix type of `ret'. (Bug#9203)
17712
476371c4
PE
177132011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17714
e5d76069
PE
17715 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
17716 This is needed if max-image-size is a floating-point number.
17717
9a79b20c
AS
177182011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17719
17720 * print.c (print_object): Print empty symbol as ##.
17721
17722 * lread.c (read1): Read ## as empty symbol.
17723
d8c2fa78
AA
177242011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
17725
17726 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
17727 setting frame foreground color (Bug#9175).
17728 (x_set_background_color): Likewise.
17729
ffe57a7a
AA
17730 * nsmenu.m (-setText): Size tooltip dimensions precisely to
17731 contents (Bug#9176).
17732 (EmacsTooltip -init): Remove bezels and add shadows to
17733 tooltip windows.
17734
bf3492a5
AA
17735 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
17736 or scroll bar (Bug#8470).
17737
d55e9c53
AA
17738 * nsfont.m (nsfont_open): Remove assignment to voffset and
17739 unnecessary vars hshink, expand, hd, full_height, min_height.
17740 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
17741
17742 * nsterm.h (nsfont_info): Remove voffset field.
17743
d8c2fa78 177442011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
17745
17746 Implement strike-through and overline on NextStep (Bug#8863).
17747
17748 * nsfont.m (nsfont_open): Use underline position provided by font,
17749 instead of hard-coded value of 2.
17750 (nsfont_draw): Call ns_draw_text_decoration instead.
17751
17752 * nsterm.h: Add declaration for ns_draw_text_decoration.
17753
17754 * nsterm.m (ns_draw_text_decoration): New function for drawing
17755 underline, overline, and strike-through.
17756 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
17757 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 17758 accommodate underlining, etc.
4843aac3 17759
4cc60b9b
EZ
177602011-07-28 Eli Zaretskii <eliz@gnu.org>
17761
bc7ece87
EZ
17762 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
17763 default.
4cc60b9b 17764
476371c4
PE
177652011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17766
66606eea
PE
17767 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
17768 Without this fix, if a signal arrives just after memory fills up,
17769 'malloc' might be invoked reentrantly.
17770
476371c4
PE
17771 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
17772 In other words, assume that every image size is allowed, on non-X
17773 hosts. This assumption is probably wrong, but it lets Emacs compile.
17774
f3fcc40d
AS
177752011-07-28 Andreas Schwab <schwab@linux-m68k.org>
17776
17777 * regex.c (re_iswctype): Convert return values to boolean.
17778
350c992f
EZ
177792011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
17780
17781 * xdisp.c (compute_display_string_pos): Don't use cached display
17782 string position if the buffer had its restriction changed.
17783 (Bug#9184)
17784
5266b4bb
PE
177852011-07-28 Paul Eggert <eggert@cs.ucla.edu>
17786
17787 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
17788
2573a837 177892011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 17790
41f55ccd 17791 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 17792
39e378da
PE
17793 * bidi.c: Integer size and overflow fixes.
17794 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
17795 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
17796 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17797 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
17798 (bidi_find_other_level_edge):
17799 Use ptrdiff_t instead of EMACS_INT where either will do.
17800 This works better on 32-bit hosts configured --with-wide-int.
17801 (bidi_cache_ensure_space): Check for size-calculation overflow.
17802 Use % rather than repeated addition, for better worst-case speed.
17803 Don't set bidi_cache_size until after xrealloc returns, because it
17804 might not return.
17805 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
17806 (bidi_cache_ensure_space): Also check that the bidi cache size
17807 does not exceed that of the largest Lisp string or buffer. See Eli
17808 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 17809
5e927815
PE
17810 * alloc.c (__malloc_size_t): Remove.
17811 All uses replaced by size_t. See Andreas Schwab's note
17812 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
17813
ca4aa935
PE
17814 * image.c: Improve checking for integer overflow.
17815 (check_image_size): Assume that f is nonnull, since
17816 it is always nonnull in practice. This is one less thing to
17817 worry about when checking for integer overflow later.
17818 (x_check_image_size): New function, which checks for integer
17819 overflow issues inside X.
17820 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17821 This removes the need for a memory_full check.
17822 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17823 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17824 (xbm_read_bitmap_data): Change locals back to 'int', since
17825 their values must fit in 'int'.
17826 (xpm_load_image, png_load, tiff_load):
17827 Invoke x_create_x_image_and_pixmap earlier,
17828 to avoid much needless work if the image is too large.
17829 (tiff_load): Treat overly large images as if
17830 x_create_x_image_and_pixmap failed, not as malloc failures.
17831 (gs_load): Use x_check_image_size.
17832
5f8f9cc2
PE
17833 * gtkutil.c: Omit integer casts.
17834 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17835 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17836
5adf60bc
PE
17837 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17838
c8907a93
PE
17839 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17840 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17841 would wrongly return t on a 64-bit host.
17842
e3c25c68
PE
17843 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17844 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17845 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17846 and therefore cause GCC to emit a bogus diagnostic in some cases.
17847
3f791afe
PE
17848 * image.c: Integer signedness and overflow and related fixes.
17849 This is not an exhaustive set of fixes, but it's time to
17850 record what I've got.
17851 (lookup_pixel_color, check_image_size): Remove redundant decls.
17852 (check_image_size): Don't assume that arbitrary EMACS_INT values
17853 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17854 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17855 (tiff_load, imagemagick_load_image):
17856 Check for overflow in size calculations.
17857 (x_create_x_image_and_pixmap): Remove unnecessary test for
17858 xmalloc returning NULL; that can't happen.
17859 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17860 (xpm_color_bucket): Use better integer hashing function.
17861 (xpm_cache_color): Don't possibly over-allocate memory.
17862 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17863 (gif_memory_source):
17864 Use ptrdiff_t, not int or size_t, to record sizes.
17865 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17866 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17867 either works, as we prefer signed integers.
17868 (tiff_read_from_memory, tiff_write_from_memory):
17869 Return tsize_t, not size_t, since that's what the TIFF API wants.
17870 (tiff_read_from_memory): Don't fail simply because the read would
17871 go past EOF; instead, return a short read.
17872 (tiff_load): Omit no-longer-needed casts.
17873 (Fimagemagick_types): Don't assume size fits into 'int'.
17874
3cc5a532
PE
17875 Improve hashing quality when configured --with-wide-int.
17876 * fns.c (hash_string): New function, taken from sxhash_string.
17877 Do not discard information about ASCII character case; this
17878 discarding is no longer needed.
17879 (sxhash-string): Use it. Change sig to match it. Caller changed.
17880 * lisp.h: Declare it.
17881 * lread.c (hash_string): Remove, since we now use fns.c's version.
17882 The fns.c version returns a wider integer if --with-wide-int is
17883 specified, so this should help the quality of the hashing a bit.
17884
b312a492
PE
17885 * emacs.c: Integer overflow minor fix.
17886 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17887 Define only if GNU_LINUX.
17888 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17889
dfd153ae
PE
17890 * dispnew.c: Integer signedness and overflow fixes.
17891 Remove unnecessary forward decls, that were a maintenance hassle.
17892 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17893 All uses changed.
17894 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17895 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17896 (prepare_desired_row, line_draw_cost):
17897 Use int, not unsigned, where either works.
17898 (save_current_matrix, restore_current_matrix):
17899 Use ptrdiff_t, not size_t, where either works.
17900 (init_display): Check for overflow more accurately, and without
17901 relying on undefined behavior.
17902
a81d11a3
PE
17903 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17904 Remove, replacing with the new symbols in lisp.h. All uses changed.
17905 * fileio.c (make_temp_name):
17906 * filelock.c (lock_file_1, lock_file):
17907 * xdisp.c (message_dolog):
17908 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17909 Use pMd etc. instead.
17910 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17911 replacing the pWIDE etc. symbols removed from editfns.c.
17912
3300e6fd
PE
17913 * keyboard.h (num_input_events): Now uintmax_t.
17914 This is (very slightly) less likely to mess up due to wraparound.
17915 All uses changed.
17916
fd05c7e9
PE
17917 * buffer.c: Integer signedness fixes.
17918 (alloc_buffer_text, enlarge_buffer_text):
17919 Use ptrdiff_t rather than size_t when either will do, as we prefer
17920 signed integers.
17921
903fe15d
PE
17922 * alloc.c: Integer signedness and overflow fixes.
17923 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17924 (__malloc_size_t): Default to size_t, not to int.
17925 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17926 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17927 Prefer ptrdiff_t to size_t when either would do, as we prefer
17928 signed integers.
17929 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17930 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17931 Now const. Initialize with values that are in range even if char
17932 is signed.
17933 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17934 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17935 These functions do the right thing with sizes > 2**32.
17936 (check_depth): Now ptrdiff_t, not int.
17937 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17938 Adjust to new way of storing sizes. Check for size overflow bugs
17939 in rest of code.
17940 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17941 slightly wrong anyway, as it missed one instance of
17942 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17943 (refill_memory_reserve): Omit needless cast to size_t.
17944 (mark_object_loop_halt): Mark as externally visible.
17945
ac82cc6a
PE
17946 * xselect.c: Integer signedness and overflow fixes.
17947 (Fx_register_dnd_atom, x_handle_dnd_message):
17948 Use ptrdiff_t, not size_t, since we prefer signed.
17949 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17950 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17951 x_dnd_atoms_size and x_dnd_atoms_length.
17952
c2d1e36d
PE
17953 * doprnt.c: Prefer signed to unsigned when either works.
17954 * eval.c (verror):
17955 * doprnt.c (doprnt):
17956 * lisp.h (doprnt):
17957 * xdisp.c (vmessage):
17958 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17959 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17960 prefer signed arithmetic to avoid comparison confusion.
17961 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17962 but is a bit tricky.
17963
0e926e56
PE
17964 Assume freestanding C89 headers, string.h, stdlib.h.
17965 * data.c, doprnt.c, floatfns.c, print.c:
17966 Include float.h unconditionally.
17967 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17968 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17969 * regex.c: Likewise for stddef.h, string.h.
17970 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17971 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17972 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17973 (STDC_HEADERS): Remove obsolete defines.
17974 * sysdep.c: Include limits.h unconditionally.
17975
9cfdb3ec
PE
17976 Assume support for memcmp, memcpy, memmove, memset.
17977 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17978 * regex.c (memcmp, memcpy):
17979 Remove; we assume C89 now.
17980
17981 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17982 (__malloc_safe_bcopy): Remove; no longer needed.
17983
cf950e6b 17984 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
17985 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17986 well either way, and we prefer signed to unsigned.
17987
dbf38e02
LMI
179882011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17989
17990 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17991 closes the connection while we're reading (bug#9182).
17992
d6f0886c 179932011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 17994
d6f0886c
JD
17995 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17996 are specified (Bug#9168).
24e0f6b1 17997
2eb1f9e6
PE
179982011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17999
18000 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
18001 Found by GCC static checking and --with-wide-int on a 32-bit host.
18002
22381272 180032011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
18004
18005 * xdisp.c (compute_display_string_pos): Fix logic of caching
18006 previous display string position. Initialize cached_prev_pos to
18007 -1. Fixes slow-down at the beginning of a buffer.
18008
f25e39b4
EZ
180092011-07-24 Eli Zaretskii <eliz@gnu.org>
18010
18011 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
18012 for attrs[LFACE_FONTSET_INDEX].
18013
04c4b52e
PE
180142011-07-23 Paul Eggert <eggert@cs.ucla.edu>
18015
18016 * xml.c (parse_region): Remove unused local
18017 that was recently introduced.
18018
c1734fbd
EZ
180192011-07-23 Eli Zaretskii <eliz@gnu.org>
18020
be18c5a5
EZ
18021 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
18022 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
18023
c1734fbd
EZ
18024 * xdisp.c (move_it_in_display_line_to): Record the best matching
18025 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
18026 exit if none of the characters scanned was an exact match.
18027 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
18028 when exact match is impossible due to invisible text, and the
18029 lines are truncated.
18030
a258d627
JD
180312011-07-23 Jan Djärv <jan.h.d@swipnet.se>
18032
18033 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
18034 for OSX >= 10.7.
18035
b6d5a689
EZ
180362011-07-22 Eli Zaretskii <eliz@gnu.org>
18037
0f74f785
EZ
18038 Fix a significant slow-down of cursor motion with C-n, C-p,
18039 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
18040 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 18041 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
18042 (next_element_from_buffer): Call compute_stop_pos_backwards to
18043 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
18044 base_level_stop.
18045 (reseat): Don't look for prev_stop, as that could mean a very long
18046 run.
18047 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
18048 <cached_disp_overlay_modiff>: Cache for last found display string
18049 position.
551918c1 18050 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
18051 about the same buffer in the same area of character positions, and
18052 the buffer wasn't changed since the time the display string
18053 position was cached.
551918c1 18054
b2d0c91a
EZ
180552011-07-22 Eli Zaretskii <eliz@gnu.org>
18056
18057 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
18058 is an integer, which is important for empty lines. (Bug#9149)
18059
043604ee
CY
180602011-07-22 Chong Yidong <cyd@stupidchicken.com>
18061
18062 * frame.c (Fmodify_frame_parameters): In tty case, update the
18063 default face if necessary (Bug#4238).
18064
da4adb04
CY
180652011-07-21 Chong Yidong <cyd@stupidchicken.com>
18066
18067 * editfns.c (Fstring_to_char): No need to explain what a character
18068 is in the docstring (Bug#6576).
18069
9abd0532
LMI
180702011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18071
18072 * xml.c (parse_region): Make sure we always return a tree.
18073
36881d16
HK
180742011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
18075
18076 * xml.c (parse_region): If a document contains only comments,
18077 return that, too.
18078
1e98674d
LMI
180792011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
18080
18081 * xml.c (make_dom): Return comments, too.
18082
590bd467
PE
180832011-07-19 Paul Eggert <eggert@cs.ucla.edu>
18084
18085 Port to OpenBSD.
18086 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
18087 and the surrounding thread.
18088 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
18089 rather than fgets, and retry after EINTR. Otherwise, 'emacs
18090 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
18091 timer goes off.
18092 * s/openbsd.h (BROKEN_SIGIO): Define.
18093 * unexelf.c (unexec) [__OpenBSD__]:
18094 Don't update the .mdebug section of the Alpha COFF symbol table.
18095
f41628b2
LMI
180962011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
18097
18098 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
18099 (bug#8460).
18100
b59b67c5
PE
181012011-07-18 Paul Eggert <eggert@cs.ucla.edu>
18102
15e3a074
PE
18103 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
18104 This fixes some race conditions on the permissions of any newly
18105 created file.
18106
41bed37d
PE
18107 * alloc.c (valid_pointer_p): Use pipe, not open.
18108 This fixes some permissions issues when debugging.
18109
b59b67c5
PE
18110 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
18111 If fchown fails to set both uid and gid, try to set just gid,
18112 as that is sometimes allowed. Adjust the file's mode to eliminate
18113 setuid or setgid bits that are inappropriate if fchown fails.
18114
925a6be7
SM
181152011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
18116
18117 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
18118 to compare Lisp_Objects.
18119 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
18120 global_gnutls_log_level, don't mistake it for a Lisp_Object.
18121 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
18122
52968808
AS
181232011-07-17 Andreas Schwab <schwab@linux-m68k.org>
18124
0a6a104b
AS
18125 * lread.c (read_integer): Unread even EOF character.
18126 (read1): Likewise. Properly record start position of symbol.
18127
52968808
AS
18128 * lread.c (read1): Read `#:' as empty uninterned symbol if no
18129 symbol character follows.
18130
9e381cdd
PE
181312011-07-17 Paul Eggert <eggert@cs.ucla.edu>
18132
18133 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
18134 This works around a problem with the previous change to Fcopy_file.
18135 Recent glibc declares fchown with __attribute__((warn_unused_result)),
18136 and without this change, GCC might complain about discarding
18137 fchown's return value.
18138
b5641435
JB
181392011-07-16 Juanma Barranquero <lekktu@gmail.com>
18140
18141 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
18142
a8031457
PE
181432011-07-16 Paul Eggert <eggert@cs.ucla.edu>
18144
18145 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
18146
dd889327
LMI
181472011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
18148
750c33f7
LMI
18149 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
18150 it's used from the C level.
18151
dd889327
LMI
18152 * process.c: Use the same condition for POLL_FOR_INPUT in both
18153 keyboard.c and process.c (bug#1858).
18154
87e86684
LM
181552011-07-09 Lawrence Mitchell <wence@gmx.li>
18156
18157 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
18158 (Fgnutls_boot): Use it.
18159
64348f40
AS
181602011-07-15 Andreas Schwab <schwab@linux-m68k.org>
18161
18162 * doc.c (Fsubstitute_command_keys): Revert last change.
18163
1d698799
LMI
181642011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
18165
f863868c
LMI
18166 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
18167 quotes the next character, and doesn't affect other longer
18168 sequences (bug#8935).
18169
1d698799
LMI
18170 * lread.c (syms_of_lread): Clarify that is isn't only
18171 `eval-buffer' and `eval-defun' that's affected by
18172 `lexical-binding' (bug#8460).
18173
aa4b6df6
EZ
181742011-07-15 Eli Zaretskii <eliz@gnu.org>
18175
18176 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 18177 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 18178
5d856da6
PE
181792011-07-14 Paul Eggert <eggert@cs.ucla.edu>
18180
ad6042bb
PE
18181 Fix minor problems found by static checking.
18182 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
18183 (elsz): Now a signed constant, not a size_t var. We prefer signed
18184 types to unsigned, to avoid integer comparison confusion. Without
18185 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
18186 "cannot optimize loop, the loop counter may overflow", a symptom
18187 of the confusion.
f00bbb22 18188 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
18189 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
18190
6468f31c
LMI
181912011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18192
49080b10
LMI
18193 * search.c (Fre_search_backward): Mention `case-fold-search' in
18194 all the re_search_* functions (bug#8138).
18195
6468f31c
LMI
18196 * keyboard.c (Fopen_dribble_file): Document when the file is
18197 closed (bug#8056).
18198
c965adc5
EZ
181992011-07-14 Eli Zaretskii <eliz@gnu.org>
18200
df9733bf
EZ
18201 * bidi.c (bidi_dump_cached_states): Fix format of displaying
18202 bidi_cache_idx.
18203
0bb23927
EZ
18204 Support bidi reordering of display and overlay strings.
18205 * xdisp.c (compute_display_string_pos)
18206 (compute_display_string_end): Accept additional argument STRING.
18207 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
18208 (reseat_to_string): Initialize bidi_it->string.s and
18209 bidi_it->string.schars.
18210 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
18211 NULL (avoids a crash in bidi_paragraph_init).
18212 Initialize itb.string.lstring.
0bb23927
EZ
18213 (init_iterator): Call bidi_init_it only of a valid
18214 buffer position was specified. Initialize paragraph_embedding to
18215 L2R.
18216 (reseat_to_string): Initialize the bidi iterator.
18217 (display_string): If we need to ignore text properties of
18218 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
18219 original value of -1 will not work with bidi.)
18220 (compute_display_string_pos): First arg is now struct
18221 `text_pos *'; all callers changed. Support display properties on
18222 Lisp strings.
18223 (compute_display_string_end): Support display properties on Lisp
18224 strings.
18225 (init_iterator, reseat_1, reseat_to_string): Initialize the
18226 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
18227 when iterating on a string not from display properties).
640c8776
SM
18228 (compute_display_string_pos, compute_display_string_end):
18229 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
18230 arrow keys.
18231 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
18232 base_level_stop; instead, set base_level_stop to BEGV.
18233 Fixes crashes in vertical-motion.
0bb23927
EZ
18234 (next_element_from_buffer): Improve commentary for when
18235 the iterator is before prev_stop.
18236 (init_iterator): Initialize bidi_p from the default value of
18237 bidi-display-reordering, not from buffer-local value. Use the
18238 buffer-local value only if initializing for buffer iteration.
18239 (handle_invisible_prop): Support invisible properties on strings
18240 that are being bidi-reordered.
18241 (set_iterator_to_next): Support bidi reordering of C strings and
18242 Lisp strings.
18243 (next_element_from_string): Support bidi reordering of Lisp
18244 strings.
18245 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
18246 (display_string): Support display of R2L glyph rows.
18247 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
18248 (init_iterator): Don't initialize it->bidi_p for strings
18249 here.
18250 (reseat_to_string): Initialize it->bidi_p for strings here.
18251 (next_element_from_string, next_element_from_c_string)
18252 (next_element_from_buffer): Add xassert's for correspondence
18253 between IT's object being iterated and it->bidi_it.string
18254 structure.
18255 (face_before_or_after_it_pos): Support bidi iteration.
18256 (next_element_from_c_string): Handle the case of the first string
18257 character that is not the first one in the visual order.
18258 (get_visually_first_element): New function, refactored from common
18259 parts of next_element_from_buffer, next_element_from_string, and
18260 next_element_from_c_string.
18261 (tool_bar_lines_needed, redisplay_tool_bar)
18262 (display_menu_bar): Force left-to-right direction. Add a FIXME
18263 comment for making that be controlled by a user option.
18264 (push_it, pop_it): Save and restore the state of the
18265 bidi iterator. Save and restore the bidi_p flag.
18266 (pop_it): Iterate out of display property for string iteration as
18267 well.
18268 (iterate_out_of_display_property): Support iteration over strings.
18269 (handle_single_display_spec): Set up it->bidi_it for iteration
18270 over a display string, and call bidi_init_it.
18271 (handle_single_display_spec, next_overlay_string)
18272 (get_overlay_strings_1, push_display_prop): Set up the bidi
18273 iterator for displaying display or overlay strings.
18274 (forward_to_next_line_start): Don't use the shortcut if
18275 bidi-iterating.
18276 (back_to_previous_visible_line_start): If handle_display_prop
18277 pushed the iterator stack, restore the internal state of the bidi
18278 iterator by calling bidi_pop_it same number of times.
18279 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
18280 and we are bidi-iterating, don't decrement the iterator position;
18281 instead, set the first_elt flag in the bidi iterator, to produce
18282 the same effect.
18283 (reseat_1): Remove redundant setting of string_from_display_prop_p.
18284 (push_display_prop): xassert that we are iterating a buffer.
18285 (push_it, pop_it): Save and restore paragraph_embedding member.
18286 (handle_single_display_spec, next_overlay_string)
18287 (get_overlay_strings_1, reseat_1, reseat_to_string)
18288 (push_display_prop): Set up the `unibyte' member of bidi_it.string
18289 correctly. Don't assume unibyte strings are not bidi-reordered.
18290 (compute_display_string_pos)
18291 (compute_display_string_end): Fix handling the case of C string.
18292 (push_it, pop_it): Save and restore from_disp_prop_p.
18293 (handle_single_display_spec, push_display_prop): Set the
18294 from_disp_prop_p flag.
18295 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
18296 (pop_it): Call iterate_out_of_display_property only if we are
18297 popping after iteration over a string that came from a display
18298 property. Fix a typo in popping stretch info. Add an assertion
18299 for verifying that the iterator position is in sync with the bidi
18300 iterator.
18301 (handle_single_display_spec, get_overlay_strings_1)
18302 (push_display_prop): Fix initialization of paragraph direction for
18303 string when that of the parent object is not yet determined.
18304 (reseat_1): Call bidi_init_it to resync the bidi
18305 iterator with IT's position. (Bug#7616)
18306 (find_row_edges): If ROW->start.pos gives position
18307 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
18308 (handle_stop, back_to_previous_visible_line_start, reseat_1):
18309 Reset the from_disp_prop_p flag.
18310 (SAVE_IT, RESTORE_IT): New macros.
18311 (pos_visible_p, face_before_or_after_it_pos)
18312 (back_to_previous_visible_line_start)
18313 (move_it_in_display_line_to, move_it_in_display_line)
18314 (move_it_to, move_it_vertically_backward, move_it_by_lines)
18315 (try_scrolling, redisplay_window, display_line): Use them when
18316 saving a temporary copy of the iterator and restoring it back.
18317 (back_to_previous_visible_line_start, reseat_1)
18318 (init_iterator): Empty the bidi cache "stack".
18319 (move_it_in_display_line_to): If iterator ended up at
18320 EOL, but we never saw any buffer positions smaller than
18321 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
18322 motion in bidi-reordered lines.
18323 (move_it_in_display_line_to): Record prev_method and prev_pos
18324 immediately before the call to set_iterator_to_next. Fixes cursor
18325 motion in bidi-reordered lines with stretch glyphs and strings
18326 displayed in margins. (Bug#8133) (Bug#8867)
18327 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
18328 TO_CHARPOS.
640c8776
SM
18329 (pos_visible_p): Support positions in bidi-reordered lines.
18330 Save and restore bidi cache.
0bb23927
EZ
18331
18332 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
18333 (bidi_paragraph_info): Delete unused struct.
18334 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
18335 (bidi_cache_start): New variable.
18336 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
18337 to zero.
18338 (bidi_cache_fetch_state, bidi_cache_search)
18339 (bidi_cache_find_level_change, bidi_cache_iterator_state)
18340 (bidi_cache_find, bidi_peek_at_next_level)
18341 (bidi_level_of_next_char, bidi_find_other_level_edge)
18342 (bidi_move_to_visually_next): Compare cache index with
18343 bidi_cache_start rather than with zero.
18344 (bidi_fetch_char): Accept new argument STRING; all callers
18345 changed. Support iteration over a string. Support strings with
18346 display properties. Support unibyte strings. Fix the type of
18347 `len' according to what STRING_CHAR_AND_LENGTH expects.
18348 (bidi_paragraph_init, bidi_resolve_explicit_1)
18349 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
18350 (bidi_level_of_next_char, bidi_move_to_visually_next):
18351 Support iteration over a string.
0bb23927
EZ
18352 (bidi_set_sor_type, bidi_resolve_explicit_1)
18353 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
18354 can now be zero (for strings); special values 0 and -1 were
18355 changed to -1 and -2, respectively.
18356 (bidi_char_at_pos): New function.
18357 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
18358 Call it instead of FETCH_MULTIBYTE_CHAR.
18359 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
18360 initialized to valid values.
18361 (bidi_init_it): Don't initialize charpos and bytepos with invalid
18362 values.
18363 (bidi_level_of_next_char): Allow the sentinel "position" to pass
18364 the test for valid cached positions. Fix the logic for looking up
18365 the sentinel state in the cache. GCPRO the Lisp string we are
18366 iterating.
18367 (bidi_push_it, bidi_pop_it): New functions.
18368 (bidi_initialize): Initialize the bidi cache start stack pointer.
18369 (bidi_cache_ensure_space): New function, refactored from part of
18370 bidi_cache_iterator_state. Don't assume the required size is just
18371 one BIDI_CACHE_CHUNK away.
18372 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
18373 (bidi_count_bytes, bidi_char_at_pos): New functions.
18374 (bidi_cache_search): Don't assume bidi_cache_last_idx is
18375 always valid if bidi_cache_idx is valid.
18376 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
18377 is valid if it's going to be used.
18378 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
18379 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
18380 (bidi_cache_find_level_change, bidi_cache_ensure_space)
18381 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
18382 (bidi_find_other_level_edge, bidi_cache_start_stack):
18383 All variables related to cache indices are now EMACS_INT.
c965adc5 18384
0bb23927
EZ
18385 * dispextern.h (struct bidi_string_data): New structure.
18386 (struct bidi_it): New member `string'. Make flag members be 1-bit
18387 fields, and put them last in the struct.
640c8776
SM
18388 (compute_display_string_pos, compute_display_string_end):
18389 Update prototypes.
0bb23927
EZ
18390 (bidi_push_it, bidi_pop_it): Add prototypes.
18391 (struct iterator_stack_entry): New members bidi_p,
18392 paragraph_embedding, and from_disp_prop_p.
18393 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
18394 (bidi_shelve_cache, bidi_unshelve_cache):
18395 Declare prototypes.
0bb23927
EZ
18396
18397 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
18398 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
18399 and vector-like objects.
18400
18401 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
18402 cache around display iteration.
18403
18404 * window.c (Fwindow_end, window_scroll_pixel_based)
18405 (displayed_window_lines, Frecenter): Save and restore the bidi
18406 cache around display iteration.
18407
3bbd2265
LMI
184082011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
18409
18410 * editfns.c (Fdelete_region): Clarify the use of the named
18411 parameters (bug#6788).
18412
adc47434
MR
184132011-07-14 Martin Rudalics <rudalics@gmx.at>
18414
18415 * indent.c (Fvertical_motion): Set and restore w->pointm when
18416 saving and restoring the window's buffer (Bug#9006).
18417
837c31f8
LMI
184182011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
18419
18420 * editfns.c (Fstring_to_char): Clarify just what is returned
18421 (bug#6576). Text by Eli Zaretskii.
18422
ac389d0c
JB
184232011-07-13 Juanma Barranquero <lekktu@gmail.com>
18424
18425 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
18426
0be0ce47
EZ
184272011-07-13 Eli Zaretskii <eliz@gnu.org>
18428
18429 * buffer.c (mmap_find): Fix a typo.
18430
cd18e7e3
JB
184312011-07-13 Johan Bockgård <bojohan@gnu.org>
18432
18433 Fix execution of x selection hooks.
18434 * xselect.c (Qx_lost_selection_functions)
18435 (Qx_sent_selection_functions): New vars.
18436 (syms_of_xselect): DEFSYM them.
18437 (x_handle_selection_request): Pass Qx_sent_selection_functions
18438 rather than Vx_sent_selection_functions to Frun_hook_with_args.
18439 (x_handle_selection_clear,x_clear_frame_selections):
18440 Pass Qx_lost_selection_functions rather than
18441 Vx_lost_selection_functions to Frun_hook_with_args.
18442
47ea7f44
PE
184432011-07-13 Paul Eggert <eggert@cs.ucla.edu>
18444
ac389d0c 18445 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
18446 The old code sometimes used this field without initializing it.
18447
47ea7f44
PE
18448 * alloc.c (gc_sweep): Don't read past end of array.
18449 In theory, the old code could also have corrupted Emacs internals,
18450 though it'd be very unlikely.
18451
bc985c87
AS
184522011-07-12 Andreas Schwab <schwab@linux-m68k.org>
18453
18454 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 18455 argument. (Bug#4026)
bc985c87 18456
0cf34688
LMI
184572011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
18458
b3dadd76
LMI
18459 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
18460 key" (bug#4257).
18461
0cf34688
LMI
18462 * window.c (Fset_window_start): Doc fix (bug#4199).
18463 (Fset_window_hscroll): Ditto.
18464
270768cd
PE
184652011-07-12 Paul Eggert <eggert@cs.ucla.edu>
18466
077e3dda 18467 Fix minor new problems caught by GCC 4.6.1.
270768cd 18468 * term.c (init_tty): Remove unused local.
490011a6 18469 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 18470 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 18471 not used otherwise.
270768cd 18472
b1f58454
CY
184732011-07-12 Chong Yidong <cyd@stupidchicken.com>
18474
18475 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
18476
22b9578d
LMI
184772011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
18478
6e70ab07
LMI
18479 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
18480 are the mini-buffer and the echo area (bug#3320).
18481
22b9578d
LMI
18482 * term.c (init_tty): Remove support for supdup, c10 and perq
18483 terminals, which are no longer supported (bug#1482).
18484
8974cc9f
JB
184852011-07-10 Johan Bockgård <bojohan@gnu.org>
18486
18487 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
18488
a560d974
JD
184892011-07-10 Jan Djärv <jan.h.d@swipnet.se>
18490
18491 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
18492 for non-popups (Bug#3642).
18493
1dae0f0a
AS
184942011-07-10 Andreas Schwab <schwab@linux-m68k.org>
18495
268c2c36 18496 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 18497 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
18498 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
18499 * cm.c (losecursor): Likewise.
1dae0f0a
AS
18500 * data.c (fmod): Likewise.
18501 * dispnew.c (swap_glyphs_in_rows): Likewise.
18502 * emacs.c (memory_warning_signal): Likewise.
18503 * floatfns.c (float_error): Likewise.
18504 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
18505 (otf_open, font_otf_capability, generate_otf_features)
18506 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
18507 Likewise.
18508 * image.c (pbm_read_file): Likewise.
18509 * indent.c (string_display_width): Likewise.
18510 * intervals.c (check_for_interval, search_for_interval)
18511 (inc_interval_count, count_intervals, root_interval)
18512 (adjust_intervals_for_insertion, make_new_interval): Likewise.
18513 * lread.c (defalias): Likewise.
268c2c36 18514 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
18515 * regex.c (set_image_of_range_1, set_image_of_range)
18516 (regex_grow_registers): Likewise.
18517 * sysdep.c (strerror): Likewise.
18518 * termcap.c (valid_filename_p, tprint, main): Likewise.
18519 * tparam.c (main): Likewise.
18520 * unexhp9k800.c (run_time_remap, save_data_space)
18521 (update_file_ptrs, read_header, write_header, calculate_checksum)
18522 (copy_file, copy_rest, display_header): Likewise.
18523 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
18524 Likewise.
18525 * xdisp.c (check_it): Likewise.
18526 * xfaces.c (register_color, unregister_color, unregister_colors):
18527 Likewise.
18528 * xfns.c (print_fontset_result): Likewise.
18529 * xrdb.c (member, fatal, main): Likewise.
18530
99033785
PE
185312011-07-10 Paul Eggert <eggert@cs.ucla.edu>
18532
18533 Fix minor problems found by static checking (Bug#9031).
18534 * chartab.c (char_table_set_range, map_sub_char_table):
18535 Remove unused locals.
18536 (uniprop_table): Now static.
18537 * composite.c (_work_char): Remove unused static var.
18538
9cb2ac56
JB
185392011-07-09 Juanma Barranquero <lekktu@gmail.com>
18540
18541 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
18542
f25661f0
JD
185432011-07-09 Jan Djärv <jan.h.d@swipnet.se>
18544
18545 * gtkutil.c (qttip_cb): Remove code without function.
18546
8278c4fe
EZ
185472011-07-09 Eli Zaretskii <eliz@gnu.org>
18548
18549 * w32.c (pthread_sigmask): New stub.
18550
1692ae2d 185512011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 18552
8a6ebd58 18553 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
18554 sigprocmask is portable only for single-threaded applications, and
18555 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
18556 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
18557 (LIBES): Use it.
18558 * callproc.c (Fcall_process):
18559 * process.c (create_process):
18560 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
18561 Use pthread_sigmask, not sigprocmask.
123403e4 18562
1b854618
JD
185632011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18564
18565 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
18566 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
18567 wrong (Bug#8591).
18568
3fe4b549
JD
185692011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18570
0ce7e563
JD
18571 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
18572 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
18573 (xg_hide_tooltip): Fix comment.
18574
3fe4b549
JD
18575 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
18576 in registerServicesMenuSendTypes.
18577 (validRequestorForSendType): Don't check ns_return_types.
18578
18579 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
18580 ns_return_type.
18581
5df75e47
JR
185822011-07-08 Jason Rumney <jasonr@gnu.org>
18583
22610910
JR
18584 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
18585 SH_SHOW for hidden windows (Bug#5482).
18586
5df75e47
JR
18587 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
18588 frame struct members of non-existent frames (Bug#6284).
18589
699c10bd
JD
185902011-07-08 Jan Djärv <jan.h.d@swipnet.se>
18591
4393663b
JD
18592 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
18593 variable firstTime not needed on OSX >= 10.6.
18594 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
18595 >= 10.5. Use setKnobProportion, setDoubleValue.
18596
18597 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
18598 (MAC_OS_X_VERSION_10_5): Define if not defined.
18599 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
18600 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
18601 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
18602
18603 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 18604 cString and lossyCString on OSX >= 10.4.
4393663b 18605
58179cce 18606 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
18607 sizeToFit on OSX >= 10.2.
18608
18609 * nsimage.m (allocInitFromFile): Don't use deprecated method
18610 bestRepresentationForDevice on OSX >= 10.6.
18611
18612 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
18613 to avoid warning.
18614
18615 * emacs.c: Declare unexec_init_emacs_zone.
18616
a63e0781
JD
18617 * nsgui.h: Fix compiler warning about gnulib redefining verify.
18618
699c10bd
JD
18619 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
18620
18621 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
18622 on svcsMenu (Bug#8842).
18623
18624 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
18625 ns_return_types.
18626 (Fns_list_services): Just return Qnil on 10.6, code not working there.
18627
18628 * nsterm.m (QUTF8_STRING): Declare.
18629 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
18630 (validRequestorForSendType): Return type is (id).
18631 Change indexOfObjectIdenticalTo to indexOfObject.
18632 Check if we have local selection before returning self (Bug#8842).
18633 (writeSelectionToPasteboard): Put local selection into paste board
18634 if we have a local selection (Bug#8842).
18635 (syms_of_nsterm): DEFSYM QUTF8_STRING.
18636
18637 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
18638 (ns_get_local_selection): Declare.
18639
54e10184
LMI
186402011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
18641
9888ff71
LMI
18642 * keymap.c (describe_map_tree): Don't insert a double newline at
18643 the end of the buffer (bug#1169) and return whether we inserted
18644 something.
18645
54e10184
LMI
18646 * callint.c (Fcall_interactively): Change "reading args" to
18647 "providing args" to try to clarify what it does (bug#1010).
18648
15fa4783
KH
186492011-07-07 Kenichi Handa <handa@m17n.org>
18650
18651 * composite.c (composition_compute_stop_pos): Ignore a static
18652 composition starting before CHARPOS (Bug#8915).
18653
18654 * xdisp.c (handle_composition_prop): Likewise.
18655
a8815b00
EZ
186562011-07-07 Eli Zaretskii <eliz@gnu.org>
18657
18658 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
18659 (Bug#9015)
18660
ef7b981d 186612011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
18662
18663 * character.h (unicode_category_t): New enum type.
18664
18665 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
18666 (Qchar_code_property_table): New variable.
18667 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
18668 (UNIPROP_COMPRESSED_FORM_P): New macros.
18669 (char_table_ascii): Uncompress the compressed values.
18670 (sub_char_table_ref): New arg is_uniprop. Callers changed.
18671 Uncompress the compressed values.
ac389d0c 18672 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
18673 (char_table_ref_and_range): Uncompress the compressed values.
18674 (sub_char_table_set): New arg is_uniprop. Callers changed.
18675 Uncompress the compressed values.
18676 (sub_char_table_set_range): Args changed. Callers changed.
18677 (char_table_set_range): Adjuted for the above change.
18678 (map_sub_char_table): Delete args default_val and parent. Add arg
18679 top. Give decoded values to a Lisp function.
640c8776 18680 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
18681 values to a Lisp function. Gcpro more variables.
18682 (uniprop_table_uncompress)
18683 (uniprop_decode_value_run_length): New functions.
18684 (uniprop_decoder, uniprop_decoder_count): New variables.
18685 (uniprop_get_decoder, uniprop_encode_value_character)
18686 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
18687 New functions.
18688 (uniprop_encoder, uniprop_encoder_count): New variables.
18689 (uniprop_get_encoder, uniprop_table)
18690 (Funicode_property_table_internal, Fget_unicode_property_internal)
18691 (Fput_unicode_property_internal): New functions.
18692 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
18693 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 18694 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
18695 char-code-property-alist.
18696
640c8776 18697 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
18698 Vunicode_category_table.
18699
640c8776 18700 * font.c (font_range): Adjust for the change of
c805dec0
KH
18701 Vunicode_category_table.
18702
76b397fb
DN
187032011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
18704
18705 * m/iris4d.h: Remove file, move contents ...
18706 * s/irix6-5.h: ... here.
18707
22b4128e
PE
187082011-07-06 Paul Eggert <eggert@cs.ucla.edu>
18709
18710 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
18711 * alloc.c (mark_buffer):
18712 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
18713 (clone_per_buffer_values): Don't assume that
22b4128e
PE
18714 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
18715 This isn't true in general, and it's particularly not true
18716 if Emacs is configured with --with-wide-int.
18717 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
18718 New macros, used in the buffer.c change.
18719
869795d6
JD
187202011-07-05 Jan Djärv <jan.h.d@swipnet.se>
18721
18722 * xsettings.c: Use both GConf and GSettings if both are available.
18723 (store_config_changed_event): Add comment.
18724 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
18725 (store_tool_bar_style_changed): New functions.
5e617bc2 18726 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
18727 (struct xsettings): Move font inside HAVE_XFT.
18728 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 18729 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 18730 Move inside HAVE_XFT.
640c8776 18731 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
18732 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
18733 also.
18734 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 18735 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 18736 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
18737 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
18738 (parse_settings): Move check for font inside HAVE_XFT.
18739 (read_settings, apply_xft_settings): Add comment.
18740 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
18741 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
18742 call store_font_name_changed.
18743 (xft_settings_event): Add comment.
18744 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
18745 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
18746 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
18747 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
18748 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
18749 (xsettings_get_system_font, xsettings_get_system_normal_font):
18750 Add comment.
869795d6 18751
d8ed26bd
PE
187522011-07-05 Paul Eggert <eggert@cs.ucla.edu>
18753
18754 Random fixes. E.g., (random) never returned negative values.
18755 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
18756 subseconds part to the entropy, as that's a bit more random.
18757 Prefer signed to unsigned, since the signedness doesn't matter and
18758 in general we prefer signed. When given a limit, use a
18759 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
18760 latter isn't right if USE_2_TAGS_FOR_INTS.
18761 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
18762 not 0..VALMASK. Don't discard "excess" bits that random () returns.
18763
cabf1cac
SM
187642011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
18765
18766 * textprop.c (text_property_stickiness):
18767 Obey Vtext_property_default_nonsticky.
18768 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
18769 * w32fns.c (syms_of_w32fns):
18770 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
18771
6e9b2be9
PE
187722011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18773
18774 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
18775 This is more efficient than Ffile_directory_p and avoids a minor race.
18776
90186c68
LMI
187772011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
18778
7c301272
LMI
18779 * buffer.c (Foverlay_put): Say what the return value is
18780 (bug#7835).
18781
c4f2d8d4
LMI
18782 * fileio.c (barf_or_query_if_file_exists): Check first if the file
18783 is a directory before asking whether to use the file name
18784 (bug#7564).
ad637907
LMI
18785 (barf_or_query_if_file_exists): Make the "File is a directory"
18786 error be more correct.
c4f2d8d4 18787
90186c68
LMI
18788 * fns.c (Frequire): Remove the mention of the .gz files, since
18789 that's installation-specific, but keep the mention of
18790 `get-load-suffixes'.
18791
da64016e
PE
187922011-07-04 Paul Eggert <eggert@cs.ucla.edu>
18793
18794 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
18795 Report string overflow if the output is too long.
18796
7d47b580
JB
187972011-07-04 Juanma Barranquero <lekktu@gmail.com>
18798
a555cb87
JB
18799 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
18800 (syms_of_gnutls): Remove duplicate DEFSYM for
18801 Qgnutls_bootprop_verify_hostname_error, an error for
18802 Qgnutls_bootprop_verify_error (which is no longer used).
18803
7d47b580
JB
18804 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
18805 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
18806 Also (re)move comments that are misplaced or no longer relevant.
18807
1e49bfab
LMI
188082011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18809
18810 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
18811
1485f4c0
CY
188122011-07-03 Chong Yidong <cyd@stupidchicken.com>
18813
18814 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
18815 and background color parameters if they have been changed.
18816
a9ab721e
LMI
188172011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
18818
18819 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18820
cf7cff57
PE
188212011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18822
2e13213d
PE
18823 * xsettings.c (SYSTEM_FONT): Define only when used.
18824 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18825
cf7cff57
PE
18826 * keymap.c (access_keymap_1): Now static.
18827
7a8e04f7
CY
188282011-07-02 Chong Yidong <cyd@stupidchicken.com>
18829
18830 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18831 leave any prefix arg for the up event (Bug#1586).
18832
61352f62
LMI
188332011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18834
69bb1ef7
LMI
18835 * lread.c (syms_of_lread): Mention single symbols defined by
18836 `defvar' or `defconst' (bug#7154).
18837
61352f62 18838 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 18839 (Frequire): Mention get-load-suffixes.
61352f62 18840
28545e04
MR
188412011-07-02 Martin Rudalics <rudalics@gmx.at>
18842
18843 * window.h (window): Remove clone_number slot.
18844 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18845 Remove.
18846 (make_parent_window, make_window, saved_window)
18847 (Fset_window_configuration, save_window_save): Don't deal with
18848 clone numbers.
18849 * buffer.c (Qclone_number): Remove declaration.
18850 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18851
3349e122
SM
188522011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18853
18854 Add multiple inheritance to keymaps.
18855 * keymap.c (Fmake_composed_keymap): New function.
18856 (Fset_keymap_parent): Simplify.
18857 (fix_submap_inheritance): Remove.
18858 (access_keymap_1): New function extracted from access_keymap to handle
18859 embedded parents and handle lists of maps.
18860 (access_keymap): Use it.
18861 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18862 (Fcopy_keymap): Handle embedded parents.
18863 (Fcommand_remapping, define_as_prefix): Simplify.
18864 (Fkey_binding): Simplify.
18865 (syms_of_keymap): Move minibuffer-local-completion-map,
18866 minibuffer-local-filename-completion-map,
18867 minibuffer-local-must-match-map, and
18868 minibuffer-local-filename-must-match-map to Elisp.
18869 (syms_of_keymap): Defsubr make-composed-keymap.
18870 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18871 (parse_menu_item): Trivial simplification.
18872
3279eb87
GM
188732011-07-01 Glenn Morris <rgm@gnu.org>
18874
18875 * Makefile.in (SETTINGS_LIBS): Fix typo.
18876
39cb9e56 188772011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
18878
18879 * coding.c (Fencode_coding_string): Record the last coding system
18880 used, as the function doc string says (bug#8738).
18881
0949d2b6
JD
188822011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18883
18884 * xsettings.c (store_monospaced_changed): Take new font as arg and
18885 check for change against current_mono_font.
18886 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18887 (emacs_settings_constructor, emacs_settings_get_property)
18888 (emacs_settings_set_property, emacs_settings_class_init)
18889 (emacs_settings_init, gsettings_obj): Remove.
18890 (something_changedCB): New function for HAVE_GSETTINGS.
18891 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18892 with value as argument.
18893 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18894 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 18895 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
18896 "changed".
18897
18898 * xgselect.c: Add defined (HAVE_GSETTINGS).
18899 (xgselect_initialize): Ditto.
18900
18901 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18902 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18903 xg_select.
18904
bbc6b304
PE
189052011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18906
18907 * eval.c (struct backtrace): Simplify and port the data structure.
18908 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18909 signed bit field, as this assumption is not portable and it makes
18910 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18911 "char debug_on_exit : 1" as this is not portable either; instead,
18912 use the portable "unsigned int debug_on_exit : 1". Remove unused
18913 member evalargs. Remove obsolete comments about cc bombing out.
18914
9851bfc5
JD
189152011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18916
51bb811f 18917 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
18918 Let HAVE_GSETTINGS override HAVE_GCONF.
18919 (store_monospaced_changed): New function.
18920 (EMACS_SETTINGS): A new type derived from GObject to handle
18921 GSettings notifications.
18922 (emacs_settings_constructor, emacs_settings_get_property)
18923 (emacs_settings_set_property, emacs_settings_class_init):
18924 New functions.
18925 (gsettings_client, gsettings_obj): New variables.
18926 (GSETTINGS_SCHEMA): New define.
18927 (something_changedCB): Call store_monospaced_changed.
18928 (init_gsettings): New function.
18929 (xsettings_initialize): Call init_gsettings.
18930 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18931 to NULL.
18932
640c8776 18933 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
18934 GCONF_CFLAGS/LIBS.
18935
5386012d
MR
189362011-06-29 Martin Rudalics <rudalics@gmx.at>
18937
18938 * window.c (resize_root_window, grow_mini_window)
18939 (shrink_mini_window): Rename Qresize_root_window to
18940 Qwindow_resize_root_window and Qresize_root_window_vertically to
18941 Qwindow_resize_root_window_vertically.
18942
f13e0b08
PE
189432011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18944
18945 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18946
94515237
JB
189472011-06-27 Juanma Barranquero <lekktu@gmail.com>
18948
18949 * makefile.w32-in: Redesign dependencies so they reflect more
18950 clearly which files are directly included by each source file,
18951 and not through other includes.
18952
e43b6e43
MR
189532011-06-27 Martin Rudalics <rudalics@gmx.at>
18954
18955 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18956 (sort_overlays, overlay_strings): When an overlay's clone number
18957 matches the window's clone number process the overlay even if
18958 the overlay's window property doesn't match the current window.
18959
d68443dc
MR
18960 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18961 (Fwindow_hchild): Rename to Fwindow_left_child.
18962 (Fwindow_next): Rename to Fwindow_next_sibling.
18963 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
18964 (resize_window_check): Rename to window_resize_check.
18965 (resize_window_apply): Rename to window_resize_apply.
18966 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18967 (Fdelete_other_windows_internal, resize_frame_windows)
18968 (Fsplit_window_internal, Fdelete_window_internal)
18969 (grow_mini_window, shrink_mini_window)
18970 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 18971
c7e73be5
JD
189722011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18973
18974 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18975 (emacs_fixed_set_min_size): Remove.
18976 (emacs_fixed_new): Take frame as argument.
18977
18978 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18979 (_EmacsFixedPrivate): Remove minwidth/height.
18980 Add struct frame *f.
18981 (emacs_fixed_init): Initialize priv->f.
18982 (get_parent_class, emacs_fixed_set_min_size): Remove.
18983 (emacs_fixed_new): Set priv->f to argument.
18984 (emacs_fixed_get_preferred_width)
18985 (emacs_fixed_get_preferred_height): Use min_width/height from
18986 frames size_hint to set minimum and natural (Bug#8919).
18987 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18988 and use min_width/height from frames size_hint to set
18989 min_width/height (Bug#8919).
18990
18991 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
18992 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18993 Fix indentation.
c7e73be5 18994
cf99dcf8
EZ
189952011-06-26 Eli Zaretskii <eliz@gnu.org>
18996
18997 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18998 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18999 called at ZV.
19000
029529ac
CY
190012011-06-26 Chong Yidong <cyd@stupidchicken.com>
19002
19003 * process.c (wait_reading_process_output): Bypass select if
19004 waiting for a cell while ignoring keyboard input, and input is
19005 pending. Suggested by Jan Djärv (Bug#8869).
19006
7a7ef429
PE
190072011-06-25 Paul Eggert <eggert@cs.ucla.edu>
19008
19009 Use gnulib's dup2 module instead of rolling our own.
19010 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
19011
11fdef7d 190122011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
19013
19014 * dispnew.c (scrolling_window): Before scrolling, turn off a
19015 mouse-highlight in the window being scrolled.
19016
cd3520a4
JB
190172011-06-24 Juanma Barranquero <lekktu@gmail.com>
19018
19019 Move DEFSYM to lisp.h and use everywhere.
19020
19021 * character.h (DEFSYM): Move declaration...
19022 * lisp.h (DEFSYM): ...here.
19023
19024 * gnutls.c:
19025 * minibuf.c:
19026 * w32menu.c:
19027 * w32proc.c:
19028 * w32select.c: Don't include character.h.
19029
19030 * alloc.c (syms_of_alloc):
19031 * buffer.c (syms_of_buffer):
19032 * bytecode.c (syms_of_bytecode):
19033 * callint.c (syms_of_callint):
19034 * casefiddle.c (syms_of_casefiddle):
19035 * casetab.c (init_casetab_once):
19036 * category.c (init_category_once, syms_of_category):
19037 * ccl.c (syms_of_ccl):
19038 * cmds.c (syms_of_cmds):
19039 * composite.c (syms_of_composite):
19040 * dbusbind.c (syms_of_dbusbind):
19041 * dired.c (syms_of_dired):
19042 * dispnew.c (syms_of_display):
19043 * doc.c (syms_of_doc):
19044 * editfns.c (syms_of_editfns):
19045 * emacs.c (syms_of_emacs):
19046 * eval.c (syms_of_eval):
19047 * fileio.c (syms_of_fileio):
19048 * fns.c (syms_of_fns):
19049 * frame.c (syms_of_frame):
19050 * fringe.c (syms_of_fringe):
19051 * insdel.c (syms_of_insdel):
19052 * keymap.c (syms_of_keymap):
19053 * lread.c (init_obarray, syms_of_lread):
19054 * macros.c (syms_of_macros):
19055 * msdos.c (syms_of_msdos):
19056 * print.c (syms_of_print):
19057 * process.c (syms_of_process):
19058 * search.c (syms_of_search):
19059 * sound.c (syms_of_sound):
19060 * syntax.c (init_syntax_once, syms_of_syntax):
19061 * terminal.c (syms_of_terminal):
19062 * textprop.c (syms_of_textprop):
19063 * undo.c (syms_of_undo):
19064 * w32.c (globals_of_w32):
19065 * window.c (syms_of_window):
19066 * xdisp.c (syms_of_xdisp):
19067 * xfaces.c (syms_of_xfaces):
19068 * xfns.c (syms_of_xfns):
19069 * xmenu.c (syms_of_xmenu):
19070 * xsettings.c (syms_of_xsettings):
19071 * xterm.c (syms_of_xterm): Use DEFSYM.
19072
4228cf16
TZ
190732011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
19074
cd3520a4 19075 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 19076
7fcccf1e
PE
190772011-06-23 Paul Eggert <eggert@cs.ucla.edu>
19078
7efb4e0e
PE
19079 Integer and buffer overflow fixes (Bug#8873).
19080
ff5844ad
PE
19081 * print.c (printchar, strout): Check for string overflow.
19082 (PRINTPREPARE, printchar, strout):
19083 Don't set size unless allocation succeeds.
19084
90532f02
PE
19085 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
19086 for sizes. Check for string overflow more accurately.
19087 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
19088
6d84508d
PE
19089 * macros.c: Integer and buffer overflow fixes.
19090 * keyboard.h (struct keyboard.kbd_macro_bufsize):
19091 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
19092 Use ptrdiff_t, not int, for sizes.
19093 Don't increment bufsize until after realloc succeeds.
19094 Check for size-calculation overflow.
19095 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
19096
437b2cb4
PE
19097 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
19098
8b9ac8b4
PE
19099 * lread.c: Integer overflow fixes.
19100 (read_integer): Radix is now EMACS_INT, not int,
19101 to improve quality of diagnostics for out-of-range radices.
19102 Calculate buffer size correctly for out-of-range radices.
19103 (read1): Check for integer overflow in radices, and in
19104 read-circle numbers.
82cb60d3
PE
19105 (read_escape): Avoid int overflow.
19106 (Fload, openp, read_buffer_size, read1)
19107 (substitute_object_recurse, read_vector, read_list, map_obarray):
19108 Use ptrdiff_t, not int, for sizes.
19109 (read1): Use EMACS_INT, not int, for sizes.
20270765 19110 Check for size overflow.
8b9ac8b4 19111
7fcccf1e
PE
19112 * image.c (cache_image): Check for size arithmetic overflow.
19113
bfbbd7e7
PE
19114 * lread.c: Integer overflow issues.
19115 (saved_doc_string_size, saved_doc_string_length)
19116 (prev_saved_doc_string_size, prev_saved_doc_string_length):
19117 Now ptrdiff_t, not int.
19118 (read1): Don't assume doc string length fits in int. Check for
19119 out-of-range doc string lengths.
19120 (read_list): Don't assume file position fits in int.
39019e54 19121 (read_escape): Check for hex character overflow.
bfbbd7e7 19122
4e323265
LL
191232011-06-22 Leo Liu <sdl.web@gmail.com>
19124
19125 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
19126 Move to minibuffer.el.
19127
85fece3e
PE
191282011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19129
20b84ce9 19130 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
19131 The following patches are for when GLYPH_DEBUG && !XASSERT.
19132 * dispextern.h (trace_redisplay_p, dump_glyph_string):
19133 * dispnew.c (flush_stdout):
19134 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
19135 Mark as externally visible.
19136 * dispnew.c (check_window_matrix_pointers): Now static.
19137 * dispnew.c (window_to_frame_vpos):
19138 * xfns.c (unwind_create_frame):
19139 * xterm.c (x_check_font): Remove unused local.
19140 * scroll.c (CHECK_BOUNDS):
19141 * xfaces.c (cache_fache): Rename local to avoid shadowing.
19142 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
19143 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
19144 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
19145 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
19146 Now static.
19147 (debug_method_add): Use va_list and vsprintf rather than relying
19148 on undefined behavior with wrong number of arguments.
19149 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
19150 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
19151 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
19152 since we're not interested in debugging glyphs with old libraries.
19153 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
19154 GCC 4.6.0's static checking.
19155
0766b489
PE
191562011-06-22 Paul Eggert <eggert@cs.ucla.edu>
19157
31fd4b32
PE
19158 Integer overflow and signedness fixes (Bug#8873).
19159 A few related buffer overrun fixes, too.
19160
b79e8648
PE
19161 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
19162
0766b489
PE
19163 * dispextern.h (struct face.stipple):
19164 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
19165 (x_bitmap_mask, x_allocate_bitmap_record)
19166 (x_create_bitmap_from_data, x_create_bitmap_from_file)
19167 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
19168 (x_create_bitmap_from_xpm_data):
19169 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
19170 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
19171 (.bitmaps_last):
19172 * xfaces.c (load_pixmap):
19173 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
19174 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
19175 (.bitmaps_last, struct x_output.icon_bitmap):
19176 Use ptrdiff_t, not int, for bitmap indexes.
19177 (x_allocate_bitmap_record): Check for size overflow.
19178 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
19179
b081724f
PE
19180 Use ptrdiff_t, not int, for overlay counts.
19181 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
19182 * editfns.c (overlays_around, get_pos_property):
19183 * textprop.c (get_char_property_and_overlay):
19184 * xdisp.c (next_overlay_change, note_mouse_highlight):
19185 * xfaces.c (face_at_buffer_position):
21514da7
PE
19186 * buffer.c (OVERLAY_COUNT_MAX): New macro.
19187 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
19188 (Fnext_overlay_change, Fprevious_overlay_change)
19189 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 19190 Use ptrdiff_t, not int, for sizes.
21514da7 19191 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 19192
3de73e5e
PE
19193 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
19194
2606c57b
PE
19195 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
19196 (x_session_initialize): Do not assume string length fits in int.
19197
aaafe47a
PE
19198 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
19199 This is unlikely, but can occur if DPI is outlandish.
19200
2674ddc8 19201 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
19202 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
19203
28154962
PE
19204 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
19205 * xrdb.c (magic_file_p, search_magic_path):
19206 Omit last arg SUFFIX; it was always 0. All callers changed.
19207 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
19208
7de51af5
PE
19209 * xfont.c (xfont_match): Avoid need for strlen.
19210
25ed6cc3
PE
19211 * xfns.c: Don't assume strlen fits in int.
19212 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
19213
4eab31dd
PE
19214 * xdisp.c (message_log_check_duplicate): Return intmax_t,
19215 not unsigned long, as we prefer signed integers. All callers changed.
19216 Detect integer overflow in repeat count.
19217 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 19218 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 19219
171e2a58
PE
19220 * termcap.c: Don't assume sizes fit in int and never overflow.
19221 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
19222 (gobble_line): Check for size-calculation overflow.
19223
ad39faca 19224 * minibuf.c (Fread_buffer):
6e5bb2dc 19225 * lread.c (intern, intern_c_string):
74ca2eb3
PE
19226 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
19227 Don't assume string length fits in int.
19228
52c61c22 19229 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
19230 * gtkutil.c (style_changed_cb): Avoid need for strlen.
19231
b5b8c9e5
PE
19232 * font.c: Don't assume string length fits in int.
19233 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
19234 Use ptrdiff_t, not int.
ccd6111c
PE
19235 (font_intern_prop): Don't assume string length fits in int.
19236 Don't assume integer property fits in fixnum.
19237 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 19238
882f0d81 19239 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 19240 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
19241 Reformulate so as not to need the command string.
19242 Invoke gzip -cd rather than gunzip, as it's more portable.
19243 (lock_info_type, lock_file_1, lock_file):
19244 Don't assume pid_t and time_t fit in unsigned long.
19245 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
19246 (current_lock_owner): Prefer signed type for sizes.
19247 Use memcpy, not strncpy, where memcpy is what is really wanted.
19248 Don't assume (via atoi) that time_t and pid_t fit in int.
19249 Check for time_t and/or pid_t out of range, e.g., via a network share.
19250 Don't alloca where an auto var works fine.
19251
93f4cf88
PE
19252 * fileio.c: Fix some integer overflow issues.
19253 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
19254 Don't assume string length fits in int.
19255 (directory_file_name): Don't assume string length fits in long.
19256 (make_temp_name): Don't assume pid fits in int, or that its print
19257 length is less than 20.
19258
f3e92b69
PE
19259 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
19260
1bfdaf10
PE
19261 * coding.c (make_subsidiaries): Don't assume string length fits in int.
19262
35016e9a
PE
19263 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
19264
3d1e65a1
PE
19265 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
19266 We prefer signed integers, even for size calculations.
19267
0b963a93
PE
19268 * emacs.c: Don't assume string length fits in 'int'.
19269 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
19270 (main): Don't invoke strlen when not needed.
19271
573f4b54
PE
19272 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
19273 (XD_DEBUG_MESSAGE): Don't waste a byte.
19274
989f33ba
PE
19275 * callproc.c (getenv_internal_1, getenv_internal)
19276 (Fgetenv_internal):
965d34eb
PE
19277 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
19278
e4d29b33
PE
19279 * lread.c (invalid_syntax): Omit length argument.
19280 All uses changed. This doesn't fix a bug, but it simplifies the
19281 code away from its former Hollerith-constant appearance, and it's
19282 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 19283 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 19284
eb49b136
PE
19285 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
19286 This didn't break anything, but it didn't help either.
19287 It's confusing to put a bogus integer in a place where the actual
19288 value does not matter.
9f62aeb1 19289 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 19290 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 19291
15375a22
PE
19292 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
19293 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
19294 implementation.
b61cc01c
PE
19295 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
19296 We prefer signed types, and the value cannot exceed the EMACS_INT
19297 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
19298 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
19299 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
19300 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 19301
53b2623d
PE
19302 * indent.c (sane_tab_width): New function.
19303 (current_column, scan_for_column, Findent_to, position_indentation)
19304 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 19305 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 19306
51cab52b 19307 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 19308
f2ed8a70
PE
19309 * lisp.h (lint_assume): New macro.
19310 * composite.c (composition_gstring_put_cache):
19311 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
19312
abe80cc6
PE
19313 * editfns.c, insdel.c:
19314 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 19315
b02c740e
PE
19316 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
19317
ebc96716
PE
19318 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
19319
b4e50fa0 19320 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 19321 Use much-faster test for byte-length change.
311d5d7c 19322 Don't assume string byte-length fits in 'int'.
a4cf38e4 19323 Check that character arg fits in 'int'.
85461888 19324 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 19325
c0c1ee9f
PE
19326 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
19327
a498d7f4
PE
19328 * fns.c (concat): Catch string overflow earlier.
19329 Do not rely on integer wraparound.
19330
51cab52b
PE
19331 * dispextern.h (struct it.overlay_strings_charpos)
19332 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
19333 * xdisp.c (forward_to_next_line_start)
19334 (back_to_previous_visible_line_start)
19335 (reseat_at_next_visible_line_start, next_element_from_buffer):
19336 Don't arbitrarily truncate the value of 'selective' to int.
19337
76031fad
PE
19338 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
19339
5eb55db9
PE
19340 * composite.c: Don't truncate sizes to 'int'.
19341 (composition_gstring_p, composition_reseat_it)
19342 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
19343 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
19344 not EMACS_UINT, for indexes.
5eb55db9 19345
0703a717
PE
19346 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
19347
d6202519
PE
19348 * buffer.c: Include <verify.h>.
19349 (struct sortvec.priority, struct sortstr.priority):
8961a454 19350 Now EMACS_INT, not int.
c20998a7 19351 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
19352 (struct sortstr.size, record_overlay_string)
19353 (struct sortstrlist.size, struct sortlist.used):
19354 Don't truncate size to int.
19355 (record_overlay_string): Check for size-calculation overflow.
d6202519 19356 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 19357
d5a19415
JM
193582011-06-22 Jim Meyering <meyering@redhat.com>
19359
029529ac 19360 Don't leak an XBM-image-sized buffer
d5a19415
JM
19361 * image.c (xbm_load): Free the image buffer after using it.
19362
a9041e6c
PE
193632011-06-21 Paul Eggert <eggert@cs.ucla.edu>
19364
19365 Port to Sun C.
19366 * composite.c (find_automatic_composition): Omit needless 'return 0;'
19367 that Sun C diagnosed.
19368 * fns.c (secure_hash): Fix pointer signedness issue.
19369 * intervals.c (static_offset_intervals): New function.
19370 (offset_intervals): Use it.
19371
7f3f739f
LL
193722011-06-21 Leo Liu <sdl.web@gmail.com>
19373
19374 * deps.mk (fns.o):
19375 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
19376 sha512.h.
19377
19378 * fns.c (secure_hash): Rename from crypto_hash_function and change
19379 the first arg to accept symbols.
5b66d427 19380 (Fsecure_hash): New primitive.
7f3f739f
LL
19381 (syms_of_fns): New symbols.
19382
76147d94
DD
193832011-06-20 Deniz Dogan <deniz@dogan.se>
19384
19385 * process.c (Fset_process_buffer): Clarify return value in
19386 docstring.
19387
7d7d0045
CY
193882011-06-18 Chong Yidong <cyd@stupidchicken.com>
19389
19390 * dispnew.c (add_window_display_history): Use BVAR.
19391
19392 * xdisp.c (debug_method_add): Use BVAR.
19393 (check_window_end, dump_glyph_matrix, dump_glyph)
19394 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
19395
19396 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
19397 Likewise.
19398
19399 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
19400 check till after the cache is created in init_frame_faces.
19401
ff2bc410
SM
194022011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
19403
19404 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
19405
28177add
PE
194062011-06-16 Paul Eggert <eggert@cs.ucla.edu>
19407
dd3482fe
PE
19408 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
19409 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
19410 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
19411
393d71f3 19412 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
19413 * fileio.c (Finsert_file_contents):
19414 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
19415 Remove the old (too-loose) buffer overflow checks.
19416 They weren't needed, since make_gap checks for buffer overflow.
19417 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
19418 The old code merely checked for Emacs fixnum overflow, and relied
19419 on undefined (wraparound) behavior. The new code avoids undefined
19420 behavior, and also checks for ptrdiff_t and/or size_t overflow.
19421
2e6813b0 19422 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
19423 Tune. Don't use wider integers than needed. Don't use alloca.
19424 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 19425
599a9e4f
PE
19426 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
19427
99561444
PE
19428 * insdel.c, lisp.h (buffer_overflow): New function.
19429 (insert_from_buffer_1, replace_range, replace_range_2):
19430 * insdel.c (make_gap_larger):
19431 * editfns.c (Finsert_char):
19432 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
19433
28177add
PE
19434 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
19435
e69dafad
PE
194362011-06-15 Paul Eggert <eggert@cs.ucla.edu>
19437
4baa020d 19438 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 19439
b1c46f02
PE
19440 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
19441 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
19442
e69dafad
PE
19443 * fileio.c: Don't assume EMACS_INT fits in off_t.
19444 (emacs_lseek): New static function.
19445 (Finsert_file_contents, Fwrite_region): Use it.
19446 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
19447
566684ea
PE
19448 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
19449
e6966cd6
PE
19450 * fns.c: Don't overflow int when computing a list length.
19451 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
19452 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
19453 truncation on 64-bit hosts. Check for QUIT every
19454 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
19455 faster and is responsive enough.
19456 (Flength): Report an error instead of overflowing an integer.
19457 (Fsafe_length): Return a float if the value is not representable
19458 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 19459 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 19460 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 19461
dd0b0efb
PE
19462 * alloc.c: Check that resized vectors' lengths fit in fixnums.
19463 (header_size, word_size): New constants.
19464 (allocate_vectorlike): Don't check size overflow here.
19465 (allocate_vector): Check it here instead, since this is the only
19466 caller of allocate_vectorlike that could cause overflow.
19467 Check that the new vector's length is representable as a fixnum.
19468
86fe5cfe
PE
19469 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
19470 The previous code was bogus. For example, next_almost_prime (32)
19471 returned 39, which is undesirable as it is a multiple of 3; and
19472 next_almost_prime (24) returned 25, which is a multiple of 5 so
19473 why was the code bothering to check for multiples of 7?
19474
80e88859
PE
19475 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
19476
4a2f0ad6
PE
19477 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
19478
f66c7cf8
PE
19479 Variadic C functions now count arguments with ptrdiff_t.
19480 This partly undoes my 2011-03-30 change, which replaced int with size_t.
19481 Back then I didn't know that the Emacs coding style prefers signed int.
19482 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
19483 were being counted with int, which may truncate counts on 64-bit
19484 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
19485 * lisp.h (struct Lisp_Subr.function.aMANY)
19486 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
19487 Arg counts are now ptrdiff_t, not size_t.
19488 All variadic functions and their callers changed accordingly.
19489 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
19490 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
19491 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
19492 * callint.c (Fcall_interactively): Check arg count for overflow,
19493 to avoid potential buffer overrun. Use signed char, not 'int',
19494 for 'varies' array, so that we needn't bother to check its size
19495 calculation for overflow.
19496 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
19497 * eval.c (apply_lambda):
19498 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
19499 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
19500 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
19501
a1759b76
PE
19502 * callint.c (Fcall_interactively): Don't use index var as event count.
19503
d96be9fc
PE
19504 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
19505 * mem-limits.h (SIZE): Remove; no longer used.
19506
a690a978 19507 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 19508
578c21e6
PE
19509 Remove unnecessary casts.
19510 * xterm.c (x_term_init):
19511 * xfns.c (x_set_border_pixel):
19512 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
19513 These aren't needed now that we assume ANSI C.
19514
96f53c6c
PE
19515 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
19516 It's more likely to cause problems (due to unsigned overflow)
19517 than to cure them.
19518
83c77d31
PE
19519 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
19520
ee2079f1
PE
19521 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
19522
6da65536
PE
19523 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
19524
7147c4a4
PE
19525 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
19526
193e32d9
PE
19527 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
19528
e5533da6
PE
19529 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
19530
9910e595
PE
19531 GLYPH_CODE_FACE returns EMACS_INT, not int.
19532 * dispextern.h (merge_faces):
19533 * xfaces.c (merge_faces):
01103c44
PE
19534 * xdisp.c (get_next_display_element, next_element_from_display_vector):
19535 Don't assume EMACS_INT fits in int.
9910e595 19536
2638320e
PE
19537 * character.h (CHAR_VALID_P): Remove unused parameter.
19538 * fontset.c, lisp.h, xdisp.c: All uses changed.
19539
045eb8d9
PE
19540 * editfns.c (Ftranslate_region_internal): Omit redundant test.
19541
c1f134b5
PE
19542 * fns.c (concat): Minor tuning based on overflow analysis.
19543 This doesn't fix any bugs. Use int to hold character, instead
19544 of constantly refetching from Emacs object. Use XFASTINT, not
19545 XINT, for value known to be a character. Don't bother comparing
19546 a single byte to 0400, as it's always less.
19547
395fcb93 19548 * floatfns.c (Fexpt):
327eeec8
PE
19549 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
19550
abbd3d23
PE
19551 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
19552 for characters.
19553
684a03ef
PE
19554 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
19555
0fed43f3
PE
19556 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
19557 Without this fix, on a 64-bit host (aset S 0 4294967386) would
19558 incorrectly succeed when S was a string, because 4294967386 was
19559 truncated before it was used.
19560
8fd02eb7
PE
19561 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
19562 Otherwise, an out-of-range integer could cause undefined behavior
19563 on a 64-bit host.
19564
f8c86b69
PE
19565 * composite.c: Use int, not EMACS_INT, for characters.
19566 (fill_gstring_body, composition_compute_stop_pos): Use int, not
19567 EMACS_INT, for values that are known to be in character range.
19568 This doesn't fix any bugs but is the usual style inside Emacs and
19569 may generate better code on 32-bit machines.
19570
34206dd2
PE
19571 Make sure a 64-bit char is never passed to ENCODE_CHAR.
19572 This is for reasons similar to the recent CHAR_STRING fix.
19573 * charset.c (Fencode_char): Check that character arg is actually
19574 a character. Pass an int to ENCODE_CHAR.
19575 * charset.h (ENCODE_CHAR): Verify that the character argument is no
19576 wider than 'int', as a compile-time check to prevent future regressions
19577 in this area.
19578
c5958d4c 19579 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
19580
19581 Make sure a 64-bit char is never passed to CHAR_STRING.
19582 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
19583 by silently ignoring the top 32 bits, allowing some values
19584 that were far too large to be valid characters.
19585 * character.h: Include <verify.h>.
19586 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
19587 arguments are no wider than unsigned, as a compile-time check
19588 to prevent future regressions in this area.
19589 * data.c (Faset):
01103c44 19590 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
19591 (Fsubst_char_in_region):
19592 * fns.c (concat):
19593 * xdisp.c (decode_mode_spec_coding):
19594 Adjust to CHAR_STRING's new requirement.
19595 * editfns.c (Finsert_char, Fsubst_char_in_region):
19596 * fns.c (concat): Check that character args are actually
19597 characters. Without this test, these functions did the wrong
19598 thing with wildly out-of-range values on 64-bit hosts.
19599
d37ca623
PE
19600 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
19601 These casts should not be needed on 32-bit hosts, either.
19602 * keyboard.c (read_char):
19603 * lread.c (Fload): Remove casts to unsigned.
19604
ea204efb
PE
19605 * lisp.h (UNSIGNED_CMP): New macro.
19606 This fixes comparison bugs on 64-bit hosts.
19607 (ASCII_CHAR_P): Use it.
19608 * casefiddle.c (casify_object):
01103c44 19609 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
19610 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
19611 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
19612 * dispextern.h (FACE_FROM_ID):
19613 * keyboard.c (read_char): Use UNSIGNED_CMP.
19614
41cb286c
PE
19615 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
19616 not to EMACS_INT, to avoid GCC warning.
19617
4a1b9832
PE
19618 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
19619
55daad71
PE
19620 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
19621 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
19622 isn't needed on 32-bit machines.
8f95c75c 19623
01103c44
PE
19624 * buffer.c (Fgenerate_new_buffer_name):
19625 Use EMACS_INT for count, not int.
0ceccced 19626 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
19627
19628 * data.c (Qcompiled_function): Now static.
19629
c6f072e7
PE
19630 * window.c (window_body_lines): Now static.
19631
20ce5912
PE
19632 * image.c (gif_load): Rename local to avoid shadowing.
19633
9c4c5f81
PE
19634 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
19635 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
19636 * alloc.c (make_save_value): Integer argument is now of type
19637 ptrdiff_t, not int.
19638 (mark_object): Use ptrdiff_t, not int.
19639 * lisp.h (pD): New macro.
19640 * print.c (print_object): Use it.
19641
c0c5c8ae
PE
19642 * alloc.c: Use EMACS_INT, not int, to count objects.
19643 (total_conses, total_markers, total_symbols, total_vector_size)
19644 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
19645 (total_free_floats, total_floats, total_free_intervals)
19646 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
19647 Now EMACS_INT, not int. All uses changed.
19648 (Fgarbage_collect): Compute overall total using a double, so that
19649 integer overflow is less likely to be a problem. Check for overflow
19650 when converting back to an integer.
5a25e253
PE
19651 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
19652 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
19653 These were 'int' variables that could overflow on 64-bit hosts;
19654 they were never used, so remove them instead of repairing them.
211a0b2a 19655 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
19656 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
19657 Previously, this ceilinged at INT_MAX, but that doesn't work on
19658 64-bit machines.
e46bb31a 19659 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 19660
c78baabf 19661 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 19662 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
19663 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
19664 when a (possibly-narrower) signed value would do just as well.
19665 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 19666
c9d624c6
PE
19667 * alloc.c: Catch some string size overflows that we were missing.
19668 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
19669 for convenience in STRING_BYTES_MAX.
19670 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
19671 The definition here is exact; the one in lisp.h was approximate.
19672 (allocate_string_data): Check for string overflow. This catches
19673 some instances we weren't catching before. Also, it catches
19674 size_t overflow on (unusual) hosts where SIZE_MAX <= min
19675 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
19676 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 19677
c9d624c6
PE
19678 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
19679 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 19680 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 19681
353032ce
PE
19682 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
19683
2bccce07
PE
19684 * alloc.c (Fmake_string): Check for out-of-range init.
19685
0ac30604
SM
196862011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
19687
19688 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
19689
c195f2de
JD
196902011-06-14 Jan Djärv <jan.h.d@swipnet.se>
19691
19692 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
19693 xg_get_default_scrollbar_width.
19694
19695 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
19696 (int_gtk_range_get_value): Move to the scroll bar part of the file.
19697 (style_changed_cb): Call update_theme_scrollbar_width and call
19698 x_set_scroll_bar_default_width and xg_frame_set_char_size for
19699 all frames (Bug#8505).
19700 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
19701 Call gtk_window_set_resizable if HAVE_GTK3.
19702 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
19703 and height if HAVE_GTK3 (Bug#8505).
19704 (scroll_bar_width_for_theme): New variable.
19705 (update_theme_scrollbar_width): New function.
19706 (xg_get_default_scrollbar_width): Move code to
19707 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
19708 (xg_initialize): Call update_theme_scrollbar_width.
19709
19710 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
19711
19712 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
19713
e10ac9f1
MR
197142011-06-12 Martin Rudalics <rudalics@gmx.at>
19715
19716 * frame.c (make_frame): Call other_buffer_safely instead of
19717 other_buffer.
19718
19719 * window.c (temp_output_buffer_show): Call display_buffer with
19720 second argument Vtemp_buffer_show_specifiers and reset latter
19721 immediately after the call.
19722 (Vtemp_buffer_show_specifiers): New variable.
19723 (auto_window_vscroll_p, next_screen_context_lines)
19724 (Vscroll_preserve_screen_position): Remove leading asterisks from
19725 doc-strings.
19726
2d3c217e 197272011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 19728
7b7f97e8 19729 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
19730 * buffer.c (Qclone_number): Remove for now, as it's unused.
19731 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
19732 (record_buffer): Remove unused local.
19733 * frame.c (other_visible_frames, frame_buffer_list): Now static.
19734 (set_frame_buffer_list): Remove; unused.
19735 * frame.h (other_visible_frames): Remove decl.
19736 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
19737 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
19738 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
19739 if HAVE_GPM.
19740 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
19741 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
19742 Define only if HAVE_GPM.
19743 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
19744 (update_hints_inhibit): Remove; never set. All uses removed.
19745 * widgetprv.h (emacsFrameClassRec): Remove decl.
19746 * window.c (delete_deletable_window): Now returns void, since it
19747 wasn't returning anything.
19748 (compare_window_configurations): Remove unused locals.
19749 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
19750 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
19751 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
19752 the same widths as pointers. This follows up on the 2011-05-06 patch.
19753 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
19754 * xterm.h: Likewise.
19755 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
19756
1384b89e
JB
197572011-06-12 Juanma Barranquero <lekktu@gmail.com>
19758
19759 * makefile.w32-in: Update dependencies.
19760 (LISP_H): Add lib/intprops.h.
19761
1100a63c
CY
197622011-06-11 Chong Yidong <cyd@stupidchicken.com>
19763
19764 * image.c (gif_load): Add animation frame delay to the metadata.
19765 (syms_of_image): Use DEFSYM. New symbol `delay'.
19766
6198ccd0
MR
197672011-06-11 Martin Rudalics <rudalics@gmx.at>
19768
19769 * window.c (delete_deletable_window): Re-add.
19770 (Fset_window_configuration): Rewrite to handle dead buffers and
19771 consequently deletable windows.
19772 (window_tree, Fwindow_tree): Remove. Supply functionality in
19773 window.el.
19774 (compare_window_configurations): Simplify code.
19775
b6e3633c
AS
197762011-06-11 Andreas Schwab <schwab@linux-m68k.org>
19777
1ab0dee5
AS
19778 * image.c (imagemagick_load_image): Fix type mismatch.
19779 (Fimagemagick_types): Likewise.
19780
b6e3633c
AS
19781 * window.h (replace_buffer_in_windows): Declare.
19782
9397e56f
MR
197832011-06-11 Martin Rudalics <rudalics@gmx.at>
19784
19785 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
19786 Qclone_number. Remove external declaration of Qdelete_window.
19787 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
19788 code.
640c8776
SM
19789 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
19790 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
19791 (Fother_buffer): Rewrite doc-string. Major rewrite for new
19792 buffer list implementation.
19793 (other_buffer_safely): New function.
19794 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
19795 calls to replace_buffer_in_windows and
19796 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
19797 if allowed.
19798 (record_buffer): Inhibit quitting and rewrite using quittable
19799 functions. Run Qbuffer_list_update_hook if allowed.
19800 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
19801 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
19802 Move switch-to-buffer to window.el.
9397e56f
MR
19803 (bury-buffer): Move to window.el.
19804 (Vbuffer_list_update_hook): New variable.
19805
19806 * lisp.h (other_buffer_safely): Add prototype in buffer.c
19807 section.
19808
19809 * window.h (resize_frame_windows): Move up in code.
19810 (Fwindow_frame): Remove EXFUN.
19811 (replace_buffer_in_all_windows): Remove prototype.
19812 (replace_buffer_in_windows_safely): Add prototype.
19813
19814 * window.c: Declare Qdelete_window static again. Move down
19815 declaration of select_count.
19816 (Fnext_window, Fprevious_window): Rewrite doc-strings.
19817 (Fother_window): Move to window.el.
19818 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
19819 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19820 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19821 window.el.
19822 (replace_buffer_in_windows): Implement by calling
19823 Qreplace_buffer_in_windows.
19824 (replace_buffer_in_all_windows): Remove with some functionality
19825 moved into replace_buffer_in_windows_safely.
19826 (replace_buffer_in_windows_safely): New function.
19827 (select_window_norecord, select_frame_norecord): Move in front
19828 of run_window_configuration_change_hook. Remove now obsolete
19829 declarations.
640c8776
SM
19830 (Fset_window_buffer): Rewrite doc-string.
19831 Call Qrecord_window_buffer.
9397e56f
MR
19832 (keys_of_window): Move binding for other-window to window.el.
19833
b50691aa
CY
198342011-06-11 Chong Yidong <cyd@stupidchicken.com>
19835
19836 * dispextern.h (struct image): Replace data member, whose int_val
19837 and ptr_val fields were not used by anything, with a single
19838 lisp_val object.
19839
19840 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19841 (gif_clear_image, gif_load, imagemagick_load_image)
19842 (gs_clear_image, gs_load): Callers changed.
19843
3f754b86
PE
198442011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19845
cca69397
PE
19846 * buffer.h: Include <time.h>, for time_t.
19847 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19848
109e28d0
PE
19849 Fix minor problems found by static checking.
19850
60737f02
PE
19851 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19852
4b66faf3
PE
19853 Make identifiers static if they are not used in other modules.
19854 * data.c (Qcompiled_function, Qframe, Qvector):
19855 * image.c (QimageMagick, Qsvg):
19856 * minibuf.c (Qmetadata):
19857 * window.c (resize_window_check, resize_root_window): Now static.
19858 * window.h (resize_window_check, resize_root_window): Remove decls.
19859
109e28d0
PE
19860 * window.c (window_deletion_count, delete_deletable_window):
19861 Remove; unused.
46a4ce9e
PE
19862 (window_body_lines): Now static.
19863 (Fdelete_other_windows_internal): Mark vars as initialized.
19864 Make sure 'resize_failed' is initialized.
19865 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19866 (resize_window_apply): Remove unused local.
19867 * window.h (delete_deletable_window): Remove decl.
19868
109e28d0 19869 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
19870 (imagemagick_load_image): Fix pointer signedness problem by changing
19871 last arg from unsigned char * to char *. All uses changed.
19872 Also, fix a local for similar reasons.
19873 Remove unused locals. Remove locals to avoid shadowing.
19874 (fn_rsvg_handle_free): Remove; unused.
19875 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 19876 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 19877
3f754b86
PE
19878 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19879
2547adb1
CY
198802011-06-10 Chong Yidong <cyd@stupidchicken.com>
19881
19882 * image.c (gif_load): Fix omitted cast error introduced by
19883 2011-06-06 change.
19884
2c8e37d4
MR
198852011-06-10 Martin Rudalics <rudalics@gmx.at>
19886
19887 * window.h (resize_proportionally, orig_total_lines)
19888 (orig_top_line): Remove from window structure.
19889 (set_window_height, set_window_width, change_window_heights)
19890 (Fdelete_window): Remove prototypes.
19891 (resize_frame_windows): Remove duplicate declaration.
19892
440a42e3
EZ
198932011-06-10 Eli Zaretskii <eliz@gnu.org>
19894
19895 * window.h (resize_frame_windows, resize_window_check)
19896 (delete_deletable_window, resize_root_window)
19897 (resize_frame_windows): Declare prototypes.
19898
19899 * window.c (resize_window_apply): Make definition be "static" to
19900 match the prototype.
19901
562dd5e9
MR
199022011-06-10 Martin Rudalics <rudalics@gmx.at>
19903
19904 * window.c: Remove declarations of Qwindow_size_fixed,
19905 window_min_size_1, window_min_size_2, window_min_size,
19906 size_window, window_fixed_size_p, enlarge_window, delete_window.
19907 Remove static from declaration of Qdelete_window, it's
19908 temporarily needed by Fbury_buffer.
19909 (replace_window): Don't assign orig_top_line and
19910 orig_total_lines.
19911 (Fdelete_window, delete_window): Remove. Window deletion is
19912 handled by window.el.
640c8776
SM
19913 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19914 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
19915 (Fdelete_other_windows): Remove. Deleting other windows is
19916 handled by window.el.
19917 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19918 handled in window.el.
19919 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19920 Window minimum sizes are handled in window.el.
19921 (shrink_windows, size_window, set_window_height)
19922 (set_window_width, change_window_heights, window_height)
19923 (window_width, CURBEG, CURSIZE, enlarge_window)
19924 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19925 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19926 handled in window.el.
19927 (make_dummy_parent): Rename to make_parent_window and give it a
19928 second argument horflag.
19929 (make_window): Don't set resize_proportionally any more.
19930 (Fsplit_window): Remove. Windows are split in window.el.
19931 (save_restore_action, save_restore_orig_size)
19932 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19933 Resize mini windows in window.el.
19934 (grow_mini_window, shrink_mini_window): Implement by calling
19935 Qresize_root_window_vertically, resize_window_check and
19936 resize_window_apply.
640c8776
SM
19937 (saved_window, Fset_window_configuration, save_window_save):
19938 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
19939 resize_proportionally.
19940 (window_min_height, window_min_width): Move to window.el.
19941 (keys_of_window): Move bindings for delete-other-windows,
19942 split-window, delete-window and enlarge-window to window.el.
19943
19944 * buffer.c: Temporarily extern Qdelete_window.
19945 (Fbury_buffer): Temporarily call Qdelete_window instead of
19946 Fdelete_window (Fbury_buffer will move to window.el soon).
19947
19948 * frame.c (set_menu_bar_lines_1): Remove code handling
19949 orig_top_line and orig_total_lines.
19950
19951 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19952 set_window_height but set heights directly.
19953 (change_frame_size_1): Use resize_frame_windows.
19954
19955 * xdisp.c (init_xdisp): Don't use set_window_height but set
19956 heights directly.
19957
640c8776
SM
19958 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19959 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
19960 run_window_configuration_change_hook.
19961
19962 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19963 instead of change_window_heights and run
19964 run_window_configuration_change_hook.
19965
1a13852e
MR
199662011-06-09 Martin Rudalics <rudalics@gmx.at>
19967
19968 * window.c (replace_window): Rename second argument REPLACEMENT to
19969 NEW. New third argument SETFLAG. Rewrite.
19970 (delete_window, make_dummy_parent): Call replace_window with
19971 third argument 1.
19972 (window_list_1): Move down in code.
19973 (run_window_configuration_change_hook): Move set_buffer part
19974 before select_frame_norecord part in order to unwind correctly.
19975 Rename count1 to count.
19976 (recombine_windows, delete_deletable_window, resize_root_window)
19977 (Fdelete_other_windows_internal)
19978 (Frun_window_configuration_change_hook, make_parent_window)
19979 (resize_window_check, resize_window_apply, Fresize_window_apply)
19980 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
19981 (Fdelete_window_internal, Fresize_mini_window_internal):
19982 New functions.
1a13852e
MR
19983 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19984
f3d1777e
MR
199852011-06-08 Martin Rudalics <rudalics@gmx.at>
19986
496e208e
MR
19987 * window.h (window): Add some new members to window structure -
19988 normal_lines, normal_cols, new_total, new_normal, clone_number,
19989 splits, nest, prev_buffers, next_buffers.
19990 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 19991 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 19992
f3d1777e
MR
19993 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19994 Remove.
496e208e
MR
19995 (make_dummy_parent): Set new members of windows structure.
19996 (make_window): Move down in code. Handle new members of window
19997 structure.
19998 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19999 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
20000 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
20001 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
20002 (Fset_window_next_buffers, Fset_window_clone_number):
20003 New functions.
496e208e
MR
20004 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
20005 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
20006 Doc-string fixes.
20007 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
20008 Argument WINDOW can be now internal window too.
20009 (Fwindow_use_time): Move up in code.
20010 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
20011 Rewrite doc-string.
20012 (Fset_window_configuration, saved_window)
20013 (Fcurrent_window_configuration, save_window_save): Handle new
20014 members of window structure.
b9e809c2
MR
20015 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
20016 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
20017 (syms_of_window): New Lisp objects Qrecord_window_buffer,
20018 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
20019 Qget_mru_window, Qresize_root_window,
20020 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
20021 Qauto_buffer_name; staticpro them.
f3d1777e 20022
abde8f8c
MR
200232011-06-07 Martin Rudalics <rudalics@gmx.at>
20024
20025 * window.c (Fwindow_total_size, Fwindow_left_column)
20026 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
20027 (Fwindow_list_1): New functions.
20028 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
20029 (Fwindow_width, Fscroll_left, Fscroll_right):
20030 Use window_body_cols instead of window_box_text_cols.
20031 (delete_window, Fset_window_configuration):
20032 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
20033 (delete_all_subwindows): Take a window as argument and not a
20034 structure. Rewrite.
190b47e6
MR
20035 (window_loop): Remove handling of GET_LRU_WINDOW and
20036 GET_LARGEST_WINDOW.
20037 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
20038
20039 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
20040 window_box_text_cols. delete_all_subwindows now takes a
20041 Lisp_Object as argument.
abde8f8c 20042
640c8776
SM
20043 * indent.c (compute_motion, Fcompute_motion):
20044 Use window_body_cols instead of window_box_text_cols.
abde8f8c 20045
fa8a67e6
MR
20046 * frame.c (delete_frame): Call delete_all_subwindows with root
20047 window as argument.
20048
a54e3482
DC
200492011-06-07 Daniel Colascione <dan.colascione@gmail.com>
20050
20051 * fns.c (Fputhash): Document return value.
20052
60002bf5
CY
200532011-06-06 Chong Yidong <cyd@stupidchicken.com>
20054
20055 * image.c (gif_load): Implement gif89a spec "no disposal" method.
20056
0c671da6 200572011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 20058
b862a52a 20059 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 20060
be44ca6c
PE
20061 Check for overflow when converting integer to cons and back.
20062 * charset.c (Fdefine_charset_internal, Fdecode_char):
20063 Use cons_to_unsigned to catch overflow.
20064 (Fencode_char): Use INTEGER_TO_CONS.
20065 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
20066 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
20067 * data.c (long_to_cons, cons_to_long): Remove.
20068 (cons_to_unsigned, cons_to_signed): New functions.
20069 These signal an error for invalid or out-of-range values.
20070 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
20071 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
20072 * font.c (Ffont_variation_glyphs):
20073 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
20074 * lisp.h: Include <intprops.h>.
20075 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
20076 (cons_to_signed, cons_to_unsigned): New decls.
20077 (long_to_cons, cons_to_long): Remove decls.
20078 * undo.c (record_first_change): Use INTEGER_TO_CONS.
20079 (Fprimitive_undo): Use CONS_TO_INTEGER.
20080 * xfns.c (Fx_window_property): Likewise.
20081 * xselect.c: Include <limits.h>.
20082 (x_own_selection, selection_data_to_lisp_data):
20083 Use INTEGER_TO_CONS.
20084 (x_handle_selection_request, x_handle_selection_clear)
20085 (x_get_foreign_selection, Fx_disown_selection_internal)
20086 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
20087 (lisp_data_to_selection_data): Use cons_to_unsigned.
20088 (x_fill_property_data): Use cons_to_signed.
20089 Report values out of range.
20090
d1f3d2af
PE
20091 Check for buffer and string overflow more precisely.
20092 * buffer.h (BUF_BYTES_MAX): New macro.
20093 * lisp.h (STRING_BYTES_MAX): New macro.
20094 * alloc.c (Fmake_string):
20095 * character.c (string_escape_byte8):
20096 * coding.c (coding_alloc_by_realloc):
20097 * doprnt.c (doprnt):
20098 * editfns.c (Fformat):
20099 * eval.c (verror):
20100 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
20101 since they may not be the same number.
20102 * editfns.c (Finsert_char):
20103 * fileio.c (Finsert_file_contents):
20104 Likewise for BUF_BYTES_MAX.
20105
dd52fcea
PE
20106 * image.c: Use ptrdiff_t, not int, for sizes.
20107 (slurp_file): Switch from int to ptrdiff_t.
20108 All uses changed.
20109 (slurp_file): Check that file size fits in both size_t (for
20110 malloc) and ptrdiff_t (for sanity and safety).
20111
7f9bbdbb
PE
20112 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
20113 if b->modtime has its maximal value.
20114
dfe18f82
PE
20115 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
20116
84acfcf0
PE
20117 Don't assume time_t can fit into int.
20118 * buffer.h (struct buffer.modtime): Now time_t, not int.
20119 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
20120 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
20121
ccd9a01a
PE
20122 Minor fixes for signed vs unsigned integers.
20123 * character.h (MAYBE_UNIFY_CHAR):
20124 * charset.c (maybe_unify_char):
20125 * keyboard.c (read_char, reorder_modifiers):
20126 XINT -> XFASTINT, since the integer must be nonnegative.
20127 * ftfont.c (ftfont_spec_pattern):
20128 * keymap.c (access_keymap, silly_event_symbol_error):
20129 XUINT -> XFASTINT, since the integer must be nonnegative.
20130 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
20131 since it makes no difference and we prefer signed.
20132 * keyboard.c (record_char): Use XUINT when all the neighbors do.
20133 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
20134 nonnegative.
20135
d6d100dd
SM
201362011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
20137
20138 * window.h (Fwindow_frame): Declare.
20139
2b6148e4
PE
201402011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20141
20142 * alloc.c: Simplify handling of large-request failures (Bug#8800).
20143 (SPARE_MEMORY): Always define.
20144 (LARGE_REQUEST): Remove.
20145 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
20146
f230ecc9
MR
201472011-06-06 Martin Rudalics <rudalics@gmx.at>
20148
727e958e
MR
20149 * lisp.h: Move EXFUNS for Fframe_root_window,
20150 Fframe_first_window and Fset_frame_selected_window to window.h.
20151
20152 * window.h: Move EXFUNS for Fframe_root_window,
20153 Fframe_first_window and Fset_frame_selected_window here from
20154 lisp.h.
20155
20156 * frame.c (Fwindow_frame, Fframe_first_window)
20157 (Fframe_root_window, Fframe_selected_window)
20158 (Fset_frame_selected_window): Move to window.c.
20159 (Factive_minibuffer_window): Move to minibuf.c.
20160 (Fother_visible_frames_p): New function.
20161
20162 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
20163
f230ecc9
MR
20164 * window.c (decode_window, decode_any_window): Move up in code.
20165 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
20166 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
20167 (Fwindow_buffer): Move up and rewrite doc-string.
20168 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
20169 (Fwindow_prev): New functions.
727e958e
MR
20170 (Fwindow_frame): Move here from frame.c. Accept any window as
20171 argument.
20172 (Fframe_root_window, Fframe_first_window)
20173 (Fframe_selected_window): Move here from frame.c. Accept frame
20174 or arbitrary window as argument. Update doc-strings.
20175 (Fminibuffer_window): Move up in code.
20176 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
20177 (Fset_frame_selected_window): Move here from frame.c.
20178 Marginal rewrite.
727e958e
MR
20179 (Fselected_window, select_window, Fselect_window): Move up in
20180 code. Minor doc-string fixes.
f230ecc9 20181
4d09bcf6
PE
201822011-06-06 Paul Eggert <eggert@cs.ucla.edu>
20183
20184 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
20185 Do not assume that spare memory exists; that assumption is valid
20186 only if SYSTEM_MALLOC.
20187 (LARGE_REQUEST): New macro, so that the issue of large requests
20188 is separated from the issue of spare memory.
20189
810928a2
AS
201902011-06-05 Andreas Schwab <schwab@linux-m68k.org>
20191
172418ad
AS
20192 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
20193 format. (Bug#8806)
20194
43f862f7
AS
20195 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
20196
810928a2
AS
20197 * xfns.c (x_set_scroll_bar_default_width): Move declarations
20198 before statements.
20199
a059fe24
JD
202002011-06-05 Jan Djärv <jan.h.d@swipnet.se>
20201
20202 * gtkutil.c (xg_get_default_scrollbar_width): New function.
20203
20204 * gtkutil.h: Declare xg_get_default_scrollbar_width.
20205
20206 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
20207 min width by calling x_set_scroll_bar_default_width (Bug#8505).
20208
989bf368
JB
202092011-06-05 Juanma Barranquero <lekktu@gmail.com>
20210
20211 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
20212
4b80f674
CY
202132011-06-04 Chong Yidong <cyd@stupidchicken.com>
20214
20215 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
20216 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
20217 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
20218 New error handlers.
4b80f674
CY
20219 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
20220 Obey Vx_select_enable_clipboard_manager. Catch errors in
20221 x_clipboard_manager_save (Bug#8779).
20222 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 20223 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 20224
99a33b77 202252011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
20226
20227 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
20228
99a33b77 202292011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
20230
20231 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
20232 in the current matrix if keep_current_p is non-zero.
20233
8264569d
EZ
202342011-06-04 Eli Zaretskii <eliz@gnu.org>
20235
20236 * bidi.c (bidi_level_of_next_char): Fix last change.
20237
57f97249
EZ
202382011-06-03 Eli Zaretskii <eliz@gnu.org>
20239
fec2107c 20240 Support bidi reordering of text covered by display properties.
57f97249 20241
fec2107c
EZ
20242 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
20243 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
20244 (bidi_cache_search, bidi_cache_iterator_state)
20245 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
20246 (bidi_level_of_next_char, bidi_move_to_visually_next):
20247 Support character positions inside a run of characters covered by a
fec2107c
EZ
20248 display string.
20249 (bidi_paragraph_init, bidi_resolve_explicit_1)
20250 (bidi_level_of_next_char): Call bidi_fetch_char and
20251 bidi_fetch_char_advance instead of FETCH_CHAR and
20252 FETCH_CHAR_ADVANCE.
20253 (bidi_init_it): Initialize new members.
20254 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
20255 definitions.
20256 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
20257 instead of using explicit *_CHAR codes.
d6d100dd
SM
20258 (bidi_resolve_explicit, bidi_resolve_weak):
20259 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
20260 bidirectional text is supported only in multibyte buffers.
20261 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
20262 it to initialize the frame_window_p member of struct bidi_it.
20263 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
20264 (bidi_resolve_explicit, bidi_resolve_weak)
20265 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
20266 bidi_it->nchars is non-positive.
20267 (bidi_level_of_next_char): Don't try to lookup the cache for the
20268 next/previous character if nothing is cached there yet, or if we
20269 were just reseat()'ed to a new position.
c40e2fb2 20270
0e14fe90
EZ
20271 * xdisp.c (set_cursor_from_row): Set start and stop points
20272 according to the row's direction when priming the loop that looks
20273 for the glyph on which to display cursor.
20274 (single_display_spec_intangible_p): Function deleted.
20275 (display_prop_intangible_p): Reimplement to call
20276 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
20277 Accept 3 additional arguments needed by handle_display_spec.
20278 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
20279 values: lists, `(when COND...)' forms, etc.
20280 (single_display_spec_string_p): Support property values that are
20281 lists with the argument STRING its top-level element.
20282 (display_prop_string_p): Fix the condition for processing a
20283 property that is a list to be consistent with handle_display_spec.
fec2107c 20284 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
20285 last portion of handle_display_prop.
20286 (compute_display_string_pos): Accept additional argument
20287 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
20288 value of a `display' property is a "replacing spec".
20289 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
20290 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
20291 the display property, but just return a value indicating whether
20292 the display property will replace the characters it covers.
20293 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
20294 frame_window_p members of struct bidi_it.
d6d100dd
SM
20295 (compute_display_string_pos, compute_display_string_end):
20296 New functions.
fec2107c
EZ
20297 (push_it): Accept second argument POSITION, where pop_it should
20298 jump to continue iteration.
20299 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 20300
fec2107c
EZ
20301 * keyboard.c (adjust_point_for_property): Adjust the call to
20302 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
20303
20304 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
20305 (bidi_init_it): Update prototypes.
20306 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
20307 (compute_display_string_pos, compute_display_string_end):
20308 Declare prototypes.
fec2107c
EZ
20309 (struct bidi_it): New members nchars and disp_pos. ch_len is now
20310 EMACS_INT.
fc6f18ce 20311
40087514 203122011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 20313
57f53182
PE
20314 Malloc failure behavior now depends on size of allocation.
20315 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
20316 * lisp.h: Change signatures accordingly.
20317 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
20318 All callers changed. (Bug#8762)
20319
20320 * gnutls.c: Use Emacs's memory allocators.
20321 Without this change, the gnutls library would invoke malloc etc.
20322 directly, which causes problems on non-SYNC_INPUT hosts, and which
20323 runs afoul of improving memory_full behavior. (Bug#8761)
20324 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
20325 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
20326 xfree instead of the default malloc, realloc, free.
20327 (Fgnutls_boot): No need to check for memory allocation failure,
20328 since xmalloc does that for us.
20329
ac32cd99 20330 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
20331 * category.c (hash_get_category_set):
20332 * ccl.c (ccl_driver):
20333 * charset.c (Fdefine_charset_internal):
20334 * charset.h (struct charset.hash_index):
20335 * composite.c (get_composition_id, gstring_lookup_cache)
20336 (composition_gstring_put_cache):
20337 * composite.h (struct composition.hash_index):
20338 * dispextern.h (struct image.hash):
20339 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
20340 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
20341 (hashfn_equal, hashfn_user_defined, make_hash_table)
20342 (maybe_resize_hash_table, hash_lookup, hash_put)
20343 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
20344 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
20345 (Fsxhash, Fgethash, Fputhash, Fmaphash):
20346 * image.c (make_image, search_image_cache, lookup_image)
20347 (xpm_put_color_table_h):
20348 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 20349 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 20350 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 20351 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
20352 * alloc.c (allocate_vectorlike):
20353 Check for overflow in vector size calculations.
20354 * ccl.c (ccl_driver):
20355 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
20356 * fns.c, image.c: Remove unnecessary static decls that would otherwise
20357 need to be updated by these changes.
40087514
PE
20358 * fns.c (make_hash_table, maybe_resize_hash_table):
20359 Check for integer overflow with large hash tables.
0de4bb68
PE
20360 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
20361 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
20362 (SXHASH_REDUCE): New macro.
20363 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
20364 Use it instead of discarding useful hash info with large hash values.
20365 (sxhash_float): New function.
20366 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
20367 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
20368 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
20369 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
20370 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
20371 Adjust signatures to match updated version of code.
20372 (consing_since_gc): Now EMACS_INT, since a single hash table can
20373 use more than INT_MAX bytes.
20374
698d32e2
DN
203752011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
20376
20377 Make it possible to build with GCC-4.6+ -O2 -flto.
20378
20379 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
20380
fd6fa53f
SM
203812011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
20382
20383 * minibuf.c (get_minibuffer, read_minibuf_unwind):
20384 Call minibuffer-inactive-mode.
20385
864db017
JB
203862011-05-31 Juanma Barranquero <lekktu@gmail.com>
20387
20388 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
20389 Update dependencies.
20390
2ad0baf4
DN
203912011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20392
20393 * data.c (init_data): Remove code for UTS, this system is not
20394 supported anymore.
20395
4fcc2638
DN
203962011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20397
20398 Don't force ./temacs to start in terminal mode.
20399
20400 * frame.c (make_initial_frame): Initialize faces in all cases, not
20401 only when CANNOT_DUMP is defined.
20402 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
20403
c56e0fd5
DN
204042011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20405
20406 * dispnew.c (add_window_display_history): Use const for the string
20407 pointer. Remove declaration, not needed.
20408
333d54da 204092011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 20410
55d4c1b2 20411 Use 'inline', not 'INLINE'.
333d54da 20412 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
20413 * alloc.c, fontset.c (INLINE): Remove.
20414 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
20415 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
20416 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
20417 * gmalloc.c (register_heapinfo): Use inline unconditionally.
20418 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
20419
738db178
DN
204202011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
20421
20422 Make it possible to run ./temacs.
20423
20424 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
20425 syms_of_callproc does the same thing. Remove test for
20426 "initialized", do it in the caller.
20427 * emacs.c (main): Avoid calling set_initial_environment when dumping.
20428
620c53a6
SM
204292011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
20430
20431 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
20432 (read_minibuf): Use get_minibuffer.
20433 (syms_of_minibuf): Use DEFSYM.
20434 (Qmetadata): New var.
20435 * data.c (Qbuffer): Don't make it static.
20436 (syms_of_data): Use DEFSYM.
20437
e003a292
PE
204382011-05-31 Paul Eggert <eggert@cs.ucla.edu>
20439
20440 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
20441 (CCL_CODE_MIN): New macro.
20442
ed008a6d
PE
204432011-05-30 Paul Eggert <eggert@cs.ucla.edu>
20444
3687c2ef
PE
20445 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
20446
ed008a6d
PE
20447 * eval.c (Qdebug): Now static.
20448 * lisp.h (Qdebug): Remove decl. This reverts a part of the
20449 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
20450 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
20451
d66c4c7c
CY
204522011-05-29 Chong Yidong <cyd@stupidchicken.com>
20453
20454 * image.c: Various fixes to ImageMagick code comments.
20455 (Fimagemagick_types): Doc fix.
20456
5fbc2025
PE
204572011-05-29 Paul Eggert <eggert@cs.ucla.edu>
20458
0196f88a
PE
20459 Minor fixes prompted by GCC 4.6.0 warnings.
20460
20461 * xselect.c (converted_selections, conversion_fail_tag): Now static.
20462
5fbc2025
PE
20463 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
20464 (x_clipboard_manager_save_all): Move extern decl to ...
20465 * xterm.h: ... here, so that it can be checked for consistency.
20466
1dd3c2d9
CY
204672011-05-29 Chong Yidong <cyd@stupidchicken.com>
20468
20469 * xselect.c (x_clipboard_manager_save_frame)
20470 (x_clipboard_manager_save_all): New functions.
20471 (Fx_clipboard_manager_save): Lisp function deleted.
20472
20473 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
20474 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
20475
20476 * xterm.h: Update prototype.
20477
5ba6571d
WX
204782011-05-28 William Xu <william.xwl@gmail.com>
20479
20480 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
20481 exiting (Bug#8239).
20482
3eaff834
JM
204832011-05-28 Jim Meyering <meyering@redhat.com>
20484
e1900994 20485 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
20486 * fns.c (to_uchar): Define.
20487 (crypto_hash_function): Use it to convert some newly-signed
20488 variables to unsigned, to avoid sign-extension bugs. For example,
20489 without this change, (md5 "truc") would evaluate to
20490 45723a2aff78ff4fff7fff1114760e62 rather than the expected
20491 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 20492 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 20493
0f6990a7
PE
204942011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20495
20496 Integer overflow fixes.
c8a9ca5a 20497
08686060
PE
20498 * dbusbind.c: Serial number integer overflow fixes.
20499 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
20500 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
20501 to hold a serial number that is too large for a fixnum.
20502 (Fdbus_method_return_internal, Fdbus_method_error_internal):
20503 Check for serial numbers out of range. Decode any serial number
59568bf0 20504 that was so large that it became a float. (Bug#8722)
08686060 20505
2d1fc3c7
PE
20506 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
20507 (Fdbus_call_method, Fdbus_call_method_asynchronously):
20508 Use XFASTINT rather than XUINT when numbers are nonnegative.
20509 (xd_append_arg, Fdbus_method_return_internal):
20510 (Fdbus_method_error_internal): Likewise. Also, for unsigned
20511 arguments, check that Lisp number is nonnegative, rather than
59568bf0 20512 silently wrapping negative numbers around. (Bug#8722)
30217ff0 20513 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 20514 (Bug#8722)
2d1fc3c7 20515
c8a9ca5a
PE
20516 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
20517
519e1d69
PE
20518 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
20519
6df6ae42 20520 ccl: Add integer overflow checks.
30569699
PE
20521 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
20522 (IN_INT_RANGE): New macros.
20523 (ccl_driver): Use them to check for integer overflow when
20524 decoding a CCL program. Many of the new checks are whether XINT (x)
20525 fits in int; it doesn't always, on 64-bit hosts. The new version
20526 doesn't catch all possible integer overflows, but it's an
847044ea 20527 improvement. (Bug#8719)
30569699 20528
c11285dc
PE
20529 * alloc.c (make_event_array): Use XINT, not XUINT.
20530 There's no need for unsigned here.
20531
fdccd48e
PE
20532 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
20533 This follows up to the 2011-05-06 change that substituted uintptr_t
20534 for EMACS_INT. This case wasn't caught back then.
20535
37910ab2
PE
20536 Rework Fformat to avoid integer overflow issues.
20537 * editfns.c: Include <float.h> unconditionally, as it's everywhere
20538 now (part of C89). Include <verify.h>.
20539 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
20540 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
20541 (Fformat): Avoid the prepass trying to compute sizes; it was only
20542 approximate and thus did not catch overflow reliably. Instead, walk
20543 through the format just once, formatting and computing sizes as we go,
20544 checking for integer overflow at every step, and allocating a larger
20545 buffer as needed. Keep track separately whether the format is
20546 multibyte. Keep only the most-recently calculated precision, rather
20547 than them all. Record whether each argument has been converted to
20548 string. Use EMACS_INT, not int, for byte and char and arg counts.
20549 Support field widths and precisions larger than INT_MAX. Avoid
20550 sprintf's undefined behavior with conversion specifications such as %#d
20551 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
20552 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
20553 formatting out-of-range floating point numbers with int
9173deec 20554 formats. (Bug#8668)
37910ab2 20555
2e6578fb
PE
20556 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
20557
0ae6bdee
PE
20558 * data.c: Avoid integer truncation in expressions involving floats.
20559 * data.c: Include <intprops.h>.
20560 (arith_driver): When there's an integer overflow in an expression
20561 involving floating point, convert the integers to floating point
20562 so that the resulting value does not suffer from catastrophic
20563 integer truncation. For example, on a 64-bit host (* 4
20564 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
20565 Do not rely on undefined behavior after integer overflow.
20566
de883a70
PE
20567 merge count_size_as_multibyte, parse_str_to_multibyte
20568 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 20569 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
20570 Check for integer overflow.
20571 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
20572 since it's now a duplicate of the other. This is more of
20573 a character than a buffer op, so better that it's in character.c.
20574 * fns.c, print.c: Adjust to above changes.
20575
2ff916cb
PE
205762011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
20577
20578 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
20579
f1b54466
PE
205802011-05-27 Paul Eggert <eggert@cs.ucla.edu>
20581
fb1ac845
PE
20582 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20583 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
20584 (x_clipboard_manager_save): Now static.
20585 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
20586
f1b54466
PE
20587 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
20588 (crypto_hash_function): Now static.
20589 Fix pointer signedness problems. Avoid unnecessary initializations.
20590
a9f737ee
CY
205912011-05-27 Chong Yidong <cyd@stupidchicken.com>
20592
20593 * termhooks.h (Vselection_alist): Make it terminal-local.
20594
20595 * terminal.c (create_terminal): Initialize it.
20596
20597 * xselect.c: Support for clipboard managers.
20598 (Vselection_alist): Move to termhooks.h as terminal-local var.
20599 (LOCAL_SELECTION): New macro.
20600 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
20601 (symbol_to_x_atom): Remove gratuitous arg.
20602 (x_handle_selection_request, lisp_data_to_selection_data)
20603 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
20604 (x_own_selection, x_get_local_selection, x_convert_selection):
20605 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
20606 (some_frame_on_display): Delete unused function.
20607 (Fx_own_selection_internal, Fx_get_selection_internal)
20608 (Fx_disown_selection_internal, Fx_selection_owner_p)
20609 (Fx_selection_exists_p): New optional frame arg.
20610 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
20611 (x_handle_selection_clear): Don't treat other terminals with the
20612 same keyboard specially. Use the terminal-local Vselection_alist.
20613 (x_clear_frame_selections): Use Frun_hook_with_args.
20614
20615 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
20616
20617 * xterm.h: Add support for those atoms.
20618
e067f0c1
CY
206192011-05-26 Chong Yidong <cyd@stupidchicken.com>
20620
20621 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
20622 (converted_selections, conversion_fail_tag): New global variables.
20623 (x_selection_request_lisp_error): Free the above.
20624 (x_get_local_selection): Remove unnecessary code.
20625 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
20626 of converted selections stored in converted_selections.
20627 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
20628 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
20629 (x_convert_selection): New function.
20630 (x_handle_selection_event): Simplify.
20631 (x_get_foreign_selection): Don't ignore incoming requests while
20632 waiting for an answer; this will fail when we implement
20633 SAVE_TARGETS, and seems unnecessary anyway.
20634 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
20635 (Vx_sent_selection_functions): Doc fix.
20636
0f4aebc0
LL
206372011-05-26 Leo Liu <sdl.web@gmail.com>
20638
20639 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
20640
e61124cd
YM
206412011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20642
20643 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
20644
20645 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
20646 for fringe update if it has periodic bitmap.
ac389d0c 20647 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
20648 and fringe_bitmap_periodic_p.
20649
20650 * fringe.c (get_fringe_bitmap_data): New function.
20651 (draw_fringe_bitmap_1, update_window_fringes): Use it.
20652 (update_window_fringes): Record periodicity of fringe bitmap in glyph
20653 row. Mark glyph row for fringe update if periodicity changed.
20654
20655 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
20656 for fringe update unless it has periodic bitmap.
20657
f16d9837
KH
206582011-05-25 Kenichi Handa <handa@m17n.org>
20659
20660 * xdisp.c (get_next_display_element): Set correct it->face_id for
20661 a static composition.
20662
e1b90ef6
LL
206632011-05-24 Leo Liu <sdl.web@gmail.com>
20664
20665 * deps.mk (fns.o):
20666 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
20667
20668 * fns.c (crypto_hash_function, Fsha1): New function.
20669 (Fmd5): Use crypto_hash_function.
20670 (syms_of_fns): Add Ssha1.
20671
7400048f
PE
206722011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20673
20674 * gnutls.c: Remove unused macros.
20675 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
20676 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
20677 Remove macros that are defined and never used.
20678 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
20679
abb71cf4
CY
206802011-05-22 Chong Yidong <cyd@stupidchicken.com>
20681
20682 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
20683 (Fx_get_selection_internal): Minor cleanup.
20684 (Fx_own_selection_internal): Rename arguments for consistency with
20685 select.el.
20686
6307db39
PE
206872011-05-22 Paul Eggert <eggert@cs.ucla.edu>
20688
20689 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
20690
f3d4e0a4
CY
206912011-05-22 Chong Yidong <cyd@stupidchicken.com>
20692
20693 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
20694
4d8ade89
YM
206952011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
20696
20697 * dispnew.c (scrolling_window): Don't exclude the case that the
20698 last enabled row in the desired matrix touches the bottom boundary.
20699
32078c8d
GM
207002011-05-21 Glenn Morris <rgm@gnu.org>
20701
20702 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
20703 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
20704 and add some more files.
32078c8d 20705
7285dc67
EZ
207062011-05-20 Eli Zaretskii <eliz@gnu.org>
20707
20708 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
20709 report_file_error introduced by the change from 2011-05-07.
20710
89d1bd22
PE
207112011-05-20 Paul Eggert <eggert@cs.ucla.edu>
20712
20713 * systime.h (Time): Define only if emacs is defined.
20714 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
20715 where the include path doesn't have X11/X.h by default. See
20716 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
20717
cd394be1 207182011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
20719
20720 * composite.c (find_automatic_composition): Fix previous change.
20721
b9704ad9
GM
207222011-05-20 Glenn Morris <rgm@gnu.org>
20723
20724 * lisp.mk: New file, split from Makefile.in.
20725 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
20726 (shortlisp): Remove.
20727 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
20728
4a720484
GM
207292011-05-19 Glenn Morris <rgm@gnu.org>
20730
20731 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
20732 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
20733 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
20734 (lisp): Set the order to that of loadup.el.
20735 (shortlisp): Make it a copy of $lisp.
20736 (SOME_MACHINE_LISP): Remove.
20737 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
20738 Use just $shortlisp, not $SOME_MACHINE_LISP too.
20739
a28d4396
KH
207402011-05-18 Kenichi Handa <handa@m17n.org>
20741
20742 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
20743 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
20744 (find_automatic_composition): Mostly rewrite for efficiency.
20745
a2b1fa8e
JB
207462011-05-18 Juanma Barranquero <lekktu@gmail.com>
20747
20748 * makefile.w32-in: Update dependencies.
20749
8e1f5610
CS
207502011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
20751
20752 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 20753 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 20754
7025ee00 207552011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 20756
cdfa6eab
PE
20757 Fix some integer overflow issues, such as string length overflow.
20758
06d6db33
PE
20759 * insdel.c (count_size_as_multibyte): Check for string overflow.
20760
2b4560a8
PE
20761 * character.c (lisp_string_width): Check for string overflow.
20762 Use EMACS_INT, not int, for string indexes and lengths; in
20763 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
20764 the resulting string length overflows an EMACS_INT; instead,
20765 report a string overflow if no precision given. When checking for
20766 precision exhaustion, use a check that cannot possibly have
20767 integer overflow. (Bug#8675)
20768 * character.h (lisp_string_width): Adjust to new signature.
20769
cb93f9be
PE
20770 * alloc.c (string_overflow): New function.
20771 (Fmake_string): Use it. This doesn't change behavior, but saves
20772 a few bytes and will simplify future changes.
20773 * character.c (string_escape_byte8): Likewise.
20774 * lisp.h (string_overflow): New decl.
20775
1a1f3366
PE
20776 Fixups, following up to the user-interface timestamp change.
20777 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
20778 for UI timestamps, instead of unsigned long.
9fbd6841
PE
20779 * msdos.c (mouse_get_pos): Likewise.
20780 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
20781 * w32gui.h (Time): Define by including "systime.h" rather than by
20782 declaring it ourselves. (Bug#8664)
20783
d4e3e4d3
PE
20784 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
20785 * image.c (clear_image_cache): Likewise.
20786
f6a24d19
PE
20787 * term.c (term_mouse_position): Don't assume time_t wraparound.
20788
08dc5ae6
PE
20789 Be more systematic about user-interface timestamps.
20790 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
20791 and sometimes 'EMACS_UINT', to represent these timestamps.
20792 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
20793 This makes the code easier to follow, and makes it easier to catch
20794 integer overflow bugs such as Bug#8664.
20795 * frame.c (Fmouse_position, Fmouse_pixel_position):
20796 Use Time, not unsigned long, for user-interface timestamps.
20797 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
20798 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
20799 * keyboard.h (last_event_timestamp): Likewise.
20800 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
20801 * menu.h (xmenu_show): Likewise.
20802 * term.c (term_mouse_position): Likewise.
20803 * termhooks.h (struct input_event.timestamp): Likewise.
20804 (struct terminal.mouse_position_hook): Likewise.
20805 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
20806 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
20807 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
20808 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
20809 what it was before.
20810 * menu.h, termhooks.h: Include "systime.h", for Time.
20811
8e55734a
PE
20812 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
20813 Don't assume that the difference between two unsigned long values
20814 can fit into an integer. At this point, we know button_down_time
20815 <= event->timestamp, so the difference must be nonnegative, so
20816 there's no need to cast the result if double-click-time is
20817 nonnegative, as it should be; check that it's nonnegative, just in
20818 case. This bug is triggered when events are more than 2**31 ms
86db42d2 20819 apart (about 25 days). (Bug#8664)
8e55734a 20820
841f1b75 20821 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 20822 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 20823
3e26f69c
PE
20824 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20825 that always fit in int. Use a sentinel instead of a counter, to
20826 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
20827 * frame.h (struct frame): Use int for menu_bar_items_used
20828 instead of EMACS_INT, since it always fits in int.
3e26f69c 20829
5cc152c0
PE
20830 * menu.c (grow_menu_items): Check for int overflow.
20831
d89eb65e
PE
20832 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20833
5235bd3e
PE
20834 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20835 Before, the code was not consistent. These values cannot exceed
20836 2**31 - 1 so there's no need to make them unsigned.
20837 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20838 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20839 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20840 as modifiers.
20841 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20842
bc827e23
PE
20843 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20844 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20845 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20846 presumably because the widths might not match.
20847
78eb494e
PE
20848 * window.c (size_window): Avoid needless test at loop start.
20849
04f2d78b
CB
208502011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20851
20852 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20853
d2fc7e3d 208542011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
20855
20856 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20857
d2fc7e3d 208582011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
20859
20860 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20861 `width' to `bar_area_x' and `bar_area_width', respectively.
20862 (x_scroll_run): Take account of fringe background extension.
20863
04f2d78b
CB
20864 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20865 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
20866 `bar_area_width', respectively.
20867 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20868 background extension.
20869
79b70037
GM
208702011-05-10 Jim Meyering <meyering@redhat.com>
20871
20872 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20873
2f142cc5
JB
208742011-05-10 Juanma Barranquero <lekktu@gmail.com>
20875
20876 * image.c (Finit_image_library): Return t for built-in image types,
20877 like pbm and xbm. (Bug#8640)
20878
57679c86
AS
208792011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20880
20881 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20882
888c9e86
EZ
208832011-05-07 Eli Zaretskii <eliz@gnu.org>
20884
b0512a1d
EZ
20885 * w32console.c (Fset_screen_color): Doc fix.
20886 (Fget_screen_color): New function.
20887 (syms_of_ntterm): Defsubr it.
20888
7285dc67
EZ
20889 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20890 unlink the temporary file if Fcall_process didn't create it in the
20891 first place.
20892 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20893 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
20894 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20895 cue to call_process_cleanup not to close that handle.
20896
4d3fcc8e
BK
208972011-05-07 Ben Key <bkey76@gmail.com>
20898
20899 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20900 one of two shell specific rules, either bootstrap-temacs-CMD or
20901 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20902 to the previous implementation of the bootstrap-temacs rule.
20903 The bootstrap-temacs-CMD rule is similar to the previous
20904 implementation of the bootstrap-temacs rule except that it
20905 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20906 variable.
20907
20908 These changes, along with some changes to nt/configure.bat,
20909 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20910 earlier fix to add support for --cflags and --ldflags options
20911 that include quotes so that it works whether make uses cmd or
20912 sh as the shell.
20913
b4289b64
MA
209142011-05-06 Michael Albinus <michael.albinus@gmx.de>
20915
20916 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20917 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20918 is a constant.
20919 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20920 a string. Handle both cases.
20921 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20922 (Fdbus_register_method): Use Qinvalid_function.
20923
af4c0e28
JB
209242011-05-06 Juanma Barranquero <lekktu@gmail.com>
20925
20926 * makefile.w32-in: Update dependencies.
20927 (LISP_H): Add inttypes.h and stdin.h.
20928 (PROCESS_H): Add unistd.h.
20929
c51453d9
EZ
209302011-05-06 Eli Zaretskii <eliz@gnu.org>
20931
20932 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20933 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20934
8ff0ac3c 209352011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 20936
4c4b566b
PE
20937 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20938
aab2b9b5
PE
20939 * term.c (vfatal): Remove stray call to va_end.
20940 It's not needed and the C Standard doesn't allow it here anyway.
20941
c378da0b
PE
20942 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20943 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20944
288b08c7
PE
20945 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20946 bytes.
20947
e3601888
PE
20948 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20949
db6c0e74
PE
20950 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20951
dd5963ea
PE
20952 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20953
88c9450f
PE
20954 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20955
2f9442b8
PE
20956 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20957
c032b5f8
PE
20958 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20959 * charset.c (Fdefine_charset_internal): Don't initialize
20960 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 20961 32-bit int (Bug#8600).
a108c10b
PE
20962
20963 * lread.c (read_integer): Be more consistent with string-to-number.
20964 Use string_to_number to do the actual conversion; this avoids
20965 rounding errors and fixes some other screwups. Without this fix,
20966 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20967 (digit_to_number): Move earlier, for benefit of read_integer.
20968 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 20969 not a digit in any supported base. (Bug#8602)
a108c10b 20970
ad5f9eea
PE
20971 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20972
aec1708a
PE
20973 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20974 to match comment at start of function. This also removes a
20975 GCC warning about overflow in a 32+64-bit port.
20976
47be4ab5
PE
20977 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20978
371cac43
PE
20979 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20980 Reported by Stefan Monnier in
20981 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
20982 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20983 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 20984
d01a7826
PE
20985 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20986 (EMACS_UINTPTR): Likewise, with uintptr_t.
20987
7fd47d5c
PE
20988 * lisp.h: Prefer 64-bit EMACS_INT if available.
20989 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20990 on 32-bit hosts that have 64-bit int, so that they can access
20991 large files.
122b0c86
PE
20992 However, temporarily disable this change unless the temporary
20993 symbol WIDE_EMACS_INT is defined.
7fd47d5c 20994
8727937b
PE
20995 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20996
8ac068ac
PE
20997 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20998 This removes an assumption that EMACS_INT and long are the same
20999 width as pointers. The assumption is true for Emacs porting targets
21000 now, but we want to make other targets possible.
21001 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
21002 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
21003 In the rest of the code, change types of integers that hold casted
21004 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
21005 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
21006 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
21007 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
21008 No need to cast type when ORing.
21009 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
21010 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
21011 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
21012 assume EMACS_INT is the same width as char *.
21013 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
21014 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
21015 Remove no-longer-needed casts.
21016 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
21017 (xg_tool_bar_help_callback, xg_make_tool_item):
21018 Use EMACS_INTPTR to hold an integer
21019 that will be cast to void *; this can avoid a GCC warning
21020 if EMACS_INT is not the same width as void *.
21021 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
21022 * xdisp.c (display_echo_area_1, resize_mini_window_1):
21023 (current_message_1, set_message_1):
21024 Use a local to convert to proper width without a cast.
21025 * xmenu.c (dialog_selection_callback): Likewise.
21026
ede49d71
PE
21027 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
21028 Also, don't assume VALBITS / RAND_BITS is less than 5,
21029 and don't rely on undefined behavior when shifting a 1 left into
21030 the sign bit.
21031 * lisp.h (get_random): Change signature to match.
21032
2f30ecd0
PE
21033 * lread.c (hash_string): Use size_t, not int, for hash computation.
21034 Normally we prefer signed values; but hashing is special, because
21035 it's better to use unsigned division on hash table sizes so that
21036 the remainder is nonnegative. Also, size_t is the natural width
21037 for hashing into memory. The previous code used 'int', which doesn't
21038 retain enough info to hash well into very large tables.
21039 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
21040
2a866e7b
PE
21041 * dbusbind.c: Don't possibly lose pointer info when converting.
21042 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
21043 Use XPNTR rather than XHASH, so that the high-order bits of
21044 the pointer aren't lost when converting through void *.
21045
51639eac
PE
21046 * eval.c (Fautoload): Don't double-shift a pointer.
21047
92394119
PE
21048 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
21049
dbdb9a7c
JB
210502011-05-06 Juanma Barranquero <lekktu@gmail.com>
21051
21052 * gnutls.c (DEF_GNUTLS_FN):
21053 * image.c (DEF_IMGLIB_FN): Make function pointers static.
21054
db7a0b4f
AS
210552011-05-05 Andreas Schwab <schwab@linux-m68k.org>
21056
21057 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
21058 marker. (Bug#8610)
21059
cd394be1 210602011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
21061
21062 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
21063 New version that can reserve upto 2GB of heap space.
21064
f7ff1b0f 210652011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
21066
21067 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
21068
639c109b
TZ
210692011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
21070
21071 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
21072 `gnutls_certificate_set_x509_key_file'.
21073
d2127135
JB
210742011-05-05 Juanma Barranquero <lekktu@gmail.com>
21075
21076 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
21077 Update dependencies.
21078
e968f4f3
JB
210792011-05-04 Juanma Barranquero <lekktu@gmail.com>
21080
21081 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
21082 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
21083 Remove unused parameter `fildes'.
21084 * process.c (read_process_output, send_process): Don't pass it.
21085
84d358f0
JB
210862011-05-04 Juanma Barranquero <lekktu@gmail.com>
21087
21088 Fix previous change: the library cache is defined in w32.c.
21089 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
21090 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
21091
0898ca10
JB
210922011-05-04 Juanma Barranquero <lekktu@gmail.com>
21093
21094 Implement dynamic loading of GnuTLS on Windows.
21095
21096 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
21097 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
21098 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21099 Declare.
21100
21101 * gnutls.c (Qgnutls_dll): Define.
21102 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
21103 (gnutls_*): Declare function pointers.
21104 (init_gnutls_functions): New function to initialize function pointers.
21105 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
21106 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
21107 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
21108 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
21109 (emacs_gnutls_write, emacs_gnutls_read)
21110 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
21111 (Fgnutls_available_p): New function.
21112 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
21113 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
21114 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
21115
21116 * image.c: Include w32.h.
21117 (Vimage_type_cache): Delete.
21118 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
21119 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
21120 (w32_delayed_load): Move to w32.c.
21121
21122 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
21123
21124 * w32.c (QCloaded_from, Vlibrary_cache): Define.
21125 (w32_delayed_load): Move from image.c. When loading a library, record
21126 its filename in the :loaded-from property of the library id.
21127 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
21128 Initialize and staticpro them.
21129 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
21130
21131 * process.c: Include lisp.h before w32.h, not after.
21132 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
21133 instead of gnutls_record_check_pending.
21134
21135 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
21136
ff4de4aa
TZ
211372011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
21138
21139 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
21140 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
21141 as passed in.
21142
abe95abb
JD
211432011-05-03 Jan Djärv <jan.h.d@swipnet.se>
21144
21145 * xterm.c (x_set_frame_alpha): Do not set property on anything
21146 else than FRAME_X_OUTER_WINDOW (Bug#8608).
21147
e16e55d4
JB
211482011-05-02 Juanma Barranquero <lekktu@gmail.com>
21149
21150 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
21151
bafcf6a5
JB
211522011-05-02 Juanma Barranquero <lekktu@gmail.com>
21153
21154 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
21155 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
21156 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
21157 (gnutls_global_initialized, Qgnutls_bootprop_priority)
21158 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
21159 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
21160 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
21161 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
21162 (Qgnutls_bootprop_callbacks_verify): Make static.
21163
e7a6747f
AS
211642011-05-01 Andreas Schwab <schwab@linux-m68k.org>
21165
19ed11ba
AS
21166 * callproc.c: Indentation fixup.
21167
e7a6747f 21168 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
21169 (wait_for_termination, interruptible_wait_for_termination):
21170 Move after wait_for_termination_1.
e7a6747f 21171
1ef14cb4
LMI
211722011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
21173
21174 * sysdep.c (interruptible_wait_for_termination): New function
21175 which is like wait_for_termination, but allows keyboard
21176 interruptions.
21177
21178 * callproc.c (Fcall_process): Add (:file "file") as an option for
21179 the STDOUT buffer.
21180 (Fcall_process_region): Ditto.
21181
330d880c
EZ
211822011-04-30 Eli Zaretskii <eliz@gnu.org>
21183
8db90b73
EZ
21184 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
21185 rather than `XVECTOR (FOO)->size'.
21186
330d880c
EZ
21187 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
21188 inttypes.h, as a gnulib replacement is used if it not available in
21189 system headers.
21190
15cbd324
EZ
211912011-04-21 Eli Zaretskii <eliz@gnu.org>
21192
21193 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
21194 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
21195 of MOST_POSITIVE_FIXNUM. (Bug#8528)
21196
21197 * coding.c (coding_alloc_by_realloc): Error out if destination
21198 will grow beyond MOST_POSITIVE_FIXNUM.
21199 (decode_coding_emacs_mule): Abort if there isn't enough place in
21200 charbuf for the composition carryover bytes. Reserve an extra
21201 space for up to 2 characters produced in a loop.
21202 (decode_coding_iso_2022): Abort if there isn't enough place in
21203 charbuf for the composition carryover bytes.
21204
212052011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 21206
ae940cca
EZ
21207 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
21208 aborting when %lld or %lll format is passed.
21209 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
21210 %llo or %llx format is passed. (Bug#8545)
21211
03ab8921
EZ
21212 * window.c (window_scroll_line_based): Use a marker instead of
21213 simple variables to record original value of point. (Bug#7952)
21214
afda1437
EZ
21215 * doprnt.c (doprnt): Fix the case where a multibyte sequence
21216 produced by %s or %c overflows available buffer space. (Bug#8545)
21217
f76dee0c
PE
212182011-04-28 Paul Eggert <eggert@cs.ucla.edu>
21219
21220 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 21221 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 21222
fdc5744d
JB
212232011-04-28 Juanma Barranquero <lekktu@gmail.com>
21224
21225 * w32.c (init_environment): Warn about defaulting HOME to C:\.
21226
638f053a
JB
212272011-04-28 Juanma Barranquero <lekktu@gmail.com>
21228
21229 * keyboard.c (Qdelayed_warnings_hook): Define.
21230 (command_loop_1): Run `delayed-warnings-hook'
21231 if Vdelayed_warnings_list is non-nil.
21232 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
21233 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
21234
d178f871
EZ
212352011-04-28 Eli Zaretskii <eliz@gnu.org>
21236
21237 * doprnt.c (doprnt): Don't return value smaller than the buffer
21238 size if the message was truncated. (Bug#8545).
21239
b124fd93
JB
212402011-04-28 Juanma Barranquero <lekktu@gmail.com>
21241
21242 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
21243 (Fx_window_property): #if-0 the whole functions, not just the bodies.
21244
e810457d
PE
212452011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21246
21247 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
21248
ea51cceb
JB
212492011-04-27 Juanma Barranquero <lekktu@gmail.com>
21250
21251 * makefile.w32-in: Update dependencies.
21252
94dcfacf
EZ
212532011-04-27 Eli Zaretskii <eliz@gnu.org>
21254
21255 Improve `doprnt' and its usage. (Bug#8545)
21256 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
21257 `format_end'. Remove support for %l as a conversion specifier.
21258 Don't use xrealloc. Improve diagnostics when the %l size modifier
21259 is used. Update the commentary.
21260
21261 * eval.c (verror): Simplify calculation of size_t.
21262
21263 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
21264 messages.
21265
f61f41d7
PE
212662011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
21267
21268 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
21269 change.
21270
96fb4434
PE
212712011-04-27 Paul Eggert <eggert@cs.ucla.edu>
21272
21273 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
21274 This makes this file independent of the recent pseudovector change.
21275
671875da 212762011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 21277
69e9b5a3
PE
21278 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
21279
b5f869a7 21280 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 21281 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 21282 Remove unused local.
c8926152 21283 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 21284
841a1577 21285 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
21286 GCC 4.6.0 optimizes based on type-based alias analysis.
21287 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
21288 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
21289 != &v->size, and therefore "v->size = 1; b->size = 2; return
21290 v->size;" must therefore return 1. This assumption is incorrect
21291 for Emacs, since it type-puns struct Lisp_Vector * with many other
21292 types. To fix this problem, this patch adds a new type struct
f904488f 21293 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
21294 and pseudovectors, and helps optimizing compilers not get fooled
21295 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
21296 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
21297 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
21298 the size member.
eab3844f
PE
21299 (XSETPVECTYPE): Rewrite in terms of new macro.
21300 (XSETPVECTYPESIZE): New macro, specifying both type and size.
21301 This is a bit clearer, and further avoids the possibility of
21302 undesirable aliasing.
21303 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 21304 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
21305 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
21306 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
21307 (ASIZE): Now uses header.size rather than size.
21308 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
21309 to avoid the hassle of writing XVECTOR (foo)->header.size.
21310 (struct vectorlike_header): New type.
eab3844f
PE
21311 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
21312 object, to help avoid aliasing.
21313 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
21314 (SUBRP): Likewise, since Lisp_Subr is a special case.
21315 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
21316 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
21317 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 21318 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
21319 changed to be "header.size" and "header.next".
21320 * buffer.h (struct buffer): Likewise.
21321 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
21322 * frame.h (struct frame): Likewise.
21323 * process.h (struct Lisp_Process): Likewise.
21324 * termhooks.h (struct terminal): Likewise.
21325 * window.c (struct save_window_data, struct saved_window): Likewise.
21326 * window.h (struct window): Likewise.
21327 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
21328 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
21329 * buffer.c (init_buffer_once): Likewise.
21330 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
21331 special case.
21332 * process.c (Fformat_network_address): Use local var for size,
21333 for brevity.
21334
0df1eac5
PE
21335 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
21336
847ab9d1 21337 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
21338 * data.c (atof): Remove decl; no longer used or needed.
21339 (digit_to_number): Move to lread.c.
21340 (Fstring_to_number): Use new string_to_number function, to be
21341 consistent with how the Lisp reader treats infinities and NaNs.
21342 Do not assume that floating-point numbers represent EMACS_INT
21343 without losing information; this is not true on most 64-bit hosts.
21344 Avoid double-rounding errors, by insisting on integers when
21345 parsing non-base-10 numbers, as the documentation specifies.
21346 * lisp.h (string_to_number): New decl, replacing ...
21347 (isfloat_string): Remove.
bc0a5c13 21348 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 21349 (read1): Do not accept +. and -. as integers; this
452f4150
PE
21350 appears to have been a coding error. Similarly, do not accept
21351 strings like +-1e0 as floating point numbers. Do not report
21352 overflow for integer overflows unless the base is not 10 which
21353 means we have no simple and reliable way to continue.
21354 Break out the floating-point parsing into a new
21355 function string_to_number, so that Fstring_to_number parses
21356 floating point numbers consistently with the Lisp reader.
04f2d78b 21357 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
21358 (E_CHAR, EXP_INT): Remove, replacing with ...
21359 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
21360 (string_to_number): New function, replacing isfloat_string.
21361 This function checks for valid syntax and produces the resulting
21362 Lisp float number too. Rework it so that string-to-number
bc0a5c13 21363 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
21364 so that overflow for non-base-10 numbers is reported only when
21365 there's no portable and simple way to convert to floating point.
452f4150 21366
67769ffc
PE
21367 * textprop.c (set_text_properties_1): Rewrite for clarity,
21368 and to avoid GCC warning about integer overflow.
21369
c20db43f
PE
21370 * intervals.h (struct interval): Use EMACS_INT for members
21371 where EMACS_UINT might cause problems. See
21372 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
21373 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
21374 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
21375 All uses changed.
37aa2f85
PE
21376 (offset_intervals): Tell GCC not to worry about length overflow
21377 when negating a negative length.
c20db43f 21378
2538aa2f
PE
21379 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
21380 (overrun_check_free): Likewise.
21381
f2d3008d
PE
21382 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
21383 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
21384 word size.
21385
ec8df744
PE
21386 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21387 (gnutls_make_error): Rename local to avoid shadowing.
21388 (gnutls_emacs_global_deinit): ifdef out; not used.
21389 (Fgnutls_boot): Use const for pointer to readonly storage.
21390 Comment out unused local. Fix pointer signedness problems.
21391
640ee02d
PE
21392 * lread.c (openp): Don't stuff size_t into an 'int'.
21393 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
21394 about possible signed overflow.
21395
6048fb2a
PE
21396 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
21397 (GDK_KEY_g): Don't define if already defined.
21398 (xg_prepare_tooltip): Avoid pointer signedness problem.
21399 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
21400
fa3c87e1
PE
21401 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
21402 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
21403
2172544b
PE
21404 * xfns.c (Fx_window_property): Simplify a bit,
21405 to make a bit faster and to avoid GCC 4.6.0 warning.
21406 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
21407
9b821a21
PE
21408 * fns.c (internal_equal): Don't assume size_t fits in int.
21409
3c616cfa
PE
21410 * alloc.c (compact_small_strings): Tighten assertion a little.
21411
c2982e87
PE
21412 Replace pEd with more-general pI, and fix some printf arg casts.
21413 * lisp.h (pI): New macro, generalizing old pEd macro to other
21414 conversion specifiers. For example, use "...%"pI"d..." rather
21415 than "...%"pEd"...".
21416 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 21417 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
21418 * alloc.c (check_pure_size): Don't overflow by converting size to int.
21419 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
21420 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
21421 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
21422 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
21423 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
21424 64-bit hosts.
21425 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
21426 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
21427 * print.c (safe_debug_print, print_object): Likewise.
21428 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
21429 to int.
6f04d126
PE
21430 Use pI instead of if-then-else-abort. Use %p to avoid casts,
21431 avoiding the 0 flag, which is not portable.
c2982e87
PE
21432 * process.c (Fmake_network_process): Use pI to avoid cast.
21433 * region-cache.c (pp_cache): Likewise.
21434 * xdisp.c (decode_mode_spec): Likewise.
21435 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
21436 behavior on 64-bit hosts with printf arg.
6f04d126 21437 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
21438 (x_stop_queuing_selection_requests): Likewise.
21439 (x_get_window_property): Don't truncate byte count to an 'int'
21440 when tracing.
0b432f21 21441
5e073ec7
PE
21442 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
21443 here, since it parses constructs like leading '-' and spaces,
21444 which are not wanted; and it overflows with large numbers.
21445 Instead, simply match F[0-9]+, which is what is wanted anyway.
21446
36372bf9
PE
21447 * alloc.c: Remove unportable assumptions about struct layout.
21448 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
21449 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
21450 (allocate_vectorlike, make_pure_vector): Use the new macros,
21451 plus offsetof, to remove unportable assumptions about struct layout.
21452 These assumptions hold on all porting targets that I know of, but
21453 they are not guaranteed, they're easy to remove, and removing them
21454 makes further changes easier.
21455
0b432f21
PE
21456 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
21457 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
21458 (string_overrun_cookie): Now const. Use initializers that
21459 don't formally overflow signed char, to avoid warnings.
000098c1
PE
21460 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
21461 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
21462 (allocate_buffer): Don't assume sizeof (struct buffer) is a
21463 multiple of sizeof (EMACS_INT); it need not be, if
21464 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 21465 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 21466
895009e1
JB
214672011-04-26 Juanma Barranquero <lekktu@gmail.com>
21468
21469 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
21470
6a7a1b0b
TZ
214712011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
21472
21473 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 21474 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
21475 Reported by Paul Eggert <eggert@cs.ucla.edu>.
21476
841a1577 214772011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
21478
21479 * lisp.h (Qdebug): List symbol.
895009e1 21480 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
21481 * keyboard.c (debug-on-event): New variable.
21482 (handle_user_signal): Break into debugger when debug-on-event
21483 matches the current signal symbol.
21484
f2d3ba6f
DN
214852011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
21486
21487 * alloc.c (check_sblock, check_string_bytes)
21488 (check_string_free_list): Convert to standard C.
21489
42ce4c63
TZ
214902011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
21491
21492 * w32.c (emacs_gnutls_push): Fix typo.
21493
825cd63c
EZ
214942011-04-25 Eli Zaretskii <eliz@gnu.org>
21495
fb11d64d
EZ
21496 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
21497 "cast to pointer from integer of different size".
21498
825cd63c
EZ
21499 Improve doprnt and its use in verror. (Bug#8545)
21500 * doprnt.c (doprnt): Document the set of format control sequences
21501 supported by the function. Use SAFE_ALLOCA instead of always
21502 using `alloca'.
21503
21504 * eval.c (verror): Don't limit the buffer size at size_max-1, that
21505 is one byte too soon. Don't use xrealloc; instead xfree and
21506 xmalloc anew.
21507
e061a11b
TZ
215082011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
21509
21510 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
21511 callbacks stage.
21512
21513 * gnutls.c: Renamed global_initialized to
21514 gnutls_global_initialized. Added internals for the
21515 :verify-hostname-error, :verify-error, and :verify-flags
21516 parameters of `gnutls-boot' and documented those parameters in the
21517 docstring. Start callback support.
9173deec
JB
21518 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
21519 unless a fatal error occurred. Call gnutls_alert_send_appropriate
21520 on error. Return error code.
e061a11b
TZ
21521 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
21522 (emacs_gnutls_read): Likewise.
21523 (Fgnutls_boot): Return handshake error code.
21524 (emacs_gnutls_handle_error): New function.
21525 (wsaerror_to_errno): Likewise.
21526
21527 * w32.h (emacs_gnutls_pull): Add prototype.
21528 (emacs_gnutls_push): Likewise.
21529
21530 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
21531 (emacs_gnutls_push): Likewise.
21532
215332011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
21534
21535 * process.c (wait_reading_process_output): Check if GnuTLS
21536 buffered some data internally if no FDs are set for TLS
21537 connections.
21538
21539 * makefile.w32-in (OBJ2): Add gnutls.$(O).
21540 (LIBS): Link to USER_LIBS.
21541 ($(BLD)/gnutls.$(0)): New target.
21542
fa6996bc
EZ
215432011-04-24 Eli Zaretskii <eliz@gnu.org>
21544
eb35682e
EZ
21545 * xdisp.c (handle_single_display_spec): Rename the
21546 display_replaced_before_p argument into display_replaced_p, to
21547 make it consistent with the commentary. Fix typos in the
21548 commentary.
21549
e2ad650c
EZ
21550 * textprop.c (syms_of_textprop): Remove dead code.
21551 (copy_text_properties): Delete obsolete commentary about an
21552 interface that was deleted long ago. Fix typos in the description
21553 of arguments.
21554
1b2de274
EZ
21555 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
21556 to changes in oldXMenu/XMenu.h from 2011-04-16.
21557 <menu_help_message, prev_menu_help_message>: Constify.
21558 (IT_menu_make_room): menu->help_text is now `const char **';
21559 adjust.
21560
21561 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
21562 to changes in oldXMenu/XMenu.h from 2011-04-16.
21563 (struct XMenu): Declare `help_text' `const char **'.
21564
21565 * xfaces.c <Qunspecified>: Make extern again.
21566
21567 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 21568 required by POSIX.
1b2de274 21569
762b15be
EZ
21570 * doc.c (get_doc_string): Improve the format passed to `error'.
21571
21572 * doprnt.c (doprnt): Improve commentary.
21573
21574 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
21575
21576 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
21577 them with etags.
21578
f1052e5d
EZ
21579 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
21580 changes in globals.h immediately force recompilation.
762b15be
EZ
21581 (TAGS): Depend on $(CURDIR)/m/intel386.h and
21582 $(CURDIR)/s/ms-w32.h.
21583 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 21584
fa6996bc
EZ
21585 * character.c (Fchar_direction): Function deleted.
21586 (syms_of_character): Don't defsubr it.
21587 <char-direction-table>: Deleted.
21588
e6c3da20
EZ
215892011-04-23 Eli Zaretskii <eliz@gnu.org>
21590
21591 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
21592 * doprnt.c: Include limits.h.
21593 (SIZE_MAX): New macro.
04f2d78b
CB
21594 (doprnt): Return a size_t value. 2nd arg is now size_t.
21595 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
21596 Improve overflow protection. Support `l' modifier for integer
21597 conversions. Support %l conversion. Don't assume an EMACS_INT
21598 argument for integer conversions and for %c.
21599
21600 * lisp.h (doprnt): Restore prototype.
21601
21602 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
21603 $(SRC)/character.h.
21604
21605 * Makefile.in (base_obj): Add back doprnt.o.
21606
21607 * deps.mk (doprnt.o): Add back prerequisites.
21608 (callint.o): Depend on character.h.
21609
21610 * eval.c (internal_lisp_condition_case): Include the handler
21611 representation in the error message.
21612 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
21613 when breaking from the loop.
21614
21615 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
21616
21617 * callint.c (Fcall_interactively): When displaying error message
21618 about invalid control letter, pass the character's codepoint, not
21619 a pointer to its multibyte form. Improve display of the character
21620 in octal and display also its hex code.
21621
21622 * character.c (char_string): Use %x to display the (unsigned)
21623 codepoint of an invalid character, to avoid displaying a bogus
21624 negative value.
21625
21626 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
21627 `error', not SYMBOL_NAME itself.
21628
21629 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
21630 character arguments to `error'.
21631
21632 * charset.c (check_iso_charset_parameter): Fix incorrect argument
21633 to `error' in error message about FINAL_CHAR argument. Make sure
21634 FINAL_CHAR is a character, and use %c when it is passed as
21635 argument to `error'.
21636
4ffd0d6b 216372011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
21638
21639 * s/ms-w32.h (localtime): Redirect to sys_localtime.
21640
21641 * w32.c: Include <time.h>.
21642 (sys_localtime): New function.
21643
4ffd0d6b 216442011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
21645
21646 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
21647
4ffd0d6b 21648 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 21649
4ffd0d6b 216502011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 21651
4ffd0d6b
GM
21652 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
21653 zombies (Bug#8467).
aac0c6e3 21654
04c56954
EZ
216552011-04-19 Eli Zaretskii <eliz@gnu.org>
21656
21657 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
21658 gl_state.e_property when gl_state.object is Qt.
21659
21660 * insdel.c (make_gap_larger): Remove limitation of buffer size
21661 to <= INT_MAX.
21662
16a43933
CY
216632011-04-18 Chong Yidong <cyd@stupidchicken.com>
21664
21665 * xdisp.c (lookup_glyphless_char_display)
21666 (produce_glyphless_glyph): Handle cons cell entry in
21667 glyphless-char-display.
21668 (Vglyphless_char_display): Document it.
21669
21670 * term.c (produce_glyphless_glyph): Handle cons cell entry in
21671 glyphless-char-display.
21672
4581706e
CY
216732011-04-17 Chong Yidong <cyd@stupidchicken.com>
21674
21675 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
21676
21677 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
21678
21679 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
21680 definition for no-X builds.
21681
4887c6e2 216822011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 21683
fd35b6f9
PE
21684 Static checks with GCC 4.6.0 and non-default toolkits.
21685
5c1ccb01
PE
21686 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
21687
006c5daa
PE
21688 * process.c (keyboard_bit_set): Define only if SIGIO.
21689 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
21690 (send_process): Repair possible setjmp clobbering.
21691
efc736d3
PE
21692 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
21693
4e2fe2e6
PE
21694 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
21695
f97334a2
PE
21696 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
21697
4e75f29d
PE
21698 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
21699 Define only if needed.
21700
90efadd1
PE
21701 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
21702 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 21703 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 21704
3c647824
PE
21705 * dispextern.h (struct redisplay_interface): Rename param
21706 to avoid shadowing.
e264f262 21707 * termhooks.h (struct terminal): Likewise.
761383f4 21708 * xterm.c (xembed_send_message): Likewise.
3c647824 21709
b58c5c4a
PE
21710 * insdel.c (make_gap_smaller): Define only if
21711 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
21712
cad59032
PE
21713 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
21714 it.
21715
c339dc2e
PE
21716 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
21717 so that we aren't warned about unused symbols.
21718
91a3e27b
PE
21719 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
21720
399c71d3 21721 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 21722
8ffc96f5
PE
21723 * xfns.c (x_real_positions): Mark locals as initialized.
21724
eef9bc79
PE
21725 * xmenu.c (xmenu_show): Don't use uninitialized vars.
21726
098db9dd
PE
21727 * xterm.c: Fix problems found by static analysis with other toolkits.
21728 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
21729 (x_dispatch_event): Declare static if USE_GTK, and
21730 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 21731 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 21732 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
21733 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
21734 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 21735
eb18f6cc
PE
21736 * xmenu.c (menu_help_callback): Pointer type fixes.
21737 Use const pointers when pointing at readonly data. Avoid pointer
21738 signedness clashes.
21739 (FALSE): Remove unused macro.
21740 (update_frame_menubar): Remove unused decl.
21741
1fe72bf8
PE
21742 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
21743
60d9e1db
PE
21744 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
21745 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
21746 (single_menu_item): Rename local to avoid shadowing.
21747
39261c26
PE
21748 * keyboard.c (make_lispy_event): Remove unused local var.
21749
018c5e19
PE
21750 * frame.c, frame.h (x_get_resource_string): Bring this back, but
21751 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
21752
63d2b86e
PE
21753 * bitmaps: Change bitmaps from unsigned char back to the X11
21754 compatible char. Avoid the old compiler warnings about
21755 out-of-range initializers by using, for example, '\xab' rather
21756 than 0xab.
21757
aefd87e1
PE
21758 * xgselect.c (xgselect_initialize): Check vs interface
21759 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
21760
bf501fb9
PE
21761 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
21762
e9829fdf
PE
21763 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
21764 to read-only memory.
21765
1086c095
PE
21766 * fns.c (vector): Remove; this old hack is no longer needed.
21767
2baccd04 21768 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 21769 Remove unused var.
dde42981 21770 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 21771
72391843 21772 * xrdb.c (x_load_resources): Omit unused local.
3565b346 21773
436c16df 21774 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 21775 (x_window): Rename locals to avoid shadowing.
dc5ddd85 21776 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 21777
92bb796d 21778 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 21779 (x_term_init): Remove local to avoid shadowing.
92bb796d 21780
764430a3 21781 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
21782
21783 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
21784 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
21785
d1dfb56c
EZ
217862011-04-16 Eli Zaretskii <eliz@gnu.org>
21787
c4354cb4
EZ
21788 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
21789
d1dfb56c
EZ
21790 Fix regex.c, syntax.c and friends for buffers > 2GB.
21791 * syntax.h (struct gl_state_s): Declare character position members
21792 EMACS_INT.
21793
21794 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
21795
04f2d78b
CB
21796 * textprop.c (verify_interval_modification, interval_of):
21797 Declare arguments EMACS_INT.
d1dfb56c
EZ
21798
21799 * intervals.c (adjust_intervals_for_insertion): Declare arguments
21800 EMACS_INT.
21801
21802 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
21803
21804 * indent.c (Fvertical_motion): Local variable it_start is now
21805 EMACS_INT.
21806
21807 * regex.c (re_match, re_match_2, re_match_2_internal)
21808 (bcmp_translate, regcomp, regexec, print_double_string)
21809 (group_in_compile_stack, re_search, re_search_2, regex_compile)
21810 (re_compile_pattern, re_exec): Declare arguments and local
21811 variables `size_t' and `ssize_t' and return values `regoff_t', as
21812 appropriate.
21813 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
21814 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
21815 <compile_stack_type>: `size' and `avail' are now `size_t'.
21816
21817 * regex.h <regoff_t>: Use ssize_t, not int.
21818 (re_search, re_search_2, re_match, re_match_2): Arguments that
21819 specify buffer/string position and length are now ssize_t and
21820 size_t. Return type is regoff_t.
21821
613052cd
BK
218222011-04-16 Ben Key <bkey76@gmail.com>
21823
21824 * nsfont.m: Fixed bugs in ns_get_family and
21825 ns_descriptor_to_entity that were caused by using free to
21826 deallocate memory blocks that were allocated by xmalloc (via
21827 xstrdup). This caused Emacs to crash when compiled with
21828 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21829 --enable-checking=xmallocoverrun). xfree is now used to
21830 deallocate these memory blocks.
21831
4170f62f 218322011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 21833
71b41406
PE
21834 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21835
9587a89d
PE
21836 emacs_write: Accept and return EMACS_INT for sizes.
21837 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21838 et seq.
21839 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21840 Accept and return EMACS_INT.
21841 (emacs_gnutls_write): Return the number of bytes written on
21842 partial writes.
21843 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
21844 (emacs_read, emacs_write): Remove check for negative size, as the
21845 Emacs source code has been audited now.
9587a89d
PE
21846 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21847 (emacs_read, emacs_write): Use it.
273a5f82
PE
21848 * process.c (send_process): Adjust to the new signatures of
21849 emacs_write and emacs_gnutls_write. Do not attempt to store
21850 a byte offset into an 'int'; it might overflow.
9587a89d 21851 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 21852
3e047f51
PE
21853 * sound.c: Don't assume sizes fit in 'int'.
21854 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 21855 Return EMACS_INT, not int.
3e047f51 21856 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
21857 Accept EMACS_INT, not int.
21858 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
21859 record read return values.
21860
cc39a9db
BK
218612011-04-15 Ben Key <bkey76@gmail.com>
21862
c9d0ec6d
JB
21863 * keyboard.c (Qundefined): Don't declare static since it is used
21864 in nsfns.m.
21865 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21866 static since they are used in nsfont.m.
cc39a9db 21867
6c60eb9f
SM
218682011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21869
21870 * process.c (Qprocessp): Don't declare static.
21871 * lisp.h (Qprocessp): Declare again.
21872
7990b61a
JB
218732011-04-15 Juanma Barranquero <lekktu@gmail.com>
21874
21875 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21876
5d4cb038
PE
218772011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21878
8bd7b830 21879 Improve C-level modularity by making more things 'static'.
cd64ea1d 21880
e3b27b31
PE
21881 Don't publish debugger-only interfaces to other modules.
21882 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21883 (verify_bytepos, count_markers): Move decls to the only modules
21884 that need them.
21885 * region-cache.h (pp_cache): Likewise.
21886 * window.h (check_all_windows): Likewise.
21887 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21888
5d4cb038
PE
21889 * sysdep.c (croak): Now static, if
21890 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21891 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
21892
21893 * alloc.c (refill_memory_reserve): Now static if
21894 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21895 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 21896
e87b6180
PE
21897 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21898 Define only if USE_LUCID.
21899
ac64929e
PE
21900 * xrdb.c (x_customization_string, x_rm_string): Now static.
21901
6f37259d
PE
21902 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21903 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21904
1683e3ab
PE
21905 * xdisp.c (draw_row_with_mouse_face): Now static.
21906 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21907
de9c2632
PE
21908 * window.h (check_all_windows): Mark externally visible.
21909
2b96acb7
PE
21910 * window.c (window_deletion_count): Now static.
21911
21912 * undo.c: Make symbols static if they're not exported.
21913 (last_undo_buffer, last_boundary_position, pending_boundary):
21914 Now static.
21915
50436f33
PE
21916 * textprop.c (interval_insert_behind_hooks): Now static.
21917 (interval_insert_in_front_hooks): Likewise.
21918
64520e5c
PE
21919 * term.c: Make symbols static if they're not exported.
21920 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21921 (max_frame_lines, tty_set_terminal_modes):
21922 (tty_reset_terminal_modes, tty_turn_off_highlight):
21923 (get_tty_terminal): Now static.
21924 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21925 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 21926 HAVE_WINDOW_SYSTEM.
64520e5c
PE
21927 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21928 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21929
1fa53021
PE
21930 * sysdep.c: Make symbols static if they're not exported.
21931 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21932 Now static.
21933 (sigprocmask_set, full_mask): Remove; unused.
21934 (wait_debugging): Mark as visible.
21935 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21936 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21937
d4b43b22
PE
21938 * syntax.c (syntax_temp): Define only if !__GNUC__.
21939
b7c513d0
PE
21940 * sound.c (current_sound_device, current_sound): Now static.
21941
989b29ad
PE
21942 * search.c (searchbufs, searchbuf_head): Now static.
21943
13a55a78
PE
21944 * scroll.c (scroll_cost): Remove; unused.
21945 * dispextern.h (scroll_cost): Remove decl.
21946
de68a1fc
PE
21947 * region-cache.h (pp_cache): Mark as externally visible.
21948
40ccffa6
PE
21949 * process.c: Make symbols static if they're not exported.
21950 (process_tick, update_tick, create_process, chan_process):
21951 (Vprocess_alist, proc_buffered_char, datagram_access):
21952 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21953 (deactivate_process): Mark defn as static, as well as decl.
21954 * lisp.h (create_process): Remove decl.
21955 * process.h (chan_process, Vprocess_alist): Remove decls.
21956
ad64fc97
PE
21957 * print.c: Make symbols static if they're not exported.
21958 (print_depth, new_backquote_output, being_printed, print_buffer):
21959 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21960 (print_interval, print_number_index, initial_stderr_stream):
21961 Now static.
21962 * lisp.h (Fprinc): Remove decl.
21963 (debug_output_compilation_hack): Mark as externally visible.
21964
adddb265
PE
21965 * sysdep.c (croak): Move decl from here to syssignal.h.
21966 * syssignal.h (croak): Put it here, so the API can be checked when
21967 'croak' is called from dissociate_if_controlling_tty.
21968
1717ede2
PE
21969 * minibuf.c: Make symbols static if they're not exported.
21970 (minibuf_save_list, choose_minibuf_frame): Now static.
21971 * lisp.h (choose_minibuf_frame): Remove decl.
21972
fa5fb2bc
PE
21973 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21974
1e3890d1
PE
21975 * lread.c: Make symbols static if they're not exported.
21976 (read_objects, initial_obarray, oblookup_last_bucket_number):
21977 Now static.
21978 (make_symbol): Remove; unused.
21979 * lisp.h (initial_obarray, make_symbol): Remove decls.
21980
8a1414fa
PE
21981 * keyboard.c: Make symbols static if they're not exported.
21982 (single_kboard, recent_keys_index, total_keys, recent_keys):
21983 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21984 (this_single_command_key_start, echoing, last_auto_save):
21985 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21986 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21987 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21988 (Vlispy_mouse_stem, double_click_count):
21989 Now static.
21990 (force_auto_save_soon): Define only if SIGDANGER.
21991 (ignore_mouse_drag_p): Now static if
21992 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21993 (print_help): Remove; unused.
21994 (stop_character, last_timer_event): Mark as externally visible.
21995 * keyboard.h (ignore_mouse_drag_p): Declare only if
21996 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21997 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21998 * lisp.h (echoing): Remove decl.
21999 (force_auto_save_soon): Declare only if SIGDANGER.
22000 * xdisp.c (redisplay_window): Simplify code, to make it more
22001 obvious that ignore_mouse_drag_p is not accessed if !defined
22002 USE_GTK && !defined HAVE_NS.
22003
93ea6e8f
PE
22004 * intervals.c: Make symbols static if they're not exported.
22005 (merge_properties_sticky, merge_interval_right, delete_interval):
22006 Now static.
22007 * intervals.h (merge_interval_right, delete_interval): Remove decls.
22008
77382fcc
PE
22009 * insdel.c: Make symbols static if they're not exported.
22010 However, leave prepare_to_modify_buffer alone. It's never
22011 called from outside this function, but that appears to be a bug.
22012 (combine_after_change_list, combine_after_change_buffer):
4889fc82 22013 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
22014 (adjust_after_replace_noundo): Remove; unused.
22015 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 22016 (signal_before_change): Remove decls.
77382fcc 22017
9306c32e
PE
22018 * indent.c (val_compute_motion, val_vmotion): Now static.
22019
cd44d2eb
PE
22020 * image.c: Make symbols static if they're not exported.
22021 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
22022 if USE_GTK.
22023 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
22024 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
22025
ad9a7a06
PE
22026 * fringe.c (standard_bitmaps): Now static.
22027 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
22028
81626931
PE
22029 * frame.c: Make symbols static if they're not exported.
22030 (x_report_frame_params, make_terminal_frame): Now static.
22031 (get_frame_param): Now static, unless HAVE_NS.
22032 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
22033 (x_get_resource_string): Remove; not used.
22034 * frame.h (make_terminal_frame, x_report_frame_params):
22035 (x_get_resource_string); Remove decls.
22036 (x_fullscreen_adjust): Declare only if WINDOWSNT.
22037 * lisp.h (get_frame_param): Declare only if HAVE_NS.
22038
239f9db9
PE
22039 * font.c, fontset.c: Make symbols static if they're not exported.
22040 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
22041 (FACE_SUITABLE_FOR_CHAR_P): Use it.
22042 * font.c (font_close_object): Now static.
22043 * font.h (font_close_object): Remove.
22044 * fontset.c (FONTSET_OBJLIST): Remove.
22045 (free_realized_fontset) #if-0 the body, which does nothing.
22046 (face_suitable_for_char_p): #if-0, as it's never called.
22047 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
22048 * xfaces.c (face_at_string_position):
22049 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
22050 since 0 is always ASCII.
22051
dfcf3579
PE
22052 * fns.c (weak_hash_tables): Now static.
22053
5045092b
PE
22054 * fileio.c: Make symbols static if they're not exported.
22055 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
22056 (Vwrite_region_annotation_buffers): Now static.
22057
57a96f5c
PE
22058 * eval.c: Make symbols static if they're not exported.
22059 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
22060 * lisp.h (backtrace_list): Remove decl.
22061
35f08c38
PE
22062 * emacs.c: Make symbols static if they're not exported.
22063 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
22064 (fatal_error_code, fatal_error_signal_hook, standard_args):
22065 Now static.
22066 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
22067 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
22068 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
22069 * lisp.h (fatal_error_signal_hook): Remove decl.
22070 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
22071
f44bd759
PE
22072 * editfns.c: Move a (normally-unused) function to its only use.
22073 * editfns.c, lisp.h (get_operating_system_release): Remove.
22074 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
22075 worth the hassle of breaking this out.
22076
b532497d
PE
22077 * xterm.c: Make symbols static if they're not exported.
22078 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
22079 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
22080 (x_destroy_window, x_delete_display):
22081 Now static.
22082 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
22083 (x_mouse_leave): Remove; unused.
22084 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
22085 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
22086 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
22087 Remove decls.
22088 (x_mouse_leave): Declare only if WINDOWSNT.
22089 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
22090 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
22091 USE_X_TOOLKIT.
22092
1675728f
PE
22093 * ftxfont.c: Make symbols static if they're not exported.
22094 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
22095 HAVE_FREETYPE.
22096 * font.h (ftxfont_driver): Likewise.
22097
e4cebfca
PE
22098 * xfns.c: Make symbols static if they're not exported.
22099 (x_last_font_name, x_display_info_for_name):
22100 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
22101 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
22102 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
22103 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
22104 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
22105 (last_show_tip_args): Now static.
22106 (xic_defaut_fontset, xic_create_fontsetname): Define only if
22107 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
22108 (x_screen_planes): Remove; unused.
22109 * dispextern.h (x_screen_planes): Remove decl.
22110
5bf46f05
PE
22111 * dispnew.c: Make symbols static if they're not exported.
22112 * dispextern.h (redraw_garbaged_frames, scrolling):
22113 (increment_row_positions): Remove.
22114 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
22115 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
22116 Now static.
22117 (redraw_garbaged_frames): Remove; unused.
22118
435f4c28
PE
22119 * xfaces.c: Make symbols static if they're not exported.
22120 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
22121 Remove decls.
22122 * xterm.h (defined_color): Remove decls.
22123 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
22124 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
22125 (menu_face_changed_default, defined_color, free_realized_face):
22126 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
22127 (ascii_face_of_lisp_face): Remove; unused.
22128
8524aef3
PE
22129 * xdisp.c: Make symbols static if they're not exported.
22130 * dispextern.h (scratch_glyph_row, window_box_edges):
22131 (glyph_to_pixel_coords, set_cursor_from_row):
22132 (get_next_display_element, set_iterator_to_next):
22133 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
22134 (show_mouse_face): Remove decls
22135 * frame.h (message_buf_print): Likewise.
22136 * lisp.h (pop_message, set_message, check_point_in_composition):
22137 Likewise.
22138 * xterm.h (set_vertical_scroll_bar): Likewise.
22139 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
22140 (message_buf_print, scratch_glyph_row, displayed_buffer):
22141 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
22142 (get_next_display_element, show_mouse_face, window_box_edges):
22143 (frame_to_window_pixel_xy, check_point_in_composition):
22144 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
22145 (glyph_to_pixel_coords): Remove; unused.
22146
16390cd2
PE
22147 * dired.c (file_name_completion): Now static.
22148
22149 * dbusbind.c (xd_in_read_queued_messages): Now static.
22150
a25f4dfa
PE
22151 * lisp.h (circular_list_error, FOREACH): Remove; unused.
22152 * data.c (circular_list_error): Remove.
22153
14a9c8df
PE
22154 * commands.h (last_point_position, last_point_position_buffer):
22155 (last_point_position_window): Remove decls.
22156 * keyboard.c: Make these variables static.
22157
04f2d78b
CB
22158 * coding.h (coding, code_convert_region, encode_coding_gap):
22159 Remove decls.
74ab6df5
PE
22160 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
22161 (iso_code_class, detect_coding, code_convert_region): Now static.
22162 (encode_coding_gap): Remove; unused.
22163
38dfbee1
PE
22164 * chartab.c (chartab_chars, chartab_bits): Now static.
22165
a2cb4e63
PE
22166 * charset.h (charset_iso_8859_1): Remove decl.
22167 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
22168 Now static.
22169
127198fd
PE
22170 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
22171 * ccl.c (Vccl_program_table): Now static.
22172 (check_ccl_update): Remove; unused.
22173
d85b608f
PE
22174 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
22175 * category.h: ... from here.
22176 * category.c (check_category_table, set_category_set): Now static.
22177
31cd66f3
PE
22178 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
22179 * lisp.h: Remove these decls.
22180
c358e587
PE
22181 * buffer.c (buffer_count): Remove unused var.
22182
e78aecca
PE
22183 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
22184 so that it's not optimized away.
22185 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
22186 * dispextern.h (bidi_dump_cached_states): Remove, since it's
22187 exported only to the debugger.
22188
e192d7d3 22189 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 22190 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 22191
92470028
PE
22192 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
22193 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
22194 was inaccessible from Lisp.
22195 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
22196 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
22197
244ed907
PE
22198 alloc.c: Import and export fewer symbols, and remove unused items.
22199 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
22200 is defined.
22201 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
22202 it's not optimized away by whole-program optimization.
22203 (message_enable_multibyte, free_misc): Remove.
22204 (catchlist, handlerlist, mark_backtrace):
22205 Declare only if BYTE_MARK_STACK.
22206 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
22207 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
22208 (message_enable_multibyte): Remove decl.
22209 (free_misc, interval_free_list, float_block, float_block_index):
22210 (n_float_blocks, float_free_list, cons_block, cons_block_index):
22211 (cons_free_list, last_marked_index):
22212 Now static.
22213 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
22214 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
22215 (mark_backtrace): Define only if BYTE_MARK_STACK.
22216 * xdisp.c (message_enable_multibyte): Now static.
22217
61c2b50e 22218 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
22219 This makes it easier for human readers (and static analyzers)
22220 to see whether these variables are used from other modules.
22221 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
22222 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
22223 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
22224 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
22225 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
22226 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
22227 * xmenu.c, xselect.c:
22228 Declare Q* vars static if they are not used in other modules.
22229 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
22230 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
22231 Remove decls of unexported vars.
22232 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
22233
95c82688
PE
22234 * lisp.h (DEFINE_FUNC): Make sname 'static'.
22235
16a97296
PE
22236 Make Emacs functions such as Fatom 'static' by default.
22237 This makes it easier for human readers (and static analyzers)
22238 to see whether these functions can be called from other modules.
22239 DEFUN now defines a static function. To make the function external
22240 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
22241 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
22242 (Finit_image_library):
16a97296
PE
22243 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
22244 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
22245 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
22246 Remove decls, since these functions are now static.
22247 (Funintern, Fget_internal_run_time): New decls, since these functions
22248 were already external.
95c82688 22249
16a97296
PE
22250 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
22251 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
22252 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
22253 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
22254 * keyboard.c, keymap.c, lread.c:
22255 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
22256 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
22257 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
22258 Mark functions with DEFUE instead of DEFUN,
22259 if they are used in other modules.
22260 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
22261 decls for now-static functions.
22262 * buffer.h (Fdelete_overlay): Remove decl.
22263 * callproc.c (Fgetenv_internal): Mark as internal.
22264 * composite.c (Fremove_list_of_text_properties): Remove decl.
22265 (Fcomposition_get_gstring): New forward static decl.
22266 * composite.h (Fcomposite_get_gstring): Remove decl.
22267 * dired.c (Ffile_attributes): New forward static decl.
22268 * doc.c (Fdocumntation_property): New forward static decl.
22269 * eval.c (Ffetch_bytecode): New forward static decl.
22270 (Funintern): Remove extern decl; now in .h file where it belongs.
22271 * fileio.c (Fmake_symbolic_link): New forward static decl.
22272 * image.c (Finit_image_library): New forward static decl.
22273 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
22274 * intervals.h (Fprevious_property_change):
22275 (Fremove_list_of_text_properties): Remove decls.
22276 * keyboard.c (Fthis_command_keys): Remove decl.
22277 (Fcommand_execute): New forward static decl.
22278 * keymap.c (Flookup_key): New forward static decl.
22279 (Fcopy_keymap): Now static.
22280 * keymap.h (Flookup_key): Remove decl.
22281 * process.c (Fget_process): New forward static decl.
22282 (Fprocess_datagram_address): Mark as internal.
22283 * syntax.c (Fsyntax_table_p): New forward static decl.
22284 (skip_chars): Remove duplicate decl.
22285 * textprop.c (Fprevious_property_change): New forward static decl.
22286 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
22287 Now internal.
22288 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
22289 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
22290
785bbd42
PE
22291 * editfns.c (Fformat): Remove unreachable code.
22292
8b913b57
AS
222932011-04-14 Andreas Schwab <schwab@linux-m68k.org>
22294
22295 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
22296 change. (Bug#8496)
22297
a6744a35
EZ
222982011-04-13 Eli Zaretskii <eliz@gnu.org>
22299
22300 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
22301 when at ZV. (Bug#8487)
22302
e7974947
AS
223032011-04-12 Andreas Schwab <schwab@linux-m68k.org>
22304
baad03f0
AS
22305 * charset.c (Fclear_charset_maps): Use xfree instead of free.
22306 (Bug#8437)
22307 * keyboard.c (parse_tool_bar_item): Likewise.
22308 * sound.c (sound_cleanup, alsa_close): Likewise.
22309 * termcap.c (tgetent): Likewise.
22310 * xfns.c (x_default_font_parameter): Likewise.
22311 * xsettings.c (read_and_apply_settings): Likewise.
22312
e7974947
AS
22313 * alloc.c (overrun_check_malloc, overrun_check_realloc)
22314 (overrun_check_free): Protoize.
22315
28272684
PE
223162011-04-12 Paul Eggert <eggert@cs.ucla.edu>
22317
22318 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
22319 since callers should never pass a negative size.
22320 Change the signature to match that of plain 'read' and 'write'; see
22321 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
22322 * lisp.h: Update prototypes of emacs_write and emacs_read.
22323
11997c76
EZ
223242011-04-11 Eli Zaretskii <eliz@gnu.org>
22325
22326 * xdisp.c (redisplay_window): Don't try to determine the character
22327 position of the scroll margin if the window start point w->startp
e896f03c 22328 is outside the buffer's accessible region. (Bug#8468)
11997c76 22329
8a2cbd72
EZ
223302011-04-10 Eli Zaretskii <eliz@gnu.org>
22331
22332 Fix write-region and its subroutines for buffers > 2GB.
22333 * fileio.c (a_write, e_write): Modify declaration of arguments and
22334 local variables to support buffers larger than 2GB.
22335 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
22336
22337 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
22338 argument, local variables, and return value.
22339
22340 * lisp.h: Update prototypes of emacs_write and emacs_read.
22341
22342 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
22343
4073e537 223442011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 22345
1ebfdcb6
PE
22346 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
22347
b2ded58d
PE
22348 Fix more problems found by GCC 4.6.0's static checks.
22349
7d66342c
PE
22350 * xdisp.c (vmessage): Use a better test for character truncation.
22351
bbf47d44
PE
22352 * charset.c (load_charset_map): <, not <=, for optimization,
22353 and to avoid potential problems with integer overflow.
9248994d 22354 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 22355 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 22356 * editfns.c (Fformat): Likewise.
1e69125e 22357 * syntax.c (skip_chars): Likewise.
3befa583 22358
e3019616
PE
22359 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
22360 This also lets GCC 4.6.0 generate slightly better loop code.
22361
becfa255
PE
22362 * callint.c (Fcall_interactively): <, not <=, for optimization.
22363 (Fcall_interactively): Count the number of arguments produced,
22364 not the number of arguments given. This is simpler and lets GCC
22365 4.6.0 generate slightly better code.
22366
dae0cd48
PE
22367 * ftfont.c: Distingish more carefully between FcChar8 and char.
22368 The previous code passed unsigned char * to a functions like
22369 strlen and xstrcasecmp that expect char *, which does not
22370 conform to the C standard.
22371 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
22372 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
22373 char * when the C standard requires it.
22374
76032d70
PE
22375 * keyboard.c (read_char): Remove unused var.
22376
eb3f1cc8
PE
22377 * eval.c: Port to Windows vsnprintf (Bug#8435).
22378 Include <limits.h>.
22379 (SIZE_MAX): Define if the headers do not.
22380 (verror): Do not give up if vsnprintf returns a negative count.
22381 Instead, grow the buffer. This ports to Windows vsnprintf, which
22382 does not conform to C99. Problem reported by Eli Zaretskii.
22383 Also, simplify the allocation scheme, by avoiding the need for
22384 calling realloc, and removing the ALLOCATED variable.
22385
70476b54
PE
22386 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
22387
12020a9e
PE
22388 Remove invocations of doprnt, as Emacs now uses vsnprintf.
22389 But keep the doprint source code for now, as we might revamp it
22390 and use it again (Bug#8435).
ea6c7ae6
PE
22391 * lisp.h (doprnt): Remove.
22392 * Makefile.in (base_obj): Remove doprnt.o.
22393 * deps.mk (doprnt.o): Remove.
22394
5fdb398c
PE
22395 error: Print 32- and 64-bit integers portably (Bug#8435).
22396 Without this change, on typical 64-bit hosts error ("...%d...", N)
22397 was used to print both 32- and 64-bit integers N, which relied on
22398 undefined behavior.
61bdb816 22399 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
22400 * lisp.h (error, verror): Mark as printf-like functions.
22401 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
22402 Report overflow in size calculations when allocating printf buffer.
22403 Do not truncate output string at its first null byte.
22404 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
22405 Truncate the output at a character boundary, since vsnprintf does not
22406 do that.
22407 * charset.c (check_iso_charset_parameter): Convert internal
22408 character to string before calling 'error', since %c now has the
22409 printf meaning.
22410 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
22411 overflow when computing char to be passed to 'error'. Do not
22412 pass Lisp_Object to 'error'; pass the integer instead.
22413 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
22414 formatted with plain %d.
22415
b189fa66
PE
22416 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
22417
bff87ef0
PE
22418 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
22419
7e2cac20
PE
22420 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
22421
ce4d90b5
PE
22422 * xterm.c (x_catch_errors): Remove duplicate declaration.
22423
266c9547
PE
22424 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
22425
79c49ad2
PE
22426 * xdisp.c, lisp.h (message_nolog): Remove; unused.
22427
368f4090
JM
224282011-04-10 Jim Meyering <meyering@redhat.com>
22429
22430 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
22431 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
22432 return ssize_t not "int", and use size_t as the buffer length.
22433 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
22434 * gnutls.h: Update declarations.
22435 * process.c (read_process_output): Use ssize_t, to match.
22436 (send_process): Likewise.
22437
a32d4040
CY
224382011-04-09 Chong Yidong <cyd@stupidchicken.com>
22439
22440 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
22441
8546720e 224422011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 22443
04f2d78b
CB
22444 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
22445 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 22446
8546720e
GM
22447 * xterm.c (handle_one_xevent):
22448 * xmenu.c (create_and_show_popup_menu):
22449 * xselect.c (x_decline_selection_request)
22450 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 22451
0a2f5c1a 224522011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
22453
22454 Fix some uses of `int' instead of EMACS_INT.
22455 * search.c (string_match_1, fast_string_match)
22456 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
22457 (scan_buffer, find_next_newline_no_quit)
22458 (find_before_next_newline, search_command, Freplace_match)
22459 (Fmatch_data): Make some `int' variables be EMACS_INT.
22460
22461 * xdisp.c (display_count_lines): 3rd argument and return value now
22462 EMACS_INT. All callers changed.
22463 (pint2hrstr): Last argument is now EMACS_INT.
22464
22465 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
22466 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
22467 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
22468 (decode_coding_utf_16, decode_coding_emacs_mule)
22469 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
22470 (decode_coding_ccl, decode_coding_charset)
22471 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
22472 (decode_coding_iso_2022, decode_coding_emacs_mule)
22473 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
22474 <char_offset, last_offset>: Declare EMACS_INT.
22475 (encode_coding_utf_8, encode_coding_utf_16)
22476 (encode_coding_emacs_mule, encode_invocation_designation)
22477 (encode_designation_at_bol, encode_coding_iso_2022)
22478 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
22479 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
22480 Declare EMACS_INT.
22481 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
22482 (encode_invocation_designation): Last argument P_NCHARS is now
22483 EMACS_INT.
22484 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
22485 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
22486
22487 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
22488 All users changed.
22489
22490 * ccl.c (Fccl_execute_on_string): Declare some variables
22491 EMACS_INT.
22492
8546720e 224932011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
22494
22495 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
22496
4e19a977
CS
224972011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
22498
22499 * process.c (Fformat_network_address): Doc fix.
22500
87302331
R
225012011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
22502
ee7683eb 22503 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 22504
cbb59342
CY
225052011-04-08 Chong Yidong <cyd@stupidchicken.com>
22506
22507 * keyboard.c (read_char): Call Lisp function help-form-show,
22508 instead of using internal_with_output_to_temp_buffer.
22509 (Qhelp_form_show): New var.
e0d38eeb 22510 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
22511
22512 * print.c (internal_with_output_to_temp_buffer): Function deleted.
22513
22514 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
22515
e67a13ab
CY
225162011-04-06 Chong Yidong <cyd@stupidchicken.com>
22517
04f2d78b
CB
22518 * process.c (Flist_processes): Remove to Lisp.
22519 (list_processes_1): Delete.
e67a13ab 22520
973f782d
EZ
225212011-04-06 Eli Zaretskii <eliz@gnu.org>
22522
7c106b1e
EZ
22523 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
22524
973f782d
EZ
22525 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
22526
41cf7d1a 225272011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 22528
ca23cc88
PE
22529 Fix more problems found by GCC 4.6.0's static checks.
22530
f390e2d5
PE
22531 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
22532
42eea0d0
PE
22533 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
22534
b69769da 22535 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 22536
f9541e84
PE
22537 * xdisp.c (vmessage): Mark as a printf-like function.
22538
13841b55
PE
22539 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
22540
c136c10f
PE
22541 * sound.c (sound_warning): Don't crash if arg contains a printf format.
22542
5e2d4a30
PE
22543 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
22544 printf-like functions.
22545 (tiff_load): Add casts to remove these marks before passing them
22546 to system-supplied API.
22547
583f48b9
PE
22548 * eval.c (Fsignal): Remove excess argument to 'fatal'.
22549
b25d760e
PE
22550 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
22551 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
22552 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
22553 directly, rather than having caller test rule sign. This avoids
22554 some unnecessary tests.
22555 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
22556 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
22557 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 22558
bc7b6697 22559 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 22560 (xfont_open): Avoid unnecessary tests.
bc7b6697 22561
27ccc379
PE
22562 * composite.c (composition_gstring_put_cache): Use unsigned integer.
22563
dcd5c89a
PE
22564 * composite.h, composite.c (composition_gstring_put_cache):
22565 Use EMACS_INT, not int, for length.
22566
b13a45c6
PE
22567 * composite.h (COMPOSITION_DECODE_REFS): New macro,
22568 breaking out part of COMPOSITION_DECODE_RULE.
22569 (COMPOSITION_DECODE_RULE): Use it.
22570 * composite.c (get_composition_id): Remove unused local vars,
22571 by using the new macro.
22572
1e792e4d
PE
22573 * textprop.c (set_text_properties_1): Change while to do-while,
22574 since the condition is always true at first.
22575
dc6c6455 22576 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
22577 (interval_deletion_adjustment): Return unsigned value.
22578 All uses changed.
dc6c6455 22579
aba7731a
PE
22580 * process.c (list_processes_1, create_pty, read_process_output):
22581 (exec_sentinel): Remove vars that were set but not used.
afd4052b 22582 (create_pty): Remove unnecessary "volatile"s.
bc57d757 22583 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 22584 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 22585 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 22586
fdfc4bf3
PE
22587 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
22588
fca8fe46 22589 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 22590 (update_syntax_table): Use unsigned instead of int.
fca8fe46 22591
06a0259a 22592 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 22593 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 22594 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 22595
e7b9e80f
PE
22596 * print.c (print_error_message): Avoid int overflow.
22597
56201685
PE
22598 * font.c (font_list_entities): Redo for clarity,
22599 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
22600
78834453 22601 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 22602 (font_score): Avoid potential overflow in diff calculation.
78834453 22603
0bc0b309 22604 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 22605 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 22606
e610eaca
PE
22607 * eval.c (funcall_lambda): Rename local to avoid shadowing.
22608
b895abce
PE
22609 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
22610 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
22611 can always succeed if overflow has undefined behavior.
22612
1f1d9321 22613 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 22614 (wordify): Omit three unnecessary tests.
1f1d9321 22615
c59478bc
PE
22616 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
22617 All callers changed. This avoids the need for an unused var.
22618
79b73827
PE
22619 * casefiddle.c (casify_region): Remove var that is set but not used.
22620
a4db5dfe
PE
22621 * dired.c (file_name_completion): Remove var that is set but not used.
22622
43aae36e
PE
22623 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
22624
2a47c44d 22625 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 22626 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 22627
a37c69bf
PE
22628 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
22629 Check for integer overflow on size calculations.
22630
328ab8e7
PE
22631 * buffer.c (Fprevious_overlay_change): Remove var that is set
22632 but not used.
22633
e5a2a5cb
PE
22634 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
22635 Remove vars that are set but not used.
8d84a6eb 22636 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 22637 (timer_check_2): Mark vars as initialized.
e5a2a5cb 22638
a60e5f68
PE
22639 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
22640
f661cb61 22641 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 22642 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 22643
f0397f5a
PE
22644 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
22645 that are set but not used.
22646
8664db06 22647 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 22648 if XCreateBitmapFromData fails (Bug#8410).
8664db06 22649
6abdaa4a
PE
22650 * xselect.c (x_get_local_selection, x_handle_property_notify):
22651 Remove vars that are set but not used.
22652
0ce7538d 22653 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 22654 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 22655
9ae848fc
PE
22656 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
22657 Remove var that is set but not used.
0b918413
PE
22658 (scroll_bar_windows_size): Now size_t, not int.
22659 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
22660 Check for overflow.
9ae848fc 22661
a5a62657
PE
22662 * xfaces.c (realize_named_face): Remove vars that are set but not used.
22663 (map_tty_color) [!defined MSDOS]: Likewise.
22664
5c5cdd39
PE
22665 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
22666
66ebf983
PE
22667 * coding.c: Remove vars that are set but not used.
22668 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
22669 All callers changed.
22670 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
22671 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
22672 (decode_coding_charset): Remove vars that are set but not used.
22673
1be4d761
PE
22674 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
22675 that is set but not used.
22676
47553fa8
PE
22677 * print.c (print_object): Remove var that is set but not used.
22678
1f7196bf 22679 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
22680 The gnulib version avoids calling malloc in the usual case,
22681 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
22682 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
22683 * filelock.c (current_lock_owner): Likewise.
22684 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
22685 * sysdep.c: Include allocator.h, careadlinkat.h.
22686 (emacs_no_realloc_allocator): New static constant.
22687 (emacs_readlink): New function.
fdb61804
PE
22688 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
22689 ../lib/careadlinkat.h.
d1fdcab7 22690
f84c17c7
SM
226912011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
22692
22693 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
22694 first non-nil return value).
22695
ef3862ad
JD
226962011-04-03 Jan Djärv <jan.h.d@swipnet.se>
22697
22698 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
22699 if not defined (Bug#8403).
22700
376a7006
JB
227012011-04-02 Juanma Barranquero <lekktu@gmail.com>
22702
22703 * xdisp.c (display_count_lines): Remove parameter `start',
22704 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22705 (get_char_face_and_encoding): Remove parameter `multibyte_p',
22706 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22707 (fill_stretch_glyph_string): Remove parameters `row' and `area',
22708 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
22709 and thereabouts. All callers changed.
22710 (get_per_char_metric): Remove parameter `f', unused since
22711 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
22712
6ca3801d
JM
227132011-04-02 Jim Meyering <meyering@redhat.com>
22714
22715 do not dereference NULL upon failed strdup
22716 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
22717 (ns_get_family): Likewise.
22718
d8e2b5ba
JB
227192011-04-02 Juanma Barranquero <lekktu@gmail.com>
22720
22721 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
22722
8c74fcbd
JD
227232011-04-02 Jan Djärv <jan.h.d@swipnet.se>
22724
22725 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
22726 later (Bug#8403).
22727
7200d79c
SM
227282011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
22729
03408648 22730 Add lexical binding.
7200d79c 22731
03408648
SM
22732 * window.c (Ftemp_output_buffer_show): New fun.
22733 (Fsave_window_excursion):
22734 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
22735
22736 * lread.c (lisp_file_lexically_bound_p): New function.
22737 (Fload): Bind Qlexical_binding.
22738 (readevalloop): Remove `evalfun' arg.
22739 Bind Qinternal_interpreter_environment.
22740 (Feval_buffer): Bind Qlexical_binding.
22741 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
22742 Mark as dynamic.
22743 (syms_of_lread): Declare `lexical-binding'.
22744
22745 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
22746
22747 * keyboard.c (eval_dyn): New fun.
22748 (menu_item_eval_property): Use it.
ca105506
SM
22749
22750 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 22751
03408648
SM
22752 * fns.c (concat, mapcar1): Accept byte-code-functions.
22753
22754 * eval.c (Fsetq): Handle lexical vars.
22755 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
22756 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
22757 (FletX, Flet): Obey lexical binding.
22758 (Fcommandp): Handle closures.
22759 (Feval): New `lexical' arg.
22760 (eval_sub): New function extracted from Feval. Use it almost
22761 everywhere where Feval was used. Look up vars in lexical env.
22762 Handle closures.
22763 (Ffunctionp): Move from subr.el.
22764 (Ffuncall): Handle closures.
22765 (apply_lambda): Remove `eval_flags'.
22766 (funcall_lambda): Handle closures and new byte-code-functions.
22767 (Fspecial_variable_p): New function.
22768 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
22769 but without exporting it to Lisp.
23aba0ea 22770
23aba0ea 22771 * doc.c (Fdocumentation, store_function_docstring):
03408648 22772 * data.c (Finteractive_form): Handle closures.
23aba0ea 22773
03408648
SM
22774 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
22775 interactive spec.
ba83908c 22776
04f2d78b
CB
22777 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
22778 New byte-codes.
03408648
SM
22779 (exec_byte_code): New function extracted from Fbyte_code to handle new
22780 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 22781
03408648 22782 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 22783
03408648 22784 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 22785
e2abce01
JB
227862011-03-31 Juanma Barranquero <lekktu@gmail.com>
22787
22788 * xdisp.c (redisplay_internal): Fix prototype.
22789
63696a73 227902011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 22791
63696a73 22792 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
22793 (try_scrolling): Use it when setting scroll_limit.
22794 Limit scrolling to 100 screen lines.
63696a73
EZ
22795 (redisplay_window): Even when falling back on "recentering",
22796 position point in the window according to scroll-conservatively,
22797 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
22798
22799 (try_scrolling): When point is above the window, allow searching
22800 as far as scroll_max, or one screenful, to compute vertical
22801 distance from PT to the scroll margin position. This prevents
22802 try_scrolling from unnecessarily failing when
22803 scroll-conservatively is set to a value slightly larger than the
22804 window height. Clean up the case of PT below the margin at bottom
22805 of window: scroll_max can no longer be INT_MAX. When aggressive
22806 scrolling is in use, don't let point enter the opposite scroll
22807 margin as result of the scroll.
22808 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
22809 threshold of 100 lines for never-recentering scrolling.
22810
e4cc2dfc
JB
228112011-03-31 Juanma Barranquero <lekktu@gmail.com>
22812
22813 * dispextern.h (move_it_by_lines):
22814 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
22815 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
22816 (message_log_check_duplicate): Remove parameters `prev_bol' and
22817 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
22818 (redisplay_internal): Remove parameter `preserve_echo_area',
22819 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22820
22821 * indent.c (Fvertical_motion):
22822 * window.c (window_scroll_pixel_based, Frecenter):
22823 Don't pass `need_y_p' to `move_it_by_lines'.
22824
1c470562
SM
228252011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22826
44f230aa
SM
22827 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22828 steal a few bits to be more compact.
22829 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22830 Remove unneeded casts.
22831
1c470562
SM
22832 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22833
888adce9
ZK
228342011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22835
22836 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22837 binding" message (bug#7967).
22838
f838ed7b
PE
228392011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22840
77861b95
PE
22841 Fix more problems found by GCC 4.6.0's static checks.
22842
de6dbc14
PE
22843 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22844 Remove unused local var.
22845
f838ed7b
PE
22846 * editfns.c (Fmessage_box): Remove unused local var.
22847
792c7b2b
PE
22848 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22849 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22850 Omit unused local vars.
c499e557 22851 * window.c (shrink_windows): Omit unused local var.
b01a1c29 22852 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
22853 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22854 Omit unused local var.
22855
ba0165e1
PE
22856 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22857 Don't assume string length fits in int.
32ad8845 22858 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 22859 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 22860
3c59b4c9
PE
22861 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22862 instead of alloca (Bug#8344).
22863
a3eed478 22864 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 22865 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 22866
eb4d412d
PE
22867 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22868
1658b401
PE
22869 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22870 concerns.
22871
22872 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22873
22874 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 22875
9a2c6e05
PE
22876 * keyboard.c (syms_of_keyboard): Use the same style as later
22877 in this function when indexing through an array. This also
22878 works around GCC bug 48267.
22879
03d0a109
PE
22880 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22881
44f730c8
PE
22882 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22883
fe75f926
PE
22884 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22885 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22886
ffa8c828
PE
22887 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22888 This avoids undefined behavior on integer overflow, and is a bit
22889 more convenient anyway since it is compared to a size_t variable.
22890
c5101a77
PE
22891 Variadic C functions now count arguments with size_t, not int.
22892 This avoids an unnecessary limitation on 64-bit machines, which
22893 caused (substring ...) to crash on large vectors (Bug#8344).
22894 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22895 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 22896 All variadic functions and their callers changed accordingly.
c5101a77
PE
22897 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22898 * data.c (arith_driver, float_arith_driver): Likewise.
22899 * editfns.c (general_insert_function): Likewise.
22900 * eval.c (struct backtrace.nargs, interactive_p)
22901 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22902 (funcall_lambda, mark_backtrace): Likewise.
22903 * fns.c (concat): Likewise.
22904 * frame.c (x_set_frame_parameters): Likewise.
22905 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22906 0 if not found, not -1. All callers changed.
22907
dd3f25f7
PE
22908 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22909 (stack_copy_size): Now size_t, not int.
22910 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22911
461c2ab9
JB
229122011-03-28 Juanma Barranquero <lekktu@gmail.com>
22913
22914 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22915 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22916 All callers changed.
22917
22918 * lisp.h (multibyte_char_to_unibyte):
22919 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22920 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22921 * character.h (CHAR_TO_BYTE8):
22922 * cmds.c (internal_self_insert):
22923 * editfns.c (general_insert_function):
22924 * keymap.c (push_key_description):
22925 * search.c (Freplace_match):
22926 * xdisp.c (message_dolog, set_message_1): All callers changed.
22927
f6d62986
SM
229282011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22929
22930 * keyboard.c (safe_run_hook_funcall): New function.
22931 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22932 don't set the hook to nil, but remove the offending function instead.
22933 (Qcommand_hook_internal): Remove, unused.
22934 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22935 Vcommand_hook_internal.
22936
22937 * eval.c (enum run_hooks_condition): Remove.
22938 (funcall_nil, funcall_not): New functions.
22939 (run_hook_with_args): Call each function through a `funcall' argument.
22940 Remove `cond' argument, now redundant.
22941 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22942 (Frun_hook_with_args_until_failure): Adjust accordingly.
22943 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22944
1db5b1ad
JB
229452011-03-28 Juanma Barranquero <lekktu@gmail.com>
22946
22947 * dispextern.h (string_buffer_position): Remove declaration.
22948
22949 * print.c (strout): Remove parameter `multibyte', unused since
22950 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22951
22952 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22953 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22954 All callers changed.
22955
22956 * w32.c (_wsa_errlist): Use braces for struct initializers.
22957
22958 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22959 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22960 All callers changed.
22961 (string_buffer_position): Likewise. Also, make static (it's never
22962 used outside xdisp.c).
22963 (cursor_row_p): Remove parameter `w', unused since
22964 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22965 (decode_mode_spec): Remove parameter `precision', introduced during
22966 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22967 All callers changed.
22968
5ffb62aa
JD
229692011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22970
22971 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22972
461c2ab9 229732011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
22974
22975 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22976 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22977 (ns_update_auto_hide_menu_bar): New functions.
22978 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22979 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22980 ns_constrain_all_frames.
22981 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22982 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22983
5c380ffb
JD
229842011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22985
22986 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22987
9af30bdf
GM
229882011-03-27 Glenn Morris <rgm@gnu.org>
22989
22990 * syssignal.h: Replace RETSIGTYPE with void.
22991 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22992 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22993 Replace SIGTYPE with void everywhere.
22994 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22995 * s/template.h (SIGTYPE): Remove commented out definition.
22996
e2abce01
JB
229972011-03-26 Eli Zaretskii <eliz@gnu.org>
22998
22999 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
23000 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
23001
f868cd8a
JB
230022011-03-26 Juanma Barranquero <lekktu@gmail.com>
23003
59eb0929
JB
23004 * w32.c (read_unc_volume): Use parameter `henum', instead of
23005 global variable `wget_enum_handle'.
23006
23007 * keymap.c (describe_vector): Remove parameters `indices' and
23008 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
23009 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
23010
f868cd8a
JB
23011 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
23012
23013 * keyboard.c (timer_check): Remove parameter `do_it_now',
23014 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
23015 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
23016 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
23017
23018 * keyboard.c (read_char):
23019 * w32menu.c (w32_menu_display_help):
23020 * xmenu.c (show_help_event, menu_help_callback):
23021 Adjust calls to `show_help_echo'.
23022
23023 * gtkutil.c (xg_maybe_add_timer):
23024 * keyboard.c (readable_events):
23025 * process.c (wait_reading_process_output):
23026 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
23027
23028 * insdel.c (adjust_markers_gap_motion):
23029 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
23030 (gap_left, gap_right): Don't call it.
23031
2ecf6fdb
CY
230322011-03-25 Chong Yidong <cyd@stupidchicken.com>
23033
23034 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
23035 incurred during fontification.
23036
6b1f9ba4
JB
230372011-03-25 Juanma Barranquero <lekktu@gmail.com>
23038
23039 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
23040 (DEFVAR_PER_BUFFER): Don't pass it.
23041
23042 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
23043 (scrolling_window): Don't pass it.
23044
0f4a96b5
JB
230452011-03-25 Juanma Barranquero <lekktu@gmail.com>
23046
23047 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
23048
23049 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
23050 and `suffix'.
23051 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
23052 of variables specific to SELinux and computation of `encoded_absname'.
23053
23054 * image.c (XPutPixel): Remove unused variable `height'.
23055
23056 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
23057
23058 * unexw32.c (get_section_info): Remove unused variable `section'.
23059
23060 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
23061 (system_process_attributes): Remove unused variable `sess'.
23062 (sys_read): Remove unused variable `err'.
23063
23064 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
23065 (w32_wnd_proc): Remove unused variable `isdead'.
23066 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
23067 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
23068 (x_create_tip_frame): Remove unused variable `tem'.
23069
23070 * w32inevt.c (w32_console_read_socket):
23071 Remove unused variable `no_events'.
23072
23073 * w32term.c (x_draw_composite_glyph_string_foreground):
23074 Remove unused variable `width'.
23075
1149507c
JB
230762011-03-24 Juanma Barranquero <lekktu@gmail.com>
23077
23078 * w32term.c (x_set_glyph_string_clipping):
23079 Don't pass uninitialized region to CombineRgn.
23080
9c88f339
JB
230812011-03-23 Juanma Barranquero <lekktu@gmail.com>
23082
23083 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
23084 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
23085 (Fx_close_connection): Remove unused variable `i'.
23086
23087 * w32font.c (w32font_draw): Return number of glyphs.
23088 (w32font_open_internal): Remove unused variable `i'.
23089 (w32font_driver): Add missing initializer.
23090
23091 * w32menu.c (utf8to16): Remove unused variable `utf16'.
23092 (fill_in_menu): Remove unused variable `items_added'.
23093
23094 * w32term.c (last_mouse_press_frame): Remove static global variable.
23095 (w32_clip_to_row): Remove unused variable `f'.
23096 (x_delete_terminal): Remove unused variable `i'.
23097
23098 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
23099 (NOTHING): Remove unused static global variable.
23100 (uniscribe_check_otf): Remove unused variable `table'.
23101 (uniscribe_font_driver): Add missing initializers.
23102
dee091a3
JD
231032011-03-23 Julien Danjou <julien@danjou.info>
23104
23105 * term.c (Fsuspend_tty, Fresume_tty):
23106 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
23107 * window.c (temp_output_buffer_show):
23108 * insdel.c (signal_before_change):
23109 * frame.c (Fhandle_switch_frame):
23110 * fileio.c (Fdo_auto_save):
23111 * emacs.c (Fkill_emacs):
23112 * editfns.c (save_excursion_restore):
23113 * cmds.c (internal_self_insert):
23114 * callint.c (Fcall_interactively):
23115 * buffer.c (Fkill_all_local_variables):
23116 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
23117 Use Frun_hooks.
0f4a96b5 23118 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 23119 unconditionally since it does the check itself.
dee091a3 23120
2c520ab5 231212011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 23122
c9c49752
PE
23123 Fix more problems found by GCC 4.5.2's static checks.
23124
8abc3f12
PE
23125 * coding.c (encode_coding_raw_text): Avoid unnecessary test
23126 the first time through the loop, since we know p0 < p1 then.
23127 This also avoids a gcc -Wstrict-overflow warning.
23128
a2d26660
PE
23129 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
23130 leading to a memory leak, possible in functions like
23131 load_charset_map_from_file that can allocate an unbounded number
b12ef411 23132 of objects (Bug#8318).
a2d26660 23133
916c72e9
PE
23134 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
23135 that could (at least in theory) be that large.
23136
19ab8a18
PE
23137 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
23138 This is less likely to overflow, and avoids undefined behavior if
23139 overflow does occur. All callers changed. Use strtoul to scan
23140 for the unsigned long integer.
b7cbbd6f
PE
23141 (pint2hrstr): Simplify and tune code slightly.
23142 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 23143
f0641eff
PE
23144 * scroll.c (do_scrolling): Work around GCC bug 48228.
23145 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
23146
7f650bb9
PE
23147 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
23148 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
23149 (validate_x_resource_name): Simplify count usage.
23150 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 23151
37dd57d1
PE
23152 * fileio.c (Fcopy_file): Report error if fchown or fchmod
23153 fail (Bug#8306).
81e56e61 23154
699979fc 23155 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 23156
401bf9b4
PE
23157 * process.c (Fmake_network_process): Use socklen_t, not int,
23158 where POSIX says socklen_t is required in portable programs.
23159 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 23160 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
23161 (Fmake_network_process, server_accept_connection):
23162 (wait_reading_process_output, read_process_output):
23163 Likewise.
23164
b93aacde
PE
23165 * process.c: Rename or move locals to avoid shadowing.
23166 (list_processes_1, Fmake_network_process):
23167 (read_process_output_error_handler, exec_sentinel_error_handler):
23168 Rename or move locals.
4dc343ee 23169 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 23170 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 23171 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 23172 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 23173 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 23174
af8a867c 23175 Make tparam.h and terminfo.c consistent.
44f230aa
SM
23176 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
23177 Include tparam.h instead, since it declares them.
af8a867c
PE
23178 * cm.h (PC): Remove extern decl; tparam.h now does this.
23179 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
23180 * terminfo.c: Include tparam.h, to check interfaces.
23181 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
23182 (tparam): Adjust signature to match interface in tparam.h;
23183 this removes some undefined behavior. Check that outstring and len
23184 are zero, which they always are with Emacs.
23185 * tparam.h (PC, BC, UP): New extern decls.
23186
0248044d 23187 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 23188 (xftfont_open): Rename locals to avoid shadowing.
0248044d 23189
8ff096c1 23190 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
23191 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
23192 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 23193 (ftfont_list): Remove unused local.
49eaafba
PE
23194 (get_adstyle_property, ftfont_pattern_entity):
23195 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
23196 Rename locals to avoid shadowing.
8ff096c1 23197
e2be39f6
PE
23198 * xfont.c (xfont_list_family): Mark var as initialized.
23199
c9735e30
PE
23200 * xml.c (make_dom): Now static.
23201
8f5201ae
PE
23202 * composite.c (composition_compute_stop_pos): Rename local to
23203 avoid shadowing.
b246f932
PE
23204 (composition_reseat_it): Remove unused locals.
23205 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 23206 (composition_update_it): Mark var as initialized.
11b61122
PE
23207 (find_automatic_composition): Mark vars as initialized,
23208 with a FIXME (Bug#8290).
8f5201ae 23209
760fbc2c
PE
23210 character.h: Rename locals to avoid shadowing.
23211 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
23212 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
23213 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
23214 (BUF_DEC_POS): Be more systematic about renaming local temporaries
23215 to avoid shadowing.
23216
ff08eb85
PE
23217 * textprop.c (property_change_between_p): Remove; unused.
23218
fc7bf025
PE
23219 * intervals.c (interval_start_pos): Now static.
23220
235d7abc
PE
23221 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
23222
44f230aa
SM
23223 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
23224 Rename locals to avoid shadowing.
3e7d6594 23225
50060332
PE
23226 * sound.c (wav_play, au_play, Fplay_sound_internal):
23227 Fix pointer signedness.
d01f234b 23228 (alsa_choose_format): Remove unused local var.
c83b8872
PE
23229 (wav_play): Initialize a variable to 0, to prevent undefined
23230 behavior (Bug#8278).
50060332 23231
c4fc4e30
PE
23232 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
23233
918436ed
PE
23234 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
23235
c939f91b
PE
23236 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
23237 clobbering (Bug#8298).
b9c7f648
PE
23238 * sysdep.c (sys_subshell): Likewise.
23239 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 23240
6bd8c144
PE
23241 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
23242 This should get cleaned up, so that child_setup has the
23243 same signature on all platforms.
23244
7710357c 23245 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 23246 (relocate_fd): Rename locals to avoid shadowing.
7710357c 23247
c59da222
CY
232482011-03-22 Chong Yidong <cyd@stupidchicken.com>
23249
23250 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
23251 not to be necessary, and produces flickering.
23252
66b87493
GM
232532011-03-20 Glenn Morris <rgm@gnu.org>
23254
23255 * config.in: Remove file.
23256
45b6f6d5
JB
232572011-03-20 Juanma Barranquero <lekktu@gmail.com>
23258
23259 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
23260 are now in src/globals.h.
23261 (syms_of_minibuf): Remove spurious & from previous change.
23262
cd394be1 232632011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
23264
23265 * minibuf.c (completing-read-function): New variable.
23266 (completing-read-default): Rename from completing-read.
23267 (completing-read): Call completing-read-function.
23268
b14e3e21
CY
232692011-03-19 Juanma Barranquero <lekktu@gmail.com>
23270
23271 * xfaces.c (Fx_load_color_file):
23272 Read color file from absolute filename (bug#8250).
23273
f2b726e6
JB
232742011-03-19 Juanma Barranquero <lekktu@gmail.com>
23275
23276 * makefile.w32-in: Update dependencies.
23277
09f6ff02
EZ
232782011-03-17 Eli Zaretskii <eliz@gnu.org>
23279
23280 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
23281
29a6015a
PE
232822011-03-17 Paul Eggert <eggert@cs.ucla.edu>
23283
a3a6c54e
PE
23284 Fix more problems found by GCC 4.5.2's static checks.
23285
b766f867
PE
23286 * process.c (make_serial_process_unwind, send_process_trap):
23287 (sigchld_handler): Now static.
23288
be02381c
PE
23289 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
23290 That way, the code declares only the vars that it needs.
23291 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
23292 * s/cygwin.h (PTY_ITERATION): Likewise.
23293 * s/darwin.h (PTY_ITERATION): Likewise.
23294 * s/gnu-linux.h (PTY_ITERATION): Likewise.
23295
57048744
PE
23296 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
23297 * process.c (allocate_pty): Don't declare stb unless it's needed.
23298
7914961c 23299 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
23300 (CONSTANTLIM): Remove; unused.
23301 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
23302 Define only if needed.
7914961c 23303
b3967b18
PE
23304 * unexelf.c (unexec): Name an expression,
23305 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
23306 Use a different way to cause a compilation error if anyone uses
23307 n rather than nn, a way that does not involve shadowing.
73366a00 23308 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 23309
29a6015a
PE
23310 * deps.mk (unexalpha.o): Remove; unused.
23311
43cfc33e 23312 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 23313 * unexec.h: New file.
ce701a33
PE
23314 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
23315 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
23316 Depend on unexec.h.
23317 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
23318 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
23319 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 23320 Change as necessary to match prototype in unexec.h.
ce701a33 23321
01f44d5a
PE
23322 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
23323 shadowing.
4f63c6bb 23324 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 23325
a6670b0b
PE
23326 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
23327 Rename locals to avoid shadowing.
23328
cef2010d 23329 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 23330 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 23331
d4d7173a
PE
23332 * print.c (Fredirect_debugging_output): Fix pointer signedess.
23333
f08b802a
PE
23334 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
23335 warning when compiling print.c.
23336
3ddb0639
PE
23337 * font.c (font_unparse_fcname): Abort in an "impossible" situation
23338 instead of using an uninitialized var.
5ad03b97 23339 (font_sort_entities): Mark var as initialized.
3ddb0639 23340
170a2692
PE
23341 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
23342
e663c700
PE
23343 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
23344 pointers to constants.
89bc529a 23345 (font_parse_fcname): Remove unused vars.
7b81e2d0 23346 (font_delete_unmatched): Now static.
ea838e10 23347 (font_get_spec): Remove; unused.
13a547c6
PE
23348 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
23349 (font_update_drivers, Ffont_get_glyphs, font_add_log):
23350 Rename or move locals to avoid shadowing.
e663c700 23351
2a80c887 23352 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 23353 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 23354
1384fa33 23355 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 23356 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 23357
8b2c52e9
PE
23358 * alloc.c (mark_backtrace): Move decl from here ...
23359 * lisp.h: ... to here, so that it can be checked.
23360
475545b5 23361 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 23362 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
23363 (lisp_indirect_variable): Name an expression,
23364 to avoid gcc -Wbad-function-cast warning.
1faed8ae 23365 (Fdefvar): Rename locals to avoid shadowing.
475545b5 23366
b1349114 23367 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 23368 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 23369 Use const pointer when appropriate.
b1349114 23370
a2928364
PE
23371 * lisp.h (get_system_name, get_operating_system_release):
23372 Move decls here, to check interfaces.
23373 * process.c (get_operating_system_release): Move decl to lisp.h.
23374 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
23375 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
23376 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
23377 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
23378 (Fformat_time_string, Fencode_time, Finsert_char):
23379 (Ftranslate_region_internal, Fformat):
23380 Rename or remove local vars to avoid shadowing.
9710023e 23381 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 23382
a415e694
PE
23383 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
23384 avoid shadowing.
23385
8ef4622d
PE
23386 * lisp.h (eassert): Check that the argument compiles, even if
23387 ENABLE_CHECKING is not defined.
23388
946f9a5b
PE
23389 * data.c (Findirect_variable): Name an expression, to avoid
23390 gcc -Wbad-function-cast warning.
112396d6 23391 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 23392 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
23393 (Fmake_variable_buffer_local, Fmake_local_variable):
23394 Mark variables as initialized.
52746918 23395 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 23396
e5aab7e7 23397 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
23398 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
23399 Rename locals to avoid shadowing.
dff45157
PE
23400 (mark_stack): Move local variables into the #ifdef region where
23401 they're used.
7bc26fdb
PE
23402 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
23403 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
23404 needed otherwise.
23405 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
23406 (GC_STRING_CHARS): Remove; not used.
d40d4be1 23407 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 23408
e5aab7e7
PE
23409 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
23410 avoids undefined behavior in theory.
23411
4da60324
PE
23412 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
23413
88043301
PE
23414 Use functions, not macros, for up- and down-casing (Bug#8254).
23415 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23416 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
23417 to use the following functions instead of these macros.
23418 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
23419 EMACS_INT, since callers assume the returned value fits in int.
23420 (upcase1): Likewise, for UPCASE_TABLE.
23421 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 23422 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 23423 the race-condition problem in the old DOWNCASE.
88043301 23424
19ed5445
PE
23425 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
23426 Rename locals to avoid shadowing.
23427 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
23428 (regex_compile, re_search_2, re_match_2_internal):
23429 Remove unused local vars.
952db0d7
PE
23430 (FREE_VAR): Rewrite so as not to use empty "else",
23431 which gcc can warn about.
da053e48 23432 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
23433 (RETALLOC_IF): Define only if needed.
23434 (WORDCHAR_P): Likewise. This one is never needed, but is used
23435 only in a comment talking about a compiler bug, so put inside
23436 the #if 0 of that comment.
23437 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
23438 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
23439 Remove; unused.
19ed5445 23440
1f3561e4 23441 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
23442 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
23443 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 23444
ded6f8f7
PE
23445 * search.c (simple_search): Remove unused var.
23446
dbd37a95
PE
23447 * dired.c (compile_pattern): Move decl from here ...
23448 * lisp.h: ... to here, so that it can be checked.
23449 (struct re_registers): New forward decl.
23450
7e47afad
PE
23451 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
23452
85f24f61
PE
23453 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
23454 All uses changed.
23455 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
23456 Rename locals to avoid shadowing.
5671df8f 23457 (Fvertical_motion): Mark locals as initialized.
85f24f61 23458
181aa2be 23459 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 23460 (casify_region): Mark local as initialized.
181aa2be 23461
930d429c
PE
23462 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
23463
7082eac6
PE
23464 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
23465 New macros, so that the caller can use some names other than
23466 gcpro1, gcpro2, etc.
23467 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
23468 of the new macros.
23469 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
23470 argument, for consistency with GCPRO2_VAR, etc: it is now the
23471 prefix of the variable, not the variable itself. All uses
23472 changed.
38b2c076
PE
23473 * dired.c (directory_files_internal, file_name_completion):
23474 Rename locals to avoid shadowing.
23475
15206ed9
PE
23476 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
23477 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
23478 dired.c's scmp function, had undefined behavior.
23479 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
23480 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
23481 * buffer.h: ... to here, because these macros use current_buffer,
23482 and the new implementation with inline functions needs to have
23483 current_buffer in scope now, rather than later when the macros
23484 are used.
23485 (downcase, upcase1): New static inline functions.
23486 (DOWNCASE, UPCASE1): Reimplement using these functions.
23487 This avoids undefined behavior in expressions like
23488 DOWNCASE (x) == DOWNCASE (y), which previously suffered
23489 from race conditions in accessing the global variables
23490 case_temp1 and case_temp2.
23491 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
23492 * lisp.h (case_temp1, case_temp2): Remove their decls.
23493 * character.h (ASCII_CHAR_P): Move from here ...
23494 * lisp.h: ... to here, so that the inline functions mentioned
23495 above can use them.
23496
4a6bea26
PE
23497 * dired.c (directory_files_internal_unwind): Now static.
23498
f14b7e14
PE
23499 * fileio.c (file_name_as_directory, directory_file_name):
23500 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
23501 Now static.
2893f146
PE
23502 (file_name_as_directory): Use const pointers when appropriate.
23503 (Fexpand_file_name): Likewise. In particular, newdir might
23504 point at constant storage, so make it a const pointer.
fd4ead52 23505 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
23506 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
23507 signedness issues.
f839df0c
PE
23508 (Fset_file_times, Finsert_file_contents, auto_save_error):
23509 Rename locals to avoid shadowing.
f14b7e14 23510
5716756e 23511 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
23512 (Ftry_completion, Fall_completions): Rename or remove locals
23513 to avoid shadowing.
5716756e 23514
b4c3046a
PE
23515 * marker.c (bytepos_to_charpos): Remove; unused.
23516
b45db522
PE
23517 * lisp.h (verify_bytepos, count_markers): New decls,
23518 so that gcc does not warn that these functions aren't declared.
23519
85876d07
PE
23520 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
23521 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 23522 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 23523 (copy_text): Remove unused local var.
85876d07 23524
03d78a21 23525 * filelock.c (within_one_second): Now static.
b3dd38ab 23526 (lock_file_1): Rename local to avoid shadowing.
03d78a21 23527
5df8f01b
PE
23528 * buffer.c (fix_overlays_before): Mark locals as initialized.
23529 (fix_start_end_in_overlays): Likewise. This function should be
23530 simplified by using pointers-to-pointers, but that's a different
23531 matter.
b1d876f1 23532 (switch_to_buffer_1): Now static.
8f54f30a
PE
23533 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
23534 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 23535
a70072c9 23536 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 23537 Fix pointer signedness issue.
edced198
PE
23538 (sys_subshell): Mark local as volatile if checking for lint,
23539 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 23540 (MAXPATHLEN): Define only if needed.
a70072c9 23541
a0977c44
PE
23542 * process.c (serial_open, serial_configure): Move decls from here ...
23543 * systty.h: ... to here, so that they can be checked.
23544
a884fdcc
PE
23545 * fns.c (get_random, seed_random): Move extern decls from here ...
23546 * lisp.h: ... to here, so that they can be checked.
23547
604efe86 23548 * sysdep.c (reset_io): Now static.
b8950c94 23549 (wait_for_termination_signal): Remove; unused.
604efe86 23550
38fc62d9
PE
23551 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
23552 (copy_keymap_item, append_key, push_text_char_description):
23553 Now static.
1004a21a 23554 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 23555 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
23556 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
23557 (describe_map_tree):
23558 Rename locals to avoid shadowing.
38fc62d9 23559
2f2650da
PE
23560 * keyboard.c: Declare functions static if they are not used elsewhere.
23561 (echo_char, echo_dash, cmd_error, top_level_2):
23562 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
23563 (read_char, kbd_buffer_get_event, make_lispy_position):
23564 (make_lispy_event, make_lispy_movement, apply_modifiers):
23565 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
23566 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
23567 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 23568 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 23569 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 23570
a053e86c 23571 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
23572 (mark_kboards): Move decl here ...
23573 * alloc.c (mark_kboards): ... from here.
a053e86c 23574
4752793e
PE
23575 * lisp.h (force_auto_save_soon): New decl.
23576
74f10ca7 23577 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
23578 (DEFINE_DUMMY_FUNCTION): New macro.
23579 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
23580 Use it.
c03cd23f
PE
23581 (main): Add casts to avoid warnings
23582 if GCC considers string literals to be constants.
74f10ca7 23583
022e70d4
PE
23584 * lisp.h (fatal_error_signal): Add decl, since it's exported.
23585
59d6fe83
PE
23586 * dbusbind.c: Pointer signedness fixes.
23587 (xd_signature, xd_append_arg, xd_initialize):
23588 (Fdbus_call_method, Fdbus_call_method_asynchronously):
23589 (Fdbus_method_return_internal, Fdbus_method_error_internal):
23590 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
23591 (Fdbus_register_signal): Use SSDATA when the context wants char *.
23592
78320123
PE
23593 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
23594 if GCC considers string literals to be constants.
49cebcca 23595 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 23596
35ac2a97
SM
235972011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
23598
fb103ca9
SM
23599 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
23600 (print_preprocess, print_object): New macro to fix last change.
23601
35ac2a97
SM
23602 * print.c (print_preprocess): Don't forget font objects.
23603
62973b41
JB
236042011-03-16 Juanma Barranquero <lekktu@gmail.com>
23605
23606 * emacs.c (USAGE3): Doc fixes.
23607
0e48bb22
AS
236082011-03-15 Andreas Schwab <schwab@linux-m68k.org>
23609
23610 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
23611 structure.
23612
7684e57b
JB
236132011-03-14 Juanma Barranquero <lekktu@gmail.com>
23614
23615 * lisp.h (VWindow_system, Qfile_name_history):
23616 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
23617 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
23618 (w32_system_caret_x, w32_system_caret_y): Declare extern.
23619
23620 * w32select.c: Don't #include "keyboard.h".
c96bbc66 23621 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
23622
23623 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
23624 * w32console.c (detect_input_pending, read_input_pending)
23625 (encode_terminal_code):
23626 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
23627 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
23628 (w32_system_caret_y, Qfile_name_history):
23629 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
23630 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
23631 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
23632 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
23633 * w32proc.c (Qlocal, report_file_error):
23634 * w32term.c (Vwindow_system, updating_frame):
23635 * w32uniscribe.c (initialized, uniscribe_font_driver):
23636 Remove unneeded extern declarations.
23637
2aa46d6c
CY
236382011-03-14 Chong Yidong <cyd@stupidchicken.com>
23639
c96bbc66 23640 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 23641
cffc6f3b
CY
236422011-03-13 Chong Yidong <cyd@stupidchicken.com>
23643
23644 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
23645 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
23646 These macros can no longer be used for assignment.
23647
44f230aa
SM
23648 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
23649 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
23650 (record_buffer_markers, fetch_buffer_markers): New functions for
23651 recording and fetching special buffer markers.
23652 (set_buffer_internal_1, set_buffer_temp): Use them.
23653
23654 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
23655
23656 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
23657
23658 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
23659 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
23660
23661 * xdisp.c (hscroll_window_tree):
23662 (reconsider_clip_changes): Use PT instead of BUF_PT.
23663
d251f04b
EZ
236642011-03-13 Eli Zaretskii <eliz@gnu.org>
23665
23666 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
23667 $(EMACS_ROOT)/lib/intprops.h.
23668
f0c77cd1
PE
236692011-03-13 Paul Eggert <eggert@cs.ucla.edu>
23670
3eca4629
PE
23671 Fix more problems found by GCC 4.5.2's static checks.
23672
7c86ee98
PE
23673 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
23674 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
23675 (xg_free_frame_widgets): Make it clear that a local variable is
23676 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
23677 (gdk_window_get_screen): Make it clear that this macro is needed
23678 only if USE_GTK_TOOLTIP.
1e5524e7
PE
23679 (int_gtk_range_get_value): New function, which avoids a diagnostic
23680 from gcc -Wbad-function-cast.
23681 (xg_set_toolkit_scroll_bar_thumb): Use it.
23682 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
23683 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
23684 (get_utf8_string, xg_get_file_with_chooser):
23685 Rename locals to avoid shadowing.
23686 (create_dialog): Move locals to avoid shadowing.
7c86ee98 23687
41729b81
PE
23688 * xgselect.c (xg_select): Remove unused var.
23689
f0c77cd1
PE
23690 * image.c (four_corners_best): Mark locals as initialized.
23691 (gif_load): Initialize transparent_p to zero (Bug#8238).
23692 Mark another local as initialized.
ec6cf4c6 23693 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 23694
ce0ad53d 23695 * image.c (clear_image_cache): Now static.
d5d5a617 23696 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 23697 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
23698 (x_edge_detection): Remove unnecessary cast that
23699 gcc -Wbad-function-cast diagnoses.
2037898d 23700 (gif_load): Fix pointer signedness.
6ae141d6
PE
23701 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
23702 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 23703
33383987 237042011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 23705
d32df629
PE
23706 Improve quality of tests for time stamp overflow.
23707 For example, without this patch (encode-time 0 0 0 1 1
23708 1152921504606846976) returns the obviously-bogus value (-948597
23709 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
23710 reports time overflow. See
23711 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
23712 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
23713 * editfns.c: Include limits.h and intprops.h.
23714 (TIME_T_MIN, TIME_T_MAX): New macros.
23715 (time_overflow): Move earlier, to before first use.
23716 (hi_time, lo_time): New functions, for an accurate test for
23717 out-of-range times.
23718 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
23719 (Fget_internal_run_time): Don't assume time_t fits in int.
23720 (make_time): Use list2 instead of Fcons twice.
23721 (Fdecode_time): More accurate test for out-of-range times.
23722 (check_tm_member): New function.
23723 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
23724 (lisp_time_argument): Don't rely on undefined left-shift and
23725 right-shift behavior when checking for time stamp overflow.
8be6f318 23726
fe31d94c
PE
23727 * editfns.c (time_overflow): New function, refactoring common code.
23728 (Fformat_time_string, Fdecode_time, Fencode_time):
23729 (Fcurrent_time_string): Use it.
23730
8be6f318
PE
23731 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
23732 * dired.c (make_time): Move to ...
23733 * editfns.c (make_time): ... here.
23734 * systime.h: Note the move.
23735
09d9db2c 237362011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 23737
126bc0dc
YM
23738 * fringe.c (update_window_fringes): Remove unused variables.
23739
c47cbdfd
YM
23740 * unexmacosx.c (copy_data_segment): Also copy __got section.
23741 (Bug#8223)
23742
7ac80be9
EZ
237432011-03-12 Eli Zaretskii <eliz@gnu.org>
23744
c96bbc66 23745 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
23746 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
23747 Constify `char *' arguments and their references according to
23748 prototypes in tparam.h.
23749
ecb0f94d 23750 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 23751
7ac80be9
EZ
23752 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
23753 Adapt all references accordingly.
23754
23755 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
23756
ef1fd07e
TT
237572011-03-11 Tom Tromey <tromey@redhat.com>
23758
23759 * buffer.c (syms_of_buffer): Remove obsolete comment.
23760
7ef4b50c
EZ
237612011-03-11 Eli Zaretskii <eliz@gnu.org>
23762
23763 * termhooks.h (encode_terminal_code): Declare prototype.
23764
23765 * msdos.c (encode_terminal_code): Don't declare prototype.
23766
23767 * term.c (encode_terminal_code): Now external again, used by
23768 w32console.c and msdos.c.
23769
44f230aa
SM
23770 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
23771 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 23772
4b1ec863 237732011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 23774
1714f52b 23775 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 23776
4b1ec863
PE
23777 * fringe.c (update_window_fringes): Mark locals as initialized
23778 (Bug#8227).
23779 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 23780
524c7aa6
PE
23781 * alloc.c (mark_fringe_data): Move decl from here ...
23782 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
23783 to check its interface.
23784 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
23785
a5c0af81 23786 * fontset.c (free_realized_fontset): Now static.
7519b8cd 23787 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 23788 (fontset_font): Mark local as initialized.
a9a06e0b 23789 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 23790
b4716021
PE
23791 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
23792
811e9bac 23793 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 23794 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
23795 (x_own_selection, Fx_disown_selection_internal): Rename locals
23796 to avoid shadowing.
23797 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 23798
7e3ab302
PE
23799 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
23800 so that the caller can use some name other than gcpro1.
23801 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
23802 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23803 (Fx_backspace_delete_keys_p):
23804 Use them to avoid shadowing, and rename vars to avoid shadowing.
23805 (x_decode_color, x_set_name, x_window): Now static.
6b437900 23806 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 23807 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
23808 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
23809 Remove unused locals.
7e3ab302
PE
23810 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
23811 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
23812 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
23813 macros.
f78faa98 23814
e2b13473
PE
23815 * xterm.h (x_mouse_leave): New decl.
23816
77f23912
PE
23817 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
23818 Remove unused functions.
cdf4ba58
PE
23819 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23820 (x_calc_absolute_position): Now static.
7411c686 23821 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 23822 Don't declare local "event" unless it's used.
ed7bf3a5
PE
23823 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23824 unless they are used.
38d0b34a
PE
23825 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23826 (x_fatal_error_signal): Remove; not used.
a6067996
PE
23827 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23828 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23829 (x_error_catcher, x_connection_closed, x_error_handler):
23830 (x_error_quitter, xembed_send_message, x_iconify_frame):
23831 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 23832 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 23833 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 23834
44f230aa
SM
23835 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23836 Rename or move locals to avoid shadowing.
6b463e58 23837 (tty_defined_color, merge_face_heights): Now static.
5967d051 23838 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
23839 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23840 does not deduce is never used uninitialized.
73719eba
PE
23841 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23842 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 23843
426994c3 23844 * terminal.c (store_terminal_param): Now static.
5489860b 23845
032f1620 23846 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 23847 (set_frame_menubar): Remove unused local.
d4323972 23848 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
23849 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23850 since they might point to immutable storage.
281585b0
PE
23851 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23852 since it's unused otherwise.
032f1620 23853
367c19e5 23854 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 23855 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
23856 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23857 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 23858 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
23859 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23860 does not deduce are never used uninitialized.
70739cbe 23861
07b48fa9
PE
23862 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23863
8868a238 23864 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
23865 * window.c (window_loop, size_window):
23866 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 23867
7e5cf297 23868 * window.c (display_buffer): Now static.
d6550a9f
PE
23869 (size_window): Mark variables that gcc -Wuninitialized
23870 does not deduce are never used uninitialized.
a586633d
PE
23871 * window.h (check_all_windows): New decl, to forestall
23872 gcc -Wmissing-prototypes diagnostic.
5b555da1 23873 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 23874
f6095868
PE
23875 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23876 shadowing.
23877 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
23878 Include <limits.h>.
23879 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23880 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
23881 (load_charset_map): Mark variables that gcc -Wuninitialized
23882 does not deduce are never used uninitialized.
53df7c11 23883 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 23884
f38b440c
PE
23885 * coding.c (coding_set_source, coding_set_destination):
23886 Use "else { /* comment */ }" rather than "else /* comment */;"
23887 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
23888 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23889 a block, when the outer 'i' will do.
23890 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23891 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23892 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23893 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23894 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23895 Rename locals to avoid shadowing.
23896 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
23897 * coding.c (emacs_mule_char, encode_invocation_designation):
23898 Now static, since they're not used elsewhere.
413bb2db 23899 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 23900 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
23901 (decode_coding_emacs_mule): Mark variables that gcc
23902 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
23903 (detect_coding_iso_2022): Initialize a local variable that might
23904 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 23905 this initialization is needed. (Bug#8211)
5f58e762
PE
23906 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23907 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23908 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23909 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23910 Remove unused macros.
f38b440c 23911
232b38b9 23912 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 23913 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 23914 * character.c (string_count_byte8): Likewise.
232b38b9 23915
fb90da1b
PE
23916 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23917 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23918
fb93dbc2
PE
23919 * chartab.c (copy_sub_char_table): Now static, since it's not used
23920 elsewhere.
5c156ace
PE
23921 (sub_char_table_ref_and_range, char_table_ref_and_range):
23922 Rename locals to avoid shadowing.
bbcd0949 23923 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 23924
7d3b3862 23925 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 23926 (BIDI_BOB): Remove unused macro.
7d3b3862 23927
6be7d3da
PE
23928 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23929 deduce are never used uninitialized.
c2ed9c8b 23930 * term.c (encode_terminal_code): Likewise.
6be7d3da 23931
75f8807f 23932 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 23933
50938595
PE
23934 * tparam.h: New file.
23935 * term.c, tparam.h: Include it.
23936 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23937 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23938 Move these decls to tparam.h, and make them agree with what
23939 is actually in tparam.c. The previous trick of using incompatible
23940 decls in different modules does not conform to the C standard.
23941 All callers of tparam changed to use tparam's actual API.
23942 * tparam.c (tparam1, tparam, tgoto):
23943 Use const pointers where appropriate.
23944
fbceeba2
PE
23945 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23946 * cm.h (struct cm): Likewise.
23947 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23948 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23949 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23950 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23951 (turn_on_face, init_tty): Likewise.
23952 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 23953
7f3f1250
PE
23954 * term.c (term_mouse_position): Rename local to avoid shadowing.
23955
e6ca6543
PE
23956 * alloc.c (mark_ttys): Move decl from here ...
23957 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23958
c40f8d15
AS
239592011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23960
23961 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23962
cfe0661d
JB
239632011-03-09 Juanma Barranquero <lekktu@gmail.com>
23964
23965 * search.c (compile_pattern_1): Remove argument regp, unused since
23966 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23967 (compile_pattern): Don't pass it.
23968
0afb4571
J
239692011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23970
23971 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23972 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23973 for ! HAVE_GTK3.
23974 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23975
23976 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23977
23978 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23979 gdk_window_get_screen, gdk_window_get_geometry,
23980 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23981 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23982 (xg_get_pixbuf_from_pixmap): New function.
23983 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23984 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23985 Call xg_get_pixbuf_from_pixmap instead of
23986 gdk_pixbuf_get_from_drawable.
23987 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23988 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23989 (xg_check_special_colors): Use GtkStyleContext and its functions
23990 for HAVE_GTK3.
23991 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23992 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23993 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
23994 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23995 Call gtk_widget_get_preferred_size.
0afb4571
J
23996 (xg_frame_resized): gdk_window_get_geometry only takes 5
23997 parameters.
44f230aa
SM
23998 (xg_win_to_widget, xg_event_is_for_menubar):
23999 Call gdk_x11_window_lookup_for_display.
0afb4571
J
24000 (xg_set_widget_bg): New function.
24001 (delete_cb): New function.
895009e1 24002 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 24003 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
24004 (xg_set_background_color): Call xg_set_widget_bg.
24005 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
24006 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
24007 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
24008 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
24009 if ! HAVE_GTK3.
24010 (update_frame_tool_bar): Call gtk_widget_hide.
24011 (xg_initialize): Use GDK_KEY_g.
24012
24013 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
24014 if ! HAVE_GTK3
24015 (x_session_initialize): Call gdk_x11_set_sm_client_id.
24016
24017 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
24018 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
24019 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
24020
1c2cc4ef
JB
240212011-03-08 Juanma Barranquero <lekktu@gmail.com>
24022
24023 * w32xfns.c (select_palette): Check success of RealizePalette against
24024 GDI_ERROR, not zero.
24025
33383987 24026See ChangeLog.11 for earlier changes.
aac0c6e3
MR
24027
24028;; Local Variables:
24029;; coding: utf-8
aac0c6e3
MR
24030;; End:
24031
ab422c4d 24032 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
24033
24034 This file is part of GNU Emacs.
24035
24036 GNU Emacs is free software: you can redistribute it and/or modify
24037 it under the terms of the GNU General Public License as published by
24038 the Free Software Foundation, either version 3 of the License, or
24039 (at your option) any later version.
24040
24041 GNU Emacs is distributed in the hope that it will be useful,
24042 but WITHOUT ANY WARRANTY; without even the implied warranty of
24043 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24044 GNU General Public License for more details.
24045
24046 You should have received a copy of the GNU General Public License
24047 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.