Merge Org 7.9.3d (commit e8f5b0ad).
[bpt/emacs.git] / src / ChangeLog
CommitLineData
f5e9cbd4 12013-01-11 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
38693137
JD
2
3 * gtkutil.c (xg_initialize): Backport from trunk.
4 Add ifdef HAVE_FREETYPE around x_last_font_name (Bug#13403).
5
b6f960a0
PE
62013-01-11 Paul Eggert <eggert@cs.ucla.edu>
7
45b7bfdd
PE
8 Backport typo fix from trunk, for AIX (Bug#13408).
9 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
10 This follows up on the 2012-09-29 patch that removed indirection
11 for the 'function' field. Reported by Sergey Vinokurov in
12 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
13
b6f960a0
PE
14 Fix SIGDANGER handlers, for AIX (Bug#13408).
15 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
16 Move handlers here from emacs.c; they were out of place.
17
b630991b
EZ
182013-01-05 Eli Zaretskii <eliz@gnu.org>
19
20 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
21 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
22 digits for buffer positions, before misalignment starts. Display
23 "0" for integer "object" field.
24 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
25 Display the newline glyph more unambiguously.
26
f032a318
YM
272013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
28
29 * nsterm.m (ns_draw_underwave):
30 * w32term.c (w32_draw_underwave):
31 * xterm.c (x_draw_underwave): Make underwave look more triangular
32 and also degrade gracefully for small fonts. (Bug#13000)
33
4240dd3c
YM
34 * nsterm.m (ns_draw_text_decoration):
35 * w32term.c (x_draw_glyph_string):
36 * xterm.c (x_draw_glyph_string): Don't use previous underline
37 thickness and position if previous underline type is underwave.
38
08f59219
GM
392012-12-31 Glenn Morris <rgm@gnu.org>
40
41 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
42
2550c6e4
AS
432012-12-29 Andreas Schwab <schwab@linux-m68k.org>
44
45 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
46 (LIBS_GNUSTEP): Define.
47 (LIBES): Add $(LIBS_GNUSTEP).
48 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
49
7a3a7493
EZ
502012-12-27 Eli Zaretskii <eliz@gnu.org>
51
52 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
53 continuation glyph on a TTY with an indication of an empty line.
54 (Bug#13277)
55
1ab0c851
GM
562012-12-27 Glenn Morris <rgm@gnu.org>
57
58 * cygw32.c (Fcygwin_convert_file_name_to_windows)
59 (Fcygwin_convert_file_name_from_windows): Doc fixes.
60
f5c81c80
EZ
612012-12-24 Eli Zaretskii <eliz@gnu.org>
62
63 * fileio.c (file_name_as_directory, directory_file_name): Accept
64 an additional argument MULTIBYTE to indicate whether the input C
65 came from a multibyte or a unibyte Lisp string; all callers
66 adjusted. Don't assume the input string is always multibyte.
67 (Bug#13262)
68 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
69 don't ENCODE_FILE them, and return a unibyte string if the input
70 was unibyte.
71 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
72 don't assume the input strings will always be multibyte. If the
73 input strings are multibyte, decode strings obtained from C
74 library functions.
75
94900bfe
MR
762012-12-22 Martin Rudalics <rudalics@gmx.at>
77
78 * window.c (Fselect_window): Reword doc-string (Bug#13248).
79
7efa3fb3
EZ
802012-12-21 Eli Zaretskii <eliz@gnu.org>
81
bb085aed
EZ
82 * fileio.c (Finsert_file_contents): Doc fix.
83
7efa3fb3
EZ
84 * w32proc.c (new_child, delete_child, find_child_pid): For a
85 subprocess, consider its slot being in use as long as its process
86 handle (procinfo.hProcess) is not NULL. This avoids reusing the
87 slot when a new process is started immediately after killing
88 another one, without waiting enough time for the first process to
89 be reaped and resources allocated for it be orderly freed.
90 (Bug#13086)
91 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
92
c1f02afa
CY
932012-12-21 Chong Yidong <cyd@gnu.org>
94
95 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
96
5bec25eb
CY
972012-12-15 Chong Yidong <cyd@gnu.org>
98
99 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
100
92340ec7
EZ
1012012-12-14 Eli Zaretskii <eliz@gnu.org>
102
103 * w32.c (get_name_and_id): Always pass NULL as the first argument
104 of lookup_account_sid. Avoids crashes with UNC file names that
105 refer to DFS domains, not to specific machine names. (Bug#12621)
106 Remove now unused argument FNAME; all callers changed.
107 (get_file_owner_and_group): Remove now unused argument FNAME; all
108 callers changed.
109
e8c6e965
EZ
1102012-12-11 Eli Zaretskii <eliz@gnu.org>
111
112 * search.c (search_buffer): Check the inverse translations of each
113 character in pattern when the buffer being searched is unibyte.
114 (Bug#13084)
115
184246df
PE
1162012-12-10 Paul Eggert <eggert@cs.ucla.edu>
117
118 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
119 files, fixing a regression from 24.2.
645c6a30 120 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 121
a06ae17d
JD
1222012-12-08 Jan Djärv <jan.h.d@swipnet.se>
123
124 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
125
cb576b5c
FP
1262012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
127
128 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
129 DWORD_PTR, for compatibility with 64-bit builds.
130
a06ae17d 131 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
132 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
133 (system_process_attributes): Use SIZE_T rather than DWORD, for
134 compatibility with 64-bit builds.
135
76b92fee
CS
1362012-12-08 Christopher Schmidt <christopher@ch.ristopher.com>
137
138 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
139
81d8cc53
EZ
1402012-12-07 Eli Zaretskii <eliz@gnu.org>
141
142 * indent.c (Fvertical_motion): If a display string will be
143 displayed on the left or the right margin, don't consider it as a
144 factor in cursor positioning. (Bug#13108)
145
2cec368c
MR
1462012-12-07 Martin Rudalics <rudalics@gmx.at>
147
148 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
149
d3cefd13
EZ
1502012-12-05 Eli Zaretskii <eliz@gnu.org>
151
152 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
153 fails, signal an error instead of continuing with an empty
154 string. (Bug#13079)
7c2fcf9b
EZ
155 Encode expanded temp file pattern before passing it to mkstemp or
156 mktemp.
d3cefd13 157
2e7cddd3
EZ
1582012-12-04 Eli Zaretskii <eliz@gnu.org>
159
160 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
161 Encode the file name before passing it to dostounix_filename, in
162 case it will downcase it (under w32-downcase-file-names).
163 (Bug#12933)
164
a2458031
CY
1652012-12-01 Chong Yidong <cyd@gnu.org>
166
167 * fileio.c (Vauto_save_list_file_name): Doc fix.
168
c7b36b95
FP
1692012-11-30 Fabrice Popineau <fabrice.popineau@gmail.com>
170
171 * w32fns.c: Remove prototype of atof.
172 (syspage_mask): Declared DWORD_PTR, for compatibility with 64-bit
173 builds.
174 (file_dialog_callback): Declared UINT_PTR.
175
176 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
177 with 64-bit builds.
178
179 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
180 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
181 defined.
182
14d27346
GM
1832012-11-27 Glenn Morris <rgm@gnu.org>
184
a9de9f0c 185 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 186
3fa1e84d
EZ
1872012-11-26 Eli Zaretskii <eliz@gnu.org>
188
189 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
190 (Bug#11964)
191
d4547511
PE
1922012-11-24 Paul Eggert <eggert@cs.ucla.edu>
193
194 Revert recent change for Bug#8855.
195 As reported by Harald Hanche-Olsen in
196 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00445.html>
197 the change introduces a further bug, of creating lots of zombie
198 processes in some cases. Further work is needed to come up with a
199 better fix for Bug#8855.
200
22294a56
EZ
2012012-11-24 Eli Zaretskii <eliz@gnu.org>
202
203 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
204 highlighting on the frame was cleared. Prevents assertion
205 violations when repeatedly clicking on the "Top" link of the
206 "bread-crumbs" in Info buffers.
207
6d4e8f62 2082012-11-23 Paul Eggert <eggert@cs.ucla.edu>
259719a6 209 Eli Zaretskii <eliz@gnu.org>
6d4e8f62
PE
210
211 Fix a race condition with glib (Bug#8855).
259719a6
EZ
212 The symptom is a diagnostic "GLib-WARNING **: In call to
213 g_spawn_sync(), exit status of a child process was requested but
214 SIGCHLD action was set to SIG_IGN and ECHILD was received by
215 waitpid(), so exit status can't be returned." The diagnostic
216 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
217 The real bug is a race condition between Emacs and glib: Emacs
218 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
219 so that glib can't find it. Work around the bug by invoking
220 waitpid only on subprocesses that Emacs itself creates.
6d4e8f62 221
259719a6 222 This is a backport from the trunk, consisting of:
6d4e8f62
PE
223
224 * w32proc.c (create_child): Don't clip the PID of the child
225 process to fit into an Emacs integer, as this is no longer a
226 restriction.
227 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
228 reaping only the process specified by PID argument, if that is
229 positive. Use PID instead of dead_child to know which process to
230 reap. Wait for the child to die only if WNOHANG is not in
231 OPTIONS.
232 (sys_select): Don't set dead_child.
233
234 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
235 as it is no longer needed.
236
237 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
238 no longer needed.
259719a6
EZ
239 (create_process, record_child_status_change): Don't use special
240 value -1 in pid field, as the caller now must know the pid rather
241 than having the callee infer it. The inference was sometimes
242 incorrect anyway, due to another race.
6d4e8f62
PE
243 (create_process): Set new 'alive' member if child is created.
244 (process_status_retrieved): New function.
245 (record_child_status_change): Use it.
246 Accept negative 1st argument, which means to wait for the
247 processes that Emacs already knows about. Move special-case code
248 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
249 processes that have already been waited for, by testing and
259719a6
EZ
250 clearing new 'alive' member. Remove the setting of
251 record_at_most_one_child for the !WNOHANG case.
6d4e8f62
PE
252 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
253 now does this internally.
254 (handle_child_signal): Let record_child_status_change do all
255 the work, since we do not want to reap all exited child processes,
256 only the child processes that Emacs itself created.
257 * process.h (Lisp_Process): New boolean member 'alive'.
258
8654a41b
EZ
2592012-11-23 Eli Zaretskii <eliz@gnu.org>
260
24becea4
EZ
261 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
262 between bpos_covered and bpos_max. This fixes cursor display when
263 several display strings follow each other.
264
8654a41b
EZ
265 * .gdbinit (pgx): If the glyph's object is a string, display the
266 pointer to string data, rather than the value of the string object
267 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
268
cb5867b1
EZ
2692012-11-21 Eli Zaretskii <eliz@gnu.org>
270
271 * indent.c (Fvertical_motion): If the starting position is covered
272 by a display string, return to one position before that, to avoid
273 overshooting it inside move_it_to. (Bug#12930)
274
a16ac13f
DC
2752012-11-20 Daniel Colascione <dancol@dancol.org>
276
277 * w32fns.c (Fx_file_dialog):
278 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
279 cygwin_convert_file_name*.
280
281 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
282 Rename cygwin_convert_path* to cygwin_convert_file_name*.
283
4ffea447
KB
2842012-11-20 Ken Brown <kbrown@cornell.edu>
285
286 * emacs.c (main): Set the G_SLICE environment variable for all
287 Cygwin builds, not just GTK builds. See
288 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
289
88c4a13c
EZ
2902012-11-19 Eli Zaretskii <eliz@gnu.org>
291
292 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Don't mix declaration of
293 w32_note_current_window with code. (Backport from trunk.)
294
295 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
296 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
297 Define for the MSVC compiler.
298
299 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing
300 semi-colon.
301
273ac8d1
EZ
3022012-11-18 Eli Zaretskii <eliz@gnu.org>
303
304 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
305 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
306 dostounix_filename. Prevents crashes down the road, because
307 dostounix_filename assumes it gets a unibyte string. Reported by
308 Michel de Ruiter <michel@sentient.nl>, see
309 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
310
d8715cdf
EZ
3112012-11-17 Eli Zaretskii <eliz@gnu.org>
312
313 * w32select.c: Include w32common.h before w32term.h, so that
314 windows.h gets included before w32term.h uses some of its
315 features, see below.
316
317 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]: New
318 typedefs.
319 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]: New
320 prototypes.
321 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
322
7436fc63
JD
3232012-11-17 Jan Djärv <jan.h.d@swipnet.se>
324
325 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
326 (ns_select): Return at once if events are held (Bug#12834).
327
86dcf21c 3282012-11-16 enami tsugutomo <tsugutomo.enami@jp.sony.com>
329
330 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
331 Needed following 2012-10-20 change. (Bug#12902)
332
d56f2e49
GM
3332012-11-16 Glenn Morris <rgm@gnu.org>
334
335 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
336
5c2a7148
SM
3372012-11-15 Stefan Monnier <monnier@iro.umontreal.ca>
338
339 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
340
730b2d8f
EZ
3412012-11-14 Eli Zaretskii <eliz@gnu.org>
342
343 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
344 use the same value of thread handle.
345 (start_timer_thread): If the timer thread exited (due to error),
346 clean up by closing the two handles it used. Duplicate the caller
347 thread's handle here, so it gets duplicated only once, when
348 launching the timer thread. Set priority of the timer thread, not
349 the caller thread.
350 (getitimer): Don't duplicate the caller thread's handle here.
351 (Bug#12832)
352
f99c65e5
JD
3532012-11-13 Jan Djärv <jan.h.d@swipnet.se>
354
355 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
356 called (Bug#12834).
357
32520273
EZ
3582012-11-12 Eli Zaretskii <eliz@gnu.org>
359
360 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
361 passed to pint2str and pint2hrstr to be at most the size of the
362 frame's decode_mode_spec_buffer. This avoids crashes with very
363 large values of FIELD_WIDTH argument to decode_mode_spec.
364 (Bug#12867)
365
fdaf534a
MR
3662012-11-07 Martin Rudalics <rudalics@gmx.at>
367
368 * window.c (Fsplit_window_internal): Set combination limit of
369 new parent window to t iff Vwindow_combination_limit is t;
370 fixing a regression introduced with the change from 2012-09-22.
5c2a7148
SM
371 (Fwindow_combination_limit, Fset_window_combination_limit):
372 Fix doc-strings.
fdaf534a 373
acf93bcf
EZ
3742012-11-06 Eli Zaretskii <eliz@gnu.org>
375
376 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
377 amount when the scroll margins are too large. When scrolling
378 backwards in the buffer, give up if cannot reach point or the
5c2a7148
SM
379 scroll margin within a reasonable number of screen lines.
380 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
381 point is positioned many lines beyond the window top/bottom.
382 (Bug#12811)
383
508f51f5
EZ
3842012-11-05 Eli Zaretskii <eliz@gnu.org>
385
386 * ralloc.c (relinquish): If real_morecore fails to return memory
387 to the system, don't crash; instead, leave the last heap
388 unchanged and return. (Bug#12774)
389
67b50ba4 3902012-11-03 Eli Zaretskii <eliz@gnu.org>
ad10696b 391
1d4341f9
EZ
392 * lisp.mk: Adjust comments to the fact that term/internal is now
393 loaded from loadup.el.
ad10696b 394
b3cf17f6
EZ
395 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
396 (msdos_fatal_signal): New function.
397 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
398 its argument list.
399
400 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
401 for GCC versions before 4.
402 (emacs_raise): Define to call msdos_fatal_signal.
67b50ba4
EZ
403
404 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
405 iterator when starting in the middle of a display or overlay
406 string. (Bug#12745)
407
858f0f24
EZ
4082012-11-03 Jan Djärv <jan.h.d@swipnet.se>
409
410 * widget.c (resize_cb): New function.
411 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
412 (EmacsFrameResize): Check if all is up to date before changing frame
413 size.
414
7e8b50d9
EZ
4152012-11-01 Eli Zaretskii <eliz@gnu.org>
416
417 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
418
322aea6d
PE
4192012-10-31 Paul Eggert <eggert@cs.ucla.edu>
420
421 Fix crash when using Emacs as commit editor for git (Bug#12697).
422 * callproc.c (setpgrp): Remove macro, as we now use setpgid
423 and it is configured in conf_post.h.
424 (Fcall_process): Don't invoke both setsid and setpgid; the former
425 is enough, if it exists.
426 * callproc.c (Fcall_process, child_setup):
427 * process.c (create_process): Use setpgid.
428 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
429 for the real thing.
430 * dispnew.c (init_display): Initialize the foreground group
431 if we are running a tty display.
432 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
433 * lisp.h (init_foreground_group): New decl.
434 * sysdep.c (inherited_pgroup): New static var.
435 (init_foreground_group, tcsetpgrp_without_stopping)
436 (narrow_foreground_group, widen_foreground_group): New functions.
437 (init_sys_modes): Narrow foreground group.
438 (reset_sys_modes): Widen foreground group.
439
220cb2bd
MA
4402012-10-31 Michael Albinus <michael.albinus@gmx.de>
441
442 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
443
218e997a
MR
4442012-10-31 Martin Rudalics <rudalics@gmx.at>
445
446 * minibuf.c (read_minibuf): Restore current buffer since
447 choose_minibuf_frame calling Fset_frame_selected_window may
448 change it (Bug#12766).
449
02615da0
JD
4502012-10-30 Jan Djärv <jan.h.d@swipnet.se>
451
452 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
453
aee5b18e
KH
4542012-10-30 Kenichi Handa <handa@gnu.org>
455
456 * font.c (Ffont_at): If WINDOW is specified and it is not
457 displaying the current buffer, signal an error.
458
ba116008
DC
4592012-10-29 Daniel Colascione <dancol@dancol.org>
460
5c2a7148
SM
461 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
462 In preparation for fixing bug#12739, move these functions from
ba116008
DC
463 here...
464
465 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
466 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
467 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 468
640bf8ad
EZ
4692012-10-28 Eli Zaretskii <eliz@gnu.org>
470
471 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
472 (timer_loop, getitimer, setitimer): Use it instead of
473 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
474 'clock'.
475 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
476 literal 10000.
477
64ccff5f
JD
4782012-10-28 Jan Djärv <jan.h.d@swipnet.se>
479
480 * nsterm.m (NO_APPDEFINED_DATA): New define.
481 (last_appdefined_event_data): New variable
482 (last_appdefined_event): Remove.
483 (ns_select): Initialize t from last_appdefined_event_data instead
484 of [last_appdefined_event data1].
485 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
486 remove last_appdefined_event (Bug#12698).
487
e483264c
SM
4882012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
489
490 * frame.c (x_set_font): Catch internal error.
491
6c16c13e
EZ
4922012-10-27 Eli Zaretskii <eliz@gnu.org>
493
e483264c
SM
494 Avoid overflow in w32 implementation of interval timers.
495 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
496 actually executes.
497 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
498 'volatile ULONGLONG' types. All the other data which was
499 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
500 (GetThreadTimes_Proc): New typedef.
501 (w32_get_timer_time): New function, returns a suitable time value
502 for the timer.
503 (timer_loop): Enter critical section when accessing ULONGLONG
504 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
505 atomic. Call 'w32_get_timer_time' instead of 'clock'.
506 Remove unused variable.
6c16c13e
EZ
507 (init_timers): Initialize s_pfn_Get_Thread_Times.
508 (start_timer_thread): Don't assign itimer->caller_thread here.
509 (getitimer): Assign itimer->caller_thread here.
510 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 511 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 512
ccc83f50
EZ
5132012-10-26 Eli Zaretskii <eliz@gnu.org>
514
515 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
516 mouse movement events if the menu bar is active. This avoids
517 producing a busy "hour-glass" cursor by Windows if the mouse
518 pointer is positioned over a tooltip shown for some menu item.
519
69deda53
PE
5202012-10-25 Paul Eggert <eggert@cs.ucla.edu>
521
522 Don't assume process IDs fit in int.
523 * emacs.c (shut_down_emacs) [!DOS_NT]:
524 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
525 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
526 Use pid_t, not int, to store process IDs, as 'int'
527 is not wide enough on a few platforms (e.g., AIX and IRIX).
528
7e70a152
KH
5292012-10-23 Kenichi Handa <handa@gnu.org>
530
531 The following change is to make face-font-rescale-alist work
532 correctly for non-ASCII fonts.
533
534 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
535 (font_open_for_lface): Handle Vface_font_rescale_alist.
536
49238e7f
CY
5372012-10-23 Chong Yidong <cyd@gnu.org>
538
539 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
540
5ec86886
JD
5412012-10-21 Jan Djärv <jan.h.d@swipnet.se>
542
ef446959
JD
543 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
544 for screen font.
545 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
546
5ec86886
JD
547 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
548 event (Bug#12681).
549
ee7a418d
GM
5502012-10-21 Glenn Morris <rgm@gnu.org>
551
552 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
553
4973679b
PE
5542012-10-20 Paul Eggert <eggert@cs.ucla.edu>
555
556 Port to OpenBSD 5.1.
557 * frame.c (Fmouse_position, Fmouse_pixel_position):
558 * xdisp.c (produce_stretch_glyph):
559 Declare local vars only when they're needed.
560 This is clearer and avoids a warning on OpenBSD about unused vars.
561 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
562 This is safer, and avoids OpenBSD warnings about unused vars.
563 * keyboard.c (record_menu_key): Remove unnecessary decl.
564 (poll_timer): Define only if POLL_FOR_INPUT is defined.
565 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
566 as our definition clashes with OpenBSD's.
567 * xfaces.c (load_face_colors, check_lface_attrs)
568 (get_lface_attributes_no_remap, get_lface_attributes)
569 (lface_fully_specified_p, x_supports_face_attributes_p)
570 (tty_supports_face_attributes_p, face_fontset, realize_face)
571 (realize_x_face, realize_tty_face):
572 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
573 merely Lisp_Object *. This is more informative and avoids
574 a warning on OpenBSD about accessing beyond an object's size.
575
c664f463
CY
5762012-10-20 Chong Yidong <cyd@gnu.org>
577
578 * lread.c (Fload): Doc fix (Bug#12592).
579
6ec83f92 5802012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
581
582 * font.c (Ffont_at): Fix previous change.
583
d2824928
EZ
5842012-10-19 Eli Zaretskii <eliz@gnu.org>
585
e483264c
SM
586 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
587 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
588 for the reasons.
589
d2824928
EZ
590 * alloc.c (NSTATICS): Decrease to 0x800.
591
f60d391f
SM
5922012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
593
594 * fns.c (Fnreverse): Include the problem element when signalling an
595 error (bug#12677).
596
1a9327d5
JD
5972012-10-18 Jan Djärv <jan.h.d@swipnet.se>
598
599 * nsterm.m (ns_select): Check writefds before call to
600 FD_ISSET (Bug#12668).
601
14145a1e
DC
6022012-10-18 Daniel Colascione <dancol@dancol.org>
603
604 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
605 (staticpro): If we run out of staticpro slots, die with an
606 informative error instead of just calling emacs_abort.
607
1f76f6f5
MR
6082012-10-18 Martin Rudalics <rudalics@gmx.at>
609
610 Fix two flaws reported by Dmitry Antipov.
611 * window.c (Ftemp_output_buffer_show): Remove.
612 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
613 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
614
fcf14875
EZ
6152012-10-17 Eli Zaretskii <eliz@gnu.org>
616
1f76f6f5
MR
617 * makefile.w32-in ($(BLD)/w32.$(O)):
618 ($(BLD)/vm-limit.$(O)):
619 ($(BLD)/term.$(O)):
620 ($(BLD)/unexw32.$(O)):
621 ($(BLD)/fileio.$(O)):
a68089e4
EZ
622 ($(BLD)/dispnew.$(O)): Update dependencies.
623
624 * w32term.h (w32_initialize_display_info, initialize_w32_display):
625 Add prototypes.
626
627 * w32proc.c: Include ctype.h.
628
629 * w32.h (init_environment, check_windows_init_file)
630 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
631 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
632 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
633 (sys_link): Add prototypes.
634
635 * w32.c: Include w32select.h.
636 (sys_access, e_malloc, sys_select): Add prototypes.
637 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
638
639 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
640
641 * unexw32.c: Include lisp.h and w32.h.
642
643 * term.c [WINDOWSNT]: Include w32term.h.
644
645 * process.c [WINDOWSNT]: Add prototype of sys_select.
646
647 * fileio.c [WINDOWSNT]: Include w32.h.
648
649 * dispnew.c [WINDOWSNT]: Include w32.h.
650
fcf14875
EZ
651 * cygw32.c (Fcygwin_convert_path_to_windows)
652 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
653 Lisp_Object values. (Bug#12661)
654
655 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
656 to Lisp_Object. (Bug#12661)
657
fe0b1ec4
KH
6582012-10-17 Kenichi Handa <handa@gnu.org>
659
660 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
661 invalidate.
662
d556ebf9
DA
6632012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
664
665 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 666 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 667
f0863a54
DA
6682012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
669
670 Do not verify indirection counters of killed buffers (Bug#12579).
671 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
672 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
673
12fbe755
DA
6742012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
675
676 * alloc.c (Fmake_byte_code): Fix typo in comment.
677 * print.c (print_interval): Define as static to match prototype.
678 * indent.c (disptab_matches_widthtab, recompute_width_table):
679 Convert to eassert.
680
61655b89
DA
6812012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
682
683 * editfns.c (get_system_name): Remove.
684 * lisp.h (get_system_name): Remove prototype.
685 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
686 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
687
9520f2f2
DC
6882012-10-15 Daniel Colascione <dancol@dancol.org>
689
690 * dbusbind.c: Add comment explaining reason for previous change.
691
dca778d5
MR
6922012-10-15 Martin Rudalics <rudalics@gmx.at>
693
694 * window.c (Fwindow_end): Rewrite check whether cached position
695 can be used (Bug#12600).
696 (resize_frame_windows, grow_mini_window, shrink_mini_window):
697 Set windows_or_buffers_changed.
698
3e0341b0
DC
6992012-10-15 Daniel Colascione <dancol@dancol.org>
700
701 * dbusbind.c: Fix cygw32 build break when compiling with dbus
702 enabled by undefining the symbol "interface", which the platform
703 headers define to something incompatible.
704
33d4113c
DC
7052012-10-14 Daniel Colascione <dancol@dancol.org>
706
707 * image.c (init_tiff_functions, init_imagemagick_functions)
708 (init_svg_functions): Fix cygw32 build break by using these
709 functions only when WINDOWSNT _and_ HAVE_NTGUI.
710
a36fb15e
JD
7112012-10-14 Jan Djärv <jan.h.d@swipnet.se>
712
713 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
714
537f336d
JD
7152012-10-13 Jan Djärv <jan.h.d@swipnet.se>
716
717 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
718
0ba06a77
KH
7192012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
720
721 * coding.c (detect_coding): Set coding->id before calling
722 this->detector.
723
ce2fe65a
AS
7242012-10-13 Andreas Schwab <schwab@linux-m68k.org>
725
726 * fileio.c: Formatting fixes.
727
d6453ce4
PE
7282012-10-13 Paul Eggert <eggert@cs.ucla.edu>
729
730 Fix some stat-related races.
731 * fileio.c (Fwrite_region): Avoid race condition if a file is
732 removed or renamed by some other process immediately after Emacs
733 writes it but before Emacs stats it. Do not assume that stat (or
734 fstat) succeeds.
735 * image.c (slurp_file): Resolve the file name with fopen + fstat
736 rather than stat + fopen.
737 (pbm_read_file) [0]: Remove unused code with stat race.
738 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
739 Remove ineffective code with stat race.
740
06485aa8
SM
7412012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
742
743 * doc.c (get_doc_string): Don't signal an error if the file is missing.
744
167e3640
JD
7452012-10-12 Jan Djärv <jan.h.d@swipnet.se>
746
747 * nsterm.m (hold_event_q): New static variable.
748 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
749 ! q_event_ptr.
750 (hold_event): New function.
751 (ns_read_socket): If hold_event_q have events, store them and
752 return (Bug#12384).
753 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
754 is zero (Bug#12384).
755
c40239df
JB
7562012-10-12 Juanma Barranquero <lekktu@gmail.com>
757
758 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
759
bb385a92
EZ
7602012-10-12 Eli Zaretskii <eliz@gnu.org>
761
2a9f1099
EZ
762 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
763
bb385a92
EZ
764 * fileio.c (check_existing): New function.
765 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
766 instead of calling 'stat', when what's needed is to check whether
767 a file exists. This avoids expensive system calls on MS-Windows.
768 (Bug#12587)
769
8599b23a 770 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
771
772 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
773 determine whether a file exists and is not a directory.
774
775 * lisp.h (check_existing): Add prototype.
776
2b9c2e68
JD
7772012-10-12 Jan Djärv <jan.h.d@swipnet.se>
778
779 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
780
81749a23
GM
7812012-10-12 Glenn Morris <rgm@gnu.org>
782
783 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
784
5253a5fd
SM
7852012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
786
389a94a5
SM
787 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
788
5253a5fd
SM
789 * eval.c (Fautoload): Remember previous autoload status in load-history.
790
7cded46f
PE
7912012-10-11 Paul Eggert <eggert@cs.ucla.edu>
792
793 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
794 * lread.c (load_each_byte, new_backquote_flag, readchar)
795 (read_filtered_event, lisp_file_lexically_bound_p)
796 (safe_to_load_version, Fload, complete_filename_p, openp)
797 (build_load_history, readevalloop, read_escape, read1)
798 (string_to_number, read_vector, read_list):
799 * macros.c (Fstart_kbd_macro):
800 * marker.c (CONSIDER):
801 * menu.c (parse_single_submenu, digest_single_submenu)
802 (find_and_return_menu_selection, Fx_popup_menu):
803 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
804 (Ftry_completion):
805 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
806 (ns_menu_show):
807 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
808 (xmenu_show, xdialog_show):
809 Use bool for booleans.
810 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
811 as it's not a predicate. All uses changed. Omit unnecessary
812 buffer termination.
813
549c3414
DA
8142012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
815
816 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
817 (save_excursion_restore): Do not restore mark if it was not saved.
818
e85aafe7
PE
8192012-10-11 Paul Eggert <eggert@cs.ucla.edu>
820
fd2f90cf
PE
821 * marker.c (cached_modiff): EMACS_INT, not int.
822
c1af190b
PE
823 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
824 instead of having a wrong decl.
e85aafe7
PE
825 * nsmenu.m (waiting_for_input): Remove wrong decl.
826
e738ca56
PE
8272012-10-10 Paul Eggert <eggert@cs.ucla.edu>
828
9fa1de30
PE
829 keyboard.c, keymap.c: Use bool for booleans.
830 * dispnew.c (sit_for): Distinguish between 3-way display_option
831 and boolean do_display.
832 * keyboard.c (single_kboard, this_command_key_count_reset)
833 (waiting_for_input, echoing, immediate_quit, input_pending)
834 (interrupt_input, interrupts_deferred, pop_kboard)
835 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
836 (command_loop_1, adjust_point_for_property)
837 (safe_run_hooks_error, input_polling_used, read_char):
838 (help_char_p, readable_events, kbd_buffer_events_waiting)
839 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
840 (lucid_event_type_list_p, get_input_pending):
841 (gobble_input, menu_separator_name_p, menu_bar_item)
842 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
843 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
844 (keyremap_step, test_undefined, read_key_sequence)
845 (detect_input_pending, detect_input_pending_ignore_squeezables)
846 (detect_input_pending_run_timers, requeued_events_pending_p)
847 (quit_throw_to_read_char, Fset_input_interrupt_mode):
848 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
849 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
850 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
851 (accessible_keymaps_1, Fkey_description, push_key_description):
852 (shadow_lookup, struct where_is_internal_data)
853 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
854 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
855 (describe_map, describe_vector):
856 * menu.c (single_menu_item):
857 * nsmenu.m (ns_update_menubar):
858 * process.c (wait_reading_process_output):
859 * search.c (scan_buffer, scan_newline):
860 Use bool for boolean.
861 * keyboard.c (timers_run, swallow_events)
862 (detect_input_pending_run_timers):
863 * process.c (wait_reading_process_output):
864 Use unsigned for counter where wraparound-on-overflow is desired,
865 since unsigned is guaranteed to have that behavior and signed is not.
866 (read_char): Use ptrdiff_t for string length.
867 (get_input_pending): Remove first argument, since it was always
868 the same pointer-to-int (now pointer-to-boolean) &input_pending,
869 and behave as if it had that value. Return new value of
870 input_pending. All callers changed.
871 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
872 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
873 a string length.
874 * keymap.c (push_key_description): Omit last arg, which was always 1.
875 All callers changed.
876
e738ca56
PE
877 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
878
29f21cdf
JB
8792012-10-10 Juanma Barranquero <lekktu@gmail.com>
880
881 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
882 ($(BLD)/term.$(O)): Update dependencies.
883
6aea7528
DA
8842012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
885
886 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
887 * lisp.h (enum pvec_type): Adjust comments and omit explicit
888 initializer for PVEC_NORMAL_VECTOR.
889
5f3f57be
PE
8902012-10-10 Paul Eggert <eggert@cs.ucla.edu>
891
892 Clean out old termopts cruft.
893 * termopts.h (flow_control, meta_key): Remove unused decls.
894 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
895 Don't include termopts.h.
896
3e98c68e
DA
8972012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
898
899 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
900
77e344e5
PE
9012012-10-10 Paul Eggert <eggert@cs.ucla.edu>
902
903 * commands.h (immediate_quit): Remove duplicate decl.
904
5683d7cd
JD
9052012-10-09 Jan Djärv <jan.h.d@swipnet.se>
906
907 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
908 caching.
909 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 910 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 911
cf5fc6db
EZ
9122012-10-09 Eli Zaretskii <eliz@gnu.org>
913
b15736e6
EZ
914 * w32fns.c (w32_last_error): Change the return value to DWORD, to
915 match what GetLastError returns. Explain why the function is
916 needed.
917
cf5fc6db
EZ
918 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
919 'is_tooltip_frame', to avoid confusion with its global namesake.
920
f99714ce
DC
9212012-10-08 Daniel Colascione <dancol@dancol.org>
922
923 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
924 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
925 build that caused Emacs to display the hourglass cursor forever.
f99714ce 926
fd59cb29
GM
927 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
928 which is broken under remote desktop, calculate the number of
929 colors available for a display based on the display's number of
930 planes and number of bits per pixel per plane. (bug#10397).
931
62c480c9 9322012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 933
62c480c9
JD
934 * nsfont.m (Vfonts_in_cache): New variable.
935 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
936 are used. Add cached fonts to Vfonts_in_cache.
937 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
938
607446ba
JB
9392012-10-08 Juanma Barranquero <lekktu@gmail.com>
940
fd5125ad
JB
941 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
942 in nt/config.nt.
46979e0b
JB
943 (FONT_H): Define after FRAME_H.
944 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
945 Update dependencies.
fd5125ad 946
607446ba
JB
947 * w32term.c: Remove leftover declaration of keyboard_codepage.
948
b6f4e300
EZ
9492012-10-08 Eli Zaretskii <eliz@gnu.org>
950
c54ebba4
EZ
951 * makefile.w32-in (FONT_H): Add $(FRAME_H).
952 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
953 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
954 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
955 ($(BLD)/unexw32.$(O)):
956 ($(BLD)/w32.$(O)):
957 ($(BLD)/w32console.$(O)):
958 ($(BLD)/w32fns.$(O)):
959 ($(BLD)/w32heap.$(O)):
960 ($(BLD)/w32menu.$(O)):
15c720a3 961 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 962
b6f4e300
EZ
963 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
964 'const char *'.
965 (x_to_w32_color): Don't modify the argument, modify a copy instead.
966
501199a3
DC
9672012-10-08 Daniel Colascione <dancol@dancol.org>
968
969 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
970 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
971 accidental message numbering hole. Change other messages to
972 match.
973
974 * w32select.h (HAVE_W32SELECT): Remove.
975
976 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 977 w32common.h instead of w32heap.h.
501199a3
DC
978
979 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
980 (get_allocation_unit, get_processor_type, get_w32_major_version)
981 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
982 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
983 (OS_NT, os_subtype, cache_system_info): Move declarations to
984 w32common.
985
986 * w32heap.c: Include w32common.h.
987 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
988 (w32_minor_version, w32_build_number, w32_subtype):
989 Remove duplicate definitions.
501199a3
DC
990
991 * w32fns.c: Include w32common.h; include w32heap.h only in
992 WINDOWSNT.
993
994 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
995 Use `report_file_error' instead of `error' in order to better
996 inform users of what went wrong. Increase NTGUI_UNICODE file
997 dialog box file name length to 32k, the maximum allowed by the NT
998 kernel.
999
1000 * w32common.h: New file.
1001 (ROUND_UP, ROUND_DOWN, get_page_size)
1002 (get_allocation_unit, get_processor_type, get_w32_major_version)
1003 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
1004 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
1005 (OS_NT, os_subtype, cache_system_info): Move here.
1006
1007 * unexw32.c, unexcw.c: Include w32common.h.
1008
1009 * emacs.c (main): Use (defined (WINDOWSNT) || defined
1010 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
1011 to call syms_of_w32select.
1012
1013 * cygw32.h: Remove obsolete EXFUN declarations.
1014
1015 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
1016
1017 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
1018 of w32inevt.o from SOME_MACHINE_OBJECTS.
1019
93aa5c81
DC
10202012-10-08 Daniel Colascione <dancol@dancol.org>
1021
1022 * image.c: Permanent fix for JPEG compilation issue --- limit
1023 jpeglib `boolean' redefinition to Cygwin builds.
1024
d424f3d8
EZ
10252012-10-08 Eli Zaretskii <eliz@gnu.org>
1026
8ee4c6ce
EZ
1027 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
1028
d424f3d8
EZ
1029 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
1030 Cygwin.
1031
e08348a0
DC
10322012-10-08 Daniel Colascione <dancol@dancol.org>
1033
1034 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
1035 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
1036 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
1037 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
1038 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
1039 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
1040 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
1041 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
1042 now a supported configuration.
1043
1044 * Makefile.in: consolidate image variables into LIBIMAGE; add
1045 W32_OBJ and W32_LIBS. Compile new files.
1046
1047 * conf_post.h:
1048 (_DebPrint) declare tracing facility for W32 debugging. We need
1049 to unify tracing later.
1050
1051 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
1052 unconditional use of W32 Unicode functions. Cygwin runs only on
1053 100% Unicode operating systems.
1054
1055 * cygw32.c: New file. Define Cygwin-specific facilities.
1056 (Fcygwin_convert_path_to_windows)
1057 (Fcygwin_convert_path_from_windows): New user functions for
1058 accessing Cygwin path-munging routines.
1059
1060 * cygw32.h: New file.
1061 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
1062 UTF-16LE strings temporarily inside non-Lisp-visible string
1063 objects.
1064
1065 (w32_strerror): Just what it says on the tin.
1066
1067 * emacs.c: Make the NS fork-then-exec code for daemon-launching
1068 also run for Cygwin; both systems have the same problem with using
1069 GUI facilities in a forked child. Also call syms_of_cygw32,
1070 syms_of_w32select in correct places.
1071
1072 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
1073 needs fork-then-exec for daemon launching.
1074
1075 * font.h: Include frame.h.
1076
1077 * image.c: Use the image library cache machinery only when we're
1078 compiling for native WINDOWSNT; Cygwin can use shared libraries
1079 like any other Unixlike system.
1080
1081 * keyboard.c: Clarify a comment regarding the input loop.
1082
1083 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
1084 functions directly instead of trying to detect at runtime that our
1085 host operating system supports them. We make this change for two
1086 reasons: Cygwin lacks support for the multibyte character
1087 conversion functions used by the legacy menu code, and Cygwin
1088 never needs to rely on non-Unicode APIs.
1089
1090 * unexw32.c (hinst): Declare extern.
1091
1092 * w32.c: Change header order;
1093 (w32_strerror): Move to w32fns.c because we need it for
1094 non-WINDOWSNT builds.
1095
1096 * w32.h: Add #error macro to make sure we don't include w32.h for
1097 Cygwin builds. Remove w32select declarations.
1098
1099 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 1100 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
1101
1102 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
1103 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
1104 POSIXy alternative.
1105 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
1106 (w32_major_version, w32_minor_version, w32_build_number)
1107 (os_subtype, sound_type): Define here
1108 (w32_defined_color): Make color parameter const for consistency
1109 with other _defined_color functions.
1110 (w32_createwindow): Unconditionally call w32_init_class instead of
1111 doing so only when hprevinst is non-NULL. Plumbing hprevinst
1112 through the code is complex and unnecessary because class
1113 registration is practically free.
1114 (w32_name_of_message): New EMACSDEBUG-only function.
1115 (Fset_message_beep): Move here
1116 (Fx_open_connection): Require that the display name for Windows be
1117 "w32" for consistency, emacsclient disambiguation, and maybe, one
1118 day, multi-window-system support.
1119 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
1120 Cygwin files for W32 GUI facilities, since these clearly don't
1121 expect Cygwin names.
1122 (_DebPrint): Define.
1123 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
1124 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
1125 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
1126 (w32_last_error): Remove.
1127
1128 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
1129
1130 * w32heap.c (syspage_mask): Declare here.
1131 (cache_system_info): Remove.
1132
1133 * w32inevt.c (faked_key): Define globally, not statically.
1134 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
1135 (w32_console_toggle_lock_key): Move to w32fns.c.
1136
1137 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
1138
1139 * w32proc.c (_DebPrint): Move to w32fns.c.
1140 * w32select.c: Include string.h, stdio.h for Cygwin.
1141 * w32select.h: New File.
1142
1143 * w32term.c: Include io.h for non-CYGWIN builds; needed for
1144 get_osfhandle.
1145 (w32_message_fd): New variable. Under Cygwin, holds the file
1146 descriptor the system used to tell us about pending thread
1147 messages.
1148
1149 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
1150 that prevented compilation under non-WINDOWSNT systems.
1151
1152 (w32_initialize): Open /dev/windows and assign it to
1153 w32_message_fd. Provide w32 feature.
1154
1155 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
1156 (WM_EMACS_INPUT_READY): add.
1157 (prepend_msg, w32_message_fd): Declare globally.
1158
1159 * w32xfns.c:
1160 (keyboard_handle): Use only when WINDOWSNT.
1161 (notify_msg_ready): New function. Posts a message to the main
1162 thread's message queue under CYGWIN, which wakes up the main
1163 thread from select(2) by making the /dev/windows file descriptor
1164 ready. Under WINDOWSNT, it sets an event the same way the old
1165 code did.
1166
1167 (post, prepend_msg): Actually call notify_msg_ready instead of
1168 setting the input event directly.
1169
98daa893
EZ
11702012-10-07 Eli Zaretskii <eliz@gnu.org>
1171
1172 * ralloc.c (relinquish): If a heap is ready to be relinquished,
1173 but it still has blocs in it, don't return it to the system,
1174 instead of aborting. (Bug#12402)
1175
3bc0a2f7
JD
11762012-10-07 Jan Djärv <jan.h.d@swipnet.se>
1177
8ad5b73b 1178 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 1179
335f5ae4
JD
1180 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
1181 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
1182 (syms_of_nsterm): Remove comment about Panther and above for
1183 ns-antialias-text.
335f5ae4
JD
1184 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
1185 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
1186 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
1187
1188 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
1189 MAC_OS_X_VERSION_10_4.
1190
8ad5b73b
JD
1191 * nsmenu.m (fillWithWidgetValue:): Remove code for <
1192 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
1193
1194 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
1195
1196 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
1197 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
1198
3bc0a2f7
JD
1199 * nsterm.m (ns_in_resize): Remove (Bug#12479).
1200 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
1201 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
1202 Remove ns_in_resize check.
3bc0a2f7
JD
1203 (ns_clear_frame_area): Remove resize handle code.
1204
1205 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
1206 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
1207 Remove ns_in_resize check.
3bc0a2f7 1208
c622b48f
PE
12092012-10-07 Paul Eggert <eggert@cs.ucla.edu>
1210
1211 Improve sys_siglist detection.
1212 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
1213 defined as a macro, as is done in Solaris.
1214 (sys_siglist_entries): New macro.
1215 (save_strsignal): Use it.
1216 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
1217 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
1218
04fafa46
JD
12192012-10-06 Jan Djärv <jan.h.d@swipnet.se>
1220
1221 * nsfns.m (Fx_create_frame): Call x_default_parameter with
1222 fullscreen/Fullscreen.
1223
1224 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
1225 tobar_height is new.
1226
1227 * nsterm.m (x_make_frame_visible): Check for fullscreen.
1228 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
1229 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
1230 (windowDidResize:): Check for correct window if old style fullscreen.
1231 Capitalize word in comment. Remove incorrect comment.
1232 (initFrameFromEmacs:): tbar_height renamed tibar_height.
1233 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
1234 error in drawing background.
1f9f395d 1235 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
1236 Set toolbar values to zero, save old height in tobar_height.
1237 Restore tool bar height when leaving fullscreen.
1238 (canBecomeMainWindow): New function.
1239
c6e21c03
PE
12402012-10-06 Paul Eggert <eggert@cs.ucla.edu>
1241
1242 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
1243
0d9f584b
EZ
12442012-10-05 Eli Zaretskii <eliz@gnu.org>
1245
a65fbb5f
EZ
1246 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
1247
0d9f584b 1248 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
1249 that time stamps of directories could also be changed.
1250 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
1251 FILE_WRITE_ATTRIBUTES access rights.
1252
1253 * fileio.c (Fset_file_times): Special-case ignoring errors for
1254 directories only on MSDOS, not on MS-Windows.
1255
e8757f09 12562012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
1257
1258 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
1259
7604f298
EZ
12602012-10-04 Eli Zaretskii <eliz@gnu.org>
1261
1262 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
1263 see whether CreateFile failed.
1264
88d69b7d
PE
12652012-10-04 Paul Eggert <eggert@cs.ucla.edu>
1266
1267 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
1268 to avoid similar races.
1269 * keyboard.c (pending_signals): Now bool, not int.
1270
7509f454
PE
1271 Port timers to OpenBSD, plus check for timer failures.
1272 OpenBSD problem reported by Han Boetes.
1273 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
1274 and/or setitimer.
1275 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
1276 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
1277 like OpenBSD, which has timer_settime but does not declare it.
1278 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
1279 whether to use itimerspec-related primitives. All uses of
1280 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
1281
a3c5c0c5
PE
12822012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1283
1284 * profiler.c (handle_profiler_signal): Fix a malloc race
1285 that caused Emacs to hang on Fedora 17 when profiling Lisp.
1286
914e743b
JD
12872012-10-02 Jan Djärv <jan.h.d@swipnet.se>
1288
1289 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
1290
d8ab37a8
EZ
12912012-10-02 Eli Zaretskii <eliz@gnu.org>
1292
1293 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
1294 consistent with the change in return value of 'safe_strsignal'.
1295
b3ecad33
PE
12962012-10-02 Paul Eggert <eggert@cs.ucla.edu>
1297
0a99eee1
PE
1298 Prefer plain 'static' to 'static inline' (Bug#12541).
1299 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
1300 (bidi_set_sor_type, bidi_push_embedding_level)
1301 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
1302 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
1303 (bidi_cache_search, bidi_cache_ensure_space)
1304 (bidi_cache_iterator_state, bidi_cache_find)
1305 (bidi_peek_at_next_level, bidi_set_paragraph_end)
1306 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1307 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
1308 Now 'static', not 'static inline'.
1309
b3ecad33
PE
1310 Count overruns when profiling; change units to ns.
1311 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
1312 Give extra weight to samples after overruns, to attempt to count
1313 the time more accurately.
1314 (setup_cpu_timer): Change sampling interval units from ms to ns, since
1315 the underlying primitives nominally do ns.
1316 (Fprofiler_cpu_start): Document the change. Mention that
1317 the sampling intervals are only approximate.
1318
090cf9db
SM
13192012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
1320
1321 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
1322
1323 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
1324 case for the special 0 coding-system.
1325
1326 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
1327 (Fmake_overlay): Remove redundant tests.
64edc777 1328 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 1329
81550bf4
JB
13302012-10-02 Juanma Barranquero <lekktu@gmail.com>
1331
1332 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
1333 Update dependencies.
1334
aa1ba90e
PE
13352012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1336
1337 Fix a malloc race condition involving strsignal.
1338 A signal can arrive in the middle of a malloc, and Emacs's signal
1339 handler can invoke strsignal, which can invoke malloc, which is
1340 not portable. This race condition bug makes Emacs hang on GNU/Linux.
1341 Fix it by altering the signal handler so that it does not invoke
1342 strsignal.
1343 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
1344 * process.c (status_message): Use const pointer, in case strsignal
1345 is #defined to safe_strsignal.
1346 * sysdep.c (sys_siglist, init_signals): Always define and
1347 initialize a substitute sys_siglist if the system does not define
1348 one, even if HAVE_STRSIGNAL.
1349 (safe_strsignal): Rename from strsignal. Always define,
1350 using sys_siglist. Return a const pointer.
1351 * syssignal.h (safe_strsignal): New decl.
1352 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
1353
ace917bd
EZ
13542012-10-01 Eli Zaretskii <eliz@gnu.org>
1355
1356 * w32proc.c (timer_loop): Fix code that waits for timer
1357 expiration, to avoid high CPU usage.
1358
9eb71b9c
SM
13592012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
1360
1361 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
1362 (sweep_weak_table): Remove redundant prototypes.
1363
b3317662
FP
13642012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
1365
1366 * emacs.c: Move the inclusion of TERM_HEADER after including
1367 windows.h on WINDOWSNT. This avoids compilation problems with
1368 MSVC.
1369
f0e5f225
EZ
13702012-10-01 Eli Zaretskii <eliz@gnu.org>
1371
2d7d1608
EZ
1372 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
1373 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
1374 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
1375 as the previous version used 'void *'.
1376
1377 * ralloc.c (ROUNDUP): Fix last change.
1378 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
1379 'size_t'.
1380
f0e5f225
EZ
1381 * w32proc.c <disable_itimers>: New static flag.
1382 (init_timers): Initialize it to zero, after creating the critical
1383 sections used by the timer threads.
1384 (term_timers): Set to 1 before deleting the critical sections.
1385 (getitimer, setitimer): If disable_itimers is non-zero, return an
1386 error indication without doing anything. Reported by Fabrice
1387 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
1388 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
1389 return results.
1390 [!HAVE_SETITIMER]: Behave as the previous version that didn't
1391 support timers.
f0e5f225
EZ
1392
1393 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
1394 term_ntproc after all the other bookkeeping, to get timers working
1395 as long as possible.
1396
82ef37c1
PE
13972012-10-01 Paul Eggert <eggert@cs.ucla.edu>
1398
b3a4c387
PE
1399 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
1400 Suggested by Juri Linkov in
1401 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
1402
b0ab8123
PE
1403 Prefer plain 'static' to 'static inline' (Bug#12541).
1404 With static functions, modern compilers inline pretty well by
1405 themselves; advice from programmers often hurts as much as it helps.
1406 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
1407 this change shrinks the text size of the Emacs executable by 1.1%
1408 without affecting CPU significantly in my benchmark.
1409 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
1410 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
1411 (mark_maybe_object, mark_maybe_pointer, bounded_number):
1412 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
1413 (bset_auto_fill_function, bset_auto_save_file_format)
1414 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
1415 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
1416 (bset_cache_long_line_scans, bset_case_fold_search)
1417 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
1418 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
1419 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
1420 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
1421 (bset_header_line_format, bset_indicate_buffer_boundaries)
1422 (bset_indicate_empty_lines, bset_invisibility_spec)
1423 (bset_left_fringe_width, bset_major_mode, bset_mark)
1424 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
1425 (bset_name, bset_overwrite_mode, bset_pt_marker)
1426 (bset_right_fringe_width, bset_save_length)
1427 (bset_scroll_bar_width, bset_scroll_down_aggressively)
1428 (bset_scroll_up_aggressively, bset_selective_display)
1429 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
1430 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
1431 (set_buffer_overlays_after):
1432 * category.c (bset_category_table):
1433 * charset.c (read_hex):
1434 * coding.c (produce_composition, produce_charset)
1435 (handle_composition_annotation, handle_charset_annotation)
1436 (char_encodable_p):
1437 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
1438 (assign_row, set_frame_matrix_frame, make_current)
1439 (add_row_entry):
1440 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
1441 * fns.c (maybe_resize_hash_table):
1442 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
1443 * gmalloc.c (register_heapinfo):
1444 * image.c (lookup_image_type):
1445 * intervals.c (set_interval_object, set_interval_left)
1446 (set_interval_right, copy_interval_parent, rotate_right)
1447 (rotate_left, balance_possible_root_interval):
1448 * keyboard.c (kset_echo_string, kset_kbd_queue)
1449 (kset_keyboard_translate_table, kset_last_prefix_arg)
1450 (kset_last_repeatable_command, kset_local_function_key_map)
1451 (kset_overriding_terminal_local_map, kset_real_last_command)
1452 (kset_system_key_syms, clear_event, set_prop):
1453 * lread.c (digit_to_number):
1454 * marker.c (attach_marker, live_buffer, set_marker_internal):
1455 * nsterm.m (ns_compute_glyph_string_overhangs):
1456 * process.c (pset_buffer, pset_command)
1457 (pset_decode_coding_system, pset_decoding_buf)
1458 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
1459 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
1460 (pset_status, pset_tty_name, pset_type, pset_write_queue):
1461 * syntax.c (bset_syntax_table, dec_bytepos):
1462 * terminal.c (tset_param_alist):
1463 * textprop.c (interval_has_some_properties)
1464 (interval_has_some_properties_list):
1465 * window.c (wset_combination_limit, wset_dedicated)
1466 (wset_display_table, wset_hchild, wset_left_fringe_width)
1467 (wset_left_margin_cols, wset_new_normal, wset_new_total)
1468 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
1469 (wset_right_fringe_width, wset_right_margin_cols)
1470 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
1471 (wset_vertical_scroll_bar_type, wset_window_parameters):
1472 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1473 (wset_column_number_displayed, wset_region_showing)
1474 (window_box_edges, run_window_scroll_functions)
1475 (append_glyph_string_lists, prepend_glyph_string_lists)
1476 (append_glyph_string, set_glyph_string_background_width)
1477 (append_glyph, append_composite_glyph)
1478 (take_vertical_position_into_account):
1479 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
1480 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
1481 (lface_hash, lface_same_font_attributes_p, lookup_face):
1482 * xml.c (libxml2_loaded_p):
1483 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
1484 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
1485 Now 'static', not 'static inline'.
1486
05584c31
PE
1487 * bidi.c: Tune.
1488 (bidi_copy_it): Do the whole copy with a single memcpy.
1489 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
1490
86ec63ba
PE
1491 Revert the FOLLOW-SYMLINKS change for file-attributes.
1492 Doing it right would require several changes to Tramp, and there's
1493 not enough time to get that tested before the freeze today.
1494 * dired.c (directory_files_internal, Ffile_attributes):
1495 Undo last change.
1496
82ef37c1
PE
1497 * frame.c (x_report_frame_params): Port better to wider ints.
1498 Do not assume that EMACS_UINT is the same width as uprintmax_t,
1499 or that pointers can be printed in 15 decimal digits.
1500 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
1501
62aba0d4
FP
15022012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
1503
1504 Support x64 build on MS-Windows.
1505 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
1506 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
1507 compatibility with x64.
5e4daaf3 1508 (x_get_focus_frame): Add prototype.
62aba0d4
FP
1509
1510 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
1511 defining an XRectangle structure.
1512
1513 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
1514 arithmetics for compatibility with x64.
1515
1516 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
1517 compatibility with x64.
1518
1519 * w32heap.h: Adjust prototypes and declarations.
1520
1521 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
1522 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
1523 DWORD, long, and unsigned long, for compatibility with x64.
1524 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
1525 (sbrk): Argument is now of type ptrdiff_t.
1526
1527 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
1528 less than 0x0500.
1529 (w32_msg_pump): Use WPARAM type for 'result'.
1530
1531 * w32.c (init_environment, get_emacs_configuration): Support AMD64
1532 architecture.
1533 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
1534 compatibility with x64.
1535
1536 * vm-limit.c (lim_data): Now size_t.
1537 (check_memory_limits): Adjust prototypes of real_morecore and
1538 __morecore to receive argument of type ptrdiff_t. Use size_t for
1539 five_percent and data_size.
1540
1541 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
1542 variables, for compatibility with x64.
1543 (rva_to_section, offset_to_section, relocate_offset)
1544 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
1545 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
1546 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
1547 for compatibility with x64.
1548
1549 * sysdep.c (STDERR_FILENO): Define if not already defined.
1550
1551 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
1552 (__morecore): Argument type is now ptrdiff_t.
1553 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
1554 (relinquish): Use ptrdiff_t type for 'excess'.
1555 (r_alloc_sbrk): Argument type is now ptrdiff_t.
1556
1557 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
1558 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
1559 instead of a literal number.
1560
1561 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
1562 (min): Define only if not already defined.
1563
1564 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
1565 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
1566 hosts.
1567
1568 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
1569 'bitmaps' is a pointer.
1570
1571 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
1572
1573 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
1574
e7a2937b
PE
15752012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1576
1577 file-attributes has a new optional arg FOLLOW-SYMLINKS.
1578 * dired.c (directory_files_internal, Ffile_attributes):
1579 New arg follow_symlinks. All uses changed.
1580
b43d62ae
SM
15812012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
1582
1583 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
1584
c06c382a
EZ
15852012-09-30 Eli Zaretskii <eliz@gnu.org>
1586
1587 Support atimers and CPU profiler via profile.c on MS-Windows.
1588 * w32proc.c (sig_mask, crit_sig): New static variables.
1589 (sys_signal): Support SIGALRM and SIGPROF.
1590 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 1591 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
1592 sigfillset, and sigprocmask are no longer no-ops.
1593 (sigismember): New function.
1594 (struct itimer_data): New definition.
1595 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
1596 (crit_prof): New static variables.
1597 (MAX_SINGLE_SLEEP): New definition.
1598 (timer_loop, stop_timer_thread, term_timers, init_timers)
1599 (start_timer_thread, getitimer, setitimer): New functions.
1600 (alarm): No longer a no-op, calls setitimer.
1601
1602 * w32.c (term_ntproc): Call term_timers.
1603 (init_ntproc): Make sure all signals are unblocked at startup, to
1604 erase any traces of dumping. Call init_timers.
1605
1606 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
1607 Windows-specific code to display the hourglass mouse pointer is no
1608 longer used.
1609 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
1610 to hourglass timer expiration.
1611 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
1612 Remove, no longer used.
b43d62ae
SM
1613 (w32_note_current_window, show_hourglass, hide_hourglass):
1614 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
1615 window systems.
1616 (syms_of_w32fns): Don't initialize hourglass_timer.
1617
1618 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
1619 WINDOWSNT as well.
1620 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
1621
1622 * w32.h (init_timers, term_timers): Add prototypes.
1623
95402d5f
KH
16242012-09-30 Kenichi Handa <handa@gnu.org>
1625
1626 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
1627 to the buffer relocation which may be caused by ccl_driver.
1628
dd946752
JD
16292012-09-30 Jan Djärv <jan.h.d@swipnet.se>
1630
d7e642cc
JD
1631 * xfns.c (Fx_file_dialog): Update comment.
1632
1633 * w32fns.c (Fx_file_dialog): Update comment.
1634
1635 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
1636 Initialize panel name field if OSX >= 10.6.
1637
1638 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
1639
dd946752
JD
1640 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
1641
1642 * nsterm.m (NEW_STYLE_FS): New define.
1643 (ns_fullscreen_hook, windowWillEnterFullScreen)
1644 (windowDidEnterFullScreen, windowWillExitFullScreen)
1645 (windowDidExitFullScreen, toggleFullScreen, handleFS)
1646 (setFSValue): New functions.
1647 (EmacsFSWindow): New implementation.
1648 (canBecomeKeyWindow): New function for EmacsFSWindow.
1649 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
1650 (dealloc): Release nonfs_window if in fullscreen.
1651 (updateFrameSize:): Call windowDidMove to update top/left.
1652 (windowWillResize:toSize:): Check if frame is still maximized.
1653 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
1654 next_maximized, maximized_width, maximized_height and nonfs_window.
1655 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
1656 tbar_height.
1657 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 1658 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
1659
1660 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
1661 (EmacsView): Add variables for fullscreen.
1662 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
1663 (EmacsFSWindow): New interface for fullscreen.
1664
427730eb
JB
16652012-09-30 Juanma Barranquero <lekktu@gmail.com>
1666
1667 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1668
48de8b12
CY
16692012-09-30 Chong Yidong <cyd@gnu.org>
1670
1671 * fns.c (Frandom): Doc fix.
1672
5938d519
MR
16732012-09-30 Martin Rudalics <rudalics@gmx.at>
1674
1675 * window.c (Vwindow_combination_limit): New default value.
1676 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
1677
cb5b0266
PE
16782012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1679
1680 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
1681 Suggested by Eli Zaretskii in
1682 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
1683
84f72efd
EZ
16842012-09-30 Eli Zaretskii <eliz@gnu.org>
1685
1686 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
1687 HAVE_TIMER_SETTIME is defined.
1688
9d4dcdc9
PE
16892012-09-30 Paul Eggert <eggert@cs.ucla.edu>
1690
d89460ed
PE
1691 Profiler improvements: more-accurate timers, overflow checks.
1692 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
1693 signal.h, setjmp.h. Include systime.h instead.
1694 (saturated_add): New function.
1695 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
1696 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
1697 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
1698 New static vars.
84f72efd 1699 (enum profiler_cpu_running): New enum.
d89460ed
PE
1700 (profiler_cpu_running): Now of that enum type, not bool.
1701 All uses changed to store the new value.
1702 (handle_profiler_signal): Rename from sigprof_handler_1,
1703 for consistency with other handlers. Do not check whether
1704 cpu_log is a hash-table if garbage collecting, since it
1705 doesn't matter in that case.
1706 (deliver_profiler_signal): Rename from sigprof_handler,
1707 for consistency with other handlers.
1708 (setup_cpu_timer): New function, with much of what used to be in
1709 Fprofiler_cpu_start. Check for out-of-range argument.
1710 Prefer timer_settime if available, and prefer
1711 thread cputime clocks, then process cputime clocks, then
1712 monotonic clocks, to the old realtime clock. Use make_timeval
1713 to round more-correctly when falling back to setitimer.
1714 (Fprofiler_cpu_start): Use it.
1715 (Fprofiler_cpu_stop): Prefer timer_settime if available.
1716 Don't assume that passing NULL as the 2nd argument of setitimer
1717 is the same as passing a pointer to all-zero storage.
1718 Ignore SIGPROF afterwards.
1719 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
1720 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
1721 non-fatal signal handlers. Ignore SIGPROF on startup.
1722 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
1723 in profiler.c, since sysdep.c now uses it.
1724
9d4dcdc9
PE
1725 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
1726 Suggested by Eli Zaretskii in
1727 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
1728
8e5691a0
JB
17292012-09-29 Juanma Barranquero <lekktu@gmail.com>
1730
1731 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1732
e7c1b6ef
SM
17332012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
1734
1735 * lisp.h (struct backtrace): Remove indirection for `function' field.
1736 * xdisp.c (redisplay_internal):
1737 * profiler.c (record_backtrace, sigprof_handler_1):
1738 * alloc.c (Fgarbage_collect):
1739 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
1740 (Fbacktrace_frame): Adjust accordingly.
1741
e61d39cd 17422012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
1743
1744 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
1745 (Frun_hook_with_args_until_failure): Doc fixes.
1746
404043ea
EZ
17472012-09-28 Eli Zaretskii <eliz@gnu.org>
1748
1749 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
1750 Qautomatic_redisplay and change the symbol name. All users changed.
1751
704d3f45
TM
17522012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
1753
1754 * profiler.c (sigprof_handler): Fix race condition.
1755
757140ff
GM
17562012-09-28 Glenn Morris <rgm@gnu.org>
1757
1758 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
1759
a615a3ae
PE
17602012-09-27 Paul Eggert <eggert@cs.ucla.edu>
1761
1762 Check more robustly for timer_settime.
89d17fd0
PE
1763 * Makefile.in (LIB_TIMER_TIME): New macro.
1764 (LIBES): Add it.
a615a3ae
PE
1765 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
1766 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
1767 call timer_settime.
1768
3670daf7
TM
17692012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1770
1771 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
1772
6a586b7f
JB
17732012-09-26 Juanma Barranquero <lekktu@gmail.com>
1774
1775 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
1776
41c8bfcf
PE
17772012-09-26 Paul Eggert <eggert@cs.ucla.edu>
1778
1779 * character.h (MAYBE_UNIFY_CHAR): Remove.
1780 * charset.c, charset.h (maybe_unify_char): Now static.
1781 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
1782 Since this stuff is now private to charset.c, there's no need for
1783 a public macro and no need to inline by hand.
1784
3a880af4
SM
17852012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
1786 Stefan Monnier <monnier@iro.umontreal.ca>
1787 Juanma Barranquero <lekktu@gmail.com>
611b7507 1788
3a880af4
SM
1789 * profiler.c: New file.
1790 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
1791 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
1792 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
1793 * emacs.c (main): Call syms_of_profiler.
1794 * alloc.c (Qautomatic_gc): New constant.
1795 (MALLOC_PROBE): New macro.
1796 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
1797 (total_bytes_of_live_objects): New function.
1798 (Fgarbage_collect): Use it. Record itself in backtrace_list.
1799 Call malloc_probe for the memory profiler.
1800 (syms_of_alloc): Define Qautomatic_gc.
1801 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
1802 race condition.
1803 (struct backtrace): Move definition...
1804 * lisp.h (struct backtrace): ..here.
1805 (Qautomatic_gc, profiler_memory_running): Declare vars.
1806 (malloc_probe, syms_of_profiler): Declare functions.
1807 * xdisp.c (Qautomatic_redisplay): New constant.
1808 (redisplay_internal): Record itself in backtrace_list.
1809 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 1810
5938d519 18112012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
18122012-09-25 Juanma Barranquero <lekktu@gmail.com>
1813
1814 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
1815
e26fd2e4
PE
18162012-09-25 Paul Eggert <eggert@cs.ucla.edu>
1817
1818 Prefer POSIX timers if available.
1819 They avoid a race if the timer is too close to the current time.
1820 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
1821 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 1822 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 1823
eedec3ee
EZ
18242012-09-25 Eli Zaretskii <eliz@gnu.org>
1825
1826 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
1827 CHAR_STRING_ADVANCE.
1828 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
1829 STRING_CHAR_ADVANCE.
1830
aa15c6bb
JB
18312012-09-25 Juanma Barranquero <lekktu@gmail.com>
1832
1833 Move Vlibrary_cache to emacs.c and reset before dumping.
1834
1835 * lisp.h (reset_image_types): Declare.
1836 [WINDOWSNT] (Vlibrary_cache): Declare.
1837
1838 * image.c (reset_image_types): New function.
1839
1840 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
1841 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
1842 (Fdump_emacs): Reset Vlibrary_cache and image_types.
1843
1844 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
1845 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
1846
1847 * w32.h (Vlibrary_cache): Do not declare.
1848
54d629be
EZ
18492012-09-25 Eli Zaretskii <eliz@gnu.org>
1850
16b22fef
EZ
1851 * w32proc.c (sys_signal): Handle all signals defined by the
1852 MS-Windows runtime, not just SIGCHLD. Actually install the signal
1853 handlers for signals supported by Windows. Don't override
1854 term_ntproc as the handler for SIGABRT.
1855 (sigaction): Rewrite to call sys_signal instead of duplicating its
1856 code.
1857 (sys_kill): Improve commentary.
1858
1859 * w32.c (term_ntproc): Accept (and ignore) one argument, for
1860 consistency with a signature of a signal handler. All callers
1861 changed.
1862 (init_ntproc): Accept an argument DUMPING. If dumping, don't
1863 install term_ntproc as a signal handler for SIGABRT, as that
1864 should be done by the dumped Emacs.
1865
1866 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
1867
1868 * w32select.c (term_w32select): Protect against repeated
1869 invocation by setting clipboard_owner to NULL after calling
1870 DestroyWindow.
1871
1872 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
1873 and term_ntproc to their modified signatures.
1874
54d629be
EZ
1875 * character.c (char_string, string_char): Remove calls to
1876 MAYBE_UNIFY_CHAR. See the discussion starting at
1877 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
1878 for the details.
1879
59f7af81
CY
18802012-09-25 Chong Yidong <cyd@gnu.org>
1881
1882 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
1883
22e8cf4a
SM
18842012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
1885
1886 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
1887 when encountering an unknown bytecode.
1888
578098f3
PE
18892012-09-24 Paul Eggert <eggert@cs.ucla.edu>
1890
1891 image.c, indent.c: Use bool for booleans.
1892 * dispextern.h (struct image_type): Members valid_p, load, init
1893 now return bool, not int. All uses changed.
1894 * image.c: Omit unnecessary static decls.
1895 (x_create_bitmap_mask, x_build_heuristic_mask):
1896 Return void, not int, since callers don't care about the return value.
1897 (x_create_bitmap_mask, define_image_type, valid_image_p)
1898 (struct image_keyword, parse_image_spec, image_spec_value)
1899 (check_image_size, image_background)
1900 (image_background_transparent, x_clear_image_1)
1901 (postprocess_image, lookup_image, x_check_image_size)
1902 (x_create_x_image_and_pixmap, xbm_image_p)
1903 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
1904 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
1905 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
1906 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
1907 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
1908 (png_image_p, init_png_functions, png_load_body, png_load)
1909 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
1910 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
1911 (init_gif_functions, gif_load, imagemagick_image_p)
1912 (imagemagick_load_image, imagemagick_load, svg_image_p)
1913 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
1914 (gs_load):
1915 * nsimage.m (ns_load_image):
1916 * nsterm.m (ns_defined_color):
1917 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
1918 * xfns.c (x_defined_color):
1919 * xterm.c (x_alloc_lighter_color_for_widget)
1920 (x_alloc_nearest_color_1, x_alloc_nearest_color)
1921 (x_alloc_lighter_color):
1922 * indent.c (disptab_matches_widthtab, current_column)
1923 (scan_for_column, string_display_width, indented_beyond_p)
1924 (compute_motion, vmotion, Fvertical_motion):
1925 Use bool for booleans.
1926
a5f2b6ec
CY
19272012-09-24 Chong Yidong <cyd@gnu.org>
1928
1929 * chartab.c (Fset_char_table_default): Obsolete function removed.
1930
18e27ea8
PE
19312012-09-23 Paul Eggert <eggert@cs.ucla.edu>
1932
afea8a8a
PE
1933 Move pid_t related decls out of lisp.h.
1934 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
1935 (interruptible_wait_for_termination):
1936 Move these decls from lisp.h to syswait.h, since they use pid_t.
1937 Needed on FreeBSD; see Herbert J. Skuhra in
1938 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
1939 * callproc.c: Include syswait.h.
1940
18e27ea8
PE
1941 gnutls.c, gtkutil.c: Use bool for boolean.
1942 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
1943 (emacs_gnutls_handle_error):
1944 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
1945 (xg_hide_tooltip, xg_create_frame_widgets)
1946 (create_dialog, xg_uses_old_file_dialog)
1947 (xg_get_file_with_chooser, xg_get_file_with_selection)
1948 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
1949 (xg_item_label_same_p, xg_update_menubar)
1950 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
1951 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
1952 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
1953 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
1954 (update_frame_tool_bar, free_frame_tool_bar):
1955 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
1956 * nsmenu.m (ns_update_menubar):
1957 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
1958 * xfns.c (Fx_show_tip) [USE_GTK]:
1959 Use bool for boolean.
1960 * gtkutil.c (xg_update_frame_menubar):
1961 * xmenu.c (update_frame_menubar):
1962 Return void, not int, since caller ignores return value.
1963 * gtkutil.c (xg_change_toolbar_position):
1964 Return void, not 1.
1965
af0e9f75
JB
19662012-09-23 Juanma Barranquero <lekktu@gmail.com>
1967
1968 * makefile.w32-in (BLOCKINPUT_H): Remove.
1969 (SYSSIGNAL_H): New macro.
1970 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
1971 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
1972 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
1973 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
1974 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
1975 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
1976 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
1977 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
1978 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
1979 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
1980 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
1981 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
1982 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
1983 ($(BLD)/w32xfns.$(O)): Update dependencies.
1984
5101529e
EZ
19852012-09-23 Eli Zaretskii <eliz@gnu.org>
1986
1987 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
1988 fatal_error_backtrace.
1989
1990 * w32proc.c (sys_kill): Undo last change: don't do anything when
1991 invoked to deliver SIGABRT to our own process. This is now
1992 handled by emacs_raise.
1993
2c3ee0ad
JB
19942012-09-23 Juanma Barranquero <lekktu@gmail.com>
1995
1996 * w32term.c (w32_read_socket): Remove leftover reference to
1997 interrupt_input_pending.
1998
62a1d661
PE
19992012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2000
2001 Do not use SA_NODEFER.
2002 Problem reported by Dani Moncayo in
2003 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
2004 * alloc.c (die):
2005 * sysdep.c (emacs_abort): Do not reset signal handler.
2006 * emacs.c (terminate_due_to_signal): Reset signal handler here.
2007 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
2008 wanted even on POSIXish hosts, and it doesn't work on Windows.
2009
a0942b9a
JD
20102012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2011
2012 * xterm.c (x_term_init): Call fixup_locale before and after calling
2013 gtk_init (Bug#12392).
2014
d07ff9db
CY
20152012-09-23 Chong Yidong <cyd@gnu.org>
2016
2017 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
2018 Vdynamic_library_alist.
2019
2020 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
2021 (Fgnutls_available_p): Caller changed.
2022
2023 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
2024 (Flibxml_parse_xml_region): Likewise.
2025
2026 * dispextern.h (struct image_type): Remove arg from init function.
2027
2028 * image.c (Finit_image_library, lookup_image_type)
2029 (define_image_type): Remove now-unneeded second arg.
2030 (init_xpm_functions, init_png_functions, init_jpeg_functions)
2031 (init_tiff_functions, init_gif_functions, init_svg_functions):
2032 Arglist and w32_delayed_load calling convention changed.
2033 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 2034 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 2035
4d7e6e51
PE
20362012-09-23 Paul Eggert <eggert@cs.ucla.edu>
2037
2038 Simplify and avoid signal-handling races (Bug#12471).
2039 * alloc.c (die):
2040 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
2041 Avoid recursive loop if there's a fatal error in the function itself.
2042 * atimer.c (pending_atimers):
2043 * blockinput.h: Don't include "atimer.h"; no longer needed.
2044 (interrupt_input_pending): Remove. All uses removed.
2045 pending_signals now counts both atimers and ordinary interrupts.
2046 This is less racy than having three separate pending-signal flags.
2047 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
2048 (input_blocked_p):
2049 Rename from their upper-case counterparts BLOCK_INPUT,
2050 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
2051 INPUT_BLOCKED_P, and turn into functions. All uses changed.
2052 This makes it easier to access volatile variables more accurately.
2053 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
2054 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
2055 that's more reliable if the code is buggy and sets
2056 interrupt_input_blocked to a negative value. All uses changed.
2057 * atimer.c (deliver_alarm_signal):
2058 Remove. No need to deliver this to the parent; any thread can
2059 handle this signal now. All uses replaced by underlying handler.
2060 * atimer.c (turn_on_atimers):
2061 * dispnew.c (handle_window_change_signal):
2062 * emacs.c (handle_danger_signal):
2063 * keyboard.c (kbd_buffer_get_event):
2064 Don't reestablish signal handler; not needed with sigaction.
2065 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
2066 (UNBLOCK_INPUT_TO):
2067 Rework to avoid unnecessary accesses to volatile variables.
2068 (UNBLOCK_INPUT_TO): Now a function.
2069 (totally_unblock_input, unblock_input): New decls.
2070 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
2071 (init_data): Remove. Necessary stuff now done in init_signal.
2072 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
2073 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
2074 (fatal_error_code): Remove; no longer needed.
2075 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
2076 it doesn't always backtrace. All uses changed. No need to reset
2077 signal to default, since sigaction and/or die does that for us now.
2078 Use emacs_raise (FOO), not kill (getpid (), FOO).
2079 (main): Check more-accurately whether we're dumping.
2080 Move fatal-error setup to sysdep.c
2081 * floatfns.c: Do not include "syssignal.h"; no longer needed.
2082 * gtkutil.c (xg_get_file_name, xg_get_font):
2083 Remove no-longer-needed signal-mask manipulation.
2084 * keyboard.c, process.c (POLL_FOR_INPUT):
2085 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
2086 * keyboard.c (read_avail_input): Remove.
2087 All uses replaced by gobble_input.
2088 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
2089 (kbd_buffer_store_event_hold, gobble_input):
2090 (record_asynch_buffer_change) [USABLE_SIGIO]:
2091 (store_user_signal_events):
2092 No need to mess with signal mask.
2093 (gobble_input): If blocking input and there are terminals, simply
2094 set pending_signals to 1 and return. All hooks changed to not
2095 worry about whether input is blocked.
2096 (process_pending_signals): Clear pending_signals before processing
2097 them, in case a signal comes in while we're processing.
2098 By convention callers now test pending_signals before calling us.
2099 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
2100 New functions, to support changes to blockinput.h.
2101 (handle_input_available_signal): Now extern.
2102 (reinvoke_input_signal): Remove. All uses replaced by
2103 handle_async_input.
2104 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
2105 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
2106 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
2107 Clear sigmask reliably, even if Fsignal returns, which it can.
2108 Omit unnecessary accesses to volatile var.
2109 (quit_throw_to_read_char): No need to restore sigmask.
2110 * keyboard.c (gobble_input, handle_user_signal):
2111 * process.c (wait_reading_process_output):
2112 Call signal-handling code rather than killing ourselves.
2113 * lisp.h: Include <float.h>, for...
2114 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
2115 (pending_signals): Now volatile.
2116 (syms_of_data): Now const if IEEE floating point.
2117 (handle_input_available_signal) [USABLE_SIGIO]:
2118 (terminate_due_to_signal, record_child_status_change): New decls.
2119 * process.c (create_process): Avoid disaster if memory is exhausted
2120 while we're processing a vfork, by tightening the critical section
2121 around the vfork.
2122 (send_process_frame, process_sent_to, handle_pipe_signal)
2123 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
2124 ignores SIGPIPE.
2125 (send_process): No need for setjmp/longjmp any more, since the
2126 SIGPIPE stuff is now gone. Instead, report an error if errno
2127 is EPIPE.
2128 (record_child_status_change): Now extern. PID and W are now args.
2129 Return void, not bool. All callers changed.
2130 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
2131 Remove. All uses removed. This bug should be fixed now in a
2132 different way.
2133 (wait_for_termination_1): Use waitpid rather than sigsuspend,
2134 and record the child status change directly. This avoids the
2135 need to futz with the signal mask.
2136 (process_fatal_action): Move here from emacs.c.
2137 (emacs_sigaction_flags): New function, containing
2138 much of what used to be in emacs_sigaction_init.
2139 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
2140 caught by emacs, to make races less likely.
2141 (deliver_process_signal): Rename from handle_on_main_thread.
2142 All uses changed.
2143 (BACKTRACE_LIMIT_MAX): Now at top level.
2144 (thread_backtrace_buffer, threadback_backtrace_pointers):
2145 New static vars.
2146 (deliver_thread_signal, deliver_fatal_thread_signal):
2147 New functions, for more-accurate delivery of thread-specific signals.
2148 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
2149 (deliver_arith_signal): Handle in this thread, not
2150 in the main thread, since it's triggered by this thread.
2151 (maybe_fatal_sig): New function.
2152 (init_signals): New arg DUMPING so that we can be more accurate
2153 about whether we're dumping. Caller changed.
2154 Treat thread-specific signals differently from process-general signals.
2155 Block all signals while handling fatal error; that's safer.
2156 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
2157 on IEEE hosts.
2158 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
2159 Ignore SIGPIPE unless batch.
2160 (emacs_backtrace): Output backtrace for the appropriate thread,
2161 which is not necessarily the main thread.
2162 * syssignal.h: Include <stdbool.h>.
2163 (emacs_raise): New macro.
2164 * xterm.c (x_connection_signal): Remove; no longer needed
2165 now that we use sigaction.
2166 (x_connection_closed): No need to mess with sigmask now.
2167 (x_initialize): No need to reset SIGPIPE handler here, since
2168 init_signals does this for us now.
2169
8f4635e9
JD
21702012-09-23 Jan Djärv <jan.h.d@swipnet.se>
2171
2172 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 2173 background rect may be larger (Bug#12245).
8f4635e9 2174
3296976d
CY
21752012-09-23 Chong Yidong <cyd@gnu.org>
2176
2177 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
2178
d41e491e
PE
21792012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2180
2181 * .gdbinit: Just stop at fatal_error_backtrace.
2182 See Stefan Monnier's request in
2183 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
2184 Remove no-longer-used query of system type.
2185
c88b867f
CY
21862012-09-22 Chong Yidong <cyd@gnu.org>
2187
2188 * search.c (Freplace_match): Doc fix (Bug#12325).
2189
2190 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
2191
2192 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
2193 (Fline_end_position): Doc fix.
2194
2195 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
2196
bb4d86b4
CY
21972012-09-22 Chong Yidong <cyd@gnu.org>
2198
2199 * dispextern.h (struct image_type): Add new slot, storing a type
2200 initialization function.
2201
2202 * image.c (define_image_type): Call the image initializer function
2203 if it is defined. Arguments and return value changed.
2204 (valid_image_p, make_image): Callers changed.
2205 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
2206 (gif_type, imagemagick_type, svg_type, gs_type):
2207 Add initialization functions.
bb4d86b4
CY
2208 (Finit_image_library): Call lookup_image_type.
2209 (CHECK_LIB_AVAILABLE): Macro deleted.
2210 (lookup_image_type): Call define_image_type here, rather than via
2211 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
2212 (syms_of_image): Move define_image_type calls for xbm_type and
2213 pbm_type to lookup_image_type.
2214
df9685f3
EZ
22152012-09-22 Eli Zaretskii <eliz@gnu.org>
2216
2217 * keyboard.c (timer_check_2): Move calculation of 'timers' and
2218 'idle_timers' from here ...
2219 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
2220 lists, to avoid infloops when the timer does something stupid,
2221 like reinvoke itself with the same or smaller time-out.
2222 (Bug#12447)
2223
8e17c9ba
MR
22242012-09-22 Martin Rudalics <rudalics@gmx.at>
2225
2226 * window.c (Fsplit_window_internal): Handle only Qt value of
2227 Vwindow_combination_limit separately.
2228 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
2229 (Vwindow_combination_limit): New default value.
2230 Rewrite doc-string.
8e17c9ba 2231
589bd69b
EZ
22322012-09-22 Eli Zaretskii <eliz@gnu.org>
2233
2234 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
2235 the new overlay string. (Bug#10159)
2236
01108e3f
PE
22372012-09-22 Paul Eggert <eggert@cs.ucla.edu>
2238
2239 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
2240 or that fprintf is async-signal-safe. POSIX doesn't require
2241 either assumption.
2242
82f8cd94
CY
22432012-09-22 Chong Yidong <cyd@gnu.org>
2244
2245 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
2246 (Bug#8207).
2247
3cccbd87
KH
22482012-09-22 Kenichi Handa <handa@gnu.org>
2249
2250 * composite.c (composition_reseat_it): Handle the case that a
2251 grapheme cluster is not covered by a single font (Bug#12352).
2252
09c01941
CY
22532012-09-21 Chong Yidong <cyd@gnu.org>
2254
2255 * image.c (define_image_type): Avoid adding duplicate types to
2256 image_types (Bug#12463). Suggested by Jörg Walter.
2257
acfa068f 22582012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
2259
2260 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
2261 (print_load_command_name): Add case LC_DATA_IN_CODE.
2262 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
2263
acfa068f 22642012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
2265
2266 * eval.c (Frun_hook_with_args_until_success)
2267 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
2268
acfa068f 22692012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
2270
2271 * fileio.c (Ffile_selinux_context): Only call freecon when
2272 lgetfilecon succeeded.
2273 (Fset_file_selinux_context): Likewise. (Bug#12444)
2274
acfa068f 22752012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
2276
2277 * xdisp.c (try_window_reusing_current_matrix): Under bidi
2278 reordering, locate the cursor by calling set_cursor_from_row; if
2279 that fails, clear the desired glyph matrix before returning a
2280 failure indication to the caller. Fixes leaving garbled display
2281 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
2282 (compute_stop_pos_backwards): Fix a typo that caused crashes while
2283 scrolling through multibyte text.
aa36e4d2 2284
e99f70c8
SM
22852012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
2286
2287 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
2288 calling mark_vectorlike since that's the one that marks the window.
2289 (mark_discard_killed_buffers): Mark the final cdr.
2290 * window.h (struct window): Move prev/next_buffers to the
2291 non-standard fields.
2292 * window.c (make_window): Initialize prev/next_buffers manually.
2293
f75beb47
PE
22942012-09-20 Paul Eggert <eggert@cs.ucla.edu>
2295
2296 Omit unused arg EXPECTED from socket hooks.
2297 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
2298 * nsterm.m (ns_term_init):
2299 * termhooks.h (struct terminal.read_socket_hook):
2300 * w32inevt.c (w32_console_read_socket):
2301 * w32term.c (w32_read_socket):
2302 * xterm.c (XTread_socket):
2303 Omit unused arg EXPECTED. All callers changed.
2304 (store_user_signal_events): Return void, not int, since callers no
2305 longer care about the return value. All uses changed.
2306
b019b76a
JB
23072012-09-20 Juanma Barranquero <lekktu@gmail.com>
2308
2309 * w32gui.h (XParseGeometry): Do not declare.
2310
05642592
PE
23112012-09-19 Paul Eggert <eggert@cs.ucla.edu>
2312
e4bce92a 2313 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 2314 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
2315 <http://bugs.gnu.org/12471#8> (last line).
2316
05642592
PE
2317 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
2318 (XParseGeometry): Now static. Substitute extremal values for
2319 values that are out of range.
2320
e543ae91
JD
23212012-09-19 Jan Djärv <jan.h.d@swipnet.se>
2322
2323 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
2324
2325 * nsfns.m (XParseGeometry): Remove.
2326 (Fx_create_frame): Call x_set_offset to correctly interpret
2327 top_pos in geometry.
2328
3a880af4 2329 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
2330 (Fx_parse_geometry): If there is a space in string, call
2331 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
2332
45ba16c7
EZ
23332012-09-17 Eli Zaretskii <eliz@gnu.org>
2334
c8b9f1bc
EZ
2335 * search.c (scan_buffer): Use character positions in calls to
2336 region_cache_forward and region_cache_backward, not byte
2337 positions. (Bug#12196)
2338
b4c932a2
EZ
2339 * w32term.c (w32_read_socket): Set pending_signals to 1, like
2340 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
2341
45ba16c7
EZ
2342 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
2343 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
2344 emacs_blocked_malloc, now deleted.
2345
eeceac93
PE
23462012-09-17 Paul Eggert <eggert@cs.ucla.edu>
2347
2348 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
2349 The workaround was for improving performance on Solaris 2.4, but
2350 is getting in the way now. Emacs will still work if someone is
2351 still running Solaris 2.4 in a museum somewhere; Sun dropped
2352 support for Solaris 2.4 in 2003.
2353 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
2354 * process.c (create_process) [HAVE_WORKING_VFORK]:
2355 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
2356 since Emacs no longer uses vfork on that platform.
2357
78f83752
GM
23582012-09-17 Glenn Morris <rgm@gnu.org>
2359
2360 * emacs.c: Use COPYRIGHT.
2361
634b8cac
PE
23622012-09-16 Paul Eggert <eggert@cs.ucla.edu>
2363
0caaedb1
PE
2364 Remove configure's --without-sync-input option (Bug#12450).
2365 When auditing signal-handling in preparation for cleaning it up,
2366 I found that SYNC_INPUT has race conditions and would be a real
2367 pain to fix. Since it's an undocumented and deprecated
2368 configure-time option, now seems like a good time to remove it.
2369 Also see <http://bugs.gnu.org/11080#16>.
2370 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
2371 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
2372 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2373 (malloc_hysteresis):
2374 (check_depth) [XMALLOC_OVERRUN_CHECK]:
2375 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
2376 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
2377 (dont_register_blocks, bytes_used_when_reconsidered)
2378 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
2379 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
2380 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 2381 Remove. All uses removed.
0caaedb1
PE
2382 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
2383 implementation, one that depends on whether the new macro
2384 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
2385 is defined.
2386 * atimer.c (run_timers, handle_alarm_signal):
2387 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
2388 (handle_async_input, process_pending_signals)
2389 (handle_input_available_signal, init_keyboard):
2390 * nsterm.m (ns_read_socket):
2391 * process.c (wait_reading_process_output):
2392 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
2393 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
2394 (emacs_write):
2395 * xterm.c (XTread_socket):
2396 Assume SYNC_INPUT.
2397 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
2398 * eval.c (handling_signal): Remove. All uses removed.
2399 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
2400 All uses replaced with the SYNC_INPUT version.
2401 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
2402 Remove decls.
2403 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
2404 Now static.
2405
634b8cac
PE
2406 * font.c (Ffont_shape_gstring): Remove unused local.
2407
83da1b55
GM
24082012-09-16 Glenn Morris <rgm@gnu.org>
2409
518650a5
GM
2410 * Makefile.in (clean): No longer run nextstep's clean.
2411
83da1b55
GM
2412 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
2413 (ns_frag): Remove.
2414 (ns-app): Move here from ns.mk, and simplify.
2415 (clean): Simplify nextstep entry.
2416 * ns.mk: Remove file.
2417
85a43e2e
KH
24182012-09-17 Kenichi Handa <handa@gnu.org>
2419
2420 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
2421 not covert the last few charactes.
2422
ba13e616 24232012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
2424
2425 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
2426 here, but just check the validity of glyphs in the glyph-string.
2427
a8c729af
MR
24282012-09-16 Martin Rudalics <rudalics@gmx.at>
2429
3a880af4
SM
2430 * window.c (Fwindow_parameter, Fset_window_parameter):
2431 Accept any window as argument (Bug#12452).
a8c729af 2432
c077c059
JD
24332012-09-16 Jan Djärv <jan.h.d@swipnet.se>
2434
2435 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
2436 to ns_term_init to avoid memory leak.
2437
2438 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
2439 explicit retain/release.
2440 (ns_term_init): Only allow one display. Initialize outerpool and
2441 ns_*_types.
2442
39a57ad0
PE
24432012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2444
2445 Port _setjmp fix to POSIXish hosts as well as Microsoft.
2446 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
2447 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
2448 the Microsoft problem in a different way, by altering ../nt/config.nt.
2449
7105c8cb
EZ
24502012-09-15 Eli Zaretskii <eliz@gnu.org>
2451
2452 * w32xfns.c:
2453 * w32uniscribe.c:
2454 * w32term.c:
2455 * w32select.c:
2456 * w32reg.c:
2457 * w32proc.c:
2458 * w32menu.c:
2459 * w32inevt.c:
2460 * w32heap.c:
2461 * w32font.c:
2462 * w32fns.c:
2463 * w32console.c:
2464 * w32.c:
2465 * w16select.c: Remove inclusion of setjmp.h, as it is now included
2466 by lisp.h. This completes removal of setjmp.h inclusion
2467 erroneously announced in the previous commit. (Bug#12446)
2468
2469 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
2470 more accurate.
2471
2472 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
2473 not defined as a macro. The latter happens on MS-Windows.
2474 (Bug#12446)
2475
0328b6de
PE
24762012-09-15 Paul Eggert <eggert@cs.ucla.edu>
2477
2478 Port better to POSIX hosts lacking _setjmp (Bug#12446).
2479 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 2480 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
2481 only reason for the instance was because "lisp.h" was included.
2482 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
2483 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
2484 and _longjmp with the new symbols. Emacs already uses _setjmp if
2485 available, so this change affects only POSIXish hosts that have
2486 sigsetjmp but not _setjmp, such as some versions of Solaris and
2487 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
2488 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
2489 (png_load_body) [HAVE_PNG]:
2490 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
2491 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
2492 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
2493 since PNG requires jmp_buf. This is the only exception to the
2494 general rule that we now use sys_setjmp and sys_longjmp.
2495 This exception is OK since this code does not change the signal
2496 mask or longjmp out of a signal handler.
2497
2af03429
PE
24982012-09-14 Paul Eggert <eggert@cs.ucla.edu>
2499
2500 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
2501 Include "syssignal.h", for 'main_thread'.
2502
2f294edf
DA
25032012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
2504
2505 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
2506 * insdel.c (replace_range, replace_range_2):
2507 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
2508 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
2509 Remove redundant check before calling offset_intervals.
2510
6b533e9c
MR
25112012-09-14 Martin Rudalics <rudalics@gmx.at>
2512
2513 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
2514 current buffer (Bug#12387).
2515
2a7931e3
JB
25162012-09-14 Juanma Barranquero <lekktu@gmail.com>
2517
2518 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
2519
c18e885b
PE
25202012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2521
2522 Use a more backwards-compatible timer format (Bug#12430).
2523 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
2524 vector element, not from the 4th, since PSECS is now at the end.
2525 (Fcurrent_idle_time): Doc fix.
2526
d59a1afb
DA
25272012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
2528
2529 Function to mark objects and remove killed buffers at once.
2530 * alloc.c (discard_killed_buffers): Rename to ...
2531 (mark_discard_killed buffers) ... new name. Add marking
2532 of remaining objects. Fix comment. Adjust users.
2533 (mark_object): Do not touch frame buffer lists here.
2534 * frame.c (delete_frame): Reset frame buffer lists here.
2535
5f0cb45a
PE
25362012-09-13 Paul Eggert <eggert@cs.ucla.edu>
2537
8ea47e3a
PE
2538 Better workaround for GNOME bug when --enable-gcc-warnings.
2539 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
2540 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
2541 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
2542
4a4bbad2
PE
2543 Simplify SIGIO usage (Bug#12408).
2544 The code that dealt with SIGIO was crufty and confusing, e.g., it
2545 played tricks like "#undef SIGIO" but these tricks were not used
2546 consistently. Simplify mostly by not #undeffing standard symbols,
2547 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
2548 or not as we please) rather than "defined SIGIO" (standard symbol
2549 that we probably shouldn't #undef).
2550 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
2551 Modules that need it can include it.
2552 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
2553 * dispextern.h (ignore_sigio): New decl.
2554 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
2555 unconditionally, since it's now a no-op if !USABLE_SIGIO.
2556 * emacs.c (shut_down_emacs):
2557 * keyboard.c (kbd_buffer_store_event_hold):
2558 Use ignore_sigio rather than invoking 'signal' directly.
2559 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
2560 for FIONREAD.
2561 (FIONREAD, SIGIO): Do not #undef.
2562 (tty_read_avail_input): Use #error rather than a syntax error.
2563 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
2564 for I_PIPE, used by SETUP_SLAVE_PTY.
2565 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
2566 * sysdep.c (croak): Remove; no longer needed. This bit of
2567 temporary code, with Fred N. Fish's comment that it's temporary,
2568 has been in Emacs since at least 1992!
2569 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
2570 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
2571 * syssignal.h (croak): Remove decl.
2572 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
2573 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
2574 now that we're termios-only.
2575 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
2576 * term.c (dissociate_if_controlling_tty): Use #error rather than
2577 a run-time error.
2578
5f0cb45a
PE
2579 Work around GCC and GNOME bugs when --enable-gcc-warnings.
2580 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
2581 to work around GNOME bug 683906.
2582 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
2583 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
2584 This works around GCC bug 54561.
2585
40bce90b
PE
25862012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2587
2588 More fixes for 'volatile' and setjmp/longjmp.
2589 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
2590 * image.c (struct png_load_context) [HAVE_PNG]: New type.
2591 (png_load_body) [HAVE_PNG]:
2592 (jpeg_load_body) [HAVE_JPEG]:
2593 New function, with most of the old parent function's body.
2594 (png_load) [HAVE_PNG]:
2595 (jpeg_load) [HAVE_JPEG]:
2596 Invoke the new function, to avoid longjmp munging our locals.
2597 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
2598 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
2599 longjmp is passed 2, as the C standard doesn't guarantee this.
2600 Instead, store the failure code into mgr->failure_code.
2601
bfeae2cf
SM
26022012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2603
2604 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
2605 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
2606 (syms_of_keyboard): Remove support for unread-command-char.
2607
8099e36b
EZ
26082012-09-12 Eli Zaretskii <eliz@gnu.org>
2609
2610 * w32proc.c (sys_kill): If PID is our process ID and the signal is
2611 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
2612 violation. (Bug#12426)
2613
92547ff9
PE
26142012-09-12 Paul Eggert <eggert@cs.ucla.edu>
2615
2616 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
2617
45b82ad0
SM
26182012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
2619
2620 * eval.c: Add `inhibit-debugger'.
2621 (Qinhibit_debugger): New symbol.
2622 (call_debugger): Bind it instead of Qdebug_on_error.
2623 (maybe_call_debugger): Test Vinhibit_debugger.
2624 (syms_of_eval): Define inhibit-debugger.
2625 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
2626 (syms_of_xdisp): Remove inhibit-debug-on-message.
2627
5779a1dc
PE
26282012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2629
50f2e553
PE
2630 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
2631 If a nonvolatile local variable is written before a _longjmp to
2632 the frame containing the variable, and is read after the _longjmp,
2633 the value read is indeterminate. Some local variables of type
2634 'struct handler' and 'struct catchtag' are used in this way, so
2635 mark each of their slots as volatile if the slot can be set before
2636 _longjmp and read afterwards.
2637 * lisp.h (struct handler): var and chosen_clause are now volatile.
2638 (struct catchtag): val, next, and pdlcount are now volatile.
2639
ae1d87e2
PE
2640 * bidi.c (bidi_push_it, bidi_pop_it):
2641 * fns.c (copy_hash_table):
2642 * image.c (define_image_type):
2643 * keyboard.c (kbd_buffer_store_event_hold):
2644 * process.c (Fprocess_send_eof):
2645 * xfaces.c (x_create_gc) [HAVE_NS]:
2646 * xgselect.c (xg_select):
2647 Prefer assignment to memcpy when either will do.
2648
5779a1dc
PE
2649 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
2650 Use pointer-to-a-pointer to simplify and avoid a NILP check each
2651 time an item is removed. No need to mark this function 'inline';
2652 the compiler knows better than we do.
2653
c4c9756b
JD
26542012-09-11 Jan Djärv <jan.h.d@swipnet.se>
2655
2656 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
2657 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
2658 to change_frame_size (Bug#12388).
2659 (windowDidResize:): Pass YES to updateFrameSize.
2660
2661 * nsterm.h: Add delay parameter to updateFrameSize.
2662
d73e321c
DA
26632012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2664
2665 Discard killed buffers from deleted window and frame objects.
2666 This reduces an amount of references to killed buffers and
2667 helps GC to reclaim them faster.
2668 * alloc.c (discard_killed_buffers): New function.
2669 (mark_object): Use it for deleted windows and frames.
2670 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 2671 or deleted frame, restore its global binding.
d73e321c
DA
2672 * data.c (swap_in_global_binding): Add GC notice.
2673 (swap_in_symval_forwarding): Use convenient set_blv_where.
2674 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
2675 * window.h: ... to here.
2676
e578f381
DA
26772012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2678
2679 Convenient macro to check whether the buffer is live.
2680 * buffer.h (BUFFER_LIVE_P): New macro.
2681 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
2682 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
2683
3057e615
YM
26842012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2685
2686 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
2687 composition cases (Bug#12364).
2688
2689 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
2690 overhang of succeeding glyphs overlapping box cursor.
2691
2692 * w32term.c (x_draw_glyph_string): Likewise.
2693
6fda35f2
PE
26942012-09-11 Paul Eggert <eggert@cs.ucla.edu>
2695
c990426a
PE
2696 Simplify, document, and port floating-point (Bug#12381).
2697 The porting part of this patch fixes bugs on non-IEEE platforms
2698 with frexp, ldexp, logb.
2699 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
2700 Now static.
2701 * floatfns.c: Simplify discussion of functions that Emacs doesn't
2702 support, by removing commented-out code and briefly listing the
2703 C89 functions excluded. The commented-out stuff was confusing
2704 maintenance, e.g., we thought we needed cbrt but it was commented out.
2705 (logb): Remove decl; no longer needed.
2706 (isfinite): New macro, if not already supplied.
2707 (isnan): Don't replace any existing macro.
2708 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
2709 are present on all C89 platforms.
2710 (Ffrexp): Do not special-case zero, as frexp does the right thing
2711 for that case.
2712 (Flogb): Do not use logb, as it doesn't have the desired meaning
2713 on hosts that use non-base-2 floating point. Instead, stick with
2714 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
2715 frexp, to avoid getting an unspecified result.
2716
6fda35f2
PE
2717 * xdisp.c (Qinhibit_debug_on_message): Now static.
2718
16130a58
JD
27192012-09-10 Jan Djärv <jan.h.d@swipnet.se>
2720
2721 * nsterm.m (ns_update_begin): Set clip path to whole view by using
2722 NSBezierPath (Bug#12131).
2723
d105a573
CY
27242012-09-10 Chong Yidong <cyd@gnu.org>
2725
2726 * fns.c (Fdelq, Fdelete): Doc fix.
2727
ff55dfe8
PE
27282012-09-10 Paul Eggert <eggert@cs.ucla.edu>
2729
2730 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
2731 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
2732
e7032e7c
SM
27332012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
2734
2735 * lisp.h (make_lisp_ptr): New macro to replace XSET.
2736 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
2737 Use it.
2738
e9957956
EZ
27392012-09-09 Eli Zaretskii <eliz@gnu.org>
2740
aba05ce9
EZ
2741 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
2742 left fringe if the window has a left margin. This avoids leaving
2743 traces of the cursor because its leftmost pixel is not drawn over.
2744
e9957956
EZ
2745 * dispnew.c (update_window_line): When the left margin area of a
2746 screen line is updated, set the redraw_fringe_bitmaps_p flag of
2747 that screen line. (Bug#12277)
2748
f6196b87
PE
27492012-09-09 Paul Eggert <eggert@cs.ucla.edu>
2750
2751 Assume C89 or later for math functions (Bug#12381).
2752 This simplifies the code, and makes it a bit smaller and faster,
2753 and (most important) makes it easier to clean up signal handling
2754 since we can stop worring about floating-point exceptions in
2755 library code. That was a problem before C89, but the problem
2756 went away many years ago on all practical Emacs targets.
2757 * data.c, image.c, lread.c, print.c:
2758 Don't include <math.h>; no longer needed.
2759 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
2760 might be autoconfigured, as that never happens.
2761 * data.c (fmod):
2762 * doprnt.c (DBL_MAX_10_EXP):
2763 * print.c (DBL_DIG):
2764 Remove. C89 or later always defines these.
2765 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
2766 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
2767 (arith_error, domain_error, domain_error2):
2768 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
2769 no longer needed -- we simply return what C returns. All uses removed.
2770 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
2771 the wrapped code.
2772 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
2773 Remove. All uses expanded, as these macros are no longer used
2774 more than once and are now more trouble than they're worth.
2775 (Ftan): Use tan, not sin / cos.
2776 (Flogb): Assume C89 frexp.
2777 (fmod_float): Assume C89 fmod.
2778 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
2779 (init_floatfns): Remove. All uses removed.
2780
9d7f1863
JD
27812012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2782
2783 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
2784 compositeToPoint for OSX < 10.6 (Bug#12390).
2785
eabf0404
PE
27862012-09-08 Paul Eggert <eggert@cs.ucla.edu>
2787
2788 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
2789 This produces more-accurate results.
2790
0b3b1d23
JD
27912012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2792
2793 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
2794 changes (Bug#12088).
2795
6dcef6ec
CY
27962012-09-08 Chong Yidong <cyd@gnu.org>
2797
2798 * syntax.c (Fstring_to_syntax): Doc fix.
2799
aa7d57c5
JD
28002012-09-08 Jan Djärv <jan.h.d@swipnet.se>
2801
2802 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
2803 in the internal border.
2804 (x_set_window_size): Remove static variables and their usage.
2805 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
2806 (ns_after_update_window_line, ns_draw_fringe_bitmap):
2807 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
2808 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
2809 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
2810 (ns_fix_rect_ibw): Remove.
2811 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
2812 (ns_dumpglyphs_box_or_relief): Ditto.
2813 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
2814 adjustment.
2815 (ns_dumpglyphs_image): Ditto.
fc0c31f8 2816 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
2817 border adjustment.
2818 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
2819 their usage. Add fringe_extended_p and its use as in other terms.
2820 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
2821 scroll bar was removed.
2822 (updateFrameSize): New function.
2823 (windowDidResize): Move code to updateFrameSize and call it.
2824
2825 * nsterm.h (EmacsView): Add updateFrameSize.
2826
1a5432bc
CY
28272012-09-07 Chong Yidong <cyd@gnu.org>
2828
b4f5313e
CY
2829 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
2830
1a5432bc
CY
2831 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
2832
1a4f1e9b
PE
28332012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2834
2835 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
2836 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
2837 Problem introduced when merging patches. Noted by Eli Zaretskii in
2838 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
2839 * floatfns.c: Comment fix.
2840 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
2841 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
2842 and anyway the declaration is harmless even if SIGDANGER is not defined.
2843 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
2844 defined BROKEN_FIONREAD). systty.h formerly did this, but other
2845 source files not surprisingly expected syssignal.h to define, or
2846 not define, SIGIO, and it's cleaner to do it that way, for consistency.
2847 Include <sys/ioctl.h>, for FIONREAD.
2848 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
2849 This eliminates a problem whereby other files mysteriously had
2850 to include "syssignal.h" before including "systty.h" if they
2851 wanted to use "#ifdef SIGIO".
2852
bc8000ff
EZ
28532012-09-07 Eli Zaretskii <eliz@gnu.org>
2854
3e6d6928
EZ
2855 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
2856
2857 * w32.c (sigemptyset): Empty the set.
2858 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
2859
bc8000ff
EZ
2860 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
2861
b4fa72f2
DA
28622012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
2863
2864 * alloc.c (mark_buffer): Revert unsafe marking optimization.
2865 (mark_object): Likewise for frame objects.
2866
30730c93
PE
28672012-09-07 Paul Eggert <eggert@cs.ucla.edu>
2868
2869 * syssignal.h (handle_on_main_thread): Always declare,
2870 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
2871 This ports to platforms without HAVE_PTHREAD.
2872
2fe28299
PE
28732012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2874
2875 Signal-handler cleanup (Bug#12327).
2876 Emacs's signal handlers were written in the old 4.2BSD style with
2877 sigblock and sigmask and so forth, and this led to some
2878 inefficiencies and confusion. Rewrite these to use
2879 pthread_sigmask etc. without copying signal sets around. Also,
2880 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
2881 'signal', and instead use functions that do not attempt to take
2882 over the system name space. This patch causes Emacs's text
2883 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
2884 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
2885 Do not include <signal.h> or "syssignal.h", as these
2886 modules do not use signals.
2887 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
2888 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
2889 Do not include <signal.h>, as "syssignal.h" does that for us now.
2890 * atimer.c (sigmask_atimers): New function.
2891 (block_atimers, unblock_atimers): New functions,
2892 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
2893 All uses replaced.
2894 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
2895 no longer needed here.
2896 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 2897 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
2898 * sysdep.c (struct save_signal): New member 'action', replacing
2899 old member 'handler'.
2900 (save_signal_handlers, restore_signal_handlers):
2901 Use sigaction instead of 'signal' to save and restore.
2902 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
2903 New function. All users of 'signal' modified to use set_sighandler
2904 if they're writeonly, and to use sys_signal if they're read+write.
2905 (emacs_sigaction_init, forwarded_signal): New functions.
2906 (sys_signal): Remove. All uses replaced by calls to sigaction
2907 and emacs_sigaction_init, or by direct calls to 'signal'.
2908 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
2909 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
2910 all uses replaced by pthread_sigmask etc. calls.
2911 * syssignal.h: Include <signal.h>.
2912 (emacs_sigaction_init, forwarded_signal): New decls.
2913 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
2914 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
2915 (sigmask, sys_sigmask): Remove; no longer needed.
2916 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
2917 (sigblock, sigunblock, sigfree):
2918 (sigsetmask) [!defined sigsetmask]:
2919 Remove. All uses replaced by pthread_sigmask.
2920 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
2921 no longer need to be replaced, and its typical old uses
2922 are now done via emacs_sigaction_init and sigaction.
2923 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
2924 (sys_sigdel): Remove; unused.
2925 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
2926
0216c128
EZ
29272012-09-06 Eli Zaretskii <eliz@gnu.org>
2928
2929 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
2930 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
2931
c752cfa9
DA
29322012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2933
2934 Explicitly mark buffer_defaults and buffer_local_symbols.
2935 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
2936 mark_local_symbols here.
2937 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
2938 since special buffers aren't marked here any more.
2939 (allocate_buffer): Chain new buffer with all_buffers here...
2940 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
2941 not here.
2942 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
2943 (syms_of_buffer): Remove staticpro of the above.
2944 (init_buffer_once): Set names for buffer_defaults and
2945 buffer_local_symbols.
2946
a864ef14
PE
29472012-09-06 Paul Eggert <eggert@cs.ucla.edu>
2948
2949 Use bool for booleans in font-related modules.
2950 * font.c (font_intern_prop, font_style_to_value)
2951 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
2952 (generate_otf_features, font_check_otf_features, font_check_otf)
2953 (font_match_p, font_list_entities, font_at):
2954 * fontset.c (fontset_id_valid_p, reorder_font_vector
2955 (fontset_find_font, Fset_fontset_font)
2956 (face_suitable_for_char_p) [0]:
2957 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
2958 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
2959 (m17n_flt_initialized, ftfont_shape_by_flt):
2960 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
2961 * nsfont.m (nsfont_draw):
2962 * w32font.c (w32font_draw):
2963 * w32term.c (x_draw_glyphless_glyph_string_foreground):
2964 Use bool for booleans.
2965 * font.h: Adjust to above API changes.
2966 (struct font, struct font_driver, struct font_driver_list):
2967 Use bool for booleans.
2968 (struct font): Remove useless member encoding_type.
2969 All users removed.
2970 * fontset.c, xftfont.c: Omit unnecessary static decls.
2971
0699fc18
DA
29722012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
2973
2974 * alloc.c (mark_object): Revert window marking code
2975 since it's unsafe for the Fset_window_configuration.
2976
20ef56db
PE
29772012-09-05 Paul Eggert <eggert@cs.ucla.edu>
2978
2fe28299 2979 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
2980 Be more systematic about preserving errno whenever a signal
2981 handler returns, even if it's not in the main thread. Do this by
2982 renaming signal handlers to distinguish between signal delivery
2983 and signal handling. All uses changed.
2984 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
2985 * data.c (deliver_arith_signal): Rename from arith_error.
2986 * dispnew.c (deliver_window_change_signal): Rename from
2987 window_change_signal.
2988 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
2989 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
2990 * keyboard.c (deliver_input_available_signal): Rename from
2991 input_available_signal.
2992 (deliver_user_signal): Rename from handle_user_signal.
2993 (deliver_interrupt_signal): Rename from interrupt_signal.
2994 * process.c (deliver_pipe_signal): Rename from send_process_trap.
2995 (deliver_child_signal): Rename from sigchld_handler.
2996 * atimer.c (handle_alarm_signal):
2997 * data.c (handle_arith_signal):
2998 * dispnew.c (handle_window_change_signal):
2999 * emacs.c (handle_fatal_signal, handle_danger_signal):
3000 * keyboard.c (handle_input_available_signal):
3001 * keyboard.c (handle_user_signal, handle_interrupt_signal):
3002 * process.c (handle_pipe_signal, handle_child_signal):
3003 New functions, with the actual signal-handling code taken from the
3004 original respective signal handlers, sans the sporadic attempts to
3005 preserve errno, since that's now done by handle_on_main_thread.
3006 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
3007 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
3008 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3009 Move to sysdep.c.
3010 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3011 Move initialization of main_thread to sysdep.c's init_signals.
3012 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
3013 our usage, and simplifies the mainline code.
3014 (record_child_status_change): New static function, as a helper
3015 for handle_child_signal, and with most of the old child handler's
3016 contents.
3017 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
3018 (handle_child_signal): Use the above.
3019 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
3020 Moved here from emacs.c.
3021 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
3022 code moved here from emacs.c's main function.
3023 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
3024 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
3025 This lets callers save and restore errno properly.
20ef56db 3026
e3ccf108
DA
30272012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3028
3029 Remove redundant or unused things here and there.
3030 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
3031 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
3032 * editfns.c (Fcompare_buffer_substrings): Likewise.
3033 * frame.h (struct terminal, struct font_driver_list):
3034 Remove redundant declarations.
3035 * window.h (Qleft, Qright): Likewise.
3036
697e1e39
DA
30372012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3038
3039 Do not mark objects from deleted buffers, windows and frames.
3040 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
3041 (mark_object): Likewise for windows and frames.
3042
c1ca42ca
DA
30432012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
3044
3045 * alloc.c (valid_lisp_object_p): Treat killed buffers,
3046 buffer_defaults and buffer_local_symbols as valid objects.
3047 Return special value to denote them.
3048
014d93be
PE
30492012-09-05 Paul Eggert <eggert@cs.ucla.edu>
3050
f75d7a91
PE
3051 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
3052 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
3053 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
3054 (file_name_absolute_p, Fsubstitute_in_file_name):
3055 (check_executable, check_writable, Ffile_accessible_directory_p)
3056 (Fset_file_selinux_context, Fdefault_file_modes)
3057 (Finsert_file_contents, choose_write_coding_system)
3058 (Fwrite_region, build_annotations, a_write, e_write)
3059 (Fdo_auto_save):
3060 * filelock.c (boot_time_initialized, get_boot_time)
3061 (get_boot_time_1, lock_file_1, within_one_second):
3062 * floatfns.c (in_float):
3063 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
3064 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
3065 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
3066 * lisp.h (struct Lisp_Hash_Table.cmpfn):
3067 * window.c (compare_window_configurations):
3068 Use bool for booleans.
3069 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
3070 (Fdefault_file_modes): Now mode_t, not int, for modes.
3071 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
3072 (internal_delete_file): Now returns void, not a (boolean) int,
3073 since nobody was looking at the return value.
3074 * lisp.h, window.h: Adjust to above API changes.
3075
014d93be
PE
3076 * xdisp.c (set_message): Simplify and reindent last change.
3077
776f29e1
JB
30782012-09-05 Juanma Barranquero <lekktu@gmail.com>
3079
3080 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
3081
7f7e0167
LI
30822012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
3083
3084 * eval.c (call_debugger): Make the function non-static so that we
3085 can call it from set_message.
3086
3087 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
3088 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
3089
cf29dd84
PE
30902012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3091
3092 Give more-useful info on a fatal error (Bug#12328).
3093 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
3094 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
3095 of doing the work ourselves.
3096 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
3097 do most of the work.
3098 (fatal_error_backtrace): New function, taken from the guts
3099 of the old fatal_error_signal, but with a new option to output
3100 a backtrace.
3101 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
3102 info about the signal than just its number.
3103 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
3104 * sysdep.c: Include <execinfo.h>
3105 (emacs_backtrace): New function, taken partly from the previous
3106 code of the 'die' function.
3107 (emacs_abort): Call fatal_error_backtrace rather than abort.
3108
972debf2
SM
31092012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
3110
3111 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
3112 eager (load-time) macro-expansion.
3113 * lisp.mk (lisp): Add macroexp.
3114
1088b922
PE
31152012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3116
3117 Simplify redefinition of 'abort' (Bug#12316).
3118 Do not try to redefine the 'abort' function. Instead, redo
3119 the code so that it calls 'emacs_abort' rather than 'abort'.
3120 This removes the need for the NO_ABORT configure-time macro
3121 and makes it easier to change the abort code to do a backtrace.
3122 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
3123 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
3124 Remove; sysdep.c's emacs_abort now takes its place.
3125 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
3126 'abort' changed to use 'emacs_abort'.
3127 * msdos.c (dos_abort) [defined abort]: Remove; not used.
3128 (abort) [!defined abort]: Rename to ...
3129 (emacs_abort): ... new name.
3130 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
3131 the place of the old 'abort' in emacs.c.
3132 * w32.c, w32fns.c (abort): Do not #undef.
3133 * w32.c (emacs_abort): Rename from w32_abort.
3134
30934d33
EZ
31352012-09-04 Eli Zaretskii <eliz@gnu.org>
3136
3137 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
3138 offsets[j].dv, since the y axis of the screen coordinates points
3139 down, while the y axis of the font definition coordinates points
3140 up. This fixes display of Arabic diacritics such as KASRA and
3141 KASRATAN. (Bug#11860)
3142
af26b72c
PE
31432012-09-04 Paul Eggert <eggert@cs.ucla.edu>
3144
3145 Be more systematic about _setjmp vs setjmp.
3146 * alloc.c (test_setjmp, mark_stack):
3147 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
3148 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
3149 (png_load, my_error_exit, jpeg_load):
3150 * process.c (send_process_trap, send_process):
3151 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
3152 The underscored versions are up to 30x faster on some hosts.
3153 Formerly, the code used setjmp+longjmp sometimes and
3154 _setjmp+_longjmp at other times, with no particular reason to
3155 prefer setjmp+longjmp.
3156
26d4541d
PE
31572012-09-03 Paul Eggert <eggert@cs.ucla.edu>
3158
d42f4f0f 3159 Fix minor problem found by static checking.
26d4541d 3160 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 3161
c5e28e39
MR
31622012-09-03 Martin Rudalics <rudalics@gmx.at>
3163
3164 * buffer.c (Fdelete_all_overlays): New function.
3165
3eab3ca9
CY
31662012-09-03 Chong Yidong <cyd@gnu.org>
3167
3168 * gtkutil.c: Add extern decl for Qxft.
3169
c04889f8
PE
31702012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3171
1882aa38
PE
3172 * emacs.c, eval.c: Use bool for boolean.
3173 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
3174 (malloc_using_checking) [DOUG_LEA_MALLOC]:
3175 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
3176 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
3177 (main, decode_env_path, Fdaemon_initialized):
3178 * eval.c (call_debugger, Finteractive_p, interactive_p):
3179 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
3180 (maybe_call_debugger, Fbacktrace):
3181 * process.c (read_process_output, exec_sentinel):
3182 Use bool for booleans.
3183 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
3184 All callers changed.
3185 * eval.c (interactive_p): Omit always-true boolean argument
3186 EXCLUDE_SUBRS_P. All callers changed.
3187 * dispextern.h, lisp.h: Reflect above API changes.
3188 * firstfile.c (dummy): Use the address of 'main', whose signature
3189 won't change, instead of the address of 'initialize', whose
3190 signature just changed from int to bool.
3191 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
3192 * msdos.c (fatal_error_in_progress): ... from here.
3193 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
3194 of incrementing it.
3195 (redisplay_internal, unwind_redisplay): Simply clear
3196 REDISPLAYING_P when unwinding, instead of saving its previous,
3197 always-false value and then restoring it.
3198
a411ac43
PE
3199 Clean up some extern decls.
3200 Mostly, this hoists extern decls out of .c files and into .h files.
3201 That way, we're more likely to catch errors if the interfaces change.
3202 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
3203 declare xg_mark_data.
3204 * dispextern.h (x_frame_parm_handlers):
3205 * font.h (Qxft):
3206 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
3207 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
3208 (Qultra_bold, Qoblique, Qitalic):
3209 Move extern decl here from .c file.
3210 * alloc.c (xg_mark_data) [USE_GTK]:
3211 * doc.c (Qclosure):
3212 * eval.c (Qlexical_binding):
3213 * fns.c (time) [!HAVE_UNISTD_H]:
3214 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
3215 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
3216 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
3217 * lread.c (Qinternal_interpreter_environment):
3218 * minibuf.c (Qbuffer):
3219 * process.c (QCfamily, QCfilter):
3220 * widget.c (free_frame_faces):
3221 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
3222 * xfont.c (x_clear_errors):
3223 * xterm.c (x_frame_parm_handlers):
3224 Remove now-redundant extern decls.
3225 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
3226 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
3227 Now static.
3228 * xfaces.c: Remove unnecessary static decls.
3229 * xterm.c (updating_frame): Remove decl of nonexistent object.
3230
c04889f8
PE
3231 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
3232 when building globals.h, as the objects that are not built on
3233 this host are not needed to compile C files on this host.
3234
8b339673
JD
32352012-09-02 Jan Djärv <jan.h.d@swipnet.se>
3236
3237 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
3238
3239 * frame.h: Add missing prototype for x_wm_set_size_hint.
3240
a08d4ba7
PE
32412012-09-02 Paul Eggert <eggert@cs.ucla.edu>
3242
3243 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
3244 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
3245 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
3246 (Fsubstitute_command_keys):
3247 * editfns.c (region_limit, find_field, Fconstrain_to_field)
3248 (save_excursion_save, save_excursion_restore)
3249 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
3250 (format_time_string, general_insert_function)
3251 (make_buffer_string, make_buffer_string_both)
3252 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
3253 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
3254 (copy_text, insert_1, insert_1_both, insert_from_string)
3255 (insert_from_string_before_markers, insert_from_string_1)
3256 (insert_from_buffer, insert_from_buffer_1, replace_range)
3257 (replace_range_2, del_range_1, del_range_byte, del_range_both)
3258 (del_range_2, modify_region):
3259 * intervals.c (intervals_equal, balance_possible_root_interval)
3260 (adjust_intervals_for_insertion, merge_properties_sticky)
3261 (graft_intervals_into_buffer, lookup_char_property)
3262 (adjust_for_invis_intang, set_point_both)
3263 (get_property_and_range, compare_string_intervals)
3264 (set_intervals_multibyte_1, set_intervals_multibyte):
3265 * keyboard.c (decode_timer):
3266 Use bool for boolean.
3267 * intervals.h, lisp.h, systime.h: Reflect above API changes.
3268 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
3269
48c948de
CY
32702012-09-02 Chong Yidong <cyd@gnu.org>
3271
3272 * keymap.c (push_key_description): Print M-TAB as C-M-i
3273 (Bug#11758).
3274
6c49a40b
JB
32752012-09-02 Juanma Barranquero <lekktu@gmail.com>
3276
3277 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
3278 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
3279 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
3280 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
3281 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
3282 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
3283 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
3284
4dfbd238
EZ
32852012-09-01 Eli Zaretskii <eliz@gnu.org>
3286
7e510e28
EZ
3287 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
3288 more than one grapheme cluster passed to the shaper: compute the
3289 offset adjustment values separately for each cluster. (Bug#11860)
3290
4dfbd238
EZ
3291 * image.c: Restore mistakenly removed inclusion of w32.h. Without
3292 it, GCC doesn't see prototypes of w32_delayed_load, and complains
3293 about implicit conversions from integer to pointer.
3294
86571ae0
DC
32952012-09-01 Daniel Colascione <dancol@dancol.org>
3296
3297 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
3298 system used too early.
3299
0e23ef9d
PE
33002012-09-01 Paul Eggert <eggert@cs.ucla.edu>
3301
3302 Better seed support for (random).
3303 * emacs.c (main): Call init_random.
3304 * fns.c (Frandom): Set the seed from a string argument, if given.
3305 Remove long-obsolete Gentzel cruft.
3306 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
3307 (init_random): New function.
3308
17a2cbbd
DC
33092012-09-01 Daniel Colascione <dancol@dancol.org>
3310
3311 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
3312 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
3313 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
3314 x_wm_set_size_hint, x_query_colors, x_real_positions,
3315 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
3316 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
3317 all of which have been moved to common code.
3318
3319 * xfaces.c: Include TERM_HEADER instead of listing all possible
3320 window-system headers.
3321
3322 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
3323 to match header.
3324
3325 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
3326 directly accessing frame internals.
3327
f18cbb28 3328 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
3329 globals_of_w32font.
3330
3331 * process.c: Include TERM_HEADER instead of listing all possible
3332 window-system headers.
3333
3a880af4
SM
3334 * nsterm.h: Remove declarations now in frame.h.
3335 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
3336
3337 * menu.c: Include TERM_HEADER instead of listing all possible
3338 window-system headers.
3339
3340 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
3341 window system.
3342
3343 * keyboard.c: Include TERM_HEADER instead of listing all possible
3344 window-system headers.
3345
3346 * image.c: Include TERM_HEADER instead of listing all possible
3347 window-system headers. Declare Vlibrary_cache when compiling for
3348 Windows.
3349
3350 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
3351 window system declarations.
3352
3353 * frame.h: Move common functions here: set_frame_menubar,
3354 x_set_window_size, x_sync, x_get_focus_frame,
3355 x_set_mouse_position, x_set_mouse_pixel_position,
3356 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
3357 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
3358 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
3359 x_activate_menubar, x_real_positions, x_bitmap_icon,
3360 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
3361 and x_query_colors.
3362
3363 * frame.c: Include TERM_HEADER instead of listing all possible
3364 window-system headers.
3365
3366 * font.c: Include TERM_HEADER instead of listing all possible
3367 window-system headers.
3368
3369 * emacs.c: Include TERM_HEADER.
3370
f18cbb28
EZ
3371 * dispnew.c: Include TERM_HEADER instead of listing all possible
3372 window-system headers.
17a2cbbd 3373
f18cbb28 3374 * ccl.h: Include character.h.
17a2cbbd
DC
3375
3376 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
3377 the current window system; include in list of objects to link into
3378 Emacs.
3379
c650a5de
DA
33802012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3381
3382 Remove mark_ttys function and fix tty_display_info initialization.
3383 * lisp.h (mark_ttys): Remove prototype.
3384 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
3385 to mark_ttys because all possible values of 'top_frame' slot are
3386 the frames which are reachable from Vframe_list.
3387 * term.c (mark_ttys): Remove.
3388 (init_tty): Safely initialize 'top_frame' slot with Qnil.
3389
4e0f6479
DA
33902012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3391
3392 Change struct frame bitfields from unsigned char to unsigned.
3393 * frame.h (struct frame): Change type of 'display_preempted',
3394 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
3395 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
3396 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
3397 bitfields from unsigned char to unsigned.
3398
8b96a52c
DA
33992012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
3400
3401 Remove unused member of struct x_output and struct w32_output.
3402 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
3403 * w32term.h (struct w32_output): Likewise.
3404
b4444c8a
JD
34052012-08-30 Jan Djärv <jan.h.d@swipnet.se>
3406
3407 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
3408 does not become zero (Bug#12234).
3409
b98521db
PE
34102012-08-30 Paul Eggert <eggert@cs.ucla.edu>
3411
3412 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
3413 for GCC 4.7.1 x86-64.
3414
31d02438
GM
34152012-08-30 Glenn Morris <rgm@gnu.org>
3416
3417 * lread.c (init_lread): For out-of-tree builds, only add the
3418 source directory's site-lisp dir to the load-path if it exists,
3419 consistent with in-tree builds. (Bug#12302)
3420
7f8941d8
JD
34212012-08-28 Jan Djärv <jan.h.d@swipnet.se>
3422
3423 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 3424 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
3425 (windowShouldClose:): Set window_closed.
3426 (dealloc): New member, free button_values.
fc0c31f8
JB
3427 (process_dialog:): Make member function. Remove window argument,
3428 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
3429 in button_values.
3430 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 3431 with tag. Remove return self, declare return value as void.
7f8941d8
JD
3432 (addString:row:): Remove return self, declare return value as void.
3433 (addSplit): Remove return self, declare return value as void.
3434 (clicked:): Remove return self, declare return value as void.
fc0c31f8 3435 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
3436 (initFromContents:isQuestion:): Adjust call to process_dialog.
3437 Code formatting change.
3438 (timeout_handler:): Set timer_fired to YES.
3439 (runDialogAt:): Set timer_fired to NO.
3440 Handle click on close button as quit.
3441
3442 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
3443 Add window_closed and button_values. Add void as return value for
3444 add(Button|String|Split). addButton takes int instead of Lisp_Object.
3445 Add process_dialog as new member.
3446
eada0861 34472012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 3448
eada0861
GM
3449 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
3450 is not one of the heaps we manage. (Bug#12242)
3451
34522012-08-28 Glenn Morris <rgm@gnu.org>
3453
3454 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
3455
457294dd
MR
34562012-08-28 Martin Rudalics <rudalics@gmx.at>
3457
3458 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
3459 auto-buffer-name window parameter. Install revision of reverted
3460 fix.
457294dd 3461
4f2daf31
DA
34622012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3463
3464 Do not allow to set major mode for a dead buffer.
3465 * buffer.c (Fset_buffer_major_mode): Signal an error
3466 if the buffer is dead.
3467 (Fother_buffer, other_buffer_safely): Remove redundant
3468 nested declaration.
3469
66322887
DA
34702012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3471
3472 Always use set_buffer_if_live to restore original buffer at unwind.
3473 * buffer.h (record_unwind_current_buffer): New function.
3474 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
3475 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
3476 * undo.c, window.c: Adjust users.
3477 * buffer.c (set_buffer_if_live): Fix comment.
3478
a3d794a1
DA
34792012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
3480
3481 Fix usage of set_buffer_internal.
3482 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
3483 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
3484 * coding.c (decode_coding): Omit redundant test.
3485 * fileio.c (decide_coding_unwind): Likewise.
3486 * fns.c (secure_hash): Likewise.
3487 * insdel.c (modify_region): Likewise.
3488 * keyboard.c (command_loop_1): Likewise.
3489 * print.c (PRINTFINISH): Likewise.
3490 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
3491
59ea14cd
PE
34922012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3493
3494 * dispnew.c: Use bool for boolean.
3495 (frame_garbaged, display_completed, delayed_size_change)
3496 (fonts_changed_p, add_window_display_history)
3497 (add_frame_display_history, verify_row_hash)
3498 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
3499 (row_equal_p, realloc_glyph_pool)
3500 (allocate_matrices_for_frame_redisplay)
3501 (showing_window_margins_p)
3502 (adjust_frame_glyphs_for_frame_redisplay)
3503 (build_frame_matrix_from_leaf_window, make_current)
3504 (mirrored_line_dance, mirror_line_dance, update_frame)
3505 (update_window_tree, update_single_window)
3506 (check_current_matrix_flags, update_window, update_text_area)
3507 (update_window_line, set_window_update_flags, scrolling_window)
3508 (update_frame_1, scrolling, buffer_posn_from_coords)
3509 (do_pending_window_change, change_frame_size)
3510 (change_frame_size_1, sit_for):
3511 Use bool for boolean.
3512 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
3513 and remove last int (actually boolean) argument, which was always 0.
3514 All callers changed.
3515 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
3516 * dispextern.h (struct composition_it): Use bool for boolean.
3517 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
3518 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
3519 * dired.c (file_name_completion):
3520 Use bool for boolean. (This was missed in an earlier change.)
3521
95072a94
MR
35222012-08-27 Martin Rudalics <rudalics@gmx.at>
3523
3524 * window.c (Fset_window_configuration): Revert first part of
3525 last change.
3526
0f19feff
JD
35272012-08-27 Jan Djärv <jan.h.d@swipnet.se>
3528
3529 * nsterm.h (NSPanel): New class variable dialog_return.
3530
3a880af4
SM
3531 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
3532 Initialize dialog_return.
0f19feff
JD
3533 (windowShouldClose:): Use stop instead of stopModalWithCode.
3534 (clicked:): Ditto, and also set dialog_return (Bug#12258).
3535 (timeout_handler:): Use stop instead of abortModal. Send a dummy
3536 event.
3537 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
3538 modal loop returns.
3539
f10fe38f
PE
35402012-08-27 Paul Eggert <eggert@cs.ucla.edu>
3541
de1339b0
PE
3542 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
3543 * composite.c (find_composition, composition_gstring_p)
3544 (composition_reseat_it, find_automatic_composition):
3545 * data.c (let_shadows_buffer_binding_p)
3546 (let_shadows_global_binding_p, set_internal, make_blv)
3547 (Fmake_variable_buffer_local, Fmake_local_variable)
3548 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
3549 (cons_to_signed, arith_driver):
3550 * dbusbind.c (xd_in_read_queued_messages):
3551 * dired.c (directory_files_internal, file_name_completion):
3552 Use bool for booleans.
3553 * dired.c (file_name_completion):
3554 * process.h (fd_callback):
3555 Omit int (actually boolean) argument. It wasn't being used.
3556 All uses changed.
3557 * composite.h, lisp.h: Reflect above API changes.
3558
f10fe38f
PE
3559 * cmds.c, coding.c: Use bool for booleans.
3560 * cmds.c (move_point, Fself_insert_command):
3561 * coding.h (struct composition status, struct coding_system):
3562 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
3563 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
3564 (emacs_mule_char, decode_coding_emacs_mule)
3565 (encode_coding_emacs_mule, detect_coding_iso_2022)
3566 (decode_coding_iso_2022, encode_invocation_designation)
3567 (encode_designation_at_bol, encode_coding_iso_2022)
3568 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
3569 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
3570 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
3571 (encode_coding_raw_text, detect_coding_charset)
3572 (decode_coding_charset, encode_coding_charset, detect_eol)
3573 (detect_coding, get_translation_table, produce_chars)
3574 (consume_chars, reused_workbuf_in_use)
3575 (make_conversion_work_buffer, code_conversion_save)
3576 (decode_coding_object, encode_coding_object)
3577 (detect_coding_system, char_encodable_p)
3578 (Funencodable_char_position, code_convert_region)
3579 (code_convert_string, code_convert_string_norecord)
3580 (Fset_coding_system_priority):
3581 * fileio.c (Finsert_file_contents):
3582 Use bool for booleans.
3583 * coding.h, lisp.h: Reflect above API changes.
3584 * coding.c: Remove unnecessary static function decls.
3585 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
3586 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
3587 not a boolean 'int', since callers never look at the return value.
3588 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
3589 * coding.h (decoding_buffer_size, encoding_buffer_size)
3590 (emacs_mule_string_char): Remove unused extern decls.
3591 (struct iso_2022_spec, struct coding_system):
3592 Use 'unsigned int : 1' for boolean fields, since there's more than one.
3593 (struct emacs_mule_spec): Remove unused field 'full_support'.
3594 All initializations removed.
3595 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
3596
5474c384
DA
35972012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3598
f10fe38f 3599 Fix spare memory change (Bug#12286).
5474c384
DA
3600 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
3601 (valid_lisp_object_p): Likewise.
3602
c4b6914d
MR
36032012-08-27 Martin Rudalics <rudalics@gmx.at>
3604
3605 * window.c (Fset_window_configuration): Record any window's old
3606 buffer if it's replaced (see Bug#8789). If the new current
3607 buffer doesn't appear in the selected window, go to its old
3608 point (Bug#12208).
3609
35aaa1ea
DA
36102012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
3611
3612 Special MEM_TYPE_SPARE to denote reserved memory.
3613 * alloc.c (enum mem_type): New memory type.
3614 (refill_memory_reserve): Use new type for spare memory.
3615 This prevents live_cons_p and live_string_p from incorrect
3616 detection of uninitialized objects from spare memory as live.
3617
6af64513
PE
36182012-08-26 Paul Eggert <eggert@cs.ucla.edu>
3619
8b2e00a3
PE
3620 Spelling fixes.
3621 * Makefile.in (.PHONY): versioclean -> versionclean.
3622
b52d6985
PE
3623 Remove unused external symbols.
3624 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
3625 * window.c (Qwindow_valid_p, decode_valid_window):
3626 Now static, not extern.
3627 * data.c (Qinterval): Remove; unused.
3628 (syms_of_data): Do not define 'interval'.
3629 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
3630 * window.h (decode_valid_window):
3631 Remove decls.
3632
d5172d4f
PE
3633 * character.c, charset.c, chartab.c: Use bool for booleans.
3634 * character.c (lisp_string_width, string_count_byte8)
3635 (string_escape_byte8):
3636 * charset.c (charset_map_loaded, load_charset_map, read_hex):
3637 (load_charset_map_from_file, map_charset_chars)
3638 (Fdefine_charset_internal, define_charset_internal)
3639 (Fdeclare_equiv_charset, find_charsets_in_text)
3640 (Ffind_charset_region, char_charset, Fiso_charset):
3641 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
3642 (sub_char_table_set, sub_char_table_set_range)
3643 (char_table_set_range, optimize_sub_char_table)
3644 (map_sub_char_table):
3645 Use bool for boolean.
3646 * character.c (str_to_unibyte): Omit last boolean argument; it was
3647 always 0. All callers changed.
3648 * character.h, charset.h: Adjust to match previous changes.
3649 * character.h (char_printable_p): Remove decl of nonexistent function.
3650 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
3651 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
3652 are all boolean, so make them single-bit bitfields.
3653
6af64513
PE
3654 * lisp.h (ASET): Remove attempt to detect side effects.
3655 It was meant to be temporary and it often doesn't work,
3656 because when IDX has side effects the behavior of IDX==IDX
3657 is undefined. See Stefan Monnier in
3658 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
3659
e1f29348
BR
36602012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
3661
3662 * lisp.h (functionp): New function (extracted from Ffunctionp).
3663 (FUNCTIONP): Use it.
3664 * eval.c (Ffunctionp): Use it.
3665
17c05d74
PE
36662012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3667
0f46bc75
PE
3668 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
3669 as that's faster and simpler than static storage. Don't bother
3670 with the g_main_context_query overhead if g_main_context_pending
3671 says no events are pending.
3672 (gfds, gfds_size): Remove these static vars.
3673 (xgselect_initialize): Remove; no longer needed.
3674 All uses and decls removed.
3675
ee4c0f69
PE
3676 * emacs.c (fatal_error_signal_hook): Remove.
3677 All uses removed. This leftover from old code was always 0.
3678
17c05d74
PE
3679 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
3680 * casefiddle.c (casify_object, casify_region):
3681 * casetab.c (set_case_table):
3682 * category.c, category.h (word_boundary_p):
3683 * category.h (CHAR_HAS_CATEGORY):
3684 Use bool for booleans, instead of int.
3685
391ceac5
EZ
36862012-08-25 Eli Zaretskii <eliz@gnu.org>
3687
3688 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
3689
2f221583
PE
36902012-08-25 Paul Eggert <eggert@cs.ucla.edu>
3691
f4a681b0
PE
3692 On assertion failure, print backtrace if available.
3693 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
3694 (die) [ENABLE_CHECKING]: Print a backtrace if available.
3695 * Makefile.in (LIB_EXECINFO): New macro.
3696 (LIBES): Use it.
3697
2f221583
PE
3698 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
3699 * bytecode.c (exec_byte_code):
3700 * callint.c (check_mark, Fcall_interactively):
3701 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
3702 (getenv_internal, sync_process_alive, call_process_exited):
3703 * lisp.h (USE_SAFE_ALLOCA):
3704 Use bool for booleans, instead of int.
3705 * lisp.h, process.h: Adjust prototypes to match above changes.
3706 * callint.c (Fcall_interactively): Don't assume the mark's
3707 offset fits in 'int'.
3708
37ef52bb
PE
37092012-08-24 Paul Eggert <eggert@cs.ucla.edu>
3710
3711 * buffer.c, buffer.h: Use bool for boolean.
3712 * buffer.c (reset_buffer_local_variables)
3713 (buffer_lisp_local_variables, Fset_buffer_modified_p)
3714 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
3715 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
3716 (overlay_touches_p, overlay_strings, Foverlay_put)
3717 (report_overlay_modification, call_overlay_mod_hooks):
3718 (mmap_enlarge, mmap_set_vars):
3719 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
3720 Use bool for booleans, instead of int.
3721 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
3722 since the 1-or-0 return value is always ignored anyway.
3723 (mmap_initialized_p):
3724 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
3725 * buffer.h, lisp.h: Adjust prototypes to match above changes.
3726
2cc21167
PE
37272012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3728
3729 * bidi.c: Use bool for boolean.
3730 This is a bit more readable, and makes the text segment of bidi.o
3731 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
3732 Presumably it's faster too.
3733 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
3734 Now bool.
3735 (bidi_cache_find_level_change, bidi_cache_iterator_state)
3736 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
3737 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
3738 (bidi_explicit_dir_char, bidi_level_of_next_char)
3739 (bidi_find_other_level_edge, bidi_move_to_visually_next):
3740 Use bool for booleans, instead of int.
3741 * dispextern.h (bidi_init_it, bidi_paragraph_init)
3742 (bidi_unshelve_cache): Adjust decls to match code.
3743
7db4ddf4
MR
37442012-08-23 Martin Rudalics <rudalics@gmx.at>
3745
3746 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
3747 argument.
3748
b1bb8011
PE
37492012-08-23 Paul Eggert <eggert@cs.ucla.edu>
3750
3751 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
3752 * atimer.h: Include <stdbool.h>.
3753
ff687885
DN
37542012-08-22 Dan Nicolaescu <dann@gnu.org>
3755
3756 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
3757 compile time tests instead of run time tests on systems that do
3758 not use them.
3759 (FRAME_MAC_P): Remove leftover from deleted code.
3760 * frame.c (syms_of_frame): Remove leftover from deleted code.
3761
4ce7a138
JD
37622012-08-22 Jan Djärv <jan.h.d@swipnet.se>
3763
3764 * nsterm.m (insertText:): Don't clear modifiers if code is space.
3765
d733ec6d
PE
37662012-08-22 Paul Eggert <eggert@cs.ucla.edu>
3767
3768 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
3769 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 3770 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
3771 (fontset_add): Return void, for FONTSET_ADD.
3772
d0d2d26f
PE
37732012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3774
fce31d69
PE
3775 * alloc.c: Use bool for booleans.
3776 (gc_in_progress, abort_on_gc)
3777 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3778 (dont_register_blocks) [GC_MALLOC_CHECK]:
3779 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
3780 (check_string_bytes, make_specified_string, memory_full)
3781 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
3782 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
3783 (mark_stack, valid_pointer_p, make_pure_string)
3784 (Fgarbage_collect, survives_gc_p, gc_sweep):
3785 Use bool for booleans, instead of int.
3786 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
3787 Remove unused local.
3788 * alloc.c (PURE_POINTER_P):
3789 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
3790 * editfns.c (Fformat):
3791 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
3792 (Fdo_auto_save):
3793 * fns.c (sweep_weak_table):
3794 * lisp.h (suppress_checking, push_message, survives_gc_p)
3795 (make_pure_string, gc_in_progress, abort_on_gc):
3796 * lread.c (readchar, read1):
3797 * print.c (Fprin1_to_string):
3798 * xdisp.c (push_message):
3799 Use bool for booleans affected directly or indirectly by
3800 alloc.c's changes.
3801
d0d2d26f
PE
3802 Make recently-introduced setters macros.
3803 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
3804 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
3805 (set_fontset_default, set_fontset_fallback): Rename from their
3806 upper-case counterparts, and make them functions rather than macros.
3807 This is more consistent with the other recently-introduced setters.
3808 These don't need to be inline, since they're local.
3809
d18e2bb6
JD
38102012-08-21 Jan Djärv <jan.h.d@swipnet.se>
3811
3812 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
3813 the loop (Bug#12247).
3814
1b9d9d16
PE
38152012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3816
3817 * lisp.h (vcopy): Use memcpy rather than our own loop.
3818 This fixes a performance regression introduced by the recent
3819 addition of vcopy. This means 'vcopy' will need to be modified
3820 for a copying collector, but that's OK. Also, tighten the
3821 checking in the assertion.
3822
b2f09701
EZ
38232012-08-21 Eli Zaretskii <eliz@gnu.org>
3824
3825 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
3826 components for RTL text (Bug#11860). Adjust X-OFFSET of each
3827 non-base glyph for the width of the base character, according to
e1f29348
BR
3828 what x_draw_composite_glyph_string_foreground expects.
3829 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
3830 expectations, to produce correct width of the composed character.
3831 Reverse the sign of the DU offset produced by ScriptPlace.
3832
9b994fed
PE
38332012-08-21 Paul Eggert <eggert@cs.ucla.edu>
3834
3835 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
3836
086ca913
DA
38372012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3838
3839 Avoid direct writes to contents member of struct Lisp_Vector.
3840 * lisp.h (vcopy): New function to copy data into vector.
3841 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
3842 * fns.c (Ffillarray): Use ASET.
3843 * keyboard.c (timer_check_2): Use AREF and ASET.
3844 (append_tool_bar_item, Frecent_keys): Use vcopy.
3845 * lread.c (read_vector): Use ASET.
3846 * msdos.c (Frecent_doskeys): Use vcopy.
3847 * xface.c (Finternal_copy_lisp_face): Use vcopy.
3848 (Finternal_merge_in_global_face): Use ASET and vcopy.
3849 * xfont.c (xfont_list_pattern): Likewise.
3850
5481664a
MR
38512012-08-21 Martin Rudalics <rudalics@gmx.at>
3852
3853 * window.c (Fwindow_point): For the selected window always return
3854 the position of its buffer's point.
3855 (Fset_window_point): For the selected window always go in its
3856 buffer to the specified position.
3857
6d470bdd
DA
38582012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
3859
3860 Setter macros for fontsets.
3861 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
3862 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
3863 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
3864 Adjust users.
3865
24564fe1
GM
38662012-08-20 Glenn Morris <rgm@gnu.org>
3867
3868 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
3869 Don't assume that `ln -f' works.
3870
0a05a035
EZ
38712012-08-20 Eli Zaretskii <eliz@gnu.org>
3872
3873 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
3874 and later about non-assignments with no effect. See discussion at
3875 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
3876 details.
3877
e46f2325
DA
38782012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3879
3880 Inline setter functions for Lisp_Objects slots of struct specbinding.
3881 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
3882 Adjust users.
3883
734fbd86
MR
38842012-08-20 Martin Rudalics <rudalics@gmx.at>
3885
3886 * window.c (select_window): Always make selected window's buffer
3887 current.
3888
f1a95992
DA
38892012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3890
3891 Use AREF and ASET for docstrings of category tables.
3892 * category.h (CATEGORY_DOCSTRING): Use AREF.
3893 (SET_CATEGORY_DOCSTRING): Use ASET.
3894 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
3895
e83064be
DA
38962012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3897
3898 Inline setter functions for hash table members.
3899 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
3900 (set_hash_hash, set_hash_index): Rename with _slot suffix.
3901 (set_hash_key_and_value, set_hash_index, set_hash_next)
3902 (set_hash_hash): New functions.
3903 * charset.c, fns.c: Adjust users.
3904
4ce60d2e
DA
39052012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
3906
3907 Inline getter and setter functions for per-buffer values.
3908 * buffer.h (per_buffer_default, set_per_buffer_default)
3909 (per_buffer_value, set_per_buffer_value): New functions.
3910 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
3911 * buffer.c, data.c: Adjust users.
3912
c06c9690
JB
39132012-08-20 Juanma Barranquero <lekktu@gmail.com>
3914
3915 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
3916
32bd4250
PE
39172012-08-19 Paul Eggert <eggert@cs.ucla.edu>
3918
bad03192 3919 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
3920 as gnulib does this if the system doesn't.
3921 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
3922 Remove declaration. MS-Windows declares it on stdlib.h which is
3923 included by conf_post.h.
b69a6d22
PE
3924 * emacs.c (environ) [DOUG_LEA_MALLOC]:
3925 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
3926 * vm-limit.c: Include <unistd.h>, for 'environ'.
3927
22d7feb2
PE
3928 * unexaix.c, unexcoff.c: Include "mem-limits.h".
3929 (start_of_data): Remove decl; mem-limits.h provides it.
3930
32bd4250
PE
3931 * xdisp.c (handle_invisible_prop): Make it a bit faster
3932 and avoid a gcc -Wmaybe-uninitialized diagnostic.
3933
450809af
CY
39342012-08-19 Chong Yidong <cyd@gnu.org>
3935
3936 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
3937 ends (Bug#3874).
3938
9e677988
AS
39392012-08-19 Andreas Schwab <schwab@linux-m68k.org>
3940
6b1319ce
AS
3941 * .gdbinit: Use call instead of set when calling a function in the
3942 inferior.
3943
9e677988
AS
3944 * data.c (set_internal): Don't use set_blv_found.
3945 (Fkill_local_variable): Likewise.
3946
d7191076
AA
39472012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
3948
3949 * nsfont.m (ns_ascii_average_width): Ensure the string
3950 ascii_printable is initialized with a null-terminated character
3951 array. Otherwise, it can contain undesired extra characters.
3952
e757f1c6
PE
39532012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3954
3955 port new setting code to Sun C 5.8 2005/10/13
3956 * chartab.c, lisp.h (char_table_set, char_table_set_range):
3957 Return void, not Lisp_Object. Otherwise, the compiler
3958 complains about (A?B:C) where B is void and C is Lisp_Object
3959 when compiling CHAR_TABLE_SET, due to the recent change to
3960 the API of sub_char_table_set_contents.
3961
a999ce26
CY
39622012-08-18 Chong Yidong <cyd@gnu.org>
3963
3964 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
3965 for the string case (Bug#3874).
3966
3f22b86f
PE
39672012-08-18 Paul Eggert <eggert@cs.ucla.edu>
3968
39eb03f1
PE
3969 * buffer.h (BSET): Remove (Bug#12215).
3970 Replace all uses with calls to new setter functions.
3971 (bset_bidi_paragraph_direction, bset_case_canon_table)
3972 (bset_case_eqv_table, bset_directory, bset_display_count)
3973 (bset_display_time, bset_downcase_table)
3974 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
3975 (bset_last_selected_window, bset_local_var_alist)
3976 (bset_mark_active, bset_point_before_scroll, bset_read_only)
3977 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
3978 (bset_width_table):
3979 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
3980 (bset_auto_fill_function, bset_auto_save_file_format)
3981 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
3982 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
3983 (bset_cache_long_line_scans, bset_case_fold_search)
3984 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
3985 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
3986 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
3987 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
3988 (bset_header_line_format, bset_indicate_buffer_boundaries)
3989 (bset_indicate_empty_lines, bset_invisibility_spec)
3990 (bset_left_fringe_width, bset_major_mode, bset_mark)
3991 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
3992 (bset_name, bset_overwrite_mode, bset_pt_marker)
3993 (bset_right_fringe_width, bset_save_length)
3994 (bset_scroll_bar_width, bset_scroll_down_aggressively)
3995 (bset_scroll_up_aggressively, bset_selective_display)
3996 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
3997 (bset_word_wrap, bset_zv_marker):
3998 * category.c (bset_category_table):
3999 * syntax.c (bset_syntax_table):
4000 New setter functions.
4001
6a09a33b
PE
4002 * process.h (PSET): Remove (Bug#12215).
4003 Replace all uses with calls to new setter functions.
4004 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4005 (PROCESS_INLINE): New macro.
4006 (pset_childp): New setter function.
4007 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
4008 * process.c (PROCESS_INLINE):
4009 Define to EXTERN_INLINE, so that the corresponding functions
4010 are compiled into code.
4011 (pset_buffer, pset_command, pset_decode_coding_system)
4012 (pset_decoding_buf, pset_encode_coding_system)
4013 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
4014 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
4015 (pset_type, pset_write_queue): New setter functions.
4016
e8c17b81
PE
4017 * window.h (WSET): Remove (Bug#12215).
4018 Replace all uses with calls to new setter functions.
4019 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4020 (WINDOW_INLINE): New macro.
4021 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
4022 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
4023 (wset_total_lines, wset_vertical_scroll_bar)
4024 (wset_window_end_pos, wset_window_end_valid)
4025 (wset_window_end_vpos): New setter functions.
4026 * window.c (WINDOW_INLINE):
4027 Define to EXTERN_INLINE, so that the corresponding functions
4028 are compiled into code.
4029 (wset_combination_limit, wset_dedicated, wset_display_table)
4030 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
4031 (wset_new_normal, wset_new_total, wset_next_buffers)
4032 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4033 (wset_prev_buffers, wset_right_fringe_width)
4034 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
4035 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
4036 (wset_window_parameters):
4037 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4038 (wset_column_number_displayed, wset_region_showing):
4039 New setter functions.
4040
3f22b86f
PE
4041 * termhooks.h (TSET): Remove (Bug#12215).
4042 Replace all uses with calls to new setter functions.
4043 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4044 (TERMHOOKS_INLINE): New macro.
4045 (tset_charset_list, tset_selection_alist): New setter functions.
4046 * terminal.c (TERMHOOKS_INLINE):
4047 Define to EXTERN_INLINE, so that the corresponding functions
4048 are compiled into code.
4049 (tset_param_alist): New setter function.
4050
742af32f
PE
40512012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4052
15dbb4d6
PE
4053 * keyboard.h (KSET): Remove (Bug#12215).
4054 Replace all uses with calls to new setter functions.
4055 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4056 (KEYBOARD_INLINE): New macro.
4057 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
4058 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
4059 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
4060 New setter functions.
4061 * keyboard.c (KEYBOARD_INLINE):
4062 Define to EXTERN_INLINE, so that the corresponding functions
4063 are compiled into code.
4064 (kset_echo_string, kset_kbd_queue)
4065 (kset_keyboard_translate_table, kset_last_prefix_arg)
4066 (kset_last_repeatable_command, kset_local_function_key_map)
4067 (kset_overriding_terminal_local_map, kset_real_last_command)
4068 (kset_system_key_syms): New setter functions.
4069
f00af5b1
PE
4070 * frame.h (FSET): Remove (Bug#12215).
4071 Replace all uses with calls to new setter functions.
4072 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4073 (FRAME_INLINE): New macro.
4074 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
4075 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
4076 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
4077 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
4078 (fset_param_alist, fset_root_window, fset_scroll_bars)
4079 (fset_selected_window, fset_title, fset_tool_bar_items)
4080 (fset_tool_bar_position, fset_tool_bar_window): New functions.
4081 * frame.c (FRAME_INLINE):
4082 Define to EXTERN_INLINE, so that the corresponding functions
4083 are compiled into code.
4084 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
4085
0c94c8d6
PE
4086 A few more naming-convention fixes for getters and setters.
4087 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
4088 and rename from buffer_overlays_set_before.
4089 (set_buffer_overlays_after): Move here from buffer.h, and rename
4090 from buffer_overlays_set_after.
4091 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
4092 All uses changed.
4093 (set_buffer_intervals): Rename from buffer_set_intervals.
4094 * intervals.c (set_interval_object): Move here from intervals.h,
4095 and rename from interval_set_object.
4096 (set_interval_left): Move here from intervals.h, and rename from
4097 interval_set_left.
4098 (set_interval_right): Move here from intervals.h, and rename from
4099 interval_set_right.
4100 (copy_interval_parent): Move here from intervals.h, and rename from
4101 interval_copy_parent.
4102 * intervals.h (set_interval_parent): Rename from interval_set_parent.
4103 (set_interval_plist): Rename from interval_set_plist.
4104 Return void, not Lisp_Object, since no caller uses the result.
4105 * lisp.h (string_intervals): Rename from string_get_intervals.
4106 (set_string_intervals): Rename from string_set_intervals.
4107
34dabdb7
PE
4108 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
4109 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 4110 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
4111 All uses changed. See the end of
4112 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
4113
742af32f
PE
4114 * lisp.h (CSET): Remove (Bug#12215).
4115 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
4116 (set_char_table_purpose): New functions,
4117 replacing CSET. All uses changed. For example, replace
4118 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 4119 "set_char_table_parent (char_table, parent);".
742af32f
PE
4120 The old version was confusing because it used the same name
4121 'parent' for two different things.
4122
a04e2c62
DA
41232012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4124
4125 Functions to get and set Lisp_Object fields of buffer-local variables.
4126 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
4127 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
4128 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
4129 * data.c, eval.c, frame.c: Adjust users.
4130
383dcbf9
CY
41312012-08-17 Chong Yidong <cyd@gnu.org>
4132
4133 * xfaces.c (merge_face_vectors): If the target font specfies a
4134 font spec, make the font's attributes take precedence over
4135 directly-specified attributes.
4136 (merge_face_ref): Recognize :font.
4137
44386687
DA
41382012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
4139
4140 Do not use memcpy for copying intervals.
4141 * intervals.c (reproduce_interval): New function.
4142 (reproduce_tree, reproduce_tree_obj): Use it.
4143 (reproduce_tree_obj): Remove prototype.
4144
927c7216
PE
41452012-08-17 Paul Eggert <eggert@cs.ucla.edu>
4146
4147 * lisp.h (duration_to_sec_usec): Remove unused decl.
4148
93044f7b
AA
41492012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
4150
4151 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
4152 to an allocated instance of NSString, not to the class itself.
4153
9851e4a5
JB
41542012-08-17 Juanma Barranquero <lekktu@gmail.com>
4155
4156 * makefile.w32-in (C_CTYPE_H): New macro.
4157 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
4158 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
4159 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
4160
620f13b0
PE
41612012-08-16 Paul Eggert <eggert@cs.ucla.edu>
4162
4163 Use ASCII tests for character types.
4164 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
4165 * xfns.c, xterm.c:
4166 Don't include <ctype.h>; was not needed.
4167 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
4168 * sysdep.c, xfaces.c:
4169 Include <c-ctype.h> instead of <ctype.h>.
4170 * nsterm.m: Include <c-ctype.h>.
4171 * charset.c (read_hex):
4172 * doc.c (Fsnarf_documentation):
4173 * fileio.c (IS_DRIVE) [WINDOWSNT]:
4174 (DRIVE_LETTER) [DOS_NT]:
4175 (Ffile_name_directory, Fexpand_file_name)
4176 (Fsubstitute_in_file_name):
4177 * font.c (font_parse_xlfd, font_parse_fcname):
4178 * frame.c (x_set_font_backend):
4179 * gtkutil.c (xg_get_font):
4180 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
4181 * nsimage.m (hexchar):
4182 * nsterm.m (ns_xlfd_to_fontname):
4183 * sysdep.c (system_process_attributes):
4184 * xfaces.c (hash_string_case_insensitive):
4185 Use C-locale tests instead of locale-specific tests for character
4186 types, since we want the ASCII interpretation here, not the
4187 interpretation suitable for whatever happens to be the current locale.
4188
52162052
MR
41892012-08-16 Martin Rudalics <rudalics@gmx.at>
4190
4191 Consistently check windows for validity/liveness
4192 (Bug#11984, Bug#12025, Bug#12026).
4193 * lisp.h (CHECK_VALID_WINDOW): New macro.
4194 * window.c (decode_window): Rename to decode_live_window.
4195 (decode_valid_window, Fwindow_valid_p): New functions.
4196 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
4197 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
4198 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
4199 (Fwindow_prev_sibling, Fwindow_combination_limit)
4200 (Fset_window_combination_limit, Fwindow_use_time)
4201 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
4202 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
4203 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
4204 (Fwindow_hscroll, Fset_window_hscroll)
4205 (Fwindow_redisplay_end_trigger)
4206 (Fset_window_redisplay_end_trigger, Fwindow_edges)
4207 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
4208 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
4209 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
4210 (Fwindow_end, Fset_window_point, Fset_window_start)
4211 (Fpos_visible_in_window_p, Fwindow_line_height)
4212 (Fwindow_dedicated_p, Fset_window_dedicated_p)
4213 (Fwindow_prev_buffers, Fset_window_prev_buffers)
4214 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
4215 (Fset_window_parameter, Fwindow_display_table)
4216 (Fset_window_display_table, Fdelete_other_windows_internal)
4217 (Fset_window_buffer, Fset_window_new_total)
4218 (Fset_window_new_normal, Fdelete_window_internal)
4219 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
4220 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
4221 (Fwindow_scroll_bars): Check whether argument window is a valid or
4222 live window. Update doc-strings.
4223 (syms_of_window): New symbol Qwindow_valid_p.
4224 * keyboard.c (Fposn_at_x_y): Check whether argument
4225 frame_or_window denotes a valid window.
4226
2751c80f
DA
42272012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4228
4229 Fix previous char table change.
4230 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
4231 * chartab.c (optimize_sub_char_table): Likewise.
4232
032a42c8
CY
42332012-08-16 Chong Yidong <cyd@gnu.org>
4234
a2d19368
CY
4235 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
4236
032a42c8
CY
4237 * xfont.c (xfont_open):
4238 * xftfont.c (xftfont_open): Set the font's max_width field.
4239
4240 * nsfont.m (nsfont_open): Similar to the Xft backend, set
4241 min_width to space_width and average_width to the average over
4242 printable ASCII characters.
4243 (ns_char_width): Code cleanup.
4244 (ns_ascii_average_width): New utility function.
4245
4246 * font.h (struct font): Update comments.
4247
a098c930
DA
42482012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
4249
032a42c8 4250 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
4251 * lisp.h (CSET): New macro.
4252 (char_table_set_extras, char_table_set_contents)
4253 (sub_char_table_set_contents): New function.
4254 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
4255 * syntax.c: Adjust users.
4256
8be3a09c
SM
42572012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
4258
4259 * eval.c (eval_sub): Bind lexical-binding.
4260 * lread.c (Qlexical_binding): Make non-static.
4261
ac4845a6
JD
42622012-08-15 Jan Djärv <jan.h.d@swipnet.se>
4263
ddee6515
JD
4264 * nsmenu.m (popupSession): Remove.
4265 (pop_down_menu): Remove endModalSession.
4266 (timeout_handler:): New method.
4267 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
4268 Call runModalForWindow. Check timer_fired when it returns.
4269 If not set, cancel timer and break out of loop.
4270 Otherwise loop again, with a new timeout.
4271
4272 * nsterm.m: Include fcntl.h if present.
4273 (fd_entry, t_readfds, inNsSelect): Remove.
4274 (select_writefds, select_valid, select_timeout, selfds)
4275 (select_mutex, apploopnr): Add.
4276 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
4277 Otherwise call kbd_buffer_store_event.
4278 (ns_send_appdefined): Remove release of fd_entry.
4279 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
4280 Increment and decrement apploopnr.
4281 (ns_select): If no file descriptors, just do a NSTimer.
4282 Otherwise copy read/write masks and start select thread (fd_handler).
4283 Start main loop and wait for application defined event.
4284 Inform select thread to stop selecting after main loop is exited.
4285 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 4286 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
4287 (fd_handler:): Loop forever, wait for info from the main thread
4288 to either start or stop selecting. When select returns, send
4289 and appdefined event.
4290 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
4291 If not call kbd_buffer_store_event.
4292
4293 * nsterm.h (EmacsApp): fd_handler takes id argument.
4294 (EmacsDialogPanel): Add timer_fired and timeout_handler.
4295
ac4845a6
JD
4296 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
4297
eb424fe3
EZ
42982012-08-15 Eli Zaretskii <eliz@gnu.org>
4299
4300 * region-cache.c (move_cache_gap): Update gap_len using the actual
4301 growth of the boundaries array. Do not change cache_len.
4302 (Bug#12196)
4303
4e6a86c6
DA
43042012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4305
4306 Generalize and cleanup font subsystem checks.
4307 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
4308 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
4309 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 4310
5bf192ca
DA
43112012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
4312
4313 * gtkutil.c (xg_get_font): Use pango_units_to_double.
4314
f2045622
CY
43152012-08-15 Chong Yidong <cyd@gnu.org>
4316
8be3a09c
SM
4317 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
4318 When using the new font chooser, use gtk_font_chooser_get_font_desc to
4319 extract the font descriptor instead of just the font name.
4320 In that case, return a font spec instead of a string.
f2045622
CY
4321 (x_last_font_name): Move to this file from xfns.c.
4322
4323 * xfns.c (Fx_select_font): The return value can also be a font
4324 spec. Move x_last_font_name management to gtkutil.c.
4325
4326 * xfaces.c: Make font weight and style symbols non-static.
4327
7f6feb56
SM
43282012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
4329
4330 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
4331 (bug#12117).
4332
fecbd8ff
SM
43332012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
4334
4335 * alloc.c (Fgarbage_collect): Use plural form consistently.
4336
9b8d5165
EZ
43372012-08-14 Eli Zaretskii <eliz@gnu.org>
4338
4339 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
4340 iteration through the command loop. Fixes a problem whereby mouse
4341 movements are ignored until the first mouse click.
4342
f5d9e83a
PE
43432012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4344
4345 Use bool, not int, for Lisp booleans.
4346 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
4347 makes Emacs a bit smaller and presumably a bit faster.
4348 * lisp.h: Include <stdbool.h>.
4349 (struct Lisp_Boolfwd, defvar_bool):
4350 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
4351 * regex.c [!emacs]: Include <stdbool.h>.
4352 (false, true): Remove; <stdbool.h> does this for us now.
4353
55802e4a
CY
43542012-08-14 Chong Yidong <cyd@gnu.org>
4355
4abcdac8
CY
4356 * character.c (Fcharacterp): Doc fix (Bug#12076).
4357
4358 * data.c (Findirect_variable): Doc fix (Bug#11040).
4359
55802e4a
CY
4360 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
4361
4362 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 4363 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 4364
8e99d072
BR
43652012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4366
4367 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
4368 (bug#12022).
4369
08908aca
MR
43702012-08-14 Martin Rudalics <rudalics@gmx.at>
4371
4372 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
4373 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
4374 * minibuf.c (choose_minibuf_frame, read_minibuf):
4375 * w32fns.c (x_create_tip_frame):
4376 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
4377 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
4378
56120d6f
PE
43792012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4380
4381 * intervals.c (offset_intervals): Remove obsolete comment.
4382
67b77c0b
AS
43832012-08-14 Andreas Schwab <schwab@linux-m68k.org>
4384
4385 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
4386
f48b82fd
GR
43872012-08-14 Gergely Risko <gergely@risko.hu>
4388
4389 * coding.c (decode_coding): Record buffer modification before
4390 disabling undo_list (Bug#11773).
4391
fd318b54
DA
43922012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4393
4394 Revert and cleanup some recent overlay changes.
4395 * buffer.h (enum overlay_type): Remove.
4396 (buffer_get_overlays, buffer_set_overlays): Likewise.
4397 (buffer_set_overlays_before, buffer_set_overlays_after):
4398 New function. Adjust users.
4399 (unchain_both): Add eassert.
4400
41a62dd9
DA
44012012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
4402
4403 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
4404
5884c324
PE
44052012-08-14 Paul Eggert <eggert@cs.ucla.edu>
4406
4407 * gtkutil.c (xg_mark_data): Don't assume C99.
4408
ca06f160
JD
44092012-08-13 Jan Djärv <jan.h.d@swipnet.se>
4410
4411 * gtkutil.c (xg_frame_tb_info): New struct.
4412 (TB_INFO_KEY): New define.
4413 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
4414 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
4415 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
4416 if not present.
4417 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 4418 is up to date. Otherwise store new data.
ca06f160
JD
4419 (free_frame_tool_bar): Free xg_frame_tb_info if present.
4420
7864a3f7
DA
44212012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4422
4423 Use KSET for write access to Lisp_Object members of struct kboard.
4424 * keyboard.h (KSET): New macro.
4425 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
4426 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
4427 * xterm.c: Adjust users.
4428
4c31be61
DA
44292012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
4430
4431 Use BSET for write access to Lisp_Object members of struct buffer.
4432 * buffer.h (BSET): New macro.
4433 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
4434 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
4435 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
4436 * window.c, xdisp.c, xfns.c: Adjust users.
4437
14ae4239
BT
44382012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
4439
4440 * lread.c (syms_of_lread): Initialize Vlexical_binding.
4441
32bcadb4
JD
44422012-08-11 Jan Djärv <jan.h.d@swipnet.se>
4443
3d29b2ce 4444 * nsterm.m (not_in_argv): New function.
fc0c31f8 4445 (application:openFile, application:openTempFile:):
3d29b2ce
JD
4446 (application:openFileWithoutUI:, application:openFiles:): Open file
4447 if not_in_argv returns non-zero (bug#12171).
4448
32bcadb4 4449 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
4450 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
4451 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
4452 (xg_get_font_name): Use those functions/macros here.
4453 Reported by Frans Oilinki <moilinki@gmail.com>.
4454
9ff9402d 44552012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
4456
4457 * unexmacosx.c (copy_data_segment): Copy initialized data in
4458 statically linked libraries from input file rather than memory.
4459
db74a5fc
YM
4460 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
4461 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
4462 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
4463
25e65510
GM
44642012-08-10 Glenn Morris <rgm@gnu.org>
4465
4466 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
4467 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
4468
7961135c
DA
44692012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4470
4471 Fix last change to allow compilation with low optimization levels.
4472 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
4473 Reported by Jan Djärv <jan.h.d@swipnet.se>.
4474
42b3a444
DA
44752012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4476
4477 Use common inline syntax in intervals.h.
4478 * intervals.h (INTERVALS_INLINE): New macro.
4479 Change all users from LISP_INLINE.
4480
9fb0c957
DA
44812012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4482
4483 Define Qnone once for all platforms.
4484 * frame.c (Qnone): Define here.
4485 (syms_of_frame): DEFSYM it.
4486 * lisp.h (Qnone): New declaration.
4487 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
4488 * xfns.c: Remove duplication. Adjust users.
4489
65e8ee52
DA
44902012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
4491
4492 Remove unused macros from intervals.h.
4493 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
4494 * intervals.c: Adjust comment.
4495
9b855fd6
EZ
44962012-08-10 Eli Zaretskii <eliz@gnu.org>
4497
4498 * w32fns.c <w32_unicode_gui>: New static variable.
4499 (globals_of_w32fns): Initialize it according to os_subtype.
4500 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
4501 testing os_subtype.
4502
39cb9e56 45032012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
4504 Eli Zaretskii <eliz@gnu.org>
4505
4506 Fix bug #10299 with Unicode characters sent by customized
4507 keyboards created by MSKLC.
4508 * w32fns.c (INIT_WINDOW_CLASS): New macro.
4509 (w32_init_class): Use it to initialize the Emacs class with either
4510 ANSI or Unicode API calls.
4511 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
4512 later.
4513 (w32_wnd_proc): If the character code sent by WM_CHAR or
4514 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
4515 original message. Call DefWindowProcW on NT and later.
4516
9374581a
GM
45172012-08-10 Glenn Morris <rgm@gnu.org>
4518
4b94e8cf
GM
4519 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
4520
9374581a
GM
4521 * lisp.h (DIRECTORY_SEP): Let configure set it.
4522
a2752828
DA
45232012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
4524
4525 Use TSET for write access to Lisp_Object slots of struct terminal.
4526 * termhooks.h (TSET): New macro.
4527 * coding.c, terminal.c, xselect.c: Adjust users.
4528
cc92c454
SM
45292012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
4530
4531 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
4532 the failing expression, include them in the error message.
4533 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
4534 * lisp.h (internal_condition_case_n): Update declaration.
4535
4cb3e6b3
DA
45362012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4537
4538 Inline functions to examine and change buffer overlays.
4539 * buffer.c (unchain_both): New function.
4540 * buffer.h (buffer_get_overlays, buffer_set_overlays):
4541 (buffer_has_overlays): New function.
4542 (enum overlay_type): New enum.
4543 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
4544 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
4545
8707c1e5
DA
45462012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4547
4548 Inline functions to examine and change buffer intervals.
4549 * alloc.c (mark_interval_tree): Remove.
4550 (MARK_INTERVAL_TREE): Simplify.
4551 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
4552 * intervals.c (buffer_balance_intervals): New function.
4553 (graft_intervals_into_buffer): Adjust indentation.
4554 (set_intervals_multibyte): Simplify.
4555 * buffer.h (BUF_INTERVALS): Remove.
4556 (buffer_get_intervals, buffer_set_intervals): New function.
4557 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
4558 * intervals.c, textprop.c: Adjust users.
4559
ad8c997f
DA
45602012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4561
4562 Inline functions to examine and change string intervals.
4563 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
4564 (string_get_intervals, string_set_intervals): New function.
4565 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4566 * lread.c, print.c, textprop.c: Adjust users.
4567
32ac3a6b
GM
45682012-08-08 Glenn Morris <rgm@gnu.org>
4569
4570 * lisp.mk (lisp): Remove language/persian.elc.
4571
77c7bcb1
DA
45722012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4573
4574 Cleanup intervals.
4575 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
4576 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
4577 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
4578 Adjust comment. Move under #if 0.
77c7bcb1
DA
4579 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
4580 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
4581
9c08a8d4
DA
45822012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
4583
4584 Check total length of intervals with eassert.
4585 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
4586 * intervals.c: Change all users to eassert.
4587
26d16b35
EZ
45882012-08-07 Eli Zaretskii <eliz@gnu.org>
4589
14ae4239
BT
4590 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
4591 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
4592 INTERNAL_FIELD in Lisp_Cons.
4593
c644523b
DA
45942012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4595
4596 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
4597 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
4598 name since all xname users are fixed long time ago. Do not
4599 use INTERNAL_FIELD.
4600 (set_symbol_name, set_symbol_function, set_symbol_plist):
4601 (set_symbol_next, set_overlay_plist): New function.
4602 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
4603 (struct Lisp_Overlay): Likewise.
4604 (CVAR, MVAR, SVAR): Remove.
4605 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
4606 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
4607 * xterm.c: Adjust users.
4608 * .gdbinit: Change to use name field of struct Lisp_Symbol
4609 where appropriate.
4610
6a3d20cc
DA
46112012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4612
4613 Basic functions to set Lisp_Object and pointer slots of intervals.
4614 * intervals.h (interval_set_parent, interval_set_object):
4615 (interval_set_left, interval_set_right, interval_set_plist):
4616 (interval_copy_parent): New function.
4617 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
4618 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
4619 Adjust indentation.
6a3d20cc
DA
4620 (INTERVAL_SIZE): Remove. Adjust users.
4621 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
4622
4d2b044c
DA
46232012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4624
4625 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
4626 * process.h (PGET): Remove.
4627 (struct Lisp_Process): Do not use INTERNAL_FIELD.
4628 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4629
d3d50620
DA
46302012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4631
4632 Drop WGET and revert read access to Lisp_Objects slots of struct window.
4633 * window.h (WGET): Remove.
4634 (struct window): Do not use INTERNAL_FIELD.
4635 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4636 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4637 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4638 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4639 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4640 Adjust users.
4641
d10a51dc
CY
46422012-08-07 Chong Yidong <cyd@gnu.org>
4643
4644 * window.c (Fwindow_edges, Fwindow_pixel_edges)
4645 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
4646 (Fdelete_window_internal): Signal an error if the window is not on
4647 a live frame (Bug#12025).
4648
e69b0960
DA
46492012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
4650
4651 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
4652 * frame.h (FGET): Remove.
4653 (struct frame): Do not use INTERNAL_FIELD.
4654 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4655 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4656 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4657 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4658
25a20a3a
JB
46592012-08-06 Juanma Barranquero <lekktu@gmail.com>
4660
4661 * w32.c: Silence compiler warnings.
4662 (map_w32_filename): Remove unused variable `is_fat'.
4663 (chase_symlinks): Add parentheses around expression.
4664
1c6f11f4
GM
46652012-08-06 Glenn Morris <rgm@gnu.org>
4666
1db4583a
GM
4667 * sysdep.c: Respect BROKEN_GETWD.
4668
1c6f11f4
GM
4669 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
4670 Let configure handle it.
4671 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
4672
2b90362b
DA
46732012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4674
4675 Use GCALIGNMENT where appropriate.
4676 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
4677 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
4678 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
4679
5f50daf2
EZ
46802012-08-06 Eli Zaretskii <eliz@gnu.org>
4681
14ae4239
BT
4682 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
4683 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 4684
cbcc7007
SM
46852012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
4686
4687 * buffer.h (struct buffer): Revert `indirections' to a simple int;
4688 that should be sufficient for everyone.
4689
4d365fa4
JD
46902012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4691
4692 * keyboard.c (timer_check_2): Add break so timer_check returns next
4693 timeout.
4694
dd86bd82
DA
46952012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4696
4697 Fix Windows build errors introduced after converting to WGET and WSET.
4698 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
4699 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4700
054e1668
JD
47012012-08-06 Jan Djärv <jan.h.d@swipnet.se>
4702
4703 * nsterm.m (ns_frame_rehighlight): Use FSET.
4704
4705 * nsmenu.m (ns_update_menubar): Use FSET.
4706
21238f11
DA
47072012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4708
4709 Separate read and write access to Lisp_Object slots of Lisp_Process.
4710 * process.h (PGET, PSET): New macros similar to AREF and ASET.
4711 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
4712
077288cf
DA
47132012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4714
4715 Separate read and write access to Lisp_Object slots of struct window.
4716 * window.h (WGET, WSET): New macros similar to AREF and ASET.
4717 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
4718 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
4719 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
4720 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
4721 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
4722 Adjust users.
4723
71688bd7
DA
47242012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4725
4726 Fix Windows build errors introduced after converting to FGET and FSET.
4727 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
4728 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
4729 (w32_judge_scroll_bars): Change to use FSET.
4730 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
4731
f99bac93
DA
47322012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4733
4734 Fix replacement typo.
4735 * window.c (replace_window): Set root_window instead of
4736 selected_window. This fixes a total window subsystem
4737 malfunction reported by Bastien Guerry <bzg@gnu.org>.
4738
8c2a0f2d
GM
47392012-08-06 Glenn Morris <rgm@gnu.org>
4740
4741 * lisp.mk (lisp): Add language/persian.elc.
4742
edd74c35
DA
47432012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
4744
4745 Separate read and write access to Lisp_Object slots of struct frame.
4746 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
4747 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
4748 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
4749 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
4750 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
4751
8671676c
AS
47522012-08-05 Andreas Schwab <schwab@linux-m68k.org>
4753
4754 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
4755
663e2b3f
DA
47562012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
4757
4758 Generalize common compile-time constants.
4759 * lisp.h (header_size, bool_header_size, word_size): Now here.
4760 (struct Lisp_Vector): Add comment.
4761 (struct Lisp_Bool_Vector): Move up to define handy constants.
4762 (VECSIZE, PSEUDOVECSIZE): Simplify.
4763 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
4764 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
4765 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
4766 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
4767 * xfont.c, xmenu.c: Use word_size where appropriate.
4768
d32e47af
LM
47692012-08-05 Lawrence Mitchell <wence@gmx.li>
4770
4771 * search.c (Freplace_match): Treat \? in the replacement text
4772 literally (Bug#8161).
4773
e5d9c0d1
CY
47742012-08-05 Chong Yidong <cyd@gnu.org>
4775
4776 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
4777 * frame.c (Vdelete_frame_functions):
4778 * emacs.c (Vkill_emacs_hook): Doc fix.
4779
8da0576b
EZ
47802012-08-04 Eli Zaretskii <eliz@gnu.org>
4781
4782 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
4783 --with-x-toolkit=no builds.
4784 Reported by Carsten Mattner <carstenmattner@gmail.com>.
4785
02676e5d
CY
47862012-08-04 Chong Yidong <cyd@gnu.org>
4787
4788 * syntax.c (Fmodify_syntax_entry): Doc fix.
4789
97147da9
EZ
47902012-08-04 Eli Zaretskii <eliz@gnu.org>
4791
76151e2c
EZ
4792 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
4793 * w32.c (init_environment): Change the default values of many
4794 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
4795 them into environment when they were not already defined.
4796 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 4797 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
4798 (check_windows_init_file): Now external, not static.
4799 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
4800 called when Vload_path is already set up.
4801
4802 * w32.h (check_windows_init_file): Add prototype.
4803
4804 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
4805 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
4806 compatibility with Posix platforms.
4807 (main): Move the call to check_windows_init_file to here from
4808 w32.c.
4809 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
4810 any, in the DEFALT argument into the root of the Emacs build or
4811 installation tree, as appropriate.
4812
4813 * callproc.c (init_callproc_1): Call decode_env_path instead of
4814 doing its equivalent by hand.
4815 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
4816 the code that sets Vexec_path run on MS-Windows.
4817
4818 * lread.c (init_lread): Add comments to #ifdef's.
4819
97147da9
EZ
4820 * msdos.c (dos_set_window_size, IT_update_begin)
4821 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
4822 instead of direct references.
4823
185ee146
PE
48242012-08-04 Paul Eggert <eggert@cs.ucla.edu>
4825
4826 Export DEFAULT_REHASH_* to GDB.
4827 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
4828 Now constants, not macros.
4829
8834c57a
PE
48302012-08-03 Paul Eggert <eggert@cs.ucla.edu>
4831
98c6f1e3
PE
4832 Remove unnecessary casts involving pointers.
4833 These casts are no longer needed now that we assume C89 or later,
4834 since they involve casting to or from void *.
4835 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
4836 (make_pure_float, make_pure_vector):
4837 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
4838 * macros.c (Fstart_kbd_macro):
4839 * menu.c (find_and_return_menu_selection):
4840 * minibuf.c (read_minibuf_noninteractive):
4841 * sysdep.c (closedir):
4842 * xdisp.c (x_produce_glyphs):
4843 * xfaces.c (compare_fonts_by_sort_order):
4844 * xfns.c (x_real_positions, select_visual):
4845 * xselect.c (x_stop_queuing_selection_requests)
4846 (x_get_window_property, x_get_window_property_as_lisp_data):
4847 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
4848 Remove unnecessary pointer casts.
4849 * alloc.c (record_xmalloc): New function.
4850 * lisp.h (record_xmalloc): New decl.
4851 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
4852 more like a function. This is because the pointer cast is not
4853 needed. All uses changed.
4854 * print.c (print_string, print_error_message): Avoid length recalc.
4855
8834c57a
PE
4856 Improve fix for macroexp crash with debugging (Bug#12118).
4857 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
4858 ARRAY_MARK_FLAG when checking subscripts, because ASET is
4859 not supposed to be invoked from the garbage collector.
4860 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
4861 (gc_aset): New function, which is like ASET but can be
4862 used in the garbage collector.
4863 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4864 (set_hash_index): Use it instead of ASET.
4865
6dad7178
EZ
48662012-08-03 Eli Zaretskii <eliz@gnu.org>
4867
4868 Support symlinks on latest versions of MS-Windows.
4869 * w32.c: Include winioctl.h and aclapi.h.
4870 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
4871 (revert_to_self): Forward declarations of static functions.
4872 <static BOOL g_b_init_get_security_info>:
4873 <g_b_init_create_symbolic_link>: New static flags.
4874 (globals_of_w32): Initialize them to zero.
4875 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
4876 (map_w32_filename): Improve commentary. Simplify switch.
4877 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
4878 headers (most versions of MinGW w32api don't).
4879 (get_security_info, create_symbolic_link)
4880 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
4881 New functions.
4882 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
4883 in the argument file name.
4884 (sys_access): Call unc_volume_file_attributes only if
4885 GetFileAttributes fails with network-related error codes.
4886 (sys_rename): Diagnose renaming of a symlink when the user doesn't
4887 have the required privileges.
14ae4239 4888 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
4889 get_file_security_desc.
4890 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
4891 with addition of handling of symlinks and support for 'lstat'.
4892 If possible, get file's attributes and security information by
6dad7178
EZ
4893 handle, not by name. Produce S_IFLNK bit for symlinks, when
4894 called from 'lstat'.
4895 (stat, lstat): New functions, call 'stat_worker'.
4896 (symlink, readlink, careadlinkat): Rewritten to create and resolve
4897 symlinks when the underlying filesystem supports them.
4898
f162bcc3
PE
48992012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4900
79ea6c20
PE
4901 Fix macroexp crash on Windows with debugging (Bug#12118).
4902 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
4903 checking subscripts; problem introduced with the recent
4904 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
4905 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
4906 since it's used in non-static inline functions now.
4907
c0ce93fd
PE
4908 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
4909 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 4910
f162bcc3
PE
4911 Use C99-style 'extern inline' if available.
4912 * buffer.h (BUFFER_INLINE):
4913 * category.h (CATEGORY_INLINE):
4914 * character.h (CHARACTER_INLINE):
4915 * charset.h (CHARSET_INLINE):
4916 * composite.h (COMPOSITE_INLINE):
4917 * dispextern.h (DISPEXTERN_INLINE):
4918 * lisp.h (LISP_INLINE):
4919 * systime.h (SYSTIME_INLINE):
4920 New macro, replacing 'static inline' in this header.
4921 * buffer.h, category.h, character.h, charset.h, composite.h:
4922 * dispextern.h, lisp.h, systime.h:
4923 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
4924 * alloc.c (LISP_INLINE):
4925 * buffer.c (BUFFER_INLINE):
4926 * category.c (CATEGORY_INLINE):
4927 * character.c (CHARACTER_INLINE):
4928 * charset.c (CHARSET_INLINE):
4929 * composite.c (COMPOSITE_INLINE):
4930 * dispnew.c (DISPEXTERN_INLINE):
4931 * sysdep.c (SYSTIME_INLINE):
4932 Define to EXTERN_INLINE, so that the corresponding functions
4933 are compiled into code.
4934 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
4935 (INLINE_HEADER_END): New macros.
4936 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
4937 since it's used in non-static inline functions now.
a8333d03 4938 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 4939
837b365b
GM
49402012-08-02 Glenn Morris <rgm@gnu.org>
4941
d66b744d
GM
4942 * s/: Remove empty directory.
4943
837b365b
GM
4944 * s/ms-w32.h: Move to ../nt/inc.
4945 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
4946 Update for new ms-w32.h location.
4947
13294f95
PE
49482012-08-02 Paul Eggert <eggert@cs.ucla.edu>
4949
4950 Port to Solaris 8.
4951 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
4952
90df0db3
GM
49532012-08-02 Glenn Morris <rgm@gnu.org>
4954
4955 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
4956 hard-coding the path separator.
4957
4939150c
PE
49582012-08-01 Paul Eggert <eggert@cs.ucla.edu>
4959
4960 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
4961 This how ASET and AREF are supposed to work, and makes
4962 it easier to think about future improvements. See
4963 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
4964 * charset.h (set_charset_attr): New function.
4965 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
4966 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
4967 (aref_addr): New function. All uses of &AREF(...) changed.
4968 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
4969 (set_hash_index): New functions. All lvalue-style uses of
4970 HASH_KEY etc. changed.
4971 * keyboard.c (set_prop): New function. All lvalue-style uses
4972 of PROP changed.
4973
947b2afd
AA
49742012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
4975
4976 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
4977 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 4978 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
4979 * nsfns.m (ns_set_name_as_filename): Likewise.
4980 * nsmenu.m (ns_update_menubar): Likewise.
4981 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
4982
4f5d0325
EZ
49832012-08-01 Eli Zaretskii <eliz@gnu.org>
4984
2008beae
EZ
4985 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
4986 Adapt to latest changes in field names of the corresponding Lisp
288479f6 4987 objects.
2008beae 4988
4f5d0325
EZ
4989 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
4990
fe3cc771
GM
49912012-08-01 Glenn Morris <rgm@gnu.org>
4992
4993 * s/msdos.h: Remove file.
4994 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
4995 * Makefile.in (S_FILE): Remove.
4996 (config_h): Remove S_FILE.
4997
c90acc54
JB
49982012-08-01 Juanma Barranquero <lekktu@gmail.com>
4999
5000 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
5001 Remove; moved to nt/config.nt.
5002
d8a05828
DA
50032012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5004
5005 Use INTERNAL_FIELD for conses and overlays.
5006 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
5007 Remove obsolete comment.
5008 (MVAR): New macro.
5009 (struct Lisp_Overlay): Use INTERNAL_FIELD.
5010 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
5011
8271d590
DA
50122012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5013
5014 Use INTERNAL_FIELD for symbols.
5015 * lisp.h (SVAR): New macro. Adjust users.
5016 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
5017 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
5018
3193acd2
DA
50192012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5020
5021 Use INTERNAL_FIELD for processes.
5022 * process.h (PVAR): New macro. Adjust style.
5023 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
5024 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
5025
3a45383a
DA
50262012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
5027
5028 Use INTERNAL_FIELD for windows.
5029 * window.h (WVAR): New macro.
5030 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
5031 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
5032 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
5033 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
5034 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
5035 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5036
c1dbc63c
PE
50372012-08-01 Paul Eggert <eggert@cs.ucla.edu>
5038
5039 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
5040
5c0c0e8a
GM
50412012-08-01 Glenn Morris <rgm@gnu.org>
5042
5043 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
5044 Move to configure.ac.
5045
552a99b4
JB
50462012-08-01 Juanma Barranquero <lekktu@gmail.com>
5047
5048 * makefile.w32-in (CONFIG_H): Update dependencies.
5049 (CONF_POST_H): New macro.
5050
5051 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
5052
8d8e2dfe
GM
50532012-07-31 Glenn Morris <rgm@gnu.org>
5054
bc96620a
GM
5055 * Makefile.in (S_FILE): No longer set by configure.
5056
476b1b2d
GM
5057 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
5058 is available.
5059 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
5060
b2c7a106
GM
5061 * process.h (NULL_DEVICE):
5062 * emacs.c (SEPCHAR):
5063 * editfns.c (USER_FULL_NAME): Let configure set them.
5064
d53d062a
GM
5065 * s/README, s/template.h: Remove files.
5066
4515017f
GM
5067 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
5068
8d8e2dfe
GM
5069 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
5070 Move to configure.ac.
5071
5b20b3cc
EZ
50722012-07-31 Eli Zaretskii <eliz@gnu.org>
5073
1e0afd9a
EZ
5074 * .gdbinit (xframe): Adapt to introduction of FVAR and the
5075 resulting renaming of 'struct frame' members.
5076
5b20b3cc
EZ
5077 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
5078
5079 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
5080 after introduction of FVAR.
5081
f1310128
JD
50822012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5083
79e721e0
JD
5084 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
5085
5086 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
5087 instead of compositeToPoint.
5088 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
5089
8d7c7eed 5090 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 5091
e34f7f79
DA
50922012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5093
5094 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
5095 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 5096 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
5097 (BVAR): Change to use INTERNAL_FIELD.
5098 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
5099 (KVAR): Change to use INTERNAL_FIELD.
5100 * frame.h (FVAR): New macro.
5101 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
5102 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
5103 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
5104 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
5105 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
5106
c09bfb2f
DA
51072012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
5108
5109 Miscellaneous fixes for non-default X toolkits.
5110 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
5111 * xterm.c (x_frame_of_widget): Remove redundant prototype.
5112 Move under #ifdef USE_LUCID.
5113 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
5114 definition and usage to avoid warnings.
5115
14c114ae
JD
51162012-07-31 Jan Djärv <jan.h.d@swipnet.se>
5117
5118 * nsterm.m (openFiles): Fix previous checkin.
5119
3bd21e82
PE
51202012-07-31 Paul Eggert <eggert@cs.ucla.edu>
5121
5122 * indent.c (compute_motion): Remove unused local.
5123
c1529ded
GM
51242012-07-31 Glenn Morris <rgm@gnu.org>
5125
400d5621
GM
5126 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
5127
268e2432
GM
5128 * conf_post.h [USG5_4]:
5129 Move remaining contents of s/usg5-4-common.h here.
5130 * s/usg5-4-common.h: Remove file.
5131
7552f3ee
GM
5132 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
5133 * s/irix6-5.h: Remove file.
5134
6a381852
GM
5135 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
5136 * s/darwin.h: Remove file.
5137
c1529ded
GM
5138 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
5139 * s/hpux10-20.h: Remove file, which is now empty.
5140
b429a4ee
GM
51412012-07-30 Glenn Morris <rgm@gnu.org>
5142
5143 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
5144 * Makefile.in (config_h): Add conf_post.h.
5145 * makefile.w32-in (CONFIG_H): Add conf_post.h.
5146
adff3182
JD
51472012-07-30 Jan Djärv <jan.h.d@swipnet.se>
5148
5149 * nsterm.m (ns_do_open_file): New variable.
b9031d69 5150 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
5151 (openFile, openTempFile, openFileWithoutUI, openFiles):
5152 Open files only if ns_do_open_file.
adff3182 5153
c32af1e4
PE
51542012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5155
7393bcbb
PE
5156 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
5157 This no-op macro hasn't been needed for many years.
5158 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
5159
c32af1e4
PE
5160 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
5161 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
5162 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
5163 gdb_make_enums_visible.
5164 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
5165 (DIRECTORY_SEP): Now a constant, not a macro.
5166
302fc036
EZ
51672012-07-30 Eli Zaretskii <eliz@gnu.org>
5168
5169 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
5170 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
5171
5172 * w32term.c <w32_keyboard_codepage>: Renamed from
5173 keyboard_codepage and now external. All users changed.
5174
5175 * w32term.h: Add declaration of w32_keyboard_codepage.
5176
5177 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
5178 the codepage to translate keys to Unicode. If this argument is
5179 -1, use the value returned by GetConsoleCP. All callers changed.
5180
88fb40b4
PE
51812012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5182
0aee6912
PE
5183 Update .PHONY listings in makefiles.
5184 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
5185 bootstrap-clean, distclean, maintainer-clean, versioclean,
5186 extraclean, frc.
5187
88fb40b4
PE
5188 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
5189 This is a bit clearer. Fix some commentary typos.
5190
0a763bd1
GM
51912012-07-30 Glenn Morris <rgm@gnu.org>
5192
32bac6d6
GM
5193 * s/netbsd.h: Let configure include signal.h if needed.
5194 Remove file, which is now empty.
5195
b65e7c46
GM
5196 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
5197 Let configure set them.
5198 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
5199 No more need to undefine.
0a763bd1 5200
169304bd
AS
52012012-07-30 Andreas Schwab <schwab@linux-m68k.org>
5202
5203 * keymap.c (Fkey_description): Don't remove 0x80 bit from
5204 non-single-byte char when adding meta modifier. (Bug#12090)
5205
6cd7a139
DA
52062012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5207
5208 Convert safe_call to use variable number of arguments.
5209 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
5210 (safe_call2): Fix comment.
5211 * lisp.h (safe_call): Adjust prototype.
5212 * coding.c (encode_coding_object): Change to use safe_call2.
5213 * xfaces.c (merge_face_heights): Change to use safe_call1.
5214
d34d6ffc
GM
52152012-07-30 Glenn Morris <rgm@gnu.org>
5216
7b8a48e4 5217 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 5218 does that unconditionally. Remove file, which is now empty.
7b8a48e4 5219
d34d6ffc
GM
5220 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
5221 Remove empty files.
5222
03a660a6
PE
52232012-07-30 Paul Eggert <eggert@cs.ucla.edu>
5224
5225 Export to GDB most of lisp.h's remaining object-like macros.
5226 * lisp.h (min, max): Move earlier, because they're used earlier now.
5227 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
5228 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
5229 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
5230 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
5231 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
5232 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
5233 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
5234 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
5235 Now constants, for GDB. They need not be macros.
5236 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
5237 Now constants, for GDB, as well as macros, for static initializers.
5238 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
5239 Move to after the definition of struct Lisp_Char_Table,
5240 since the former now needs that type defined.
5241 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
5242 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
5243 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
5244 New enums, for gdb_make_enums_visible.
5245 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 5246 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
5247 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
5248 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
5249 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
5250 enum maxargs, enum MAX_ALLOCA.
5251 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
5252 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
5253 no longer needed, now that they are done in lisp.h.
5254
e499d0ee
DA
52552012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
5256
5257 Cleanup string bytes checking.
5258 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
5259 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
5260 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
5261 (check_sblock, compact_small_strings): Simplify.
5262
d5040d2d
PE
52632012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5264
5265 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
5266 These macros are confusing and no longer need to be defined, as
5267 the enum values now suffice. All uses replaced with definiens.
5268 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
5269
7f259ae6
JB
52702012-07-29 Juanma Barranquero <lekktu@gmail.com>
5271
5272 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
5273 ($(BLD)/w32console.$(O)): Update dependencies.
5274
7e63e0c3
DA
52752012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5276
5277 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
5278 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
5279 time. Adjust users.
5280 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
5281
ffd817eb
JD
52822012-07-29 Jan Djärv <jan.h.d@swipnet.se>
5283
5284 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
5285 setting sitelisp (Bug#12010).
5286
417a7a0e
EZ
52872012-07-29 Eli Zaretskii <eliz@gnu.org>
5288
14ae4239 5289 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
5290
5291 * w32heap.c (cache_system_info):
5292 * w32.c (sys_rename):
5293 * w32proc.c (find_child_console, sys_kill): All users changed.
5294
387d4d92
PE
52952012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5296
5297 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
5298
55a6cca6
EZ
52992012-07-29 Eli Zaretskii <eliz@gnu.org>
5300
5301 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
5302
dbcf001c
DA
53032012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5304
5305 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
5306 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
5307 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 5308
e2688e4a
DA
53092012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
5310
5311 Generalize marker debugging code under MARKER_DEBUG and use eassert.
5312 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
5313 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
5314 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
5315 (replace_range, replace_range_2, del_range_2): Change to eassert.
5316 * marker.c (byte_char_debug_check): Adjust style.
5317
b46a6a83
PE
53182012-07-29 Paul Eggert <eggert@cs.ucla.edu>
5319
5320 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
5321 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
5322 long-ago-commented-out code that talks about "WIN32".
5323 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
5324 All uses changed.
5325
e32a5799
PE
53262012-07-28 Paul Eggert <eggert@cs.ucla.edu>
5327
5328 Use Gnulib stdalign module (Bug#9772, Bug#9960).
5329 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
5330 Simplify by using alignof.
5331 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
5332 * lisp.h: Include <stdalign.h>.
5333 (GCALIGNMENT): New macro and constant.
5334 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
5335 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
5336 (stdalign): New macro, if not already defined.
5337
df81cd29
EZ
53382012-07-28 Eli Zaretskii <eliz@gnu.org>
5339
01bd1b0d
EZ
5340 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
5341 * w32inevt.c: Include w32inevt.h.
5342 (w32_read_console_input): New inline function, calls either
5343 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
5344 w32_console_unicode_input.
5345 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
5346 (w32_kbd_patch_key, key_event): Use the codepage returned by
5347 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
5348 (key_event): use uChar.UnicodeChar only if
5349 w32_console_unicode_input is non-zero.
5350
5351 * w32console.c: Include w32heap.h.
5352 <w32_console_unicode_input>: New global variable.
5353 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
5354 family of Windows, zero otherwise.
5355
5356 * w32inevt.h: Declare w32_console_unicode_input.
5357
df81cd29
EZ
5358 * xdisp.c (init_iterator): Don't reference tip_frame in a build
5359 --without-x. (Bug#11742)
5360
c20fdd9e
PE
53612012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5362
5363 Adjust GDB to reflect pvec_type changes (Bug#12036).
5364 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
5365 2012-07-04 changes to pseudovector representation.
5366 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 5367
32770973 53682012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
5369
5370 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
5371 bus address.
5372 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
5373
3438fe21
EZ
53742012-07-27 Eli Zaretskii <eliz@gnu.org>
5375
bcfbc9de
EZ
5376 * alloc.c (listn): Fix the order the arguments are consed onto the
5377 list.
5378
3438fe21
EZ
5379 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
5380 enumeration constants, as PURE and HEAP are too general, and clash
5381 with other headers and sources, such as gmalloc.c and the
5382 MS-Windows system headers. All users changed.
5383
eeaea515
DA
53842012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5385
5386 Revert last save_excursion_save and save_excursion_restore changes.
5387 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
5388 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
5389
073c88c2
DA
53902012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5391
5392 Fix recently-introduced typos in Windows port.
5393 Reported by Martin Rudalics <rudalics@gmx.at>.
5394 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 5395 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 5396
4706125e
PE
53972012-07-27 Paul Eggert <eggert@cs.ucla.edu>
5398
5399 Improve GDB symbol export (Bug#12036).
5400 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
5401 arms of an 'if', not using conditional expressions; otherwise GDB
5402 complains about the types in the unevaluated arm when the argument
5403 is an integer literal.
5404 (xgetint): Simplify expression.
5405 * alloc.c (gdb_make_enums_visible): New constant. This ports to
5406 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
5407 Zaretskii in <http://bugs.gnu.org/12036#13>.
5408 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
5409 needed now that we have gdb_make_enums_visible.
5410 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
5411 (enum enum_USE_LSB_TAG):
5412 New enum types, packaging up enums that need to be exported to GDB.
5413
694b6c97
DA
54142012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5415
5416 Utility function to make a list from specified amount of objects.
5417 * lisp.h (enum constype): New datatype.
5418 (listn): New prototype.
5419 * alloc.c (listn): New function.
5420 (Fmemory_use_count, syms_of_alloc): Use it.
5421 * buffer.c (syms_of_buffer): Likewise.
5422 * callint.c (syms_of_callint): Likewise.
5423 * charset.c (define_charset_internal): Likewise.
5424 * coding.c (syms_of_coding): Likewise.
5425 * keymap.c (syms_of_keymap): Likewise.
5426 * search.c (syms_of_search): Likewise.
5427 * syntax.c (syms_of_syntax): Likewise.
5428 * w32.c (init_environment): Likewise.
5429 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
5430 * xdisp.c (syms_of_xdisp): Likewise.
5431 * xfns.c (syms_of_xfns): Likewise.
5432
6195f384
DA
54332012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
5434
5435 Fast save_excursion_save and save_excursion_restore.
5436 * lisp.h (struct Lisp_Excursion): New data type.
5437 (PVEC_EXCURSION): New pseudovector type.
5438 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
5439 to deal with it. Adjust comments.
5440 (init_marker, attach_marker): New prototype.
5441 (unchain_marker): Adjust prototype.
5442 * marker.c (attach_marker): Change to global.
5443 (init_marker): New function.
5444 * alloc.c (Fmake_marker, build_marker): Use it.
5445 (build_marker): More easserts.
5446 (mark_object): Handle struct Lisp_Excursion.
5447 * editfns.c (save_excursion_save, save_excursion_restore):
5448 Reimplement to use struct Lisp_Excursion. Add comments.
5449
5eceb8fb
PE
54502012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5451
5452 Fix export of symbols to GDB (Bug#12036).
5453 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
5454 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
5455 emacs.c, as this is a more-suitable home. Had this been done earlier
5456 the fix for 12036 would have avoided some of the problems noted in
5457 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
5458 would have been more obvious.
562157c8
PE
5459 * emacs.c: Do not include <verify.h>; no longer needed.
5460 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
5461 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
5462 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5463 Remove; now done in lisp.h.
5464 * lisp.h (PUBLISH_TO_GDB): New macro.
5465 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
5466 (DATA_SEG_BITS): Use it.
5467 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
5468 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
5469 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
5470 not be usable in #if. This simplifies things.
5471
d6749401
JB
54722012-07-26 Juanma Barranquero <lekktu@gmail.com>
5473
5474 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
5475
1781b9e9
PE
54762012-07-26 Paul Eggert <eggert@cs.ucla.edu>
5477
d89518db 5478 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
5479 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
5480 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
5481 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
5482 Adjust to changes in lisp.h and emacs.c, by using
5483 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
5484 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
5485 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
5486 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
5487 instead of gdb_valbits.
5488 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
5489 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
5490 instead of gdb_array_mark_flag.
5491 (xboolvector): Get size from $->size, not $->header.size.
5492 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
5493 (xreload, hook-run, hookpost-run): Remove.
5494 * emacs.c: Include <verify.h>.
5495 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
5496 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
5497 Remove.
5498 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
5499 (gdb_USE_LSB_TAG): New enum constants.
5500 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
5501 Also define these as enum constants, so they're visible to GDB.
5502 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
5503 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
5504 as constants, so they're visible to GDB.
5505 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
5506 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
5507 Now enum constants, not macros, so they're visible to GDB.
5508 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
5509 more convenient now. All uses changed.
5510 (VALMASK) [USE_LSB_TAG]: Also define in this case.
5511 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
5512
3628596a
DA
55132012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
5514
5515 Explicitly free restriction data that are not needed anymore.
5516 * editfns.c (save_restriction_restore): Free restriction data.
5517
7abaf5cc
SM
55182012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
5519
5520 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
5521 add argument, tune behavior, and adjust all callers.
5522
71f88e00
PE
55232012-07-25 Paul Eggert <eggert@cs.ucla.edu>
5524
5525 Use typedef for EMACS_INT, EMACS_UINT.
5526 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
5527 than macros. This simplifies debugging in the usual case, since
5528 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
5529 and it allows expressions involving EMACS_INT casts.
5530 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
5531
57ec3034
JD
55322012-07-25 Jan Djärv <jan.h.d@swipnet.se>
5533
5534 * nsterm.m (ns_read_socket): Return early if there is a modal
5535 window (Bug#12043).
5536
8137e7b3
MR
55372012-07-25 Martin Rudalics <rudalics@gmx.at>
5538
5539 * frame.c (Fredirect_frame_focus): In doc-string don't mention
5540 that FOCUS-FRAME can be omitted.
5541
04e9897c
DA
55422012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
5543
5544 Adjust buffer text indirection counters at the end of Fkill_buffer.
5545 * buffer.c (Fkill_buffer): Adjust indirection counters when the
5546 buffer is definitely dead. This should really fix an issue reported
5547 by Christoph Scholtes again. (Bug#12007).
5548 (init_buffer_once): Initialize indirection counters of
5549 buffer_defaults and buffer_local_symbols (for sanity and safety).
5550
8a0484e1
EZ
55512012-07-24 Eli Zaretskii <eliz@gnu.org>
5552
5553 * xdisp.c (init_iterator): Don't compute dimensions of truncation
5554 and continuation glyphs on tooltip frames, leave them at zero.
5555 Avoids continued lines in tooltips. (Bug#11832)
5556
fa691a83
DA
55572012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
5558
5559 Simplify copy_overlay.
04e9897c 5560 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
5561 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
5562
436bc8e0
EZ
55632012-07-23 Eli Zaretskii <eliz@gnu.org>
5564
5565 * print.c (print_object): Don't crash when a frame's name is nil
5566 or invalid. (Bug#12025)
5567
5568 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
5569 it signals an error when a tooltip frame is being created.
5570
d7a7fda3
DA
55712012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
5572
5573 Cleanup miscellaneous objects allocation and initialization.
5574 * alloc.c (allocate_misc): Change to static. Add argument to
5575 specify the subtype. Adjust comment and users.
5576 (build_overlay): New function.
5577 * buffer.c (copy_overlays, Fmake_overlay): Use it.
5578 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
5579 (allocate_misc): Remove prototype.
5580 (build_overlay): Add prototype.
5581
55822012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
5583
5584 Swap buffer text indirection counters in Fbuffer_swap_text.
5585 * buffer.c (Fbuffer_swap_text): Swap indirections too.
5586 This avoids crash reported by Christoph Scholtes at
5587 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
5588
9d7fa573
JD
55892012-07-22 Jan Djärv <jan.h.d@swipnet.se>
5590
5591 * nsmenu.m (Popdown_data): New struct.
5592 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
5593 free Popdown_data.
5594 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
5595 (initWithContentRect): Make imgView and contentView non-static
5596 and autorelease them. Also autorelease img and matrix (Bug#12005).
5597 (dealloc): Remove (Bug#12005).
5598
0dd6d66d
DA
55992012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5600
5601 Adjust consing_since_gc when objects are explicitly freed.
5602 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
5603 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
5604 (free_cons, free_misc): Subtract object size from consing_since_gc.
5605
d36d71df
DA
56062012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
5607
5608 Simplify and cleanup markers positioning code.
5609 * marker.c (attach_marker): More useful eassert.
5610 (live_buffer, set_marker_internal): New function.
5611 (Fset_marker, set_marker_restricted): Use set_marker_internal.
5612 (set_marker_both, set_marker_restricted_both): Use live_buffer.
5613
fb9ea40f
PE
56142012-07-22 Paul Eggert <eggert@cs.ucla.edu>
5615
5616 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
5617 as it's limited by the amount of memory, not by INT_MAX.
5618
2d5c5f7d
EZ
56192012-07-21 Eli Zaretskii <eliz@gnu.org>
5620
07fb592e
EZ
5621 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
5622 in special-event-map. See the discussion at
5623 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
5624 for the reasons.
5625
37a9eac8 5626 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
5627 info.dwItemData. Fixes crashes on 64-bit Windows.
5628 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 5629
c4328746
JD
56302012-07-21 Jan Djärv <jan.h.d@swipnet.se>
5631
fc0c31f8 5632 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 5633 (conversationIdentifier): Return value is NSInteger.
784051c4 5634 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 5635
6e5d1c12
CY
56362012-07-21 Chong Yidong <cyd@gnu.org>
5637
5638 * window.c (decode_any_window): Signal an error if the window is
5639 on a dead frame (Bug#11984).
5640
9928463d
DA
56412012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5642
5643 Add indirection counting to speed up Fkill_buffer.
5644 * buffer.h (struct buffer): New member.
5645 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
5646 (Fmake_indirect_buffer): Set indirection counter to -1, increment
5647 base buffer indirection counter.
5648 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
5649 (Fkill_buffer): Adjust indirection counters as needed, don't walk
5650 through buffer list if indirection counter is 0.
5651
f8643a6b
DA
56522012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5653
5654 Extend the value returned by Fgarbage_collect with heap statistics.
5655 * alloc.c (Qheap): New symbol.
5656 (syms_of_alloc): DEFSYM it.
5657 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
5658 (Fmemory_free): Remove.
5659 (syms_of_alloc): Don't defsubr it.
5660 * buffer.c (Fcompact_buffer): Remove.
5661 (syms_of_buffer): Don't defsubr it.
5662
dac616ff
DA
56632012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5664
5665 Make maybe_gc inline.
5666 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
5667 * lisp.h (consing_since_gc, gc_relative_threshold)
5668 (memory_full_cons_threshold): Revert declaration.
5669 (maybe_gc): Remove prototype, define as inline.
5670 * alloc.c: Remove old commented-out code.
5671 (consing_since_gc, gc_relative_threshold)
5672 (memory_full_cons_threshold): Revert to global.
5673 (maybe_gc): Remove.
5674
d7ea76b4
DA
56752012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5676
5677 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
5678 * lisp.h (build_unibyte_string): New function.
5679 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
5680 * sysdep.c, w32fns.c, xfns.c: Use it.
5681 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
5682 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
5683 Adjust users accordingly.
5684 * font.h (font_open_by_name): Adjust prototype.
5685
765e61e3
DA
56862012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
5687
5688 Cleanup calls to Fgarbage_collect.
5689 * lisp.h (maybe_gc): New prototype.
5690 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5691 Remove declarations.
5692 * alloc.c (maybe_gc): New function.
5693 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
5694 Make them static.
5695 * bytecode.c (MAYBE_GC): Use maybe_gc.
5696 * eval.c (eval_sub, Ffuncall): Likewise.
5697 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
5698 to avoid dependency from auto-save feature.
5699
52b852c7
PE
57002012-07-19 Paul Eggert <eggert@cs.ucla.edu>
5701
5702 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
5703 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
5704 'for_each_per_buffer_object_at'.
5705 All uses changed. It's better to use upper-case for macros that
5706 cannot be implemented as functions, to give the reader a clue
5707 that they're special.
5708
5db81e33
SM
57092012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
5710
5711 * alloc.c (Fgarbage_collect): Tweak docstring.
5712
5b835e1d
DA
57132012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5714
5715 Tweak the value returned from Fgarbage_collect again.
5716 * alloc.c (Fgarbage_collect): New return value, as confirmed in
5717 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
5718 Adjust documentation.
5719 (total_vector_bytes): Rename to total_vector_slots, adjust
5720 accounting.
5721 (total_free_vector_bytes): Rename to total_free_vector_slots,
5722 adjust accounting.
5723 (Qstring_bytes, Qvector_slots): New symbols.
5724 (syms_of_alloc): DEFSYM them.
5725
9cd47b72
DA
57262012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5727
5728 Buffer compaction primitive which may be used from Lisp.
5729 * buffer.c (compact_buffer, Fcompact_buffer): New function.
5730 (syms_of_buffer): Register Fcompact_buffer.
5731 * alloc.c (Fgarbage_collect): Use compact_buffer.
5732 * buffer.h (compact_buffer): New prototype.
5733 (struct buffer_text): New member.
5734
d17337e5
DA
57352012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
5736
5737 New macro to iterate over all buffers, miscellaneous cleanups.
5738 * lisp.h (all_buffers): Remove declaration.
5739 * buffer.h (all_buffers): Add declaration, with comment.
5740 (for_each_buffer): New macro.
5741 * alloc.c (Fgarbage_collect, mark_object): Use it.
5742 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
5743 (init_buffer): Likewise.
5744 * data.c (Fset_default): Likewise.
5745 * coding.c (code_conversion_restore): Remove redundant check
5746 for dead buffer.
5747 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
5748
60cfd278
AS
57492012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5750
5751 Fix bug that created negative-length intervals.
5752 * intervals.c (merge_interval_right, merge_interval_left):
5753 Do not zero out this interval if it is absorbed by its children,
5754 as this interval's total length doesn't change in that case. See
5755 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
5756
d06714cb
PE
57572012-07-18 Paul Eggert <eggert@cs.ucla.edu>
5758
83713154
PE
5759 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
5760 when invoking (make-bool-vector N t) and N is a positive
5761 multiple of 8 -- the last 8 bits were mistakenly cleared.
5762
d06714cb
PE
5763 Remove some struct layout assumptions in bool vectors.
5764 * alloc.c (bool_header_size): New constant.
5765 (header_size, word_size): Move earlier, as they're now used earlier.
5766 Use 'word_size' in a few more places, where it's appropriate.
5767 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
5768 padding before the data member of a bool vector.
5769 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
5770 than doing the check by hand with an abort ().
5771
464d5a5e
SM
57722012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
5773
5fbc0409
SM
5774 * eval.c (Fdefvar): Don't check constants since we only set the var if
5775 it's not yet defined anyway (bug#11904).
5776
464d5a5e
SM
5777 * lisp.h (last_undo_boundary): Declare new var.
5778 * keyboard.c (command_loop_1): Set it.
5779 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
5780 were auto-added by the command loop (bug#11774).
5781
8dc2e44a
AS
57822012-07-18 Andreas Schwab <schwab@linux-m68k.org>
5783
5784 * w32font.c (Qsymbol): Remove local definition.
5785 (syms_of_w32font): Don't DEFSYM it.
5786
169925ec
DA
57872012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5788
5789 Fix sweep_vectors to handle large bool vectors correctly.
5790 * alloc.c (sweep_vectors): Account total_vector_bytes for
5791 bool vectors larger than VBLOCK_BYTES_MAX.
5792
5fbfb018
CY
57932012-07-18 Chong Yidong <cyd@gnu.org>
5794
5795 * frame.c (x_set_frame_parameters): Revert bogus change introduced
5796 in 2012-05-25 commit by Paul Eggert (Bug#11738).
5797
3ab6e069
DA
57982012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
5799
5800 Return more descriptive data from Fgarbage_collect.
5801 Suggested by Stefan Monnier in
5802 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
5803 * alloc.c (bounded_number): New function.
5804 (total_buffers, total_vectors): New variable.
5805 (total_string_size): Rename to total_string_bytes, adjust users.
5806 (total_vector_size): Rename to total_vector_bytes, adjust users.
5807 (sweep_vectors): Account total_vectors and total_vector_bytes.
5808 (Fgarbage_collect): New return value. Adjust documentation.
5809 (gc_sweep): Account total_buffers.
5810 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
5811 (VECTOR_SIZE): Remove.
5812 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
5813 (Qinterval, Qmisc): New symbols.
5814 (syms_of_data): Initialize them.
5815 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
5816 (Qcons, Qbuffer): New declarations.
5817
6d02fe5b
PE
58182012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5819
5820 * alloc.c (Fmemory_free): Account for memory-free's own storage.
5821 Round up, not down. Improve doc.
5822
b7ffe040
DA
58232012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5824
5825 Restore old code in allocate_string_data to avoid Faset breakage.
5826 Reported by Julien Danjou <julien@danjou.info> in
5827 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
5828 * alloc.c (allocate_string_data): Restore old code with minor
5829 adjustments, fix comment to explain this subtle issue.
5830
4dc7c8d5
SM
58312012-07-17 Eli Zaretskii <eliz@gnu.org>
5832
5833 Remove FILE_SYSTEM_CASE.
5834 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
5835
5836 * fileio.c (FILE_SYSTEM_CASE): Don't define.
5837 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
5838 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
5839 call-process-region passes it through expand-file-name.
5840
5841 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
5842
58432012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5844
5845 Fix crash when creating indirect buffer (Bug#11917)
5846 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
5847 Don't handle unbound variables specially if non-zero.
5848 (Fbuffer_local_variables): Pass zero.
5849 (clone_per_buffer_values): Pass non-zero.
5850
58512012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5852
5853 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
5854 to make the loop interruptible.
5855
58562012-07-17 Andreas Schwab <schwab@linux-m68k.org>
5857
5858 * gnutls.c (emacs_gnutls_handshake): Only retry if
5859 GNUTLS_E_INTERRUPTED.
5860
cce7fefc
DA
58612012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5862
5863 Cleanup and convert miscellaneous checks to eassert.
5864 * alloc.c (mark_interval): Fix comment, partially rephrase
5865 old comment from intervals.h (see below).
5866 * intervals.c (find_interval, adjust_intervals_for_insertion)
5867 (delete_interval, adjust_intervals_for_deletion)
5868 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
5869 Convert to eassert.
5870 (adjust_intervals_for_insertion, make_new_interval):
5871 Remove obsolete and unused code.
5872 * intervals.h (struct interval): Remove obsolete comment.
5873 * textprotp.c (erase_properties): Remove unused code.
5874 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
5875 (Fremove_list_of_text_properties): Convert to eassert.
5876
9ea10cc3
CY
58772012-07-17 Chong Yidong <cyd@gnu.org>
5878
5879 * editfns.c (Finsert_char): Doc fix.
5880
3900d5de
DA
58812012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5882
5883 Fix previous change to make Fmemory_free always accurate.
5884 * alloc.c (make_interval): Update total_free_intervals.
5885 (make_float): Likewise for total_free_floats.
5886 (free_cons, Fcons): Likewise for total_free_conses.
5887 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
5888 Likewise for total_free_vector_bytes.
5889 (Fmake_symbol): Likewise for total_free_symbols.
5890 (bytes_free): Remove.
5891
7098646f
DA
58922012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5893
5894 Simple free memory accounting feature.
5895 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
5896 (sweep_vectors): Accumulate size of free vectors.
5897 (Fgarbage_collect): Setup bytes_free.
5898 (Fmemory_free): New function.
5899 (syms_of_alloc): Register it.
5900
22657b40
DA
59012012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
5902
5903 Cleanup overlays checking.
5904 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
5905 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
5906 eassert and OVERLAYP.
5907 (sort_overlays): Change to use OVERLAYP.
5908
ddfc8813
RK
59092012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
5910
5911 * editfns.c (Finsert_char): Make it interactive, and make the
5912 second arg optional. Copy interactive spec and docstring from
5913 ucs-insert.
5914
7c26cf3c
PE
59152012-07-17 Paul Eggert <eggert@cs.ucla.edu>
5916
5917 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
5918 Unlike the other wrapped functions, fabs has an unspecified
5919 effect on errno.
5920
5d127af9
JD
59212012-07-16 Jan Djärv <jan.h.d@swipnet.se>
5922
5923 * nsterm.m (keyDown): Interpret flags without left/right bits
5924 as the left key (Bug#11670).
5925
6a0dd1d7
DA
59262012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5927
5928 Remove empty and useless init functions.
5929 * lisp.h (init_character_once, init_fns, init_image)
5930 (init_filelock, init_sound): Remove prototype.
5931 * character.c (init_character_once): Remove.
5932 * filelock.c (init_filelock): Likewise.
5933 * fns.c (init_fns): Likewise.
5934 * image.c (init_image): Likewise.
5935 * sound.c (init_sound): Likewise.
5936 * emacs.c (main): Adjust accordingly.
5937
7a6136fd
DA
59382012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
5939
5940 * gtkutil.h: Tiny cleanups.
5941 (use_old_gtk_file_dialog): Remove useless declaration.
5942 (xg_uses_old_file_dialog): Add suggested const attribute.
5943
ce811ad9
EZ
59442012-07-15 Eli Zaretskii <eliz@gnu.org>
5945
5946 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
5947 (bidi_paragraph_init): Use it to limit search forward for a strong
5948 directional character in abnormally large paragraphs full of
5949 neutral or weak characters. (Bug#11943)
5950
c9adfeaa
SF
59512012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
5952
5953 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
5954 the toolbar (Bug#9451).
5955 (xg_make_tool_item): Give the widget event box a transparent
5956 background.
5957
fff62aa9
DA
59582012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5959
5960 Cleanup basic allocation variables and functions.
5961 * alloc.c (ignore_warnings, init_intervals, init_float)
5962 (init_cons, init_symbol, init_marker): Remove.
5963 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
5964 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
5965 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
5966 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
5967 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
5968 (staticidx, init_alloc_once, init_strings, free_ablock):
5969 Remove redundant initialization.
5970 * fns.c (init_weak_hash_tables): Remove.
5971 * lisp.h (init_weak_hash_tables): Remove prototype.
5972
9730daca
DA
59732012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
5974
5975 Use zero_vector where appropriate.
5976 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
5977 accordingly.
5978 * lisp.h (zero_vector): New declaration.
5979 * font.c (null_vector): Remove.
5980 (syms_of_font): Remove initialization and staticpro.
5981 (font_list_entities, font_find_for_lface): Change to use zero_vector.
5982 * keymap.c (Faccessible_keymaps): Likewise.
5983
2e2d2a13
LL
59842012-07-15 Leo Liu <sdl.web@gmail.com>
5985
5986 * fringe.c: Fix typo in comments.
5987
cd276f6e
LL
59882012-07-14 Leo Liu <sdl.web@gmail.com>
5989
5990 * fringe.c: Add a new bitmap exclamation-mark.
5991
5a1131d9
EZ
59922012-07-14 Eli Zaretskii <eliz@gnu.org>
5993
5994 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
5995
5996 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
5997 (HAVE_MENUS): Don't define, defined by editing config.in with
5998 msdos/sed2v2.inp.
5999 (GMALLOC_INHIBIT_VALLOC): Don't define.
6000 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
6001
22e983b7
JB
60022012-07-14 Juanma Barranquero <lekktu@gmail.com>
6003
6004 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
6005
5b3f250f
GM
60062012-07-14 Glenn Morris <rgm@gnu.org>
6007
6008 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
6009 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
6010 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
6011
33d63ff4
GM
60122012-07-13 Glenn Morris <rgm@gnu.org>
6013
5b633342
GM
6014 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
6015
33d63ff4
GM
6016 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
6017 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
6018
b55b9f85
JD
60192012-07-13 Jan Djärv <jan.h.d@swipnet.se>
6020
0dc8cf50
JD
6021 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
6022 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
6023 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
6024 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
6025 where appropriate.
6026 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
6027 as boolean expression.
6028 (x_set_window_size): Remove unused variable toolbar.
6029 (ns_get_color_default, ns_mod_to_lisp): Remove.
6030 (ns_mouse_position): Remove unused variables xchar and ychar.
6031 (ns_compute_glyph_string_overhangs): Remove unused variable face.
6032 (ns_set_vertical_scroll_bar): Remove unused variable count.
6033 (ns_delete_terminal): Remove unused variable i.
6034 (ns_term_init): Remove unused variables r, g and b.
6035 (mouseDown): Remove unused variable window.
6036 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
6037 (initFrameFromEmacs): Remove unused variable vbextra.
6038 (mouseEntered): Remove unused variables p and dpyinfo.
6039 (mouseExited): Remove unused variables p and r.
6040 (ns_define_frame_cursor, ns_clear_frame_area)
6041 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
6042 (menuDown): Assign [sender tag] to variable and cast the variable.
6043
6044 * nsterm.h (menuDown): Add id as type to argument sender.
6045 (ns_display_info_for_name): Add Lisp_Object argument.
6046 (ns_term_init): Add Lisp_Object argument.
6047 (ns_map_event_to_object): Add void argument.
6048 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
6049 prototype with arguments and only declare if __OBJC__.
6050 (nxatoms_of_nsselect): Add void argument.
6051 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
6052 (ns_alloc_autorelease_pool): Add void argument.
6053 (ns_release_autorelease_pool): Add void* argument.
6054 (ns_get_defaults_value): Add const char* argument.
6055
6056 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
6057 (initFromContents): Use SSDATA where appropriate.
6058 (ns_update_menubar): Add braces to ambigous if-else.
6059 (initWithTitle): Put () around assignment in if statement.
6060 (ns_menu_show): Remove unused variables window and keymap.
6061 (update_frame_tool_bar): Remove unused variable selected_p.
6062 (initWithContentRect): Remove unused variable this_cmd_name.
6063
6064 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
6065 appropriate.
6066 (setXBMColor): Remove unused variable len.
6067 (setPixmapData): Put () around assignment in loop statement.
6068
6069 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
6070 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
6071 where appropriate.
6072 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
6073 around assignment in loop statement.
6074 (nsfont_open): Remove unused variable i.
6075 (nsfont_open): Remove unused variable len.
6076 (nsfont_draw): Remove unused variable cs.
6077
6078 * nsfns.m (x_set_icon_name, ns_set_name_internal)
6079 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
6080 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
6081 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
6082 (Fns_font_name, Fns_perform_service)
6083 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
6084 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
6085 (ns_set_name): Remove unused variable view.
6086 (x_set_menu_bar_lines): Remove unused variable olines.
6087 (x_set_tool_bar_lines): Remove unused variable root_window.
6088 (Fns_list_colors): Put () around assignment in while statement.
6089 (Fns_perform_service): Remove unused variable len.
6090 (Fns_display_usable_bounds): Remove unused variable top.
6091 (syms_of_nsfns): Remove unused variable i.
6092
b55b9f85
JD
6093 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
6094 memcpy (Bug#11907).
6095
ed9265fc 60962012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
6097
6098 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
6099 and free it with DestroyExceptionInfo (Bug#11558).
6100
ef099b57
JB
61012012-07-13 Juanma Barranquero <lekktu@gmail.com>
6102
6103 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
6104 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
6105 Set here, not in nt/config.nt.
6106
ea814a5d
EZ
61072012-07-13 Eli Zaretskii <eliz@gnu.org>
6108
6109 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
6110 cursor overflow into the last glyph on display line when the right
6111 fringe is off. (Bug#11832)
6112
1a952767
PE
61132012-07-13 Paul Eggert <eggert@cs.ucla.edu>
6114
6115 * xdisp.c (produce_special_glyphs): Now static.
6116 * dispextern.h (produce_special_glyphs): Remove decl.
6117
983188fd
GM
61182012-07-13 Glenn Morris <rgm@gnu.org>
6119
8d7c7eed 6120 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
6121 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
6122
983188fd
GM
6123 * s/usg5-4-common.h (USG, USG5):
6124 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
6125 * s/sol2-6.h (SOLARIS2):
6126 * s/irix6-5.h (IRIX6_5):
6127 * s/hpux10-20.h (USG, USG5, HPUX):
6128 * s/gnu-linux.h (USG, GNU_LINUX):
6129 * s/freebsd.h (BSD_SYSTEM):
6130 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
6131 * s/cygwin.h (CYGWIN):
6132 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
6133 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
6134
d1e68667 61352012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
6136
6137 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 6138
6de0e799
GM
61392012-07-13 Glenn Morris <rgm@gnu.org>
6140
739ae010
GM
6141 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
6142
dbee5793
GM
6143 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
6144
6de0e799
GM
6145 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
6146 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
6147
b82da769
GM
61482012-07-12 Glenn Morris <rgm@gnu.org>
6149
4fae5a7a 6150 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
6151
6152 * process.c (init_process_emacs): Rename from init_process.
6153 The old name is also the name of a Mach system call.
6154 * lisp.h, emacs.c: Update for this name change.
6155 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
6156 longer needed.
6157
5a979817
EZ
61582012-07-12 Eli Zaretskii <eliz@gnu.org>
6159
6160 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
6161 memmove call that removes glyphs covered by the left truncation
6162 glyph. Improve commentary.
6163 (display_line): Fix display of continuation glyphs on GUI frames
6164 when the right fringe is turned off and variable-size fonts are
6165 used in the window. Move the code that appends a stretch glyph to
6166 produce_special_glyphs, so that it could be used for truncation
6167 and continuation glyphs alike.
6168 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
6169 glyph of a suitably computed width, to align the special glyphs at
6170 the window margin. Code moved from display_line. (Bug#11832)
6171
3e91a053
GM
61722012-07-12 Glenn Morris <rgm@gnu.org>
6173
ba9e4b84
GM
6174 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
6175
6176 * s/gnu-linux.h, s/hpux10-20.h:
6177 Do not unconditionally define HAVE_XRMSETDATABASE.
6178
3e91a053
GM
6179 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
6180
b300b1f4
PE
61812012-07-12 Paul Eggert <eggert@cs.ucla.edu>
6182
6183 Fix typos that broke OS X build.
6184 Reported by Randal L. Schwartz in
6185 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
6186 * nsterm.m (ns_timeout): Add missing local decl.
6187 (ns_get_color): snprintf -> sprintf, to fix typo.
6188
6e777848
GM
61892012-07-12 Glenn Morris <rgm@gnu.org>
6190
3f922c37
GM
6191 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
6192 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
6193 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
6194 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
6195
0ab7b23a
GM
6196 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
6197 Move PTY_OPEN to configure.
6198
6e777848
GM
6199 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6200 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
6201 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
6202
4a7edc24
DA
62032012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
6204
6205 Use empty_unibyte_string where applicable.
6206 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
6207 * lread.c (read1): Likewise.
6208 * xsettings.c (syms_of_xsettings): Likewise.
6209
308aab79
GM
62102012-07-12 Glenn Morris <rgm@gnu.org>
6211
42bd1719
GM
6212 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
6213 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
6214 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
6215 * s/hpux10-20.h (RUN_TIME_REMAP):
6216 * s/bsd-common.h (TABDLY): Move to configure.
6217
6218 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
6219
6220 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
6221
ea0bbd17 6222 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 6223 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
6224
6225 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 6226
308aab79
GM
6227 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
6228 * s/template.h: Move NARROWPROTO to configure.
6229
ee1cf5cf
GM
62302012-07-11 Glenn Morris <rgm@gnu.org>
6231
30fe9bf4
GM
6232 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
6233 unused since 2011-01-17 change to systty.h.
6234
ee1cf5cf
GM
6235 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
6236 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6237 Move HAVE_PTYS and HAVE_SOCKETS to configure.
6238
63e47e07
PE
62392012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6240
6241 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
6242
c43fb4c3
GM
62432012-07-11 Glenn Morris <rgm@gnu.org>
6244
6245 * s/darwin.h, s/gnu-linux.h, s/template.h:
6246 Move INTERRUPT_INPUT to configure.
6247
e8df9267
DA
62482012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6249
6250 Minor adjustments to interning code.
6251 * lisp.h (intern, intern_c_string): Redefine as static inline
6252 wrappers for intern_1 and intern_c_string_1, respectively.
6253 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
6254 * lread.c (intern_1, intern_c_string_1, oblookup):
6255 Simplify Vobarray checking.
e8df9267
DA
6256 * font.c (font_intern_prop): Likewise. Adjust comment.
6257 * w32font.c (intern_font_name): Likewise.
6258
34348bd4
AS
62592012-07-11 Andreas Schwab <schwab@linux-m68k.org>
6260
d96a1e0c
AS
6261 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
6262
34348bd4
AS
6263 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
6264 of Fcar/Fcdr if possible.
6265 * font.c (check_otf_features): Likewise.
6266 * fontset.c (Fnew_fontset): Likewise.
6267 * gnutls.c (Fgnutls_boot): Likewise.
6268 * minibuf.c (read_minibuf): Likewise.
6269 * msdos.c (IT_set_frame_parameters): Likewise.
6270 * xmenu.c (Fx_popup_dialog): Likewise.
6271 * w32menu.c (Fx_popup_dialog): Likewise.
6272
c8add24e
GM
62732012-07-11 Glenn Morris <rgm@gnu.org>
6274
4b575b3c
GM
6275 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
6276 since nothing has defined it on these platforms.
6277
09f4e3b0
GM
6278 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
6279 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
6280
172bedef
GM
6281 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
6282 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
6283 Move CLASH_DETECTION to configure.
6284
249685df
GM
6285 * s/gnu.h: Remove file, which is now empty.
6286
c8add24e
GM
6287 * s/gnu.h, s/gnu-linux.h:
6288 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
6289
b41253a3
JW
62902012-07-11 John Wiegley <johnw@newartisans.com>
6291
6292 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
6293 function attribute, so we only use it if it exists in the
6294 compiler.
6295
d923b542
DA
62962012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6297
6298 Avoid call to strlen in fast_c_string_match_ignore_case.
6299 * search.c (fast_c_string_match_ignore_case): Change to use
6300 length argument. Adjust users accordingly.
6301 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
6302
5ebbef1d
PE
63032012-07-11 Paul Eggert <eggert@cs.ucla.edu>
6304
bb352260
PE
6305 Assume mkdir, rmdir.
6306 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
6307 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
6308
57054ddd
PE
6309 Assume rename.
6310 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
6311
b747d3f7
PE
6312 Assume perror.
6313 * s/hpux10-20.h (HAVE_PERROR): Remove.
6314 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
6315 Remove dummy definition, as this problem was obsolete long ago.
6316
5ebbef1d
PE
6317 Assume strerror.
6318 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
6319
984e7f30
DA
63202012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
6321
6322 Avoid calls to strlen in font processing functions.
6323 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
6324 (font_open_by_name): Change to use length argument.
6325 Adjust users accordingly.
d923b542
DA
6326 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
6327 Adjust prototypes.
6328 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
6329 Change to return ptrdiff_t.
984e7f30
DA
6330 (xfont_list_pattern, xfont_match): Use length returned by
6331 xfont_decode_coding_xlfd.
6332 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
6333
20e94fdd
GM
63342012-07-11 Glenn Morris <rgm@gnu.org>
6335
9d596af3
GM
6336 * s/darwin.h, s/freebsd.h, s/netbsd.h:
6337 Move DONT_REOPEN_PTY to configure.
6338
20e94fdd
GM
6339 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
6340 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
6341
e99a530f
PE
63422012-07-10 Paul Eggert <eggert@cs.ucla.edu>
6343
22ffb973
PE
6344 Remove "#define unix" that is no longer needed (Bug#11905).
6345 * s/aix4-2.h (unix): Remove; no longer needed.
6346
e9a9ae03
PE
6347 EMACS_TIME simplification (Bug#11875).
6348 This replaces macros (which typically do not work in GDB)
6349 with functions, typedefs and enums, making the code easier to debug.
6350 The functional style also makes code easier to read and maintain.
6351 * systime.h: Include <sys/time.h> on all hosts, not just if
6352 WINDOWSNT, since 'struct timeval' is needed in general.
6353 (EMACS_TIME): Now a typedef, not a macro.
6354 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
6355 not macros.
6356 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
6357 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
6358 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
6359 (EMACS_TIME_LE): Now functions, not macros.
6360 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
6361 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
6362 which are not functions. All uses rewritten to use:
6363 (make_emacs_time): New function.
6364 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
6365 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
6366 not functions. All uses rewritten to use the following, respectively:
6367 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
6368 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 6369 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
6370 * fileio.c (Fcopy_file):
6371 * xterm.c (XTflash): Get the current time closer to when it's used.
6372 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
6373
ffacb126
PE
6374 * bytecode.c (targets): Suppress -Woverride-init warnings.
6375
e99a530f
PE
6376 Simplify by avoiding confusing use of strncpy etc.
6377 * doc.c (Fsnarf_documentation):
6378 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
6379 * frame.c (Fmake_terminal_frame):
6380 * gtkutil.c (get_utf8_string):
6381 * lread.c (openp):
6382 * nsmenu.m (ns_update_menubar):
6383 * regex.c (regerror):
6384 Prefer memcpy to strncpy and strncat when either will do.
6385 * fileio.c (Fsubstitute_in_file_name):
6386 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
6387 (menu_separator_name_p):
6388 * nsmenu.m (ns_update_menubar):
6389 Prefer memcmp to strncmp when either will do.
6390 * nsterm.m: Include <ftoastr.h>.
6391 (ns_get_color):
6392 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
6393 Prefer snprintf to strncpy.
6394 * nsterm.m (ns_term_init):
6395 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
6396 * nsterm.m (ns_term_init):
6397 Avoid the need for strncpy, by using build_string or
6398 make_unibyte_string directly. Use dtoastr, not snprintf.
6399 * process.c (Fmake_network_process): Diagnose service names that
6400 are too long, rather than silently truncating them or creating
6401 non-null-terminated names.
6402 (Fnetwork_interface_info): Likewise, for interface names.
6403 * sysdep.c (system_process_attributes) [GNU_LINUX]:
6404 Prefer sprintf to strncat.
6405 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
6406 Prefer vsnprintf to vsprintf + strncpy.
6407
c59592b3
GM
64082012-07-10 Glenn Morris <rgm@gnu.org>
6409
6410 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
6411 Clarify fallback case.
6412
7d7bbefd
DA
64132012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6414
6415 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
6416 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
6417 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 6418 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
6419 where argument type is known to be a Lisp_Cons.
6420
3a4c8000
TT
64212012-07-10 Tom Tromey <tromey@redhat.com>
6422
6423 * bytecode.c (BYTE_CODE_THREADED): New macro.
6424 (BYTE_CODES): New macro. Replaces all old byte-code defines.
6425 (enum byte_code_op): New type.
6426 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
6427 (exec_byte_code): Use them. Use token threading when applicable.
6428
2a0213a6
DA
64292012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6430
6431 Optimize pure C strings initialization.
6432 * lisp.h (make_pure_string): Fix prototype.
6433 (build_pure_c_string): New function, defined as static inline. This
6434 provides a better opportunity to optimize away calls to strlen when
6435 the function is called with compile-time constant argument.
6436 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
6437 argument, adjust users accordingly. Use build_pure_c_string where
6438 appropriate.
6439 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
6440 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
6441 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
6442
cb1caeaf
DA
64432012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6444
6445 Avoid calls to strlen in miscellaneous functions.
6446 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
6447 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
6448 * lread.c (openp): Likewise.
6449
c293e30c
DA
64502012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
6451
6452 Avoid calls to strlen in path processing functions.
6453 * fileio.c (file_name_as_directory): Add comment. Change to add
6454 srclen argument and return the length of result. Adjust users
6455 accordingly.
6456 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
6457 swap 1st and 2nd arguments to obey the common convention.
6458 Adjust users accordingly.
c293e30c
DA
6459 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
6460
9e059e3f
GM
64612012-07-10 Glenn Morris <rgm@gnu.org>
6462
d02eb359
GM
6463 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
6464 Move PENDING_OUTPUT_COUNT definition to configure.
6465
882cf227
GM
6466 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
6467 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
6468 * s/gnu.h (DATA_START): Move definitions to configure.
6469
af6e839f
GM
6470 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
6471 We include usg5-4-common.h, which defines them both.
6472
40289a12
GM
6473 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
6474 O_RDONLY already includes it).
6475
9e059e3f
GM
6476 Stop ns builds setting the EMACSLOADPATH environment variable.
6477 * nsterm.m (ns_load_path): Rename from ns_init_paths.
6478 Now it does not set EMACSLOADPATH, just returns the load-path string.
6479 * nsterm.h: Update accordingly.
6480 * lread.c [HAVE_NS]: Include nsterm.h.
6481 (init_lread) [HAVE_NS]: Use ns_load_path.
6482 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
6483
7c4e8ec0
GM
64842012-07-09 Glenn Morris <rgm@gnu.org>
6485
d4f600ff
GM
6486 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
6487 since the included bsd-common.h does so.
6488
cbb31951
GM
6489 Stop ns builds setting the EMACSPATH environment variable.
6490 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
6491 (ns_init_paths): Do not set EMACSPATH.
6492 * nsterm.h (ns_exec_path): Add it.
6493 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
6494 Use ns_exec_path.
6495
7c4e8ec0
GM
6496 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
6497
26bccfae
PE
64982012-07-09 Paul Eggert <eggert@cs.ucla.edu>
6499
a0bee46f
PE
6500 * process.c (wait_reading_process_output): 'waitchannels' was unset
6501 when read_kbd || !NILP (wait_for_cell); fix this.
6502
5994c183
PE
6503 Add GCC-style 'const' attribute to functions that can use it.
6504 * character.h (char_resolve_modifier_mask):
6505 * keyboard.h (make_ctrl_char):
6506 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
6507 (init_character_once, next_almost_prime, init_fns, init_image)
6508 (flush_pending_output, init_sound):
6509 * mem-limits.h (start_of_data):
6510 * menu.h (finish_menu_items):
6511 Add ATTRIBUTE_CONST.
6512 * emacs.c (DEFINE_DUMMY_FUNCTION):
6513 Declare the dummy function with ATTRIBUTE_CONST.
6514 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
6515 Add decls with ATTRIBUTE_CONST.
6516
26bccfae
PE
6517 Minor improvements to make_formatted_string.
6518 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
6519 where int is good enough, as vsprintf returns an int.
6520 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
6521
a8290ec3
DA
65222012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6523
6524 Use make_formatted_string to avoid double length calculation.
6525 * lisp.h (make_formatted_string): New prototype.
6526 * alloc.c (make_formatted_string): New function.
6527 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 6528 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
6529 * editfns.c (Fcurrent_time_zone): Likewise.
6530 * filelock.c (get_boot_time): Likewise.
6531 * frame.c (make_terminal_frame, set_term_frame_name)
6532 (x_report_frame_params): Likewise.
6533 * image.c (gs_load): Likewise.
6534 * minibuf.c (get_minibuffer): Likewise.
6535 * msdos.c (dos_set_window_size): Likewise.
6536 * process.c (make_process): Likewise.
6537 * xdisp.c (ensure_echo_area_buffers): Likewise.
6538 * xsettings.c (apply_xft_settings): Likewise.
6539
d01ba2f1
GM
65402012-07-09 Glenn Morris <rgm@gnu.org>
6541
6542 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
6543 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
6544 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
6545 * nsterm.h (ns_etc_directory): Add it.
6546 * callproc.c [HAVE_NS]: Include nsterm.h.
6547 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
6548
f1f924b6
DA
65492012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
6550
6551 Move marker debugging code under MARKER_DEBUG.
6552 * marker.c (MARKER_DEBUG): Move marker debugging code under
6553 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
6554 for bootstrap with --enable-checking (~3x slowdown reported
6555 by Juanma Barranquero <lekktu@gmail.com>).
6556 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
6557
ab531b66
PE
65582012-07-08 Paul Eggert <eggert@cs.ucla.edu>
6559
6560 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
6561 See <http://bugs.gnu.org/11825#29>.
6562
c4b3bc8a
EZ
65632012-07-08 Eli Zaretskii <eliz@gnu.org>
6564
6565 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
6566 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
6567 (display_line): Add commentary about displaying truncation glyphs
6568 on GUI frames.
6569 (produce_special_glyphs): Move here from term.c.
6570
6571 * term.c (produce_special_glyphs): Move to xdisp.c.
6572
6573 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
6574 section.
c4b3bc8a 6575
b676b881
AS
65762012-07-07 Andreas Schwab <schwab@linux-m68k.org>
6577
f17c5273
AS
6578 * xdisp.c (display_line): Avoid warning about implicit declaration
6579 of FRAME_FONT.
6580
298819b9
AS
6581 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
6582
b676b881
AS
6583 * lisp.h: Remove empty conditional.
6584
6045c4fd
PE
65852012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6586
b3350bf9
PE
6587 * lread.c (load_path_check): Now static.
6588
6045c4fd
PE
6589 Fix some minor --with-ns problems found by static checking.
6590 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
6591 (x_set_font) [!HAVE_X_WINDOWS]:
6592 * image.c (xpm_load_image) [HAVE_NS]:
6593 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
6594 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
6595 Remove unused local.
6596 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
6597 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
6598 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
6599 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
6600 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
6601 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
6602 Fix pointer signedness problem.
6603 * xfaces.c (FRAME_X_FONT_TABLE):
6604 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
6605
929e7845
GM
66062012-07-07 Glenn Morris <rgm@gnu.org>
6607
6608 * lread.c (load_path_check): New function, split from init_lread.
6609 (init_lread): Reorganize. Motivation:
6610 If EMACSLOADPATH is set, check/warn about that rather than the
6611 defaults, which we are not going to use. Hence we can remove
6612 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
6613 Don't warn if site-lisp directories are missing.
6614 If not installed, start from a blank load-path, since
6615 PATH_LOADSEARCH refers to the eventual installation directories.
6616
58dd0aa4
EZ
66172012-07-07 Eli Zaretskii <eliz@gnu.org>
6618
6619 Support truncation and continuation glyphs on GUI frames, when
6620 fringes are disabled. (Bug#11832)
6621 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
6622 continuation glyphs even if on GUI frames.
6623 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
6624 or both, are absent.
6625 (start_display, move_it_in_display_line_to): Handle the case of a
6626 GUI frame without a fringe to display continuation or truncation
6627 glyphs.
6628 (insert_left_trunc_glyphs): Support GUI frames: make sure
6629 truncation glyphs overwrite enough glyphs from the current line to
6630 have sufficient space in pixels.
6631 (display_line): Support truncation and continuation glyphs on GUI
6632 frames. If some spare pixels are left on the line after inserting
6633 the truncation glyphs, fill that space with a stretch glyph of a
6634 suitably computed width.
6635
6636 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
6637 produce_glyphs, to support GUI sessions.
6638
31571fd7
PE
66392012-07-07 Paul Eggert <eggert@cs.ucla.edu>
6640
5a16b9bc
PE
6641 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
6642
f3047c75
PE
6643 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
6644
31571fd7
PE
6645 Do not require float-time's arg to fit in time_t (Bug#11825).
6646 This works better on hosts where time_t is unsigned, and where
6647 float-time is applied to the (negative) difference between two times.
6648 * editfns.c (decode_time_components): Last arg is now double *,
6649 not int *, and means to store all the result as a double, without
6650 worrying about whether the seconds part fits in time_t.
6651 All callers changed.
6652 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
6653 All callers changed.
6654 (Ffloat_time): Do not fail merely because the specified time falls
6655 outside of time_t range.
6656
4516fbef
GM
66572012-07-07 Glenn Morris <rgm@gnu.org>
6658
6659 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
6660 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
6661 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
6662
07adc2c6
JB
66632012-07-07 Juanma Barranquero <lekktu@gmail.com>
6664
6665 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
6666 Update dependencies.
6667
6668 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
6669
fd573f31
PE
66702012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6671
fee5959d
PE
6672 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
6673 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
6674 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
6675 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
6676 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
6677 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
6678
fd573f31
PE
6679 * xfont.c (compare_font_names): Redo to omit the need for casts.
6680
ddadbc0e
AS
66812012-07-06 Andreas Schwab <schwab@linux-m68k.org>
6682
fca8d6b6
AS
6683 * xfns.c (Fx_change_window_property): Doc fix.
6684 * w32fns.c (Fx_change_window_property): Doc fix.
6685
ddadbc0e
AS
6686 * w32fns.c (Fx_window_property): Accept the same arguments as the
6687 X Windows version. Doc fix.
6688 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
6689
ed9265fc 66902012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
6691 Eli Zaretskii <eliz@gnu.org>
6692
6693 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
6694 Windows-specific code from nt/config.nt moved here.
6695 Obsolete settings removed.
6696
216ee680
PE
66972012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6698
6699 * process.c: Avoid unnecessary calls to gettime.
6700 (wait_reading_process_output): Don't get the time of day
6701 when gobbling data immediately and not waiting, as there's no need
6702 for it in that case. This removes a FIXME.
6703
bdd091e4
JD
67042012-07-06 Jan Djärv <jan.h.d@swipnet.se>
6705
6706 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
6707 is defined (Bug#11768).
6708
9d44f8ce
DA
67092012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6710
6711 Fix marker debugging code.
6712 * marker.c (byte_char_debug_check): Do not perform the check
6713 if buffer is not multibyte.
090bd7cb
JB
6714 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6715 Call byte_char_debug_check with correct arguments.
9d44f8ce 6716
90fc4786
DA
67172012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6718
6719 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
6720 * marker.c (byte_char_debug_check, count_markers):
6721 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
6722 (byte_debug_flag): Remove.
6723 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
6724 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
6725
7b7ae965
DA
67262012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6727
4e57b342
DA
6728 Avoid code repetition in marker-related functions.
6729 * marker.c (attach_marker): New function.
6730 (Fset_marker, set_marker_restricted, set_marker_both)
6731 (set_marker_restricted_both): Use it.
6732 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
6733 Consistently rename charno to charpos.
6734 (marker_position): Add eassert.
6735 (marker_byte_position): Convert to eassert.
6736
67372012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6738
6739 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 6740 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 6741 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 6742
657924ff
DA
67432012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6744
6745 Introduce fast path for the widely used marker operation.
6746 * alloc.c (build_marker): New function.
6747 * lisp.h (build_marker): New prototype.
6748 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
6749 * composite.c (autocmp_chars): Likewise.
6750 * editfns.c (buildmark): Remove.
6751 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
6752 (save_restriction_save): Use build_marker.
6753 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
6754 * window.c (save_window_save): Likewise.
6755
041a49a6
DA
67562012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
6757
6758 Do not use Fdelete_overlay in delete_all_overlays
6759 to avoid redundant calls to unchain_overlay.
6760 * buffer.c (drop_overlay): New function.
6761 (delete_all_overlays, Fdelete_overlay): Use it.
6762 * minibuf.c (get_minibuffer): Fix comment.
6763
7dca65a4
PE
67642012-07-06 Paul Eggert <eggert@cs.ucla.edu>
6765
6766 Port to OpenBSD 5.1 amd64.
6767 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
6768 This is needed for OpenBSD, and should be harmless on all BSD systems.
6769 Also, include <sys/sysctl.h>, as it should be available on all
6770 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
6771 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
6772 use p_pid member, not kp_proc.pid.
6773
8eb876e2
GM
67742012-07-06 Glenn Morris <rgm@gnu.org>
6775
6776 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
6777
38182d90
PE
67782012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6779
6780 More xmalloc and related cleanup.
6781 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
6782 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
6783 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
6784 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
6785 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
6786 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
6787 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
6788 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
6789 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
6790 * xterm.c:
6791 Omit needless casts involving void * pointers and allocation.
6792 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
6793 as the former is more robust if P's type is changed.
6794 Prefer xzalloc to xmalloc + memset 0.
6795 Simplify malloc-or-realloc to realloc.
6796 Don't worry about xmalloc returning a null pointer.
6797 Prefer xstrdup to xmalloc + strcpy.
6798 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
6799 growing it.
6800 * keyboard.c (apply_modifiers_uncached): Prefer local array to
6801 alloca of a constant.
6802
6dd5a677
EZ
68032012-07-05 Eli Zaretskii <eliz@gnu.org>
6804
6805 * xdisp.c (display_line): Fix horizontal pixel coordinates when
6806 hscroll is larger than the line width. Fixes long and futile
6807 looping inside extend_face_to_end_of_line (on a TTY) producing
6808 glyphs that are not needed and thrown away.
6809
6b312f0f
DA
68102012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6811
6812 * marker.c (set_marker_restricted_both): Simplify by using
6813 clip_to_bounds.
6814
f520ef9b
PE
68152012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6816
6817 * editfns.c (region_limit): Simplify by using clip_to_bounds.
6818
383b7c95
JD
68192012-07-05 Jan Djärv <jan.h.d@swipnet.se>
6820
6821 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
6822 not defined (Bug#11768).
6823 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
6824 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
6825 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
6826 followed by gtk_box_set_homogeneous (Bug#11768).
6827 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
6828 (update_theme_scrollbar_width, xg_create_scroll_bar):
6829 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
6830 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
6831 (is_box_type): New function (Bug#11768).
6832 (xg_tool_item_stale_p): Call is_box_type.
5293d758 6833 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
6834 with default display (Bug#11768).
6835
d6e7bf45
EZ
68362012-07-05 Eli Zaretskii <eliz@gnu.org>
6837
6838 * xdisp.c (window_hscroll_limited): New function.
6839 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
6840 coordinates when window's hscroll is set to insanely large
6841 values. (Bug#11857)
6842
431391ec
JB
68432012-07-05 Juanma Barranquero <lekktu@gmail.com>
6844
6845 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
6846 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
6847
23f86fce
DA
68482012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
6849
6850 Cleanup xmalloc.
6851 * lisp.h (xzalloc): New prototype. Omit needless casts.
6852 * alloc.c (xzalloc): New function. Omit needless casts.
6853 * charset.c: Omit needless casts. Convert all calls to
6854 xmalloc with following memset to xzalloc.
6855 * dispnew.c: Likewise.
6856 * fringe.c: Likewise.
6857 * image.c: Likewise.
6858 * sound.c: Likewise.
6859 * term.c: Likewise.
6860 * w32fns.c: Likewise.
6861 * w32font.c: Likewise.
6862 * w32term.c: Likewise.
6863 * xfaces.c: Likewise.
6864 * xfns.c: Likewise.
6865 * xterm.c: Likewise.
6866 * atimer.c: Omit needless casts.
6867 * buffer.c: Likewise.
6868 * callproc.c: Likewise.
6869 * ccl.c: Likewise.
6870 * coding.c: Likewise.
6871 * composite.c: Likewise.
6872 * doc.c: Likewise.
6873 * doprnt.c: Likewise.
6874 * editfns.c: Likewise.
6875 * emacs.c: Likewise.
6876 * eval.c: Likewise.
6877 * filelock.c: Likewise.
6878 * fns.c: Likewise.
6879 * gtkutil.c: Likewise.
6880 * keyboard.c: Likewise.
6881 * lisp.h: Likewise.
6882 * lread.c: Likewise.
6883 * minibuf.c: Likewise.
6884 * msdos.c: Likewise.
6885 * print.c: Likewise.
6886 * process.c: Likewise.
6887 * region-cache.c: Likewise.
6888 * search.c: Likewise.
6889 * sysdep.c: Likewise.
6890 * termcap.c: Likewise.
6891 * terminal.c: Likewise.
6892 * tparam.c: Likewise.
6893 * w16select.c: Likewise.
6894 * w32.c: Likewise.
6895 * w32reg.c: Likewise.
6896 * w32select.c: Likewise.
6897 * w32uniscribe.c: Likewise.
6898 * widget.c: Likewise.
6899 * xdisp.c: Likewise.
6900 * xmenu.c: Likewise.
6901 * xrdb.c: Likewise.
6902 * xselect.c: Likewise.
6903
0497dc44
PE
69042012-07-05 Paul Eggert <eggert@cs.ucla.edu>
6905
6906 * fileio.c (time_error_value): Check the right error number.
6907 Problem reported by Troels Nielsen in
6908 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
6909
356e7178
PE
69102012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6911
4e71fd89
PE
6912 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
6913 This should be fixed in a better way; see Eli Zaretskii in
6914 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
6915 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
6916
f0941253
PE
6917 * fileio.c (time_error_value): Rename from special_mtime.
6918 The old name's problems were noted by Eli Zaretskii in
6919 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
6920
065c9eb4
PE
6921 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
6922 This variable's comment says Emacs needs at least one GDB-visible
6923 symbol of type enum pvec_type, to work around GDB problems.
6924 The symbol's value doesn't matter.
6925
356e7178
PE
6926 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
6927 that causes compilation to fail on pre-C99 compilers.
6928
ed9265fc 69292012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
6930
6931 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
6932 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
6933
3884d954
DA
69342012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6935
d209e2fb 6936 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
6937 headers for buffer_defaults and buffer_local_symbols.
6938 Reported by Juanma Barranquero <lekktu@gmail.com>.
6939
ee28be33
SM
69402012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6941
6942 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
6943 * lisp.h (enum pvec_type): Use fewer bits.
6944 (PSEUDOVECTOR_SIZE_BITS): New constant.
6945 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
6946 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
6947 change in pvec_type.
6948 (PSEUDOVECTOR_TYPEP): New macro.
6949 (TYPED_PSEUDOVECTORP): Use it.
6950 * fns.c (internal_equal): Adapt code to extract pvectype.
6951 * emacs.c (gdb_pvec_type): Update type.
6952 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
6953 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
6954 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
6955 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
6956 (sweep_vectors): Use it. Use local var `total_bytes' instead of
6957 abusing vector->header.next.nbytes.
6958 (live_vector_p): Use PVEC_TYPE.
6959 (mark_object): Adapt code to extract pvectype. Use switch.
6960
c7f2cd7f
PE
69612012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6962
6963 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
6964 Tighten new eassert a bit.
6965
8ce70ed2
DA
69662012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6967
6968 Fix compilation with --enable-gcc-warnings and -O1
6969 optimization level.
6970 * doprnt.c (doprnt): Change type of tem to int, initialize
6971 to avoid compiler warning. Add eassert.
6972 * search.c (simple_search): Initialize match_byte to avoid
6973 compiler warning. Add eassert.
6974
dea7f1e5
PE
69752012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6976
24a212eb
PE
6977 Avoid weird behavior with large horizontal scrolls.
6978 Without this change, for example, large hscroll values would
6979 mess up Emacs's display on Fedora 15 x86, presumably due to
6980 overflows in int calculations in the display code.
6981 Also, if buffers had long lines, Emacs would freeze.
6982 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
6983 (set_window_hscroll): New function, containing the old guts of
6984 Fset_window_hscroll. Return the clipped value.
6985 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
6986 This avoids the need to check against PTRDIFF_MAX.
6987
dea7f1e5
PE
6988 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
6989
76046526
DA
69902012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
6991
6992 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
6993
39adff0d
PE
69942012-07-04 Paul Eggert <eggert@cs.ucla.edu>
6995
63807d47
PE
6996 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
6997 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
6998 since GCC 4.4.6 issues a bogus warning for them.
6999
39adff0d
PE
7000 Fix bugs in file timestamp newness comparisons.
7001 * fileio.c (Ffile_newer_than_file_p):
7002 * lread.c (Fload): Use full timestamp resolution of files,
7003 not just the 1-second resolution, so that files that are only
7004 slightly newer still count as newer.
7005 * fileio.c (Ffile_newer_than_file_p): Don't assume file
7006 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
7007
dbeed9a6
PE
70082012-07-03 Paul Eggert <eggert@cs.ucla.edu>
7009
7010 * fileio.c: Improve handling of file time marker. (Bug#11852)
7011 (special_mtime): New function.
7012 (Finsert_file_contents, Fverify_visited_file_modtime):
7013 Use it to set special mtime values consistently.
7014
636334d6
AS
70152012-07-03 Andreas Schwab <schwab@linux-m68k.org>
7016
7017 * fileio.c (Finsert_file_contents): Properly handle st_mtime
7018 marker for non-existing file. (Bug#11852)
7019
e2017fe2
GM
70202012-07-03 Glenn Morris <rgm@gnu.org>
7021
7022 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
7023 and did not make it into globals.h).
7024
404dbd37
TT
70252012-07-03 Tom Tromey <tromey@redhat.com>
7026
7027 * window.c (Fset_window_margins, Fset_window_fringes)
7028 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
7029 * textprop.c (Fprevious_property_change): No longer static.
7030 * syntax.c (Fsyntax_table_p): No longer static.
7031 * process.c (Fget_process, Fprocess_datagram_address): No longer
7032 static.
7033 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
7034 * keyboard.c (Fcommand_execute): No longer static.
7035 Remove EXFUN.
7036 * insdel.c (Fcombine_after_change_execute): No longer static.
7037 * image.c (Finit_image_library): No longer static.
7038 * fileio.c (Fmake_symbolic_link): No longer static.
7039 * eval.c (Ffetch_bytecode): No longer static.
7040 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
7041 * doc.c (Fdocumentation_property, Fsnarf_documentation):
7042 No longer static.
404dbd37
TT
7043 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
7044 static.
7045 * dired.c (Ffile_attributes): No longer static.
7046 * composite.c (Fcomposition_get_gstring): No longer static.
7047 * callproc.c (Fgetenv_internal): No longer static.
7048
7049 * ccl.h: Remove EXFUNs.
7050 * buffer.h: Remove EXFUNs.
7051 * dispextern.h: Remove EXFUNs.
7052 * intervals.h: Remove EXFUNs.
7053 * fontset.h: Remove EXFUN.
7054 * font.h: Remove EXFUNs.
7055 * dosfns.c (system_process_attributes): Remove EXFUN.
7056 * keymap.h: Remove EXFUNs.
7057 * lisp.h: Remove EXFUNs.
7058 * w32term.h: Remove EXFUNs.
7059 * window.h: Remove EXFUNs.
7060 * xsettings.h: Remove EXFUN.
7061 * xterm.h: Remove EXFUN.
7062
8e4fd1e1
GM
70632012-07-03 Glenn Morris <rgm@gnu.org>
7064
7065 * lisp.h (Frandom): Make it visible to C.
7066 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
7067 buffer for invisible buffers. (Bug#1229)
7068
ca95b3eb
DA
70692012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7070
7071 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
7072 values which aren't power of 2.
14ae4239 7073 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 7074 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
7075 accordingly.
7076
7555c33f
SM
70772012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
7078
7079 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
7080
7081 * alloc.c (mark_object): Revert part of last patch to use `switch'.
7082
d12e8f5a
DA
70832012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7084
7085 * alloc.c (allocate_vector_block): Remove redundant
7086 calls to mallopt if DOUG_LEA_MALLOC is defined.
7087 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
7088 avoid calls to mallopt if zero_vector is returned.
7089
296094c3
DA
70902012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7091
7092 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
7093 is enabled, avoid dereferencing NULL current_sblock if
7094 running undumped.
7095
36429c89
DA
70962012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
7097
7098 Cleanup basic buffer management.
7099 * buffer.h (struct buffer): Change layout to use generic vector
7100 marking code. Fix some comments. Change type of 'clip_changed'
7101 to bitfield. Remove unused #ifndef old.
7102 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
7103 (GET_OVERLAYS_AT): Fix indentation.
7104 (for_each_per_buffer_object_at): New macro.
7105 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
7106 (Fbuffer_local_variables): Use it.
7107 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
7108 * alloc.c (allocate_buffer): Adjust to match new layout of
7109 struct buffer. Fix comment.
7110 (mark_overlay): New function.
7111 (mark_buffer): Use it. Use mark_vectorlike to mark normal
7112 Lisp area of struct buffer.
7113 (mark_object): Use it. Adjust marking of misc objects
7114 and related comments.
7115
3b3e4cac
PE
71162012-07-02 Paul Eggert <eggert@cs.ucla.edu>
7117
7118 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
7119 wrapper that is not needed because the wrapped code is a no-op (zero
7120 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
7121 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
7122
cf5c0175
DA
71232012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
7124
7125 * alloc.c (mark_buffer): Simplify. Remove prototype.
7126 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 7127 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
7128 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
7129 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 7130
ca26824c
GM
71312012-06-30 Glenn Morris <rgm@gnu.org>
7132
2e4c5312
GM
7133 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
7134
ca26824c
GM
7135 * epaths.in (PATH_SITELOADSEARCH): New.
7136 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
7137 This is rather than relying on --enable-locallisppath elements
7138 having "site-lisp" in their names. (Bug#10208#25, 11658)
7139
0d23c240
EZ
71402012-06-30 Eli Zaretskii <eliz@gnu.org>
7141
c9240d7a
EZ
7142 * w32proc.c (sys_select): Accept and ignore one more argument.
7143
7144 * w32.c (emacs_gnutls_pull): Call select with one more argument.
7145
0d23c240 7146 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 7147 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
7148
7149 * sysdep.c: Don't include dos.h and dosfns.h.
7150
7151 * process.c (sys_select):
7152 * msdos.c (sys_select): Accept one more argument and ignore it.
7153
7154 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
7155 adapt data types and code to that.
7156
7157 * dosfns.c:
7158 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
7159 which clashes with the gnulib function of the same name.
7160
af5a5a98
AS
71612012-06-30 Andreas Schwab <schwab@linux-m68k.org>
7162
c5e4379c
AS
7163 * font.c (font_style_to_value, font_style_symbolic)
7164 (font_prop_validate_style): Add type checks for values in
7165 font_style_table.
7166
af5a5a98
AS
7167 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
7168 argument.
7169 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
7170 uses.
7171
8d38f461
EZ
71722012-06-29 Eli Zaretskii <eliz@gnu.org>
7173
2e5a6631
EZ
7174 * xdisp.c (try_window_id): Undo last change.
7175
8d38f461
EZ
7176 * w32.c (getwd): Adjust commentary about startup_dir.
7177 (init_environment): Always call sys_access, even in non-MSVC
7178 builds. Don't chdir to the directory of the Emacs executable.
7179 This undoes code from 1997 which was justified by the need to
7180 "avoid conflicts when removing and renaming directories". But its
7181 downside was that every relative file name was being interpreted
7182 relative to the directory of the Emacs executable, which can never
7183 be TRT. In particular, it broke sys_access when called with
7184 relative file names.
7185 (sys_access): Map GetLastError to errno.
7186
2af3565e
DA
71872012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7188
7189 * window.h (struct window): Change type of 'fringes_outside_margins'
7190 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 7191 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
7192 Adjust comment.
7193 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
7194 to ptrdiff_t.
7195
c8d3a25c 71962012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 7197
c8d3a25c
GM
7198 * gnutls.c (emacs_gnutls_handshake):
7199 Add QUIT to make the loop interruptible.
57570cd3 7200
c8d3a25c 72012012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 7202
c8d3a25c
GM
7203 * charset.c (init_charset): Make lack of etc/charsets fatal.
7204
3e984ee8
DA
72052012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7206
7207 * editfns.c (region_limit): Fix type mismatch.
7208
ef884f23
DA
72092012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
7210
7211 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
7212 undefined. Convert from xassert to eassert.
7213 * nsmenu.m: Convert from xassert to eassert.
7214 * nsterm.m: Likewise.
7215
7d7e0027
SM
72162012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
7217
7218 * editfns.c (region_limit): Clip to narrowing (bug#11770).
7219
aa754e6a
PE
72202012-06-28 Paul Eggert <eggert@cs.ucla.edu>
7221
7222 Avoid integer overflow on scroll-left and scroll-right.
7223 * window.c (HSCROLL_MAX): New macro.
7224 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
7225 overflow when requested scroll falls outside ptrdiff_t range.
7226
80b00b08
DA
72272012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7228
7229 * window.h (struct window): Change type of 'hscroll',
7230 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
7231 'last_modified' and 'last_overlay_modified' to EMACS_INT.
7232 Adjust users accordingly.
7233 * xdisp.c (try_cursor_movement): Replace type check with eassert.
7234 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
7235 from EMACS_INT to ptrdiff_t.
7236 (make_window): Omit redundant initialization.
7237
62b2bcf6
JB
72382012-06-28 Juanma Barranquero <lekktu@gmail.com>
7239
7240 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
7241
45942c7d
DA
72422012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7243
7244 * window.h (struct window): Change type of 'use_time' and
7245 'sequence_number' from Lisp_Object to int.
7246 * frame.c (make_frame): Adjust users accordingly.
7247 * print.c (print_object): Likewise.
7248 * window.c (select_window, Fwindow_use_time, make_parent_window)
7249 (make_window): Likewise.
7250
e509cfa6
DA
72512012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7252
7253 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
7254 enabled with --enable-checking=[all,glyphs] configure option.
7255 Fix GLYPH_DEBUG usage assuming that it may be undefined,
7256 adjust comments accordingly.
7257 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
7258 undefined, adjust comments accordingly.
7259 * image.c: Likewise.
7260 * scroll.c: Likewise.
7261 * w32fns.c: Likewise.
7262 * w32term.c: Likewise.
7263 * xdisp.c: Likewise.
7264 * xfaces.c: Likewise.
7265 * xfns.c: Likewise.
7266 * xterm.c: Likewise.
7267
a54e2c05
DA
72682012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
7269
7270 Generalize run-time debugging checks.
7271 * dispextern.h (XASSERTS): Remove.
7272 * fontset.c (xassert): Remove.
7273 Convert from xassert to eassert.
7274 * alloc.c: Convert from xassert to eassert.
7275 * bidi.c: Likewise.
7276 * dispnew.c: Likewise.
7277 * fns.c: Likewise.
7278 * fringe.c: Likewise.
7279 * ftfont.c: Likewise.
7280 * gtkutil.c: Likewise.
7281 * image.c: Likewise.
7282 * keyboard.c: Likewise.
7283 * menu.c: Likewise.
7284 * process.c: Likewise.
7285 * scroll.c: Likewise.
7286 * sound.c: Likewise.
7287 * term.c: Likewise.
7288 * w32console.c: Likewise.
7289 * w32fns.c: Likewise.
7290 * w32term.c: Likewise.
7291 * window.c: Likewise.
7292 * xdisp.c: Likewise.
7293 * xfaces.c: Likewise.
7294 * xfns.c: Likewise.
7295 * xselect.c: Likewise.
7296 * xterm.c: Likewise.
7297
1ec4b7b2
SM
72982012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
7299
7300 * fns.c (maybe_resize_hash_table): Output message when growing the
7301 purify-hashtable.
7302
2014308a
DA
73032012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7304
7305 * alloc.c (allocate_string_data): Remove dead code.
7306 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
7307 avoid GCC warning about unused macro.
7308
246155eb
DA
73092012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7310
7311 * alloc.c (allocate_string): Omit intervals initialization.
7312 * alloc.c (make_uninit_multibyte_string): Initialize intervals
7313 as in make_pure_string and make_pure_c_string.
7314
43184b7b
DA
73152012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7316
d209e2fb 7317 * alloc.c (allocate_string): Fix last change.
43184b7b 7318
3fe6dd74
DA
73192012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
7320
d209e2fb 7321 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
7322 to memset, add explicit initialization where appropriate.
7323
1ba6038a
GM
73242012-06-27 Glenn Morris <rgm@gnu.org>
7325
7326 * lisp.mk (lisp): Remove paths.elc.
7327
c89926a5
CY
73282012-06-27 Chong Yidong <cyd@gnu.org>
7329
7330 * doc.c (Fsubstitute_command_keys): Fix punctuation.
7331
ed6b3510
JW
73322012-06-26 John Wiegley <johnw@newartisans.com>
7333
1ec4b7b2 7334 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
7335 on Mac OS X Lion: __mod_init_func and __mod_term_func.
7336
ed6b3510
JW
7337 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
7338 when building with Clang.
7339
8edd4a2b
SM
73402012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
7341
7342 * eval.c (Fapply): Allow calling it with a single argument.
7343
f6f62d1b
EZ
73442012-06-26 Eli Zaretskii <eliz@gnu.org>
7345
7346 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
7347 _stricmp and _strnicmp.
7348 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
7349
62efea5e
DA
73502012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7351
7352 * alloc.c (allocate_window): Zero out non-Lisp part of newly
7353 allocated window.
7354 (allocate_process): Likewise for new process.
8edd4a2b 7355 (allocate_terminal): Change to use offsetof.
62efea5e
DA
7356 (allocate_frame): Likewise.
7357 * frame.c (make_frame): Omit redundant initialization.
7358 * window.c (make_parent_window): Use memset.
7359 (make_window): Omit redundant initialization.
7360 * process.c (make_process): Omit redundant initialization.
7361 * terminal.c (create_terminal): Likewise.
7362
42997f4d
DA
73632012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7364
7365 * term.c (delete_tty): Remove redundant call to memset.
7366
1130ecfc
DA
73672012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
7368
7369 * alloc.c: Remove build_string.
7370 * lisp.h: Define build_string as static inline. This provides
7371 a better opportunity to optimize away calls to strlen when the
7372 function is called with compile-time constant argument.
7373 * image.c (imagemagick_error): Convert to build_string.
7374 * w32proc.c (sys_spawnve): Likewise.
7375 * xterm.c (x_term_init): Likewise.
7376
cf38a720
PE
73772012-06-26 Paul Eggert <eggert@cs.ucla.edu>
7378
99027bdd
PE
7379 Use sprintf return value instead of invoking strlen on result.
7380 In the old days this wasn't portable, since some sprintf
7381 implementations returned char *. But they died out years ago and
7382 Emacs already assumes sprintf returns int.
7383 Similarly for float_to_string.
7384 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
7385 * ccl.c (ccl_driver):
7386 * character.c (string_escape_byte8):
7387 * data.c (Fnumber_to_string):
7388 * doprnt.c (doprnt):
7389 * print.c (print_object):
7390 * xdisp.c (message_dolog):
7391 * xfns.c (syms_of_xfns):
7392 Use sprintf or float_to_string result to avoid need to call strlen.
7393 * data.c (Fnumber_to_string):
7394 Use make_unibyte_string, since the string must be ASCII.
7395 * lisp.h, print.c (float_to_string): Now returns int length.
7396 * term.c (produce_glyphless_glyph):
7397 Use sprintf result rather than recomputing it.
7398
cf38a720
PE
7399 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
7400 * Makefile.in (ALL_CFLAGS):
7401 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
7402 * gmalloc.c, regex.c: Include <config.h> unconditionally.
7403
3511c784
DA
74042012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7405
0a08eb21 7406 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
7407 strcasecmp if available.
7408 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
7409
fb7da12e
AS
74102012-06-25 Andreas Schwab <schwab@linux-m68k.org>
7411
7412 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
7413 Avoid comma operator.
7414 * menu.c (push_submenu_start, push_submenu_end)
7415 (push_left_right_boundary, push_menu_pane): Likewise.
7416 * msdos.c (dos_rawgetc): Likewise.
7417
afa2ffd8
DA
74182012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7419
7420 * xfns.c (xic_create_fontsetname): Remove redundant calls
7421 to memset.
7422
b3b4476b
PE
74232012-06-25 Paul Eggert <eggert@cs.ucla.edu>
7424
4495ff38
PE
7425 * gtkutil.c (get_utf8_string): Remove redundant assignment.
7426 sprintf already null-terminates its output.
7427
b3b4476b
PE
7428 * xfns.c (x_window): Remove redundant cast.
7429
b00876c9
DA
74302012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
7431
7432 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
7433 `const char *' to `char *' to avoid compiler warning.
7434
d188e26b
PE
74352012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7436
885d1d74
PE
7437 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
7438 instead of truncating it to 63 (admittedly a generous limit).
7439
d188e26b
PE
7440 * process.c: Fix spelling and caps in comments.
7441
e2f560b1
DN
74422012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
7443
e86db54b 7444 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
7445 * sysdep.c (setpgrp): Remove definition, not used in this file.
7446
7583a3a1
JB
74472012-06-24 Juanma Barranquero <lekktu@gmail.com>
7448
7449 * makefile.w32-in: Update dependencies.
7450
696056c2
EZ
74512012-06-24 Eli Zaretskii <eliz@gnu.org>
7452
7453 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
7454 (SYSTIME_H): Add nt/inc/sys/time.h.
7455
7456 * systime.h [WINDOWSNT]: Include sys/time.h.
7457
7458 * s/ms-w32.h (struct timespec): Definition moved from
7459 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
7460
845ca893
PE
74612012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7462
7463 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
7464 * buffer.h (buffer_slot_type_mismatch):
7465 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7466 * eval.c (unwind_to_catch):
7467 * image.c (my_png_error, my_error_exit):
7468 * keyboard.c (quit_throw_to_read_char, user_error)
7469 (Fexit_recursive_edit, Fabort_recursive_edit):
7470 * lisp.h (die, args_out_of_range, args_out_of_range_3)
7471 (wrong_type_argument, buffer_overflow, __executable_start)
7472 (memory_full, buffer_memory_full, string_overflow, Fthrow)
7473 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
7474 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
7475 (fatal):
7476 (child_setup) [!DOS_NT]:
7477 * lread.c (end_of_file_error, invalid_syntax):
7478 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
7479 * puresize.h (pure_write_error):
7480 * search.c (matcher_overflow):
7481 * sound.c (sound_perror, alsa_sound_perror):
7482 * sysdep.c, syssignal.h (croak):
7483 * term.c (maybe_fatal, vfatal):
7484 * textprop.c (text_read_only):
7485 * undo.c (user_error):
7486 * unexmacosx.c (unexec_error):
7487 * xterm.c (x_ins_del_lines, x_delete_glyphs):
7488 Use _Noreturn rather than NO_RETURN.
7489 No need for separate decl merely because of _Noreturn.
7490 * sound.c (sound_warning, parse_sound):
7491 Remove unnecessary forward decls.
7492
f1dd8073
PE
74932012-06-24 Paul Eggert <eggert@cs.ucla.edu>
7494
7495 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
7496 * lisp.h (WAIT_READING_MAX): New macro.
7497 * dispnew.c (Fsleep_for, sit_for):
7498 * keyboard.c (kbd_buffer_get_event):
7499 * process.c (Faccept_process_output):
7500 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
7501 This improves on the previous patch, which introduced a bug
7502 when time_t is unsigned and as wide as intmax_t.
7503 See <http://bugs.gnu.org/9000#51>.
7504
b82c1755
EZ
75052012-06-23 Eli Zaretskii <eliz@gnu.org>
7506
7507 * dispnew.c (sit_for, Fsleep_for):
7508 * keyboard.c (kbd_buffer_get_event):
7509 * process.c (Faccept_process_output): Avoid compiler warnings when
7510 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
7511
ca300656
JB
75122012-06-23 Juanma Barranquero <lekktu@gmail.com>
7513
049ec95b
JB
7514 * makefile.w32-in: Update dependencies.
7515
ca300656
JB
7516 * w32.c (ltime): Add return type and declare static.
7517 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
7518
db7b8d06
PE
75192012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7520
7521 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
7522 Privately reported by Herbert J. Skuhra.
7523 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
7524 All uses changed.
7525 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
7526 not make_lisp_timeval, when the argument is of type EMACS_TIME.
7527
0bd8297f
EZ
75282012-06-23 Eli Zaretskii <eliz@gnu.org>
7529
96512555
EZ
7530 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
7531 last argument of make_unibyte_string.
7532
0bd8297f
EZ
7533 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
7534 language ID in the event parameters.
7535
7536 * w32term.c (w32_read_socket): Put the new keyboard codepage into
7537 event.code, not the obscure "character set ID".
7538
63def6b6
CY
75392012-06-23 Chong Yidong <cyd@gnu.org>
7540
7541 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
7542
e8a02204
EZ
75432012-06-23 Eli Zaretskii <eliz@gnu.org>
7544
388cdec0
EZ
7545 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
7546 * w32.c (fdutimens): New function.
7547
7548 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
7549
7550 * s/ms-w32.h (pselect): Redirect to sys_select.
7551
7552 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
7553
e8a02204
EZ
7554 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
7555 in the logic of incrementing and decrementing the value of
7556 use_relocatable_buffers.
7557
d054f3fb
PE
75582012-06-23 Paul Eggert <eggert@cs.ucla.edu>
7559
7560 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
7561 Privately reported by Herbert J. Skuhra.
7562 [__FreeBSD__]: Remove "*/" typo after "#include".
7563 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
7564 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
7565 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
7566 Don't assume EMACS_TIME and struct timeval are the same type.
7567
d35af63c
PE
75682012-06-22 Paul Eggert <eggert@cs.ucla.edu>
7569
7570 Support higher-resolution time stamps (Bug#9000).
7571 The time stamps are only nanosecond-resolution at the C level,
7572 since that's the best that any real-world system supports now.
7573 But they are picosecond-resolution at the Lisp level, as that's
7574 easy, and leaves room for future OS improvements.
7575
7576 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
7577 (LIBES): Use it.
7578
7579 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
7580 Don't get current time unless it's needed.
7581
7582 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
7583 now provides it if it's absent.
7584 (start_atimer): Port to higher-res time stamps.
7585 Check for time stamp overflow. Don't get current time more
7586 often than is needed.
7587
7588 * buffer.h (struct buffer): Buffer modtime now has high resolution.
7589 Include systime.h, not time.h.
7590 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
7591
7592 * dired.c: Include stat-time.h.
7593 (Ffile-attributes): File times now have higher resolution.
7594
7595 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
7596 (struct image): Timestamp now has higher resolution.
7597
7598 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
7599 has at least microseconds now. All uses removed.
7600 (update_frame, update_single_window, update_window, update_frame_1)
7601 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 7602 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
7603
7604 * editfns.c (time_overflow): Now extern.
7605 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
7606 (float-time, Fformat_time_string, Fcurrent_time_string)
7607 (Fcurrent_time_zone): Accept and generate higher-resolution
7608 time stamps.
7609 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
7610 (decode_time_components, lisp_seconds_argument): New functions.
7611 (make_time): Now static.
7612 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
7613 Report an error if the time is invalid, rather than having the caller
7614 do that.
7615
7616 * fileio.c: Include <stat-time.h>
7617 (Fcopy_file): Copy higher-resolution time stamps.
7618 Prefer to set the time stamp via a file descriptor if that works.
7619 (Fset_file_times, Finsert_file_contents, Fwrite_region)
7620 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
7621 (Fvisited_file_modtime, Fset_visited_file_modtime):
7622 Support higher-resolution time stamps.
7623
7624 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
7625
7626 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
7627
7628 * image.c (prepare_image_for_display, clear_image_cache)
7629 (lookup_image): Port to higer-resolution time stamps.
7630
7631 * keyboard.c (start_polling, bind_polling_period):
7632 Check for time stamp overflow.
7633 (read_char, kbd_buffer_get_event, timer_start_idle)
7634 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
7635 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
7636 Port to higher-resolution time stamps. Do not assume time_t is signed.
7637 (decode_timer): New function. Timers are now vectors of length 9,
7638 not 8, to accommodate the picosecond component.
7639 (timer_check_2): Use it.
7640
7641 * nsterm.m (select_timeout, timeval_subtract): Remove.
7642 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
7643 as they're a bit more accurate and handle overflow better.
7644 (ns_select): Change prototype to be compatible with pselect.
7645 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
7646 * nsterm.h (ns_select): Adjust prototype.
7647
7648 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
7649 us-resolution time stamps.
7650 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
7651
7652 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
7653
7654 * lisp.h (time_overflow): New decl.
7655 (wait_reading_process_output): First arg is now intmax_t, not int,
7656 to accommodate larger waits.
7657
7658 * process.h (struct Lisp_Process.read_output_delay):
7659 Now counts nanoseconds, not microseconds.
7660 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
7661 EMACS_HAS_USECS.
7662 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
7663 (wait_reading_process_output):
7664 Port to ns-resolution time stamps.
7665 (Faccept_process_output, wait_reading_process_output):
7666 Check for time stamp overflow. Do not assume time_t is signed.
7667 (select_wrapper): Remove; we now use pselect.
7668 (Fprocess_attributes): Now generates ns-resolution time stamps.
7669
7670 * sysdep.c: Include utimens.h. Don't include utime.h
7671 or worry about struct utimbuf; gnulib does that for us now.
7672 (gettimeofday): Remove; gnulib provides a substitute.
7673 (make_timeval): New function.
7674 (set_file_times): Now sets ns-resolution time stamps.
7675 New arg FD; all uses changed.
7676 (time_from_jiffies, ltime_from_jiffies, get_up_time)
7677 (system_process_attributes):
7678 Now returns ns-resolution time stamp. All uses changed.
7679 Check for time stamp overflow.
7680
7681 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
7682 provides a substitute now.
7683
7684 * systime.h: Include timespec.h rather than sys/time.h and time.h,
7685 since it guarantees struct timespec.
7686 (EMACS_TIME): Now struct timespec, so that we can support
7687 ns-resolution time stamps.
7688 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
7689 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
7690 (EMACS_USECS): Remove.
7691 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
7692 so multiply the arg by 1000 before storing it.
7693 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
7694 New macros.
7695 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
7696 Port to ns-resolution time stamps.
7697 (EMACS_TIME_NEG_P): Remove; replaced by....
7698 (EMACS_TIME_SIGN): New macro.
7699 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
7700 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
7701 (set_file_times, make_time, lisp_time_argument): Adjust signature.
7702 (make_timeval, make_lisp_time, decode_time_components): New decls.
7703 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
7704 that it mishandled time_t overflow. You can't compare by subtracting!
7705 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
7706 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
7707
7708 * term.c: Include <sys/time.h>.
7709 (timeval_to_Time): New function, for proper overflow wraparound.
7710 (term_mouse_position, term_mouse_click): Use it.
7711
7712 * undo.c (record_first_change): Support higher-resolution time stamps
7713 in the undo buffer.
7714 (Fprimitive_undo): Use them when restoring time stamps.
7715
7716 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
7717 (w32_get_internal_run_time):
7718 Port to higher-resolution Emacs time stamps.
7719 (ltime): Now accepts single 64-bit integer, as that's more convenient
7720 for callers.
7721
7722 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
7723
7724 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
7725 for compatibility with pselect. Support ns-resolution time stamps.
7726
7727 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
7728
7729 * xselect.c (wait_for_property_change, x_get_foreign_selection):
7730 Check for time stamp overflow, and support ns-resolution time stamps.
7731
7732 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
7733 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
7734 (timeval_subtract): Remove; no longer needed.
7735 (XTflash, XTring_bell, x_wait_for_event):
7736 Port to ns-resolution time stamps. Don't assume time_t is signed.
7737
b6a92dfe
CY
77382012-06-22 Chong Yidong <cyd@gnu.org>
7739
7740 * xdisp.c (x_consider_frame_title): Revert last change.
7741
d251c37c
EZ
77422012-06-22 Eli Zaretskii <eliz@gnu.org>
7743
7744 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
7745 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
7746 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
7747 staticidx goes up to 1597 out of 1600 = 0x640.)
7748
f10deafb
PE
77492012-06-20 Paul Eggert <eggert@cs.ucla.edu>
7750
7751 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
7752 Otherwise, the umask might be mistakenly 0 while handling input signals.
7753
ec6de1e2
SM
77542012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
7755
7756 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
7757
28be1ada
DA
77582012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
7759
7760 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
7761 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
7762 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
7763 access to `contents' member of Lisp_Vector objects with AREF and ASET
7764 where appropriate.
7765
c6bf3022
CY
77662012-06-19 Chong Yidong <cyd@gnu.org>
7767
7768 * frame.c (delete_frame): When selecting a frame on a different
7769 text terminal, do not alter the terminal's top-frame.
7770
7771 * xdisp.c (format_mode_line_unwind_data): Record the target
7772 frame's selected window and its terminal's top-frame.
7773 (unwind_format_mode_line): Restore them.
7774 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
7775 Callers changed.
7776 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
7777 since tty frames can be explicitly named.
7778 (prepare_menu_bars): Likewise.
7779
7780 * term.c (Ftty_top_frame): New function.
7781
defd4196
PE
77822012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7783
7784 Port byte-code-meter to modern targets.
7785 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
7786 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 7787 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
7788 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
7789 (METER_1, METER_2): Simplify.
7790
1053a871
SM
77912012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
7792
7793 * data.c (Fdefalias): Return `symbol' (bug#11686).
7794
b7e8d081
MR
77952012-06-18 Martin Rudalics <rudalics@gmx.at>
7796
7797 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
7798 gets killed during executing of this function (Bug#11665).
7799 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
7800 (Vkill_buffer_query_functions): In doc-string say that functions
7801 run by this hook should not change the current buffer.
7802
7ea2b339
PE
78032012-06-18 Paul Eggert <eggert@cs.ucla.edu>
7804
7805 Fix recently-introduced process.c problems found by static checking.
7806 * process.c (write_queue_push, write_queue_pop, send_process):
7807 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
7808 (write_queue_pop): Fix pointer signedness problem.
7809 (send_process): Remove unused local.
7810
96a313a1
CY
78112012-06-17 Chong Yidong <cyd@gnu.org>
7812
7813 * xdisp.c (redisplay_internal): No need to redisplay terminal
7814 frames that are not on top.
7815
20ca2e94
TN
78162012-06-17 Troels Nielsen <bn.troels@gmail.com>
7817
7818 * process.c (make_process): Initialize write_queue.
7819 (write_queue_push, write_queue_pop): New functions.
7820 (send_process): Use them to maintain correct ordering of process
7821 writes (Bug#10815).
7822
9a900ca9
PE
78232012-06-17 Paul Eggert <eggert@cs.ucla.edu>
7824
310fbfa8
PE
7825 * lisp.h (eassert): Assume C89 or later.
7826 This removes the need for CHECK.
7827 (CHECK): Remove. Its comments about always evaluating its
7828 argument were confusing, as 'eassert' typically does not evaluate
7829 its argument.
7830
27bb1ca4
PE
7831 * coding.c (produce_chars): Use ptrdiff_t, not int.
7832
9a900ca9
PE
7833 * xterm.c (x_draw_underwave): Check for integer overflow.
7834 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
7835
41b7f8bc 78362012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
7837
7838 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
7839 referenced (Bug#11583).
7840
9b0e3eba
AA
78412012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
7842
7843 Implement wave-style variant of underlining.
7844 * dispextern.h (face_underline_type): New enum.
7845 (face): Add field for underline type.
7846 * nsterm.m (ns_draw_underwave): New function.
7847 (ns_draw_text_decoration): Use it.
7848 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
7849 New functions.
7850 (x_draw_glyph_string): Use them.
7851 * xfaces.c (Qline, Qwave): New Lisp objects.
7852 (check_lface_attrs, merge_face_ref)
1053a871
SM
7853 (Finternal_set_lisp_face_attribute, realize_x_face):
7854 Handle wave-style underline face attributes.
9b0e3eba
AA
7855 * xterm.c (x_draw_underwave): New function.
7856 (x_draw_glyph_string): Use it.
7857
0fb52f11
JB
78582012-06-16 Juanma Barranquero <lekktu@gmail.com>
7859
7860 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
7861 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
7862 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
7863 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
7864 ($(BLD)/w32select.$(O)): Update dependencies.
7865
e5560ff7
AS
78662012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7867
7868 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
7869 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
7870 * character.c (_fetch_multibyte_char_p): Remove.
7871 * alloc.c: Include "character.h" before "buffer.h".
7872 * bidi.c: Likewise.
7873 * buffer.c: Likewise.
7874 * bytecode.c: Likewise.
7875 * callint.c: Likewise.
7876 * callproc.c: Likewise.
7877 * casefiddle.c: Likewise.
7878 * casetab.c: Likewise.
7879 * category.c: Likewise.
7880 * cmds.c: Likewise.
7881 * coding.c: Likewise.
7882 * composite.c: Likewise.
7883 * dired.c: Likewise.
7884 * dispnew.c: Likewise.
7885 * doc.c: Likewise.
7886 * dosfns.c: Likewise.
7887 * editfns.c: Likewise.
7888 * emacs.c: Likewise.
7889 * fileio.c: Likewise.
7890 * filelock.c: Likewise.
7891 * font.c: Likewise.
7892 * fontset.c: Likewise.
7893 * fringe.c: Likewise.
7894 * indent.c: Likewise.
7895 * insdel.c: Likewise.
7896 * intervals.c: Likewise.
7897 * keyboard.c: Likewise.
7898 * keymap.c: Likewise.
7899 * lread.c: Likewise.
7900 * macros.c: Likewise.
7901 * marker.c: Likewise.
7902 * minibuf.c: Likewise.
7903 * nsfns.m: Likewise.
7904 * nsmenu.m: Likewise.
7905 * print.c: Likewise.
7906 * process.c: Likewise.
7907 * regex.c: Likewise.
7908 * region-cache.c: Likewise.
7909 * search.c: Likewise.
7910 * syntax.c: Likewise.
7911 * term.c: Likewise.
7912 * textprop.c: Likewise.
7913 * undo.c: Likewise.
7914 * unexsol.c: Likewise.
7915 * w16select.c: Likewise.
7916 * w32fns.c: Likewise.
7917 * w32menu.c: Likewise.
7918 * window.c: Likewise.
7919 * xdisp.c: Likewise.
7920 * xfns.c: Likewise.
7921 * xmenu.c: Likewise.
7922 * xml.c: Likewise.
7923 * xselect.c: Likewise.
7924
2f07e6af
EZ
79252012-06-16 Eli Zaretskii <eliz@gnu.org>
7926
1053a871
SM
7927 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
7928 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 7929 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
7930 row.
7931 (handle_face_prop): Use chunk-relative overlay string index when
7932 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
7933 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
7934 the rightmost. (Bug#11720)
2f07e6af 7935
29b83cec
AS
79362012-06-16 Andreas Schwab <schwab@linux-m68k.org>
7937
7938 * category.h (CHAR_HAS_CATEGORY): Define as inline.
7939 (CATEGORY_MEMBER): Enforce 1/0 value.
7940 * category.c (_temp_category_set): Remove.
7941
4c5501e9
EZ
79422012-06-16 Eli Zaretskii <eliz@gnu.org>
7943
7944 * window.c (Fdelete_other_windows_internal)
7945 (Fdelete_window_internal): Don't access frame's mouse highlight
7946 info of the initial frame. (Bug#11677)
7947
2b570124
PE
79482012-06-14 Paul Eggert <eggert@cs.ucla.edu>
7949
e93864f9
PE
7950 * .gdbinit (xgetint): Fix recently-introduced paren typo.
7951 Assume USE_2_TAGS_FOR_INTS.
7952 (xreload): Adjust $tagmask width to match recent lisp.h change.
7953
2b570124
PE
7954 Simplify lisp.h in minor ways that should not affect code.
7955 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
7956 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
7957 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
7958 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
7959 (INTTYPEBITS): New macro, for clarity.
7960 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
7961 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
7962 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
7963 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
7964 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
7965
81755f69
JB
79662012-06-13 Juanma Barranquero <lekktu@gmail.com>
7967
7968 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
7969
16192a57
GM
79702012-06-13 Glenn Morris <rgm@gnu.org>
7971
7972 * s/bsd-common.h (BSD4_3):
7973 * s/usg5-4-common.h (USG5_4): No longer define; unused.
7974
646b5f55
AS
79752012-06-13 Andreas Schwab <schwab@linux-m68k.org>
7976
7977 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
7978 instead of union.
7979 (XLI, XIL): Define.
1053a871
SM
7980 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
7981 Use them.
7982 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 7983 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 7984 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
7985 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
7986 * frame.c (delete_frame): Remove outdated comment.
7987 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
7988 USE_LISP_UNION_TYPE.
7989 (Fw32_unregister_hot_key): Likewise.
7990 (Fw32_toggle_lock_key): Likewise.
7991 * w32menu.c (add_menu_item): Likewise.
7992 (w32_menu_display_help): Use XIL instead of checking
7993 USE_LISP_UNION_TYPE.
7994 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
7995 (init_heap): Likewise.
7996 * w32term.c (w32_read_socket): Update comment.
7997
1d3823c9
GM
79982012-06-13 Glenn Morris <rgm@gnu.org>
7999
c62ff706
GM
8000 * s/usg5-4-common.h, src/s/unixware.h:
8001 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
8002
1d3823c9
GM
8003 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
8004
bfe3e0a2
PE
80052012-06-13 Paul Eggert <eggert@cs.ucla.edu>
8006
8007 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
8008 * alloc.c (make_number) [!defined make_number]:
8009 Remove, as lisp.h always defines this now.
8010 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
8011 (roundup_size): Verify that it is a power of 2.
8012 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
8013 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
8014 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
8015 -DUSE_LSB_TAG=0, to override the automatically-selected default.
8016 USE_LSB_TAG now is always defined to be either 0 or 1.
8017 All uses changed.
8018 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
8019 code works fine either way, and efficiency is not a concern here,
8020 as the union type is for debugging, not for production.
8021 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
8022 Use an inline function on all platforms when using the union type,
8023 since this is simpler and 'static inline' can be used portably
8024 within Emacs now.
8025 (LISP_INITIALLY_ZERO): New macro.
8026 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
8027 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
8028
45fa9c0f
GM
80292012-06-12 Glenn Morris <rgm@gnu.org>
8030
b4492cba
GM
8031 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
8032
8033 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 8034
45fa9c0f
GM
8035 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
8036 Move BROKEN_SIGIO to configure.
8037
8038 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
8039 Move NO_TERMIO to configure.
8040
0e25d334
CY
80412012-06-12 Chong Yidong <cyd@gnu.org>
8042
8043 * image.c (imagemagick_load_image): Use MagickFlattenImage if
8044 MagickMergeImageLayers is undefined. Use pixel pusher loop if
8045 MagickExportImagePixels is undefined.
8046
43682bb6
PE
80472012-06-12 Paul Eggert <eggert@cs.ucla.edu>
8048
8049 * image.c (imagemagick_load_image): Remove unused label.
8050
a9be7d2b
GM
80512012-06-11 Glenn Morris <rgm@gnu.org>
8052
8053 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
8054 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
8055 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
8056 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
8057
3017f87f
SM
80582012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
8059
8060 * alloc.c (make_byte_code): New function.
8061 (Fmake_byte_code): Use it. Don't purify here.
8062 * lread.c (read1): Use it as well to avoid extra allocation.
8063
1b9b4cf4
CY
80642012-06-11 Chong Yidong <cyd@gnu.org>
8065
8066 * image.c (imagemagick_load_image): Implement transparency.
8067
95988fcf
AS
80682012-06-10 Andreas Schwab <schwab@linux-m68k.org>
8069
8070 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
8071 account for preceding backslashes. (Bug#11663)
8072
cd4eb164
CY
80732012-06-09 Chong Yidong <cyd@gnu.org>
8074
8075 * term.c: Support italics in capable terminals (Bug#9652).
8076 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
8077 (turn_on_face): Output using TS_enter_italic_mode if available.
8078 Don't handle unused blinking and alt-charset cases.
8079 (turn_off_face): Handle italic case; discard unused tty_blinking_p
8080 and tty_alt_charset_p cases.
8081 (tty_capable_p, init_tty): Support italics.
8082
8083 * termchar.h (struct tty_display_info): Add field for italics.
8084 Remove unused blink field.
8085
8086 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
8087 Handle slant.
8088
8089 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
8090 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
8091 tty_alt_charset_p. Add tty_italic_p.
8092
ff88beb8
MA
80932012-06-09 Michael Albinus <michael.albinus@gmx.de>
8094
8095 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
8096 dbus_type_is_basic if available.
8097 (xd_extract_signed, xd_extract_unsigned): Rename from
8098 extract_signed and extract_unsigned, respectively. Adapt callers.
8099
44286096
CY
81002012-06-09 Chong Yidong <cyd@gnu.org>
8101
1682701f
CY
8102 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
8103
44286096
CY
8104 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
8105 case (Bug#9752).
8106
d86feb17
PE
81072012-06-08 Paul Eggert <eggert@cs.ucla.edu>
8108
8109 * xdisp.c (vmessage): Treat frame message as multibyte.
8110 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
8111 would generate the diagnostic "Making \302\247 buffer-local while
8112 let-bound!".
8113
d5c20fe8
EZ
81142012-06-08 Eli Zaretskii <eliz@gnu.org>
8115
8116 * dispnew.c (showing_window_margins_p): Undo last change, which
8117 was done due to an inadvertent commit.
8118 (adjust_frame_glyphs_for_frame_redisplay): Do call
8119 showing_window_margins_p.
8120
513749ee
SM
81212012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8122
8123 * eval.c (Fmake_var_non_special): New primitive.
8124 (syms_of_eval): Defsubr it.
8125 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
8126
d4a8f5c1
JB
81272012-06-08 Juanma Barranquero <lekktu@gmail.com>
8128
8129 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
8130 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
8131
8bbbc977
EZ
81322012-06-08 Eli Zaretskii <eliz@gnu.org>
8133
8134 * alloc.c (allocate_vectorlike): Fix last change.
8135
f3372c87
DA
81362012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
8137
8138 Block-based vector allocation of small vectors.
8139 * lisp.h (struct vectorlike_header): New field `nbytes',
8140 adjust comment accordingly.
8141 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 8142 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
8143 mark_maybe_pointer, valid_lisp_object_p) accordingly.
8144 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
8145 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
8146 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
8147 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
8148 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
8149 (roundup_size): New constant.
8150 (struct vector_block): New data type.
8151 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 8152 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
8153 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
8154 (sweep_vectors): New functions.
8155 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 8156 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
8157 or equal to VBLOCK_BYTES_MAX.
8158 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
8159 (init_alloc_once): Add call to init_vectors.
8160
4f18a4ed
SM
81612012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
8162
8163 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
8164
86f158bc
PE
81652012-06-07 Paul Eggert <eggert@cs.ucla.edu>
8166
8167 * doprnt.c (doprnt): Truncate multibyte char correctly.
8168 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
8169 would mishandle a string argument "Xc" if X was a multibyte
8170 character of length 2: it would truncate after X's first byte
8171 rather than including all of X.
8172
c5cfcbe0
CY
81732012-06-06 Chong Yidong <cyd@gnu.org>
8174
8175 * buffer.c (word_wrap): Doc fix.
8176
c05cf390
PE
81772012-06-04 Paul Eggert <eggert@cs.ucla.edu>
8178
8179 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
8180
0c3461de
GM
81812012-06-03 Glenn Morris <rgm@gnu.org>
8182
8183 * xdisp.c (tool-bar-style): Doc fix.
8184
c71232db
UM
81852012-06-03 Ulrich Müller <ulm@gentoo.org>
8186
8187 * Makefile.in (PAXCTL): Define.
8188 (temacs$(EXEEXT)): Disable memory randomization for the temacs
8189 binary via PaX flags if the paxctl utility is available.
8190 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
8191 Restore PaX flags to their default. (Bug#11398)
8192
383f7350
CY
81932012-06-03 Chong Yidong <cyd@gnu.org>
8194
8195 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
8196 buffer (Bug#11226).
8197
5f2c76c6
CY
81982012-06-03 Chong Yidong <cyd@gnu.org>
8199
8200 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
8201 (note_mode_line_or_margin_highlight): If there is no help echo,
8202 use mode-line-default-help-echo. Handle the case where the mouse
8203 position is past the end of the mode line string.
8204
8205 * buffer.c (buffer_local_value_1): New function, split from
8206 Fbuffer_local_value; can return Qunbound.
8207 (Fbuffer_local_value): Use it.
8208 (Vmode_line_format): Docstring tweaks.
8209
773d47f6
PE
82102012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8211
8212 * sysdep.c (system_process_attributes): Improve comment.
8213
f2d6a3df
SM
82142012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
8215
8216 * keyboard.c: Export real-this-command to Elisp.
8217 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
8218 and DEFVAR it. Update all users.
8219
63810350
PE
82202012-06-02 Paul Eggert <eggert@cs.ucla.edu>
8221
7bd5c1f4
PE
8222 * minibuf.c (Fassoc_string): Remove duplicate declaration.
8223
63810350
PE
8224 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
8225 Convert pctcpu and pctmem to Lisp float properly.
8226 Let the compiler fold better, as 100.0/0x8000 is exact.
8227
a2821611
AS
82282012-06-02 Andreas Schwab <schwab@linux-m68k.org>
8229
8230 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
8231 cons_block.
8232
5fceba1d
PE
82332012-06-01 Paul Eggert <eggert@cs.ucla.edu>
8234
8235 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
8236
c98ff5dd
DA
82372012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
8238
8239 For a 'struct window', replace some Lisp_Object fields to
8240 bitfields where appropriate, remove unused fields.
8241 * window.h (struct window): Remove unused 'last_mark_x' and
8242 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 8243 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
8244 Change type of 'force_start', 'optional_new_start',
8245 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 8246 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 8247
ca34e0be
PE
82482012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8249
8250 Pacify gcc -Wdouble-precision when using Xaw.
8251 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
8252 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
8253 Use 'float' consistently, rather than 'float' in most places
8254 and 'double' in a couple of places.
8255
efc00ab1 82562012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
8257
8258 * xdisp.c (handle_stop): Detect whether we have overlay strings
8259 loaded by testing it->current.overlay_string_index to be
8260 non-negative, instead of checking whether n_overlay_strings is
8261 positive. (Bug#11587)
8262
efc00ab1 82632012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
8264
8265 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
8266
8267 * doc.c (Fsubstitute_command_keys): Doc fix.
8268
efc00ab1 82692012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
8270
8271 * search.c (search_buffer): Remove calls to
8272 r_alloc_inhibit_buffer_relocation, as it is now called by
8273 maybe_unify_char, which was the cause of relocation of buffer text
8274 in bug#11519.
8275
efc00ab1 82762012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
8277
8278 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
8279 for the duration of call to load_charset, to avoid problems with
8280 callers of maybe_unify_char that access buffer text through C
8281 pointers.
8282
8283 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
8284 decrement the inhibition flag, instead of just setting or
8285 resetting it.
8286
ba93a187
PE
82872012-05-31 Paul Eggert <eggert@cs.ucla.edu>
8288
8289 Remove obsolete '#define static' cruft.
8290 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
8291 This #undef was "temporary" in 2000; it is no longer needed
8292 now that '#define static' has gone away.
8293 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
8294 (gray_bitmap_bits): Remove; no longer needed.
8295 All uses replaced with definiens.
8296 * xterm.c: Include "bitmaps/gray.xbm".
8297
9e4bf381
PE
82982012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8299
8300 Clean up __executable_start, monstartup when --enable-profiling.
8301 The following changes affect the code only when profiling.
8302 * dispnew.c (__executable_start): Rename from safe_bcopy.
8303 Define only on platforms that need it.
8304 * emacs.c: Include <sys/gmon.h> when profiling.
8305 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
8306 (__executable_start): Remove decl, since lisp.h does it now.
8307 (safe_bcopy): Remove decl; no longer has that name.
8308 (main): Coalesce #if into single bit of code, for simplicity.
8309 Cast pointers to uintptr_t, since standard libraries want integers
8310 and not pointers.
8311 * lisp.h (__executable_start): New decl.
8312
32d72c2f
GM
83132012-05-31 Glenn Morris <rgm@gnu.org>
8314
8315 * image.c (Fimagemagick_types): Doc fix.
8316
baac5bc7
JM
83172012-05-30 Jim Meyering <meyering@redhat.com>
8318
8319 * callproc.c (Fcall_process_region): Include directory component
8320 in mkstemp error message (Bug#11586).
8321
72cb32cf
PE
83222012-05-30 Paul Eggert <eggert@cs.ucla.edu>
8323
8324 * alloc.c, lisp.h (make_pure_vector): Now static.
8325
61b108cc
SM
83262012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
8327
8328 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
8329 Move to byte-run.el.
8330 (Fautoload): Do the hash-doc more carefully.
8331 * data.c (Fdefalias): Purify definition, except for keymaps.
8332 (Qdefun): Move from eval.c.
8333 * lisp.h (Qdefun): Remove.
8334 * lread.c (read1): Tiny simplification.
8335
471fe23d
TN
83362012-05-29 Troels Nielsen <bn.troels@gmail.com>
8337
934f3f58 8338 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
8339 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
8340 Bug#9642, but explicitly check that the buffer the overlay would
8341 be moved to is live and rearrange lines to make sure that errors
8342 will not put the overlay in an inconsistent state.
8343 (Fdelete_overlay): Cosmetics.
8344
85d0efd1
EZ
83452012-05-28 Eli Zaretskii <eliz@gnu.org>
8346
8347 * w32term.c (my_bring_window_to_top): New function.
8348 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
8349 could be different from the original one.
8350 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
8351 (Bug#11513)
8352
8353 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
8354 by calling BringWindowToTop.
8355
8356 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
8357 (WM_EMACS_END): Increase by one.
8358
da92a98c
PE
83592012-05-28 Paul Eggert <eggert@cs.ucla.edu>
8360
8361 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
8362 This avoids undefined behavior that might cause the eassert
8363 to not catch an out-of-range value.
8364
74d1f848
JB
83652012-05-28 Juanma Barranquero <lekktu@gmail.com>
8366
8367 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
8368 Update dependencies.
8369
9e1a06fc
EZ
83702012-05-27 Eli Zaretskii <eliz@gnu.org>
8371
8372 * bidi.c (bidi_mirror_char): Fix last change.
8373
f3dd7312
AS
83742012-05-27 Andreas Schwab <schwab@linux-m68k.org>
8375
8376 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
8377 when referring to sectname field in printf format.
8378
81899c91
PE
83792012-05-27 Paul Eggert <eggert@cs.ucla.edu>
8380
57b81a9f
PE
8381 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
8382 Only r_alloc_inhibit_buffer_relocation needed to be added;
8383 the others were already declared.
8384
81899c91
PE
8385 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
8386 before checking whether it's out of range. Put the check inside
8387 eassert. See
8388 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
8389
33017faf 83902012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
8391
8392 * callproc.c (Fcall_process): Restore a line that was accidentally
8393 commented out in the 2011-02-13 change (bug#11547).
8394
33017faf 83952012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
8396
8397 * lisp.h [REL_ALLOC]: Add prototypes for external functions
8398 defined on ralloc.c.
8399
8400 * buffer.c [REL_ALLOC]: Remove prototypes of
8401 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
8402 they are now on lisp.h.
8403
8404 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
8405
8406 * search.c (search_buffer): Use it to inhibit relocation of buffer
8407 text while re_search_2 is doing its job, because re_search_2 is
8408 passed C pointers to buffer text. (Bug#11519)
8409
23415acf
EZ
8410 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
8411 Update value to 24.
8412
44e27368
EZ
8413 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
8414 state after an additional call to move_it_in_display_line_to, keep
8415 the values of it->max_ascent and it->max_descent found for the
8416 entire line.
8417 (pos_visible_p): Revert the comparison against bottom_y to what it
8418 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
8419 (Bug#11464)
8420
c1892f11
PE
84212012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8422
8423 Fix coding-related core dumps with gcc -ftrapv.
8424 The code was computing A - B, where A and B are pointers, and B is
8425 random garbage. This can lead to core dumps on platforms that
8426 have special pointer registers, and it also leads to core dumps on
8427 x86-64 when compiled with gcc -ftrapv. The fix is to compute
8428 A - B only when B is initialized properly.
8429 * coding.c (coding_set_source, coding_set_destination): Return void.
8430 (coding_change_source, coding_change_destinations): New functions,
8431 with the old behaviors of coding_set_source and coding_set_destination.
8432 All callers that need an offset changed to use these new functions.
8433
eb7afdad
GM
84342012-05-26 Glenn Morris <rgm@gnu.org>
8435
8436 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
8437
f12fdf02
EZ
84382012-05-26 Eli Zaretskii <eliz@gnu.org>
8439
53a63be6 8440 Extend mouse support on W32 text-mode console.
61b108cc
SM
8441 * xdisp.c (draw_row_with_mouse_face):
8442 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 8443
eb3f6f01 8444 * w32console.c: Include window.h.
61b108cc
SM
8445 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
8446 New functions.
eb3f6f01
EZ
8447 (initialize_w32_display): Initialize mouse-highlight data.
8448
53a63be6
EZ
8449 * w32inevt.c: Include termchar.h and window.h.
8450 (do_mouse_event): Support mouse-autoselect-window. When the mouse
8451 moves, call note_mouse_highlight. If help_echo changed, call
8452 gen_help_event to produce help-echo message in the echo area.
8453 Call clear_mouse_face if mouse_face_hidden is set in the mouse
8454 highlight info.
8455
4cfd81f6
PE
84562012-05-26 Paul Eggert <eggert@cs.ucla.edu>
8457
8458 * lread.c (read1): Simplify slightly to avoid an overflow warning
8459 with GCC 4.7.0 on x86-64.
8460
4446092a
EZ
84612012-05-26 Eli Zaretskii <eliz@gnu.org>
8462
8463 * bidi.c (bidi_mirror_char): Revert last change: an int is
8464 definitely wide enough here.
8465
42b2a986 84662012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 8467
42b2a986 8468 Fix integer width and related bugs (Bug#9874).
eb106a49 8469 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
8470 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
8471 (string_bytes, check_sblock, allocate_string_data):
8472 (compact_small_strings, Fmake_bool_vector, make_string)
8473 (make_unibyte_string, make_multibyte_string)
8474 (make_string_from_bytes, make_specified_string)
8475 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
8476 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
8477 (mark_vectorlike):
8478 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8479 (allocate_pseudovector):
8480 Use int, not EMACS_INT, where int is wide enough.
8481 (inhibit_garbage_collection, Fgarbage_collect):
8482 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8483 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
8484 int might not be wide enough.
8485 (bidi_cache_search, bidi_cache_find, bidi_init_it)
8486 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
8487 (bidi_at_paragraph_end, bidi_find_paragraph_start)
8488 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8489 (bidi_level_of_next_char, bidi_move_to_visually_next):
8490 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8491 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
8492 (Fkill_buffer, Fset_buffer_major_mode)
8493 (advance_to_char_boundary, Fbuffer_swap_text)
8494 (Fset_buffer_multibyte, overlays_at, overlays_in)
8495 (overlay_touches_p, struct sortvec, record_overlay_string)
8496 (overlay_strings, recenter_overlay_lists)
8497 (adjust_overlays_for_insert, adjust_overlays_for_delete)
8498 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
8499 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
8500 (Foverlay_recenter, last_overlay_modification_hooks_used)
8501 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
8502 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
8503 (validate_region): Omit unnecessary test for b <= e,
8504 since that's guaranteed by the previous test.
d311d28c
PE
8505 (adjust_overlays_for_delete): Avoid pos + length overflow.
8506 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
8507 (report_overlay_modification):
8508 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8509 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
8510 Omit pointer cast, which isn't needed anyway, and doesn't work
8511 after the EMACS_INT -> ptrdiff_t change.
02481186 8512 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
8513 * buffer.h: Adjust decls to match defn changes elsewhere.
8514 (struct buffer_text, struct buffer):
8515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8516 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
8517 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
8518 not int, to avoid needless 32-bit limit on 64-bit hosts.
8519 (exec_byte_code): Use tighter memory-full test, one that checks
8520 for alloca overflow. Don't compute the address of the object just
8521 before an array, as that's not portable. Use EMACS_INT, not
8522 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
8523 * callint.c (Fcall_interactively):
8524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8525 * callproc.c (call_process_kill, Fcall_process):
8526 Don't assume pid_t fits into an Emacs fixnum.
8527 (call_process_cleanup, Fcall_process, child_setup):
8528 Don't assume pid_t fits into int.
8529 (call_process_cleanup, Fcall_process, delete_temp_file)
8530 (Fcall_process_region):
8531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8532 (Fcall_process): Simplify handling of volatile integers.
8533 Use int, not EMACS_INT, where int will do.
8534 * casefiddle.c (casify_object, casify_region, operate_on_word)
8535 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
8536 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8537 (casify_object): Avoid integer overflow when overallocating buffer.
8538 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 8539 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
8540 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
8541 * category.h (CATEGORYP): Don't assume arg is nonnegative.
8542 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
8543 integers are now checked earlier. All uses replaced with XINT.
8544 (ccl_driver):
8545 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8546 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
8547 (ccl_driver, Fregister_code_conversion_map):
8548 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
8549 (resolve_symbol_ccl_program): Check that vector header is in range.
8550 Always copy the vector, so that we can check its contents reliably
8551 now rather than having to recheck each instruction as it's being
8552 executed. Check that vector words fit in 'int'.
8553 (ccl_get_compiled_code, Fregister_ccl_program)
8554 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
8555 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
8556 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
8557 contents are in range.
8558 (Fccl_execute_on_string): Check that status is in range.
8559 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
8560 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
8561 Accept and return EMACS_INT, not int, because callers can pass values
8562 out of 'int' range.
8563 (c_string_width, strwidth, lisp_string_width, chars_in_text)
8564 (multibyte_chars_in_text, parse_str_as_multibyte)
8565 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
8566 (str_as_unibyte, str_to_unibyte, string_count_byte8)
8567 (string_escape_byte8, Fget_byte):
8568 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 8569 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
8570 avoid mishandling large integers.
8571 * character.h: Adjust decls to match defn changes elsewhere.
8572 * charset.c (load_charset_map_from_file, find_charsets_in_text)
8573 (Ffind_charset_region):
8574 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8575 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
8576 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 8577 Don't assume fixnum fits in int.
d311d28c
PE
8578 (load_charset_map_from_vector, Fmap_charset_chars):
8579 Remove now-unnecessary CHECK_NATNUMs.
8580 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
8581 Don't rely on undefined behavior with signed left shift overflow.
8582 Don't assume unsigned int fits into fixnum, or that fixnum fits
8583 into unsigned int. Don't require max_code to be a valid fixnum;
8584 that's not true for gb10830 4-byte on a 32-bit host. Allow
8585 invalid_code to be a cons, for the same reason. Require code_offset
8586 to be a character. Avoid int overflow if max_char is close
8587 to INT_MAX.
8588 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
8589 this is intended anyway and avoids some undefined behavior.
8590 (load_charset_map): Pass unsigned, not int, as 2nd arg of
8591 INDEX_TO_CODE_POINT, as that's what it expects.
8592 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
8593 * charset.h (DECODE_CHAR): Return int, not unsigned;
8594 this is what was intended anyway, and it avoids undefined behavior.
8595 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
8596 integer-overflow issues.
8597 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
8598 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
8599 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
8600 * chartab.c (Fmake_char_table, Fset_char_table_range)
8601 (uniprop_get_decoder, uniprop_get_encoder):
8602 Don't assume fixnum fits in int.
8603 * cmds.c (move_point): New function, that does the gist of
8604 Fforward_char and Fbackward_char, but does so while checking
8605 for integer overflow more accurately.
c96e5d6a 8606 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
8607 (Fforward_line, Fend_of_line, internal_self_insert)
8608 (internal_self_insert):
8609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8610 Fix a FIXME, by checking for integer overflow when calculating
8611 target_clm and actual_clm.
8612 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 8613 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
8614 (ASSURE_DESTINATION, coding_alloc_by_realloc)
8615 (coding_alloc_by_making_gap, alloc_destination)
8616 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
8617 (encode_coding_utf_16, detect_coding_emacs_mule)
8618 (decode_coding_emacs_mule, encode_coding_emacs_mule)
8619 (detect_coding_iso_2022, decode_coding_iso_2022)
8620 (encode_invocation_designation, encode_designation_at_bol)
8621 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
8622 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
8623 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
8624 (encode_coding_ccl, encode_coding_raw_text)
8625 (detect_coding_charset, decode_coding_charset)
8626 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
8627 (produce_composition, produce_charset, produce_annotation)
8628 (decode_coding, handle_composition_annotation)
8629 (handle_charset_annotation, consume_chars, decode_coding_gap)
8630 (decode_coding_object, encode_coding_object, detect_coding_system)
8631 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
8632 (code_convert_region, code_convert_string)
8f50130c
PE
8633 (Fdefine_coding_system_internal)
8634 (coding_set_source, coding_set_destination):
d311d28c
PE
8635 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8636 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
8637 (Fdefine_coding_system_internal):
8638 Don't assume fixnums fit in int.
8639 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 8640 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
8641 (Funencodable_char_position, Fcheck_coding_systems_region)
8642 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 8643 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 8644 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 8645 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 8646 Don't access memory outside of the args array.
d311d28c 8647 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
8648 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
8649 result of ENCODE_CHAR.
d311d28c
PE
8650 * coding.h: Adjust decls to match defn changes elsewhere.
8651 (struct coding_system):
8652 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8653 * composite.c (get_composition_id, find_composition)
8654 (run_composition_function, update_compositions)
8655 (compose_text, composition_gstring_put_cache)
8656 (composition_gstring_p, composition_gstring_width)
8657 (fill_gstring_header, fill_gstring_body, autocmp_chars)
8658 (composition_compute_stop_pos, composition_reseat_it)
8659 (composition_update_it, struct position_record)
8660 (find_automatic_composition, composition_adjust_point)
8661 (Fcomposition_get_gstring, Ffind_composition_internal):
8662 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8663 (update_compositions):
8664 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8665 * composite.h: Adjust decls to match defn changes elsewhere.
8666 (struct composition):
8667 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8668 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
8669 Do not attempt to compute the address of the object just before a
8670 buffer; this is not portable.
8671 (Faref, Faset):
8672 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8673 (Faset): Use int, not EMACS_INT, where int is wide enough.
8674 (Fstring_to_number): Don't assume fixnums fit in int.
8675 (Frem): Don't assume arg is nonnegative.
8676 * dbusbind.c (xd_append_arg): Check for integers out of range.
8677 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 8678 (extract_signed, extract_unsigned): New functions.
243e0530
PE
8679 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
8680 (xd_get_connection_references): Return ptrdiff_t, not int.
8681 All uses changed.
8682 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
8683 (xd_read_message_1):
8684 Use int, not unsigned, where the dbus API uses int.
8685 (Fdbus_message_internal): Don't overflow mtype.
8686 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
8687 * dired.c (directory_files_internal, file_name_completion, scmp)
8688 (file_name_completion_stat):
8689 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8690 (file_name_completion): Don't overflow matchcount.
8691 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
8692 * dispextern.h: Adjust decls to match defn changes elsewhere.
8693 (struct text_pos, struct glyph, struct bidi_saved_info)
8694 (struct bidi_string_data, struct bidi_it, struct composition_it)
8695 (struct it):
8696 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8697 (struct display_pos, struct composition_it, struct it):
8698 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8699 * dispnew.c (increment_matrix_positions)
8700 (increment_row_positions, mode_line_string)
8701 (marginal_area_string):
8702 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 8703 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
8704 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8705 (duration_to_sec_usec): New function, to check for overflow better.
8706 (Fsleep_for, sit_for): Use it.
8707 * doc.c (get_doc_string, store_function_docstring):
8708 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8709 (get_doc_string, Fsnarf_documentation):
8710 Use int, not EMACS_INT, where int is wide enough.
8711 (get_doc_string):
8712 Use SAFE_ALLOCA, not alloca.
8713 Check for overflow when converting EMACS_INT to off_t.
8714 * doprnt.c (doprnt):
8715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8716 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
8717 Don't assume uid_t fits into fixnum.
8718 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
8719 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
8720 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
8721 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
8722 (general_insert_function)
8723 (Finsert_char, make_buffer_string, make_buffer_string_both)
8724 (update_buffer_properties, Fbuffer_substring)
8725 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
8726 (Fsubst_char_in_region, check_translation)
8727 (Ftranslate_region_internal, save_restriction_restore, Fformat)
8728 (transpose_markers, Ftranspose_regions):
8729 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8730 (clip_to_bounds): Move to lisp.h as an inline function).
8731 (Fconstrain_to_field): Don't assume integers are nonnegative.
8732 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
8733 (Fsubst_char_in_region, Fsave_restriction):
8734 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8735 (Femacs_pid): Don't assume pid_t fits into fixnum.
8736 (lo_time): Use int, not EMACS_INT, when int suffices.
8737 (lisp_time_argument): Check for usec out of range.
8738 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
8739 (Fuser_login_name, Fuser_full_name): Signal an error
8740 if a uid argument is out of range, rather than relying on
8741 undefined behavior.
c8d5c857
PE
8742 (Fformat_time_string): Remove now-unnecessary check.
8743 lisp_time_argument checks for out-of-range usec now.
243e0530 8744 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
8745 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
8746 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
8747 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
8748 (init_cmdargs, Fdump_emacs):
8749 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8750 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
8751 the bottom (typically) 32 bits of the fixnum.
8752 * eval.c (specpdl_size, call_debugger):
8753 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8754 (when_entered_debugger, Fbacktrace_debug):
8755 Don't assume fixnum can fit in int.
8756 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
8757 the object just before a buffer; this is not portable.
8758 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
8759 (grow_specpdl, unbind_to):
8760 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8761 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
8762 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 8763 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
8764 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
8765 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
8766 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8767 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
8768 (a_write, e_write):
8769 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8770 (Fcopy_file, non_regular_nbytes, read_non_regular)
8771 (Finsert_file_contents):
8772 Use int, not EMACS_INT, where int is wide enough.
8773 (READ_BUF_SIZE): Verify that it fits in int.
8774 (Finsert_file_contents): Check that counts are in proper range,
8775 rather than assuming fixnums fit into ptrdiff_t etc.
8776 Don't assume fixnums fit into int.
125b3835 8777 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
8778 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
8779 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
8780 (string_char_to_byte, string_byte_to_char)
8781 (string_make_multibyte, string_to_multibyte)
8782 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
8783 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
8784 (substring_both, Fdelete, internal_equal, Ffillarray)
8785 (Fclear_string, mapcar1)
8786 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
8787 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
8788 (larger_vector, make_hash_table, maybe_resize_hash_table)
8789 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
8790 (Fmaphash, secure_hash):
8791 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8792 (concat): Check for string index and length overflow.
8793 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
8794 (Frequire):
8795 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8796 (larger_vector): New API (vec, incr_min, size_max) replaces old
8797 one (vec, new_size, init). This catches size overflow.
8798 INIT was removed because it was always Qnil.
8799 All callers changed.
8800 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
8801 the upper bound on a hash table index size.
8802 (make_hash_table, maybe_resize_hash_table): Use it.
8803 (secure_hash): Computer start_byte and end_byte only after
8804 they're known to be in ptrdiff_t range.
8805 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
8806 (Ffont_get_glyphs, Ffont_at):
8807 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8808 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
8809 (Flist_fonts, Fopen_font):
8810 Don't assume fixnum can fit in int.
8811 (check_gstring): Don't assume index can fit in int.
8812 (font_match_p): Check that fixnum is a character, not a nonnegative
8813 fixnum, since the later code needs to stuff it into an int.
8814 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
8815 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
8816 conversion overflow issues.
8817 (Fopen_font): Check for integer out of range.
8818 (Ffont_get_glyphs): Don't assume index can fit in int.
8819 * font.h: Adjust decls to match defn changes elsewhere.
8820 * fontset.c (reorder_font_vector): Redo score calculation to avoid
8821 integer overflow.
8822 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
8823 printmax_t, where ptrdiff_t is wide enough.
8824 (Finternal_char_font):
8825 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8826 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
8827 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
8828 (Fset_frame_position, x_set_frame_parameters)
8829 (x_set_line_spacing, x_set_border_width)
8830 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
8831 Check that fixnums are in proper range for system types.
8832 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
8833 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8834 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
8835 Use SAFE_ALLOCA_LISP, not alloca.
8836 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
8837 intptr_t is wide enough.
8838 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
8839 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
8840 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
8841 Check for fixnum out of range.
8842 * ftfont.c (ftfont_list): Don't assume index fits in int.
8843 Check that fixnums are in proper range for system types.
8844 (ftfont_shape_by_flt):
8845 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
8846 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
8847 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8848 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
8849 Check that fixnums are in proper range for system types.
8850 * gnutls.h: Adjust decls to match defn changes elsewhere.
8851 * gtkutil.c (xg_dialog_run):
8852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8853 (update_frame_tool_bar):
8854 Check that fixnums are in proper range for system types.
8855 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 8856 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
8857 * indent.c (last_known_column, last_known_column_point):
8858 (current_column_bol_cache):
8859 (skip_invisible, current_column, check_display_width):
8860 (check_display_width, scan_for_column, current_column_1)
8861 (Findent_to, Fcurrent_indentation, position_indentation)
8862 (indented_beyond_p, Fmove_to_column, compute_motion):
8863 (Fcompute_motion, Fvertical_motion):
8864 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8865 (last_known_column_modified): Use EMACS_INT, not int.
8866 (check_display_width):
8867 (Fcompute_motion):
8868 Check that fixnums and floats are in proper range for system types.
8869 (compute_motion): Don't assume index or fixnum fits in int.
8870 (compute_motion, Fcompute_motion):
8871 Use int, not EMACS_INT, when it is wide enough.
8872 (vmotion): Omit local var start_hpos that is always 0; that way
8873 we don't need to worry about overflow in expressions involving it.
8874 * indent.h: Adjust decls to match defn changes elsewhere.
8875 (struct position):
8876 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8877 Use int, not EMACS_INT, where int is wide enough.
8878 Remove unused members ovstring_chars_done and tab_offset;
8879 all uses removed.
8880 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
8881 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
8882 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
8883 (make_gap, copy_text, insert, insert_and_inherit)
8884 (insert_before_markers, insert_before_markers_and_inherit)
8885 (insert_1, count_combining_before, count_combining_after)
8886 (insert_1_both, insert_from_string)
8887 (insert_from_string_before_markers, insert_from_string_1)
8888 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
8889 (adjust_after_replace, adjust_after_insert, replace_range)
8890 (replace_range_2, del_range, del_range_1, del_range_byte)
8891 (del_range_both, del_range_2, modify_region)
8892 (prepare_to_modify_buffer, signal_before_change)
8893 (signal_after_change, Fcombine_after_change_execute):
8894 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8895 * intervals.c (traverse_intervals, rotate_right, rotate_left)
8896 (balance_an_interval, split_interval_right, split_interval_left)
8897 (find_interval, next_interval, update_interval)
8898 (adjust_intervals_for_insertion, delete_node, delete_interval)
8899 (interval_deletion_adjustment, adjust_intervals_for_deletion)
8900 (static_offset_intervals, offset_intervals)
8901 (merge_interval_right, merge_interval_left, make_new_interval)
8902 (graft_intervals_into_buffer, temp_set_point_both)
8903 (temp_set_point, set_point, adjust_for_invis_intang)
8904 (set_point_both, move_if_not_intangible, get_property_and_range)
8905 (get_local_map, copy_intervals, copy_intervals_to_string)
8906 (compare_string_intervals, set_intervals_multibyte_1):
8907 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8908 * intervals.h: Adjust decls to match defn changes elsewhere.
8909 (struct interval):
8910 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8911 * keyboard.c (this_command_key_count, this_single_command_key_start)
8912 (before_command_key_count, before_command_echo_length, echo_now)
8913 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
8914 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
8915 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
8916 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
8917 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8918 (last_non_minibuf_size, last_point_position, echo_truncate)
8919 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
8920 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
8921 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
8922 (stuff_buffered_input):
8923 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8924 (last_auto_save, command_loop_1, read_char):
8925 Use EMACS_INT, not int, to avoid integer overflow.
8926 (record_char): Avoid overflow in total_keys computation.
8927 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
8928 * keyboard.h: Adjust decls to match defn changes elsewhere.
8929 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
8930 (Fkey_description, Fdescribe_vector, Flookup_key):
8931 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8932 (click_position): New function, to check that positions are in range.
8933 (Fcurrent_active_maps):
8934 (describe_command):
8935 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8936 (Faccessible_keymaps, Fkey_description):
8937 (preferred_sequence_p):
8938 Don't assume fixnum can fit into int.
8939 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
8940 Check for integer overflow in size calculations.
8941 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
8942 avoid mishandling large integers.
8943 * lisp.h: Adjust decls to match defn changes elsewhere.
8944 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
8945 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
8946 (struct Lisp_Marker):
8947 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8948 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
8949 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
8950 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
8951 All callers changed.
8952 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
8953 Assume the arg has valid form, since it always does.
8954 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
8955 unsigned integer system type.
8956 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
8957 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
8958 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8959 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
8960 (duration_to_sec_usec): New decl.
8961 * lread.c (read_from_string_index, read_from_string_index_byte)
8962 (read_from_string_limit, readchar, unreadchar, openp)
8963 (read_internal_start, read1, oblookup):
8964 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8965 (Fload, readevalloop, Feval_buffer, Feval_region):
8966 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8967 (openp): Check for out-of-range argument to 'access'.
8968 (read1): Use int, not EMACS_INT, where int is wide enough.
8969 Don't assume fixnum fits into int.
6efdadfd 8970 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
8971 (read_filtered_event): Use duration_to_sec_usec
8972 to do proper overflow checking on durations.
d311d28c
PE
8973 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
8974 in size calculation.
8975 (Fexecute_kbd_macro):
8976 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8977 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
8978 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
8979 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
8980 (set_marker_both, set_marker_restricted_both, marker_position)
8981 (marker_byte_position, Fbuffer_has_markers_at):
8982 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8983 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 8984 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
8985 It now merely ensures that the menu is large enough, without
8986 necessarily growing it, as this avoids some integer overflow issues.
8987 All callers changed.
8988 (keymap_panes, parse_single_submenu, Fx_popup_menu):
8989 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
8990 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
8991 Use SAFE_ALLOCA_LISP, not alloca.
8992 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
8993 to EMACS_INT. Check that fixnums are in proper range for system types.
8994 * minibuf.c (minibuf_prompt_width, string_to_object)
8995 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
8996 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
8997 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
8998 (get_minibuffer, read_minibuf_unwind):
8999 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9000 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
9001 this simplifies overflow checking. All callers changed.
9002 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
9003 (Ftest_completion):
9004 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9005 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
9006 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
9007 Check that fixnums are in proper range for system types.
9008 (Fx_create_frame, Fx_show_tip):
9009 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9010 * nsfont.m (ns_findfonts, nsfont_list_family):
9011 Don't assume fixnum fits in long.
9012 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
9013 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9014 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
9015 wide enough.
17fdb222 9016 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
9017 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9018 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
9019 (PRINTDECLARE, PRINTPREPARE):
9020 (strout, print_string):
9021 (print, print_preprocess, print_check_string_charset_prop)
9022 (print_object):
9023 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9024 (PRINTDECLARE):
9025 (temp_output_buffer_setup, Fprin1_to_string, print_object):
9026 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9027 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 9028 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 9029 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
9030 (print_error_message): Use SAFE_ALLOCA, not alloca.
9031 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
9032 (print_depth, new_backquote_output, print_number_index):
9033 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
9034 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
9035 (Fset_process_window_size, Fformat_network_address)
9036 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 9037 (sigchld_handler):
d311d28c 9038 Check that fixnums are in proper range for system types.
d44287d4 9039 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
9040 Check for process-ids out of pid_t range rather than relying on
9041 undefined behavior.
e4d81efc 9042 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
9043 (Fformat_network_address, read_process_output, send_process)
9044 (Fprocess_send_region, status_notify):
9045 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9046 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
9047 (wait_reading_process_output, read_process_output, exec_sentinel):
9048 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9049 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
9050 (Faccept_process_output): Use duration_to_sec_usec to do proper
9051 overflow checking on durations.
dde14581
PE
9052 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
9053 Don't assume pid_t fits in int.
02481186
PE
9054 * process.h (struct Lisp_Process): Members tick and update_tick
9055 are now of type EMACS_INT, not int.
b62b53e8
PE
9056 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
9057 configured --with-wide-int.
d311d28c
PE
9058 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
9059 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
9060 * search.c (looking_at_1, string_match_1):
9061 (fast_string_match, fast_c_string_match_ignore_case)
9062 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
9063 (scan_newline, find_before_next_newline, search_command)
9064 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
9065 (set_search_regs, wordify):
9066 (Freplace_match):
9067 (Fmatch_data):
9068 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9069 (string_match_1, search_buffer, set_search_regs):
9070 (Fmatch_data):
9071 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9072 (wordify): Check for overflow in size calculation.
9073 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
9074 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
9075 Check that fixnums are in proper range for system types.
9076 * sound.c (struct sound_device)
9077 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
9078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9079 (Fplay_sound_internal):
9080 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 9081 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
9082 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
9083 (Fparse_partial_sexp):
9084 Don't assume fixnums can fit in int.
9085 (struct lisp_parse_state, find_start_pos, find_start_value)
9086 (find_start_value_byte, find_start_begv)
9087 (update_syntax_table, char_quoted, dec_bytepos)
9088 (find_defun_start, prev_char_comend_first, back_comment):
9089 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
9090 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
9091 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9092 (Finternal_describe_syntax_value): Check that match_lisp is a
9093 character, not an integer, since the code stuffs it into int.
9094 (scan_words, scan_sexps_forward):
9095 Check that fixnums are in proper range for system types.
9096 (Fforward_word):
9097 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9098 (scan_sexps_forward):
9099 Use CHARACTERP, not INTEGERP, since the value must fit into int.
9100 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
9101 * syntax.h: Adjust decls to match defn changes elsewhere.
9102 (struct gl_state_s):
9103 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
9104 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
9105 MOST_POSITIVE_FIXNUM.
d311d28c
PE
9106 * sysdep.c (wait_for_termination_1, wait_for_termination)
9107 (interruptible_wait_for_termination, mkdir):
9108 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
9109 (emacs_read, emacs_write):
9110 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
9111 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
9112 and double all fit in int.
d311d28c
PE
9113 * term.c (set_tty_color_mode):
9114 Check that fixnums are in proper range for system types.
9115 * termhooks.h (struct input_event):
9116 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9117 * textprop.c (validate_interval_range, interval_of)
9118 (Fadd_text_properties, set_text_properties_1)
9119 (Fremove_text_properties, Fremove_list_of_text_properties)
9120 (Ftext_property_any, Ftext_property_not_all)
9121 (copy_text_properties, text_property_list, extend_property_ranges)
9122 (verify_interval_modification):
9123 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9124 (Fnext_single_char_property_change)
9125 (Fprevious_single_char_property_change):
9126 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
9127 (copy_text_properties):
9128 Check for integer overflow in index calculation.
d311d28c
PE
9129 * undo.c (last_boundary_position, record_point, record_insert)
9130 (record_delete, record_marker_adjustment, record_change)
9131 (record_property_change):
9132 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9133 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
9134 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9135 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9136 (Fx_hide_tip, Fx_file_dialog):
9137 * w32menu.c (set_frame_menubar):
9138 Use ptrdiff_t, not int, for consistency with rest of code.
9139 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
9140 (select_window, Fdelete_other_windows_internal)
9141 (window_scroll_pixel_based, window_scroll_line_based)
9142 (Frecenter, Fset_window_configuration):
9143 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9144 (Fset_window_hscroll, run_window_configuration_change_hook)
9145 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 9146 (Fscroll_other_window, Frecenter):
d311d28c
PE
9147 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9148 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
9149 Don't assume fixnum fits in int.
9150 (Fset_window_scroll_bars):
9151 Check that fixnums are in proper range for system types.
9152 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
9153 (string_pos, c_string_pos, number_of_chars, init_iterator)
9154 (in_ellipses_for_invisible_text_p, init_from_display_pos)
9155 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
9156 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
9157 (face_before_or_after_it_pos, handle_invisible_prop)
9158 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
9159 (display_prop_intangible_p, string_buffer_position_lim)
9160 (string_buffer_position, handle_composition_prop, load_overlay_strings)
9161 (get_overlay_strings_1, get_overlay_strings)
9162 (iterate_out_of_display_property, forward_to_next_line_start)
9163 (back_to_previous_visible_line_start, reseat, reseat_to_string)
9164 (get_next_display_element, set_iterator_to_next)
9165 (get_visually_first_element, compute_stop_pos_backwards)
9166 (handle_stop_backwards, next_element_from_buffer)
9167 (move_it_in_display_line_to, move_it_in_display_line)
9168 (move_it_to, move_it_vertically_backward, move_it_by_lines)
9169 (add_to_log, message_dolog, message_log_check_duplicate)
9170 (message2, message2_nolog, message3, message3_nolog
9171 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
9172 (current_message_1, truncate_echo_area, truncate_message_1)
9173 (set_message, set_message_1, store_mode_line_noprop)
9174 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
9175 (text_outside_line_unchanged_p, check_point_in_composition)
9176 (reconsider_clip_changes)
9177 (redisplay_internal, set_cursor_from_row, try_scrolling)
9178 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
9179 (redisplay_window, find_last_unchanged_at_beg_row)
9180 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
9181 (trailing_whitespace_p, find_row_edges, display_line)
9182 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
9183 (display_mode_element, store_mode_line_string)
9184 (pint2str, pint2hrstr, decode_mode_spec)
9185 (display_count_lines, display_string, draw_glyphs)
9186 (x_produce_glyphs, x_insert_glyphs)
9187 (rows_from_pos_range, mouse_face_from_buffer_pos)
9188 (fast_find_string_pos, mouse_face_from_string_pos)
9189 (note_mode_line_or_margin_highlight, note_mouse_highlight):
9190 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9191 (safe_call, init_from_display_pos, handle_fontified_prop)
9192 (handle_single_display_spec, load_overlay_strings)
9193 (with_echo_area_buffer, setup_echo_area_for_printing)
9194 (display_echo_area, echo_area_display)
9195 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
9196 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
9197 (redisplay_window, dump_glyph_row, display_mode_line)
9198 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 9199 (handle_display_spec, display_prop_string_p):
d311d28c
PE
9200 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9201 (handle_single_display_spec, build_desired_tool_bar_string)
9202 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
9203 (get_specified_cursor_type):
9204 Check that fixnums are in proper range for system types.
9205 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
9206 (Flookup_image_map):
9207 Don't assume fixnums fit in int.
9208 (compare_overlay_entries):
9209 Avoid mishandling comparisons due to subtraction overflow.
9210 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
9211 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
9212 (handle_tool_bar_click):
9213 Use int, not unsigned, since we prefer signed and the signedness
9214 doesn't matter here.
9215 (get_next_display_element, next_element_from_display_vector):
9216 Use int, not EMACS_INT, when int is wide enough.
9217 (start_hourglass): Use duration_to_sec_usec to do proper
9218 overflow checking on durations.
9219 * xfaces.c (Fbitmap_spec_p):
9220 Check that fixnums are in proper range for system types.
9221 (compare_fonts_by_sort_order):
9222 Avoid mishandling comparisons due to subtraction overflow.
9223 (Fx_family_fonts, realize_basic_faces):
9224 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9225 (Fx_family_fonts):
9226 Don't assume fixnum fits in int.
9227 Use SAFE_ALLOCA_LISP, not alloca.
9228 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
9229 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
9230 (face_at_buffer_position, face_for_overlay_string)
9231 (face_at_string_position):
9232 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9233 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
9234 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
9235 (Fx_show_tip):
9236 Check that fixnums are in proper range for system types.
9237 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
9238 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
9239 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9240 (Fx_change_window_property): Don't assume fixnums fit in int.
9241 * xfont.c (xfont_chars_supported):
9242 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9243 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
9244 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
9245 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9246 * xml.c (parse_region):
9247 * xrdb.c (magic_file_p):
9248 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
9249 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
9250 (x_get_local_selection, x_reply_selection_request)
9251 (x_handle_selection_request, wait_for_property_change):
9252 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9253 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
9254 short is wide enough.
9255 (x_send_client_event): Don't assume fixnum fits in int.
9256 * xterm.c (x_x_to_emacs_modifiers):
9257 Don't assume EMACS_INT overflows nicely into int.
9258 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
9259 may come from Lisp.
9260 (handle_one_xevent): NATNUMP can eval its arg twice.
9261 (x_connection_closed):
9262 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
9263 * xterm.h: Adjust decls to match defn changes elsewhere.
9264 (struct scroll_bar): Use struct vectorlike_header
9265 rather than rolling our own approximation.
9266 (SCROLL_BAR_VEC_SIZE): Remove; not used.
9267
c6574eb5
GM
92682012-05-25 Glenn Morris <rgm@gnu.org>
9269
9270 * lisp.mk (lisp): Update for more files being compiled now.
9271
e8d32c7e
SM
92722012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
9273
48def666
SM
9274 * lread.c: Remove `read_pure' which makes no difference.
9275 (read_pure): Remove var.
9276 (unreadpure): Remove function.
9277 (readevalloop): Don't call read_list with -1 flag.
9278 (read1, read_vector): Don't test read_pure any more.
9279 (read_list): Simplify.
9280
e8d32c7e
SM
9281 * fileio.c, character.h: Minor style tweaks.
9282
4b2addb7
DA
92832012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
9284
9285 * window.h (clip_changed): Remove useless declaration.
9286
584461b2
JB
92872012-05-22 Juanma Barranquero <lekktu@gmail.com>
9288
9289 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
9290 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
9291
34374650
PE
92922012-05-22 Paul Eggert <eggert@cs.ucla.edu>
9293
9294 Remove src/m/*.
9295 This directory predates autoconf and is no longer needed nowadays.
9296 Move its few remaining bits of functionality to where they're needed.
9297 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
9298 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
9299 * m/template.h: Remove.
9300 * Makefile.in (M_FILE): Remove. All uses removed.
9301 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
9302 * lisp.h (USE_LSB_TAG):
9303 * mem-limits.h (EXCEEDS_LISP_PTR):
9304 Use VAL_MAX, not VALBITS, in #if.
9305 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
9306 (EMACS_UINT): Define unconditionally now.
9307 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
9308 (BITS_PER_EMACS_INT): New constants, replacing
9309 what used to be in config.h, but not useful in #if.
9310 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
9311 define them any more.
9312 (VAL_MAX): New macro.
9313 (VALMASK): Use it.
9314 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
9315 BITS_PER_EMACS_INT, in #if.
9316 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
9317 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
9318 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
9319 * s/ms-w32.h (DATA_START):
9320 Move here from removed file m/intel386.h.
9321 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
9322 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
9323
261cb4bb
PE
93242012-05-21 Paul Eggert <eggert@cs.ucla.edu>
9325
9326 Assume C89 or later.
9327 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
9328 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
9329 (xrealloc):
9330 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
9331 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
9332 * textprop.c, tparam.c (NULL): Remove.
9333 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
9334 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
9335 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
9336 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
9337 * xterm.c (input_signal_count): Assume volatile works.
9338
ff23cd9f
KB
93392012-05-21 Ken Brown <kbrown@cornell.edu>
9340
9341 * xgselect.c (xg_select): Fix first argument in call to 'select'
9342 (bug#11508).
9343
1b170bc6
KB
93442012-05-20 Ken Brown <kbrown@cornell.edu>
9345
9346 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 9347 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 9348
b2f4d39f
KB
93492012-05-19 Ken Brown <kbrown@cornell.edu>
9350
9351 * xfns.c (x_in_use): Remove `static' qualifier.
9352 * xterm.h (x_in_use): Declare.
9353 * xgselect.c: Include xterm.h.
9354 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
9355 and `display_arg' (bug#9754).
9356
003fdae2
PE
93572012-05-19 Paul Eggert <eggert@cs.ucla.edu>
9358
9232a6d9
PE
9359 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
9360
003fdae2
PE
9361 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
9362 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
9363
784b56e2
EZ
93642012-05-18 Eli Zaretskii <eliz@gnu.org>
9365
9366 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
9367
9368 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 9369 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
9370
9371 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
9372 reference to image_cache->refcount.
9373 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
9374
a0a79cde
JL
93752012-05-17 Juri Linkov <juri@jurta.org>
9376
9377 * search.c (Fword_search_regexp, Fword_search_backward)
9378 (Fword_search_forward, Fword_search_backward_lax)
9379 (Fword_search_forward_lax): Move functions to isearch.el
9380 (bug#10145, bug#11381).
9381
b0572523
PE
93822012-05-16 Paul Eggert <eggert@cs.ucla.edu>
9383
9384 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
9385
9660f5fc
SM
93862012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
9387
9388 * lread.c (init_obarray): Declare Qt and Qnil as special.
9389
4374de83
GM
93902012-05-14 Glenn Morris <rgm@gnu.org>
9391
9392 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 9393 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 9394
dc44c39a
PE
93952012-05-14 Paul Eggert <eggert@cs.ucla.edu>
9396
078c97cb
PE
9397 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
9398
dc44c39a
PE
9399 * unexaix.c: Port to more-recent AIX compilers.
9400 (report_error, report_error_1, make_hdr, copy_sym)
9401 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
9402 Make arguments const char *, not char *, to avoid violations of C
9403 standard and to fix some AIX warnings reported by Gilles Pion.
9404
e18afed7 94052012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
9406
9407 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
9408 already have overlays loaded.
9409 (handle_single_display_spec): Before returning without displaying
9410 fringe bitmap, synchronize the bidi iterator with the main display
9411 iterator, by calling iterate_out_of_display_property.
9412 (iterate_out_of_display_property): Detect buffer iteration by
9413 testing that it->string is a Lisp string.
9414 (get_next_display_element): When the current object is exhausted,
9415 and there's something on it->stack, call set_iterator_to_next to
9416 proceed with what's on the stack, instead of returning zero.
9417 (set_iterator_to_next): If called at the end of a Lisp string,
9418 proceed to consider_string_end without incrementing string
9419 position. Don't increment display vector index past the end of
9420 the display vector. (Bug#11417)
c8fb9dc6
EZ
9421 (pos_visible_p): Don't report a position visible when move_it_to
9422 stopped at the last line of window, which happens to be scanned
9423 backwards by the bidi iteration. (Bug#11464)
ac268e67 9424
e18afed7 94252012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
9426
9427 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
9428 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
9429 are on a TTY, and thus unable to display on the fringes.
9430 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
9431 so we need to signal to the caller that this is a "replacing"
9432 display spec. This fixes display when the spec is invalid or we
9433 are on a TTY.
9434
e18afed7 94352012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
9436
9437 * unexaix.c (make_hdr): Fix typo in prototype.
9438 This bug broke the build on AIX. Problem reported by Gilles Pion.
9439
9d0a235a
MA
94402012-05-14 Michael Albinus <michael.albinus@gmx.de>
9441
9442 * keyboard.c (kbd_buffer_get_event): Read special events also in
9443 batch mode. (Bug#11415)
9444
9e6b06ed
GM
94452012-05-12 Glenn Morris <rgm@gnu.org>
9446
9447 * ns.mk: Update for ns_appbindir no longer having trailing "/".
9448
c1a1d7a3
EZ
94492012-05-12 Eli Zaretskii <eliz@gnu.org>
9450
9451 * lisp.mk (lisp): Add newcomment.elc.
9452
3fe7cdc8
GM
94532012-05-12 Glenn Morris <rgm@gnu.org>
9454
9455 * Makefile.in (MKDIR_P): New, set by configure.
9456 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
9457
53f7d2c0
PE
94582012-05-11 Paul Eggert <eggert@cs.ucla.edu>
9459
9460 Remove unused function hourglass_started.
9461 * dispextern.h (hourglass_started):
9462 * w32fns.c (hourglass_started):
9463 * xdisp.c (hourglass_started): Remove.
9464
75aafb17
JB
94652012-05-10 Juanma Barranquero <lekktu@gmail.com>
9466
9467 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
9468 Update dependencies.
9469
12959e8e
PE
94702012-05-10 Paul Eggert <eggert@cs.ucla.edu>
9471
97107e2e
PE
9472 * xgselect.c (xg_select): Put maxfds+1 into a var.
9473 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
9474
12959e8e
PE
9475 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
9476
836d29b3
DA
94772012-05-10 Dave Abrahams <dave@boostpro.com>
9478
9479 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
9480 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
9481
5cb67954
MA
94822012-05-09 Michael Albinus <michael.albinus@gmx.de>
9483
9484 * dbusbind.c (xd_registered_buses): New internal Lisp object.
9485 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
9486 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
9487 Initialize xd_registered_buses.
9488
3478ec45
PE
94892012-05-09 Paul Eggert <eggert@cs.ucla.edu>
9490
b263a6b0
PE
9491 Untag more efficiently if USE_LSB_TAG.
9492 This is based on a proposal by YAMAMOTO Mitsuharu in
9493 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
9494 For an admittedly artificial (nth 8000 longlist) benchmark on
9495 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
9496 Emacs's overall text size by 1%.
9497 * lisp.h (XUNTAG): New macro.
9498 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
9499 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
9500 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
9501 * eval.c (Fautoload):
9502 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
9503 * frame.h (XFRAME): Use XUNTAG.
9504
3478ec45
PE
9505 Port recent dbusbind.c changes to 32-bit --with-wide-int.
9506 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
9507 Remove unportable assumptions about print widths of types like
9508 dbus_uint32_t.
9509 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
9510 intptr_t when converting between pointer and integer, to avoid GCC
9511 warnings about wrong width.
9512
666b903b 95132012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
9514
9515 * w32proc.c (new_child): Force Windows to reserve only 64KB of
9516 stack for each reader_thread, instead of defaulting to 8MB
9517 determined by the linker. This avoids failures in creating
9518 subprocesses on Windows 7, see the discussion in this thread:
9519 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
9520
b120cc17
JC
95212012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
9522
9523 Fix up display of the *Minibuf-0* buffer in the mini window.
9524 * keyboard.c (read_char): Don't clear the echo area if there's no
9525 message to clear.
9526 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 9527 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 9528
9a4b36f8
MA
95292012-05-07 Michael Albinus <michael.albinus@gmx.de>
9530
9531 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
9532 batch mode.
9533
e5f9458f
CY
95342012-05-06 Chong Yidong <cyd@gnu.org>
9535
9536 * lisp.mk (lisp): Update.
9537
eceeb5fc 95382012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
9539
9540 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
9541
71873e2b
SM
95422012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
9543
9544 * data.c (PUT_ERROR): New macro.
9545 (syms_of_data): Use it. Add new error type `user-error'.
9546 * undo.c (user_error): New function.
9547 (Fprimitive_undo): Use it.
9548 * print.c (print_error_message): Adjust print style for `user-error'.
9549 * keyboard.c (user_error): New function.
9550 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
9551
ab0fa4e4
PE
95522012-05-03 Paul Eggert <eggert@cs.ucla.edu>
9553
9554 Do not limit current-time-string to years 1000..9999.
9555 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
9556 (Fcurrent_time_string): Support any year that is supported by the
9557 underlying localtime representation. Don't use asctime, as it
9558 has undefined behavior for years outside the range -999..9999.
9559
7ed806a7
PE
95602012-05-02 Paul Eggert <eggert@cs.ucla.edu>
9561
9562 Fix race conditions involving setenv, gmtime, localtime, asctime.
9563 Without this fix, interrupts could mess up code that uses these
9564 nonreentrant functions, since setting TZ invalidates existing
9565 tm_zone or tzname values, and since most of these functions return
9566 pointers to static storage.
9567 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
9568 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
9569 Grow the critical sections to include not just invoking
9570 localtime/gmtime, but also accessing these functions' results
9571 including their tm_zone values if any, and any related TZ setting.
9572 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
9573 so that the struct tm is saved in the critical section.
9574 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
9575 motivated by the fact that memory allocation needs to be outside
9576 the critical section.
9577
0c16dfed
DA
95782012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
9579
9580 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
9581 with RESET_INTERVAL.
9582
9583 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
9584 Remove duplicated buffer name initialization.
9585
3f83ace8
JM
95862012-05-02 Jim Meyering <jim@meyering.net>
9587
9588 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
9589
c7b8541e
JM
9590 * xfns.c (x_window): Use xstrdup (Bug#11375).
9591
90207a15 95922012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
9593
9594 * xdisp.c (pos_visible_p): If already at a newline from the
9595 display string before the 'while' loop, don't walk back the glyphs
9596 from it3.glyph_row. Solves assertion violation when the display
9597 string begins with a newline (egg.el). (Bug#11367)
9598
b593d6a9
AH
95992012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
9600
9601 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
9602 Move to simple.el.
9603
4737362e
GM
96042012-05-01 Glenn Morris <rgm@gnu.org>
9605
99cf43f9
GM
9606 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
9607 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
9608 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
9609 All were removed before 23.1.
9610
9311dcff
GM
9611 * dispnew.c: Remove HAVE_LIBNCURSES test;
9612 it is always true on relevant platforms.
9613
4d5c6349
GM
9614 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
9615 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
9616
4737362e
GM
9617 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
9618
74dd3a6b
AS
96192012-04-30 Andreas Schwab <schwab@linux-m68k.org>
9620
9621 * .gdbinit (xpr): Remove checks for no longer existing misc types.
9622 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
9623 Remove.
9624
13c379ee
PE
96252012-04-28 Paul Eggert <eggert@cs.ucla.edu>
9626
9627 Do not avoid creating empty evaporating overlays (Bug#9642).
9628 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
9629 That is, do not delete an evaporating overlay if it becomes
9630 empty after its bounds are adjusted to fit within its buffer.
9631 This fix caused other problems, and I'm reverting it until we get
9632 to the bottom of them.
9633
a8e7d6d7 96342012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
9635
9636 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
9637
a8e7d6d7 96382012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
9639
9640 * xdisp.c (pos_visible_p): If the window start position is beyond
9641 ZV, start the display from buffer beginning. Prevents assertion
9642 violation in init_iterator when the minibuffer window is scrolled
9643 via the scroll bar.
9644
9645 * window.c (window_scroll_pixel_based): Likewise.
9646
a8e7d6d7 96472012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
9648
9649 * keymap.c (where_is_internal): Doc fix (Bug#10872).
9650
a8e7d6d7 96512012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
9652
9653 * fileio.c (Fcopy_file, Fset_file_selinux_context):
9654 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
9655
a8e7d6d7 96562012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 9657
b593d6a9
AH
9658 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
9659 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 9660
1c6900d9
EZ
96612012-04-26 Eli Zaretskii <eliz@gnu.org>
9662
4c3fa1d9
EZ
9663 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
9664 display element, check also the underlying string or buffer
9665 character. (Bug#11341)
9666
1c6900d9
EZ
9667 * w32menu.c: Include w32heap.h.
9668 (add_menu_item): If the call to AppendMenuW (via
9669 unicode_append_menu) fails, disable Unicode menus only if we are
9670 running on Windows 9X/Me.
9671
42bf8205
AS
96722012-04-24 Andreas Schwab <schwab@linux-m68k.org>
9673
9674 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
9675 (xgetint): Add missing shift for LSB tags.
9676
b1bac16e
MR
96772012-04-24 Martin Rudalics <rudalics@gmx.at>
9678
9679 * keyboard.c (read_char): Don't wipe echo area for select window
9680 events: These might get delayed via `mouse-autoselect-window'
9681 (Bug#11304).
9682
d69621cc
JB
96832012-04-24 Juanma Barranquero <lekktu@gmail.com>
9684
9685 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
9686 manipulation of :loaded-from data.
9687
02fd101b
JB
96882012-04-23 Juanma Barranquero <lekktu@gmail.com>
9689
9690 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
9691 now a cons (bug#11311).
9692
888bec30
PE
96932012-04-23 Paul Eggert <eggert@cs.ucla.edu>
9694
89a438bd
PE
9695 Do not create empty overlays with the evaporate property (Bug#9642).
9696 * buffer.c (Fmove_overlay): Delete an evaporating overlay
9697 if it becomes empty after its bounds are adjusted to fit within
9698 its buffer. Without this fix, in a nonempty buffer (let ((o
9699 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
9700 yields an empty overlay that has the evaporate property, which is
9701 not supposed to happen.
9702
1068fe4d
PE
9703 Fix minor GTK3 problems found by static checking.
9704 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9705 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9706 (struct _EmacsFixedClass, emacs_fixed_get_type):
9707 Move decls here from emacsgtkfixed.h, since they needn't be public.
9708 (emacs_fixed_get_type): Now static.
9709 (emacs_fixed_class_init): Omit unused local.
9710 (emacs_fixed_child_type): Remove; unused.
9711 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
9712 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
9713 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
9714 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
9715 (EMACS_FIXED_GET_CLASS): Remove; unused.
9716 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
9717
888bec30
PE
9718 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
9719 Problem reported by Juanma Barranquero for Windows -Wunused-function.
9720
de85e130
PE
97212012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9722
d0baac98 9723 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 9724 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
9725 (__malloc_size_t, __malloc_ptrdiff_t):
9726 Remove. All uses removed, replaced by the definiens if needed,
9727 since we can assume C89 or better now.
9728 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
9729 (protect_malloc_state, align, get_contiguous_space)
9730 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
9731 (malloc_atfork_handler_child, malloc_enable_thread)
9732 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
9733 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
9734 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
9735 (special_realloc, _realloc_internal_nolock, _realloc_internal)
9736 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
9737 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
9738 Define using prototypes, not old style.
9739 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
9740 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
9741 (align): Don't assume that signed integer overflow wraps around.
9742 Omit unused local var.
9743 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
9744 (_free_internal_nolock, memalign, mallochook, reallochook):
9745 Omit no-longer-needed casts.
9746 (valloc): Use getpagesize, not __getpagesize.
9747 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
9748 (struct hdr): The 'magic' member is now size_t, not unsigned long.
9749
de85e130
PE
9750 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
9751
dcbf5805
MA
97522012-04-22 Michael Albinus <michael.albinus@gmx.de>
9753
9754 Move functions from C to Lisp. Make non-blocking method calls
9755 the default. Implement further D-Bus standard interfaces.
9756
9757 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
9758 (QCdbus_request_name_allow_replacement)
9759 (QCdbus_request_name_replace_existing)
9760 (QCdbus_request_name_do_not_queue)
9761 (QCdbus_request_name_reply_primary_owner)
9762 (QCdbus_request_name_reply_in_queue)
9763 (QCdbus_request_name_reply_exists)
9764 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
9765 (QCdbus_registered_serial, QCdbus_registered_method)
9766 (QCdbus_registered_signal): New Lisp objects.
9767 (XD_DEBUG_MESSAGE): Use sizeof.
9768 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
9769 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
9770 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
9771 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
9772 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
9773 (xd_signature, xd_append_arg): Allow float for integer types.
9774 (xd_get_connection_references): New function.
b593d6a9
AH
9775 (xd_get_connection_address): Rename from xd_initialize.
9776 Return cached address.
dcbf5805
MA
9777 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
9778 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
9779 level.
9780 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 9781 Return number of refcounts.
dcbf5805
MA
9782 (Fdbus_get_unique_name): Make stronger parameter check.
9783 (Fdbus_message_internal): New defun.
9784 (Fdbus_call_method, Fdbus_call_method_asynchronously)
9785 (Fdbus_method_return_internal, Fdbus_method_error_internal)
9786 (Fdbus_send_signal, Fdbus_register_service)
9787 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
9788 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
9789 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
9790 (Vdbus_compiled_version, Vdbus_runtime_version)
9791 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
9792 (Vdbus_message_type_method_return, Vdbus_message_type_error)
9793 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
9794 (Vdbus_registered_buses, Vdbus_registered_objects_table):
9795 Adapt docstring.
dcbf5805 9796
52828e02
PE
97972012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9798
da05bc4c
PE
9799 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
9800 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
9801 Do not assume ptrdiff_t is the same width as 'int'.
9802
52828e02
PE
9803 * alloc.c: Handle unusual debugging option combinations.
9804 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
9805 since the two debugging options are incompatible.
9806 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
9807 is defined.
9808 (mem_init, mem_insert, mem_insert_fixup):
9809 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
9810 (NEED_MEM_INSERT): Remove; no longer needed.
9811
f01769f9
LL
98122012-04-22 Leo Liu <sdl.web@gmail.com>
9813
9814 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
9815
5790543d
PE
98162012-04-22 Paul Eggert <eggert@cs.ucla.edu>
9817
9818 * sysdep.c [__FreeBSD__]: Minor cleanups.
9819 (list_system_processes, system_process_attributes) [__FreeBSD__]:
9820 Use Emacs indenting style more consistently. Avoid some casts.
9821 Use 'double' consistently rather than mixing 'float' and 'double'.
9822
b91b7e4d
EW
98232012-04-21 Eduard Wiebe <usenet@pusto.de>
9824
b593d6a9
AH
9825 * sysdep.c (list_system_processes, system_process_attributes):
9826 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 9827
6114eb15
AS
98282012-04-21 Andreas Schwab <schwab@linux-m68k.org>
9829
9830 * lisp.mk (lisp): Update.
9831
2f38dff7
PE
98322012-04-20 Paul Eggert <eggert@cs.ucla.edu>
9833
9834 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
9835 It is never used otherwise.
9836
4ae29f89
SM
98372012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
9838
9839 * print.c (print_preprocess): Only check print_depth if print-circle
9840 is nil.
9841 (print_object): Check for cycles even when print-circle is nil and
9842 print-gensym is t, but only check print_depth if print-circle is nil.
9843
f30d612a
CY
98442012-04-20 Chong Yidong <cyd@gnu.org>
9845
9846 * process.c (wait_reading_process_output): If EIO occurs on a pty,
9847 set the status to "failed" and ensure that sentinel is run.
9848
c07a4c0b 98492012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
9850
9851 * process.c (Fset_process_inherit_coding_system_flag)
9852 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 9853 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 9854
c07a4c0b 98552012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
9856
9857 * xdisp.c (string_buffer_position_lim): Limit starting position to
9858 BEGV.
9859 (set_cursor_from_row): If called for a mode-line or header-line
9860 row, return zero immediately.
9861 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
9862 farther than the first row after the header line, if any.
9863 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
9864 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
9865
c07a4c0b 98662012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9867
4ae29f89
SM
9868 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
9869 (bug#11238).
ad3a2b41 9870
c07a4c0b 98712012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 98722012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
9873
9874 configure: new option --enable-gcc-warnings (Bug#11207)
9875 * Makefile.in (C_WARNINGS_SWITCH): Remove.
9876 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
9877 (ALL_CFLAGS): Use new macros rather than old.
9878 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
9879 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
9880 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
9881 -Wunused-result, -Wunused-variable. This should go away once
9882 the Emacs and Gnulib regex code is merged.
9883 (xmalloc, xrealloc): Now static.
9884
aba027e8
PE
98852012-04-17 Paul Eggert <eggert@cs.ucla.edu>
9886
9887 * dired.c (Fsystem_groups): Remove unused local.
9888
e5a36063
GM
98892012-04-17 Glenn Morris <rgm@gnu.org>
9890
9891 * dired.c (Fsystem_users): Doc fix.
9892
316411f0
DA
98932012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
9894
9895 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
9896 (syms_of_dired): Add them.
9897
9426aba4
PE
98982012-04-16 Paul Eggert <eggert@cs.ucla.edu>
9899
b62a57be
PE
9900 Fix minor alloc.c problems found by static checking.
9901 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
9902 New extern decls, to avoid calling undeclared functions.
9903 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
9904 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
9905 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
9906 (NEED_MEM_INSERT): New macro.
9907 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 9908 Remove one incorrect comment and fix another.
b62a57be 9909
3539f31f
PE
9910 Fix minor ralloc.c problems found by static checking.
9911 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9912 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
9913 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
9914 (r_alloc_sbrk): Now static.
9915
a041960a
PE
9916 Improve ralloc.c interface checking.
9917 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
9918 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
9919 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
9920 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
9921 [REL_ALLOC]: ... to here, to check interface.
9922 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
9923 Remove decls. This fixes an "It stinks!".
9924
9426aba4
PE
9925 * alloc.c (which_symbols): Fix alignment issue / type clash.
9926
d55c12ed
AS
99272012-04-15 Andreas Schwab <schwab@linux-m68k.org>
9928
9929 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
9930 (struct Lisp_Misc_Any): Likewise.
9931 (struct Lisp_Free): Likewise.
9932 * alloc.c (union aligned_Lisp_Symbol): Define.
9933 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
9934 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
9935 (union aligned_Lisp_Misc): Define.
9936 (MARKER_BLOCK_SIZE, struct marker_block): Use union
9937 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 9938 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 9939
b948ce8b
PE
99402012-04-14 Paul Eggert <eggert@cs.ucla.edu>
9941
9942 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
9943 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
9944 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
9945 * s/netbsd.h, s/sol2-6.h:
9946 Remove definition of GC_MARK_STACK, since the default now works.
9947 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
9948 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
9949 no longer the default.
9950 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
9951
35dc09a1 99522012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 9953
35dc09a1
GM
9954 * lread.c (lisp_file_lexically_bound_p):
9955 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 9956
35dc09a1
GM
99572012-04-14 Eli Zaretskii <eliz@gnu.org>
9958
9959 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
9960 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
9961
99622012-04-14 Jan Djärv <jan.h.d@swipnet.se>
9963
9964 * nsterm.m (constrainFrameRect): Always constrain when there is only
9965 one screen (Bug#10962).
9966
bcd86815
KB
99672012-04-13 Ken Brown <kbrown@cornell.edu>
9968
9969 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
9970
c25df26e
RT
99712012-04-13 Reuben Thomas <rrt@sc3d.org>
9972
9973 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
9974
0fc59f1e
DC
99752012-04-11 Daniel Colascione <dancol@dancol.org>
9976
9977 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
9978 against is gone. It's better to use vfork now so that when Cygwin
9979 gains a new, working vfork, we use it automatically (bug#10398).
9980
de8c03dc
SM
99812012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9982
9983 * window.c (save_window_save): Obey window-point-insertion-type.
9984
2f097256
GM
99852012-04-11 Glenn Morris <rgm@gnu.org>
9986
9987 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
9988
453b951e
SM
99892012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
9990
9991 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
9992
75f1671a 99932012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
9994
9995 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
9996 (force_quit_count): New var.
9997 (handle_interrupt): Use it.
9998
2a8ce227
JB
99992012-04-10 Juanma Barranquero <lekktu@gmail.com>
10000
10001 * w32.c (w32_delayed_load): Record the full path of the library
10002 being loaded (bug#10424).
10003
935396c0
GM
100042012-04-09 Glenn Morris <rgm@gnu.org>
10005
05920a43
GM
10006 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
10007 not just in the obarray, before snarfing them. (Bug#11036)
10008
935396c0
GM
10009 * Makefile.in ($(leimdir)/leim-list.el):
10010 Pass EMACS rather than BUILT_EMACS.
10011
a18ecafa
TZ
100122012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
10013
10014 * process.c (make_process):
10015 * process.h: Add integer `gnutls_handshakes_tried' member to
10016 process struct.
10017
6bbef4e5
JC
10018 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
10019 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
10020
10021 * gnutls.c (gnutls_log_function2i): Convenience log function.
10022 (emacs_gnutls_read): Use new log functions,
10023 `gnutls_handshakes_tried' process member, and
10024 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
10025 attempts per process (connection).
10026
b4d3bc10
CY
100272012-04-09 Chong Yidong <cyd@gnu.org>
10028
10029 * eval.c (Fuser_variable_p, user_variable_p_eh)
10030 (lisp_indirect_variable): Functions deleted.
10031 (Fdefvar): Caller changed.
10032
10033 * callint.c (Finteractive, Fcall_interactively):
10034 * minibuf.c (Fread_variable): Callers changed.
10035
70f4d973
EZ
100362012-04-09 Eli Zaretskii <eliz@gnu.org>
10037
10038 * xdisp.c (set_cursor_from_row): If the display string appears in
10039 the buffer at position that is closer to point than the position
10040 after the display string, display the cursor on the first glyph of
10041 the display string. Fixes cursor display when a 'display' text
10042 property immediately follows invisible text. (Bug#11094)
10043
cb3c2e3e
PE
100442012-04-09 Paul Eggert <eggert@cs.ucla.edu>
10045
10046 composite.c: use 'double' consistently
10047 * composite.c (get_composition_id): Use 'double' consistently
10048 instead of converting 'float' to 'double' and vice versa; this is
10049 easier to understand and avoids a GCC warning.
10050
fd06db5d
GM
100512012-04-09 Glenn Morris <rgm@gnu.org>
10052
50fe702a
GM
10053 * Makefile.in: Generate leim-list with bootstrap-emacs, in
10054 preparation for dumping it with emacs. (Bug#4789)
10055 (leimdir): New variable.
10056 ($(leimdir)/leim-list.el): New rule.
10057 (emacs$(EXEEXT)): Depend on leim-list.el.
10058
fd06db5d
GM
10059 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
10060 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
10061 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
10062
55c131ee
AS
100632012-04-08 Andreas Schwab <schwab@linux-m68k.org>
10064
10065 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
10066 proper alignment.
10067
9209588f
JB
100682012-04-07 Juanma Barranquero <lekktu@gmail.com>
10069
10070 * xml.c (init_libxml2_functions) [WINDOWSNT]:
10071 Remove unused local variable.
10072
e3fb2efb
PE
100732012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10074
10075 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
10076 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
10077 (mark_memory): Mark Lisp_Objects only if pointers might hide in
10078 objects, as mark_maybe_pointer will catch them otherwise.
10079 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
10080 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
10081
b5385551
PE
100822012-04-07 Paul Eggert <eggert@cs.ucla.edu>
10083
10084 Fix typo that broke non-Windows builds.
10085 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
10086
9078ead6
EZ
100872012-04-07 Eli Zaretskii <eliz@gnu.org>
10088
10089 Support building on MS-Windows with libxml2.
10090
10091 * makefile.w32-in (OBJ2): Add xml.$(O).
10092 (GLOBAL_SOURCES): Add xml.c.
10093 ($(BLD)/xml.$(O)): New dependency list.
10094
10095 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
10096 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
10097 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
10098 [!WINDOWSNT]: New macros.
10099 (init_libxml2_functions, libxml2_loaded_p): New functions.
10100 (parse_region): Call fn_xmlCheckVersion instead of using the macro
10101 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
10102 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
10103 Calls xmlCleanupParser only if libxml2 was loaded (or statically
10104 linked in).
6bbef4e5
JC
10105 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
10106 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
10107 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
10108
10109 * emacs.c: Don't include libxml/parser.h.
10110 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
10111 xmlCleanupParser directly.
10112
10113 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
10114
3811fdf3
EZ
101152012-04-07 Eli Zaretskii <eliz@gnu.org>
10116
10117 * indent.c (Fvertical_motion): If there is a display string at
10118 point, use it.vpos to compute how many lines to backtrack after
10119 move_it_to point. (Bug#11133)
10120
2f8e16b2
EZ
101212012-04-06 Eli Zaretskii <eliz@gnu.org>
10122
10123 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
10124 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
10125 about subtle differences between FETCH_CHAR* and STRING_CHAR*
10126 macros related to unification of CJK characters. For the details,
10127 see the discussion following the message here:
10128 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
10129
3d439cd1
CY
101302012-04-04 Chong Yidong <cyd@gnu.org>
10131
10132 * keyboard.c (Vdelayed_warnings_list): Doc fix.
10133
8bc53d00
EZ
101342012-04-01 Eli Zaretskii <eliz@gnu.org>
10135
10136 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
10137 instead of alloca. (Bug#11138)
10138
3b0512a3
AS
101392012-04-01 Andreas Schwab <schwab@linux-m68k.org>
10140
10141 * w32menu.c (is_simple_dialog): Properly check lisp types.
10142 (Bug#11141)
10143
8427ddd2
EZ
101442012-03-31 Eli Zaretskii <eliz@gnu.org>
10145
979022ef
EZ
10146 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
10147 position we get to after a call to move_it_to fails the
10148 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
10149 only if we wind up in a string from display property. (Bug#11063)
10150
a6b1c7cc
EZ
10151 * window.c (Fdelete_other_windows_internal): Invalidate the row
10152 and column information about mouse highlight, so that redisplay
10153 restores it after reallocating the glyph matrices. (Bug#7464)
10154
8427ddd2
EZ
10155 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
10156 string comes from a `display' text property, use the buffer
10157 position of that property as if we actually saw that position in
10158 the row's glyphs.
697ba24b
EZ
10159 (move_it_by_lines): Remove the assertion that
10160 "it->current_x == 0 && it->hpos == 0" which can be legitimately
10161 violated when there's a before-string at the beginning of a line.
10162 (Bug#11063)
8427ddd2 10163
65a0a738
EZ
101642012-03-30 Eli Zaretskii <eliz@gnu.org>
10165
10166 * xdisp.c (append_space_for_newline): If the default face was
10167 remapped, use the remapped face for the appended newline.
10168 (extend_face_to_end_of_line): Use the remapped default face for
10169 extending the face to the end of the line.
10170 (display_line): Call extend_face_to_end_of_line when the default
10171 face was remapped. (Bug#11068)
10172
581355cc
EZ
101732012-03-29 Eli Zaretskii <eliz@gnu.org>
10174
10175 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
10176
e8fc049f
SM
101772012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
10178
10179 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
10180
4fb9a543
GM
101812012-03-27 Glenn Morris <rgm@gnu.org>
10182
10183 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
10184 Doc fixes.
10185
679910f1
KH
101862012-03-26 Kenichi Handa <handa@m17n.org>
10187
10188 * dispextern.h (struct glyph): Fix previous change. Change the
10189 bit length of glyphless.ch to 25 (Bug#11082).
10190
90d49b7f
CY
101912012-03-26 Chong Yidong <cyd@gnu.org>
10192
10193 * keyboard.c (Vselection_inhibit_update_commands): New variable.
10194 (command_loop_1): Use it; inhibit selection update for
10195 handle-select-window too (Bug#8996).
10196
f514f6f0
FP
101972012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
10198
e8fc049f 10199 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 10200
bf43fa51
KH
102012012-03-25 Kenichi Handa <handa@m17n.org>
10202
10203 * dispextern.h (struct glyph): Change the bit length of
10204 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
10205
8a0c01dd
EZ
102062012-03-24 Eli Zaretskii <eliz@gnu.org>
10207
10208 * s/ms-w32.h (tzname): Include time.h before redirecting to
10209 _tzname. Fixes the MSVC build. (Bug#9960)
10210
7d1c3a76
AS
102112012-03-24 Andreas Schwab <schwab@linux-m68k.org>
10212
8ed79523
AS
10213 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
10214 characters.
10215
7d1c3a76
AS
10216 * xterm.c (XTread_socket): Only modify handling_signal if
10217 !SYNC_INPUT. (Bug#11080)
10218
e99a9b8b
EZ
102192012-03-23 Eli Zaretskii <eliz@gnu.org>
10220
10221 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
10222 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
10223 when fetching a multibyte character consumes more bytes than
10224 CHAR_BYTES returns, due to unification of CJK characters in
10225 string_char. (Bug#11073)
10226
5063c0e1
TN
102272012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
10228
10229 * process.c (wait_reading_process_output): Handle pty disconnect
10230 by refraining from sending oneself a SIGCHLD (bug#10933).
10231
9f851fbd
CY
102322012-03-22 Chong Yidong <cyd@gnu.org>
10233
10234 * dispextern.h (struct it): New member string_from_prefix_prop_p.
10235
5063c0e1 10236 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
10237 Mark string as coming from a prefix property.
10238 (handle_face_prop): Use default face for prefix strings (Bug#4281).
10239 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
10240
fb5b8aca
CY
102412012-03-21 Chong Yidong <cyd@gnu.org>
10242
10243 * xfaces.c (Vface_remapping_alist): Doc fix.
10244
62356a1b
EZ
102452012-03-20 Eli Zaretskii <eliz@gnu.org>
10246
10247 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
10248 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
10249 Doc fixes.
62356a1b 10250
025de85b
CY
102512012-03-20 Chong Yidong <cyd@gnu.org>
10252
10253 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
10254 to reflect default non-nil value of redisplay-dont-pause.
10255
4827f94e
KH
102562012-03-19 Kenichi Handa <handa@m17n.org>
10257
10258 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
10259 it fit in a valid range (Bug#11003).
10260
e50a24a2
EZ
102612012-03-18 Eli Zaretskii <eliz@gnu.org>
10262
10263 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
10264 that is not from display property, accept the row as a "cursor
10265 row" if one of the string's character has a non-nil `cursor'
10266 property. Fixes cursor positioning when there are newlines in
10267 overlay strings, e.g. in icomplete.el. (Bug#11035)
10268
9af5ed87
PE
102692012-03-12 Paul Eggert <eggert@cs.ucla.edu>
10270
10271 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
10272
d1f55f16
CY
102732012-03-12 Chong Yidong <cyd@gnu.org>
10274
10275 * eval.c (inhibit_lisp_code): Rename from
10276 inhibit_window_configuration_change_hook; move from window.c.
10277
10278 * xfns.c (unwind_create_frame_1, Fx_create_frame):
10279 * window.c (run_window_configuration_change_hook)
10280 (syms_of_window): Callers changed.
10281
66c5eebd
CY
102822012-03-11 Chong Yidong <cyd@gnu.org>
10283
413df973
CY
10284 * keymap.c (Fkey_description): Doc fix (Bug#9700).
10285
66c5eebd
CY
10286 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
10287
1de11f56
CY
102882012-03-10 Chong Yidong <cyd@gnu.org>
10289
10290 * frame.c (other_visible_frames): Don't assume the selected frame
10291 is visible (Bug#10955).
10292
cae07000
SM
102932012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
10294
10295 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
10296
89c94350
JD
102972012-03-08 Jan Djärv <jan.h.d@swipnet.se>
10298
10299 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
10300 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
10301 zero (Bug#10954).
10302
999dd333
GM
103032012-03-03 Glenn Morris <rgm@gnu.org>
10304
01a6dcc8 10305 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 10306
de0100f2
EZ
103072012-03-02 Eli Zaretskii <eliz@gnu.org>
10308
10309 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
10310 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
10311 (redisplay_window, next_element_from_string): Fix typos in
10312 comments.
3e441275
EZ
10313 (redisplay_window): Pass to move_it_vertically the margin in
10314 pixels, not in screen lines.
de0100f2 10315
96a72ee9
GM
103162012-03-02 Glenn Morris <rgm@gnu.org>
10317
10318 * buffer.c (buffer-list-update-hook): Doc fix.
10319
312508d7
EZ
103202012-02-29 Eli Zaretskii <eliz@gnu.org>
10321
10322 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
10323 push_it before setting up the iterator for the first overlay
10324 string, even if we have an empty string loaded.
10325 (next_overlay_string): If there's an empty string on the iterator
10326 stack, pop the stack. (Bug#10903)
10327
27f3c637
PE
103282012-02-25 Paul Eggert <eggert@cs.ucla.edu>
10329
10330 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
10331 Suggested by Stefan Monnier in
10332 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
10333 * alloc.c (widen_to_Lisp_Object): New static function.
10334 (mark_memory): Also mark Lisp_Objects by fetching pointer words
10335 and widening them to Lisp_Objects. This would work even if
10336 USE_LSB_TAG is defined and wide integers are used, which might
10337 happen in a future version of Emacs.
10338
3c9dfce6
CY
103392012-02-25 Chong Yidong <cyd@gnu.org>
10340
fa74b241
CY
10341 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
10342 Doc fix.
10343
3c9dfce6
CY
10344 * xselect.c (Fx_selection_exists_p): Doc fix.
10345 (x_clipboard_manager_save_all): Print an informative message
10346 before saving to clipboard manager.
10347
9486df08
CY
103482012-02-24 Chong Yidong <cyd@gnu.org>
10349
10350 * keyboard.c (process_special_events): Handle all X selection
10351 requests in kbd_buffer, not just the next one (Bug#8869).
10352
f01d3321
CY
103532012-02-23 Chong Yidong <cyd@gnu.org>
10354
10355 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
10356 call when setting menu-bar-lines and tool-bar-lines parameters.
10357 (unwind_create_frame_1): New helper function.
10358
10359 * window.c (inhibit_window_configuration_change_hook): New var.
10360 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 10361 (syms_of_window): Initialize it.
f01d3321 10362
86b847b6
CY
103632012-02-22 Chong Yidong <cyd@gnu.org>
10364
10365 * xterm.c (x_draw_image_relief): Add missing type check for
10366 Vtool_bar_button_margin (Bug#10743).
10367
a59225b1
CY
103682012-02-21 Chong Yidong <cyd@gnu.org>
10369
10370 * fileio.c (Vfile_name_handler_alist): Doc fix.
10371
10372 * buffer.c (Fget_file_buffer): Protect against invalid file
10373 handler return value.
10374
310f5bd4
PE
103752012-02-20 Paul Eggert <eggert@cs.ucla.edu>
10376
cb3a28cc
PE
10377 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
10378 when computing $valmask.
10379
310f5bd4
PE
10380 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
10381 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
10382 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
10383 It's useless in that case, and it can cause problems on hosts
10384 that allocate halves of EMACS_INT values separately.
10385 Reported by Dan Horák. Diagnosed by Andreas Schwab in
10386 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
10387 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
10388 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
10389 it avoids undefined behavior on hosts where shifting right by more
10390 than the word width has undefined behavior.
10391
2375c96a
CY
103922012-02-19 Chong Yidong <cyd@gnu.org>
10393
10394 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
10395 (Funhandled_file_name_directory, Ffile_name_as_directory)
10396 (Fdirectory_file_name, Fexpand_file_name)
10397 (Fsubstitute_in_file_name): Protect against invalid file handler
10398 return values (Bug#10845).
10399
3eb49e71
EZ
104002012-02-18 Eli Zaretskii <eliz@gnu.org>
10401
10402 * .gdbinit (pitx): Fix incorrect references to fields of the
10403 iterator stack.
10404
7b926f3f
CY
104052012-02-17 Chong Yidong <cyd@gnu.org>
10406
10407 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
10408
11273115
PE
104092012-02-15 Paul Eggert <eggert@cs.ucla.edu>
10410
10411 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
10412 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
10413
c3a70e2b
CY
104142012-02-15 Chong Yidong <cyd@gnu.org>
10415
10416 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
10417 marked as special. Also, starting docstrings with * is obsolete.
10418
0ca43699
AS
104192012-02-13 Andreas Schwab <schwab@linux-m68k.org>
10420
10421 * gnutls.c (emacs_gnutls_write): Fix last change.
10422
2e8f3c56
LI
104232012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
10424
10425 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
10426 send_process.
10427
af70074f
SM
104282012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
10429
10430 * keymap.c (Fsingle_key_description): Handle char ranges.
10431
95986d52
CY
104322012-02-12 Chong Yidong <cyd@gnu.org>
10433
afd83bd1
CY
10434 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
10435 as that creates a dangerous corner case.
10436
95986d52
CY
10437 * window.c (Fdelete_window_internal): Invalidate the mouse
10438 highlight (Bug#9904).
10439
bd7da63e
GM
104402012-02-12 Glenn Morris <rgm@gnu.org>
10441
10442 * xselect.c (Fx_own_selection_internal)
10443 (Fx_get_selection_internal, Fx_disown_selection_internal)
10444 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
10445 * nsselect.m (Fx_own_selection_internal)
10446 (Fx_disown_selection_internal, Fx_selection_exists_p)
10447 (Fx_selection_owner_p, Fx_get_selection_internal):
10448 Sync docs and argument specs with the xselect.c versions.
10449
77abcbc2
LI
104502012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
10451
10452 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
10453
90b671e2
EZ
104542012-02-11 Eli Zaretskii <eliz@gnu.org>
10455
1c0ca0b7
EZ
10456 * w32select.c (Fx_selection_exists_p): Sync doc string and
10457 argument list with xselect.c. (Bug#10783)
10458
10459 * w16select.c (Fx_selection_exists_p): Sync doc string and
10460 argument list with xselect.c. (Bug#10783)
90b671e2 10461
49241268
GM
104622012-02-10 Glenn Morris <rgm@gnu.org>
10463
10464 * fns.c (Fsecure_hash): Doc fix.
10465
f998bbe7 104662012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
10467
10468 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
10469
0992bd9c
CY
104702012-02-07 Chong Yidong <cyd@gnu.org>
10471
10472 * buffer.c (Fbuffer_local_variables)
10473 (buffer_lisp_local_variables): Handle unbound vars correctly;
10474 don't let Qunbound leak into Lisp.
10475
af008560
GM
104762012-02-07 Glenn Morris <rgm@gnu.org>
10477
dd605cc4
GM
10478 * image.c (Fimagemagick_types): Doc fix.
10479
af008560
GM
10480 * image.c (imagemagick-render-type): Change it from a lisp object
10481 to an integer. Move the doc here from the lisp manual.
10482 Treat all values not equal to 0 the same.
10483
1449fa1d
CY
104842012-02-06 Chong Yidong <cyd@gnu.org>
10485
10486 * doc.c (store_function_docstring): Avoid applying docstring of
10487 alias to base function (Bug#2603).
10488
3723ec07
AS
104892012-02-04 Andreas Schwab <schwab@linux-m68k.org>
10490
10491 * .gdbinit (pp1, pv1): Remove redundant defines.
10492 (pr): Use pp.
10493
79c1cc1e
CY
104942012-02-04 Chong Yidong <cyd@gnu.org>
10495
10496 * nsterm.m: Declare a global (Bug#10694).
10497
d7f29f8e
EZ
104982012-02-04 Eli Zaretskii <eliz@gnu.org>
10499
cae07000
SM
10500 * w32.c (get_emacs_configuration_options):
10501 Include --enable-checking, if specified, in the return value.
d7f29f8e 10502
3b95a6f9
MR
105032012-02-04 Martin Rudalics <rudalics@gmx.at>
10504
10505 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
10506 after rounding frame sizes. (Bug#9723)
10507
d6fa96a6
EZ
105082012-02-04 Eli Zaretskii <eliz@gnu.org>
10509
10510 * keyboard.c (adjust_point_for_property): Don't position point
10511 before BEGV. (Bug#10696)
10512
df0b2940
PE
105132012-02-03 Paul Eggert <eggert@cs.ucla.edu>
10514
10515 Handle overflow when computing char display width (Bug#9496).
10516 * character.c (char_width): Return EMACS_INT, not int.
10517 (char_width, c_string_width): Check for overflow when
10518 computing the width; this is possible now that individual
10519 characters can have unbounded width. Problem introduced
10520 by merge from Emacs 23 on 2012-01-19.
10521
6bee44d6
MA
105222012-02-02 Michael Albinus <michael.albinus@gmx.de>
10523
10524 * dbusbind.c (Fdbus_register_method): Mention the return value
10525 :ignore in the docstring.
10526
44f92739
GM
105272012-02-02 Glenn Morris <rgm@gnu.org>
10528
1b9f60cc
GM
10529 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
10530
44f92739
GM
10531 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10532 Unconditionally set to t. (Bug#10673)
10533 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
10534 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
10535 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
10536
c5d3843c
KH
105372012-02-02 Kenichi Handa <handa@m17n.org>
10538
10539 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
10540 0, do not call append_composite_glyph.
10541
159462d4 105422012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
10543
10544 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
10545 NULL (Bug#6988).
10546 (x_produce_glyphs): If the component of a composition is a null
10547 string, set it->pixel_width to 1 to avoid zero-width glyph.
10548
78cef877
EZ
105492012-02-01 Eli Zaretskii <eliz@gnu.org>
10550
10551 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
10552 first 2 arguments are identical. This makes inserting large
10553 output from a subprocess an order of magnitude faster on
10554 MS-Windows, where all sbrk'ed memory is always contiguous.
10555
97897668
GM
105562012-01-31 Glenn Morris <rgm@gnu.org>
10557
10558 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 10559 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
10560 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
10561
31fd3586
GM
105622012-01-29 Glenn Morris <rgm@gnu.org>
10563
10564 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
10565
0e24a8b2
CY
105662012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
10567
10568 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
10569
cc0adcb0
CY
105702012-01-28 Chong Yidong <cyd@gnu.org>
10571
10572 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
10573
acc28cb9
CY
105742012-01-26 Chong Yidong <cyd@gnu.org>
10575
9c69cfb7
CY
10576 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
10577
acc28cb9
CY
10578 * search.c (Fsearch_forward, Fsearch_backward): Document negative
10579 repeat counts (Bug#10507).
10580
48da7392
GM
105812012-01-26 Glenn Morris <rgm@gnu.org>
10582
10583 * lread.c (syms_of_lread): Doc fix.
10584
14af5f7f
CY
105852012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
10586
10587 * coding.c (encode_designation_at_bol): Change return value to
10588 EMACS_INT.
10589
0b21c100
CY
105902012-01-25 Chong Yidong <cyd@gnu.org>
10591
10592 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
10593
3c2907f7
CY
105942012-01-21 Chong Yidong <cyd@gnu.org>
10595
10596 * floatfns.c (Fcopysign): Make the second argument non-optional,
10597 since nil is not allowed anyway.
10598
959ad23f
AS
105992012-01-21 Andreas Schwab <schwab@linux-m68k.org>
10600
10601 * process.c (read_process_output): Use p instead of XPROCESS (proc).
10602 (send_process): Likewise.
10603
34a02f46
MR
106042012-01-19 Martin Rudalics <rudalics@gmx.at>
10605
10606 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
10607 (Vwindow_persistent_parameters): Do not use Qstate.
10608 Rewrite doc-strings.
34a02f46 10609
1259009a 106102012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
10611
10612 * character.c (char_width): New function.
70d4fdf6
GM
10613 (Fchar_width, c_string_width, lisp_string_width):
10614 Use char_width (Bug#9496).
25ed9e61 10615
6a6ee00d
MR
106162012-01-16 Martin Rudalics <rudalics@gmx.at>
10617
10618 * window.c (Vwindow_persistent_parameters): New variable.
10619 (Fset_window_configuration, save_window_save): Handle persistent
10620 window parameters.
10621
c85efaf7
EZ
106222012-01-14 Eli Zaretskii <eliz@gnu.org>
10623
10624 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
10625 thrashing the stack of the thread. (Bug#9087)
10626
5944709e
PE
106272012-01-12 Paul Eggert <eggert@cs.ucla.edu>
10628
10629 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
10630
e71f5d99
EZ
106312012-01-11 Eli Zaretskii <eliz@gnu.org>
10632
10633 * xdisp.c (rows_from_pos_range): Handle the case where the
10634 highlight ends on a newline. (Bug#10464)
10635 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
10636 he end column for display of highlight that ends on a newline
10637 before a R2L line.
10638
ce316182
GM
106392012-01-11 Glenn Morris <rgm@gnu.org>
10640
10641 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
10642 from load-path also when installation-directory is nil. (Bug#10208)
10643
5b43da69
GM
106442012-01-10 Glenn Morris <rgm@gnu.org>
10645
74cc8ff9
GM
10646 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
10647
7d8d6e4e
GM
10648 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
10649 Update template values to be closer to their typical values these days.
5b43da69 10650
a0db8d43
EZ
106512012-01-09 Eli Zaretskii <eliz@gnu.org>
10652
10653 * xdisp.c (rows_from_pos_range): Accept additional argument
10654 DISP_STRING, and accept any glyph in a row whose object is that
10655 string as eligible for mouse highlight. Fixes mouse highlight of
10656 display strings from overlays. (Bug#10464)
10657
9a0115ab 106582012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 10659
b9110d6a 10660 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
10661 * fileio.c (auto_saving_dir_umask): New static var.
10662 (Fmake_directory_internal): Use it.
10663 (do_auto_save_make_dir): Set it, instead of invoking chmod after
10664 creating the directory. The old code temporarily assigns
10665 too-generous permissions to the directory.
10666 (do_auto_save_eh): Clear it.
b9110d6a 10667 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
10668 that the var is always cleared.
10669
6c1bd3f3
EZ
106702012-01-07 Eli Zaretskii <eliz@gnu.org>
10671
10672 * search.c (scan_buffer): Pass character positions to
10673 know_region_cache, not byte positions. (Bug#6540)
10674
069d2b50
L
106752012-01-07 LynX <_LynX@bk.ru> (tiny change)
10676
10677 * w32.c (sys_rename): Report EXDEV when rename of a directory
10678 fails because the target is on another logical disk. (Bug#10284)
10679
75bf0d33
DB
106802012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
10681
10682 * xterm.c (x_embed_request_focus): New function.
10683
10684 * xterm.h: Add prototype.
10685
10686 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
10687
1c6e5a32
GM
106882012-01-05 Glenn Morris <rgm@gnu.org>
10689
10690 * emacs.c (emacs_copyright): Update short copyright year to 2012.
10691
651e947e
EZ
106922012-01-01 Eli Zaretskii <eliz@gnu.org>
10693
10694 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
10695 Load gnutls_transport_set_lowat only if GnuTLS version is below
10696 2.11.1.
10697 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
10698 GnuTLS versions below 2.11.1.
10699
3778cdd8
AL
107002011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
10701
10702 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
10703 to the doc string advising against its use for altering the way
10704 windows are scrolled.
10705
0e5317f7
KH
107062011-12-28 Kenichi Handa <handa@m17n.org>
10707
10708 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
10709 coding-system ASCII compatible only when it does not produce BOM
10710 on encoding (Bug#10383).
10711
93d5ca1f
JD
107122011-12-26 Jan Djärv <jan.h.d@swipnet.se>
10713
10714 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
10715 can scroll.
10716 (create_and_show_popup_menu): Always use menu_position_func for
10717 Gtk3 (Bug#10361).
10718
ca22b785
AS
107192011-12-24 Andreas Schwab <schwab@linux-m68k.org>
10720
10721 * callint.c (Fcall_interactively): Don't truncate prompt string.
10722
d048e1e6
EZ
107232011-12-23 Eli Zaretskii <eliz@gnu.org>
10724
10725 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
10726 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 10727 resumed from there (after widening). (Bug#10360)
d048e1e6 10728
5ccaba1f
JD
107292011-12-22 Jan Djärv <jan.h.d@swipnet.se>
10730
10731 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
10732
204ee57f
JD
107332011-12-21 Jan Djärv <jan.h.d@swipnet.se>
10734
b81d40f0
JB
10735 * nsterm.m (x_free_frame_resources):
10736 Release f->output_data.ns->miniimage.
204ee57f
JD
10737 (ns_index_color): Fix indentation. Do not retain
10738 color_table->colors[i].
10739
10740 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
10741 before returning.
10742
10743 * nsfns.m (x_set_background_color): Assign return value from
10744 ns_index_color to face-background instead of NSColor*.
10745 (ns_implicitly_set_icon_type): Fix indentation.
10746 Change assignment in for loop to comparison.
10747
10748 * emacs.c (ns_pool): New variable.
10749 (main): Assign ns_pool.
10750 (Fkill_emacs): Call ns_release_autorelease_pool.
10751
10752 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
10753 autorelease fdesc, release fdAttrs and tdict.
10754 (ns_get_covering_families): Release charset.
10755 (ns_findfonts): Release NSFontDescriptor created with new.
10756 (ns_uni_to_glyphs): Fix indentation.
10757 (setString): Release attrStr before assigning new value.
10758
c803b2b7
JD
107592011-12-18 Jan Djärv <jan.h.d@swipnet.se>
10760
678f4426
JD
10761 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
10762 and NS_IMPL_COCOA.
10763 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
10764 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
10765
cd394be1 107662011-12-18 David Reitter <reitter@cmu.edu>
678f4426 10767
5fecd5fc
JD
10768 * nsterm.m (ns_term_init): Subscribe for notifications
10769 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
10770 to method trackingNotification in EmacsMenu.
10771
10772 * nsmenu.m (trackingMenu): New variable.
3771cb17 10773 (trackingNotification): New method (from Aquamacs).
5fecd5fc 10774 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 10775 from Aquamacs (Bug#7030).
678f4426
JD
10776
107772011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 10778
c803b2b7
JD
10779 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
10780 (symbol_to_nsstring): Fix indentation.
10781 (ns_symbol_to_pb): New function.
cae07000
SM
10782 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
10783 (Fns_rotate_cut_buffers_internal): Remove.
10784 (Fns_store_selection_internal): Rename from
c803b2b7
JD
10785 Fns_store_cut_buffer_internal.
10786 (ns_get_foreign_selection, Fx_own_selection_internal)
10787 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
10788 (Fns_get_selection_internal, Fns_store_selection_internal):
10789 Use ns_symbol_to_pb and check if return value is nil.
10790 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
10791 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
10792 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
10793 renamed to Sns_store_selection_internal.
10794 (ns_handle_selection_request): Move code to Fx_own_selection_internal
10795 and remove this function.
10796 (ns_handle_selection_clear): Remove, never used.
10797 (Fx_own_selection_internal): Move code from ns_handle_selection_request
10798 here.
10799
e1b01a3a
KB
108002011-12-17 Ken Brown <kbrown@cornell.edu>
10801
10802 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
10803 GID is unknown (Bug#10257).
10804
2adb6e85
PE
108052011-12-17 Paul Eggert <eggert@cs.ucla.edu>
10806
10807 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
10808 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
10809 which caused a build failure on GNU/Linux IA-64. This problem was
10810 introduced by my 2011-10-07 patch.
10811
d1d7b339
JL
108122011-12-15 Juri Linkov <juri@jurta.org>
10813
10814 * image.c (imagemagick_error): New function. (Bug#10112)
10815 (imagemagick_load_image): Comment out `MagickSetResolution' call.
10816 Use `imagemagick_error' where ImageMagick functions return
10817 `MagickFalse'.
10818 (Fimagemagick_types): Add `Fnreverse' to return the list in the
10819 proper order.
10820
100d5755
KH
108212011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10822
10823 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
10824 fill background (Bug#8992).
10825
454592a6
MR
108262011-12-13 Martin Rudalics <rudalics@gmx.at>
10827
10828 * window.c (Vwindow_combination_resize)
10829 (Vwindow_combination_limit): Use t instead of non-nil in
10830 doc-strings.
61d4b438
MR
10831 (Vrecenter_redisplay): Add first sentence of doc-string on
10832 separate line.
53524d93 10833 (Frecenter): Fix doc-string typo.
454592a6 10834
3633e3aa
KH
108352011-12-11 Kenichi Handa <handa@m17n.org>
10836
10837 * coding.c (Funencodable_char_position): Pay attention to the
10838 buffer text relocation (Bug#9389).
10839
7b9d523a 108402011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 10841
7b9d523a
JD
10842 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
10843 gtk_init (Bug#10100).
10844
b73189c6
EZ
108452011-12-10 Eli Zaretskii <eliz@gnu.org>
10846
10847 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
10848 IT->string is nil. (Bug#10263)
10849
f7dfe5d6
JD
108502011-12-10 Jan Djärv <jan.h.d@swipnet.se>
10851
83faebb4
JD
10852 * nsterm.h (x_free_frame_resources): Declare.
10853
f7dfe5d6
JD
10854 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
10855 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
10856
10857 * nsterm.h (ns_get_defaults_value): Declare.
10858
10859 * nsterm.m (ns_default): Call ns_get_defaults_value.
10860
7cd4e72c
EZ
108612011-12-09 Eli Zaretskii <eliz@gnu.org>
10862
10863 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
10864 (Bug#10170)
10865
b34d7317
YM
108662011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
10867
10868 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
10869 that where the value of an _OBJC_* symbol points to is in the .bss
10870 section (Bug#10240).
10871
76470ad1
KH
108722011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10873
10874 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 10875 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 10876
745fff94
KH
108772011-12-08 Kenichi Handa <handa@m17n.org>
10878
10879 * ftfont.c (get_adstyle_property): Fix previous change
10880 (Bug#10233).
10881
6e44397c
JB
108822011-12-07 Juanma Barranquero <lekktu@gmail.com>
10883
10884 * w32.c (init_environment): If no_site_lisp, remove site-lisp
10885 dirs from the default value of EMACSLOADPATH (bug#10208).
10886
7efa6272
GM
108872011-12-07 Glenn Morris <rgm@gnu.org>
10888
10889 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
10890 installation and source directories as well. (Bug#10208)
10891
f6fc4d87
CY
108922011-12-06 Chong Yidong <cyd@gnu.org>
10893
10894 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
10895
2bf26180
GM
108962011-12-06 Glenn Morris <rgm@gnu.org>
10897
10898 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
10899 as an error, not just -1. (Bug#10217)
10900
3a6ad4f0
CY
109012011-12-05 Chong Yidong <cyd@gnu.org>
10902
10903 * keyboard.c (process_special_events): New function.
10904 (swallow_events, Finput_pending_p): Use it (Bug#10195).
10905
75a3b399
PE
109062011-12-05 Paul Eggert <eggert@cs.ucla.edu>
10907
10908 * coding.c (encode_designation_at_bol): Don't use uninitialized
10909 local variable (Bug#9318).
10910
c3c9e25e
KH
109112011-12-05 Kenichi Handa <handa@m17n.org>
10912
10913 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
10914 return Qnil (Bug#8046, Bug#10193).
10915
5eb05ea3
KH
109162011-12-05 Kenichi Handa <handa@m17n.org>
10917
10918 * coding.c (encode_designation_at_bol): New args charbuf_end and
10919 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
10920 (coding_set_source): Return how many bytes coding->source was
10921 relocated.
10922 (coding_set_destination): Return how many bytes
10923 coding->destination was relocated.
10924 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 10925 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
10926
109272011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10928
10929 * coding.c (CODING_CHAR_CHARSET_P): New macro.
10930 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
10931 macro (Bug#9318).
10932
109332011-12-05 Andreas Schwab <schwab@linux-m68k.org>
10934
10935 The following changes are to fix Bug#9318.
10936
a79703f5 10937 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
10938 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
10939 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 10940 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 10941
7dbda6df
JB
109422011-12-05 Juanma Barranquero <lekktu@gmail.com>
10943
10944 * lisp.h (process_quit_flag): Fix external declaration.
10945
6d5eb5b0
SM
109462011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
10947
10948 Don't macro-inline non-performance-critical code.
10949 * eval.c (process_quit_flag): New function.
10950 * lisp.h (QUIT): Use it.
10951
a0c3fad0
JD
109522011-12-04 Jan Djärv <jan.h.d@swipnet.se>
10953
10954 * nsfns.m (get_geometry_from_preferences): New function.
10955 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
10956
6c07aac2
AS
109572011-12-04 Andreas Schwab <schwab@linux-m68k.org>
10958
10959 * emacs.c (Qkill_emacs): Define.
10960 (syms_of_emacs): Initialize it.
10961 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
10962 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
10963 (quit_throw_to_read_char): Add parameter `from_signal'.
10964 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
10965 * lisp.h (QUIT): Call Fkill_emacs if requested.
10966
c052ead4
JD
109672011-12-03 Jan Djärv <jan.h.d@swipnet.se>
10968
10969 * widget.c (update_wm_hints): Return if wmshell is null.
10970 (widget_update_wm_size_hints): New function.
10971
10972 * widget.h (widget_update_wm_size_hints): Declare.
10973
10974 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
10975 widget_update_wm_size_hints (Bug#10104).
10976
9e49252b
EZ
109772011-12-03 Eli Zaretskii <eliz@gnu.org>
10978
10979 * xdisp.c (handle_invisible_prop): If the invisible text ends just
10980 before a newline, prepare the bidi iterator for consuming the
10981 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 10982 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 10983
02b16839
JL
109842011-12-02 Juri Linkov <juri@jurta.org>
10985
10986 * search.c (Fword_search_regexp): New Lisp function created from
10987 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
10988 (Fword_search_backward, Fword_search_forward)
10989 (Fword_search_backward_lax, Fword_search_forward_lax):
10990 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
10991 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
10992
0068070e
SM
109932011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
10994
10995 * fileio.c (Finsert_file_contents): Move after-change-function call
10996 to before the "handled:" label, since all "goto handled" appear in
10997 cases where the *-change-functions have already been properly called
10998 (bug#10117).
10999
3360a3fc
AS
110002011-12-01 Andreas Schwab <schwab@linux-m68k.org>
11001
11002 * keyboard.c (interrupt_signal): Don't call kill-emacs when
11003 waiting for input. (Bug#10169)
11004
73d6c093
EZ
110052011-11-30 Eli Zaretskii <eliz@gnu.org>
11006
11007 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
11008 verifies glyph row's hash code--we have just reallocated the
11009 glyphs, so their contents can be complete garbage. (Bug#10164)
11010
febe6bea
JB
110112011-11-30 Juanma Barranquero <lekktu@gmail.com>
11012
11013 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
11014
801a4313
EZ
110152011-11-30 Eli Zaretskii <eliz@gnu.org>
11016
11017 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
11018 attributes are tested _before_ calling verify_row_hash, to protect
11019 against GCC re-ordering of the tests. (Bug#10164)
11020
2b56b87e
JD
110212011-11-29 Jan Djärv <jan.h.d@swipnet.se>
11022
11023 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
11024
11025 * xterm.c (handle_one_xevent): Only set async_visible and friends
11026 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 11027 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
11028 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
11029
dbf31225
PE
110302011-11-28 Paul Eggert <eggert@cs.ucla.edu>
11031
11032 Remove GCPRO-related macros that exist only to avoid shadowing locals.
11033 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
11034 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
11035 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11036 All uses changed to use GCPRO1 etc.
11037 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
11038 Revert to old implementation (i.e., before 2011-03-11).
11039
1305621b
YM
110402011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11041
11042 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
11043 of scroll runs so as to avoid assigning disabled bogus rows and
11044 unnecessary graphics copy operations.
11045
8c9afb46
EZ
110462011-11-27 Eli Zaretskii <eliz@gnu.org>
11047
11048 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
11049 (snprintf) [_MSC_VER]: Redirect to _snprintf.
11050 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
11051 (malloc, free, realloc, calloc): Redirect to e_* only when
11052 compiling Emacs.
11053
11054 * lisp.h (GCTYPEBITS): Move before first use.
11055 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
11056 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
11057 this macro definition.
11058
11059 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
11060 _MSC_VER.
11061
54e9e3bf
JD
110622011-11-27 Jan Djärv <jan.h.d@swipnet.se>
11063
6d5eb5b0
SM
11064 * gtkutil.c (xg_create_frame_widgets):
11065 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
11066 present with Gtk+ 2.0.
11067
83aca1cb
PE
110682011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11069
11070 * fileio.c (Finsert_file_contents): Undo previous change; see
11071 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
11072
5b76caa4
PE
110732011-11-26 Paul Eggert <eggert@cs.ucla.edu>
11074
11075 Rename locals to avoid shadowing.
11076 * fileio.c (Finsert_file_contents):
11077 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
11078 * process.c (wait_reading_process_output):
11079 Rename inner 'proc' to 'p' to avoid shadowing.
11080 Indent for consistency with usual Emacs style.
11081
8c535114
EZ
110822011-11-25 Eli Zaretskii <eliz@gnu.org>
11083
11084 * xdisp.c (redisplay_window): If cursor row is not fully visible
11085 after recentering, and scroll-conservatively is set to a large
11086 number, scroll window by a few more lines to make the cursor fully
11087 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
11088 (start_display): Don't move to the next line if the display should
11089 start at a newline that is part of a display vector or an overlay
11090 string. (Bug#10119)
8c535114 11091
fa4fdb5c
JL
110922011-11-24 Juri Linkov <juri@jurta.org>
11093
11094 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
11095 after the `MagickPingImage' call. (Bug#10112)
11096
90ec88df
CY
110972011-11-23 Chong Yidong <cyd@gnu.org>
11098
11099 * window.c (Fcoordinates_in_window_p): Accept only live windows.
11100
56e2e794
MR
111012011-11-23 Martin Rudalics <rudalics@gmx.at>
11102
11103 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
11104 making another buffer current. (Bug#10114)
11105
b6e64c41
GM
111062011-11-23 Glenn Morris <rgm@gnu.org>
11107
11108 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
11109
6b21de18
CY
111102011-11-23 Chong Yidong <cyd@gnu.org>
11111
11112 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
11113 using it (Bug#5984).
11114
b12cd789
EZ
111152011-11-22 Eli Zaretskii <eliz@gnu.org>
11116
11117 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
11118 and header-lines, as they don't have one computed for them.
11119 (Bug#10098)
11120
11121 * .gdbinit (prow): Make displayed values more self-explaining.
11122 Add row's hash code.
11123
261b6fd4
LMI
111242011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
11125
11126 * process.c (wait_reading_process_output): Fix asynchrounous
11127 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 11128 (wait_reading_process_output): Add comment and URL.
261b6fd4 11129
e7cfd277
JD
111302011-11-21 Jan Djärv <jan.h.d@swipnet.se>
11131
11132 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
11133
a9b9b7f5
CY
111342011-11-21 Chong Yidong <cyd@gnu.org>
11135
11136 * window.c (Fnext_window, Fprevious_window): Doc fix.
11137
b0d15b4f
SM
111382011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11139
11140 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
11141
fe7a3057
JB
111422011-11-20 Juanma Barranquero <lekktu@gmail.com>
11143
11144 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
11145
d2999b1a
MR
111462011-11-20 Martin Rudalics <rudalics@gmx.at>
11147
11148 * window.c (Fset_window_combination_limit): Rename argument
11149 STATUS to LIMIT.
11150 (Vwindow_combination_limit): Remove "status" from doc-string.
11151
d5ff9cd0
AS
111522011-11-20 Andreas Schwab <schwab@linux-m68k.org>
11153
11154 * m/ibms390.h: Remove.
11155 * m/ibms390x.h: Don't include "ibms390.h".
11156
a5bb9bd3
SM
111572011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
11158
11159 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
11160 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
11161
cd1181db
JB
111622011-11-20 Juanma Barranquero <lekktu@gmail.com>
11163
11164 * casetab.c (Fset_case_table):
11165 * charset.c (Fcharset_after): Fix typos.
11166
615a3b8d 111672011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 11168
17e845af
PE
11169 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
11170 Otherwise, valgrind does not work on some platforms.
11171 Problem reported by Andreas Schwab in
6a0bf43d
PE
11172 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
11173 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
11174 is set, removing the need for VIRT_ADDRESS_VARIES.
11175 (PURE_P): Use a more-efficient implementation that needs just one
11176 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
11177 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
11178 to 4 (xorl, subq, cmpq, setbe).
11179 * alloc.c (pure): Always extern now, since that's the
11180 VIRT_ADDR_VARIES behavior.
11181 (PURE_POINTER_P): Use a single comparison, not two, for
11182 consistency with the new puresize.h.
11183 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
11184 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
11185 Remove VIRT_ADDR_VARIES no longer needed.
11186
f8fe6f96
EZ
111872011-11-19 Eli Zaretskii <eliz@gnu.org>
11188
11189 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
11190 (erase_phys_cursor, update_window_cursor, show_mouse_face)
11191 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
11192 behave as if the cursor position were at the window margin.
11193
11194 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
11195 and the cursor position is out of bounds, behave as if the cursor
11196 position were at the window margin. (Bug#10075)
11197
df05a53c
CY
111982011-11-18 Chong Yidong <cyd@gnu.org>
11199
11200 * window.c (Fwindow_combination_limit): Make first argument
11201 non-optional, since it is meaningless for live windows like the
11202 selected window.
61ccba97 11203
2071918e
DA
112042011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
11205
11206 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
11207
b50a28de
SM
112082011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
11209
11210 * intervals.c: Fix grafting over the whole buffer (bug#10071).
11211 (graft_intervals_into_buffer): Simplify.
11212
015137db
EZ
112132011-11-18 Eli Zaretskii <eliz@gnu.org>
11214
11215 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
11216 hash values of the two rows.
11217 (copy_row_except_pointers): Preserve the used[] arrays and the
11218 hash values of the two rows. (Bug#10035)
68c95424 11219 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
11220
11221 * xdisp.c (row_hash): New function, body extracted from
11222 compute_line_metrics.
11223 (compute_line_metrics): Call row_hash, instead of computing the
11224 hash code inline.
11225
11226 * dispnew.c (verify_row_hash): Call row_hash for computing the
11227 hash code of a row, instead of duplicating code from xdisp.c.
11228
11229 * dispextern.h (row_hash): Add prototype.
11230
a2addb04
TH
112312011-11-18 Tassilo Horn <tassilo@member.fsf.org>
11232
11233 * frame.c (delete_frame): Don't delete the terminal when the last
11234 X frame is closed if emacs is built with GTK toolkit.
11235
df85d315
JB
112362011-11-17 Juanma Barranquero <lekktu@gmail.com>
11237
11238 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
11239
a0c2d0ae
MR
112402011-11-17 Martin Rudalics <rudalics@gmx.at>
11241
11242 * window.c (Vwindow_splits): Rename to
11243 Vwindow_combination_resize. Suggested by Juri Linkov.
11244 (Fsplit_window_internal): Use Vwindow_combination_resize instead
11245 of Vwindow_splits.
11246
58179cce
JB
112472011-11-16 Juanma Barranquero <lekktu@gmail.com>
11248
7877f373
JB
11249 * nsfns.m (Fns_font_name):
11250 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 11251
b6f67890
MR
112522011-11-16 Martin Rudalics <rudalics@gmx.at>
11253
11254 * window.h (window): Rename slot "nest" to "combination_limit".
11255 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
11256 (Fset_window_nest): Rename to Fset_window_combination_limit.
11257 (Vwindow_nest): Rename to Vwindow_combination_limit.
11258 (recombine_windows, make_parent_window, make_window)
11259 (Fsplit_window_internal, saved_window)
11260 (Fset_window_configuration, save_window_save): Rename all
11261 occurrences of window_nest to window_combination_limit.
11262
c7015153
JB
112632011-11-15 Juanma Barranquero <lekktu@gmail.com>
11264
11265 * image.c (imagemagick_load_image): Fix typo.
11266
322ad6ec
EZ
112672011-11-14 Eli Zaretskii <eliz@gnu.org>
11268
11269 * xdisp.c (display_line): Move the call to
11270 highlight_trailing_whitespace before the call to
11271 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
11272 faces of all the glyphs to compute ROW's hash value.
11273 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 11274
f067b8ec
JB
112752011-11-14 Juanma Barranquero <lekktu@gmail.com>
11276
11277 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
11278 just return (bug#10044).
11279
1e5b2111
EZ
112802011-11-12 Eli Zaretskii <eliz@gnu.org>
11281
7ef3cbd5
EZ
11282 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
11283 with user-defined heap size. Bump the default size of the temacs
11284 heap to 27MB, to avoid memory warning when running temacs.
11285 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
11286
1e5b2111
EZ
11287 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
11288 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
11289 (verify_row_hash) [XASSERTS]: New function.
11290 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
11291 that the hash value of glyph rows is correct.
1e5b2111 11292
89d61221
MR
112932011-11-12 Martin Rudalics <rudalics@gmx.at>
11294
11295 * window.h (window): Remove splits slot.
11296 * window.c (Fwindow_splits, Fset_window_splits): Remove.
11297 (Fdelete_other_windows_internal, make_parent_window)
11298 (make_window, Fsplit_window_internal, Fdelete_window_internal)
11299 (Fset_window_configuration, save_window_save): Don't deal with
11300 split status of windows.
11301 (saved_window): Remove splits slot.
11302 (Vwindow_splits): Rewrite doc-string.
11303
97f18cc8
JD
113042011-11-11 Jan Djärv <jan.h.d@swipnet.se>
11305
11306 * xfns.c (unwind_create_frame):
11307 * nsfns.m (unwind_create_frame):
11308 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
11309 Vframe_list (Bug#9999).
11310
22a648b4
DA
113112011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
11312
0b381c7e 11313 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 11314
659afede
KH
113152011-11-11 Kenichi Handa <handa@m17n.org>
11316
11317 * callproc.c (Fcall_process): Set the member dst_multibyte of
11318 process_coding.
11319
9ac0394b
KH
113202011-11-11 Johan Bockgård <bojohan@gnu.org>
11321
11322 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
11323 avoid a crash (bug#9496).
11324
2fbdc249
CY
113252011-11-09 Chong Yidong <cyd@gnu.org>
11326
11327 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
11328 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
11329
ac6b1f81
PE
113302011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11331
11332 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
11333
09db192c
PE
113342011-11-08 Paul Eggert <eggert@cs.ucla.edu>
11335
11336 Avoid some portability problems by eschewing 'extern inline' functions.
11337 The trivial performance wins aren't worth the portability hassles; see
11338 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
11339 et seq.
11340 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11341 (window_box_width, window_box_left, window_box_left_offset)
11342 (window_box_right, window_box_right_offset): Undo previous change,
11343 by removing the "extern"s.
11344 * intervals.c (adjust_intervals_for_insertion)
11345 (adjust_intervals_for_deletion): Undo previous change,
11346 making these static again.
11347 (offset_intervals, temp_set_point_both, temp_set_point)
11348 (copy_intervals_to_string): No longer inline.
11349 * xdisp.c (window_text_bottom_y, window_box_width)
11350 (window_box_height, window_box_left_offset)
11351 (window_box_right_offset, window_box_left, window_box_right)
11352 (window_box): No longer inline.
11353
105216ed
CY
113542011-11-08 Chong Yidong <cyd@gnu.org>
11355
11356 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
11357 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
11358 Signal an error if not a live window.
105216ed
CY
11359 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
11360 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
11361
ae9e237f
JB
113622011-11-07 Juanma Barranquero <lekktu@gmail.com>
11363
11364 * lisp.h (syms_of_abbrev): Remove declaration.
11365 Reported by CHENG Gao <chenggao@royau.me>.
11366
c7aa8333
EZ
113672011-11-07 Eli Zaretskii <eliz@gnu.org>
11368
11369 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
11370 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
11371 of temacs in GUI mode.
11372
be7f5545
MR
113732011-11-07 Martin Rudalics <rudalics@gmx.at>
11374
11375 * window.h: Declare delete_all_child_windows instead of
11376 delete_all_subwindows.
11377 * window.c (Fwindow_nest, Fset_window_nest)
11378 (Fset_window_new_total, Fset_window_new_normal)
11379 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
11380 (delete_all_subwindows): Rename to delete_all_child_windows.
11381 (Fdelete_other_windows_internal, Fset_window_configuration):
11382 Call delete_all_child_windows instead of delete_all_subwindows.
11383 * frame.c (delete_frame): Call delete_all_child_windows instead
11384 of delete_all_subwindows.
11385
ca78dc43
PE
113862011-11-07 Paul Eggert <eggert@cs.ucla.edu>
11387
11388 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
11389 This is also needed for porting to any host where GC_MARK_STACK is
11390 not GC_MAKE_GCPROS_NOOPS.
11391 (which_symbols): Use it.
11392
a0241d01
KH
113932011-11-07 Kenichi Handa <handa@m17n.org>
11394
11395 * coding.c (coding_set_destination): Check coding->src_pos only
11396 when coding->src_object is a buffer (bug#9910).
11397
11398 * process.c (send_process): Set the member src_multibyte of coding
11399 to 0 (bug#9911) when sending a unibyte text.
11400
11401 * callproc.c (Fcall_process): Set the member src_multibyte of
11402 process_coding to 0 (bug#9912).
11403
a64bfdfa 114042011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
11405
11406 * xmenu.c (cleanup_widget_value_tree): New function.
11407 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
11408 calling free_menubar_widget_value_tree directly (Bug#9830).
11409
cb41b32a
PE
114102011-11-06 Paul Eggert <eggert@cs.ucla.edu>
11411
11412 Fix some portability problems with 'inline'.
11413 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
11414 (window_box_width, window_box_left, window_box_left_offset)
11415 (window_box_right, window_box_right_offset): Declare extern.
11416 Otherwise, these inline functions do not conform to C99 and
11417 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
11418 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
11419 * intervals.c (adjust_intervals_for_insertion)
11420 (adjust_intervals_for_deletion): Now extern, because otherwise the
11421 extern inline functions 'offset_intervals' couldn't refer to it.
11422 (static_offset_intervals): Remove.
11423 (offset_intervals): Rewrite using the old contents of
11424 static_offset_intervals. The old version didn't conform to C99
11425 because an extern inline function contained a reference to an
11426 identifier with static linkage.
11427
b7041366
AS
114282011-11-06 Andreas Schwab <schwab@linux-m68k.org>
11429
11430 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
11431 GC.
11432
88a37c4d
EZ
114332011-11-06 Eli Zaretskii <eliz@gnu.org>
11434
11435 * xdisp.c (init_iterator, reseat_to_string): Don't set the
11436 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
11437 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
11438 return Qleft_to_right.
11439
49745b39
CY
114402011-11-06 Chong Yidong <cyd@gnu.org>
11441
11442 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
11443 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
11444 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
11445 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
11446 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
11447 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
11448 (Fwindow_vscroll): Doc fix.
11449 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
11450 argument, since it makes no sense to pass a live window and for
11451 consistency with window-child.
11452
1f05cd82
CS
114532011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
11454
11455 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
11456 support MSVC.
11457
22610910
JR
114582011-11-05 Jason Rumney <jasonr@gnu.org>
11459
11460 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
11461 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
11462 fonts (Bug#6029).
11463 (add_font_entity_to_list): Fix logic errors in mixed boolean and
11464 bitwise arithmetic preventing use of unicode-sip and non-truetype
11465 opentype fonts.
11466
a06776b2
EZ
114672011-11-05 Eli Zaretskii <eliz@gnu.org>
11468
3ad924ba
EZ
11469 * s/ms-w32.h (fstat, stat, utime): Move redirections to
11470 "emacs"-only part.
11471
a06776b2
EZ
11472 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
11473 initialization code to keep similarity to xfns.c after changes
11474 from 2011-11-05.
11475
c9e7db78
JD
114762011-11-05 Jan Djärv <jan.h.d@swipnet.se>
11477
a97f8f3f
JD
11478 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
11479 (unwind_create_frame): New function (Bug#9943).
11480 (Fx_create_frame): Restructure code to be more similar to the one in
11481 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
11482 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
11483 Move terminal->reference_count++ just before making the frame official
11484 (Bug#9943).
11485
11486 * nsterm.m (x_free_frame_resources): New function.
11487 (x_destroy_window): Move code to x_free_frame_resources.
11488
c9e7db78 11489 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
11490 (Fx_create_frame, x_create_tip_frame):
11491 Move terminal->reference_count++ just before making the frame
75f1671a 11492 official. Move initialization of image_cache_refcount and
c9e7db78
JD
11493 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
11494
a6fc3b5c
EZ
114952011-11-05 Eli Zaretskii <eliz@gnu.org>
11496
11497 Support MSVC build with newer versions of Visual Studio.
11498 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
11499 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
11500 nt/gmake.defs.
11501
11502 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
11503 which are not supported by MSVC.
11504 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
11505 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
11506 bitfields.
11507 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
11508 types in bitfields.
11509 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
11510
11511 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
11512
58179cce 115132011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
11514
11515 Support MSVC build with newer versions of Visual Studio.
11516 * w32.c: Don't include w32api.h for MSVC.
11517 (init_environment) [_MSC_VER]: Call sys_access, not _access.
11518
11519 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
11520 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
11521 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
11522 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
11523 e_* cousins.
11524 (alloca) [_MSC_VER]: Define to _alloca.
11525
11526 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
11527
11528 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
11529
a58c13ed
EZ
115302011-11-04 Eli Zaretskii <eliz@gnu.org>
11531
11532 * xdisp.c (note_mouse_highlight): If either of
11533 previous/next-single-property-change returns nil, treat that as
11534 the beginning or the end of the buffer. (Bug#9955)
11535
fe0b6370
JD
115362011-11-04 Jan Djärv <jan.h.d@swipnet.se>
11537
a58c13ed 11538 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
11539 label is not null (Bug#9951).
11540 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
11541 may be NULL.
11542
89bd5ee1
EZ
115432011-11-04 Eli Zaretskii <eliz@gnu.org>
11544
11545 * window.c (Fwindow_body_size): Mention in the doc string that the
11546 return value is in frame's canonical units. (Bug#9949)
11547
84c3edb9
EZ
115482011-11-03 Eli Zaretskii <eliz@gnu.org>
11549
4e2fb5c7
EZ
11550 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
11551
84c3edb9 11552 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 11553 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 11554 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 11555
bc17a887
EZ
115562011-11-01 Eli Zaretskii <eliz@gnu.org>
11557
11558 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
11559 Don't stop backward scan on the continuation glyph, even though
11560 its CHARPOS is positive.
6d5eb5b0
SM
11561 (mouse_face_from_buffer_pos, note_mouse_highlight):
11562 Rename cover_string to disp_string.
bc17a887 11563
4ee88440
MR
115642011-11-01 Martin Rudalics <rudalics@gmx.at>
11565
11566 * window.c (temp_output_buffer_show): Don't use
11567 Vtemp_buffer_show_specifiers.
11568 (Vtemp_buffer_show_specifiers): Remove unused variable.
11569
c2ff3c02
EZ
115702011-10-30 Eli Zaretskii <eliz@gnu.org>
11571
11572 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
11573 past the beginning of the current glyph matrix.
11574
58179cce 115752011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
11576
11577 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
11578 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
11579 HAVE_GTK3 (Bug#9869).
b77a6a7f 11580
3b574623
JD
11581 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
11582 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
11583
b77a6a7f
JD
11584 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
11585
11586 * xterm.c: Declare x_handle_net_wm_state to return int.
11587 (handle_one_xevent): Check if we are iconified but don't have
11588 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
11589 (get_current_wm_state): Return non-zero if not hidden,
11590 check for _NET_WM_STATE_HIDDEN (Bug#9893).
11591 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
11592 (x_handle_net_wm_state): Return what get_current_wm_state returns.
11593 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
11594
196e41e4
PE
115952011-10-29 Paul Eggert <eggert@cs.ucla.edu>
11596
11597 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
11598 so that this new function doesn't get optimized away by a
11599 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
11600
021f2e1a
AS
116012011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11602
11603 * frame.h (MOUSE_HL_INFO): Remove excess parens.
11604
8b058d44
EZ
116052011-10-29 Eli Zaretskii <eliz@gnu.org>
11606
11607 Fix the `xbytecode' command.
11608 * .gdbinit (xprintbytestr): New command.
b50a28de 11609 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
11610 (xbytecode): Print the byte-code string as well.
11611
4452fb80
EZ
116122011-10-29 Kim Storm <storm@cua.dk>
11613
8b058d44
EZ
11614 * alloc.c (which_symbols): New function.
11615
21b72067
AS
116162011-10-29 Andreas Schwab <schwab@linux-m68k.org>
11617
11618 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
11619 line. (Bug#9903)
11620
83ed7b5c
GM
116212011-10-29 Glenn Morris <rgm@gnu.org>
11622
11623 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
11624 Not clear what it was for, and it causes various bugs. (Bug#9839)
11625
5a7a728b
EZ
116262011-10-28 Eli Zaretskii <eliz@gnu.org>
11627
11628 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
11629 possible random value that matches one of those tested as
11630 condition to clear the mouse face.
11631
d3d0842f
CY
116322011-10-28 Chong Yidong <cyd@gnu.org>
11633
11634 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
11635
31b39d13
DN
116362011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
11637
11638 * window.c (make_window): Initialize phys_cursor_on_p.
11639
9aba6043
SM
116402011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
11641
11642 * lisp.h (struct Lisp_Symbol): Update comments.
11643
c20992f4
JB
116442011-10-28 Juanma Barranquero <lekktu@gmail.com>
11645
11646 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
11647
db4f02f2
EZ
116482011-10-28 Eli Zaretskii <eliz@gnu.org>
11649
11650 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
11651 <oslsachem@gmail.com> for helping to debug this.
11652
11653 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
11654 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
11655 (g_b_init_get_glyph_outline_w): New static variables.
11656 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
11657 (GetGlyphOutlineW_Proc): New typedefs.
11658 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
11659 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
11660 New functions.
11661 (w32font_open_internal, compute_metrics):
11662 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
11663 instead of calling the "wide" APIs directly.
11664
11665 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
11666
11667 * w32.h (syms_of_w32font): Add prototype.
11668
87e68db4
JB
116692011-10-27 Juanma Barranquero <lekktu@gmail.com>
11670
11671 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
11672 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
11673 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
11674 (Fmove_to_window_line): Doc fix.
11675
435c1d67
CY
116762011-10-27 Chong Yidong <cyd@gnu.org>
11677
11678 * process.c (make_process): Set gnutls_state to NULL.
11679
11680 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
11681 non-NULL, regardless of GNUTLS_INITSTAGE.
11682 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
11683 an error. Set process slots as soon as we allocate them.
11684
11685 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
11686
9c6c6f49
CY
116872011-10-27 Chong Yidong <cyd@gnu.org>
11688
9aba6043
SM
11689 * gnutls.c (emacs_gnutls_deinit): New function.
11690 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
11691 (Fgnutls_deinit, Fgnutls_boot): Use it.
11692
11693 * process.c (make_process): Initialize GnuTLS credentials to NULL.
11694 (deactivate_process): Call emacs_gnutls_deinit.
11695
657d08d3
JB
116962011-10-27 Juanma Barranquero <lekktu@gmail.com>
11697
11698 * image.c (x_create_x_image_and_pixmap):
11699 * w32.c (sys_rename, w32_delayed_load):
11700 * w32font.c (fill_in_logfont):
11701 * w32reg.c (x_get_string_resource): Silence compiler warnings.
11702
5430d399
JB
117032011-10-26 Juanma Barranquero <lekktu@gmail.com>
11704
11705 * w32fns.c (w32_default_color_map): New function,
11706 extracted from Fw32_default_color_map.
a7ef684b 11707 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 11708
fe0055fa
PE
117092011-10-25 Paul Eggert <eggert@cs.ucla.edu>
11710
11711 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
11712
e6346438
SM
117132011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
11714
11715 * keyboard.c (test_undefined): New function (bug#9751).
11716 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
11717
e112cc37
ET
117182011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
11719
11720 * sysdep.c (init_sys_modes): Fix the check for the controlling
11721 terminal (Bug#6649).
11722
7b5d6677
EZ
117232011-10-20 Eli Zaretskii <eliz@gnu.org>
11724
11725 * dispextern.h (struct bidi_it): New member next_en_type.
11726
11727 * bidi.c (bidi_line_init): Initialize the next_en_type member.
11728 (bidi_resolve_explicit_1): When next_en_pos is valid for the
11729 current character, check also for next_en_type being WEAK_EN.
11730 (bidi_resolve_weak): Don't enter the expensive loop if the current
11731 position is before next_en_pos. Record the bidi type of the first
11732 non-ET, non-BN character we find, in addition to its position.
11733 (bidi_level_of_next_char): Invalidate next_en_type when
11734 next_en_pos is over-stepped.
11735
7da0b018
PE
117362011-10-20 Paul Eggert <eggert@cs.ucla.edu>
11737
11738 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
11739 * editfns.c: Rewrite current-time-zone so that it invokes
11740 the equivalent of (format-time-string "%Z") to get the time zone name.
11741 This fixes a bug when the time zone name contains characters that
11742 need converting from the system time locale to Emacs internal format.
11743 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
11744 that patch fixed format-time-string to do the conversion, but
11745 I forgot to fix current-time-zone.
11746 (format_time_string): New function, containing most of
11747 what Fformat_time_string used to contain.
11748 (Fformat_time_string): Rewrite in terms of format_time_string.
11749 This doesn't change this function's behavior.
11750 (current-time-zone): Rewrite to use format_time_string.
11751 This fixes the bug reported by Michael Schierl in
11752 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
11753 Jason Rumney's 2007-06-07 change worked around this bug, but
11754 didn't fix it.
11755 * systime.h (tzname, timezone): Remove no-longer-used declarations.
11756
8547b010
EZ
117572011-10-19 Eli Zaretskii <eliz@gnu.org>
11758
11759 * xdisp.c (start_display): If the character at POS is displayed
11760 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
11761 (try_window_reusing_current_matrix): If a line ends in a display
11762 vector or the next line starts in a display vector, continue
11763 redrawing the window even though the character position of
11764 start_row was reached.
8547b010
EZ
11765 (Bug#9771, part 2)
11766
4e948d15
CY
117672011-10-18 Chong Yidong <cyd@gnu.org>
11768
11769 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
11770 with nobreak-char-display too.
11771
4787455f
EZ
117722011-10-18 Eli Zaretskii <eliz@gnu.org>
11773
11774 Fix part 3 of bug#9771.
11775 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
11776 (bidi_resolve_neutral): Don't enter the expensive loop looking for
11777 non-neutral characters if the current character is a paragraph
11778 separator (a.k.a. Newline). This avoids running the same
11779 expensive loop twice, once when we consume the preceding newline
11780 and the other time when the line actually needs to be displayed.
11781 Avoid the loop when we see neutrals on the base embedding level
11782 following a character whose directionality is the same as the
11783 paragraph's. This avoids running the expensive loop when a line
11784 ends in a long sequence of neutrals, like control characters.
11785 Add assertion against STRONG_AL type. Slightly rearrange code
11786 that determines the type of a neutral given the first non-neutral
11787 that follows it.
11788 (bidi_level_of_next_char): Set next_en_pos to zero when
11789 invalidating its info.
11790
2c91f553
EZ
117912011-10-17 Eli Zaretskii <eliz@gnu.org>
11792
11793 * xdisp.c (push_display_prop): Determine whether to record string
11794 or buffer position by IT->string, not by IT->method. Allow
11795 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
11796 (move_it_vertically_backward): Don't look for character position
11797 immediately after the newline when in a continuation line.
11798 (Bug#9771, part 1)
2c91f553 11799
c7b08b0d
MR
118002011-10-15 Martin Rudalics <rudalics@gmx.at>
11801
11802 * window.c (coordinates_in_window): Rewrite and delabelize
11803 vertical border check. (Bug#5357) (Bug#9618)
11804
6b02f655
SM
118052011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
11806
11807 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
11808 errors in XSetWindowBorder (bug#9310).
11809
81d40c92
DA
118102011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
11811
11812 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
11813 avoid crash when xmalloc overrun checking is enabled.
11814
d4172c3b
EZ
118152011-10-13 Eli Zaretskii <eliz@gnu.org>
11816
11817 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
11818 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
11819 cursor motion with <left> and <right> arrow keys.
11820
11821 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
11822 some callers set that themselves.
11823
b00eea75
EZ
118242011-10-12 Eli Zaretskii <eliz@gnu.org>
11825
11826 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
11827 display string and the previous row comes from the same string and
11828 is empty. (Bug#9739) (Bug#9738)
11829
8fe012c4
SM
118302011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
11831
11832 * doc.c (get_doc_string): Encode file name (bug#9735).
11833
0074aef2
EZ
118342011-10-12 Eli Zaretskii <eliz@gnu.org>
11835
79beb178
EZ
11836 * bidi.c (bidi_level_of_next_char):
11837 * xdisp.c (get_visually_first_element): Remove old incorrect
11838 comments regarding the Unicode Line Separator character.
11839
0074aef2
EZ
11840 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
11841
6e4b3fbe
DA
118422011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
11843
11844 * alloc.c (Fgc_status): Do not access beyond zombies array
11845 boundary if nzombies > MAX_ZOMBIES.
11846 * alloc.c (dump_zombies): Add missing format specifier.
11847
0324f3af
PE
118482011-10-12 Paul Eggert <eggert@cs.ucla.edu>
11849
b5525cac
PE
11850 * xdisp.c (set_cursor_from_row): Simplify conditionals,
11851 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
11852
0324f3af
PE
11853 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
11854 Some packages use them to denote characters with modifiers.
11855
e9b5f888
AS
118562011-10-11 Andreas Schwab <schwab@linux-m68k.org>
11857
11858 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
11859 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
11860 matching a pp-number. Rename parameter var to var1.
11861
127827c0
SM
118622011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
11863
11864 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
11865
c8fd3bd0
GM
118662011-10-08 Glenn Morris <rgm@gnu.org>
11867
11868 * callint.c (Fcall_interactively): Give a more explicit error for the
11869 'c' case with a non-character input. (Bug#8479)
11870
352ec8ff
EZ
118712011-10-08 Eli Zaretskii <eliz@gnu.org>
11872
03669ccb
EZ
11873 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
11874 lines.
7061c986
EZ
11875 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
11876 lines that are hscrolled on the left.
03669ccb 11877
352ec8ff
EZ
11878 * dispnew.c (buffer_posn_from_coords): Account for a possible
11879 presence of header-line. (Bug#4426)
11880
a66cfb1c
SM
118812011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
11882
6b02f655
SM
11883 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
11884 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 11885
7c5ee88e
PE
118862011-10-07 Paul Eggert <eggert@cs.ucla.edu>
11887
11888 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
11889 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
11890 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
11891 this makes Emacs dump core during garbage collection on rare
11892 occasions. sizeof is obviously inferior to offsetof here, so
11893 stick with offsetof.
11894 (GC_POINTER_ALIGNMENT): New macro.
11895 (mark_memory): Omit 3rd (offset) arg; caller changed.
11896 Don't assume EMACS_INT alignment is the same as pointer alignment.
11897
df1bbe5b
SM
118982011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
11899
11900 * keyboard.c (read_key_sequence_remapped): New var.
11901 (read_key_sequence): Compute remapping in the right buffer.
11902 (command_loop_1): Use read_key_sequence's remapping directly.
11903
51553db6
SM
119042011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
11905
32c1fffd
SM
11906 * dired.c (file_name_completion): Don't expand file name.
11907 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
11908 before checking file name handler.
11909
51553db6
SM
11910 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
11911 they've been requested explicitly (bug#9591).
11912
b6bd1599 119132011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
11914
11915 * keymap.c (Fsingle_key_description): Use make_specified_string
11916 instead of build_string to build string from push_key_description.
11917 (Bug#5193)
11918
f701dc2a
PE
119192011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11920
4222c55d
PE
11921 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
11922 This fixes a Y2038 bug on 64-bit hosts.
11923 * buffer.c (reset_buffer):
11924 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
11925 (Fclear_buffer_auto_save_failure):
11926 Use 0, not -1, to represent an unset failure time, since time_t
11927 might not be signed.
11928
f701dc2a
PE
11929 Remove dependency on glibc malloc internals.
11930 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11931 Move back here from lisp.h, but with their new implementations.
11932 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11933 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
11934 * charset.c (charset_table_init): New static var.
11935 (syms_of_charset): Use it instead of xmalloc. This removes a
11936 dependency on glibc malloc internals. See Eli Zaretskii's comment in
11937 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
11938 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11939 Move back to alloc.c.
11940 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11941 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
11942
9ceebf39
JD
119432011-09-30 Jan Djärv <jan.h.d@swipnet.se>
11944
11945 * nsterm.m (windowDidResize): Call x_set_window_size only when
11946 ns_in_resize is true. Otherwise set pixelwidth/height and
11947 call change_frame_size (Bug#9628).
11948
cb993c58
PE
119492011-09-30 Paul Eggert <eggert@cs.ucla.edu>
11950
3930c88b
PE
11951 Port --enable-checking=all to Fedora 14 x86-64.
11952 * charset.c (syms_of_charset): Also account for glibc malloc's
11953 internal overhead when calculating the initial malloc maximum.
11954
cb993c58
PE
11955 Port --enable-checking=all to Fedora 14 x86.
11956 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11957 Move to lisp.h.
11958 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
11959 (overrun_check_realloc, overrun_check_free):
11960 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
11961 That way, xmalloc returns a properly-aligned pointer even if
11962 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
11963 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
11964 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
11965 into account when calculating the initial malloc maximum.
11966 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
11967 Move here from alloc.c, so that charset.c can use it too.
11968 Properly align; the old code wasn't right for common 32-bit hosts
11969 when configured with --enable-checking=all.
11970 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
11971 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
11972
31bed486
EZ
119732011-09-29 Eli Zaretskii <eliz@gnu.org>
11974
04c70788 11975 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
11976 use EDOM.
11977
fbcaa2f3
EZ
119782011-09-28 Eli Zaretskii <eliz@gnu.org>
11979
11980 * xdisp.c (compute_display_string_end): If there's no display
11981 string at CHARPOS, return -1.
11982
11983 * bidi.c (bidi_fetch_char): When compute_display_string_end
11984 returns a negative value, treat the character as a normal
11985 character not covered by a display string. (Bug#9624)
11986
a239d4e9
JB
119872011-09-28 Juanma Barranquero <lekktu@gmail.com>
11988
11989 * lread.c (Fread_from_string): Fix typo in docstring.
11990
88652fd5
EZ
119912011-09-27 Eli Zaretskii <eliz@gnu.org>
11992
11993 * xdisp.c (handle_invisible_prop): If invisible text ends on a
11994 newline, reseat the iterator instead of bidi-iterating there one
11995 character at a time. (Bug#9610)
32c1fffd
SM
11996 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
11997 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 11998
ed497dd4
AS
119992011-09-27 Andreas Schwab <schwab@linux-m68k.org>
12000
12001 * lread.c (readevalloop): Use correct code for NBSP.
12002 (read1): Likewise. (Bug#9608)
12003
b2bf61aa
MA
120042011-09-25 Michael Albinus <michael.albinus@gmx.de>
12005
12006 * dbusbind.c (Fdbus_register_signal): When service is not
12007 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
12008
32bbb17c
GM
120092011-09-25 Glenn Morris <rgm@gnu.org>
12010
12011 * buffer.c (truncate-lines): Doc fix.
12012
94e0933e
CY
120132011-09-24 Chong Yidong <cyd@stupidchicken.com>
12014
12015 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
12016 (Fset_window_next_buffers): Doc fix.
12017
cddde921
GM
120182011-09-24 Glenn Morris <rgm@gnu.org>
12019
12020 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
12021
1260aef1
PE
120222011-09-24 Paul Eggert <eggert@cs.ucla.edu>
12023
25b4bfa0
PE
12024 Fix minor problems found by static checking.
12025 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
12026 * indent.c (Fvertical_motion): Fix == vs = typo.
12027
e3cbd34b
EZ
120282011-09-24 Eli Zaretskii <eliz@gnu.org>
12029
a66cfb1c
SM
12030 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
12031 Default value is now t. Doc fix.
6bf7006f 12032
e3cbd34b 12033 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 12034 logic when moving up, not only when moving down. Fix the
e3cbd34b 12035 confusing name and values of the it_overshoot_expected variable;
32c1fffd 12036 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
12037
12038 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
12039 CHARPOS is covered by a display string which includes newlines.
12040 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
12041 is covered by a display string with embedded newlines.
12042
a3de0cbd
MA
120432011-09-24 Michael Albinus <michael.albinus@gmx.de>
12044
12045 * dbusbind.c (Fdbus_register_signal): Add match rule to
12046 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
12047 (Fdbus_register_method, Vdbus_registered_objects_table):
12048 Fix docstring.
a3de0cbd 12049
b260039d
JM
120502011-09-24 Jim Meyering <meyering@redhat.com>
12051
32c1fffd 12052 do not ignore write error for any output size
b260039d
JM
12053 The previous change was incomplete.
12054 While it makes emacs --batch detect the vast majority of stdout
12055 write failures, errors were still ignored whenever the output size is
12056 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
12057 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
12058 && echo FAIL: ignored write error
12059 FAIL: ignored write error
12060 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
12061 && echo FAIL: ignored write error
12062 FAIL: ignored write error
12063 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
12064
8eca8a7c
AS
120652011-09-23 Andreas Schwab <schwab@linux-m68k.org>
12066
12067 * emacs.c (Fkill_emacs): In noninteractive mode exit
12068 non-successfully if a write error occurred on stdout. (Bug#9574)
12069
3341db62
EZ
120702011-09-21 Eli Zaretskii <eliz@gnu.org>
12071
12072 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
12073 the xassert test.
12074
12075 * dispextern.h (struct it): Update the comment documenting what
12076 can it->OBJECT be.
12077
8c203dbf
EZ
120782011-09-20 Eli Zaretskii <eliz@gnu.org>
12079
12080 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
12081 a display string, extend search for cursor position to end of row.
12082 (find_row_edges): If the row ends in a newline from a display
12083 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
12084 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
12085 (Fcurrent_bidi_paragraph_direction): Fix search for previous
12086 non-empty line. Fixes confusing cursor motion with arrow keys at
12087 the beginning of a line that starts with whitespace.
8c203dbf 12088
a4824228
LMI
120892011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
12090
12091 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
12092 (bug#9493).
12093
33ed493b
CY
120942011-09-18 Chong Yidong <cyd@stupidchicken.com>
12095
12096 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
12097 boolean (Bug#9154).
12098
56cd55c8
EZ
120992011-09-18 Eli Zaretskii <eliz@gnu.org>
12100
12101 * xdisp.c (display_line): Record maximum and minimum buffer
12102 positions even if no glyphs were produced (e.g., by a zero-width
12103 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
12104 buffer positions that will be removed from the glyph row because
12105 they don't fit.
c02dcedf
EZ
12106 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
12107 column is beyond frame width: don't subtract 1 "pixel" when
12108 computing width of the stretch.
3e62b7e0
EZ
12109 (reseat_at_next_visible_line_start): Undo the change made on
12110 2011-09-17 that saved paragraph information and restored it after
12111 the call to `reseat'. (Bug#9545)
56cd55c8 12112
5ed99d36 121132011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
12114
12115 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
12116 and turn window cursor on if cleared (Bug#9415).
12117
5ed99d36 121182011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
12119
12120 * search.c (boyer_moore): Take unibyte characters from pattern
12121 literally. (Bug#9458)
12122
9bade7b2
EZ
121232011-09-18 Eli Zaretskii <eliz@gnu.org>
12124
12125 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
12126
e5e9d610
PE
121272011-09-18 Paul Eggert <eggert@cs.ucla.edu>
12128
87e4427a
PE
12129 Fix minor problem found by static checking.
12130 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
12131 initialized, to pacify gcc -Wuninitialized.
12132
e5e9d610
PE
12133 * fileio.c: Report proper errno when syscall falls.
12134 (Finsert_file_contents): Save and restore errno,
12135 so that report_file_error outputs the correct diagnostic.
12136 (Fwrite_region) [CLASH_DETECTION]: Likewise.
12137
a1674f0b
EZ
121382011-09-18 Eli Zaretskii <eliz@gnu.org>
12139
12140 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
12141
fbfb6dd4
EZ
121422011-09-17 Eli Zaretskii <eliz@gnu.org>
12143
12144 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
12145 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
12146
bb187662
EZ
121472011-09-17 Eli Zaretskii <eliz@gnu.org>
12148
1137e8b8 12149 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 12150 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
12151
12152 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
12153 (bidi_find_paragraph_start): Search back for paragraph beginning
12154 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
12155 (bidi_move_to_visually_next): Only trigger paragraph-related
12156 computations when the last character is a newline or at EOB, not
12157 just any NEUTRAL_B. (Bug#9470)
12158
bb187662
EZ
12159 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
12160 truncated lines if point is covered by a display string. (Bug#9524)
12161
2e621251
PE
121622011-09-16 Paul Eggert <eggert@cs.ucla.edu>
12163
12164 * xselect.c: Relax test for outgoing X longs (Bug#9498).
12165 (cons_to_x_long): New function.
12166 (lisp_data_to_selection_data): Use it. Correct the test for
12167 short-versus-long data; it was negated. Break out of vector
12168 loop, for efficiency, when a long datum is discovered.
12169
91a15bc6
SM
121702011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
12171
12172 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
12173
b41c3a35
EZ
121742011-09-16 Eli Zaretskii <eliz@gnu.org>
12175
12176 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
12177 GCC PR/17406) by declaring this function with external scope.
12178
7812ba2d
PE
121792011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12180
12181 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
12182 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
12183
cf7edc2a
AS
121842011-09-15 Andreas Schwab <schwab@linux-m68k.org>
12185
12186 * editfns.c (Fformat): Correctly handle text properties on "%%".
12187
bd01620e
EZ
121882011-09-15 Eli Zaretskii <eliz@gnu.org>
12189
12190 * xterm.c (x_draw_composite_glyph_string_foreground):
12191 * w32term.c (x_draw_composite_glyph_string_foreground):
12192 * term.c (encode_terminal_code):
12193 * composite.c (composition_update_it, get_composition_id):
12194 * xdisp.c (get_next_display_element)
12195 (fill_composite_glyph_string): Add comments about special meaning
12196 of TAB characters in a composition.
12197
a02719a3
PE
121982011-09-15 Paul Eggert <eggert@cs.ucla.edu>
12199
12200 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
12201 This occurs when processing a multibyte format.
12202 Problem reported by Wolfgang Jenker.
a02719a3 12203
72589a3c
JB
122042011-09-15 Johan Bockgård <bojohan@gnu.org>
12205
12206 * xdisp.c (try_cursor_movement): Only check for exact match if
12207 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
12208
1c14176c
PE
122092011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12210
12211 Remove unused external symbols.
12212 * dispextern.h (calc_pixel_width_or_height): Remove decl.
12213 * xdisp.c (calc_pixel_width_or_height): Now static.
12214 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
12215 * indent.c (check_display_width):
12216 * w32term.c: Fix comment to match code.
12217 * xterm.c, xterm.h (x_catching_errors): Remove.
12218
d2eea5b5
PE
122192011-09-14 Paul Eggert <eggert@cs.ucla.edu>
12220
12221 * xselect.c: Use signed conversions more consistently (Bug#9498).
12222 (selection_data_to_lisp_data): Assume incoming selection data are
12223 signed integers, not unsigned. This is to be consistent with
12224 outgoing selection data, which was modified to use signed integers
12225 in as part of the fix to Bug#9196 in response to Jan D.'s comment
12226 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
12227 expects long, not unsigned long.
12228
46888499
EZ
122292011-09-14 Eli Zaretskii <eliz@gnu.org>
12230
12231 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
12232 computation of loop end. Reported by Johan Bockgård
12233 <bojohan@gnu.org>.
12234
ef8ef9fb
CY
122352011-09-13 Chong Yidong <cyd@stupidchicken.com>
12236
12237 * frame.c (Fother_visible_frames_p): Function deleted.
12238
fa819fed
EZ
122392011-09-12 Eli Zaretskii <eliz@gnu.org>
12240
12241 * indent.c (compute_motion): Process display vector front to back
12242 rather than the other way around. (Bug#2496)
12243
2ba8e008
SM
122442011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
12245
12246 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
12247
20f53c69
CY
122482011-09-11 Chong Yidong <cyd@stupidchicken.com>
12249
12250 * minibuf.c (Fread_from_minibuffer): Doc fix.
12251
d562d7a4
EZ
122522011-09-11 Eli Zaretskii <eliz@gnu.org>
12253
12254 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
12255 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
12256
1c4d7f3d
LMI
122572011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
12258
12259 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
12260 value for non-existent files.
12261
b885bf36
EZ
122622011-09-11 Eli Zaretskii <eliz@gnu.org>
12263
12264 * fileio.c (Finsert_file_contents): If the file cannot be opened,
12265 set its "size" to -1. This will set the modtime_size field of
12266 the corresponding buffer to -1, which is what
12267 verify-visited-file-modtime expects for files that do not exist.
12268 (Bug#9139)
12269
6612f0bf
PE
122702011-09-11 Paul Eggert <eggert@cs.ucla.edu>
12271
12272 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
12273 here ...
12274 * lisp.h: ... from here. push_key_description is no longer
12275 defined in keyboard.c, so its declaration should not be in
12276 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
12277 logically belongs with push_key_description.
12278
dfb3f755
PE
122792011-09-10 Paul Eggert <eggert@cs.ucla.edu>
12280
12281 * buffer.h: Include <sys/types.h> instead of <time.h>.
12282 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
12283 Problem reported by Herbert J. Skuhra.
12284
3134906c
LMI
122852011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
12286
12287 * xml.c (parse_region): Make the parsing work for
12288 non-comment-starting XML files again (bug#9144).
12289
8d903f4e
AS
122902011-09-10 Andreas Schwab <schwab@linux-m68k.org>
12291
12292 * image.c (gif_load): Fix calculation of bottom and right corner.
12293 (Bug#9468)
12294
80ad64f4
EZ
122952011-09-10 Eli Zaretskii <eliz@gnu.org>
12296
12297 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
12298 redisplay in small windows.
12299
208a048d
EZ
123002011-09-09 Eli Zaretskii <eliz@gnu.org>
12301
12302 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
12303
9b1c252e
MR
123042011-09-08 Martin Rudalics <rudalics@gmx.at>
12305
12306 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
12307 Operate on live windows only.
12308
2949f33b
JB
123092011-09-08 Juanma Barranquero <lekktu@gmail.com>
12310
12311 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
12312
e08dcafd
EZ
123132011-09-07 Eli Zaretskii <eliz@gnu.org>
12314
12315 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
12316 only under bidi iteration.
12317
115b96bd
JD
123182011-09-07 Jan Djärv <jan.h.d@swipnet.se>
12319
12320 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
12321
c8199d0f
PE
123222011-09-06 Paul Eggert <eggert@cs.ucla.edu>
12323
12324 isnan: Fix porting problem to Solaris 10 with bundled gcc.
12325 Without this fix, the command to link temacs failed due to an
12326 undefined symbol __builtin_isnan. This is because
12327 /usr/include/iso/math_c99.h #defines isnan(x) to
12328 __builtin_isnan(x), but the bundled gcc, which identifies itself
12329 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
12330 a __builtin_isnan.
12331 * floatfns.c (isnan): #undef, and then #define to a clone of
12332 what's in data.c.
12333 (Fisnan): Always define, since it's always available now.
12334 (syms_of_floatfns): Always define isnan at the Lisp level.
12335
e39b275c 123362011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
12337
12338 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
12339
b2db44d9 123402011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 12341
f4af5137 12342 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
12343 The previous code assumed that file offsets (off_t values) fit in
12344 EMACS_INT variables, which is not true on typical 32-bit hosts.
12345 The code messed up by falsely reporting buffer overflow in cases
12346 such as (insert-file-contents "big" nil 1 2) into an empty buffer
12347 when "big" contains more than 2**29 bytes, even though this
12348 inserts just one byte and does not overflow the buffer.
12349 (Finsert_file_contents): Store file offsets as off_t
12350 values, not as EMACS_INT values. Check for overflow when
12351 converting between EMACS_INT and off_t. When checking for
12352 buffer overflow or for overlap, take the offsets into account.
12353 Don't use EMACS_INT for small values where int suffices.
12354 When checking for overlap, fix a typo: ZV was used where
12355 ZV_BYTE was intended.
12356 (Fwrite_region): Don't assume off_t fits into 'long'.
12357 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
12358
ecfc0a49
MA
123592011-09-05 Michael Albinus <michael.albinus@gmx.de>
12360
12361 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
12362
6511acf2 123632011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 12364
0999621a 12365 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
12366
12367 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 12368 (esprintf, exprintf, evxprintf): New functions.
62f19c19 12369 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 12370 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
12371 (modify_event_symbol): Do not assume that the length of
12372 name_alist_or_stem is safe to alloca and fits in int.
12373 (Fexecute_extended_command): Likewise for function name and binding.
12374 (Frecursion_depth): Wrap around reliably on integer overflow.
12375 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
12376 since some callers pass EMACS_INT values.
12377 (Fsingle_key_description): Don't crash if symbol name contains more
12378 than MAX_ALLOCA bytes.
12379 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
12380 (get_minibuffer): Arg is now EMACS_INT, not int.
12381 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 12382 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
12383 * window.h (command_loop_level, minibuf_level): Reflect API changes.
12384
2be7d702
PE
12385 * dbusbind.c (signature_cat): New function.
12386 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
12387 Do not overrun buffer; instead, report string overflow.
12388
9d1df220
PE
12389 * dispnew.c (add_window_display_history): Don't overrun buffer.
12390 Truncate instead; this is OK since it's just a log.
12391
33ef5c64
PE
12392 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
12393 even if the time zone offset is outlandishly large.
12394 Don't mishandle offset == INT_MIN.
12395
66c6fdd5
PE
12396 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
12397 when creating daemon; the previous buffer-overflow check was incorrect.
12398
d749b01b
PE
12399 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
12400 which has the guts of the old verror function.
12401
b5cd1905
PE
12402 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
12403 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
12404
6e1a67fb
PE
12405 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
12406 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 12407 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 12408 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
12409 length of string rather than counting it via multiple sprintfs;
12410 that's simpler and more reliable.
c21721cc
PE
12411 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
12412 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
12413 sprintf, in case result does not fit in int.
12414
c57b67fc
PE
12415 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
12416 (fontset_from_font): Print it.
12417
8a401434
PE
12418 * frame.c (tty_frame_count): Now printmax_t, not int.
12419 (make_terminal_frame, set_term_frame_name): Print it.
12420 (x_report_frame_params): In X, window IDs are unsigned long,
12421 not signed long, so print them as unsigned.
12422 (validate_x_resource_name): Check for implausibly long names,
12423 and don't assume name length fits in 'int'.
12424 (x_get_resource_string): Don't blindly alloca invocation name;
12425 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
12426 not fit in int.
12427
6e1a67fb
PE
12428 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
12429 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
12430 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
12431
0df02bf3
PE
12432 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
12433 Use esprintf, not sprintf, in case result does not fit in int.
12434
48e30793
PE
12435 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12436 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
12437 it as a large positive number.
12438 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
12439 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
12440
a66ff6d8
PE
12441 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
12442 in case result does not fit in int.
12443
aca216ff
PE
12444 * print.c (float_to_string): Detect width overflow more reliably.
12445 (print_object): Make sprintf buffer a bit bigger, to avoid potential
12446 buffer overrun. Don't assume list length fits in 'int'. Treat
12447 print length of 0 as 0, not as infinity; to be consistent with other
12448 uses of print length in this function. Don't overflow print length
12449 index. Don't assume hash table size fits in 'long', or that
12450 vectorlike size fits in 'unsigned long'.
12451
31c286f7
PE
12452 * process.c (make_process): Use printmax_t, not int, to format
12453 process-name gensyms.
12454
55e5faa1
PE
12455 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
12456
80f2e268
PE
12457 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
12458 to avoid potential buffer overrun.
12459
670741ab
PE
12460 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
12461 if X resource line is longer than 512 bytes.
12462
b7163a50
PE
12463 * xfns.c (x_window): Make sprintf buffer a bit bigger
12464 to avoid potential buffer overrun.
12465
ae58ff1f
PE
12466 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
12467
c43c8a6a
PE
12468 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
12469
3f8236f4
PE
124702011-09-04 Paul Eggert <eggert@cs.ucla.edu>
12471
53e9fe90 12472 Integer overflow fixes for scrolling, etc.
6511acf2
PE
12473 Without these, Emacs silently mishandles large integers sometimes.
12474 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
12475 it were "C-u 1 M-x recenter" on a typical 64-bit host.
12476
6511acf2
PE
12477 * xdisp.c (try_window_id): Check Emacs fixnum range before
12478 converting to 'int'.
806add1d 12479
6511acf2 12480 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
12481 Check that an Emacs fixnum is in range before assigning it to 'int'.
12482 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
12483 values converted from Emacs fixnums.
12484 (Frecenter): Don't wrap around a line count if it is out of 'int'
12485 range; instead, treat it as an extreme value.
12486 (Fset_window_configuration, compare_window_configurations):
12487 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
12488
6511acf2
PE
12489 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
12490 that can exceed INT_MAX. Check that EMACS_INT value is in range
12491 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
12492 (match_limit): Don't assume that a fixnum can fit in 'int'.
12493
6511acf2 12494 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
12495 exceed INT_MAX.
12496
6511acf2 12497 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
12498 (Fvertical_motion): Don't wrap around LINES values that don't fit
12499 in 'int'. Instead, treat them as extreme values. This is good
12500 enough for windows, which can't have more than INT_MAX lines anyway.
12501
fcb901a7
LMI
125022011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
12503
0f2f6b6d
LMI
12504 * Require libxml/parser.h to avoid compilation warning.
12505
fcb901a7
LMI
12506 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
12507
12508 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
12509 since this reportedly can destroy thread storage.
12510
6e20a0d4
CY
125112011-08-30 Chong Yidong <cyd@stupidchicken.com>
12512
12513 * syntax.c (find_defun_start): Update all cache variables if
12514 exiting early (Bug#9401).
12515
148ae00e
EZ
125162011-08-30 Eli Zaretskii <eliz@gnu.org>
12517
f6cfbd8f
EZ
12518 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
12519
148ae00e
EZ
12520 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
12521 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
12522 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
12523
12524 * term.c (tty_append_glyph): New function.
12525 (produce_stretch_glyph): Static function and its prototype deleted.
12526
a66cfb1c
SM
12527 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
12528 Add prototypes.
148ae00e 12529
c4a07a4c
PE
125302011-08-29 Paul Eggert <eggert@cs.ucla.edu>
12531
12532 * image.c (parse_image_spec): Check for nonnegative, not for positive,
12533 when checking :margin (Bug#9390).
12534 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 12535 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
12536 so that the name doesn't mislead. All uses changed.
12537
6bc8cd65
JB
125382011-08-28 Johan Bockgård <bojohan@gnu.org>
12539
12540 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
12541 set_tty_hooks.
12542
dca4927e
EZ
125432011-08-27 Eli Zaretskii <eliz@gnu.org>
12544
12545 * xdisp.c (move_it_to): Don't bail out early when reaching
12546 position beyond to_charpos, if we are scanning backwards.
12547 (move_it_vertically_backward): When DY == 0, make sure we get to
12548 the first character in the line after the newline.
12549
f2cad773
PE
125502011-08-27 Paul Eggert <eggert@cs.ucla.edu>
12551
12552 * ccl.c: Improve and simplify overflow checking (Bug#9196).
12553 (ccl_driver): Do not generate an out-of-range pointer.
12554 (Fccl_execute_on_string): Remove unnecessary check for
12555 integer overflow, noted by Stefan Monnier in
12556 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
12557 Remove a FIXME that didn't need fixing.
12558 Simplify the newly-introduced buffer reallocation code.
12559
0cae2cdb
JB
125602011-08-27 Juanma Barranquero <lekktu@gmail.com>
12561
12562 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
12563
5fc295a4 125642011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 12565
70c60eb2 12566 Integer and memory overflow issues (Bug#9196).
726e0ab1 12567
d31850da
PE
12568 * doc.c (get_doc_string): Rework so that
12569 get_doc_string_buffer_size is the actual buffer size, rather than
12570 being 1 less than the actual buffer size; this makes xpalloc more
12571 convenient.
12572
a69fbedb
PE
12573 * image.c (x_allocate_bitmap_record, cache_image):
12574 * xselect.c (Fx_register_dnd_atom):
12575 Simplify previous changes by using xpalloc.
12576
fe5c5d37
PE
12577 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
12578 since either will do and ptrdiff_t is convenient with xpalloc.
12579
0065d054
PE
12580 * charset.c (charset_table_size)
12581 (struct charset_sort_data.priority): Now ptrdiff_t.
12582 (charset_compare): Don't overflow if priorities differ greatly.
12583 (Fsort_charsets): Don't assume list length fits in int.
12584 Check for size-calculation overflow when allocating sort data.
12585 (syms_of_charset): Allocate an initial charset table that is
12586 just under 64 KiB, to avoid problems with glibc malloc and mmap.
12587
12588 * cmds.c (internal_self_insert): Check for size-calculation overflow.
12589
12590 * composite.h (struct composition.glyph_len): Now int, not unsigned.
12591 The actual value is always <= INT_MAX, and leaving it unsigned made
12592 overflow checking harder.
12593
12594 * dispextern.h (struct glyph_matrix.rows_allocated)
12595 (struct face_cache.size): Now ptrdiff_t, for convenience in use
12596 with xpalloc. The values are still always <= INT_MAX.
12597
12598 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
12599
12600 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
12601 (SAFE_NALLOCA): New macro.
12602
12603 * region-cache.c (struct boundary.pos, find_cache_boundary)
12604 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
12605 (set_cache_region, invalidate_region_cache)
12606 (revalidate_region_cache, know_region_cache, region_cache_forward)
12607 (region_cache_backward, pp_cache):
12608 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
12609 so that ptrdiff_t * can be passed to xpalloc.
12610 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
12611 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
12612 (pp_cache): Don't assume cache_len fits in int.
12613 * region-cache.h: Adjust extern decls to match.
12614
12615 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
12616 EMACS_INT, since either will do, for xpalloc.
12617
12618 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
12619 (xnmalloc, xnrealloc, xpalloc): New functions.
12620
726e0ab1
PE
12621 * bidi.c (bidi_shelve_header_size): New constant.
12622 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
12623 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
12624
51f30bc5 12625 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
12626 * buffer.c (overlays_at, overlays_in, record_overlay_string)
12627 (overlay_strings):
12628 Don't update size of array until after memory allocation succeeds,
12629 because xmalloc/xrealloc may not return.
0065d054
PE
12630 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
12631 now that we have proper integer overflow checking.
12632 (record_overlay_string, overlay_strings): Catch overflows when
12633 calculating size of overlay_str_buf.
726e0ab1 12634
0065d054
PE
12635 * callproc.c (Fcall_process): Check for size overflow when
12636 calculating size of args2.
12637 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
12638 Normally we prefer signed values, but sticking with ptrdiff_t would
12639 require adding more-complicated checks.
726e0ab1
PE
12640
12641 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
12642 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
12643 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 12644 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
12645
12646 * character.c (Fstring): Check for size-calculation overflow.
12647
12648 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
12649 unnecessary integer overflow. Check for size overflow.
12650 (encode_coding_object): Don't update size until xmalloc succeeds.
12651
12652 * composite.c (get_composition_id): Check for overflow in glyph
12653 length calculations.
12654
12655 Integer and memory overflow fixes for display code.
12656 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
12657 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
12658 (scrolling_window): Check for overflow in size calculations.
12659 (line_draw_cost, realloc_glyph_pool, add_row_entry):
12660 Don't assume glyph table len fits in int.
12661 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
12662 (row_table_size): Now ptrdiff_t, not int.
12663 (scrolling_window): Avoid overflow in size calculations.
12664 Don't update size until allocation succeeds.
12665 * fns.c (concat): Check for overflow in size calculations.
12666 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
12667 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12668 (NEXT_ALMOST_PRIME_LIMIT): New constant.
12669
12670 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
12671 (get_doc_string): Check for size calculation overflow.
12672 Don't update size until allocation succeeds.
12673 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
12674 EMACS_INT, where ptrdiff_t will do.
12675 (Fsubstitute_command_keys): Check for string overflow.
12676
12677 * editfns.c (set_time_zone_rule): Don't assume environment length
12678 fits in int.
12679 (message_length): Now ptrdiff_t, not int.
12680 (Fmessage_box): Don't update size until allocation succeeds.
12681 Don't assume message length fits in int.
12682 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
12683
0065d054
PE
12684 * emacs.c (main): Do not reallocate argv, since there is a null at
12685 the end that can be overwritten, and this way there's no need to
12686 worry about size-calculation overflow.
12687 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
12688
12689 * eval.c (init_eval_once, grow_specpdl): Don't update size until
12690 alloc succeeds.
12691 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
12692
12693 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
12694 (x_set_scroll_bar_width, x_figure_window_size):
12695 Check for integer overflow.
12696 (x_set_alpha): Do not assume XINT fits in int.
12697
12698 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
12699 This is for the members text_lines, text_cols, total_lines, total_cols,
12700 where the system imposes an 'int' limit.
12701
12702 * fringe.c (Fdefine_fringe_bitmap):
12703 Don't update size until alloc works.
12704
12705 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
12706 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
12707
12708 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
12709 Check for size-calculation overflow.
12710 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
12711 do, as we prefer signed integers.
12712 (id_to_widget.max_size, id_to_widget.used)
12713 (xg_store_widget_in_map, xg_remove_widget_from_map)
12714 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
12715 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
12716 Use and return ptrdiff_t, not int.
12717 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
12718 * gtkutil.h: Change prototypes to match the above.
12719
12720 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
12721 are duplicate now that they've been promoted to lisp.h.
12722 (x_allocate_bitmap_record, x_alloc_image_color)
12723 (make_image_cache, cache_image, xpm_load):
12724 Don't update size until alloc is done.
12725 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
12726 (x_detect_edges):
3256efce 12727 Check for size calculation overflow.
726e0ab1
PE
12728 (ct_colors_allocated_max): New constant.
12729 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
12730 overflow.
3256efce 12731
726e0ab1
PE
12732 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
12733 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
12734 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
12735 Use ptrdiff_t, not int, to count maps.
12736 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
12737 calculations. Don't update size until allocation succeeds.
12738 Redo calculations to avoid overflow.
726e0ab1
PE
12739 * keyboard.h: Change prototypes to match the above.
12740
12741 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
12742 to count maps.
12743 (current_minor_maps): Check for size calculation overflow.
12744 * keymap.h: Change prototypes to match the above.
12745
12746 * lread.c (read1, init_obarray): Don't update size until alloc done.
12747
12748 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
12749 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
12750
726e0ab1
PE
12751 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
12752 Now ptrdiff_t, not int.
12753 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
12754 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
12755
12756 * process.c (Fnetwork_interface_list): Check for overflow
12757 in size calculation.
12758
12759 * region-cache.c (move_cache_gap): Check for size calculation overflow.
12760
12761 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
12762 overflow. Don't bother calling xmalloc when xrealloc will do.
12763
12764 * search.c (Freplace_match): Check for size calculation overflow.
12765 (Fset_match_data): Don't assume list lengths fit in 'int'.
12766
12767 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
12768 for command line length. Do not attempt to address one before the
12769 beginning of an array, as that's not portable.
12770
12771 * term.c (max_frame_lines): Remove; unused.
12772 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
12773 not int.
12774 (encode_terminal_code, calculate_costs): Check for size
12775 calculation overflow.
12776 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
12777 table lengths and related sizes. Don't update size until alloc
12778 done. Redo calculations to avoid overflow.
12779 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
12780
12781 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
12782 subtracting pointers.
12783 (gobble_line): Check for overflow more carefully. Don't update size
12784 until alloc done.
12785
12786 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
12787 Don't update size until alloc done.
12788 Redo size calculations to avoid overflow.
12789 Check for size calculation overflow.
0065d054 12790 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
12791
12792 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
12793 Use ptrdiff_t, not int, for sizes.
12794 (store_mode_line_noprop_char): Don't update size until alloc done.
12795
0065d054
PE
12796 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
12797 Use ptrdiff_t, not int, for sizes.
12798 (Finternal_make_lisp_face, cache_face):
12799 Check for size calculation overflow.
12800 (cache_face): Treat size calculation overflows as if they were
12801 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
12802
12803 * xfns.c (x_encode_text, x_set_name_internal)
12804 (Fx_change_window_property): Use ptrdiff_t, not int, to count
12805 sizes, since they can exceed INT_MAX in size. Check for size
12806 calculation overflow.
12807
0065d054
PE
12808 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
12809 (xg_select): Check for size calculation overflow.
726e0ab1
PE
12810 Don't update size until alloc done.
12811
0065d054 12812 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 12813 as sprintf is limited to int lengths.
1d526e2f 12814
252c5ee1
PE
12815 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
12816 (X_LONG_MIN): New macros.
864d7ce7
PE
12817 Use them to make the following changes clearer.
12818 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
12819 This change doesn't affect the value now, but it may help remind
12820 future maintainers not to raise the value too much later.
12821 (SELECTION_QUANTUM): Remove, replacing with ...
12822 (selection_quantum): ... new function, which avoids overflow.
12823 All uses changed.
12824 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
12825 assumption that selection length fits in 'int'.
12826 (x_reply_selection_request, x_handle_selection_request)
12827 (x_get_window_property, receive_incremental_selection)
12828 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
12829 (lisp_data_to_selection_data, clean_local_selection_data):
12830 Use ptrdiff_t, not int, to record length of selection.
12831 (x_reply_selection_request, x_get_window_property)
12832 (receive_incremental_selection, x_property_data_to_lisp):
12833 Redo calculations to avoid overflow.
12834 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 12835 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
12836 something.
12837 (x_get_window_property, receive_incremental_selection)
12838 (lisp_data_to_selection_data, x_property_data_to_lisp):
12839 Check for size-calculation overflow.
12840 (x_get_window_property, receive_incremental_selection)
12841 (lisp_data_to_selection_data, Fx_register_dnd_atom):
12842 Don't store size until memory allocation succeeds.
12843 (x_get_window_property): Plug memory leak on memory exhaustion.
12844 Don't double-block input; malloc is safe here. Don't assume 2**34
12845 - 4 fits in unsigned long. Add an xassert to check
12846 XGetWindowProperty overflow. Be more careful about overflow
12847 calculations, and distinguish size from memory overflow better.
12848 (receive_incremental_selection): When tracing, don't assume
12849 unsigned int is less than INT_MAX.
12850 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
12851 harmful) conversions of unsigned short to int.
12852 (lisp_data_to_selection_data): Don't assume that integers
12853 in the range -65535 through -1 fit in an X unsigned short.
12854 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
12855 result parameters unless successful. Rely on cons_to_unsigned
12856 to report problems with elements; the old code wasn't right anyway.
12857 (x_check_property_data): Check for int overflow; we cannot use
12858 a wider type due to X limits.
12859 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
12860
726e0ab1 12861 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 12862
0065d054
PE
12863 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
12864 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
12865 (x_color_cells): Don't store size until memory allocation succeeds.
12866 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 12867 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
12868 (x_term_init): Don't assume length fits in int (sprintf is limited
12869 to int size).
bc18e09d 12870
ebfa62c0
PE
12871 Use ptrdiff_t for composition IDs.
12872 * character.c (lisp_string_width):
12873 * composite.c (composition_table_size, n_compositions)
12874 (get_composition_id, composition_gstring_from_id):
12875 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
12876 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
12877 * window.c (Frecenter):
12878 Use ptrdiff_t, not int, for composition IDs.
12879 * composite.c (get_composition_id): Check for integer overflow.
12880 * composite.h: Adjust prototypes to match the above changes.
12881
d3411f89
PE
12882 Use ptrdiff_t for hash table indexes.
12883 * category.c (hash_get_category_set):
12884 * ccl.c (ccl_driver):
12885 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
12886 * coding.c (coding_system_charset_list, detect_coding_system):
12887 * coding.h (struct coding_system.id):
12888 * composite.c (get_composition_id, gstring_lookup_cache):
12889 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
12890 * image.c (xpm_get_color_table_h):
12891 * lisp.h (hash_lookup, hash_put):
12892 * minibuf.c (Ftest_completion):
12893 Use ptrdiff_t for hash table indexes, not int (which is too
12894 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
12895 32-bit --with-wide-int hosts).
12896
e097a6fa
PE
12897 * charset.c (Fdefine_charset_internal): Check for integer overflow.
12898 Add a FIXME comment about memory leaks.
12899 (syms_of_charset): Don't assume xmalloc returns.
12900
5637687f
PE
12901 Don't assume that stated character widths fit in int.
12902 * character.c (Fchar_width, c_string_width, lisp_string_width):
12903 * character.h (CHAR_WIDTH):
12904 * indent.c (MULTIBYTE_BYTES_WIDTH):
12905 Use sanitize_char_width to avoid undefined and/or bad behavior
12906 with outlandish widths.
a66cfb1c 12907 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
12908 now that we have two such functions. All uses changed.
12909 (sanitize_char_width): New inline function.
12910
a2271ba2
PE
12911 Don't assume that tab-width fits in int.
12912 * character.h (sanitize_width): New inline function.
12913 (SANE_TAB_WIDTH): New macro.
12914 (ASCII_CHAR_WIDTH): Use it.
12915 * indent.c (sane_tab_width): Remove. All uses replaced by
12916 SANE_TAB_WIDTH (current_buffer).
12917 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
12918
18c52557
PE
12919 * fileio.c: Integer overflow issues with file modes.
12920 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
12921
caeeedc1
PE
12922 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
12923 Remove unreachable code.
12924 (read_hex, load_charset_map_from_file): Check for integer overflow.
12925
6df6ae42 12926 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
12927 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
12928 (x_send_scroll_bar_event): Likewise. Check that the size does not
12929 exceed limits imposed by XClientMessageEvent, as well as the usual
12930 ptrdiff_t and size_t limits.
12931
b13995db
PE
12932 * keyboard.c: Overflow, signedness and related fixes.
12933 (make_lispy_movement): Use same integer type in forward decl
12934 that is used in the definition.
12935 (read_key_sequence, keyremap_step):
12936 Change bufsize argument back to int, undoing my 2011-03-30 change.
12937 We prefer signed types, and int is wide enough here.
12938 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
12939 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
12940 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
12941 length, not size_t. Use ptrdiff_t for index, not int.
12942 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
12943 possibility of integer overflow.
12944
13464394
PE
12945 Overflow, signedness and related fixes for images.
12946
12947 * dispextern.h (struct it.stack[0].u.image.image_id)
12948 (struct_it.image_id, struct image.id, struct image_cache.size)
12949 (struct image_cache.used, struct image_cache.ref_count):
12950 * gtkutil.c (update_frame_tool_bar):
12951 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
12952 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
12953 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
12954 * nsmenu.m (update_frame_tool_bar):
12955 * xdisp.c (calc_pixel_width_or_height):
12956 * xfns.c (image_cache_refcount):
12957 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
12958 on typical 64-bit hosts.
12959
12960 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
12961 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
12962 Omit unnecessary casts to int.
12963 (parse_image_spec): Check that integers fall into 'int' range
12964 when the callers expect that.
12965 (image_ascent): Redo ascent calculation to avoid int overflow.
12966 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
12967 (lookup_image): Remove unnecessary tests.
12968 (xbm_image_p): Locals are now of int, not EMACS_INT,
12969 since parse_image_check makes sure they fit into int.
12970 (png_load, gif_load, svg_load_image):
12971 Prefer int to unsigned where either will do.
12972 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
12973 old tiff_error_handler and tiff_warning_handler.
12974 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
12975 stack buffer overflows. It uses only the features of vsnprintf
12976 that are common to both POSIX and native Microsoft.
12977 (tiff_error_handler, tiff_warning_handler): Use it.
12978 (tiff_load, gif_load, imagemagick_load_image):
12979 Don't assume :index value fits in 'int'.
12980 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
12981 (imagemagick_load_image): Check that crop parameters fit into
12982 the integer types that MagickCropImage accepts. Don't assume
12983 Vimagemagick_render_type has a nonnegative value. Don't assume
12984 size_t fits in 'long'.
12985 (gs_load): Use printmax_t to print the widest integers possible.
12986 Check for integer overflow when computing image height and width.
12987
c11821d4
EZ
129882011-08-26 Eli Zaretskii <eliz@gnu.org>
12989
12990 * xdisp.c (redisplay_window): Don't force window start if point
12991 will be invisible in the resulting window. (Bug#9324)
12992
0c95fcf7
EZ
129932011-08-25 Eli Zaretskii <eliz@gnu.org>
12994
12995 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
12996 the display spec is of the form `(space ...)'.
12997 (handle_display_spec): Return the value returned by
12998 handle_single_display_spec, not just 1 or zero.
12999 (handle_single_display_spec): If the display spec is of the form
13000 `(space ...)', and specifies display in the text area, return 2
13001 rather than 1.
fee65a97 13002 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
13003 accurately, and prefer exact match for point under bidi.
13004 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
13005
13006 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
13007 into disp_prop; all users changed.
13008
13009 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
13010 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
13011 for the text covered by the display property.
13012
e4ed06f1
CY
130132011-08-25 Chong Yidong <cyd@stupidchicken.com>
13014
13015 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
13016 Change return value to nil.
13017 (Frecord_buffer): Delete unused function.
13018
f67cdd7f
EZ
130192011-08-24 Eli Zaretskii <eliz@gnu.org>
13020
5980d4c6
EZ
13021 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
13022 buffers, return left-to-right.
8610fe8b
EZ
13023 (set_cursor_from_row): Consider candidate row a win if its glyph
13024 represents a newline and point is on that newline. Fixes cursor
13025 positioning on the newline at EOL of R2L text within L2R
13026 paragraph, and vice versa.
13027 (try_cursor_movement): Check continued rows, in addition to
13028 continuation rows. Fixes unwarranted scroll when point enters a
13029 continued line of R2L text within an L2R paragraph, or vice versa.
13030 (cursor_row_p): Consider the case of point being equal to
13031 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
13032 from the end of a short line to the beginning of a continued line
13033 of R2L text within L2R paragraph.
13034 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
13035 composed characters.
5980d4c6 13036
f67cdd7f
EZ
13037 * bidi.c (bidi_check_type): Use xassert.
13038 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
13039 members.
13040
bca633fb
EZ
130412011-08-23 Eli Zaretskii <eliz@gnu.org>
13042
13043 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
13044 a character.
13045
4a5885a7
CY
130462011-08-23 Chong Yidong <cyd@stupidchicken.com>
13047
13048 * nsfont.m (ns_otf_to_script): Fix typo.
13049
0902a04e
KH
130502011-08-22 Kenichi Handa <handa@m17n.org>
13051
13052 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
13053 extra slot even if the purpose is char-code-property-table.
13054
1a2e6670
EZ
130552011-08-23 Eli Zaretskii <eliz@gnu.org>
13056
8ddde651
EZ
13057 * xdisp.c (redisplay_window): When computing centering_position,
13058 account for the height of the header line. (Bug#8874)
13059
425cc014
EZ
13060 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
13061 instead of CHAR_TO_BYTE. Fixes a crash when a completion
13062 candidate is selected by the mouse, and that candidate has a
13063 composed character under the mouse.
13064
1a2e6670
EZ
13065 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
13066 coordinates reported by pos-visible-in-window-p for a composed
13067 character in column zero.
13068
8b76d6f8
SM
130692011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
13070
13071 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
13072
dac347dd
EZ
130732011-08-22 Eli Zaretskii <eliz@gnu.org>
13074
13075 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
13076 consider it a hit if to_charpos is anywhere in the range of the
13077 composed buffer positions.
13078
e013fb34
CY
130792011-08-22 Chong Yidong <cyd@stupidchicken.com>
13080
13081 * image.c (gif_load): Don't assume that each subimage has the same
13082 dimensions as the base image. Handle disposal method that is
13083 "undefined" by the gif spec (Bug#9335).
13084
bd1ba3e8
CY
130852011-08-20 Chong Yidong <cyd@stupidchicken.com>
13086
13087 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 13088 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 13089
54a1215b
EZ
130902011-08-19 Eli Zaretskii <eliz@gnu.org>
13091
823564e5
EZ
13092 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
13093 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
13094 from an Org mode buffer to a Speedbar frame.
13095
54a1215b
EZ
13096 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
13097 a composition, take its buffer position from IT->cmp_it.charpos.
13098 Fixes cursor positioning at the beginning of a line that begins
13099 with a composed character.
13100
9778ebcc
EZ
131012011-08-18 Eli Zaretskii <eliz@gnu.org>
13102
0be6ee06
EZ
13103 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
13104 character bidirectional type, use STRONG_L instead. Fixes crashes
13105 in a buffer produced by `describe-categories'.
13106
9778ebcc
EZ
13107 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
13108 members before the level stack, so they would be saved and
13109 restored when copying iterator state. Fixes incorrect reordering
13110 around TABs covered by display properties.
13111
156bffbe
AS
131122011-08-18 Andreas Schwab <schwab@linux-m68k.org>
13113
6b02f655 13114 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 13115
72ad093b
CY
131162011-08-17 Chong Yidong <cyd@stupidchicken.com>
13117
13118 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
13119 (internal_condition_case_2, internal_condition_case_n):
13120 Remove unnecessary aborts (Bug#9081).
72ad093b 13121
35774242
EZ
131222011-08-17 Eli Zaretskii <eliz@gnu.org>
13123
13124 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
13125 has no `load' handler, try opening the file locally. (Bug#9311)
13126
db76dd85
KB
131272011-08-16 Ken Brown <kbrown@cornell.edu>
13128
13129 * gmalloc.c: Expand comment.
13130
b215eee5
EZ
131312011-08-16 Eli Zaretskii <eliz@gnu.org>
13132
13133 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
13134 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
13135
a4579d33
KB
131362011-08-16 Ken Brown <kbrown@cornell.edu>
13137
13138 Fix memory allocation problems in Cygwin build (Bug#9273).
13139
13140 * unexcw.c ( __malloc_initialized): Declare external variable.
13141 (fixup_executable): Force the dumped emacs to reinitialize malloc.
13142
8b76d6f8
SM
13143 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
13144 New variables.
a4579d33
KB
13145 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
13146 dumped emacs.
13147 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
13148 in the static heap.
13149 [CYGWIN] (special_realloc): New function.
13150 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
13151 requests to realloc storage in the static heap.
13152
3ebec551
PE
131532011-08-15 Paul Eggert <eggert@cs.ucla.edu>
13154
13155 * bidi.c (bidi_initialize): Remove unused local.
13156
9fd8be00
EZ
131572011-08-15 Eli Zaretskii <eliz@gnu.org>
13158
6b02f655
SM
13159 * bidimirror.h:
13160 * biditype.h: Remove file.
13161 * makefile.w32-in ($(BLD)/bidi.$(O)):
13162 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
13163
13164 * dispextern.h: Fix a typo in the comment to bidi_type_t.
13165
13166 * chartab.c: Improve commentary for the uniprop_table API.
13167
32413314
EZ
13168 * bidi.c (bidi_paragraph_init): Support zero value of
13169 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
13170 (bidi_initialize): Use uniprop_table instead of including
13171 biditype.h and bidimirror.h.
32413314 13172
9fd8be00
EZ
13173 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
13174 coordinates of the iterator when restoring from ppos_it.
13175 (Bug#9296)
13176
5cf2b69b
KH
131772011-08-14 Kenichi Handa <handa@m17n.org>
13178
13179 * process.c (create_process): Call setup_process_coding_systems
72ad093b 13180 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 13181
daf17d00
EZ
131822011-08-14 Eli Zaretskii <eliz@gnu.org>
13183
13184 * xdisp.c (move_it_in_display_line_to): Don't invoke
13185 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
13186 ppos_it. Fixes vertical cursor motion when line beginning is
13187 covered by an image. (Bug#9296)
13188
08e3161a
JD
131892011-08-14 Jan Djärv <jan.h.d@swipnet.se>
13190
13191 * nsterm.h (ns_run_ascript): Declare.
13192 (NSAPP_DATA2_RUNASSCRIPT): Define.
13193
13194 * nsfns.m (as_script, as_result, as_status): New static variables.
13195 (ns_run_ascript): New function.
5e617bc2 13196 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
13197 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
13198 the event loop. Get status from as_status (Bug#7276).
13199
13200 * nsterm.m (sendEvent): If event is NSApplicationDefined and
13201 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
13202 the event loop (Bug#7276).
13203
a3720aa2
AS
132042011-08-14 Andreas Schwab <schwab@linux-m68k.org>
13205
13206 * gnutls.c (QCgnutls_bootprop_priority)
13207 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
13208 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
13209 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
13210 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
13211 (QCgnutls_bootprop_verify_hostname_error)
13212 (QCgnutls_bootprop_callbacks_verify): Rename from
13213 Qgnutls_bootprop_..., all uses changed.
13214
13215 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
13216 uses changed.
13217
0a0d27fb
PE
132182011-08-14 Paul Eggert <eggert@cs.ucla.edu>
13219
19d5c50c
PE
13220 * xfaces.c (Qframe_set_background_mode): Now static.
13221 * dispextern.h (Qframe_set_background_mode): Remove decl.
13222
0a0d27fb
PE
13223 * process.c (Fnetwork_interface_info): Declare local only if needed.
13224
377538cb
JD
132252011-08-13 Jan Djärv <jan.h.d@swipnet.se>
13226
13227 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
13228 (Fnetwork_interface_list): Allocate in increments of bytes instead
13229 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
13230 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
13231 sockaddr.
13232 (struct ifflag_def): notrailers is smart on OSX.
13233 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
13234 Get hardware address with getifaddrs if available.
13235
08fff70c
EZ
132362011-08-12 Eli Zaretskii <eliz@gnu.org>
13237
13238 * xdisp.c (iterate_out_of_display_property): xassert that
13239 IT->position is set to within IT->object's boundaries. Break from
13240 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
13241 when IT->position is set up wrongly due to some bug.
13242 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
13243 (push_display_prop): Allow GET_FROM_STRING as IT->method on
13244 entry. Force push_it to save on the stack the current
13245 buffer/string position, to be restored by pop_it. Fix flags in
13246 the iterator structure wrt the object coming from a display
13247 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
13248 properties. (Bug#9284)
13249
7be1c708 132502011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 13251
7be1c708
CY
13252 * fontset.c (fontset_get_font_group): Add proper type checks.
13253 (Bug#9172)
aac0c6e3 13254
7be1c708 132552011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 13256
7be1c708
CY
13257 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
13258 and LC_VERSION_MIN_MACOSX.
13259 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
13260 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 13261
97bb72a6
EZ
132622011-08-08 Eli Zaretskii <eliz@gnu.org>
13263
13264 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
13265 no-display-properties-and-no-overlays under bidi display.
13266 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 13267 properties and overlays.
97bb72a6 13268
d5617611
CY
132692011-08-08 Chong Yidong <cyd@stupidchicken.com>
13270
37e11a63
CY
13271 * editfns.c (Fset_time_zone_rule): Document relationship with the
13272 setenv function.
13273
d5617611
CY
13274 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
13275 the font entity extracted from the cache (Bug#8109).
13276
58872834
CY
132772011-08-07 Chong Yidong <cyd@stupidchicken.com>
13278
13279 * composite.c (autocmp_chars): Don't reset point. That is done by
13280 restore_point_unwind (Bug#5984).
13281
75bfc667
JL
132822011-08-07 Juri Linkov <juri@jurta.org>
13283
13284 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
13285 to show the arg `TIME' instead of `TIMEVAL'.
13286
d1410150
EZ
132872011-08-06 Eli Zaretskii <eliz@gnu.org>
13288
13289 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
13290 display property strides EOL and includes a newline, as in
13291 longlines-mode. (Bug#9254)
75b771e4
EZ
13292 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
13293 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
13294
13295 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
13296 is non-zero, even if the data buffer is NULL. Fixes a crash in
13297 vertical-motion with longlines-mode. (Bug#9254)
13298
35928349
EZ
132992011-08-05 Eli Zaretskii <eliz@gnu.org>
13300
ec7cc85b
EZ
13301 * bidi.c <bidi_cache_total_alloc>: Now static.
13302 (bidi_initialize): Initialize bidi_cache_total_alloc.
13303
8b76d6f8 13304 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
13305 cache. (Bug#9221)
13306
13307 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
13308 amount allocated this far in `bidi_cache_total_alloc'.
13309 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
13310 non-zero, only free the data buffer without restoring the cache
13311 contents. All callers changed.
13312
13313 * dispextern.h (bidi_unshelve_cache): Update prototype.
13314
13315 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
13316 (move_it_in_display_line, move_it_to)
13317 (move_it_vertically_backward, move_it_by_lines): Replace the call
13318 to xfree to an equivalent call to bidi_unshelve_cache.
13319 (move_it_in_display_line_to): Fix logic of returning
412b6358 13320 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 13321
e2e2423b
EZ
133222011-08-05 Eli Zaretskii <eliz@gnu.org>
13323
13324 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
13325 came from a string character with a `cursor' property. (Bug#9229)
13326
ae9e757a
JD
133272011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13328
13329 * Makefile.in (LIB_PTHREAD): New variable.
13330 (LIBES): Add LIB_PTHREAD (Bug#9216).
13331
13332 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
13333 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
13334
213bd7f2
AS
133352011-08-04 Andreas Schwab <schwab@linux-m68k.org>
13336
6b02f655 13337 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 13338
99aaf75f
JD
133392011-08-04 Jan Djärv <jan.h.d@swipnet.se>
13340
13341 * xterm.c (x_find_topmost_parent): New function.
13342 (x_set_frame_alpha): Find topmost parent window with
13343 x_find_topmost_parent and set the property there also (bug#9181).
13344 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
13345
c74e9d86
PE
133462011-08-04 Paul Eggert <eggert@cs.ucla.edu>
13347
13348 * callproc.c (Fcall_process): Avoid vfork clobbering
13349 the local vars buffer, coding_systems, current_dir.
13350
640c8776
SM
133512011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
13352
13353 * keymap.c (Fmake_composed_keymap): Move to subr.el.
13354
f26d0e4c
PE
133552011-08-03 Paul Eggert <eggert@cs.ucla.edu>
13356
8a10d76c
PE
13357 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
13358 so that it is not optimized away.
13359
f26d0e4c
PE
13360 * xdisp.c (compute_display_string_pos): Remove unused local.
13361
55439c61
EZ
133622011-08-02 Eli Zaretskii <eliz@gnu.org>
13363
13364 Fix slow cursor motion and scrolling in large buffers with
13365 selective display, like Org Mode buffers. (Bug#9218)
13366
13367 * dispextern.h (struct bidi_it): New member disp_prop_p.
13368
13369 * xdisp.c: Remove one-slot cache of display string positions.
13370 (compute_display_string_pos): Accept an additional argument
5e617bc2 13371 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
13372 for a display string or property. If found, set DISP_PROP_P
13373 non-zero.
13374
13375 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
13376 DISP_PROP_P, and pass it to compute_display_string_pos.
13377 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
13378 non-zero. All callers of bidi_fetch_char changed.
13379
fb33fa43
SM
133802011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
13381
13382 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
13383
b099e063
DM
133842010-12-03 Don March <don@ohspite.net>
13385
13386 * keymap.c (Fdefine_key): Fix non-prefix key error message when
13387 last character M-[char] is translated to ESC [char] (bug#7541).
13388
5cc7f7af
KH
133892011-08-02 Kenichi Handa <handa@m17n.org>
13390
d0fffa3f 13391 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
13392
13393 * chartab.c (uniprop_table): Make it non-static.
13394
525d5e6e
EZ
133952011-08-01 Eli Zaretskii <eliz@gnu.org>
13396
13397 * xdisp.c (forward_to_next_line_start): Accept additional argument
13398 BIDI_IT_PREV, and store into it the state of the bidi iterator had
13399 on the newline.
13400 (reseat_at_next_visible_line_start): Use the bidi iterator state
13401 returned by forward_to_next_line_start to restore the state of
13402 it->bidi_it after backing up to previous newline. (Bug#9212)
13403
31011111
AS
134042011-07-30 Andreas Schwab <schwab@linux-m68k.org>
13405
13406 * regex.c (re_comp): Protoize.
13407 (re_exec): Fix return type.
13408 (regexec): Fix type of `ret'. (Bug#9203)
13409
476371c4
PE
134102011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13411
e5d76069
PE
13412 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
13413 This is needed if max-image-size is a floating-point number.
13414
9a79b20c
AS
134152011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13416
13417 * print.c (print_object): Print empty symbol as ##.
13418
13419 * lread.c (read1): Read ## as empty symbol.
13420
d8c2fa78
AA
134212011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
13422
13423 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
13424 setting frame foreground color (Bug#9175).
13425 (x_set_background_color): Likewise.
13426
ffe57a7a
AA
13427 * nsmenu.m (-setText): Size tooltip dimensions precisely to
13428 contents (Bug#9176).
13429 (EmacsTooltip -init): Remove bezels and add shadows to
13430 tooltip windows.
13431
bf3492a5
AA
13432 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
13433 or scroll bar (Bug#8470).
13434
d55e9c53
AA
13435 * nsfont.m (nsfont_open): Remove assignment to voffset and
13436 unnecessary vars hshink, expand, hd, full_height, min_height.
13437 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
13438
13439 * nsterm.h (nsfont_info): Remove voffset field.
13440
d8c2fa78 134412011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
13442
13443 Implement strike-through and overline on NextStep (Bug#8863).
13444
13445 * nsfont.m (nsfont_open): Use underline position provided by font,
13446 instead of hard-coded value of 2.
13447 (nsfont_draw): Call ns_draw_text_decoration instead.
13448
13449 * nsterm.h: Add declaration for ns_draw_text_decoration.
13450
13451 * nsterm.m (ns_draw_text_decoration): New function for drawing
13452 underline, overline, and strike-through.
13453 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
13454 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 13455 accommodate underlining, etc.
4843aac3 13456
4cc60b9b
EZ
134572011-07-28 Eli Zaretskii <eliz@gnu.org>
13458
bc7ece87
EZ
13459 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
13460 default.
4cc60b9b 13461
476371c4
PE
134622011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13463
66606eea
PE
13464 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
13465 Without this fix, if a signal arrives just after memory fills up,
13466 'malloc' might be invoked reentrantly.
13467
476371c4
PE
13468 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
13469 In other words, assume that every image size is allowed, on non-X
13470 hosts. This assumption is probably wrong, but it lets Emacs compile.
13471
f3fcc40d
AS
134722011-07-28 Andreas Schwab <schwab@linux-m68k.org>
13473
13474 * regex.c (re_iswctype): Convert return values to boolean.
13475
350c992f
EZ
134762011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
13477
13478 * xdisp.c (compute_display_string_pos): Don't use cached display
13479 string position if the buffer had its restriction changed.
13480 (Bug#9184)
13481
5266b4bb
PE
134822011-07-28 Paul Eggert <eggert@cs.ucla.edu>
13483
13484 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13485
2573a837 134862011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 13487
41f55ccd 13488 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 13489
39e378da
PE
13490 * bidi.c: Integer size and overflow fixes.
13491 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
13492 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
13493 (bidi_cache_find_level_change, bidi_cache_ensure_space)
13494 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
13495 (bidi_find_other_level_edge):
13496 Use ptrdiff_t instead of EMACS_INT where either will do.
13497 This works better on 32-bit hosts configured --with-wide-int.
13498 (bidi_cache_ensure_space): Check for size-calculation overflow.
13499 Use % rather than repeated addition, for better worst-case speed.
13500 Don't set bidi_cache_size until after xrealloc returns, because it
13501 might not return.
13502 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
13503 (bidi_cache_ensure_space): Also check that the bidi cache size
13504 does not exceed that of the largest Lisp string or buffer. See Eli
13505 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 13506
5e927815
PE
13507 * alloc.c (__malloc_size_t): Remove.
13508 All uses replaced by size_t. See Andreas Schwab's note
13509 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
13510
ca4aa935
PE
13511 * image.c: Improve checking for integer overflow.
13512 (check_image_size): Assume that f is nonnull, since
13513 it is always nonnull in practice. This is one less thing to
13514 worry about when checking for integer overflow later.
13515 (x_check_image_size): New function, which checks for integer
13516 overflow issues inside X.
13517 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
13518 This removes the need for a memory_full check.
13519 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
13520 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
13521 (xbm_read_bitmap_data): Change locals back to 'int', since
13522 their values must fit in 'int'.
13523 (xpm_load_image, png_load, tiff_load):
13524 Invoke x_create_x_image_and_pixmap earlier,
13525 to avoid much needless work if the image is too large.
13526 (tiff_load): Treat overly large images as if
13527 x_create_x_image_and_pixmap failed, not as malloc failures.
13528 (gs_load): Use x_check_image_size.
13529
5f8f9cc2
PE
13530 * gtkutil.c: Omit integer casts.
13531 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
13532 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
13533
5adf60bc
PE
13534 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
13535
c8907a93
PE
13536 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
13537 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
13538 would wrongly return t on a 64-bit host.
13539
e3c25c68
PE
13540 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
13541 The plain *_OVERFLOW macros run afoul of GCC bug 49705
13542 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
13543 and therefore cause GCC to emit a bogus diagnostic in some cases.
13544
3f791afe
PE
13545 * image.c: Integer signedness and overflow and related fixes.
13546 This is not an exhaustive set of fixes, but it's time to
13547 record what I've got.
13548 (lookup_pixel_color, check_image_size): Remove redundant decls.
13549 (check_image_size): Don't assume that arbitrary EMACS_INT values
13550 fit in 'int', or that arbitrary 'double' values fit in 'int'.
13551 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
13552 (tiff_load, imagemagick_load_image):
13553 Check for overflow in size calculations.
13554 (x_create_x_image_and_pixmap): Remove unnecessary test for
13555 xmalloc returning NULL; that can't happen.
13556 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
13557 (xpm_color_bucket): Use better integer hashing function.
13558 (xpm_cache_color): Don't possibly over-allocate memory.
13559 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
13560 (gif_memory_source):
13561 Use ptrdiff_t, not int or size_t, to record sizes.
13562 (png_load): Don't assume values greater than 2**31 fit in 'int'.
13563 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
13564 either works, as we prefer signed integers.
13565 (tiff_read_from_memory, tiff_write_from_memory):
13566 Return tsize_t, not size_t, since that's what the TIFF API wants.
13567 (tiff_read_from_memory): Don't fail simply because the read would
13568 go past EOF; instead, return a short read.
13569 (tiff_load): Omit no-longer-needed casts.
13570 (Fimagemagick_types): Don't assume size fits into 'int'.
13571
3cc5a532
PE
13572 Improve hashing quality when configured --with-wide-int.
13573 * fns.c (hash_string): New function, taken from sxhash_string.
13574 Do not discard information about ASCII character case; this
13575 discarding is no longer needed.
13576 (sxhash-string): Use it. Change sig to match it. Caller changed.
13577 * lisp.h: Declare it.
13578 * lread.c (hash_string): Remove, since we now use fns.c's version.
13579 The fns.c version returns a wider integer if --with-wide-int is
13580 specified, so this should help the quality of the hashing a bit.
13581
b312a492
PE
13582 * emacs.c: Integer overflow minor fix.
13583 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
13584 Define only if GNU_LINUX.
13585 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
13586
dfd153ae
PE
13587 * dispnew.c: Integer signedness and overflow fixes.
13588 Remove unnecessary forward decls, that were a maintenance hassle.
13589 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
13590 All uses changed.
13591 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
13592 (scrolling_window): Use ptrdiff_t, not int, for byte count.
13593 (prepare_desired_row, line_draw_cost):
13594 Use int, not unsigned, where either works.
13595 (save_current_matrix, restore_current_matrix):
13596 Use ptrdiff_t, not size_t, where either works.
13597 (init_display): Check for overflow more accurately, and without
13598 relying on undefined behavior.
13599
a81d11a3
PE
13600 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
13601 Remove, replacing with the new symbols in lisp.h. All uses changed.
13602 * fileio.c (make_temp_name):
13603 * filelock.c (lock_file_1, lock_file):
13604 * xdisp.c (message_dolog):
13605 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
13606 Use pMd etc. instead.
13607 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
13608 replacing the pWIDE etc. symbols removed from editfns.c.
13609
3300e6fd
PE
13610 * keyboard.h (num_input_events): Now uintmax_t.
13611 This is (very slightly) less likely to mess up due to wraparound.
13612 All uses changed.
13613
fd05c7e9
PE
13614 * buffer.c: Integer signedness fixes.
13615 (alloc_buffer_text, enlarge_buffer_text):
13616 Use ptrdiff_t rather than size_t when either will do, as we prefer
13617 signed integers.
13618
903fe15d
PE
13619 * alloc.c: Integer signedness and overflow fixes.
13620 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
13621 (__malloc_size_t): Default to size_t, not to int.
13622 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
13623 (Fgarbage_collect, mark_object_loop_halt, mark_object):
13624 Prefer ptrdiff_t to size_t when either would do, as we prefer
13625 signed integers.
13626 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
13627 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
13628 Now const. Initialize with values that are in range even if char
13629 is signed.
13630 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
13631 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
13632 These functions do the right thing with sizes > 2**32.
13633 (check_depth): Now ptrdiff_t, not int.
13634 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
13635 Adjust to new way of storing sizes. Check for size overflow bugs
13636 in rest of code.
13637 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
13638 slightly wrong anyway, as it missed one instance of
13639 XMALLOC_OVERRUN_CHECK_OVERHEAD.
13640 (refill_memory_reserve): Omit needless cast to size_t.
13641 (mark_object_loop_halt): Mark as externally visible.
13642
ac82cc6a
PE
13643 * xselect.c: Integer signedness and overflow fixes.
13644 (Fx_register_dnd_atom, x_handle_dnd_message):
13645 Use ptrdiff_t, not size_t, since we prefer signed.
13646 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
13647 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
13648 x_dnd_atoms_size and x_dnd_atoms_length.
13649
c2d1e36d
PE
13650 * doprnt.c: Prefer signed to unsigned when either works.
13651 * eval.c (verror):
13652 * doprnt.c (doprnt):
13653 * lisp.h (doprnt):
13654 * xdisp.c (vmessage):
13655 Use ptrdiff_t, not size_t, when using or implementing doprnt,
13656 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
13657 prefer signed arithmetic to avoid comparison confusion.
13658 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
13659 but is a bit tricky.
13660
0e926e56
PE
13661 Assume freestanding C89 headers, string.h, stdlib.h.
13662 * data.c, doprnt.c, floatfns.c, print.c:
13663 Include float.h unconditionally.
13664 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
13665 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
13666 * regex.c: Likewise for stddef.h, string.h.
13667 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
13668 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
13669 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
13670 (STDC_HEADERS): Remove obsolete defines.
13671 * sysdep.c: Include limits.h unconditionally.
13672
9cfdb3ec
PE
13673 Assume support for memcmp, memcpy, memmove, memset.
13674 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
13675 * regex.c (memcmp, memcpy):
13676 Remove; we assume C89 now.
13677
13678 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
13679 (__malloc_safe_bcopy): Remove; no longer needed.
13680
cf950e6b 13681 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
13682 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
13683 well either way, and we prefer signed to unsigned.
13684
dbf38e02
LMI
136852011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
13686
13687 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
13688 closes the connection while we're reading (bug#9182).
13689
d6f0886c 136902011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 13691
d6f0886c
JD
13692 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
13693 are specified (Bug#9168).
24e0f6b1 13694
2eb1f9e6
PE
136952011-07-25 Paul Eggert <eggert@cs.ucla.edu>
13696
13697 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
13698 Found by GCC static checking and --with-wide-int on a 32-bit host.
13699
22381272 137002011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
13701
13702 * xdisp.c (compute_display_string_pos): Fix logic of caching
13703 previous display string position. Initialize cached_prev_pos to
13704 -1. Fixes slow-down at the beginning of a buffer.
13705
f25e39b4
EZ
137062011-07-24 Eli Zaretskii <eliz@gnu.org>
13707
13708 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
13709 for attrs[LFACE_FONTSET_INDEX].
13710
04c4b52e
PE
137112011-07-23 Paul Eggert <eggert@cs.ucla.edu>
13712
13713 * xml.c (parse_region): Remove unused local
13714 that was recently introduced.
13715
c1734fbd
EZ
137162011-07-23 Eli Zaretskii <eliz@gnu.org>
13717
be18c5a5
EZ
13718 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
13719 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
13720
c1734fbd
EZ
13721 * xdisp.c (move_it_in_display_line_to): Record the best matching
13722 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
13723 exit if none of the characters scanned was an exact match.
13724 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
13725 when exact match is impossible due to invisible text, and the
13726 lines are truncated.
13727
a258d627
JD
137282011-07-23 Jan Djärv <jan.h.d@swipnet.se>
13729
13730 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
13731 for OSX >= 10.7.
13732
b6d5a689
EZ
137332011-07-22 Eli Zaretskii <eliz@gnu.org>
13734
0f74f785
EZ
13735 Fix a significant slow-down of cursor motion with C-n, C-p,
13736 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
13737 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 13738 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
13739 (next_element_from_buffer): Call compute_stop_pos_backwards to
13740 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
13741 base_level_stop.
13742 (reseat): Don't look for prev_stop, as that could mean a very long
13743 run.
13744 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
13745 <cached_disp_overlay_modiff>: Cache for last found display string
13746 position.
551918c1 13747 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
13748 about the same buffer in the same area of character positions, and
13749 the buffer wasn't changed since the time the display string
13750 position was cached.
551918c1 13751
b2d0c91a
EZ
137522011-07-22 Eli Zaretskii <eliz@gnu.org>
13753
13754 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
13755 is an integer, which is important for empty lines. (Bug#9149)
13756
043604ee
CY
137572011-07-22 Chong Yidong <cyd@stupidchicken.com>
13758
13759 * frame.c (Fmodify_frame_parameters): In tty case, update the
13760 default face if necessary (Bug#4238).
13761
da4adb04
CY
137622011-07-21 Chong Yidong <cyd@stupidchicken.com>
13763
13764 * editfns.c (Fstring_to_char): No need to explain what a character
13765 is in the docstring (Bug#6576).
13766
9abd0532
LMI
137672011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13768
13769 * xml.c (parse_region): Make sure we always return a tree.
13770
36881d16
HK
137712011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
13772
13773 * xml.c (parse_region): If a document contains only comments,
13774 return that, too.
13775
1e98674d
LMI
137762011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
13777
13778 * xml.c (make_dom): Return comments, too.
13779
590bd467
PE
137802011-07-19 Paul Eggert <eggert@cs.ucla.edu>
13781
13782 Port to OpenBSD.
13783 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
13784 and the surrounding thread.
13785 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
13786 rather than fgets, and retry after EINTR. Otherwise, 'emacs
13787 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
13788 timer goes off.
13789 * s/openbsd.h (BROKEN_SIGIO): Define.
13790 * unexelf.c (unexec) [__OpenBSD__]:
13791 Don't update the .mdebug section of the Alpha COFF symbol table.
13792
f41628b2
LMI
137932011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
13794
13795 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
13796 (bug#8460).
13797
b59b67c5
PE
137982011-07-18 Paul Eggert <eggert@cs.ucla.edu>
13799
15e3a074
PE
13800 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
13801 This fixes some race conditions on the permissions of any newly
13802 created file.
13803
41bed37d
PE
13804 * alloc.c (valid_pointer_p): Use pipe, not open.
13805 This fixes some permissions issues when debugging.
13806
b59b67c5
PE
13807 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
13808 If fchown fails to set both uid and gid, try to set just gid,
13809 as that is sometimes allowed. Adjust the file's mode to eliminate
13810 setuid or setgid bits that are inappropriate if fchown fails.
13811
925a6be7
SM
138122011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
13813
13814 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
13815 to compare Lisp_Objects.
13816 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
13817 global_gnutls_log_level, don't mistake it for a Lisp_Object.
13818 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
13819
52968808
AS
138202011-07-17 Andreas Schwab <schwab@linux-m68k.org>
13821
0a6a104b
AS
13822 * lread.c (read_integer): Unread even EOF character.
13823 (read1): Likewise. Properly record start position of symbol.
13824
52968808
AS
13825 * lread.c (read1): Read `#:' as empty uninterned symbol if no
13826 symbol character follows.
13827
9e381cdd
PE
138282011-07-17 Paul Eggert <eggert@cs.ucla.edu>
13829
13830 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
13831 This works around a problem with the previous change to Fcopy_file.
13832 Recent glibc declares fchown with __attribute__((warn_unused_result)),
13833 and without this change, GCC might complain about discarding
13834 fchown's return value.
13835
b5641435
JB
138362011-07-16 Juanma Barranquero <lekktu@gmail.com>
13837
13838 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
13839
a8031457
PE
138402011-07-16 Paul Eggert <eggert@cs.ucla.edu>
13841
13842 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
13843
dd889327
LMI
138442011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
13845
750c33f7
LMI
13846 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
13847 it's used from the C level.
13848
dd889327
LMI
13849 * process.c: Use the same condition for POLL_FOR_INPUT in both
13850 keyboard.c and process.c (bug#1858).
13851
87e86684
LM
138522011-07-09 Lawrence Mitchell <wence@gmx.li>
13853
13854 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
13855 (Fgnutls_boot): Use it.
13856
64348f40
AS
138572011-07-15 Andreas Schwab <schwab@linux-m68k.org>
13858
13859 * doc.c (Fsubstitute_command_keys): Revert last change.
13860
1d698799
LMI
138612011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
13862
f863868c
LMI
13863 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
13864 quotes the next character, and doesn't affect other longer
13865 sequences (bug#8935).
13866
1d698799
LMI
13867 * lread.c (syms_of_lread): Clarify that is isn't only
13868 `eval-buffer' and `eval-defun' that's affected by
13869 `lexical-binding' (bug#8460).
13870
aa4b6df6
EZ
138712011-07-15 Eli Zaretskii <eliz@gnu.org>
13872
13873 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 13874 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 13875
5d856da6
PE
138762011-07-14 Paul Eggert <eggert@cs.ucla.edu>
13877
ad6042bb
PE
13878 Fix minor problems found by static checking.
13879 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
13880 (elsz): Now a signed constant, not a size_t var. We prefer signed
13881 types to unsigned, to avoid integer comparison confusion. Without
13882 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
13883 "cannot optimize loop, the loop counter may overflow", a symptom
13884 of the confusion.
f00bbb22 13885 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
13886 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
13887
6468f31c
LMI
138882011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
13889
49080b10
LMI
13890 * search.c (Fre_search_backward): Mention `case-fold-search' in
13891 all the re_search_* functions (bug#8138).
13892
6468f31c
LMI
13893 * keyboard.c (Fopen_dribble_file): Document when the file is
13894 closed (bug#8056).
13895
c965adc5
EZ
138962011-07-14 Eli Zaretskii <eliz@gnu.org>
13897
df9733bf
EZ
13898 * bidi.c (bidi_dump_cached_states): Fix format of displaying
13899 bidi_cache_idx.
13900
0bb23927
EZ
13901 Support bidi reordering of display and overlay strings.
13902 * xdisp.c (compute_display_string_pos)
13903 (compute_display_string_end): Accept additional argument STRING.
13904 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
13905 (reseat_to_string): Initialize bidi_it->string.s and
13906 bidi_it->string.schars.
13907 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
13908 NULL (avoids a crash in bidi_paragraph_init).
13909 Initialize itb.string.lstring.
0bb23927
EZ
13910 (init_iterator): Call bidi_init_it only of a valid
13911 buffer position was specified. Initialize paragraph_embedding to
13912 L2R.
13913 (reseat_to_string): Initialize the bidi iterator.
13914 (display_string): If we need to ignore text properties of
13915 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
13916 original value of -1 will not work with bidi.)
13917 (compute_display_string_pos): First arg is now struct
13918 `text_pos *'; all callers changed. Support display properties on
13919 Lisp strings.
13920 (compute_display_string_end): Support display properties on Lisp
13921 strings.
13922 (init_iterator, reseat_1, reseat_to_string): Initialize the
13923 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
13924 when iterating on a string not from display properties).
640c8776
SM
13925 (compute_display_string_pos, compute_display_string_end):
13926 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
13927 arrow keys.
13928 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
13929 base_level_stop; instead, set base_level_stop to BEGV.
13930 Fixes crashes in vertical-motion.
0bb23927
EZ
13931 (next_element_from_buffer): Improve commentary for when
13932 the iterator is before prev_stop.
13933 (init_iterator): Initialize bidi_p from the default value of
13934 bidi-display-reordering, not from buffer-local value. Use the
13935 buffer-local value only if initializing for buffer iteration.
13936 (handle_invisible_prop): Support invisible properties on strings
13937 that are being bidi-reordered.
13938 (set_iterator_to_next): Support bidi reordering of C strings and
13939 Lisp strings.
13940 (next_element_from_string): Support bidi reordering of Lisp
13941 strings.
13942 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
13943 (display_string): Support display of R2L glyph rows.
13944 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
13945 (init_iterator): Don't initialize it->bidi_p for strings
13946 here.
13947 (reseat_to_string): Initialize it->bidi_p for strings here.
13948 (next_element_from_string, next_element_from_c_string)
13949 (next_element_from_buffer): Add xassert's for correspondence
13950 between IT's object being iterated and it->bidi_it.string
13951 structure.
13952 (face_before_or_after_it_pos): Support bidi iteration.
13953 (next_element_from_c_string): Handle the case of the first string
13954 character that is not the first one in the visual order.
13955 (get_visually_first_element): New function, refactored from common
13956 parts of next_element_from_buffer, next_element_from_string, and
13957 next_element_from_c_string.
13958 (tool_bar_lines_needed, redisplay_tool_bar)
13959 (display_menu_bar): Force left-to-right direction. Add a FIXME
13960 comment for making that be controlled by a user option.
13961 (push_it, pop_it): Save and restore the state of the
13962 bidi iterator. Save and restore the bidi_p flag.
13963 (pop_it): Iterate out of display property for string iteration as
13964 well.
13965 (iterate_out_of_display_property): Support iteration over strings.
13966 (handle_single_display_spec): Set up it->bidi_it for iteration
13967 over a display string, and call bidi_init_it.
13968 (handle_single_display_spec, next_overlay_string)
13969 (get_overlay_strings_1, push_display_prop): Set up the bidi
13970 iterator for displaying display or overlay strings.
13971 (forward_to_next_line_start): Don't use the shortcut if
13972 bidi-iterating.
13973 (back_to_previous_visible_line_start): If handle_display_prop
13974 pushed the iterator stack, restore the internal state of the bidi
13975 iterator by calling bidi_pop_it same number of times.
13976 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
13977 and we are bidi-iterating, don't decrement the iterator position;
13978 instead, set the first_elt flag in the bidi iterator, to produce
13979 the same effect.
13980 (reseat_1): Remove redundant setting of string_from_display_prop_p.
13981 (push_display_prop): xassert that we are iterating a buffer.
13982 (push_it, pop_it): Save and restore paragraph_embedding member.
13983 (handle_single_display_spec, next_overlay_string)
13984 (get_overlay_strings_1, reseat_1, reseat_to_string)
13985 (push_display_prop): Set up the `unibyte' member of bidi_it.string
13986 correctly. Don't assume unibyte strings are not bidi-reordered.
13987 (compute_display_string_pos)
13988 (compute_display_string_end): Fix handling the case of C string.
13989 (push_it, pop_it): Save and restore from_disp_prop_p.
13990 (handle_single_display_spec, push_display_prop): Set the
13991 from_disp_prop_p flag.
13992 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
13993 (pop_it): Call iterate_out_of_display_property only if we are
13994 popping after iteration over a string that came from a display
13995 property. Fix a typo in popping stretch info. Add an assertion
13996 for verifying that the iterator position is in sync with the bidi
13997 iterator.
13998 (handle_single_display_spec, get_overlay_strings_1)
13999 (push_display_prop): Fix initialization of paragraph direction for
14000 string when that of the parent object is not yet determined.
14001 (reseat_1): Call bidi_init_it to resync the bidi
14002 iterator with IT's position. (Bug#7616)
14003 (find_row_edges): If ROW->start.pos gives position
14004 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
14005 (handle_stop, back_to_previous_visible_line_start, reseat_1):
14006 Reset the from_disp_prop_p flag.
14007 (SAVE_IT, RESTORE_IT): New macros.
14008 (pos_visible_p, face_before_or_after_it_pos)
14009 (back_to_previous_visible_line_start)
14010 (move_it_in_display_line_to, move_it_in_display_line)
14011 (move_it_to, move_it_vertically_backward, move_it_by_lines)
14012 (try_scrolling, redisplay_window, display_line): Use them when
14013 saving a temporary copy of the iterator and restoring it back.
14014 (back_to_previous_visible_line_start, reseat_1)
14015 (init_iterator): Empty the bidi cache "stack".
14016 (move_it_in_display_line_to): If iterator ended up at
14017 EOL, but we never saw any buffer positions smaller than
14018 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
14019 motion in bidi-reordered lines.
14020 (move_it_in_display_line_to): Record prev_method and prev_pos
14021 immediately before the call to set_iterator_to_next. Fixes cursor
14022 motion in bidi-reordered lines with stretch glyphs and strings
14023 displayed in margins. (Bug#8133) (Bug#8867)
14024 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
14025 TO_CHARPOS.
640c8776
SM
14026 (pos_visible_p): Support positions in bidi-reordered lines.
14027 Save and restore bidi cache.
0bb23927
EZ
14028
14029 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
14030 (bidi_paragraph_info): Delete unused struct.
14031 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
14032 (bidi_cache_start): New variable.
14033 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
14034 to zero.
14035 (bidi_cache_fetch_state, bidi_cache_search)
14036 (bidi_cache_find_level_change, bidi_cache_iterator_state)
14037 (bidi_cache_find, bidi_peek_at_next_level)
14038 (bidi_level_of_next_char, bidi_find_other_level_edge)
14039 (bidi_move_to_visually_next): Compare cache index with
14040 bidi_cache_start rather than with zero.
14041 (bidi_fetch_char): Accept new argument STRING; all callers
14042 changed. Support iteration over a string. Support strings with
14043 display properties. Support unibyte strings. Fix the type of
14044 `len' according to what STRING_CHAR_AND_LENGTH expects.
14045 (bidi_paragraph_init, bidi_resolve_explicit_1)
14046 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
14047 (bidi_level_of_next_char, bidi_move_to_visually_next):
14048 Support iteration over a string.
0bb23927
EZ
14049 (bidi_set_sor_type, bidi_resolve_explicit_1)
14050 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
14051 can now be zero (for strings); special values 0 and -1 were
14052 changed to -1 and -2, respectively.
14053 (bidi_char_at_pos): New function.
14054 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
14055 Call it instead of FETCH_MULTIBYTE_CHAR.
14056 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
14057 initialized to valid values.
14058 (bidi_init_it): Don't initialize charpos and bytepos with invalid
14059 values.
14060 (bidi_level_of_next_char): Allow the sentinel "position" to pass
14061 the test for valid cached positions. Fix the logic for looking up
14062 the sentinel state in the cache. GCPRO the Lisp string we are
14063 iterating.
14064 (bidi_push_it, bidi_pop_it): New functions.
14065 (bidi_initialize): Initialize the bidi cache start stack pointer.
14066 (bidi_cache_ensure_space): New function, refactored from part of
14067 bidi_cache_iterator_state. Don't assume the required size is just
14068 one BIDI_CACHE_CHUNK away.
14069 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
14070 (bidi_count_bytes, bidi_char_at_pos): New functions.
14071 (bidi_cache_search): Don't assume bidi_cache_last_idx is
14072 always valid if bidi_cache_idx is valid.
14073 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
14074 is valid if it's going to be used.
14075 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
14076 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
14077 (bidi_cache_find_level_change, bidi_cache_ensure_space)
14078 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
14079 (bidi_find_other_level_edge, bidi_cache_start_stack):
14080 All variables related to cache indices are now EMACS_INT.
c965adc5 14081
0bb23927
EZ
14082 * dispextern.h (struct bidi_string_data): New structure.
14083 (struct bidi_it): New member `string'. Make flag members be 1-bit
14084 fields, and put them last in the struct.
640c8776
SM
14085 (compute_display_string_pos, compute_display_string_end):
14086 Update prototypes.
0bb23927
EZ
14087 (bidi_push_it, bidi_pop_it): Add prototypes.
14088 (struct iterator_stack_entry): New members bidi_p,
14089 paragraph_embedding, and from_disp_prop_p.
14090 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
14091 (bidi_shelve_cache, bidi_unshelve_cache):
14092 Declare prototypes.
0bb23927
EZ
14093
14094 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
14095 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
14096 and vector-like objects.
14097
14098 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
14099 cache around display iteration.
14100
14101 * window.c (Fwindow_end, window_scroll_pixel_based)
14102 (displayed_window_lines, Frecenter): Save and restore the bidi
14103 cache around display iteration.
14104
3bbd2265
LMI
141052011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
14106
14107 * editfns.c (Fdelete_region): Clarify the use of the named
14108 parameters (bug#6788).
14109
adc47434
MR
141102011-07-14 Martin Rudalics <rudalics@gmx.at>
14111
14112 * indent.c (Fvertical_motion): Set and restore w->pointm when
14113 saving and restoring the window's buffer (Bug#9006).
14114
837c31f8
LMI
141152011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
14116
14117 * editfns.c (Fstring_to_char): Clarify just what is returned
14118 (bug#6576). Text by Eli Zaretskii.
14119
ac389d0c
JB
141202011-07-13 Juanma Barranquero <lekktu@gmail.com>
14121
14122 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
14123
0be0ce47
EZ
141242011-07-13 Eli Zaretskii <eliz@gnu.org>
14125
14126 * buffer.c (mmap_find): Fix a typo.
14127
cd18e7e3
JB
141282011-07-13 Johan Bockgård <bojohan@gnu.org>
14129
14130 Fix execution of x selection hooks.
14131 * xselect.c (Qx_lost_selection_functions)
14132 (Qx_sent_selection_functions): New vars.
14133 (syms_of_xselect): DEFSYM them.
14134 (x_handle_selection_request): Pass Qx_sent_selection_functions
14135 rather than Vx_sent_selection_functions to Frun_hook_with_args.
14136 (x_handle_selection_clear,x_clear_frame_selections):
14137 Pass Qx_lost_selection_functions rather than
14138 Vx_lost_selection_functions to Frun_hook_with_args.
14139
47ea7f44
PE
141402011-07-13 Paul Eggert <eggert@cs.ucla.edu>
14141
ac389d0c 14142 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
14143 The old code sometimes used this field without initializing it.
14144
47ea7f44
PE
14145 * alloc.c (gc_sweep): Don't read past end of array.
14146 In theory, the old code could also have corrupted Emacs internals,
14147 though it'd be very unlikely.
14148
bc985c87
AS
141492011-07-12 Andreas Schwab <schwab@linux-m68k.org>
14150
14151 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 14152 argument. (Bug#4026)
bc985c87 14153
0cf34688
LMI
141542011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
14155
b3dadd76
LMI
14156 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
14157 key" (bug#4257).
14158
0cf34688
LMI
14159 * window.c (Fset_window_start): Doc fix (bug#4199).
14160 (Fset_window_hscroll): Ditto.
14161
270768cd
PE
141622011-07-12 Paul Eggert <eggert@cs.ucla.edu>
14163
077e3dda 14164 Fix minor new problems caught by GCC 4.6.1.
270768cd 14165 * term.c (init_tty): Remove unused local.
490011a6 14166 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 14167 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 14168 not used otherwise.
270768cd 14169
b1f58454
CY
141702011-07-12 Chong Yidong <cyd@stupidchicken.com>
14171
14172 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
14173
22b9578d
LMI
141742011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
14175
6e70ab07
LMI
14176 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
14177 are the mini-buffer and the echo area (bug#3320).
14178
22b9578d
LMI
14179 * term.c (init_tty): Remove support for supdup, c10 and perq
14180 terminals, which are no longer supported (bug#1482).
14181
8974cc9f
JB
141822011-07-10 Johan Bockgård <bojohan@gnu.org>
14183
14184 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
14185
a560d974
JD
141862011-07-10 Jan Djärv <jan.h.d@swipnet.se>
14187
14188 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
14189 for non-popups (Bug#3642).
14190
1dae0f0a
AS
141912011-07-10 Andreas Schwab <schwab@linux-m68k.org>
14192
268c2c36 14193 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 14194 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
14195 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
14196 * cm.c (losecursor): Likewise.
1dae0f0a
AS
14197 * data.c (fmod): Likewise.
14198 * dispnew.c (swap_glyphs_in_rows): Likewise.
14199 * emacs.c (memory_warning_signal): Likewise.
14200 * floatfns.c (float_error): Likewise.
14201 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
14202 (otf_open, font_otf_capability, generate_otf_features)
14203 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
14204 Likewise.
14205 * image.c (pbm_read_file): Likewise.
14206 * indent.c (string_display_width): Likewise.
14207 * intervals.c (check_for_interval, search_for_interval)
14208 (inc_interval_count, count_intervals, root_interval)
14209 (adjust_intervals_for_insertion, make_new_interval): Likewise.
14210 * lread.c (defalias): Likewise.
268c2c36 14211 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
14212 * regex.c (set_image_of_range_1, set_image_of_range)
14213 (regex_grow_registers): Likewise.
14214 * sysdep.c (strerror): Likewise.
14215 * termcap.c (valid_filename_p, tprint, main): Likewise.
14216 * tparam.c (main): Likewise.
14217 * unexhp9k800.c (run_time_remap, save_data_space)
14218 (update_file_ptrs, read_header, write_header, calculate_checksum)
14219 (copy_file, copy_rest, display_header): Likewise.
14220 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
14221 Likewise.
14222 * xdisp.c (check_it): Likewise.
14223 * xfaces.c (register_color, unregister_color, unregister_colors):
14224 Likewise.
14225 * xfns.c (print_fontset_result): Likewise.
14226 * xrdb.c (member, fatal, main): Likewise.
14227
99033785
PE
142282011-07-10 Paul Eggert <eggert@cs.ucla.edu>
14229
14230 Fix minor problems found by static checking (Bug#9031).
14231 * chartab.c (char_table_set_range, map_sub_char_table):
14232 Remove unused locals.
14233 (uniprop_table): Now static.
14234 * composite.c (_work_char): Remove unused static var.
14235
9cb2ac56
JB
142362011-07-09 Juanma Barranquero <lekktu@gmail.com>
14237
14238 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
14239
f25661f0
JD
142402011-07-09 Jan Djärv <jan.h.d@swipnet.se>
14241
14242 * gtkutil.c (qttip_cb): Remove code without function.
14243
8278c4fe
EZ
142442011-07-09 Eli Zaretskii <eliz@gnu.org>
14245
14246 * w32.c (pthread_sigmask): New stub.
14247
1692ae2d 142482011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 14249
8a6ebd58 14250 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
14251 sigprocmask is portable only for single-threaded applications, and
14252 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
14253 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
14254 (LIBES): Use it.
14255 * callproc.c (Fcall_process):
14256 * process.c (create_process):
14257 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
14258 Use pthread_sigmask, not sigprocmask.
123403e4 14259
1b854618
JD
142602011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14261
14262 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
14263 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
14264 wrong (Bug#8591).
14265
3fe4b549
JD
142662011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14267
0ce7e563
JD
14268 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
14269 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
14270 (xg_hide_tooltip): Fix comment.
14271
3fe4b549
JD
14272 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
14273 in registerServicesMenuSendTypes.
14274 (validRequestorForSendType): Don't check ns_return_types.
14275
14276 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
14277 ns_return_type.
14278
5df75e47
JR
142792011-07-08 Jason Rumney <jasonr@gnu.org>
14280
22610910
JR
14281 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
14282 SH_SHOW for hidden windows (Bug#5482).
14283
5df75e47
JR
14284 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
14285 frame struct members of non-existent frames (Bug#6284).
14286
699c10bd
JD
142872011-07-08 Jan Djärv <jan.h.d@swipnet.se>
14288
4393663b
JD
14289 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
14290 variable firstTime not needed on OSX >= 10.6.
14291 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
14292 >= 10.5. Use setKnobProportion, setDoubleValue.
14293
14294 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
14295 (MAC_OS_X_VERSION_10_5): Define if not defined.
14296 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
14297 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
14298 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
14299
14300 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 14301 cString and lossyCString on OSX >= 10.4.
4393663b 14302
58179cce 14303 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
14304 sizeToFit on OSX >= 10.2.
14305
14306 * nsimage.m (allocInitFromFile): Don't use deprecated method
14307 bestRepresentationForDevice on OSX >= 10.6.
14308
14309 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
14310 to avoid warning.
14311
14312 * emacs.c: Declare unexec_init_emacs_zone.
14313
a63e0781
JD
14314 * nsgui.h: Fix compiler warning about gnulib redefining verify.
14315
699c10bd
JD
14316 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
14317
14318 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
14319 on svcsMenu (Bug#8842).
14320
14321 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
14322 ns_return_types.
14323 (Fns_list_services): Just return Qnil on 10.6, code not working there.
14324
14325 * nsterm.m (QUTF8_STRING): Declare.
14326 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
14327 (validRequestorForSendType): Return type is (id).
14328 Change indexOfObjectIdenticalTo to indexOfObject.
14329 Check if we have local selection before returning self (Bug#8842).
14330 (writeSelectionToPasteboard): Put local selection into paste board
14331 if we have a local selection (Bug#8842).
14332 (syms_of_nsterm): DEFSYM QUTF8_STRING.
14333
14334 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
14335 (ns_get_local_selection): Declare.
14336
54e10184
LMI
143372011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
14338
9888ff71
LMI
14339 * keymap.c (describe_map_tree): Don't insert a double newline at
14340 the end of the buffer (bug#1169) and return whether we inserted
14341 something.
14342
54e10184
LMI
14343 * callint.c (Fcall_interactively): Change "reading args" to
14344 "providing args" to try to clarify what it does (bug#1010).
14345
15fa4783
KH
143462011-07-07 Kenichi Handa <handa@m17n.org>
14347
14348 * composite.c (composition_compute_stop_pos): Ignore a static
14349 composition starting before CHARPOS (Bug#8915).
14350
14351 * xdisp.c (handle_composition_prop): Likewise.
14352
a8815b00
EZ
143532011-07-07 Eli Zaretskii <eliz@gnu.org>
14354
14355 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
14356 (Bug#9015)
14357
ef7b981d 143582011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
14359
14360 * character.h (unicode_category_t): New enum type.
14361
14362 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
14363 (Qchar_code_property_table): New variable.
14364 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
14365 (UNIPROP_COMPRESSED_FORM_P): New macros.
14366 (char_table_ascii): Uncompress the compressed values.
14367 (sub_char_table_ref): New arg is_uniprop. Callers changed.
14368 Uncompress the compressed values.
ac389d0c 14369 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
14370 (char_table_ref_and_range): Uncompress the compressed values.
14371 (sub_char_table_set): New arg is_uniprop. Callers changed.
14372 Uncompress the compressed values.
14373 (sub_char_table_set_range): Args changed. Callers changed.
14374 (char_table_set_range): Adjuted for the above change.
14375 (map_sub_char_table): Delete args default_val and parent. Add arg
14376 top. Give decoded values to a Lisp function.
640c8776 14377 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
14378 values to a Lisp function. Gcpro more variables.
14379 (uniprop_table_uncompress)
14380 (uniprop_decode_value_run_length): New functions.
14381 (uniprop_decoder, uniprop_decoder_count): New variables.
14382 (uniprop_get_decoder, uniprop_encode_value_character)
14383 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
14384 New functions.
14385 (uniprop_encoder, uniprop_encoder_count): New variables.
14386 (uniprop_get_encoder, uniprop_table)
14387 (Funicode_property_table_internal, Fget_unicode_property_internal)
14388 (Fput_unicode_property_internal): New functions.
14389 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
14390 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 14391 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
14392 char-code-property-alist.
14393
640c8776 14394 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
14395 Vunicode_category_table.
14396
640c8776 14397 * font.c (font_range): Adjust for the change of
c805dec0
KH
14398 Vunicode_category_table.
14399
76b397fb
DN
144002011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
14401
14402 * m/iris4d.h: Remove file, move contents ...
14403 * s/irix6-5.h: ... here.
14404
22b4128e
PE
144052011-07-06 Paul Eggert <eggert@cs.ucla.edu>
14406
14407 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
14408 * alloc.c (mark_buffer):
14409 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
14410 (clone_per_buffer_values): Don't assume that
22b4128e
PE
14411 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
14412 This isn't true in general, and it's particularly not true
14413 if Emacs is configured with --with-wide-int.
14414 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
14415 New macros, used in the buffer.c change.
14416
869795d6
JD
144172011-07-05 Jan Djärv <jan.h.d@swipnet.se>
14418
14419 * xsettings.c: Use both GConf and GSettings if both are available.
14420 (store_config_changed_event): Add comment.
14421 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
14422 (store_tool_bar_style_changed): New functions.
5e617bc2 14423 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
14424 (struct xsettings): Move font inside HAVE_XFT.
14425 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 14426 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 14427 Move inside HAVE_XFT.
640c8776 14428 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
14429 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
14430 also.
14431 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 14432 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 14433 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
14434 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
14435 (parse_settings): Move check for font inside HAVE_XFT.
14436 (read_settings, apply_xft_settings): Add comment.
14437 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
14438 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
14439 call store_font_name_changed.
14440 (xft_settings_event): Add comment.
14441 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
14442 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
14443 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
14444 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
14445 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
14446 (xsettings_get_system_font, xsettings_get_system_normal_font):
14447 Add comment.
869795d6 14448
d8ed26bd
PE
144492011-07-05 Paul Eggert <eggert@cs.ucla.edu>
14450
14451 Random fixes. E.g., (random) never returned negative values.
14452 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
14453 subseconds part to the entropy, as that's a bit more random.
14454 Prefer signed to unsigned, since the signedness doesn't matter and
14455 in general we prefer signed. When given a limit, use a
14456 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
14457 latter isn't right if USE_2_TAGS_FOR_INTS.
14458 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
14459 not 0..VALMASK. Don't discard "excess" bits that random () returns.
14460
cabf1cac
SM
144612011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
14462
14463 * textprop.c (text_property_stickiness):
14464 Obey Vtext_property_default_nonsticky.
14465 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
14466 * w32fns.c (syms_of_w32fns):
14467 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
14468
6e9b2be9
PE
144692011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14470
14471 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
14472 This is more efficient than Ffile_directory_p and avoids a minor race.
14473
90186c68
LMI
144742011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
14475
7c301272
LMI
14476 * buffer.c (Foverlay_put): Say what the return value is
14477 (bug#7835).
14478
c4f2d8d4
LMI
14479 * fileio.c (barf_or_query_if_file_exists): Check first if the file
14480 is a directory before asking whether to use the file name
14481 (bug#7564).
ad637907
LMI
14482 (barf_or_query_if_file_exists): Make the "File is a directory"
14483 error be more correct.
c4f2d8d4 14484
90186c68
LMI
14485 * fns.c (Frequire): Remove the mention of the .gz files, since
14486 that's installation-specific, but keep the mention of
14487 `get-load-suffixes'.
14488
da64016e
PE
144892011-07-04 Paul Eggert <eggert@cs.ucla.edu>
14490
14491 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
14492 Report string overflow if the output is too long.
14493
7d47b580
JB
144942011-07-04 Juanma Barranquero <lekktu@gmail.com>
14495
a555cb87
JB
14496 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
14497 (syms_of_gnutls): Remove duplicate DEFSYM for
14498 Qgnutls_bootprop_verify_hostname_error, an error for
14499 Qgnutls_bootprop_verify_error (which is no longer used).
14500
7d47b580
JB
14501 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
14502 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
14503 Also (re)move comments that are misplaced or no longer relevant.
14504
1e49bfab
LMI
145052011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14506
14507 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
14508
1485f4c0
CY
145092011-07-03 Chong Yidong <cyd@stupidchicken.com>
14510
14511 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
14512 and background color parameters if they have been changed.
14513
a9ab721e
LMI
145142011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
14515
14516 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
14517
cf7cff57
PE
145182011-07-03 Paul Eggert <eggert@cs.ucla.edu>
14519
2e13213d
PE
14520 * xsettings.c (SYSTEM_FONT): Define only when used.
14521 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
14522
cf7cff57
PE
14523 * keymap.c (access_keymap_1): Now static.
14524
7a8e04f7
CY
145252011-07-02 Chong Yidong <cyd@stupidchicken.com>
14526
14527 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
14528 leave any prefix arg for the up event (Bug#1586).
14529
61352f62
LMI
145302011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
14531
69bb1ef7
LMI
14532 * lread.c (syms_of_lread): Mention single symbols defined by
14533 `defvar' or `defconst' (bug#7154).
14534
61352f62 14535 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 14536 (Frequire): Mention get-load-suffixes.
61352f62 14537
28545e04
MR
145382011-07-02 Martin Rudalics <rudalics@gmx.at>
14539
14540 * window.h (window): Remove clone_number slot.
14541 * window.c (Fwindow_clone_number, Fset_window_clone_number):
14542 Remove.
14543 (make_parent_window, make_window, saved_window)
14544 (Fset_window_configuration, save_window_save): Don't deal with
14545 clone numbers.
14546 * buffer.c (Qclone_number): Remove declaration.
14547 (sort_overlays, overlay_strings): Don't deal with clone numbers.
14548
3349e122
SM
145492011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
14550
14551 Add multiple inheritance to keymaps.
14552 * keymap.c (Fmake_composed_keymap): New function.
14553 (Fset_keymap_parent): Simplify.
14554 (fix_submap_inheritance): Remove.
14555 (access_keymap_1): New function extracted from access_keymap to handle
14556 embedded parents and handle lists of maps.
14557 (access_keymap): Use it.
14558 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
14559 (Fcopy_keymap): Handle embedded parents.
14560 (Fcommand_remapping, define_as_prefix): Simplify.
14561 (Fkey_binding): Simplify.
14562 (syms_of_keymap): Move minibuffer-local-completion-map,
14563 minibuffer-local-filename-completion-map,
14564 minibuffer-local-must-match-map, and
14565 minibuffer-local-filename-must-match-map to Elisp.
14566 (syms_of_keymap): Defsubr make-composed-keymap.
14567 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
14568 (parse_menu_item): Trivial simplification.
14569
3279eb87
GM
145702011-07-01 Glenn Morris <rgm@gnu.org>
14571
14572 * Makefile.in (SETTINGS_LIBS): Fix typo.
14573
39cb9e56 145742011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
14575
14576 * coding.c (Fencode_coding_string): Record the last coding system
14577 used, as the function doc string says (bug#8738).
14578
0949d2b6
JD
145792011-07-01 Jan Djärv <jan.h.d@swipnet.se>
14580
14581 * xsettings.c (store_monospaced_changed): Take new font as arg and
14582 check for change against current_mono_font.
14583 (EMACS_TYPE_SETTINGS): Remove this and related defines.
14584 (emacs_settings_constructor, emacs_settings_get_property)
14585 (emacs_settings_set_property, emacs_settings_class_init)
14586 (emacs_settings_init, gsettings_obj): Remove.
14587 (something_changedCB): New function for HAVE_GSETTINGS.
14588 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
14589 with value as argument.
14590 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
14591 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 14592 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
14593 "changed".
14594
14595 * xgselect.c: Add defined (HAVE_GSETTINGS).
14596 (xgselect_initialize): Ditto.
14597
14598 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
14599 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
14600 xg_select.
14601
bbc6b304
PE
146022011-07-01 Paul Eggert <eggert@cs.ucla.edu>
14603
14604 * eval.c (struct backtrace): Simplify and port the data structure.
14605 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
14606 signed bit field, as this assumption is not portable and it makes
14607 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
14608 "char debug_on_exit : 1" as this is not portable either; instead,
14609 use the portable "unsigned int debug_on_exit : 1". Remove unused
14610 member evalargs. Remove obsolete comments about cc bombing out.
14611
9851bfc5
JD
146122011-06-30 Jan Djärv <jan.h.d@swipnet.se>
14613
51bb811f 14614 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
14615 Let HAVE_GSETTINGS override HAVE_GCONF.
14616 (store_monospaced_changed): New function.
14617 (EMACS_SETTINGS): A new type derived from GObject to handle
14618 GSettings notifications.
14619 (emacs_settings_constructor, emacs_settings_get_property)
14620 (emacs_settings_set_property, emacs_settings_class_init):
14621 New functions.
14622 (gsettings_client, gsettings_obj): New variables.
14623 (GSETTINGS_SCHEMA): New define.
14624 (something_changedCB): Call store_monospaced_changed.
14625 (init_gsettings): New function.
14626 (xsettings_initialize): Call init_gsettings.
14627 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
14628 to NULL.
14629
640c8776 14630 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
14631 GCONF_CFLAGS/LIBS.
14632
5386012d
MR
146332011-06-29 Martin Rudalics <rudalics@gmx.at>
14634
14635 * window.c (resize_root_window, grow_mini_window)
14636 (shrink_mini_window): Rename Qresize_root_window to
14637 Qwindow_resize_root_window and Qresize_root_window_vertically to
14638 Qwindow_resize_root_window_vertically.
14639
f13e0b08
PE
146402011-06-28 Paul Eggert <eggert@cs.ucla.edu>
14641
14642 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
14643
94515237
JB
146442011-06-27 Juanma Barranquero <lekktu@gmail.com>
14645
14646 * makefile.w32-in: Redesign dependencies so they reflect more
14647 clearly which files are directly included by each source file,
14648 and not through other includes.
14649
e43b6e43
MR
146502011-06-27 Martin Rudalics <rudalics@gmx.at>
14651
14652 * buffer.c (Qclone_number): Declare static and DEFSYM it.
14653 (sort_overlays, overlay_strings): When an overlay's clone number
14654 matches the window's clone number process the overlay even if
14655 the overlay's window property doesn't match the current window.
14656
d68443dc
MR
14657 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
14658 (Fwindow_hchild): Rename to Fwindow_left_child.
14659 (Fwindow_next): Rename to Fwindow_next_sibling.
14660 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
14661 (resize_window_check): Rename to window_resize_check.
14662 (resize_window_apply): Rename to window_resize_apply.
14663 (Fresize_window_apply): Rename to Fwindow_resize_apply.
14664 (Fdelete_other_windows_internal, resize_frame_windows)
14665 (Fsplit_window_internal, Fdelete_window_internal)
14666 (grow_mini_window, shrink_mini_window)
14667 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 14668
c7e73be5
JD
146692011-06-26 Jan Djärv <jan.h.d@swipnet.se>
14670
14671 * emacsgtkfixed.h: State that this is only used with Gtk+3.
14672 (emacs_fixed_set_min_size): Remove.
14673 (emacs_fixed_new): Take frame as argument.
14674
14675 * emacsgtkfixed.c: State that this is only used with Gtk+3.
14676 (_EmacsFixedPrivate): Remove minwidth/height.
14677 Add struct frame *f.
14678 (emacs_fixed_init): Initialize priv->f.
14679 (get_parent_class, emacs_fixed_set_min_size): Remove.
14680 (emacs_fixed_new): Set priv->f to argument.
14681 (emacs_fixed_get_preferred_width)
14682 (emacs_fixed_get_preferred_height): Use min_width/height from
14683 frames size_hint to set minimum and natural (Bug#8919).
14684 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
14685 and use min_width/height from frames size_hint to set
14686 min_width/height (Bug#8919).
14687
14688 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
14689 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
14690 Fix indentation.
c7e73be5 14691
cf99dcf8
EZ
146922011-06-26 Eli Zaretskii <eliz@gnu.org>
14693
14694 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
14695 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
14696 called at ZV.
14697
029529ac
CY
146982011-06-26 Chong Yidong <cyd@stupidchicken.com>
14699
14700 * process.c (wait_reading_process_output): Bypass select if
14701 waiting for a cell while ignoring keyboard input, and input is
14702 pending. Suggested by Jan Djärv (Bug#8869).
14703
7a7ef429
PE
147042011-06-25 Paul Eggert <eggert@cs.ucla.edu>
14705
14706 Use gnulib's dup2 module instead of rolling our own.
14707 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
14708
11fdef7d 147092011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
14710
14711 * dispnew.c (scrolling_window): Before scrolling, turn off a
14712 mouse-highlight in the window being scrolled.
14713
cd3520a4
JB
147142011-06-24 Juanma Barranquero <lekktu@gmail.com>
14715
14716 Move DEFSYM to lisp.h and use everywhere.
14717
14718 * character.h (DEFSYM): Move declaration...
14719 * lisp.h (DEFSYM): ...here.
14720
14721 * gnutls.c:
14722 * minibuf.c:
14723 * w32menu.c:
14724 * w32proc.c:
14725 * w32select.c: Don't include character.h.
14726
14727 * alloc.c (syms_of_alloc):
14728 * buffer.c (syms_of_buffer):
14729 * bytecode.c (syms_of_bytecode):
14730 * callint.c (syms_of_callint):
14731 * casefiddle.c (syms_of_casefiddle):
14732 * casetab.c (init_casetab_once):
14733 * category.c (init_category_once, syms_of_category):
14734 * ccl.c (syms_of_ccl):
14735 * cmds.c (syms_of_cmds):
14736 * composite.c (syms_of_composite):
14737 * dbusbind.c (syms_of_dbusbind):
14738 * dired.c (syms_of_dired):
14739 * dispnew.c (syms_of_display):
14740 * doc.c (syms_of_doc):
14741 * editfns.c (syms_of_editfns):
14742 * emacs.c (syms_of_emacs):
14743 * eval.c (syms_of_eval):
14744 * fileio.c (syms_of_fileio):
14745 * fns.c (syms_of_fns):
14746 * frame.c (syms_of_frame):
14747 * fringe.c (syms_of_fringe):
14748 * insdel.c (syms_of_insdel):
14749 * keymap.c (syms_of_keymap):
14750 * lread.c (init_obarray, syms_of_lread):
14751 * macros.c (syms_of_macros):
14752 * msdos.c (syms_of_msdos):
14753 * print.c (syms_of_print):
14754 * process.c (syms_of_process):
14755 * search.c (syms_of_search):
14756 * sound.c (syms_of_sound):
14757 * syntax.c (init_syntax_once, syms_of_syntax):
14758 * terminal.c (syms_of_terminal):
14759 * textprop.c (syms_of_textprop):
14760 * undo.c (syms_of_undo):
14761 * w32.c (globals_of_w32):
14762 * window.c (syms_of_window):
14763 * xdisp.c (syms_of_xdisp):
14764 * xfaces.c (syms_of_xfaces):
14765 * xfns.c (syms_of_xfns):
14766 * xmenu.c (syms_of_xmenu):
14767 * xsettings.c (syms_of_xsettings):
14768 * xterm.c (syms_of_xterm): Use DEFSYM.
14769
4228cf16
TZ
147702011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
14771
cd3520a4 14772 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 14773
7fcccf1e
PE
147742011-06-23 Paul Eggert <eggert@cs.ucla.edu>
14775
7efb4e0e
PE
14776 Integer and buffer overflow fixes (Bug#8873).
14777
ff5844ad
PE
14778 * print.c (printchar, strout): Check for string overflow.
14779 (PRINTPREPARE, printchar, strout):
14780 Don't set size unless allocation succeeds.
14781
90532f02
PE
14782 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
14783 for sizes. Check for string overflow more accurately.
14784 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
14785
6d84508d
PE
14786 * macros.c: Integer and buffer overflow fixes.
14787 * keyboard.h (struct keyboard.kbd_macro_bufsize):
14788 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
14789 Use ptrdiff_t, not int, for sizes.
14790 Don't increment bufsize until after realloc succeeds.
14791 Check for size-calculation overflow.
14792 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
14793
437b2cb4
PE
14794 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
14795
8b9ac8b4
PE
14796 * lread.c: Integer overflow fixes.
14797 (read_integer): Radix is now EMACS_INT, not int,
14798 to improve quality of diagnostics for out-of-range radices.
14799 Calculate buffer size correctly for out-of-range radices.
14800 (read1): Check for integer overflow in radices, and in
14801 read-circle numbers.
82cb60d3
PE
14802 (read_escape): Avoid int overflow.
14803 (Fload, openp, read_buffer_size, read1)
14804 (substitute_object_recurse, read_vector, read_list, map_obarray):
14805 Use ptrdiff_t, not int, for sizes.
14806 (read1): Use EMACS_INT, not int, for sizes.
20270765 14807 Check for size overflow.
8b9ac8b4 14808
7fcccf1e
PE
14809 * image.c (cache_image): Check for size arithmetic overflow.
14810
bfbbd7e7
PE
14811 * lread.c: Integer overflow issues.
14812 (saved_doc_string_size, saved_doc_string_length)
14813 (prev_saved_doc_string_size, prev_saved_doc_string_length):
14814 Now ptrdiff_t, not int.
14815 (read1): Don't assume doc string length fits in int. Check for
14816 out-of-range doc string lengths.
14817 (read_list): Don't assume file position fits in int.
39019e54 14818 (read_escape): Check for hex character overflow.
bfbbd7e7 14819
4e323265
LL
148202011-06-22 Leo Liu <sdl.web@gmail.com>
14821
14822 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
14823 Move to minibuffer.el.
14824
85fece3e
PE
148252011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14826
20b84ce9 14827 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
14828 The following patches are for when GLYPH_DEBUG && !XASSERT.
14829 * dispextern.h (trace_redisplay_p, dump_glyph_string):
14830 * dispnew.c (flush_stdout):
14831 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
14832 Mark as externally visible.
14833 * dispnew.c (check_window_matrix_pointers): Now static.
14834 * dispnew.c (window_to_frame_vpos):
14835 * xfns.c (unwind_create_frame):
14836 * xterm.c (x_check_font): Remove unused local.
14837 * scroll.c (CHECK_BOUNDS):
14838 * xfaces.c (cache_fache): Rename local to avoid shadowing.
14839 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
14840 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
14841 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
14842 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
14843 Now static.
14844 (debug_method_add): Use va_list and vsprintf rather than relying
14845 on undefined behavior with wrong number of arguments.
14846 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
14847 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
14848 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
14849 since we're not interested in debugging glyphs with old libraries.
14850 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
14851 GCC 4.6.0's static checking.
14852
0766b489
PE
148532011-06-22 Paul Eggert <eggert@cs.ucla.edu>
14854
31fd4b32
PE
14855 Integer overflow and signedness fixes (Bug#8873).
14856 A few related buffer overrun fixes, too.
14857
b79e8648
PE
14858 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
14859
0766b489
PE
14860 * dispextern.h (struct face.stipple):
14861 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
14862 (x_bitmap_mask, x_allocate_bitmap_record)
14863 (x_create_bitmap_from_data, x_create_bitmap_from_file)
14864 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
14865 (x_create_bitmap_from_xpm_data):
14866 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
14867 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
14868 (.bitmaps_last):
14869 * xfaces.c (load_pixmap):
14870 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
14871 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
14872 (.bitmaps_last, struct x_output.icon_bitmap):
14873 Use ptrdiff_t, not int, for bitmap indexes.
14874 (x_allocate_bitmap_record): Check for size overflow.
14875 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
14876
b081724f
PE
14877 Use ptrdiff_t, not int, for overlay counts.
14878 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
14879 * editfns.c (overlays_around, get_pos_property):
14880 * textprop.c (get_char_property_and_overlay):
14881 * xdisp.c (next_overlay_change, note_mouse_highlight):
14882 * xfaces.c (face_at_buffer_position):
21514da7
PE
14883 * buffer.c (OVERLAY_COUNT_MAX): New macro.
14884 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
14885 (Fnext_overlay_change, Fprevious_overlay_change)
14886 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 14887 Use ptrdiff_t, not int, for sizes.
21514da7 14888 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 14889
3de73e5e
PE
14890 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
14891
2606c57b
PE
14892 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
14893 (x_session_initialize): Do not assume string length fits in int.
14894
aaafe47a
PE
14895 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
14896 This is unlikely, but can occur if DPI is outlandish.
14897
2674ddc8 14898 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
14899 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
14900
28154962
PE
14901 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
14902 * xrdb.c (magic_file_p, search_magic_path):
14903 Omit last arg SUFFIX; it was always 0. All callers changed.
14904 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
14905
7de51af5
PE
14906 * xfont.c (xfont_match): Avoid need for strlen.
14907
25ed6cc3
PE
14908 * xfns.c: Don't assume strlen fits in int.
14909 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
14910
4eab31dd
PE
14911 * xdisp.c (message_log_check_duplicate): Return intmax_t,
14912 not unsigned long, as we prefer signed integers. All callers changed.
14913 Detect integer overflow in repeat count.
14914 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 14915 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 14916
171e2a58
PE
14917 * termcap.c: Don't assume sizes fit in int and never overflow.
14918 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
14919 (gobble_line): Check for size-calculation overflow.
14920
ad39faca 14921 * minibuf.c (Fread_buffer):
6e5bb2dc 14922 * lread.c (intern, intern_c_string):
74ca2eb3
PE
14923 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
14924 Don't assume string length fits in int.
14925
52c61c22 14926 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
14927 * gtkutil.c (style_changed_cb): Avoid need for strlen.
14928
b5b8c9e5
PE
14929 * font.c: Don't assume string length fits in int.
14930 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
14931 Use ptrdiff_t, not int.
ccd6111c
PE
14932 (font_intern_prop): Don't assume string length fits in int.
14933 Don't assume integer property fits in fixnum.
14934 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 14935
882f0d81 14936 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 14937 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
14938 Reformulate so as not to need the command string.
14939 Invoke gzip -cd rather than gunzip, as it's more portable.
14940 (lock_info_type, lock_file_1, lock_file):
14941 Don't assume pid_t and time_t fit in unsigned long.
14942 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
14943 (current_lock_owner): Prefer signed type for sizes.
14944 Use memcpy, not strncpy, where memcpy is what is really wanted.
14945 Don't assume (via atoi) that time_t and pid_t fit in int.
14946 Check for time_t and/or pid_t out of range, e.g., via a network share.
14947 Don't alloca where an auto var works fine.
14948
93f4cf88
PE
14949 * fileio.c: Fix some integer overflow issues.
14950 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
14951 Don't assume string length fits in int.
14952 (directory_file_name): Don't assume string length fits in long.
14953 (make_temp_name): Don't assume pid fits in int, or that its print
14954 length is less than 20.
14955
f3e92b69
PE
14956 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
14957
1bfdaf10
PE
14958 * coding.c (make_subsidiaries): Don't assume string length fits in int.
14959
35016e9a
PE
14960 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
14961
3d1e65a1
PE
14962 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
14963 We prefer signed integers, even for size calculations.
14964
0b963a93
PE
14965 * emacs.c: Don't assume string length fits in 'int'.
14966 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
14967 (main): Don't invoke strlen when not needed.
14968
573f4b54
PE
14969 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
14970 (XD_DEBUG_MESSAGE): Don't waste a byte.
14971
989f33ba
PE
14972 * callproc.c (getenv_internal_1, getenv_internal)
14973 (Fgetenv_internal):
965d34eb
PE
14974 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
14975
e4d29b33
PE
14976 * lread.c (invalid_syntax): Omit length argument.
14977 All uses changed. This doesn't fix a bug, but it simplifies the
14978 code away from its former Hollerith-constant appearance, and it's
14979 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 14980 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 14981
eb49b136
PE
14982 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
14983 This didn't break anything, but it didn't help either.
14984 It's confusing to put a bogus integer in a place where the actual
14985 value does not matter.
9f62aeb1 14986 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 14987 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 14988
15375a22
PE
14989 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
14990 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
14991 implementation.
b61cc01c
PE
14992 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
14993 We prefer signed types, and the value cannot exceed the EMACS_INT
14994 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
14995 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
14996 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
14997 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 14998
53b2623d
PE
14999 * indent.c (sane_tab_width): New function.
15000 (current_column, scan_for_column, Findent_to, position_indentation)
15001 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 15002 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 15003
51cab52b 15004 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 15005
f2ed8a70
PE
15006 * lisp.h (lint_assume): New macro.
15007 * composite.c (composition_gstring_put_cache):
15008 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
15009
abe80cc6
PE
15010 * editfns.c, insdel.c:
15011 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 15012
b02c740e
PE
15013 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
15014
ebc96716
PE
15015 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
15016
b4e50fa0 15017 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 15018 Use much-faster test for byte-length change.
311d5d7c 15019 Don't assume string byte-length fits in 'int'.
a4cf38e4 15020 Check that character arg fits in 'int'.
85461888 15021 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 15022
c0c1ee9f
PE
15023 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
15024
a498d7f4
PE
15025 * fns.c (concat): Catch string overflow earlier.
15026 Do not rely on integer wraparound.
15027
51cab52b
PE
15028 * dispextern.h (struct it.overlay_strings_charpos)
15029 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
15030 * xdisp.c (forward_to_next_line_start)
15031 (back_to_previous_visible_line_start)
15032 (reseat_at_next_visible_line_start, next_element_from_buffer):
15033 Don't arbitrarily truncate the value of 'selective' to int.
15034
76031fad
PE
15035 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
15036
5eb55db9
PE
15037 * composite.c: Don't truncate sizes to 'int'.
15038 (composition_gstring_p, composition_reseat_it)
15039 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
15040 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
15041 not EMACS_UINT, for indexes.
5eb55db9 15042
0703a717
PE
15043 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
15044
d6202519
PE
15045 * buffer.c: Include <verify.h>.
15046 (struct sortvec.priority, struct sortstr.priority):
8961a454 15047 Now EMACS_INT, not int.
c20998a7 15048 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
15049 (struct sortstr.size, record_overlay_string)
15050 (struct sortstrlist.size, struct sortlist.used):
15051 Don't truncate size to int.
15052 (record_overlay_string): Check for size-calculation overflow.
d6202519 15053 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 15054
d5a19415
JM
150552011-06-22 Jim Meyering <meyering@redhat.com>
15056
029529ac 15057 Don't leak an XBM-image-sized buffer
d5a19415
JM
15058 * image.c (xbm_load): Free the image buffer after using it.
15059
a9041e6c
PE
150602011-06-21 Paul Eggert <eggert@cs.ucla.edu>
15061
15062 Port to Sun C.
15063 * composite.c (find_automatic_composition): Omit needless 'return 0;'
15064 that Sun C diagnosed.
15065 * fns.c (secure_hash): Fix pointer signedness issue.
15066 * intervals.c (static_offset_intervals): New function.
15067 (offset_intervals): Use it.
15068
7f3f739f
LL
150692011-06-21 Leo Liu <sdl.web@gmail.com>
15070
15071 * deps.mk (fns.o):
15072 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
15073 sha512.h.
15074
15075 * fns.c (secure_hash): Rename from crypto_hash_function and change
15076 the first arg to accept symbols.
5b66d427 15077 (Fsecure_hash): New primitive.
7f3f739f
LL
15078 (syms_of_fns): New symbols.
15079
76147d94
DD
150802011-06-20 Deniz Dogan <deniz@dogan.se>
15081
15082 * process.c (Fset_process_buffer): Clarify return value in
15083 docstring.
15084
7d7d0045
CY
150852011-06-18 Chong Yidong <cyd@stupidchicken.com>
15086
15087 * dispnew.c (add_window_display_history): Use BVAR.
15088
15089 * xdisp.c (debug_method_add): Use BVAR.
15090 (check_window_end, dump_glyph_matrix, dump_glyph)
15091 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
15092
15093 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
15094 Likewise.
15095
15096 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
15097 check till after the cache is created in init_frame_faces.
15098
ff2bc410
SM
150992011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
15100
15101 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
15102
28177add
PE
151032011-06-16 Paul Eggert <eggert@cs.ucla.edu>
15104
dd3482fe
PE
15105 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
15106 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
15107 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
15108
393d71f3 15109 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
15110 * fileio.c (Finsert_file_contents):
15111 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
15112 Remove the old (too-loose) buffer overflow checks.
15113 They weren't needed, since make_gap checks for buffer overflow.
15114 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
15115 The old code merely checked for Emacs fixnum overflow, and relied
15116 on undefined (wraparound) behavior. The new code avoids undefined
15117 behavior, and also checks for ptrdiff_t and/or size_t overflow.
15118
2e6813b0 15119 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
15120 Tune. Don't use wider integers than needed. Don't use alloca.
15121 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 15122
599a9e4f
PE
15123 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
15124
99561444
PE
15125 * insdel.c, lisp.h (buffer_overflow): New function.
15126 (insert_from_buffer_1, replace_range, replace_range_2):
15127 * insdel.c (make_gap_larger):
15128 * editfns.c (Finsert_char):
15129 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
15130
28177add
PE
15131 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
15132
e69dafad
PE
151332011-06-15 Paul Eggert <eggert@cs.ucla.edu>
15134
4baa020d 15135 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 15136
b1c46f02
PE
15137 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
15138 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
15139
e69dafad
PE
15140 * fileio.c: Don't assume EMACS_INT fits in off_t.
15141 (emacs_lseek): New static function.
15142 (Finsert_file_contents, Fwrite_region): Use it.
15143 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
15144
566684ea
PE
15145 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
15146
e6966cd6
PE
15147 * fns.c: Don't overflow int when computing a list length.
15148 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
15149 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
15150 truncation on 64-bit hosts. Check for QUIT every
15151 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
15152 faster and is responsive enough.
15153 (Flength): Report an error instead of overflowing an integer.
15154 (Fsafe_length): Return a float if the value is not representable
15155 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 15156 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 15157 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 15158
dd0b0efb
PE
15159 * alloc.c: Check that resized vectors' lengths fit in fixnums.
15160 (header_size, word_size): New constants.
15161 (allocate_vectorlike): Don't check size overflow here.
15162 (allocate_vector): Check it here instead, since this is the only
15163 caller of allocate_vectorlike that could cause overflow.
15164 Check that the new vector's length is representable as a fixnum.
15165
86fe5cfe
PE
15166 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
15167 The previous code was bogus. For example, next_almost_prime (32)
15168 returned 39, which is undesirable as it is a multiple of 3; and
15169 next_almost_prime (24) returned 25, which is a multiple of 5 so
15170 why was the code bothering to check for multiples of 7?
15171
80e88859
PE
15172 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
15173
4a2f0ad6
PE
15174 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
15175
f66c7cf8
PE
15176 Variadic C functions now count arguments with ptrdiff_t.
15177 This partly undoes my 2011-03-30 change, which replaced int with size_t.
15178 Back then I didn't know that the Emacs coding style prefers signed int.
15179 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
15180 were being counted with int, which may truncate counts on 64-bit
15181 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
15182 * lisp.h (struct Lisp_Subr.function.aMANY)
15183 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
15184 Arg counts are now ptrdiff_t, not size_t.
15185 All variadic functions and their callers changed accordingly.
15186 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
15187 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
15188 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
15189 * callint.c (Fcall_interactively): Check arg count for overflow,
15190 to avoid potential buffer overrun. Use signed char, not 'int',
15191 for 'varies' array, so that we needn't bother to check its size
15192 calculation for overflow.
15193 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
15194 * eval.c (apply_lambda):
15195 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
15196 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
15197 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
15198
a1759b76
PE
15199 * callint.c (Fcall_interactively): Don't use index var as event count.
15200
d96be9fc
PE
15201 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
15202 * mem-limits.h (SIZE): Remove; no longer used.
15203
a690a978 15204 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 15205
578c21e6
PE
15206 Remove unnecessary casts.
15207 * xterm.c (x_term_init):
15208 * xfns.c (x_set_border_pixel):
15209 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
15210 These aren't needed now that we assume ANSI C.
15211
96f53c6c
PE
15212 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
15213 It's more likely to cause problems (due to unsigned overflow)
15214 than to cure them.
15215
83c77d31
PE
15216 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
15217
ee2079f1
PE
15218 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
15219
6da65536
PE
15220 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
15221
7147c4a4
PE
15222 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
15223
193e32d9
PE
15224 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
15225
e5533da6
PE
15226 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
15227
9910e595
PE
15228 GLYPH_CODE_FACE returns EMACS_INT, not int.
15229 * dispextern.h (merge_faces):
15230 * xfaces.c (merge_faces):
01103c44
PE
15231 * xdisp.c (get_next_display_element, next_element_from_display_vector):
15232 Don't assume EMACS_INT fits in int.
9910e595 15233
2638320e
PE
15234 * character.h (CHAR_VALID_P): Remove unused parameter.
15235 * fontset.c, lisp.h, xdisp.c: All uses changed.
15236
045eb8d9
PE
15237 * editfns.c (Ftranslate_region_internal): Omit redundant test.
15238
c1f134b5
PE
15239 * fns.c (concat): Minor tuning based on overflow analysis.
15240 This doesn't fix any bugs. Use int to hold character, instead
15241 of constantly refetching from Emacs object. Use XFASTINT, not
15242 XINT, for value known to be a character. Don't bother comparing
15243 a single byte to 0400, as it's always less.
15244
395fcb93 15245 * floatfns.c (Fexpt):
327eeec8
PE
15246 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
15247
abbd3d23
PE
15248 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
15249 for characters.
15250
684a03ef
PE
15251 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
15252
0fed43f3
PE
15253 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
15254 Without this fix, on a 64-bit host (aset S 0 4294967386) would
15255 incorrectly succeed when S was a string, because 4294967386 was
15256 truncated before it was used.
15257
8fd02eb7
PE
15258 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
15259 Otherwise, an out-of-range integer could cause undefined behavior
15260 on a 64-bit host.
15261
f8c86b69
PE
15262 * composite.c: Use int, not EMACS_INT, for characters.
15263 (fill_gstring_body, composition_compute_stop_pos): Use int, not
15264 EMACS_INT, for values that are known to be in character range.
15265 This doesn't fix any bugs but is the usual style inside Emacs and
15266 may generate better code on 32-bit machines.
15267
34206dd2
PE
15268 Make sure a 64-bit char is never passed to ENCODE_CHAR.
15269 This is for reasons similar to the recent CHAR_STRING fix.
15270 * charset.c (Fencode_char): Check that character arg is actually
15271 a character. Pass an int to ENCODE_CHAR.
15272 * charset.h (ENCODE_CHAR): Verify that the character argument is no
15273 wider than 'int', as a compile-time check to prevent future regressions
15274 in this area.
15275
c5958d4c 15276 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
15277
15278 Make sure a 64-bit char is never passed to CHAR_STRING.
15279 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
15280 by silently ignoring the top 32 bits, allowing some values
15281 that were far too large to be valid characters.
15282 * character.h: Include <verify.h>.
15283 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
15284 arguments are no wider than unsigned, as a compile-time check
15285 to prevent future regressions in this area.
15286 * data.c (Faset):
01103c44 15287 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
15288 (Fsubst_char_in_region):
15289 * fns.c (concat):
15290 * xdisp.c (decode_mode_spec_coding):
15291 Adjust to CHAR_STRING's new requirement.
15292 * editfns.c (Finsert_char, Fsubst_char_in_region):
15293 * fns.c (concat): Check that character args are actually
15294 characters. Without this test, these functions did the wrong
15295 thing with wildly out-of-range values on 64-bit hosts.
15296
d37ca623
PE
15297 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
15298 These casts should not be needed on 32-bit hosts, either.
15299 * keyboard.c (read_char):
15300 * lread.c (Fload): Remove casts to unsigned.
15301
ea204efb
PE
15302 * lisp.h (UNSIGNED_CMP): New macro.
15303 This fixes comparison bugs on 64-bit hosts.
15304 (ASCII_CHAR_P): Use it.
15305 * casefiddle.c (casify_object):
01103c44 15306 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
15307 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
15308 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
15309 * dispextern.h (FACE_FROM_ID):
15310 * keyboard.c (read_char): Use UNSIGNED_CMP.
15311
41cb286c
PE
15312 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
15313 not to EMACS_INT, to avoid GCC warning.
15314
4a1b9832
PE
15315 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
15316
55daad71
PE
15317 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
15318 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
15319 isn't needed on 32-bit machines.
8f95c75c 15320
01103c44
PE
15321 * buffer.c (Fgenerate_new_buffer_name):
15322 Use EMACS_INT for count, not int.
0ceccced 15323 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
15324
15325 * data.c (Qcompiled_function): Now static.
15326
c6f072e7
PE
15327 * window.c (window_body_lines): Now static.
15328
20ce5912
PE
15329 * image.c (gif_load): Rename local to avoid shadowing.
15330
9c4c5f81
PE
15331 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
15332 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
15333 * alloc.c (make_save_value): Integer argument is now of type
15334 ptrdiff_t, not int.
15335 (mark_object): Use ptrdiff_t, not int.
15336 * lisp.h (pD): New macro.
15337 * print.c (print_object): Use it.
15338
c0c5c8ae
PE
15339 * alloc.c: Use EMACS_INT, not int, to count objects.
15340 (total_conses, total_markers, total_symbols, total_vector_size)
15341 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
15342 (total_free_floats, total_floats, total_free_intervals)
15343 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
15344 Now EMACS_INT, not int. All uses changed.
15345 (Fgarbage_collect): Compute overall total using a double, so that
15346 integer overflow is less likely to be a problem. Check for overflow
15347 when converting back to an integer.
5a25e253
PE
15348 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
15349 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
15350 These were 'int' variables that could overflow on 64-bit hosts;
15351 they were never used, so remove them instead of repairing them.
211a0b2a 15352 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
15353 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
15354 Previously, this ceilinged at INT_MAX, but that doesn't work on
15355 64-bit machines.
e46bb31a 15356 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 15357
c78baabf 15358 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 15359 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
15360 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
15361 when a (possibly-narrower) signed value would do just as well.
15362 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 15363
c9d624c6
PE
15364 * alloc.c: Catch some string size overflows that we were missing.
15365 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
15366 for convenience in STRING_BYTES_MAX.
15367 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
15368 The definition here is exact; the one in lisp.h was approximate.
15369 (allocate_string_data): Check for string overflow. This catches
15370 some instances we weren't catching before. Also, it catches
15371 size_t overflow on (unusual) hosts where SIZE_MAX <= min
15372 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
15373 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 15374
c9d624c6
PE
15375 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
15376 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 15377 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 15378
353032ce
PE
15379 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
15380
2bccce07
PE
15381 * alloc.c (Fmake_string): Check for out-of-range init.
15382
0ac30604
SM
153832011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
15384
15385 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
15386
c195f2de
JD
153872011-06-14 Jan Djärv <jan.h.d@swipnet.se>
15388
15389 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
15390 xg_get_default_scrollbar_width.
15391
15392 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
15393 (int_gtk_range_get_value): Move to the scroll bar part of the file.
15394 (style_changed_cb): Call update_theme_scrollbar_width and call
15395 x_set_scroll_bar_default_width and xg_frame_set_char_size for
15396 all frames (Bug#8505).
15397 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
15398 Call gtk_window_set_resizable if HAVE_GTK3.
15399 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
15400 and height if HAVE_GTK3 (Bug#8505).
15401 (scroll_bar_width_for_theme): New variable.
15402 (update_theme_scrollbar_width): New function.
15403 (xg_get_default_scrollbar_width): Move code to
15404 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
15405 (xg_initialize): Call update_theme_scrollbar_width.
15406
15407 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
15408
15409 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
15410
e10ac9f1
MR
154112011-06-12 Martin Rudalics <rudalics@gmx.at>
15412
15413 * frame.c (make_frame): Call other_buffer_safely instead of
15414 other_buffer.
15415
15416 * window.c (temp_output_buffer_show): Call display_buffer with
15417 second argument Vtemp_buffer_show_specifiers and reset latter
15418 immediately after the call.
15419 (Vtemp_buffer_show_specifiers): New variable.
15420 (auto_window_vscroll_p, next_screen_context_lines)
15421 (Vscroll_preserve_screen_position): Remove leading asterisks from
15422 doc-strings.
15423
2d3c217e 154242011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 15425
7b7f97e8 15426 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
15427 * buffer.c (Qclone_number): Remove for now, as it's unused.
15428 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
15429 (record_buffer): Remove unused local.
15430 * frame.c (other_visible_frames, frame_buffer_list): Now static.
15431 (set_frame_buffer_list): Remove; unused.
15432 * frame.h (other_visible_frames): Remove decl.
15433 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
15434 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
15435 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
15436 if HAVE_GPM.
15437 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
15438 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
15439 Define only if HAVE_GPM.
15440 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
15441 (update_hints_inhibit): Remove; never set. All uses removed.
15442 * widgetprv.h (emacsFrameClassRec): Remove decl.
15443 * window.c (delete_deletable_window): Now returns void, since it
15444 wasn't returning anything.
15445 (compare_window_configurations): Remove unused locals.
15446 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
15447 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
15448 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
15449 the same widths as pointers. This follows up on the 2011-05-06 patch.
15450 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
15451 * xterm.h: Likewise.
15452 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
15453
1384b89e
JB
154542011-06-12 Juanma Barranquero <lekktu@gmail.com>
15455
15456 * makefile.w32-in: Update dependencies.
15457 (LISP_H): Add lib/intprops.h.
15458
1100a63c
CY
154592011-06-11 Chong Yidong <cyd@stupidchicken.com>
15460
15461 * image.c (gif_load): Add animation frame delay to the metadata.
15462 (syms_of_image): Use DEFSYM. New symbol `delay'.
15463
6198ccd0
MR
154642011-06-11 Martin Rudalics <rudalics@gmx.at>
15465
15466 * window.c (delete_deletable_window): Re-add.
15467 (Fset_window_configuration): Rewrite to handle dead buffers and
15468 consequently deletable windows.
15469 (window_tree, Fwindow_tree): Remove. Supply functionality in
15470 window.el.
15471 (compare_window_configurations): Simplify code.
15472
b6e3633c
AS
154732011-06-11 Andreas Schwab <schwab@linux-m68k.org>
15474
1ab0dee5
AS
15475 * image.c (imagemagick_load_image): Fix type mismatch.
15476 (Fimagemagick_types): Likewise.
15477
b6e3633c
AS
15478 * window.h (replace_buffer_in_windows): Declare.
15479
9397e56f
MR
154802011-06-11 Martin Rudalics <rudalics@gmx.at>
15481
15482 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
15483 Qclone_number. Remove external declaration of Qdelete_window.
15484 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
15485 code.
640c8776
SM
15486 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
15487 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
15488 (Fother_buffer): Rewrite doc-string. Major rewrite for new
15489 buffer list implementation.
15490 (other_buffer_safely): New function.
15491 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
15492 calls to replace_buffer_in_windows and
15493 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
15494 if allowed.
15495 (record_buffer): Inhibit quitting and rewrite using quittable
15496 functions. Run Qbuffer_list_update_hook if allowed.
15497 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
15498 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
15499 Move switch-to-buffer to window.el.
9397e56f
MR
15500 (bury-buffer): Move to window.el.
15501 (Vbuffer_list_update_hook): New variable.
15502
15503 * lisp.h (other_buffer_safely): Add prototype in buffer.c
15504 section.
15505
15506 * window.h (resize_frame_windows): Move up in code.
15507 (Fwindow_frame): Remove EXFUN.
15508 (replace_buffer_in_all_windows): Remove prototype.
15509 (replace_buffer_in_windows_safely): Add prototype.
15510
15511 * window.c: Declare Qdelete_window static again. Move down
15512 declaration of select_count.
15513 (Fnext_window, Fprevious_window): Rewrite doc-strings.
15514 (Fother_window): Move to window.el.
15515 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
15516 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
15517 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
15518 window.el.
15519 (replace_buffer_in_windows): Implement by calling
15520 Qreplace_buffer_in_windows.
15521 (replace_buffer_in_all_windows): Remove with some functionality
15522 moved into replace_buffer_in_windows_safely.
15523 (replace_buffer_in_windows_safely): New function.
15524 (select_window_norecord, select_frame_norecord): Move in front
15525 of run_window_configuration_change_hook. Remove now obsolete
15526 declarations.
640c8776
SM
15527 (Fset_window_buffer): Rewrite doc-string.
15528 Call Qrecord_window_buffer.
9397e56f
MR
15529 (keys_of_window): Move binding for other-window to window.el.
15530
b50691aa
CY
155312011-06-11 Chong Yidong <cyd@stupidchicken.com>
15532
15533 * dispextern.h (struct image): Replace data member, whose int_val
15534 and ptr_val fields were not used by anything, with a single
15535 lisp_val object.
15536
15537 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
15538 (gif_clear_image, gif_load, imagemagick_load_image)
15539 (gs_clear_image, gs_load): Callers changed.
15540
3f754b86
PE
155412011-06-10 Paul Eggert <eggert@cs.ucla.edu>
15542
cca69397
PE
15543 * buffer.h: Include <time.h>, for time_t.
15544 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
15545
109e28d0
PE
15546 Fix minor problems found by static checking.
15547
60737f02
PE
15548 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
15549
4b66faf3
PE
15550 Make identifiers static if they are not used in other modules.
15551 * data.c (Qcompiled_function, Qframe, Qvector):
15552 * image.c (QimageMagick, Qsvg):
15553 * minibuf.c (Qmetadata):
15554 * window.c (resize_window_check, resize_root_window): Now static.
15555 * window.h (resize_window_check, resize_root_window): Remove decls.
15556
109e28d0
PE
15557 * window.c (window_deletion_count, delete_deletable_window):
15558 Remove; unused.
46a4ce9e
PE
15559 (window_body_lines): Now static.
15560 (Fdelete_other_windows_internal): Mark vars as initialized.
15561 Make sure 'resize_failed' is initialized.
15562 (run_window_configuration_change_hook): Rename local to avoid shadowing.
15563 (resize_window_apply): Remove unused local.
15564 * window.h (delete_deletable_window): Remove decl.
15565
109e28d0 15566 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
15567 (imagemagick_load_image): Fix pointer signedness problem by changing
15568 last arg from unsigned char * to char *. All uses changed.
15569 Also, fix a local for similar reasons.
15570 Remove unused locals. Remove locals to avoid shadowing.
15571 (fn_rsvg_handle_free): Remove; unused.
15572 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 15573 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 15574
3f754b86
PE
15575 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
15576
2547adb1
CY
155772011-06-10 Chong Yidong <cyd@stupidchicken.com>
15578
15579 * image.c (gif_load): Fix omitted cast error introduced by
15580 2011-06-06 change.
15581
2c8e37d4
MR
155822011-06-10 Martin Rudalics <rudalics@gmx.at>
15583
15584 * window.h (resize_proportionally, orig_total_lines)
15585 (orig_top_line): Remove from window structure.
15586 (set_window_height, set_window_width, change_window_heights)
15587 (Fdelete_window): Remove prototypes.
15588 (resize_frame_windows): Remove duplicate declaration.
15589
440a42e3
EZ
155902011-06-10 Eli Zaretskii <eliz@gnu.org>
15591
15592 * window.h (resize_frame_windows, resize_window_check)
15593 (delete_deletable_window, resize_root_window)
15594 (resize_frame_windows): Declare prototypes.
15595
15596 * window.c (resize_window_apply): Make definition be "static" to
15597 match the prototype.
15598
562dd5e9
MR
155992011-06-10 Martin Rudalics <rudalics@gmx.at>
15600
15601 * window.c: Remove declarations of Qwindow_size_fixed,
15602 window_min_size_1, window_min_size_2, window_min_size,
15603 size_window, window_fixed_size_p, enlarge_window, delete_window.
15604 Remove static from declaration of Qdelete_window, it's
15605 temporarily needed by Fbury_buffer.
15606 (replace_window): Don't assign orig_top_line and
15607 orig_total_lines.
15608 (Fdelete_window, delete_window): Remove. Window deletion is
15609 handled by window.el.
640c8776
SM
15610 (window_loop): Remove DELETE_OTHER_WINDOWS case.
15611 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
15612 (Fdelete_other_windows): Remove. Deleting other windows is
15613 handled by window.el.
15614 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
15615 handled in window.el.
15616 (window_min_size_2, window_min_size_1, window_min_size): Remove.
15617 Window minimum sizes are handled in window.el.
15618 (shrink_windows, size_window, set_window_height)
15619 (set_window_width, change_window_heights, window_height)
15620 (window_width, CURBEG, CURSIZE, enlarge_window)
15621 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
15622 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
15623 handled in window.el.
15624 (make_dummy_parent): Rename to make_parent_window and give it a
15625 second argument horflag.
15626 (make_window): Don't set resize_proportionally any more.
15627 (Fsplit_window): Remove. Windows are split in window.el.
15628 (save_restore_action, save_restore_orig_size)
15629 (shrink_window_lowest_first, save_restore_orig_size): Remove.
15630 Resize mini windows in window.el.
15631 (grow_mini_window, shrink_mini_window): Implement by calling
15632 Qresize_root_window_vertically, resize_window_check and
15633 resize_window_apply.
640c8776
SM
15634 (saved_window, Fset_window_configuration, save_window_save):
15635 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
15636 resize_proportionally.
15637 (window_min_height, window_min_width): Move to window.el.
15638 (keys_of_window): Move bindings for delete-other-windows,
15639 split-window, delete-window and enlarge-window to window.el.
15640
15641 * buffer.c: Temporarily extern Qdelete_window.
15642 (Fbury_buffer): Temporarily call Qdelete_window instead of
15643 Fdelete_window (Fbury_buffer will move to window.el soon).
15644
15645 * frame.c (set_menu_bar_lines_1): Remove code handling
15646 orig_top_line and orig_total_lines.
15647
15648 * dispnew.c (adjust_frame_glyphs_initially): Don't use
15649 set_window_height but set heights directly.
15650 (change_frame_size_1): Use resize_frame_windows.
15651
15652 * xdisp.c (init_xdisp): Don't use set_window_height but set
15653 heights directly.
15654
640c8776
SM
15655 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
15656 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
15657 run_window_configuration_change_hook.
15658
15659 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
15660 instead of change_window_heights and run
15661 run_window_configuration_change_hook.
15662
1a13852e
MR
156632011-06-09 Martin Rudalics <rudalics@gmx.at>
15664
15665 * window.c (replace_window): Rename second argument REPLACEMENT to
15666 NEW. New third argument SETFLAG. Rewrite.
15667 (delete_window, make_dummy_parent): Call replace_window with
15668 third argument 1.
15669 (window_list_1): Move down in code.
15670 (run_window_configuration_change_hook): Move set_buffer part
15671 before select_frame_norecord part in order to unwind correctly.
15672 Rename count1 to count.
15673 (recombine_windows, delete_deletable_window, resize_root_window)
15674 (Fdelete_other_windows_internal)
15675 (Frun_window_configuration_change_hook, make_parent_window)
15676 (resize_window_check, resize_window_apply, Fresize_window_apply)
15677 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
15678 (Fdelete_window_internal, Fresize_mini_window_internal):
15679 New functions.
1a13852e
MR
15680 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
15681
f3d1777e
MR
156822011-06-08 Martin Rudalics <rudalics@gmx.at>
15683
496e208e
MR
15684 * window.h (window): Add some new members to window structure -
15685 normal_lines, normal_cols, new_total, new_normal, clone_number,
15686 splits, nest, prev_buffers, next_buffers.
15687 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 15688 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 15689
f3d1777e
MR
15690 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
15691 Remove.
496e208e
MR
15692 (make_dummy_parent): Set new members of windows structure.
15693 (make_window): Move down in code. Handle new members of window
15694 structure.
15695 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
15696 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
15697 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
15698 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
15699 (Fset_window_next_buffers, Fset_window_clone_number):
15700 New functions.
496e208e
MR
15701 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
15702 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
15703 Doc-string fixes.
15704 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
15705 Argument WINDOW can be now internal window too.
15706 (Fwindow_use_time): Move up in code.
15707 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
15708 Rewrite doc-string.
15709 (Fset_window_configuration, saved_window)
15710 (Fcurrent_window_configuration, save_window_save): Handle new
15711 members of window structure.
b9e809c2
MR
15712 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
15713 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
15714 (syms_of_window): New Lisp objects Qrecord_window_buffer,
15715 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
15716 Qget_mru_window, Qresize_root_window,
15717 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
15718 Qauto_buffer_name; staticpro them.
f3d1777e 15719
abde8f8c
MR
157202011-06-07 Martin Rudalics <rudalics@gmx.at>
15721
15722 * window.c (Fwindow_total_size, Fwindow_left_column)
15723 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
15724 (Fwindow_list_1): New functions.
15725 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
15726 (Fwindow_width, Fscroll_left, Fscroll_right):
15727 Use window_body_cols instead of window_box_text_cols.
15728 (delete_window, Fset_window_configuration):
15729 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
15730 (delete_all_subwindows): Take a window as argument and not a
15731 structure. Rewrite.
190b47e6
MR
15732 (window_loop): Remove handling of GET_LRU_WINDOW and
15733 GET_LARGEST_WINDOW.
15734 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
15735
15736 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
15737 window_box_text_cols. delete_all_subwindows now takes a
15738 Lisp_Object as argument.
abde8f8c 15739
640c8776
SM
15740 * indent.c (compute_motion, Fcompute_motion):
15741 Use window_body_cols instead of window_box_text_cols.
abde8f8c 15742
fa8a67e6
MR
15743 * frame.c (delete_frame): Call delete_all_subwindows with root
15744 window as argument.
15745
a54e3482
DC
157462011-06-07 Daniel Colascione <dan.colascione@gmail.com>
15747
15748 * fns.c (Fputhash): Document return value.
15749
60002bf5
CY
157502011-06-06 Chong Yidong <cyd@stupidchicken.com>
15751
15752 * image.c (gif_load): Implement gif89a spec "no disposal" method.
15753
0c671da6 157542011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 15755
b862a52a 15756 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 15757
be44ca6c
PE
15758 Check for overflow when converting integer to cons and back.
15759 * charset.c (Fdefine_charset_internal, Fdecode_char):
15760 Use cons_to_unsigned to catch overflow.
15761 (Fencode_char): Use INTEGER_TO_CONS.
15762 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
15763 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
15764 * data.c (long_to_cons, cons_to_long): Remove.
15765 (cons_to_unsigned, cons_to_signed): New functions.
15766 These signal an error for invalid or out-of-range values.
15767 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
15768 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
15769 * font.c (Ffont_variation_glyphs):
15770 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
15771 * lisp.h: Include <intprops.h>.
15772 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
15773 (cons_to_signed, cons_to_unsigned): New decls.
15774 (long_to_cons, cons_to_long): Remove decls.
15775 * undo.c (record_first_change): Use INTEGER_TO_CONS.
15776 (Fprimitive_undo): Use CONS_TO_INTEGER.
15777 * xfns.c (Fx_window_property): Likewise.
15778 * xselect.c: Include <limits.h>.
15779 (x_own_selection, selection_data_to_lisp_data):
15780 Use INTEGER_TO_CONS.
15781 (x_handle_selection_request, x_handle_selection_clear)
15782 (x_get_foreign_selection, Fx_disown_selection_internal)
15783 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
15784 (lisp_data_to_selection_data): Use cons_to_unsigned.
15785 (x_fill_property_data): Use cons_to_signed.
15786 Report values out of range.
15787
d1f3d2af
PE
15788 Check for buffer and string overflow more precisely.
15789 * buffer.h (BUF_BYTES_MAX): New macro.
15790 * lisp.h (STRING_BYTES_MAX): New macro.
15791 * alloc.c (Fmake_string):
15792 * character.c (string_escape_byte8):
15793 * coding.c (coding_alloc_by_realloc):
15794 * doprnt.c (doprnt):
15795 * editfns.c (Fformat):
15796 * eval.c (verror):
15797 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
15798 since they may not be the same number.
15799 * editfns.c (Finsert_char):
15800 * fileio.c (Finsert_file_contents):
15801 Likewise for BUF_BYTES_MAX.
15802
dd52fcea
PE
15803 * image.c: Use ptrdiff_t, not int, for sizes.
15804 (slurp_file): Switch from int to ptrdiff_t.
15805 All uses changed.
15806 (slurp_file): Check that file size fits in both size_t (for
15807 malloc) and ptrdiff_t (for sanity and safety).
15808
7f9bbdbb
PE
15809 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
15810 if b->modtime has its maximal value.
15811
dfe18f82
PE
15812 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
15813
84acfcf0
PE
15814 Don't assume time_t can fit into int.
15815 * buffer.h (struct buffer.modtime): Now time_t, not int.
15816 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
15817 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
15818
ccd9a01a
PE
15819 Minor fixes for signed vs unsigned integers.
15820 * character.h (MAYBE_UNIFY_CHAR):
15821 * charset.c (maybe_unify_char):
15822 * keyboard.c (read_char, reorder_modifiers):
15823 XINT -> XFASTINT, since the integer must be nonnegative.
15824 * ftfont.c (ftfont_spec_pattern):
15825 * keymap.c (access_keymap, silly_event_symbol_error):
15826 XUINT -> XFASTINT, since the integer must be nonnegative.
15827 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
15828 since it makes no difference and we prefer signed.
15829 * keyboard.c (record_char): Use XUINT when all the neighbors do.
15830 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
15831 nonnegative.
15832
d6d100dd
SM
158332011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
15834
15835 * window.h (Fwindow_frame): Declare.
15836
2b6148e4
PE
158372011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15838
15839 * alloc.c: Simplify handling of large-request failures (Bug#8800).
15840 (SPARE_MEMORY): Always define.
15841 (LARGE_REQUEST): Remove.
15842 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
15843
f230ecc9
MR
158442011-06-06 Martin Rudalics <rudalics@gmx.at>
15845
727e958e
MR
15846 * lisp.h: Move EXFUNS for Fframe_root_window,
15847 Fframe_first_window and Fset_frame_selected_window to window.h.
15848
15849 * window.h: Move EXFUNS for Fframe_root_window,
15850 Fframe_first_window and Fset_frame_selected_window here from
15851 lisp.h.
15852
15853 * frame.c (Fwindow_frame, Fframe_first_window)
15854 (Fframe_root_window, Fframe_selected_window)
15855 (Fset_frame_selected_window): Move to window.c.
15856 (Factive_minibuffer_window): Move to minibuf.c.
15857 (Fother_visible_frames_p): New function.
15858
15859 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
15860
f230ecc9
MR
15861 * window.c (decode_window, decode_any_window): Move up in code.
15862 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
15863 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
15864 (Fwindow_buffer): Move up and rewrite doc-string.
15865 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
15866 (Fwindow_prev): New functions.
727e958e
MR
15867 (Fwindow_frame): Move here from frame.c. Accept any window as
15868 argument.
15869 (Fframe_root_window, Fframe_first_window)
15870 (Fframe_selected_window): Move here from frame.c. Accept frame
15871 or arbitrary window as argument. Update doc-strings.
15872 (Fminibuffer_window): Move up in code.
15873 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
15874 (Fset_frame_selected_window): Move here from frame.c.
15875 Marginal rewrite.
727e958e
MR
15876 (Fselected_window, select_window, Fselect_window): Move up in
15877 code. Minor doc-string fixes.
f230ecc9 15878
4d09bcf6
PE
158792011-06-06 Paul Eggert <eggert@cs.ucla.edu>
15880
15881 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
15882 Do not assume that spare memory exists; that assumption is valid
15883 only if SYSTEM_MALLOC.
15884 (LARGE_REQUEST): New macro, so that the issue of large requests
15885 is separated from the issue of spare memory.
15886
810928a2
AS
158872011-06-05 Andreas Schwab <schwab@linux-m68k.org>
15888
172418ad
AS
15889 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
15890 format. (Bug#8806)
15891
43f862f7
AS
15892 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
15893
810928a2
AS
15894 * xfns.c (x_set_scroll_bar_default_width): Move declarations
15895 before statements.
15896
a059fe24
JD
158972011-06-05 Jan Djärv <jan.h.d@swipnet.se>
15898
15899 * gtkutil.c (xg_get_default_scrollbar_width): New function.
15900
15901 * gtkutil.h: Declare xg_get_default_scrollbar_width.
15902
15903 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
15904 min width by calling x_set_scroll_bar_default_width (Bug#8505).
15905
989bf368
JB
159062011-06-05 Juanma Barranquero <lekktu@gmail.com>
15907
15908 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
15909
4b80f674
CY
159102011-06-04 Chong Yidong <cyd@stupidchicken.com>
15911
15912 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
15913 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
15914 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
15915 New error handlers.
4b80f674
CY
15916 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
15917 Obey Vx_select_enable_clipboard_manager. Catch errors in
15918 x_clipboard_manager_save (Bug#8779).
15919 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 15920 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 15921
99a33b77 159222011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
15923
15924 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
15925
99a33b77 159262011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
15927
15928 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
15929 in the current matrix if keep_current_p is non-zero.
15930
8264569d
EZ
159312011-06-04 Eli Zaretskii <eliz@gnu.org>
15932
15933 * bidi.c (bidi_level_of_next_char): Fix last change.
15934
57f97249
EZ
159352011-06-03 Eli Zaretskii <eliz@gnu.org>
15936
fec2107c 15937 Support bidi reordering of text covered by display properties.
57f97249 15938
fec2107c
EZ
15939 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
15940 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
15941 (bidi_cache_search, bidi_cache_iterator_state)
15942 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
15943 (bidi_level_of_next_char, bidi_move_to_visually_next):
15944 Support character positions inside a run of characters covered by a
fec2107c
EZ
15945 display string.
15946 (bidi_paragraph_init, bidi_resolve_explicit_1)
15947 (bidi_level_of_next_char): Call bidi_fetch_char and
15948 bidi_fetch_char_advance instead of FETCH_CHAR and
15949 FETCH_CHAR_ADVANCE.
15950 (bidi_init_it): Initialize new members.
15951 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
15952 definitions.
15953 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
15954 instead of using explicit *_CHAR codes.
d6d100dd
SM
15955 (bidi_resolve_explicit, bidi_resolve_weak):
15956 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
15957 bidirectional text is supported only in multibyte buffers.
15958 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
15959 it to initialize the frame_window_p member of struct bidi_it.
15960 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
15961 (bidi_resolve_explicit, bidi_resolve_weak)
15962 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
15963 bidi_it->nchars is non-positive.
15964 (bidi_level_of_next_char): Don't try to lookup the cache for the
15965 next/previous character if nothing is cached there yet, or if we
15966 were just reseat()'ed to a new position.
c40e2fb2 15967
0e14fe90
EZ
15968 * xdisp.c (set_cursor_from_row): Set start and stop points
15969 according to the row's direction when priming the loop that looks
15970 for the glyph on which to display cursor.
15971 (single_display_spec_intangible_p): Function deleted.
15972 (display_prop_intangible_p): Reimplement to call
15973 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
15974 Accept 3 additional arguments needed by handle_display_spec.
15975 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
15976 values: lists, `(when COND...)' forms, etc.
15977 (single_display_spec_string_p): Support property values that are
15978 lists with the argument STRING its top-level element.
15979 (display_prop_string_p): Fix the condition for processing a
15980 property that is a list to be consistent with handle_display_spec.
fec2107c 15981 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
15982 last portion of handle_display_prop.
15983 (compute_display_string_pos): Accept additional argument
15984 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
15985 value of a `display' property is a "replacing spec".
15986 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
15987 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
15988 the display property, but just return a value indicating whether
15989 the display property will replace the characters it covers.
15990 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
15991 frame_window_p members of struct bidi_it.
d6d100dd
SM
15992 (compute_display_string_pos, compute_display_string_end):
15993 New functions.
fec2107c
EZ
15994 (push_it): Accept second argument POSITION, where pop_it should
15995 jump to continue iteration.
15996 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 15997
fec2107c
EZ
15998 * keyboard.c (adjust_point_for_property): Adjust the call to
15999 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
16000
16001 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
16002 (bidi_init_it): Update prototypes.
16003 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
16004 (compute_display_string_pos, compute_display_string_end):
16005 Declare prototypes.
fec2107c
EZ
16006 (struct bidi_it): New members nchars and disp_pos. ch_len is now
16007 EMACS_INT.
fc6f18ce 16008
40087514 160092011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 16010
57f53182
PE
16011 Malloc failure behavior now depends on size of allocation.
16012 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
16013 * lisp.h: Change signatures accordingly.
16014 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
16015 All callers changed. (Bug#8762)
16016
16017 * gnutls.c: Use Emacs's memory allocators.
16018 Without this change, the gnutls library would invoke malloc etc.
16019 directly, which causes problems on non-SYNC_INPUT hosts, and which
16020 runs afoul of improving memory_full behavior. (Bug#8761)
16021 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
16022 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
16023 xfree instead of the default malloc, realloc, free.
16024 (Fgnutls_boot): No need to check for memory allocation failure,
16025 since xmalloc does that for us.
16026
ac32cd99 16027 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
16028 * category.c (hash_get_category_set):
16029 * ccl.c (ccl_driver):
16030 * charset.c (Fdefine_charset_internal):
16031 * charset.h (struct charset.hash_index):
16032 * composite.c (get_composition_id, gstring_lookup_cache)
16033 (composition_gstring_put_cache):
16034 * composite.h (struct composition.hash_index):
16035 * dispextern.h (struct image.hash):
16036 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
16037 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
16038 (hashfn_equal, hashfn_user_defined, make_hash_table)
16039 (maybe_resize_hash_table, hash_lookup, hash_put)
16040 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
16041 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
16042 (Fsxhash, Fgethash, Fputhash, Fmaphash):
16043 * image.c (make_image, search_image_cache, lookup_image)
16044 (xpm_put_color_table_h):
16045 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 16046 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 16047 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 16048 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
16049 * alloc.c (allocate_vectorlike):
16050 Check for overflow in vector size calculations.
16051 * ccl.c (ccl_driver):
16052 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
16053 * fns.c, image.c: Remove unnecessary static decls that would otherwise
16054 need to be updated by these changes.
40087514
PE
16055 * fns.c (make_hash_table, maybe_resize_hash_table):
16056 Check for integer overflow with large hash tables.
0de4bb68
PE
16057 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
16058 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
16059 (SXHASH_REDUCE): New macro.
16060 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
16061 Use it instead of discarding useful hash info with large hash values.
16062 (sxhash_float): New function.
16063 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
16064 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
16065 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
16066 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
16067 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
16068 Adjust signatures to match updated version of code.
16069 (consing_since_gc): Now EMACS_INT, since a single hash table can
16070 use more than INT_MAX bytes.
16071
698d32e2
DN
160722011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
16073
16074 Make it possible to build with GCC-4.6+ -O2 -flto.
16075
16076 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
16077
fd6fa53f
SM
160782011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
16079
16080 * minibuf.c (get_minibuffer, read_minibuf_unwind):
16081 Call minibuffer-inactive-mode.
16082
864db017
JB
160832011-05-31 Juanma Barranquero <lekktu@gmail.com>
16084
16085 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
16086 Update dependencies.
16087
2ad0baf4
DN
160882011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16089
16090 * data.c (init_data): Remove code for UTS, this system is not
16091 supported anymore.
16092
4fcc2638
DN
160932011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16094
16095 Don't force ./temacs to start in terminal mode.
16096
16097 * frame.c (make_initial_frame): Initialize faces in all cases, not
16098 only when CANNOT_DUMP is defined.
16099 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
16100
c56e0fd5
DN
161012011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16102
16103 * dispnew.c (add_window_display_history): Use const for the string
16104 pointer. Remove declaration, not needed.
16105
333d54da 161062011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 16107
55d4c1b2 16108 Use 'inline', not 'INLINE'.
333d54da 16109 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
16110 * alloc.c, fontset.c (INLINE): Remove.
16111 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
16112 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
16113 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
16114 * gmalloc.c (register_heapinfo): Use inline unconditionally.
16115 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
16116
738db178
DN
161172011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
16118
16119 Make it possible to run ./temacs.
16120
16121 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
16122 syms_of_callproc does the same thing. Remove test for
16123 "initialized", do it in the caller.
16124 * emacs.c (main): Avoid calling set_initial_environment when dumping.
16125
620c53a6
SM
161262011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
16127
16128 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
16129 (read_minibuf): Use get_minibuffer.
16130 (syms_of_minibuf): Use DEFSYM.
16131 (Qmetadata): New var.
16132 * data.c (Qbuffer): Don't make it static.
16133 (syms_of_data): Use DEFSYM.
16134
e003a292
PE
161352011-05-31 Paul Eggert <eggert@cs.ucla.edu>
16136
16137 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
16138 (CCL_CODE_MIN): New macro.
16139
ed008a6d
PE
161402011-05-30 Paul Eggert <eggert@cs.ucla.edu>
16141
3687c2ef
PE
16142 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
16143
ed008a6d
PE
16144 * eval.c (Qdebug): Now static.
16145 * lisp.h (Qdebug): Remove decl. This reverts a part of the
16146 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
16147 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
16148
d66c4c7c
CY
161492011-05-29 Chong Yidong <cyd@stupidchicken.com>
16150
16151 * image.c: Various fixes to ImageMagick code comments.
16152 (Fimagemagick_types): Doc fix.
16153
5fbc2025
PE
161542011-05-29 Paul Eggert <eggert@cs.ucla.edu>
16155
0196f88a
PE
16156 Minor fixes prompted by GCC 4.6.0 warnings.
16157
16158 * xselect.c (converted_selections, conversion_fail_tag): Now static.
16159
5fbc2025
PE
16160 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
16161 (x_clipboard_manager_save_all): Move extern decl to ...
16162 * xterm.h: ... here, so that it can be checked for consistency.
16163
1dd3c2d9
CY
161642011-05-29 Chong Yidong <cyd@stupidchicken.com>
16165
16166 * xselect.c (x_clipboard_manager_save_frame)
16167 (x_clipboard_manager_save_all): New functions.
16168 (Fx_clipboard_manager_save): Lisp function deleted.
16169
16170 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
16171 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
16172
16173 * xterm.h: Update prototype.
16174
5ba6571d
WX
161752011-05-28 William Xu <william.xwl@gmail.com>
16176
16177 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
16178 exiting (Bug#8239).
16179
3eaff834
JM
161802011-05-28 Jim Meyering <meyering@redhat.com>
16181
e1900994 16182 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
16183 * fns.c (to_uchar): Define.
16184 (crypto_hash_function): Use it to convert some newly-signed
16185 variables to unsigned, to avoid sign-extension bugs. For example,
16186 without this change, (md5 "truc") would evaluate to
16187 45723a2aff78ff4fff7fff1114760e62 rather than the expected
16188 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 16189 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 16190
0f6990a7
PE
161912011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16192
16193 Integer overflow fixes.
c8a9ca5a 16194
08686060
PE
16195 * dbusbind.c: Serial number integer overflow fixes.
16196 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
16197 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
16198 to hold a serial number that is too large for a fixnum.
16199 (Fdbus_method_return_internal, Fdbus_method_error_internal):
16200 Check for serial numbers out of range. Decode any serial number
59568bf0 16201 that was so large that it became a float. (Bug#8722)
08686060 16202
2d1fc3c7
PE
16203 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
16204 (Fdbus_call_method, Fdbus_call_method_asynchronously):
16205 Use XFASTINT rather than XUINT when numbers are nonnegative.
16206 (xd_append_arg, Fdbus_method_return_internal):
16207 (Fdbus_method_error_internal): Likewise. Also, for unsigned
16208 arguments, check that Lisp number is nonnegative, rather than
59568bf0 16209 silently wrapping negative numbers around. (Bug#8722)
30217ff0 16210 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 16211 (Bug#8722)
2d1fc3c7 16212
c8a9ca5a
PE
16213 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
16214
519e1d69
PE
16215 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
16216
6df6ae42 16217 ccl: Add integer overflow checks.
30569699
PE
16218 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
16219 (IN_INT_RANGE): New macros.
16220 (ccl_driver): Use them to check for integer overflow when
16221 decoding a CCL program. Many of the new checks are whether XINT (x)
16222 fits in int; it doesn't always, on 64-bit hosts. The new version
16223 doesn't catch all possible integer overflows, but it's an
847044ea 16224 improvement. (Bug#8719)
30569699 16225
c11285dc
PE
16226 * alloc.c (make_event_array): Use XINT, not XUINT.
16227 There's no need for unsigned here.
16228
fdccd48e
PE
16229 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
16230 This follows up to the 2011-05-06 change that substituted uintptr_t
16231 for EMACS_INT. This case wasn't caught back then.
16232
37910ab2
PE
16233 Rework Fformat to avoid integer overflow issues.
16234 * editfns.c: Include <float.h> unconditionally, as it's everywhere
16235 now (part of C89). Include <verify.h>.
16236 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
16237 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
16238 (Fformat): Avoid the prepass trying to compute sizes; it was only
16239 approximate and thus did not catch overflow reliably. Instead, walk
16240 through the format just once, formatting and computing sizes as we go,
16241 checking for integer overflow at every step, and allocating a larger
16242 buffer as needed. Keep track separately whether the format is
16243 multibyte. Keep only the most-recently calculated precision, rather
16244 than them all. Record whether each argument has been converted to
16245 string. Use EMACS_INT, not int, for byte and char and arg counts.
16246 Support field widths and precisions larger than INT_MAX. Avoid
16247 sprintf's undefined behavior with conversion specifications such as %#d
16248 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
16249 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
16250 formatting out-of-range floating point numbers with int
9173deec 16251 formats. (Bug#8668)
37910ab2 16252
2e6578fb
PE
16253 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
16254
0ae6bdee
PE
16255 * data.c: Avoid integer truncation in expressions involving floats.
16256 * data.c: Include <intprops.h>.
16257 (arith_driver): When there's an integer overflow in an expression
16258 involving floating point, convert the integers to floating point
16259 so that the resulting value does not suffer from catastrophic
16260 integer truncation. For example, on a 64-bit host (* 4
16261 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
16262 Do not rely on undefined behavior after integer overflow.
16263
de883a70
PE
16264 merge count_size_as_multibyte, parse_str_to_multibyte
16265 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 16266 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
16267 Check for integer overflow.
16268 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
16269 since it's now a duplicate of the other. This is more of
16270 a character than a buffer op, so better that it's in character.c.
16271 * fns.c, print.c: Adjust to above changes.
16272
2ff916cb
PE
162732011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
16274
16275 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
16276
f1b54466
PE
162772011-05-27 Paul Eggert <eggert@cs.ucla.edu>
16278
fb1ac845
PE
16279 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16280 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
16281 (x_clipboard_manager_save): Now static.
16282 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
16283
f1b54466
PE
16284 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
16285 (crypto_hash_function): Now static.
16286 Fix pointer signedness problems. Avoid unnecessary initializations.
16287
a9f737ee
CY
162882011-05-27 Chong Yidong <cyd@stupidchicken.com>
16289
16290 * termhooks.h (Vselection_alist): Make it terminal-local.
16291
16292 * terminal.c (create_terminal): Initialize it.
16293
16294 * xselect.c: Support for clipboard managers.
16295 (Vselection_alist): Move to termhooks.h as terminal-local var.
16296 (LOCAL_SELECTION): New macro.
16297 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
16298 (symbol_to_x_atom): Remove gratuitous arg.
16299 (x_handle_selection_request, lisp_data_to_selection_data)
16300 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
16301 (x_own_selection, x_get_local_selection, x_convert_selection):
16302 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
16303 (some_frame_on_display): Delete unused function.
16304 (Fx_own_selection_internal, Fx_get_selection_internal)
16305 (Fx_disown_selection_internal, Fx_selection_owner_p)
16306 (Fx_selection_exists_p): New optional frame arg.
16307 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
16308 (x_handle_selection_clear): Don't treat other terminals with the
16309 same keyboard specially. Use the terminal-local Vselection_alist.
16310 (x_clear_frame_selections): Use Frun_hook_with_args.
16311
16312 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
16313
16314 * xterm.h: Add support for those atoms.
16315
e067f0c1
CY
163162011-05-26 Chong Yidong <cyd@stupidchicken.com>
16317
16318 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
16319 (converted_selections, conversion_fail_tag): New global variables.
16320 (x_selection_request_lisp_error): Free the above.
16321 (x_get_local_selection): Remove unnecessary code.
16322 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
16323 of converted selections stored in converted_selections.
16324 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
16325 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
16326 (x_convert_selection): New function.
16327 (x_handle_selection_event): Simplify.
16328 (x_get_foreign_selection): Don't ignore incoming requests while
16329 waiting for an answer; this will fail when we implement
16330 SAVE_TARGETS, and seems unnecessary anyway.
16331 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
16332 (Vx_sent_selection_functions): Doc fix.
16333
0f4aebc0
LL
163342011-05-26 Leo Liu <sdl.web@gmail.com>
16335
16336 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
16337
e61124cd
YM
163382011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16339
16340 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
16341
16342 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
16343 for fringe update if it has periodic bitmap.
ac389d0c 16344 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
16345 and fringe_bitmap_periodic_p.
16346
16347 * fringe.c (get_fringe_bitmap_data): New function.
16348 (draw_fringe_bitmap_1, update_window_fringes): Use it.
16349 (update_window_fringes): Record periodicity of fringe bitmap in glyph
16350 row. Mark glyph row for fringe update if periodicity changed.
16351
16352 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
16353 for fringe update unless it has periodic bitmap.
16354
f16d9837
KH
163552011-05-25 Kenichi Handa <handa@m17n.org>
16356
16357 * xdisp.c (get_next_display_element): Set correct it->face_id for
16358 a static composition.
16359
e1b90ef6
LL
163602011-05-24 Leo Liu <sdl.web@gmail.com>
16361
16362 * deps.mk (fns.o):
16363 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
16364
16365 * fns.c (crypto_hash_function, Fsha1): New function.
16366 (Fmd5): Use crypto_hash_function.
16367 (syms_of_fns): Add Ssha1.
16368
7400048f
PE
163692011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16370
16371 * gnutls.c: Remove unused macros.
16372 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
16373 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
16374 Remove macros that are defined and never used.
16375 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
16376
abb71cf4
CY
163772011-05-22 Chong Yidong <cyd@stupidchicken.com>
16378
16379 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
16380 (Fx_get_selection_internal): Minor cleanup.
16381 (Fx_own_selection_internal): Rename arguments for consistency with
16382 select.el.
16383
6307db39
PE
163842011-05-22 Paul Eggert <eggert@cs.ucla.edu>
16385
16386 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
16387
f3d4e0a4
CY
163882011-05-22 Chong Yidong <cyd@stupidchicken.com>
16389
16390 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
16391
4d8ade89
YM
163922011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
16393
16394 * dispnew.c (scrolling_window): Don't exclude the case that the
16395 last enabled row in the desired matrix touches the bottom boundary.
16396
32078c8d
GM
163972011-05-21 Glenn Morris <rgm@gnu.org>
16398
16399 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
16400 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
16401 and add some more files.
32078c8d 16402
7285dc67
EZ
164032011-05-20 Eli Zaretskii <eliz@gnu.org>
16404
16405 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
16406 report_file_error introduced by the change from 2011-05-07.
16407
89d1bd22
PE
164082011-05-20 Paul Eggert <eggert@cs.ucla.edu>
16409
16410 * systime.h (Time): Define only if emacs is defined.
16411 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
16412 where the include path doesn't have X11/X.h by default. See
16413 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
16414
cd394be1 164152011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
16416
16417 * composite.c (find_automatic_composition): Fix previous change.
16418
b9704ad9
GM
164192011-05-20 Glenn Morris <rgm@gnu.org>
16420
16421 * lisp.mk: New file, split from Makefile.in.
16422 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
16423 (shortlisp): Remove.
16424 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
16425
4a720484
GM
164262011-05-19 Glenn Morris <rgm@gnu.org>
16427
16428 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
16429 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
16430 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
16431 (lisp): Set the order to that of loadup.el.
16432 (shortlisp): Make it a copy of $lisp.
16433 (SOME_MACHINE_LISP): Remove.
16434 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
16435 Use just $shortlisp, not $SOME_MACHINE_LISP too.
16436
a28d4396
KH
164372011-05-18 Kenichi Handa <handa@m17n.org>
16438
16439 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
16440 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
16441 (find_automatic_composition): Mostly rewrite for efficiency.
16442
a2b1fa8e
JB
164432011-05-18 Juanma Barranquero <lekktu@gmail.com>
16444
16445 * makefile.w32-in: Update dependencies.
16446
8e1f5610
CS
164472011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
16448
16449 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 16450 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 16451
7025ee00 164522011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 16453
cdfa6eab
PE
16454 Fix some integer overflow issues, such as string length overflow.
16455
06d6db33
PE
16456 * insdel.c (count_size_as_multibyte): Check for string overflow.
16457
2b4560a8
PE
16458 * character.c (lisp_string_width): Check for string overflow.
16459 Use EMACS_INT, not int, for string indexes and lengths; in
16460 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
16461 the resulting string length overflows an EMACS_INT; instead,
16462 report a string overflow if no precision given. When checking for
16463 precision exhaustion, use a check that cannot possibly have
16464 integer overflow. (Bug#8675)
16465 * character.h (lisp_string_width): Adjust to new signature.
16466
cb93f9be
PE
16467 * alloc.c (string_overflow): New function.
16468 (Fmake_string): Use it. This doesn't change behavior, but saves
16469 a few bytes and will simplify future changes.
16470 * character.c (string_escape_byte8): Likewise.
16471 * lisp.h (string_overflow): New decl.
16472
1a1f3366
PE
16473 Fixups, following up to the user-interface timestamp change.
16474 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
16475 for UI timestamps, instead of unsigned long.
9fbd6841
PE
16476 * msdos.c (mouse_get_pos): Likewise.
16477 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
16478 * w32gui.h (Time): Define by including "systime.h" rather than by
16479 declaring it ourselves. (Bug#8664)
16480
d4e3e4d3
PE
16481 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
16482 * image.c (clear_image_cache): Likewise.
16483
f6a24d19
PE
16484 * term.c (term_mouse_position): Don't assume time_t wraparound.
16485
08dc5ae6
PE
16486 Be more systematic about user-interface timestamps.
16487 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
16488 and sometimes 'EMACS_UINT', to represent these timestamps.
16489 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
16490 This makes the code easier to follow, and makes it easier to catch
16491 integer overflow bugs such as Bug#8664.
16492 * frame.c (Fmouse_position, Fmouse_pixel_position):
16493 Use Time, not unsigned long, for user-interface timestamps.
16494 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
16495 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
16496 * keyboard.h (last_event_timestamp): Likewise.
16497 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
16498 * menu.h (xmenu_show): Likewise.
16499 * term.c (term_mouse_position): Likewise.
16500 * termhooks.h (struct input_event.timestamp): Likewise.
16501 (struct terminal.mouse_position_hook): Likewise.
16502 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
16503 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
16504 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
16505 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
16506 what it was before.
16507 * menu.h, termhooks.h: Include "systime.h", for Time.
16508
8e55734a
PE
16509 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
16510 Don't assume that the difference between two unsigned long values
16511 can fit into an integer. At this point, we know button_down_time
16512 <= event->timestamp, so the difference must be nonnegative, so
16513 there's no need to cast the result if double-click-time is
16514 nonnegative, as it should be; check that it's nonnegative, just in
16515 case. This bug is triggered when events are more than 2**31 ms
86db42d2 16516 apart (about 25 days). (Bug#8664)
8e55734a 16517
841f1b75 16518 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 16519 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 16520
3e26f69c
PE
16521 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
16522 that always fit in int. Use a sentinel instead of a counter, to
16523 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
16524 * frame.h (struct frame): Use int for menu_bar_items_used
16525 instead of EMACS_INT, since it always fits in int.
3e26f69c 16526
5cc152c0
PE
16527 * menu.c (grow_menu_items): Check for int overflow.
16528
d89eb65e
PE
16529 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
16530
5235bd3e
PE
16531 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
16532 Before, the code was not consistent. These values cannot exceed
16533 2**31 - 1 so there's no need to make them unsigned.
16534 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
16535 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
16536 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
16537 as modifiers.
16538 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
16539
bc827e23
PE
16540 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
16541 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
16542 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
16543 presumably because the widths might not match.
16544
78eb494e
PE
16545 * window.c (size_window): Avoid needless test at loop start.
16546
04f2d78b
CB
165472011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
16548
16549 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
16550
d2fc7e3d 165512011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
16552
16553 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
16554
d2fc7e3d 165552011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
16556
16557 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
16558 `width' to `bar_area_x' and `bar_area_width', respectively.
16559 (x_scroll_run): Take account of fringe background extension.
16560
04f2d78b
CB
16561 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
16562 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
16563 `bar_area_width', respectively.
16564 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
16565 background extension.
16566
79b70037
GM
165672011-05-10 Jim Meyering <meyering@redhat.com>
16568
16569 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
16570
2f142cc5
JB
165712011-05-10 Juanma Barranquero <lekktu@gmail.com>
16572
16573 * image.c (Finit_image_library): Return t for built-in image types,
16574 like pbm and xbm. (Bug#8640)
16575
57679c86
AS
165762011-05-09 Andreas Schwab <schwab@linux-m68k.org>
16577
16578 * w32menu.c (set_frame_menubar): Fix submenu allocation.
16579
888c9e86
EZ
165802011-05-07 Eli Zaretskii <eliz@gnu.org>
16581
b0512a1d
EZ
16582 * w32console.c (Fset_screen_color): Doc fix.
16583 (Fget_screen_color): New function.
16584 (syms_of_ntterm): Defsubr it.
16585
7285dc67
EZ
16586 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
16587 unlink the temporary file if Fcall_process didn't create it in the
16588 first place.
16589 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
16590 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
16591 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
16592 cue to call_process_cleanup not to close that handle.
16593
4d3fcc8e
BK
165942011-05-07 Ben Key <bkey76@gmail.com>
16595
16596 * makefile.w32-in: The bootstrap-temacs rule now makes use of
16597 one of two shell specific rules, either bootstrap-temacs-CMD or
16598 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
16599 to the previous implementation of the bootstrap-temacs rule.
16600 The bootstrap-temacs-CMD rule is similar to the previous
16601 implementation of the bootstrap-temacs rule except that it
16602 makes use of the ESC_CFLAGS variable instead of the CFLAGS
16603 variable.
16604
16605 These changes, along with some changes to nt/configure.bat,
16606 nt/gmake.defs, and nt/nmake.defs, are required to extend my
16607 earlier fix to add support for --cflags and --ldflags options
16608 that include quotes so that it works whether make uses cmd or
16609 sh as the shell.
16610
b4289b64
MA
166112011-05-06 Michael Albinus <michael.albinus@gmx.de>
16612
16613 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
16614 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
16615 is a constant.
16616 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
16617 a string. Handle both cases.
16618 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
16619 (Fdbus_register_method): Use Qinvalid_function.
16620
af4c0e28
JB
166212011-05-06 Juanma Barranquero <lekktu@gmail.com>
16622
16623 * makefile.w32-in: Update dependencies.
16624 (LISP_H): Add inttypes.h and stdin.h.
16625 (PROCESS_H): Add unistd.h.
16626
c51453d9
EZ
166272011-05-06 Eli Zaretskii <eliz@gnu.org>
16628
16629 * lread.c: Include limits.h (fixes the MS-Windows build broken by
16630 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
16631
8ff0ac3c 166322011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 16633
4c4b566b
PE
16634 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
16635
aab2b9b5
PE
16636 * term.c (vfatal): Remove stray call to va_end.
16637 It's not needed and the C Standard doesn't allow it here anyway.
16638
c378da0b
PE
16639 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
16640 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
16641
288b08c7
PE
16642 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
16643 bytes.
16644
e3601888
PE
16645 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
16646
db6c0e74
PE
16647 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16648
dd5963ea
PE
16649 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
16650
88c9450f
PE
16651 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
16652
2f9442b8
PE
16653 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
16654
c032b5f8
PE
16655 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
16656 * charset.c (Fdefine_charset_internal): Don't initialize
16657 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 16658 32-bit int (Bug#8600).
a108c10b
PE
16659
16660 * lread.c (read_integer): Be more consistent with string-to-number.
16661 Use string_to_number to do the actual conversion; this avoids
16662 rounding errors and fixes some other screwups. Without this fix,
16663 for example, #x1fffffffffffffff was misread as -2305843009213693952.
16664 (digit_to_number): Move earlier, for benefit of read_integer.
16665 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 16666 not a digit in any supported base. (Bug#8602)
a108c10b 16667
ad5f9eea
PE
16668 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
16669
aec1708a
PE
16670 * dispnew.c (scrolling_window): Return 1 if we scrolled,
16671 to match comment at start of function. This also removes a
16672 GCC warning about overflow in a 32+64-bit port.
16673
47be4ab5
PE
16674 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
16675
371cac43
PE
16676 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
16677 Reported by Stefan Monnier in
16678 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
16679 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16680 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 16681
d01a7826
PE
16682 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
16683 (EMACS_UINTPTR): Likewise, with uintptr_t.
16684
7fd47d5c
PE
16685 * lisp.h: Prefer 64-bit EMACS_INT if available.
16686 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
16687 on 32-bit hosts that have 64-bit int, so that they can access
16688 large files.
122b0c86
PE
16689 However, temporarily disable this change unless the temporary
16690 symbol WIDE_EMACS_INT is defined.
7fd47d5c 16691
8727937b
PE
16692 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
16693
8ac068ac
PE
16694 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
16695 This removes an assumption that EMACS_INT and long are the same
16696 width as pointers. The assumption is true for Emacs porting targets
16697 now, but we want to make other targets possible.
16698 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
16699 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
16700 In the rest of the code, change types of integers that hold casted
16701 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
16702 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
16703 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
16704 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
16705 No need to cast type when ORing.
16706 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
16707 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
16708 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
16709 assume EMACS_INT is the same width as char *.
16710 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
16711 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
16712 Remove no-longer-needed casts.
16713 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
16714 (xg_tool_bar_help_callback, xg_make_tool_item):
16715 Use EMACS_INTPTR to hold an integer
16716 that will be cast to void *; this can avoid a GCC warning
16717 if EMACS_INT is not the same width as void *.
16718 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
16719 * xdisp.c (display_echo_area_1, resize_mini_window_1):
16720 (current_message_1, set_message_1):
16721 Use a local to convert to proper width without a cast.
16722 * xmenu.c (dialog_selection_callback): Likewise.
16723
ede49d71
PE
16724 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
16725 Also, don't assume VALBITS / RAND_BITS is less than 5,
16726 and don't rely on undefined behavior when shifting a 1 left into
16727 the sign bit.
16728 * lisp.h (get_random): Change signature to match.
16729
2f30ecd0
PE
16730 * lread.c (hash_string): Use size_t, not int, for hash computation.
16731 Normally we prefer signed values; but hashing is special, because
16732 it's better to use unsigned division on hash table sizes so that
16733 the remainder is nonnegative. Also, size_t is the natural width
16734 for hashing into memory. The previous code used 'int', which doesn't
16735 retain enough info to hash well into very large tables.
16736 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
16737
2a866e7b
PE
16738 * dbusbind.c: Don't possibly lose pointer info when converting.
16739 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
16740 Use XPNTR rather than XHASH, so that the high-order bits of
16741 the pointer aren't lost when converting through void *.
16742
51639eac
PE
16743 * eval.c (Fautoload): Don't double-shift a pointer.
16744
92394119
PE
16745 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
16746
dbdb9a7c
JB
167472011-05-06 Juanma Barranquero <lekktu@gmail.com>
16748
16749 * gnutls.c (DEF_GNUTLS_FN):
16750 * image.c (DEF_IMGLIB_FN): Make function pointers static.
16751
db7a0b4f
AS
167522011-05-05 Andreas Schwab <schwab@linux-m68k.org>
16753
16754 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
16755 marker. (Bug#8610)
16756
cd394be1 167572011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
16758
16759 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
16760 New version that can reserve upto 2GB of heap space.
16761
f7ff1b0f 167622011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
16763
16764 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
16765
639c109b
TZ
167662011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
16767
16768 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
16769 `gnutls_certificate_set_x509_key_file'.
16770
d2127135
JB
167712011-05-05 Juanma Barranquero <lekktu@gmail.com>
16772
16773 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
16774 Update dependencies.
16775
e968f4f3
JB
167762011-05-04 Juanma Barranquero <lekktu@gmail.com>
16777
16778 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
16779 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
16780 Remove unused parameter `fildes'.
16781 * process.c (read_process_output, send_process): Don't pass it.
16782
84d358f0
JB
167832011-05-04 Juanma Barranquero <lekktu@gmail.com>
16784
16785 Fix previous change: the library cache is defined in w32.c.
16786 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
16787 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
16788
0898ca10
JB
167892011-05-04 Juanma Barranquero <lekktu@gmail.com>
16790
16791 Implement dynamic loading of GnuTLS on Windows.
16792
16793 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
16794 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
16795 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16796 Declare.
16797
16798 * gnutls.c (Qgnutls_dll): Define.
16799 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
16800 (gnutls_*): Declare function pointers.
16801 (init_gnutls_functions): New function to initialize function pointers.
16802 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
16803 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
16804 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
16805 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
16806 (emacs_gnutls_write, emacs_gnutls_read)
16807 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
16808 (Fgnutls_available_p): New function.
16809 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
16810 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
16811 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
16812
16813 * image.c: Include w32.h.
16814 (Vimage_type_cache): Delete.
16815 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
16816 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
16817 (w32_delayed_load): Move to w32.c.
16818
16819 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
16820
16821 * w32.c (QCloaded_from, Vlibrary_cache): Define.
16822 (w32_delayed_load): Move from image.c. When loading a library, record
16823 its filename in the :loaded-from property of the library id.
16824 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
16825 Initialize and staticpro them.
16826 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
16827
16828 * process.c: Include lisp.h before w32.h, not after.
16829 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
16830 instead of gnutls_record_check_pending.
16831
16832 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
16833
ff4de4aa
TZ
168342011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
16835
16836 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
16837 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
16838 as passed in.
16839
abe95abb
JD
168402011-05-03 Jan Djärv <jan.h.d@swipnet.se>
16841
16842 * xterm.c (x_set_frame_alpha): Do not set property on anything
16843 else than FRAME_X_OUTER_WINDOW (Bug#8608).
16844
e16e55d4
JB
168452011-05-02 Juanma Barranquero <lekktu@gmail.com>
16846
16847 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
16848
bafcf6a5
JB
168492011-05-02 Juanma Barranquero <lekktu@gmail.com>
16850
16851 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
16852 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
16853 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
16854 (gnutls_global_initialized, Qgnutls_bootprop_priority)
16855 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
16856 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
16857 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
16858 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
16859 (Qgnutls_bootprop_callbacks_verify): Make static.
16860
e7a6747f
AS
168612011-05-01 Andreas Schwab <schwab@linux-m68k.org>
16862
19ed11ba
AS
16863 * callproc.c: Indentation fixup.
16864
e7a6747f 16865 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
16866 (wait_for_termination, interruptible_wait_for_termination):
16867 Move after wait_for_termination_1.
e7a6747f 16868
1ef14cb4
LMI
168692011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
16870
16871 * sysdep.c (interruptible_wait_for_termination): New function
16872 which is like wait_for_termination, but allows keyboard
16873 interruptions.
16874
16875 * callproc.c (Fcall_process): Add (:file "file") as an option for
16876 the STDOUT buffer.
16877 (Fcall_process_region): Ditto.
16878
330d880c
EZ
168792011-04-30 Eli Zaretskii <eliz@gnu.org>
16880
8db90b73
EZ
16881 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
16882 rather than `XVECTOR (FOO)->size'.
16883
330d880c
EZ
16884 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
16885 inttypes.h, as a gnulib replacement is used if it not available in
16886 system headers.
16887
15cbd324
EZ
168882011-04-21 Eli Zaretskii <eliz@gnu.org>
16889
16890 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
16891 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
16892 of MOST_POSITIVE_FIXNUM. (Bug#8528)
16893
16894 * coding.c (coding_alloc_by_realloc): Error out if destination
16895 will grow beyond MOST_POSITIVE_FIXNUM.
16896 (decode_coding_emacs_mule): Abort if there isn't enough place in
16897 charbuf for the composition carryover bytes. Reserve an extra
16898 space for up to 2 characters produced in a loop.
16899 (decode_coding_iso_2022): Abort if there isn't enough place in
16900 charbuf for the composition carryover bytes.
16901
169022011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 16903
ae940cca
EZ
16904 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
16905 aborting when %lld or %lll format is passed.
16906 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
16907 %llo or %llx format is passed. (Bug#8545)
16908
03ab8921
EZ
16909 * window.c (window_scroll_line_based): Use a marker instead of
16910 simple variables to record original value of point. (Bug#7952)
16911
afda1437
EZ
16912 * doprnt.c (doprnt): Fix the case where a multibyte sequence
16913 produced by %s or %c overflows available buffer space. (Bug#8545)
16914
f76dee0c
PE
169152011-04-28 Paul Eggert <eggert@cs.ucla.edu>
16916
16917 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 16918 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 16919
fdc5744d
JB
169202011-04-28 Juanma Barranquero <lekktu@gmail.com>
16921
16922 * w32.c (init_environment): Warn about defaulting HOME to C:\.
16923
638f053a
JB
169242011-04-28 Juanma Barranquero <lekktu@gmail.com>
16925
16926 * keyboard.c (Qdelayed_warnings_hook): Define.
16927 (command_loop_1): Run `delayed-warnings-hook'
16928 if Vdelayed_warnings_list is non-nil.
16929 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
16930 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
16931
d178f871
EZ
169322011-04-28 Eli Zaretskii <eliz@gnu.org>
16933
16934 * doprnt.c (doprnt): Don't return value smaller than the buffer
16935 size if the message was truncated. (Bug#8545).
16936
b124fd93
JB
169372011-04-28 Juanma Barranquero <lekktu@gmail.com>
16938
16939 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
16940 (Fx_window_property): #if-0 the whole functions, not just the bodies.
16941
e810457d
PE
169422011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16943
16944 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
16945
ea51cceb
JB
169462011-04-27 Juanma Barranquero <lekktu@gmail.com>
16947
16948 * makefile.w32-in: Update dependencies.
16949
94dcfacf
EZ
169502011-04-27 Eli Zaretskii <eliz@gnu.org>
16951
16952 Improve `doprnt' and its usage. (Bug#8545)
16953 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
16954 `format_end'. Remove support for %l as a conversion specifier.
16955 Don't use xrealloc. Improve diagnostics when the %l size modifier
16956 is used. Update the commentary.
16957
16958 * eval.c (verror): Simplify calculation of size_t.
16959
16960 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
16961 messages.
16962
f61f41d7
PE
169632011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
16964
16965 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
16966 change.
16967
96fb4434
PE
169682011-04-27 Paul Eggert <eggert@cs.ucla.edu>
16969
16970 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
16971 This makes this file independent of the recent pseudovector change.
16972
671875da 169732011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 16974
69e9b5a3
PE
16975 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
16976
b5f869a7 16977 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 16978 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 16979 Remove unused local.
c8926152 16980 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 16981
841a1577 16982 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
16983 GCC 4.6.0 optimizes based on type-based alias analysis.
16984 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
16985 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
16986 != &v->size, and therefore "v->size = 1; b->size = 2; return
16987 v->size;" must therefore return 1. This assumption is incorrect
16988 for Emacs, since it type-puns struct Lisp_Vector * with many other
16989 types. To fix this problem, this patch adds a new type struct
f904488f 16990 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
16991 and pseudovectors, and helps optimizing compilers not get fooled
16992 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
16993 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
16994 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
16995 the size member.
eab3844f
PE
16996 (XSETPVECTYPE): Rewrite in terms of new macro.
16997 (XSETPVECTYPESIZE): New macro, specifying both type and size.
16998 This is a bit clearer, and further avoids the possibility of
16999 undesirable aliasing.
17000 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 17001 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
17002 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
17003 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
17004 (ASIZE): Now uses header.size rather than size.
17005 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
17006 to avoid the hassle of writing XVECTOR (foo)->header.size.
17007 (struct vectorlike_header): New type.
eab3844f
PE
17008 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
17009 object, to help avoid aliasing.
17010 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
17011 (SUBRP): Likewise, since Lisp_Subr is a special case.
17012 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
17013 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
17014 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 17015 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
17016 changed to be "header.size" and "header.next".
17017 * buffer.h (struct buffer): Likewise.
17018 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
17019 * frame.h (struct frame): Likewise.
17020 * process.h (struct Lisp_Process): Likewise.
17021 * termhooks.h (struct terminal): Likewise.
17022 * window.c (struct save_window_data, struct saved_window): Likewise.
17023 * window.h (struct window): Likewise.
17024 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
17025 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
17026 * buffer.c (init_buffer_once): Likewise.
17027 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
17028 special case.
17029 * process.c (Fformat_network_address): Use local var for size,
17030 for brevity.
17031
0df1eac5
PE
17032 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
17033
847ab9d1 17034 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
17035 * data.c (atof): Remove decl; no longer used or needed.
17036 (digit_to_number): Move to lread.c.
17037 (Fstring_to_number): Use new string_to_number function, to be
17038 consistent with how the Lisp reader treats infinities and NaNs.
17039 Do not assume that floating-point numbers represent EMACS_INT
17040 without losing information; this is not true on most 64-bit hosts.
17041 Avoid double-rounding errors, by insisting on integers when
17042 parsing non-base-10 numbers, as the documentation specifies.
17043 * lisp.h (string_to_number): New decl, replacing ...
17044 (isfloat_string): Remove.
bc0a5c13 17045 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 17046 (read1): Do not accept +. and -. as integers; this
452f4150
PE
17047 appears to have been a coding error. Similarly, do not accept
17048 strings like +-1e0 as floating point numbers. Do not report
17049 overflow for integer overflows unless the base is not 10 which
17050 means we have no simple and reliable way to continue.
17051 Break out the floating-point parsing into a new
17052 function string_to_number, so that Fstring_to_number parses
17053 floating point numbers consistently with the Lisp reader.
04f2d78b 17054 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
17055 (E_CHAR, EXP_INT): Remove, replacing with ...
17056 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
17057 (string_to_number): New function, replacing isfloat_string.
17058 This function checks for valid syntax and produces the resulting
17059 Lisp float number too. Rework it so that string-to-number
bc0a5c13 17060 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
17061 so that overflow for non-base-10 numbers is reported only when
17062 there's no portable and simple way to convert to floating point.
452f4150 17063
67769ffc
PE
17064 * textprop.c (set_text_properties_1): Rewrite for clarity,
17065 and to avoid GCC warning about integer overflow.
17066
c20db43f
PE
17067 * intervals.h (struct interval): Use EMACS_INT for members
17068 where EMACS_UINT might cause problems. See
17069 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
17070 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
17071 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
17072 All uses changed.
37aa2f85
PE
17073 (offset_intervals): Tell GCC not to worry about length overflow
17074 when negating a negative length.
c20db43f 17075
2538aa2f
PE
17076 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
17077 (overrun_check_free): Likewise.
17078
f2d3008d
PE
17079 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
17080 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
17081 word size.
17082
ec8df744
PE
17083 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17084 (gnutls_make_error): Rename local to avoid shadowing.
17085 (gnutls_emacs_global_deinit): ifdef out; not used.
17086 (Fgnutls_boot): Use const for pointer to readonly storage.
17087 Comment out unused local. Fix pointer signedness problems.
17088
640ee02d
PE
17089 * lread.c (openp): Don't stuff size_t into an 'int'.
17090 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
17091 about possible signed overflow.
17092
6048fb2a
PE
17093 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
17094 (GDK_KEY_g): Don't define if already defined.
17095 (xg_prepare_tooltip): Avoid pointer signedness problem.
17096 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
17097
fa3c87e1
PE
17098 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
17099 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
17100
2172544b
PE
17101 * xfns.c (Fx_window_property): Simplify a bit,
17102 to make a bit faster and to avoid GCC 4.6.0 warning.
17103 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
17104
9b821a21
PE
17105 * fns.c (internal_equal): Don't assume size_t fits in int.
17106
3c616cfa
PE
17107 * alloc.c (compact_small_strings): Tighten assertion a little.
17108
c2982e87
PE
17109 Replace pEd with more-general pI, and fix some printf arg casts.
17110 * lisp.h (pI): New macro, generalizing old pEd macro to other
17111 conversion specifiers. For example, use "...%"pI"d..." rather
17112 than "...%"pEd"...".
17113 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 17114 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
17115 * alloc.c (check_pure_size): Don't overflow by converting size to int.
17116 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
17117 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
17118 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
17119 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
17120 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
17121 64-bit hosts.
17122 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
17123 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
17124 * print.c (safe_debug_print, print_object): Likewise.
17125 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
17126 to int.
6f04d126
PE
17127 Use pI instead of if-then-else-abort. Use %p to avoid casts,
17128 avoiding the 0 flag, which is not portable.
c2982e87
PE
17129 * process.c (Fmake_network_process): Use pI to avoid cast.
17130 * region-cache.c (pp_cache): Likewise.
17131 * xdisp.c (decode_mode_spec): Likewise.
17132 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
17133 behavior on 64-bit hosts with printf arg.
6f04d126 17134 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
17135 (x_stop_queuing_selection_requests): Likewise.
17136 (x_get_window_property): Don't truncate byte count to an 'int'
17137 when tracing.
0b432f21 17138
5e073ec7
PE
17139 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
17140 here, since it parses constructs like leading '-' and spaces,
17141 which are not wanted; and it overflows with large numbers.
17142 Instead, simply match F[0-9]+, which is what is wanted anyway.
17143
36372bf9
PE
17144 * alloc.c: Remove unportable assumptions about struct layout.
17145 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
17146 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
17147 (allocate_vectorlike, make_pure_vector): Use the new macros,
17148 plus offsetof, to remove unportable assumptions about struct layout.
17149 These assumptions hold on all porting targets that I know of, but
17150 they are not guaranteed, they're easy to remove, and removing them
17151 makes further changes easier.
17152
0b432f21
PE
17153 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
17154 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
17155 (string_overrun_cookie): Now const. Use initializers that
17156 don't formally overflow signed char, to avoid warnings.
000098c1
PE
17157 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
17158 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
17159 (allocate_buffer): Don't assume sizeof (struct buffer) is a
17160 multiple of sizeof (EMACS_INT); it need not be, if
17161 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 17162 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 17163
895009e1
JB
171642011-04-26 Juanma Barranquero <lekktu@gmail.com>
17165
17166 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
17167
6a7a1b0b
TZ
171682011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
17169
17170 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 17171 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
17172 Reported by Paul Eggert <eggert@cs.ucla.edu>.
17173
841a1577 171742011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
17175
17176 * lisp.h (Qdebug): List symbol.
895009e1 17177 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
17178 * keyboard.c (debug-on-event): New variable.
17179 (handle_user_signal): Break into debugger when debug-on-event
17180 matches the current signal symbol.
17181
f2d3ba6f
DN
171822011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
17183
17184 * alloc.c (check_sblock, check_string_bytes)
17185 (check_string_free_list): Convert to standard C.
17186
42ce4c63
TZ
171872011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
17188
17189 * w32.c (emacs_gnutls_push): Fix typo.
17190
825cd63c
EZ
171912011-04-25 Eli Zaretskii <eliz@gnu.org>
17192
fb11d64d
EZ
17193 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
17194 "cast to pointer from integer of different size".
17195
825cd63c
EZ
17196 Improve doprnt and its use in verror. (Bug#8545)
17197 * doprnt.c (doprnt): Document the set of format control sequences
17198 supported by the function. Use SAFE_ALLOCA instead of always
17199 using `alloca'.
17200
17201 * eval.c (verror): Don't limit the buffer size at size_max-1, that
17202 is one byte too soon. Don't use xrealloc; instead xfree and
17203 xmalloc anew.
17204
e061a11b
TZ
172052011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
17206
17207 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
17208 callbacks stage.
17209
17210 * gnutls.c: Renamed global_initialized to
17211 gnutls_global_initialized. Added internals for the
17212 :verify-hostname-error, :verify-error, and :verify-flags
17213 parameters of `gnutls-boot' and documented those parameters in the
17214 docstring. Start callback support.
9173deec
JB
17215 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
17216 unless a fatal error occurred. Call gnutls_alert_send_appropriate
17217 on error. Return error code.
e061a11b
TZ
17218 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
17219 (emacs_gnutls_read): Likewise.
17220 (Fgnutls_boot): Return handshake error code.
17221 (emacs_gnutls_handle_error): New function.
17222 (wsaerror_to_errno): Likewise.
17223
17224 * w32.h (emacs_gnutls_pull): Add prototype.
17225 (emacs_gnutls_push): Likewise.
17226
17227 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
17228 (emacs_gnutls_push): Likewise.
17229
172302011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
17231
17232 * process.c (wait_reading_process_output): Check if GnuTLS
17233 buffered some data internally if no FDs are set for TLS
17234 connections.
17235
17236 * makefile.w32-in (OBJ2): Add gnutls.$(O).
17237 (LIBS): Link to USER_LIBS.
17238 ($(BLD)/gnutls.$(0)): New target.
17239
fa6996bc
EZ
172402011-04-24 Eli Zaretskii <eliz@gnu.org>
17241
eb35682e
EZ
17242 * xdisp.c (handle_single_display_spec): Rename the
17243 display_replaced_before_p argument into display_replaced_p, to
17244 make it consistent with the commentary. Fix typos in the
17245 commentary.
17246
e2ad650c
EZ
17247 * textprop.c (syms_of_textprop): Remove dead code.
17248 (copy_text_properties): Delete obsolete commentary about an
17249 interface that was deleted long ago. Fix typos in the description
17250 of arguments.
17251
1b2de274
EZ
17252 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
17253 to changes in oldXMenu/XMenu.h from 2011-04-16.
17254 <menu_help_message, prev_menu_help_message>: Constify.
17255 (IT_menu_make_room): menu->help_text is now `const char **';
17256 adjust.
17257
17258 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
17259 to changes in oldXMenu/XMenu.h from 2011-04-16.
17260 (struct XMenu): Declare `help_text' `const char **'.
17261
17262 * xfaces.c <Qunspecified>: Make extern again.
17263
17264 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 17265 required by POSIX.
1b2de274 17266
762b15be
EZ
17267 * doc.c (get_doc_string): Improve the format passed to `error'.
17268
17269 * doprnt.c (doprnt): Improve commentary.
17270
17271 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
17272
17273 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
17274 them with etags.
17275
f1052e5d
EZ
17276 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
17277 changes in globals.h immediately force recompilation.
762b15be
EZ
17278 (TAGS): Depend on $(CURDIR)/m/intel386.h and
17279 $(CURDIR)/s/ms-w32.h.
17280 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 17281
fa6996bc
EZ
17282 * character.c (Fchar_direction): Function deleted.
17283 (syms_of_character): Don't defsubr it.
17284 <char-direction-table>: Deleted.
17285
e6c3da20
EZ
172862011-04-23 Eli Zaretskii <eliz@gnu.org>
17287
17288 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
17289 * doprnt.c: Include limits.h.
17290 (SIZE_MAX): New macro.
04f2d78b
CB
17291 (doprnt): Return a size_t value. 2nd arg is now size_t.
17292 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
17293 Improve overflow protection. Support `l' modifier for integer
17294 conversions. Support %l conversion. Don't assume an EMACS_INT
17295 argument for integer conversions and for %c.
17296
17297 * lisp.h (doprnt): Restore prototype.
17298
17299 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
17300 $(SRC)/character.h.
17301
17302 * Makefile.in (base_obj): Add back doprnt.o.
17303
17304 * deps.mk (doprnt.o): Add back prerequisites.
17305 (callint.o): Depend on character.h.
17306
17307 * eval.c (internal_lisp_condition_case): Include the handler
17308 representation in the error message.
17309 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
17310 when breaking from the loop.
17311
17312 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
17313
17314 * callint.c (Fcall_interactively): When displaying error message
17315 about invalid control letter, pass the character's codepoint, not
17316 a pointer to its multibyte form. Improve display of the character
17317 in octal and display also its hex code.
17318
17319 * character.c (char_string): Use %x to display the (unsigned)
17320 codepoint of an invalid character, to avoid displaying a bogus
17321 negative value.
17322
17323 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
17324 `error', not SYMBOL_NAME itself.
17325
17326 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
17327 character arguments to `error'.
17328
17329 * charset.c (check_iso_charset_parameter): Fix incorrect argument
17330 to `error' in error message about FINAL_CHAR argument. Make sure
17331 FINAL_CHAR is a character, and use %c when it is passed as
17332 argument to `error'.
17333
4ffd0d6b 173342011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
17335
17336 * s/ms-w32.h (localtime): Redirect to sys_localtime.
17337
17338 * w32.c: Include <time.h>.
17339 (sys_localtime): New function.
17340
4ffd0d6b 173412011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
17342
17343 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
17344
4ffd0d6b 17345 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 17346
4ffd0d6b 173472011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 17348
4ffd0d6b
GM
17349 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
17350 zombies (Bug#8467).
aac0c6e3 17351
04c56954
EZ
173522011-04-19 Eli Zaretskii <eliz@gnu.org>
17353
17354 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
17355 gl_state.e_property when gl_state.object is Qt.
17356
17357 * insdel.c (make_gap_larger): Remove limitation of buffer size
17358 to <= INT_MAX.
17359
16a43933
CY
173602011-04-18 Chong Yidong <cyd@stupidchicken.com>
17361
17362 * xdisp.c (lookup_glyphless_char_display)
17363 (produce_glyphless_glyph): Handle cons cell entry in
17364 glyphless-char-display.
17365 (Vglyphless_char_display): Document it.
17366
17367 * term.c (produce_glyphless_glyph): Handle cons cell entry in
17368 glyphless-char-display.
17369
4581706e
CY
173702011-04-17 Chong Yidong <cyd@stupidchicken.com>
17371
17372 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
17373
17374 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
17375
17376 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
17377 definition for no-X builds.
17378
4887c6e2 173792011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 17380
fd35b6f9
PE
17381 Static checks with GCC 4.6.0 and non-default toolkits.
17382
5c1ccb01
PE
17383 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
17384
006c5daa
PE
17385 * process.c (keyboard_bit_set): Define only if SIGIO.
17386 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
17387 (send_process): Repair possible setjmp clobbering.
17388
efc736d3
PE
17389 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
17390
4e2fe2e6
PE
17391 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
17392
f97334a2
PE
17393 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
17394
4e75f29d
PE
17395 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
17396 Define only if needed.
17397
90efadd1
PE
17398 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
17399 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 17400 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 17401
3c647824
PE
17402 * dispextern.h (struct redisplay_interface): Rename param
17403 to avoid shadowing.
e264f262 17404 * termhooks.h (struct terminal): Likewise.
761383f4 17405 * xterm.c (xembed_send_message): Likewise.
3c647824 17406
b58c5c4a
PE
17407 * insdel.c (make_gap_smaller): Define only if
17408 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
17409
cad59032
PE
17410 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
17411 it.
17412
c339dc2e
PE
17413 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
17414 so that we aren't warned about unused symbols.
17415
91a3e27b
PE
17416 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
17417
399c71d3 17418 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 17419
8ffc96f5
PE
17420 * xfns.c (x_real_positions): Mark locals as initialized.
17421
eef9bc79
PE
17422 * xmenu.c (xmenu_show): Don't use uninitialized vars.
17423
098db9dd
PE
17424 * xterm.c: Fix problems found by static analysis with other toolkits.
17425 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
17426 (x_dispatch_event): Declare static if USE_GTK, and
17427 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 17428 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 17429 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
17430 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
17431 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 17432
eb18f6cc
PE
17433 * xmenu.c (menu_help_callback): Pointer type fixes.
17434 Use const pointers when pointing at readonly data. Avoid pointer
17435 signedness clashes.
17436 (FALSE): Remove unused macro.
17437 (update_frame_menubar): Remove unused decl.
17438
1fe72bf8
PE
17439 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
17440
60d9e1db
PE
17441 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
17442 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
17443 (single_menu_item): Rename local to avoid shadowing.
17444
39261c26
PE
17445 * keyboard.c (make_lispy_event): Remove unused local var.
17446
018c5e19
PE
17447 * frame.c, frame.h (x_get_resource_string): Bring this back, but
17448 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
17449
63d2b86e
PE
17450 * bitmaps: Change bitmaps from unsigned char back to the X11
17451 compatible char. Avoid the old compiler warnings about
17452 out-of-range initializers by using, for example, '\xab' rather
17453 than 0xab.
17454
aefd87e1
PE
17455 * xgselect.c (xgselect_initialize): Check vs interface
17456 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
17457
bf501fb9
PE
17458 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
17459
e9829fdf
PE
17460 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
17461 to read-only memory.
17462
1086c095
PE
17463 * fns.c (vector): Remove; this old hack is no longer needed.
17464
2baccd04 17465 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 17466 Remove unused var.
dde42981 17467 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 17468
72391843 17469 * xrdb.c (x_load_resources): Omit unused local.
3565b346 17470
436c16df 17471 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 17472 (x_window): Rename locals to avoid shadowing.
dc5ddd85 17473 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 17474
92bb796d 17475 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 17476 (x_term_init): Remove local to avoid shadowing.
92bb796d 17477
764430a3 17478 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
17479
17480 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
17481 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
17482
d1dfb56c
EZ
174832011-04-16 Eli Zaretskii <eliz@gnu.org>
17484
c4354cb4
EZ
17485 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
17486
d1dfb56c
EZ
17487 Fix regex.c, syntax.c and friends for buffers > 2GB.
17488 * syntax.h (struct gl_state_s): Declare character position members
17489 EMACS_INT.
17490
17491 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
17492
04f2d78b
CB
17493 * textprop.c (verify_interval_modification, interval_of):
17494 Declare arguments EMACS_INT.
d1dfb56c
EZ
17495
17496 * intervals.c (adjust_intervals_for_insertion): Declare arguments
17497 EMACS_INT.
17498
17499 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
17500
17501 * indent.c (Fvertical_motion): Local variable it_start is now
17502 EMACS_INT.
17503
17504 * regex.c (re_match, re_match_2, re_match_2_internal)
17505 (bcmp_translate, regcomp, regexec, print_double_string)
17506 (group_in_compile_stack, re_search, re_search_2, regex_compile)
17507 (re_compile_pattern, re_exec): Declare arguments and local
17508 variables `size_t' and `ssize_t' and return values `regoff_t', as
17509 appropriate.
17510 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
17511 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
17512 <compile_stack_type>: `size' and `avail' are now `size_t'.
17513
17514 * regex.h <regoff_t>: Use ssize_t, not int.
17515 (re_search, re_search_2, re_match, re_match_2): Arguments that
17516 specify buffer/string position and length are now ssize_t and
17517 size_t. Return type is regoff_t.
17518
613052cd
BK
175192011-04-16 Ben Key <bkey76@gmail.com>
17520
17521 * nsfont.m: Fixed bugs in ns_get_family and
17522 ns_descriptor_to_entity that were caused by using free to
17523 deallocate memory blocks that were allocated by xmalloc (via
17524 xstrdup). This caused Emacs to crash when compiled with
17525 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
17526 --enable-checking=xmallocoverrun). xfree is now used to
17527 deallocate these memory blocks.
17528
4170f62f 175292011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 17530
71b41406
PE
17531 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
17532
9587a89d
PE
17533 emacs_write: Accept and return EMACS_INT for sizes.
17534 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
17535 et seq.
17536 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
17537 Accept and return EMACS_INT.
17538 (emacs_gnutls_write): Return the number of bytes written on
17539 partial writes.
17540 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
17541 (emacs_read, emacs_write): Remove check for negative size, as the
17542 Emacs source code has been audited now.
9587a89d
PE
17543 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
17544 (emacs_read, emacs_write): Use it.
273a5f82
PE
17545 * process.c (send_process): Adjust to the new signatures of
17546 emacs_write and emacs_gnutls_write. Do not attempt to store
17547 a byte offset into an 'int'; it might overflow.
9587a89d 17548 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 17549
3e047f51
PE
17550 * sound.c: Don't assume sizes fit in 'int'.
17551 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 17552 Return EMACS_INT, not int.
3e047f51 17553 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
17554 Accept EMACS_INT, not int.
17555 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
17556 record read return values.
17557
cc39a9db
BK
175582011-04-15 Ben Key <bkey76@gmail.com>
17559
c9d0ec6d
JB
17560 * keyboard.c (Qundefined): Don't declare static since it is used
17561 in nsfns.m.
17562 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
17563 static since they are used in nsfont.m.
cc39a9db 17564
6c60eb9f
SM
175652011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
17566
17567 * process.c (Qprocessp): Don't declare static.
17568 * lisp.h (Qprocessp): Declare again.
17569
7990b61a
JB
175702011-04-15 Juanma Barranquero <lekktu@gmail.com>
17571
17572 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
17573
5d4cb038
PE
175742011-04-14 Paul Eggert <eggert@cs.ucla.edu>
17575
8bd7b830 17576 Improve C-level modularity by making more things 'static'.
cd64ea1d 17577
e3b27b31
PE
17578 Don't publish debugger-only interfaces to other modules.
17579 * lisp.h (safe_debug_print, debug_output_compilation_hack):
17580 (verify_bytepos, count_markers): Move decls to the only modules
17581 that need them.
17582 * region-cache.h (pp_cache): Likewise.
17583 * window.h (check_all_windows): Likewise.
17584 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
17585
5d4cb038
PE
17586 * sysdep.c (croak): Now static, if
17587 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
17588 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
17589
17590 * alloc.c (refill_memory_reserve): Now static if
17591 !defined REL_ALLOC || defined SYSTEM_MALLOC.
17592 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 17593
e87b6180
PE
17594 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
17595 Define only if USE_LUCID.
17596
ac64929e
PE
17597 * xrdb.c (x_customization_string, x_rm_string): Now static.
17598
6f37259d
PE
17599 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
17600 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
17601
1683e3ab
PE
17602 * xdisp.c (draw_row_with_mouse_face): Now static.
17603 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
17604
de9c2632
PE
17605 * window.h (check_all_windows): Mark externally visible.
17606
2b96acb7
PE
17607 * window.c (window_deletion_count): Now static.
17608
17609 * undo.c: Make symbols static if they're not exported.
17610 (last_undo_buffer, last_boundary_position, pending_boundary):
17611 Now static.
17612
50436f33
PE
17613 * textprop.c (interval_insert_behind_hooks): Now static.
17614 (interval_insert_in_front_hooks): Likewise.
17615
64520e5c
PE
17616 * term.c: Make symbols static if they're not exported.
17617 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
17618 (max_frame_lines, tty_set_terminal_modes):
17619 (tty_reset_terminal_modes, tty_turn_off_highlight):
17620 (get_tty_terminal): Now static.
17621 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
17622 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 17623 HAVE_WINDOW_SYSTEM.
64520e5c
PE
17624 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
17625 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
17626
1fa53021
PE
17627 * sysdep.c: Make symbols static if they're not exported.
17628 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
17629 Now static.
17630 (sigprocmask_set, full_mask): Remove; unused.
17631 (wait_debugging): Mark as visible.
17632 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
17633 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
17634
d4b43b22
PE
17635 * syntax.c (syntax_temp): Define only if !__GNUC__.
17636
b7c513d0
PE
17637 * sound.c (current_sound_device, current_sound): Now static.
17638
989b29ad
PE
17639 * search.c (searchbufs, searchbuf_head): Now static.
17640
13a55a78
PE
17641 * scroll.c (scroll_cost): Remove; unused.
17642 * dispextern.h (scroll_cost): Remove decl.
17643
de68a1fc
PE
17644 * region-cache.h (pp_cache): Mark as externally visible.
17645
40ccffa6
PE
17646 * process.c: Make symbols static if they're not exported.
17647 (process_tick, update_tick, create_process, chan_process):
17648 (Vprocess_alist, proc_buffered_char, datagram_access):
17649 (fd_callback_data, send_process_frame, process_sent_to): Now static.
17650 (deactivate_process): Mark defn as static, as well as decl.
17651 * lisp.h (create_process): Remove decl.
17652 * process.h (chan_process, Vprocess_alist): Remove decls.
17653
ad64fc97
PE
17654 * print.c: Make symbols static if they're not exported.
17655 (print_depth, new_backquote_output, being_printed, print_buffer):
17656 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
17657 (print_interval, print_number_index, initial_stderr_stream):
17658 Now static.
17659 * lisp.h (Fprinc): Remove decl.
17660 (debug_output_compilation_hack): Mark as externally visible.
17661
adddb265
PE
17662 * sysdep.c (croak): Move decl from here to syssignal.h.
17663 * syssignal.h (croak): Put it here, so the API can be checked when
17664 'croak' is called from dissociate_if_controlling_tty.
17665
1717ede2
PE
17666 * minibuf.c: Make symbols static if they're not exported.
17667 (minibuf_save_list, choose_minibuf_frame): Now static.
17668 * lisp.h (choose_minibuf_frame): Remove decl.
17669
fa5fb2bc
PE
17670 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
17671
1e3890d1
PE
17672 * lread.c: Make symbols static if they're not exported.
17673 (read_objects, initial_obarray, oblookup_last_bucket_number):
17674 Now static.
17675 (make_symbol): Remove; unused.
17676 * lisp.h (initial_obarray, make_symbol): Remove decls.
17677
8a1414fa
PE
17678 * keyboard.c: Make symbols static if they're not exported.
17679 (single_kboard, recent_keys_index, total_keys, recent_keys):
17680 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
17681 (this_single_command_key_start, echoing, last_auto_save):
17682 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
17683 (command_loop, echo_now, keyboard_init_hook, help_char_p):
17684 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
17685 (Vlispy_mouse_stem, double_click_count):
17686 Now static.
17687 (force_auto_save_soon): Define only if SIGDANGER.
17688 (ignore_mouse_drag_p): Now static if
17689 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
17690 (print_help): Remove; unused.
17691 (stop_character, last_timer_event): Mark as externally visible.
17692 * keyboard.h (ignore_mouse_drag_p): Declare only if
17693 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
17694 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
17695 * lisp.h (echoing): Remove decl.
17696 (force_auto_save_soon): Declare only if SIGDANGER.
17697 * xdisp.c (redisplay_window): Simplify code, to make it more
17698 obvious that ignore_mouse_drag_p is not accessed if !defined
17699 USE_GTK && !defined HAVE_NS.
17700
93ea6e8f
PE
17701 * intervals.c: Make symbols static if they're not exported.
17702 (merge_properties_sticky, merge_interval_right, delete_interval):
17703 Now static.
17704 * intervals.h (merge_interval_right, delete_interval): Remove decls.
17705
77382fcc
PE
17706 * insdel.c: Make symbols static if they're not exported.
17707 However, leave prepare_to_modify_buffer alone. It's never
17708 called from outside this function, but that appears to be a bug.
17709 (combine_after_change_list, combine_after_change_buffer):
4889fc82 17710 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
17711 (adjust_after_replace_noundo): Remove; unused.
17712 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 17713 (signal_before_change): Remove decls.
77382fcc 17714
9306c32e
PE
17715 * indent.c (val_compute_motion, val_vmotion): Now static.
17716
cd44d2eb
PE
17717 * image.c: Make symbols static if they're not exported.
17718 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
17719 if USE_GTK.
17720 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
17721 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
17722
ad9a7a06
PE
17723 * fringe.c (standard_bitmaps): Now static.
17724 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
17725
81626931
PE
17726 * frame.c: Make symbols static if they're not exported.
17727 (x_report_frame_params, make_terminal_frame): Now static.
17728 (get_frame_param): Now static, unless HAVE_NS.
17729 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
17730 (x_get_resource_string): Remove; not used.
17731 * frame.h (make_terminal_frame, x_report_frame_params):
17732 (x_get_resource_string); Remove decls.
17733 (x_fullscreen_adjust): Declare only if WINDOWSNT.
17734 * lisp.h (get_frame_param): Declare only if HAVE_NS.
17735
239f9db9
PE
17736 * font.c, fontset.c: Make symbols static if they're not exported.
17737 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
17738 (FACE_SUITABLE_FOR_CHAR_P): Use it.
17739 * font.c (font_close_object): Now static.
17740 * font.h (font_close_object): Remove.
17741 * fontset.c (FONTSET_OBJLIST): Remove.
17742 (free_realized_fontset) #if-0 the body, which does nothing.
17743 (face_suitable_for_char_p): #if-0, as it's never called.
17744 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
17745 * xfaces.c (face_at_string_position):
17746 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
17747 since 0 is always ASCII.
17748
dfcf3579
PE
17749 * fns.c (weak_hash_tables): Now static.
17750
5045092b
PE
17751 * fileio.c: Make symbols static if they're not exported.
17752 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
17753 (Vwrite_region_annotation_buffers): Now static.
17754
57a96f5c
PE
17755 * eval.c: Make symbols static if they're not exported.
17756 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
17757 * lisp.h (backtrace_list): Remove decl.
17758
35f08c38
PE
17759 * emacs.c: Make symbols static if they're not exported.
17760 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
17761 (fatal_error_code, fatal_error_signal_hook, standard_args):
17762 Now static.
17763 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
17764 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
17765 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
17766 * lisp.h (fatal_error_signal_hook): Remove decl.
17767 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
17768
f44bd759
PE
17769 * editfns.c: Move a (normally-unused) function to its only use.
17770 * editfns.c, lisp.h (get_operating_system_release): Remove.
17771 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
17772 worth the hassle of breaking this out.
17773
b532497d
PE
17774 * xterm.c: Make symbols static if they're not exported.
17775 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
17776 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
17777 (x_destroy_window, x_delete_display):
17778 Now static.
17779 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
17780 (x_mouse_leave): Remove; unused.
17781 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
17782 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
17783 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
17784 Remove decls.
17785 (x_mouse_leave): Declare only if WINDOWSNT.
17786 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
17787 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
17788 USE_X_TOOLKIT.
17789
1675728f
PE
17790 * ftxfont.c: Make symbols static if they're not exported.
17791 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
17792 HAVE_FREETYPE.
17793 * font.h (ftxfont_driver): Likewise.
17794
e4cebfca
PE
17795 * xfns.c: Make symbols static if they're not exported.
17796 (x_last_font_name, x_display_info_for_name):
17797 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
17798 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
17799 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
17800 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
17801 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
17802 (last_show_tip_args): Now static.
17803 (xic_defaut_fontset, xic_create_fontsetname): Define only if
17804 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
17805 (x_screen_planes): Remove; unused.
17806 * dispextern.h (x_screen_planes): Remove decl.
17807
5bf46f05
PE
17808 * dispnew.c: Make symbols static if they're not exported.
17809 * dispextern.h (redraw_garbaged_frames, scrolling):
17810 (increment_row_positions): Remove.
17811 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
17812 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
17813 Now static.
17814 (redraw_garbaged_frames): Remove; unused.
17815
435f4c28
PE
17816 * xfaces.c: Make symbols static if they're not exported.
17817 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
17818 Remove decls.
17819 * xterm.h (defined_color): Remove decls.
17820 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
17821 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
17822 (menu_face_changed_default, defined_color, free_realized_face):
17823 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
17824 (ascii_face_of_lisp_face): Remove; unused.
17825
8524aef3
PE
17826 * xdisp.c: Make symbols static if they're not exported.
17827 * dispextern.h (scratch_glyph_row, window_box_edges):
17828 (glyph_to_pixel_coords, set_cursor_from_row):
17829 (get_next_display_element, set_iterator_to_next):
17830 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
17831 (show_mouse_face): Remove decls
17832 * frame.h (message_buf_print): Likewise.
17833 * lisp.h (pop_message, set_message, check_point_in_composition):
17834 Likewise.
17835 * xterm.h (set_vertical_scroll_bar): Likewise.
17836 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
17837 (message_buf_print, scratch_glyph_row, displayed_buffer):
17838 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
17839 (get_next_display_element, show_mouse_face, window_box_edges):
17840 (frame_to_window_pixel_xy, check_point_in_composition):
17841 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
17842 (glyph_to_pixel_coords): Remove; unused.
17843
16390cd2
PE
17844 * dired.c (file_name_completion): Now static.
17845
17846 * dbusbind.c (xd_in_read_queued_messages): Now static.
17847
a25f4dfa
PE
17848 * lisp.h (circular_list_error, FOREACH): Remove; unused.
17849 * data.c (circular_list_error): Remove.
17850
14a9c8df
PE
17851 * commands.h (last_point_position, last_point_position_buffer):
17852 (last_point_position_window): Remove decls.
17853 * keyboard.c: Make these variables static.
17854
04f2d78b
CB
17855 * coding.h (coding, code_convert_region, encode_coding_gap):
17856 Remove decls.
74ab6df5
PE
17857 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
17858 (iso_code_class, detect_coding, code_convert_region): Now static.
17859 (encode_coding_gap): Remove; unused.
17860
38dfbee1
PE
17861 * chartab.c (chartab_chars, chartab_bits): Now static.
17862
a2cb4e63
PE
17863 * charset.h (charset_iso_8859_1): Remove decl.
17864 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
17865 Now static.
17866
127198fd
PE
17867 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
17868 * ccl.c (Vccl_program_table): Now static.
17869 (check_ccl_update): Remove; unused.
17870
d85b608f
PE
17871 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
17872 * category.h: ... from here.
17873 * category.c (check_category_table, set_category_set): Now static.
17874
31cd66f3
PE
17875 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
17876 * lisp.h: Remove these decls.
17877
c358e587
PE
17878 * buffer.c (buffer_count): Remove unused var.
17879
e78aecca
PE
17880 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
17881 so that it's not optimized away.
17882 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
17883 * dispextern.h (bidi_dump_cached_states): Remove, since it's
17884 exported only to the debugger.
17885
e192d7d3 17886 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 17887 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 17888
92470028
PE
17889 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
17890 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
17891 was inaccessible from Lisp.
17892 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
17893 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
17894
244ed907
PE
17895 alloc.c: Import and export fewer symbols, and remove unused items.
17896 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
17897 is defined.
17898 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
17899 it's not optimized away by whole-program optimization.
17900 (message_enable_multibyte, free_misc): Remove.
17901 (catchlist, handlerlist, mark_backtrace):
17902 Declare only if BYTE_MARK_STACK.
17903 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
17904 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
17905 (message_enable_multibyte): Remove decl.
17906 (free_misc, interval_free_list, float_block, float_block_index):
17907 (n_float_blocks, float_free_list, cons_block, cons_block_index):
17908 (cons_free_list, last_marked_index):
17909 Now static.
17910 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
17911 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
17912 (mark_backtrace): Define only if BYTE_MARK_STACK.
17913 * xdisp.c (message_enable_multibyte): Now static.
17914
61c2b50e 17915 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
17916 This makes it easier for human readers (and static analyzers)
17917 to see whether these variables are used from other modules.
17918 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
17919 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
17920 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
17921 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
17922 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
17923 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
17924 * xmenu.c, xselect.c:
17925 Declare Q* vars static if they are not used in other modules.
17926 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
17927 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
17928 Remove decls of unexported vars.
17929 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
17930
95c82688
PE
17931 * lisp.h (DEFINE_FUNC): Make sname 'static'.
17932
16a97296
PE
17933 Make Emacs functions such as Fatom 'static' by default.
17934 This makes it easier for human readers (and static analyzers)
17935 to see whether these functions can be called from other modules.
17936 DEFUN now defines a static function. To make the function external
17937 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
17938 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
17939 (Finit_image_library):
16a97296
PE
17940 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
17941 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
17942 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
17943 Remove decls, since these functions are now static.
17944 (Funintern, Fget_internal_run_time): New decls, since these functions
17945 were already external.
95c82688 17946
16a97296
PE
17947 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
17948 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
17949 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
17950 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
17951 * keyboard.c, keymap.c, lread.c:
17952 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
17953 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
17954 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
17955 Mark functions with DEFUE instead of DEFUN,
17956 if they are used in other modules.
17957 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
17958 decls for now-static functions.
17959 * buffer.h (Fdelete_overlay): Remove decl.
17960 * callproc.c (Fgetenv_internal): Mark as internal.
17961 * composite.c (Fremove_list_of_text_properties): Remove decl.
17962 (Fcomposition_get_gstring): New forward static decl.
17963 * composite.h (Fcomposite_get_gstring): Remove decl.
17964 * dired.c (Ffile_attributes): New forward static decl.
17965 * doc.c (Fdocumntation_property): New forward static decl.
17966 * eval.c (Ffetch_bytecode): New forward static decl.
17967 (Funintern): Remove extern decl; now in .h file where it belongs.
17968 * fileio.c (Fmake_symbolic_link): New forward static decl.
17969 * image.c (Finit_image_library): New forward static decl.
17970 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
17971 * intervals.h (Fprevious_property_change):
17972 (Fremove_list_of_text_properties): Remove decls.
17973 * keyboard.c (Fthis_command_keys): Remove decl.
17974 (Fcommand_execute): New forward static decl.
17975 * keymap.c (Flookup_key): New forward static decl.
17976 (Fcopy_keymap): Now static.
17977 * keymap.h (Flookup_key): Remove decl.
17978 * process.c (Fget_process): New forward static decl.
17979 (Fprocess_datagram_address): Mark as internal.
17980 * syntax.c (Fsyntax_table_p): New forward static decl.
17981 (skip_chars): Remove duplicate decl.
17982 * textprop.c (Fprevious_property_change): New forward static decl.
17983 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
17984 Now internal.
17985 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
17986 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
17987
785bbd42
PE
17988 * editfns.c (Fformat): Remove unreachable code.
17989
8b913b57
AS
179902011-04-14 Andreas Schwab <schwab@linux-m68k.org>
17991
17992 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
17993 change. (Bug#8496)
17994
a6744a35
EZ
179952011-04-13 Eli Zaretskii <eliz@gnu.org>
17996
17997 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
17998 when at ZV. (Bug#8487)
17999
e7974947
AS
180002011-04-12 Andreas Schwab <schwab@linux-m68k.org>
18001
baad03f0
AS
18002 * charset.c (Fclear_charset_maps): Use xfree instead of free.
18003 (Bug#8437)
18004 * keyboard.c (parse_tool_bar_item): Likewise.
18005 * sound.c (sound_cleanup, alsa_close): Likewise.
18006 * termcap.c (tgetent): Likewise.
18007 * xfns.c (x_default_font_parameter): Likewise.
18008 * xsettings.c (read_and_apply_settings): Likewise.
18009
e7974947
AS
18010 * alloc.c (overrun_check_malloc, overrun_check_realloc)
18011 (overrun_check_free): Protoize.
18012
28272684
PE
180132011-04-12 Paul Eggert <eggert@cs.ucla.edu>
18014
18015 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
18016 since callers should never pass a negative size.
18017 Change the signature to match that of plain 'read' and 'write'; see
18018 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
18019 * lisp.h: Update prototypes of emacs_write and emacs_read.
18020
11997c76
EZ
180212011-04-11 Eli Zaretskii <eliz@gnu.org>
18022
18023 * xdisp.c (redisplay_window): Don't try to determine the character
18024 position of the scroll margin if the window start point w->startp
e896f03c 18025 is outside the buffer's accessible region. (Bug#8468)
11997c76 18026
8a2cbd72
EZ
180272011-04-10 Eli Zaretskii <eliz@gnu.org>
18028
18029 Fix write-region and its subroutines for buffers > 2GB.
18030 * fileio.c (a_write, e_write): Modify declaration of arguments and
18031 local variables to support buffers larger than 2GB.
18032 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
18033
18034 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
18035 argument, local variables, and return value.
18036
18037 * lisp.h: Update prototypes of emacs_write and emacs_read.
18038
18039 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
18040
4073e537 180412011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 18042
1ebfdcb6
PE
18043 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
18044
b2ded58d
PE
18045 Fix more problems found by GCC 4.6.0's static checks.
18046
7d66342c
PE
18047 * xdisp.c (vmessage): Use a better test for character truncation.
18048
bbf47d44
PE
18049 * charset.c (load_charset_map): <, not <=, for optimization,
18050 and to avoid potential problems with integer overflow.
9248994d 18051 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 18052 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 18053 * editfns.c (Fformat): Likewise.
1e69125e 18054 * syntax.c (skip_chars): Likewise.
3befa583 18055
e3019616
PE
18056 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
18057 This also lets GCC 4.6.0 generate slightly better loop code.
18058
becfa255
PE
18059 * callint.c (Fcall_interactively): <, not <=, for optimization.
18060 (Fcall_interactively): Count the number of arguments produced,
18061 not the number of arguments given. This is simpler and lets GCC
18062 4.6.0 generate slightly better code.
18063
dae0cd48
PE
18064 * ftfont.c: Distingish more carefully between FcChar8 and char.
18065 The previous code passed unsigned char * to a functions like
18066 strlen and xstrcasecmp that expect char *, which does not
18067 conform to the C standard.
18068 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
18069 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
18070 char * when the C standard requires it.
18071
76032d70
PE
18072 * keyboard.c (read_char): Remove unused var.
18073
eb3f1cc8
PE
18074 * eval.c: Port to Windows vsnprintf (Bug#8435).
18075 Include <limits.h>.
18076 (SIZE_MAX): Define if the headers do not.
18077 (verror): Do not give up if vsnprintf returns a negative count.
18078 Instead, grow the buffer. This ports to Windows vsnprintf, which
18079 does not conform to C99. Problem reported by Eli Zaretskii.
18080 Also, simplify the allocation scheme, by avoiding the need for
18081 calling realloc, and removing the ALLOCATED variable.
18082
70476b54
PE
18083 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
18084
12020a9e
PE
18085 Remove invocations of doprnt, as Emacs now uses vsnprintf.
18086 But keep the doprint source code for now, as we might revamp it
18087 and use it again (Bug#8435).
ea6c7ae6
PE
18088 * lisp.h (doprnt): Remove.
18089 * Makefile.in (base_obj): Remove doprnt.o.
18090 * deps.mk (doprnt.o): Remove.
18091
5fdb398c
PE
18092 error: Print 32- and 64-bit integers portably (Bug#8435).
18093 Without this change, on typical 64-bit hosts error ("...%d...", N)
18094 was used to print both 32- and 64-bit integers N, which relied on
18095 undefined behavior.
61bdb816 18096 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
18097 * lisp.h (error, verror): Mark as printf-like functions.
18098 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
18099 Report overflow in size calculations when allocating printf buffer.
18100 Do not truncate output string at its first null byte.
18101 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
18102 Truncate the output at a character boundary, since vsnprintf does not
18103 do that.
18104 * charset.c (check_iso_charset_parameter): Convert internal
18105 character to string before calling 'error', since %c now has the
18106 printf meaning.
18107 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
18108 overflow when computing char to be passed to 'error'. Do not
18109 pass Lisp_Object to 'error'; pass the integer instead.
18110 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
18111 formatted with plain %d.
18112
b189fa66
PE
18113 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
18114
bff87ef0
PE
18115 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
18116
7e2cac20
PE
18117 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
18118
ce4d90b5
PE
18119 * xterm.c (x_catch_errors): Remove duplicate declaration.
18120
266c9547
PE
18121 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
18122
79c49ad2
PE
18123 * xdisp.c, lisp.h (message_nolog): Remove; unused.
18124
368f4090
JM
181252011-04-10 Jim Meyering <meyering@redhat.com>
18126
18127 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
18128 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
18129 return ssize_t not "int", and use size_t as the buffer length.
18130 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
18131 * gnutls.h: Update declarations.
18132 * process.c (read_process_output): Use ssize_t, to match.
18133 (send_process): Likewise.
18134
a32d4040
CY
181352011-04-09 Chong Yidong <cyd@stupidchicken.com>
18136
18137 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
18138
8546720e 181392011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 18140
04f2d78b
CB
18141 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
18142 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 18143
8546720e
GM
18144 * xterm.c (handle_one_xevent):
18145 * xmenu.c (create_and_show_popup_menu):
18146 * xselect.c (x_decline_selection_request)
18147 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 18148
0a2f5c1a 181492011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
18150
18151 Fix some uses of `int' instead of EMACS_INT.
18152 * search.c (string_match_1, fast_string_match)
18153 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
18154 (scan_buffer, find_next_newline_no_quit)
18155 (find_before_next_newline, search_command, Freplace_match)
18156 (Fmatch_data): Make some `int' variables be EMACS_INT.
18157
18158 * xdisp.c (display_count_lines): 3rd argument and return value now
18159 EMACS_INT. All callers changed.
18160 (pint2hrstr): Last argument is now EMACS_INT.
18161
18162 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
18163 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
18164 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
18165 (decode_coding_utf_16, decode_coding_emacs_mule)
18166 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
18167 (decode_coding_ccl, decode_coding_charset)
18168 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
18169 (decode_coding_iso_2022, decode_coding_emacs_mule)
18170 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
18171 <char_offset, last_offset>: Declare EMACS_INT.
18172 (encode_coding_utf_8, encode_coding_utf_16)
18173 (encode_coding_emacs_mule, encode_invocation_designation)
18174 (encode_designation_at_bol, encode_coding_iso_2022)
18175 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
18176 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
18177 Declare EMACS_INT.
18178 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
18179 (encode_invocation_designation): Last argument P_NCHARS is now
18180 EMACS_INT.
18181 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
18182 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
18183
18184 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
18185 All users changed.
18186
18187 * ccl.c (Fccl_execute_on_string): Declare some variables
18188 EMACS_INT.
18189
8546720e 181902011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
18191
18192 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
18193
4e19a977
CS
181942011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
18195
18196 * process.c (Fformat_network_address): Doc fix.
18197
87302331
R
181982011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
18199
ee7683eb 18200 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 18201
cbb59342
CY
182022011-04-08 Chong Yidong <cyd@stupidchicken.com>
18203
18204 * keyboard.c (read_char): Call Lisp function help-form-show,
18205 instead of using internal_with_output_to_temp_buffer.
18206 (Qhelp_form_show): New var.
e0d38eeb 18207 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
18208
18209 * print.c (internal_with_output_to_temp_buffer): Function deleted.
18210
18211 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
18212
e67a13ab
CY
182132011-04-06 Chong Yidong <cyd@stupidchicken.com>
18214
04f2d78b
CB
18215 * process.c (Flist_processes): Remove to Lisp.
18216 (list_processes_1): Delete.
e67a13ab 18217
973f782d
EZ
182182011-04-06 Eli Zaretskii <eliz@gnu.org>
18219
7c106b1e
EZ
18220 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
18221
973f782d
EZ
18222 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
18223
41cf7d1a 182242011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 18225
ca23cc88
PE
18226 Fix more problems found by GCC 4.6.0's static checks.
18227
f390e2d5
PE
18228 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
18229
42eea0d0
PE
18230 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
18231
b69769da 18232 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 18233
f9541e84
PE
18234 * xdisp.c (vmessage): Mark as a printf-like function.
18235
13841b55
PE
18236 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
18237
c136c10f
PE
18238 * sound.c (sound_warning): Don't crash if arg contains a printf format.
18239
5e2d4a30
PE
18240 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
18241 printf-like functions.
18242 (tiff_load): Add casts to remove these marks before passing them
18243 to system-supplied API.
18244
583f48b9
PE
18245 * eval.c (Fsignal): Remove excess argument to 'fatal'.
18246
b25d760e
PE
18247 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
18248 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
18249 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
18250 directly, rather than having caller test rule sign. This avoids
18251 some unnecessary tests.
18252 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
18253 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
18254 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 18255
bc7b6697 18256 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 18257 (xfont_open): Avoid unnecessary tests.
bc7b6697 18258
27ccc379
PE
18259 * composite.c (composition_gstring_put_cache): Use unsigned integer.
18260
dcd5c89a
PE
18261 * composite.h, composite.c (composition_gstring_put_cache):
18262 Use EMACS_INT, not int, for length.
18263
b13a45c6
PE
18264 * composite.h (COMPOSITION_DECODE_REFS): New macro,
18265 breaking out part of COMPOSITION_DECODE_RULE.
18266 (COMPOSITION_DECODE_RULE): Use it.
18267 * composite.c (get_composition_id): Remove unused local vars,
18268 by using the new macro.
18269
1e792e4d
PE
18270 * textprop.c (set_text_properties_1): Change while to do-while,
18271 since the condition is always true at first.
18272
dc6c6455 18273 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
18274 (interval_deletion_adjustment): Return unsigned value.
18275 All uses changed.
dc6c6455 18276
aba7731a
PE
18277 * process.c (list_processes_1, create_pty, read_process_output):
18278 (exec_sentinel): Remove vars that were set but not used.
afd4052b 18279 (create_pty): Remove unnecessary "volatile"s.
bc57d757 18280 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 18281 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 18282 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 18283
fdfc4bf3
PE
18284 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
18285
fca8fe46 18286 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 18287 (update_syntax_table): Use unsigned instead of int.
fca8fe46 18288
06a0259a 18289 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 18290 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 18291 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 18292
e7b9e80f
PE
18293 * print.c (print_error_message): Avoid int overflow.
18294
56201685
PE
18295 * font.c (font_list_entities): Redo for clarity,
18296 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
18297
78834453 18298 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 18299 (font_score): Avoid potential overflow in diff calculation.
78834453 18300
0bc0b309 18301 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 18302 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 18303
e610eaca
PE
18304 * eval.c (funcall_lambda): Rename local to avoid shadowing.
18305
b895abce
PE
18306 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
18307 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
18308 can always succeed if overflow has undefined behavior.
18309
1f1d9321 18310 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 18311 (wordify): Omit three unnecessary tests.
1f1d9321 18312
c59478bc
PE
18313 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
18314 All callers changed. This avoids the need for an unused var.
18315
79b73827
PE
18316 * casefiddle.c (casify_region): Remove var that is set but not used.
18317
a4db5dfe
PE
18318 * dired.c (file_name_completion): Remove var that is set but not used.
18319
43aae36e
PE
18320 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
18321
2a47c44d 18322 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 18323 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 18324
a37c69bf
PE
18325 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
18326 Check for integer overflow on size calculations.
18327
328ab8e7
PE
18328 * buffer.c (Fprevious_overlay_change): Remove var that is set
18329 but not used.
18330
e5a2a5cb
PE
18331 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
18332 Remove vars that are set but not used.
8d84a6eb 18333 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 18334 (timer_check_2): Mark vars as initialized.
e5a2a5cb 18335
a60e5f68
PE
18336 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
18337
f661cb61 18338 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 18339 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 18340
f0397f5a
PE
18341 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
18342 that are set but not used.
18343
8664db06 18344 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 18345 if XCreateBitmapFromData fails (Bug#8410).
8664db06 18346
6abdaa4a
PE
18347 * xselect.c (x_get_local_selection, x_handle_property_notify):
18348 Remove vars that are set but not used.
18349
0ce7538d 18350 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 18351 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 18352
9ae848fc
PE
18353 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
18354 Remove var that is set but not used.
0b918413
PE
18355 (scroll_bar_windows_size): Now size_t, not int.
18356 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
18357 Check for overflow.
9ae848fc 18358
a5a62657
PE
18359 * xfaces.c (realize_named_face): Remove vars that are set but not used.
18360 (map_tty_color) [!defined MSDOS]: Likewise.
18361
5c5cdd39
PE
18362 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
18363
66ebf983
PE
18364 * coding.c: Remove vars that are set but not used.
18365 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
18366 All callers changed.
18367 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
18368 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
18369 (decode_coding_charset): Remove vars that are set but not used.
18370
1be4d761
PE
18371 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
18372 that is set but not used.
18373
47553fa8
PE
18374 * print.c (print_object): Remove var that is set but not used.
18375
1f7196bf 18376 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
18377 The gnulib version avoids calling malloc in the usual case,
18378 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
18379 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
18380 * filelock.c (current_lock_owner): Likewise.
18381 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
18382 * sysdep.c: Include allocator.h, careadlinkat.h.
18383 (emacs_no_realloc_allocator): New static constant.
18384 (emacs_readlink): New function.
fdb61804
PE
18385 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
18386 ../lib/careadlinkat.h.
d1fdcab7 18387
f84c17c7
SM
183882011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
18389
18390 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
18391 first non-nil return value).
18392
ef3862ad
JD
183932011-04-03 Jan Djärv <jan.h.d@swipnet.se>
18394
18395 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
18396 if not defined (Bug#8403).
18397
376a7006
JB
183982011-04-02 Juanma Barranquero <lekktu@gmail.com>
18399
18400 * xdisp.c (display_count_lines): Remove parameter `start',
18401 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18402 (get_char_face_and_encoding): Remove parameter `multibyte_p',
18403 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18404 (fill_stretch_glyph_string): Remove parameters `row' and `area',
18405 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
18406 and thereabouts. All callers changed.
18407 (get_per_char_metric): Remove parameter `f', unused since
18408 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
18409
6ca3801d
JM
184102011-04-02 Jim Meyering <meyering@redhat.com>
18411
18412 do not dereference NULL upon failed strdup
18413 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
18414 (ns_get_family): Likewise.
18415
d8e2b5ba
JB
184162011-04-02 Juanma Barranquero <lekktu@gmail.com>
18417
18418 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
18419
8c74fcbd
JD
184202011-04-02 Jan Djärv <jan.h.d@swipnet.se>
18421
18422 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
18423 later (Bug#8403).
18424
7200d79c
SM
184252011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
18426
03408648 18427 Add lexical binding.
7200d79c 18428
03408648
SM
18429 * window.c (Ftemp_output_buffer_show): New fun.
18430 (Fsave_window_excursion):
18431 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
18432
18433 * lread.c (lisp_file_lexically_bound_p): New function.
18434 (Fload): Bind Qlexical_binding.
18435 (readevalloop): Remove `evalfun' arg.
18436 Bind Qinternal_interpreter_environment.
18437 (Feval_buffer): Bind Qlexical_binding.
18438 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
18439 Mark as dynamic.
18440 (syms_of_lread): Declare `lexical-binding'.
18441
18442 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
18443
18444 * keyboard.c (eval_dyn): New fun.
18445 (menu_item_eval_property): Use it.
ca105506
SM
18446
18447 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 18448
03408648
SM
18449 * fns.c (concat, mapcar1): Accept byte-code-functions.
18450
18451 * eval.c (Fsetq): Handle lexical vars.
18452 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
18453 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
18454 (FletX, Flet): Obey lexical binding.
18455 (Fcommandp): Handle closures.
18456 (Feval): New `lexical' arg.
18457 (eval_sub): New function extracted from Feval. Use it almost
18458 everywhere where Feval was used. Look up vars in lexical env.
18459 Handle closures.
18460 (Ffunctionp): Move from subr.el.
18461 (Ffuncall): Handle closures.
18462 (apply_lambda): Remove `eval_flags'.
18463 (funcall_lambda): Handle closures and new byte-code-functions.
18464 (Fspecial_variable_p): New function.
18465 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
18466 but without exporting it to Lisp.
23aba0ea 18467
23aba0ea 18468 * doc.c (Fdocumentation, store_function_docstring):
03408648 18469 * data.c (Finteractive_form): Handle closures.
23aba0ea 18470
03408648
SM
18471 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
18472 interactive spec.
ba83908c 18473
04f2d78b
CB
18474 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
18475 New byte-codes.
03408648
SM
18476 (exec_byte_code): New function extracted from Fbyte_code to handle new
18477 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 18478
03408648 18479 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 18480
03408648 18481 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 18482
e2abce01
JB
184832011-03-31 Juanma Barranquero <lekktu@gmail.com>
18484
18485 * xdisp.c (redisplay_internal): Fix prototype.
18486
63696a73 184872011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 18488
63696a73 18489 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
18490 (try_scrolling): Use it when setting scroll_limit.
18491 Limit scrolling to 100 screen lines.
63696a73
EZ
18492 (redisplay_window): Even when falling back on "recentering",
18493 position point in the window according to scroll-conservatively,
18494 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
18495
18496 (try_scrolling): When point is above the window, allow searching
18497 as far as scroll_max, or one screenful, to compute vertical
18498 distance from PT to the scroll margin position. This prevents
18499 try_scrolling from unnecessarily failing when
18500 scroll-conservatively is set to a value slightly larger than the
18501 window height. Clean up the case of PT below the margin at bottom
18502 of window: scroll_max can no longer be INT_MAX. When aggressive
18503 scrolling is in use, don't let point enter the opposite scroll
18504 margin as result of the scroll.
18505 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
18506 threshold of 100 lines for never-recentering scrolling.
18507
e4cc2dfc
JB
185082011-03-31 Juanma Barranquero <lekktu@gmail.com>
18509
18510 * dispextern.h (move_it_by_lines):
18511 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
18512 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
18513 (message_log_check_duplicate): Remove parameters `prev_bol' and
18514 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
18515 (redisplay_internal): Remove parameter `preserve_echo_area',
18516 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
18517
18518 * indent.c (Fvertical_motion):
18519 * window.c (window_scroll_pixel_based, Frecenter):
18520 Don't pass `need_y_p' to `move_it_by_lines'.
18521
1c470562
SM
185222011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
18523
44f230aa
SM
18524 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
18525 steal a few bits to be more compact.
18526 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
18527 Remove unneeded casts.
18528
1c470562
SM
18529 * bytecode.c (Fbyte_code): CAR and CDR can GC.
18530
888adce9
ZK
185312011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
18532
18533 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
18534 binding" message (bug#7967).
18535
f838ed7b
PE
185362011-03-30 Paul Eggert <eggert@cs.ucla.edu>
18537
77861b95
PE
18538 Fix more problems found by GCC 4.6.0's static checks.
18539
de6dbc14
PE
18540 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
18541 Remove unused local var.
18542
f838ed7b
PE
18543 * editfns.c (Fmessage_box): Remove unused local var.
18544
792c7b2b
PE
18545 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
18546 (note_mode_line_or_margin_highlight, note_mouse_highlight):
18547 Omit unused local vars.
c499e557 18548 * window.c (shrink_windows): Omit unused local var.
b01a1c29 18549 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
18550 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
18551 Omit unused local var.
18552
ba0165e1
PE
18553 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
18554 Don't assume string length fits in int.
32ad8845 18555 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 18556 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 18557
3c59b4c9
PE
18558 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
18559 instead of alloca (Bug#8344).
18560
a3eed478 18561 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 18562 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 18563
eb4d412d
PE
18564 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
18565
1658b401
PE
18566 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
18567 concerns.
18568
18569 * term.c (produce_glyphless_glyph): Remove unnecessary test.
18570
18571 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 18572
9a2c6e05
PE
18573 * keyboard.c (syms_of_keyboard): Use the same style as later
18574 in this function when indexing through an array. This also
18575 works around GCC bug 48267.
18576
03d0a109
PE
18577 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
18578
44f730c8
PE
18579 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
18580
fe75f926
PE
18581 * chartab.c (sub_char_table_ref_and_range): Redo for slight
18582 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
18583
ffa8c828
PE
18584 * keyboard.c, keyboard.h (num_input_events): Now size_t.
18585 This avoids undefined behavior on integer overflow, and is a bit
18586 more convenient anyway since it is compared to a size_t variable.
18587
c5101a77
PE
18588 Variadic C functions now count arguments with size_t, not int.
18589 This avoids an unnecessary limitation on 64-bit machines, which
18590 caused (substring ...) to crash on large vectors (Bug#8344).
18591 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
18592 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 18593 All variadic functions and their callers changed accordingly.
c5101a77
PE
18594 (struct gcpro.nvars): Now size_t, not int. All uses changed.
18595 * data.c (arith_driver, float_arith_driver): Likewise.
18596 * editfns.c (general_insert_function): Likewise.
18597 * eval.c (struct backtrace.nargs, interactive_p)
18598 (internal_condition_case_n, run_hook_with_args, apply_lambda)
18599 (funcall_lambda, mark_backtrace): Likewise.
18600 * fns.c (concat): Likewise.
18601 * frame.c (x_set_frame_parameters): Likewise.
18602 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
18603 0 if not found, not -1. All callers changed.
18604
dd3f25f7
PE
18605 * alloc.c (garbage_collect): Don't assume stack size fits in int.
18606 (stack_copy_size): Now size_t, not int.
18607 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
18608
461c2ab9
JB
186092011-03-28 Juanma Barranquero <lekktu@gmail.com>
18610
18611 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
18612 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18613 All callers changed.
18614
18615 * lisp.h (multibyte_char_to_unibyte):
18616 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
18617 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
18618 * character.h (CHAR_TO_BYTE8):
18619 * cmds.c (internal_self_insert):
18620 * editfns.c (general_insert_function):
18621 * keymap.c (push_key_description):
18622 * search.c (Freplace_match):
18623 * xdisp.c (message_dolog, set_message_1): All callers changed.
18624
f6d62986
SM
186252011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
18626
18627 * keyboard.c (safe_run_hook_funcall): New function.
18628 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
18629 don't set the hook to nil, but remove the offending function instead.
18630 (Qcommand_hook_internal): Remove, unused.
18631 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
18632 Vcommand_hook_internal.
18633
18634 * eval.c (enum run_hooks_condition): Remove.
18635 (funcall_nil, funcall_not): New functions.
18636 (run_hook_with_args): Call each function through a `funcall' argument.
18637 Remove `cond' argument, now redundant.
18638 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
18639 (Frun_hook_with_args_until_failure): Adjust accordingly.
18640 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
18641
1db5b1ad
JB
186422011-03-28 Juanma Barranquero <lekktu@gmail.com>
18643
18644 * dispextern.h (string_buffer_position): Remove declaration.
18645
18646 * print.c (strout): Remove parameter `multibyte', unused since
18647 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
18648
18649 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
18650 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
18651 All callers changed.
18652
18653 * w32.c (_wsa_errlist): Use braces for struct initializers.
18654
18655 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
18656 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
18657 All callers changed.
18658 (string_buffer_position): Likewise. Also, make static (it's never
18659 used outside xdisp.c).
18660 (cursor_row_p): Remove parameter `w', unused since
18661 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
18662 (decode_mode_spec): Remove parameter `precision', introduced during
18663 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
18664 All callers changed.
18665
5ffb62aa
JD
186662011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18667
18668 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
18669
461c2ab9 186702011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
18671
18672 * nsterm.m (ns_menu_bar_is_hidden): New variable.
18673 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
18674 (ns_update_auto_hide_menu_bar): New functions.
18675 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
18676 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
18677 ns_constrain_all_frames.
18678 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
18679 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
18680
5c380ffb
JD
186812011-03-27 Jan Djärv <jan.h.d@swipnet.se>
18682
18683 * nsmenu.m (runDialogAt): Remove argument to timer_check.
18684
9af30bdf
GM
186852011-03-27 Glenn Morris <rgm@gnu.org>
18686
18687 * syssignal.h: Replace RETSIGTYPE with void.
18688 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
18689 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
18690 Replace SIGTYPE with void everywhere.
18691 * s/usg5-4-common.h (SIGTYPE): Remove definition.
18692 * s/template.h (SIGTYPE): Remove commented out definition.
18693
e2abce01
JB
186942011-03-26 Eli Zaretskii <eliz@gnu.org>
18695
18696 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
18697 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
18698
f868cd8a
JB
186992011-03-26 Juanma Barranquero <lekktu@gmail.com>
18700
59eb0929
JB
18701 * w32.c (read_unc_volume): Use parameter `henum', instead of
18702 global variable `wget_enum_handle'.
18703
18704 * keymap.c (describe_vector): Remove parameters `indices' and
18705 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
18706 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
18707
f868cd8a
JB
18708 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
18709
18710 * keyboard.c (timer_check): Remove parameter `do_it_now',
18711 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
18712 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
18713 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
18714
18715 * keyboard.c (read_char):
18716 * w32menu.c (w32_menu_display_help):
18717 * xmenu.c (show_help_event, menu_help_callback):
18718 Adjust calls to `show_help_echo'.
18719
18720 * gtkutil.c (xg_maybe_add_timer):
18721 * keyboard.c (readable_events):
18722 * process.c (wait_reading_process_output):
18723 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
18724
18725 * insdel.c (adjust_markers_gap_motion):
18726 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
18727 (gap_left, gap_right): Don't call it.
18728
2ecf6fdb
CY
187292011-03-25 Chong Yidong <cyd@stupidchicken.com>
18730
18731 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
18732 incurred during fontification.
18733
6b1f9ba4
JB
187342011-03-25 Juanma Barranquero <lekktu@gmail.com>
18735
18736 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
18737 (DEFVAR_PER_BUFFER): Don't pass it.
18738
18739 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
18740 (scrolling_window): Don't pass it.
18741
0f4a96b5
JB
187422011-03-25 Juanma Barranquero <lekktu@gmail.com>
18743
18744 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
18745
18746 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
18747 and `suffix'.
18748 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
18749 of variables specific to SELinux and computation of `encoded_absname'.
18750
18751 * image.c (XPutPixel): Remove unused variable `height'.
18752
18753 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
18754
18755 * unexw32.c (get_section_info): Remove unused variable `section'.
18756
18757 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
18758 (system_process_attributes): Remove unused variable `sess'.
18759 (sys_read): Remove unused variable `err'.
18760
18761 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
18762 (w32_wnd_proc): Remove unused variable `isdead'.
18763 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
18764 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
18765 (x_create_tip_frame): Remove unused variable `tem'.
18766
18767 * w32inevt.c (w32_console_read_socket):
18768 Remove unused variable `no_events'.
18769
18770 * w32term.c (x_draw_composite_glyph_string_foreground):
18771 Remove unused variable `width'.
18772
1149507c
JB
187732011-03-24 Juanma Barranquero <lekktu@gmail.com>
18774
18775 * w32term.c (x_set_glyph_string_clipping):
18776 Don't pass uninitialized region to CombineRgn.
18777
9c88f339
JB
187782011-03-23 Juanma Barranquero <lekktu@gmail.com>
18779
18780 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
18781 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
18782 (Fx_close_connection): Remove unused variable `i'.
18783
18784 * w32font.c (w32font_draw): Return number of glyphs.
18785 (w32font_open_internal): Remove unused variable `i'.
18786 (w32font_driver): Add missing initializer.
18787
18788 * w32menu.c (utf8to16): Remove unused variable `utf16'.
18789 (fill_in_menu): Remove unused variable `items_added'.
18790
18791 * w32term.c (last_mouse_press_frame): Remove static global variable.
18792 (w32_clip_to_row): Remove unused variable `f'.
18793 (x_delete_terminal): Remove unused variable `i'.
18794
18795 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
18796 (NOTHING): Remove unused static global variable.
18797 (uniscribe_check_otf): Remove unused variable `table'.
18798 (uniscribe_font_driver): Add missing initializers.
18799
dee091a3
JD
188002011-03-23 Julien Danjou <julien@danjou.info>
18801
18802 * term.c (Fsuspend_tty, Fresume_tty):
18803 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
18804 * window.c (temp_output_buffer_show):
18805 * insdel.c (signal_before_change):
18806 * frame.c (Fhandle_switch_frame):
18807 * fileio.c (Fdo_auto_save):
18808 * emacs.c (Fkill_emacs):
18809 * editfns.c (save_excursion_restore):
18810 * cmds.c (internal_self_insert):
18811 * callint.c (Fcall_interactively):
18812 * buffer.c (Fkill_all_local_variables):
18813 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
18814 Use Frun_hooks.
0f4a96b5 18815 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 18816 unconditionally since it does the check itself.
dee091a3 18817
2c520ab5 188182011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 18819
c9c49752
PE
18820 Fix more problems found by GCC 4.5.2's static checks.
18821
8abc3f12
PE
18822 * coding.c (encode_coding_raw_text): Avoid unnecessary test
18823 the first time through the loop, since we know p0 < p1 then.
18824 This also avoids a gcc -Wstrict-overflow warning.
18825
a2d26660
PE
18826 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
18827 leading to a memory leak, possible in functions like
18828 load_charset_map_from_file that can allocate an unbounded number
b12ef411 18829 of objects (Bug#8318).
a2d26660 18830
916c72e9
PE
18831 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
18832 that could (at least in theory) be that large.
18833
19ab8a18
PE
18834 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
18835 This is less likely to overflow, and avoids undefined behavior if
18836 overflow does occur. All callers changed. Use strtoul to scan
18837 for the unsigned long integer.
b7cbbd6f
PE
18838 (pint2hrstr): Simplify and tune code slightly.
18839 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 18840
f0641eff
PE
18841 * scroll.c (do_scrolling): Work around GCC bug 48228.
18842 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
18843
7f650bb9
PE
18844 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
18845 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
18846 (validate_x_resource_name): Simplify count usage.
18847 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 18848
37dd57d1
PE
18849 * fileio.c (Fcopy_file): Report error if fchown or fchmod
18850 fail (Bug#8306).
81e56e61 18851
699979fc 18852 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 18853
401bf9b4
PE
18854 * process.c (Fmake_network_process): Use socklen_t, not int,
18855 where POSIX says socklen_t is required in portable programs.
18856 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 18857 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
18858 (Fmake_network_process, server_accept_connection):
18859 (wait_reading_process_output, read_process_output):
18860 Likewise.
18861
b93aacde
PE
18862 * process.c: Rename or move locals to avoid shadowing.
18863 (list_processes_1, Fmake_network_process):
18864 (read_process_output_error_handler, exec_sentinel_error_handler):
18865 Rename or move locals.
4dc343ee 18866 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 18867 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 18868 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 18869 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 18870 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 18871
af8a867c 18872 Make tparam.h and terminfo.c consistent.
44f230aa
SM
18873 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
18874 Include tparam.h instead, since it declares them.
af8a867c
PE
18875 * cm.h (PC): Remove extern decl; tparam.h now does this.
18876 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
18877 * terminfo.c: Include tparam.h, to check interfaces.
18878 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
18879 (tparam): Adjust signature to match interface in tparam.h;
18880 this removes some undefined behavior. Check that outstring and len
18881 are zero, which they always are with Emacs.
18882 * tparam.h (PC, BC, UP): New extern decls.
18883
0248044d 18884 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 18885 (xftfont_open): Rename locals to avoid shadowing.
0248044d 18886
8ff096c1 18887 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
18888 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
18889 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 18890 (ftfont_list): Remove unused local.
49eaafba
PE
18891 (get_adstyle_property, ftfont_pattern_entity):
18892 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
18893 Rename locals to avoid shadowing.
8ff096c1 18894
e2be39f6
PE
18895 * xfont.c (xfont_list_family): Mark var as initialized.
18896
c9735e30
PE
18897 * xml.c (make_dom): Now static.
18898
8f5201ae
PE
18899 * composite.c (composition_compute_stop_pos): Rename local to
18900 avoid shadowing.
b246f932
PE
18901 (composition_reseat_it): Remove unused locals.
18902 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 18903 (composition_update_it): Mark var as initialized.
11b61122
PE
18904 (find_automatic_composition): Mark vars as initialized,
18905 with a FIXME (Bug#8290).
8f5201ae 18906
760fbc2c
PE
18907 character.h: Rename locals to avoid shadowing.
18908 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
18909 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
18910 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
18911 (BUF_DEC_POS): Be more systematic about renaming local temporaries
18912 to avoid shadowing.
18913
ff08eb85
PE
18914 * textprop.c (property_change_between_p): Remove; unused.
18915
fc7bf025
PE
18916 * intervals.c (interval_start_pos): Now static.
18917
235d7abc
PE
18918 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
18919
44f230aa
SM
18920 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
18921 Rename locals to avoid shadowing.
3e7d6594 18922
50060332
PE
18923 * sound.c (wav_play, au_play, Fplay_sound_internal):
18924 Fix pointer signedness.
d01f234b 18925 (alsa_choose_format): Remove unused local var.
c83b8872
PE
18926 (wav_play): Initialize a variable to 0, to prevent undefined
18927 behavior (Bug#8278).
50060332 18928
c4fc4e30
PE
18929 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
18930
918436ed
PE
18931 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
18932
c939f91b
PE
18933 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
18934 clobbering (Bug#8298).
b9c7f648
PE
18935 * sysdep.c (sys_subshell): Likewise.
18936 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 18937
6bd8c144
PE
18938 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
18939 This should get cleaned up, so that child_setup has the
18940 same signature on all platforms.
18941
7710357c 18942 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 18943 (relocate_fd): Rename locals to avoid shadowing.
7710357c 18944
c59da222
CY
189452011-03-22 Chong Yidong <cyd@stupidchicken.com>
18946
18947 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
18948 not to be necessary, and produces flickering.
18949
66b87493
GM
189502011-03-20 Glenn Morris <rgm@gnu.org>
18951
18952 * config.in: Remove file.
18953
45b6f6d5
JB
189542011-03-20 Juanma Barranquero <lekktu@gmail.com>
18955
18956 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
18957 are now in src/globals.h.
18958 (syms_of_minibuf): Remove spurious & from previous change.
18959
cd394be1 189602011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
18961
18962 * minibuf.c (completing-read-function): New variable.
18963 (completing-read-default): Rename from completing-read.
18964 (completing-read): Call completing-read-function.
18965
b14e3e21
CY
189662011-03-19 Juanma Barranquero <lekktu@gmail.com>
18967
18968 * xfaces.c (Fx_load_color_file):
18969 Read color file from absolute filename (bug#8250).
18970
f2b726e6
JB
189712011-03-19 Juanma Barranquero <lekktu@gmail.com>
18972
18973 * makefile.w32-in: Update dependencies.
18974
09f6ff02
EZ
189752011-03-17 Eli Zaretskii <eliz@gnu.org>
18976
18977 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
18978
29a6015a
PE
189792011-03-17 Paul Eggert <eggert@cs.ucla.edu>
18980
a3a6c54e
PE
18981 Fix more problems found by GCC 4.5.2's static checks.
18982
b766f867
PE
18983 * process.c (make_serial_process_unwind, send_process_trap):
18984 (sigchld_handler): Now static.
18985
be02381c
PE
18986 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
18987 That way, the code declares only the vars that it needs.
18988 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
18989 * s/cygwin.h (PTY_ITERATION): Likewise.
18990 * s/darwin.h (PTY_ITERATION): Likewise.
18991 * s/gnu-linux.h (PTY_ITERATION): Likewise.
18992
57048744
PE
18993 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
18994 * process.c (allocate_pty): Don't declare stb unless it's needed.
18995
7914961c 18996 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
18997 (CONSTANTLIM): Remove; unused.
18998 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
18999 Define only if needed.
7914961c 19000
b3967b18
PE
19001 * unexelf.c (unexec): Name an expression,
19002 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
19003 Use a different way to cause a compilation error if anyone uses
19004 n rather than nn, a way that does not involve shadowing.
73366a00 19005 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 19006
29a6015a
PE
19007 * deps.mk (unexalpha.o): Remove; unused.
19008
43cfc33e 19009 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 19010 * unexec.h: New file.
ce701a33
PE
19011 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
19012 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
19013 Depend on unexec.h.
19014 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
19015 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
19016 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 19017 Change as necessary to match prototype in unexec.h.
ce701a33 19018
01f44d5a
PE
19019 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
19020 shadowing.
4f63c6bb 19021 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 19022
a6670b0b
PE
19023 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
19024 Rename locals to avoid shadowing.
19025
cef2010d 19026 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 19027 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 19028
d4d7173a
PE
19029 * print.c (Fredirect_debugging_output): Fix pointer signedess.
19030
f08b802a
PE
19031 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
19032 warning when compiling print.c.
19033
3ddb0639
PE
19034 * font.c (font_unparse_fcname): Abort in an "impossible" situation
19035 instead of using an uninitialized var.
5ad03b97 19036 (font_sort_entities): Mark var as initialized.
3ddb0639 19037
170a2692
PE
19038 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
19039
e663c700
PE
19040 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
19041 pointers to constants.
89bc529a 19042 (font_parse_fcname): Remove unused vars.
7b81e2d0 19043 (font_delete_unmatched): Now static.
ea838e10 19044 (font_get_spec): Remove; unused.
13a547c6
PE
19045 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
19046 (font_update_drivers, Ffont_get_glyphs, font_add_log):
19047 Rename or move locals to avoid shadowing.
e663c700 19048
2a80c887 19049 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 19050 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 19051
1384fa33 19052 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 19053 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 19054
8b2c52e9
PE
19055 * alloc.c (mark_backtrace): Move decl from here ...
19056 * lisp.h: ... to here, so that it can be checked.
19057
475545b5 19058 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 19059 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
19060 (lisp_indirect_variable): Name an expression,
19061 to avoid gcc -Wbad-function-cast warning.
1faed8ae 19062 (Fdefvar): Rename locals to avoid shadowing.
475545b5 19063
b1349114 19064 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 19065 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 19066 Use const pointer when appropriate.
b1349114 19067
a2928364
PE
19068 * lisp.h (get_system_name, get_operating_system_release):
19069 Move decls here, to check interfaces.
19070 * process.c (get_operating_system_release): Move decl to lisp.h.
19071 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
19072 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
19073 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
19074 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
19075 (Fformat_time_string, Fencode_time, Finsert_char):
19076 (Ftranslate_region_internal, Fformat):
19077 Rename or remove local vars to avoid shadowing.
9710023e 19078 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 19079
a415e694
PE
19080 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
19081 avoid shadowing.
19082
8ef4622d
PE
19083 * lisp.h (eassert): Check that the argument compiles, even if
19084 ENABLE_CHECKING is not defined.
19085
946f9a5b
PE
19086 * data.c (Findirect_variable): Name an expression, to avoid
19087 gcc -Wbad-function-cast warning.
112396d6 19088 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 19089 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
19090 (Fmake_variable_buffer_local, Fmake_local_variable):
19091 Mark variables as initialized.
52746918 19092 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 19093
e5aab7e7 19094 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
19095 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
19096 Rename locals to avoid shadowing.
dff45157
PE
19097 (mark_stack): Move local variables into the #ifdef region where
19098 they're used.
7bc26fdb
PE
19099 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
19100 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
19101 needed otherwise.
19102 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
19103 (GC_STRING_CHARS): Remove; not used.
d40d4be1 19104 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 19105
e5aab7e7
PE
19106 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
19107 avoids undefined behavior in theory.
19108
4da60324
PE
19109 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
19110
88043301
PE
19111 Use functions, not macros, for up- and down-casing (Bug#8254).
19112 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19113 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
19114 to use the following functions instead of these macros.
19115 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
19116 EMACS_INT, since callers assume the returned value fits in int.
19117 (upcase1): Likewise, for UPCASE_TABLE.
19118 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 19119 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 19120 the race-condition problem in the old DOWNCASE.
88043301 19121
19ed5445
PE
19122 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
19123 Rename locals to avoid shadowing.
19124 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
19125 (regex_compile, re_search_2, re_match_2_internal):
19126 Remove unused local vars.
952db0d7
PE
19127 (FREE_VAR): Rewrite so as not to use empty "else",
19128 which gcc can warn about.
da053e48 19129 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
19130 (RETALLOC_IF): Define only if needed.
19131 (WORDCHAR_P): Likewise. This one is never needed, but is used
19132 only in a comment talking about a compiler bug, so put inside
19133 the #if 0 of that comment.
19134 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
19135 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
19136 Remove; unused.
19ed5445 19137
1f3561e4 19138 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
19139 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
19140 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 19141
ded6f8f7
PE
19142 * search.c (simple_search): Remove unused var.
19143
dbd37a95
PE
19144 * dired.c (compile_pattern): Move decl from here ...
19145 * lisp.h: ... to here, so that it can be checked.
19146 (struct re_registers): New forward decl.
19147
7e47afad
PE
19148 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
19149
85f24f61
PE
19150 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
19151 All uses changed.
19152 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
19153 Rename locals to avoid shadowing.
5671df8f 19154 (Fvertical_motion): Mark locals as initialized.
85f24f61 19155
181aa2be 19156 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 19157 (casify_region): Mark local as initialized.
181aa2be 19158
930d429c
PE
19159 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
19160
7082eac6
PE
19161 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
19162 New macros, so that the caller can use some names other than
19163 gcpro1, gcpro2, etc.
19164 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
19165 of the new macros.
19166 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
19167 argument, for consistency with GCPRO2_VAR, etc: it is now the
19168 prefix of the variable, not the variable itself. All uses
19169 changed.
38b2c076
PE
19170 * dired.c (directory_files_internal, file_name_completion):
19171 Rename locals to avoid shadowing.
19172
15206ed9
PE
19173 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
19174 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
19175 dired.c's scmp function, had undefined behavior.
19176 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
19177 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
19178 * buffer.h: ... to here, because these macros use current_buffer,
19179 and the new implementation with inline functions needs to have
19180 current_buffer in scope now, rather than later when the macros
19181 are used.
19182 (downcase, upcase1): New static inline functions.
19183 (DOWNCASE, UPCASE1): Reimplement using these functions.
19184 This avoids undefined behavior in expressions like
19185 DOWNCASE (x) == DOWNCASE (y), which previously suffered
19186 from race conditions in accessing the global variables
19187 case_temp1 and case_temp2.
19188 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
19189 * lisp.h (case_temp1, case_temp2): Remove their decls.
19190 * character.h (ASCII_CHAR_P): Move from here ...
19191 * lisp.h: ... to here, so that the inline functions mentioned
19192 above can use them.
19193
4a6bea26
PE
19194 * dired.c (directory_files_internal_unwind): Now static.
19195
f14b7e14
PE
19196 * fileio.c (file_name_as_directory, directory_file_name):
19197 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
19198 Now static.
2893f146
PE
19199 (file_name_as_directory): Use const pointers when appropriate.
19200 (Fexpand_file_name): Likewise. In particular, newdir might
19201 point at constant storage, so make it a const pointer.
fd4ead52 19202 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
19203 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
19204 signedness issues.
f839df0c
PE
19205 (Fset_file_times, Finsert_file_contents, auto_save_error):
19206 Rename locals to avoid shadowing.
f14b7e14 19207
5716756e 19208 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
19209 (Ftry_completion, Fall_completions): Rename or remove locals
19210 to avoid shadowing.
5716756e 19211
b4c3046a
PE
19212 * marker.c (bytepos_to_charpos): Remove; unused.
19213
b45db522
PE
19214 * lisp.h (verify_bytepos, count_markers): New decls,
19215 so that gcc does not warn that these functions aren't declared.
19216
85876d07
PE
19217 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
19218 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 19219 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 19220 (copy_text): Remove unused local var.
85876d07 19221
03d78a21 19222 * filelock.c (within_one_second): Now static.
b3dd38ab 19223 (lock_file_1): Rename local to avoid shadowing.
03d78a21 19224
5df8f01b
PE
19225 * buffer.c (fix_overlays_before): Mark locals as initialized.
19226 (fix_start_end_in_overlays): Likewise. This function should be
19227 simplified by using pointers-to-pointers, but that's a different
19228 matter.
b1d876f1 19229 (switch_to_buffer_1): Now static.
8f54f30a
PE
19230 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
19231 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 19232
a70072c9 19233 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 19234 Fix pointer signedness issue.
edced198
PE
19235 (sys_subshell): Mark local as volatile if checking for lint,
19236 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 19237 (MAXPATHLEN): Define only if needed.
a70072c9 19238
a0977c44
PE
19239 * process.c (serial_open, serial_configure): Move decls from here ...
19240 * systty.h: ... to here, so that they can be checked.
19241
a884fdcc
PE
19242 * fns.c (get_random, seed_random): Move extern decls from here ...
19243 * lisp.h: ... to here, so that they can be checked.
19244
604efe86 19245 * sysdep.c (reset_io): Now static.
b8950c94 19246 (wait_for_termination_signal): Remove; unused.
604efe86 19247
38fc62d9
PE
19248 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
19249 (copy_keymap_item, append_key, push_text_char_description):
19250 Now static.
1004a21a 19251 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 19252 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
19253 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
19254 (describe_map_tree):
19255 Rename locals to avoid shadowing.
38fc62d9 19256
2f2650da
PE
19257 * keyboard.c: Declare functions static if they are not used elsewhere.
19258 (echo_char, echo_dash, cmd_error, top_level_2):
19259 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
19260 (read_char, kbd_buffer_get_event, make_lispy_position):
19261 (make_lispy_event, make_lispy_movement, apply_modifiers):
19262 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
19263 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
19264 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 19265 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 19266 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 19267
a053e86c 19268 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
19269 (mark_kboards): Move decl here ...
19270 * alloc.c (mark_kboards): ... from here.
a053e86c 19271
4752793e
PE
19272 * lisp.h (force_auto_save_soon): New decl.
19273
74f10ca7 19274 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
19275 (DEFINE_DUMMY_FUNCTION): New macro.
19276 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
19277 Use it.
c03cd23f
PE
19278 (main): Add casts to avoid warnings
19279 if GCC considers string literals to be constants.
74f10ca7 19280
022e70d4
PE
19281 * lisp.h (fatal_error_signal): Add decl, since it's exported.
19282
59d6fe83
PE
19283 * dbusbind.c: Pointer signedness fixes.
19284 (xd_signature, xd_append_arg, xd_initialize):
19285 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19286 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19287 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
19288 (Fdbus_register_signal): Use SSDATA when the context wants char *.
19289
78320123
PE
19290 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
19291 if GCC considers string literals to be constants.
49cebcca 19292 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 19293
35ac2a97
SM
192942011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
19295
fb103ca9
SM
19296 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
19297 (print_preprocess, print_object): New macro to fix last change.
19298
35ac2a97
SM
19299 * print.c (print_preprocess): Don't forget font objects.
19300
62973b41
JB
193012011-03-16 Juanma Barranquero <lekktu@gmail.com>
19302
19303 * emacs.c (USAGE3): Doc fixes.
19304
0e48bb22
AS
193052011-03-15 Andreas Schwab <schwab@linux-m68k.org>
19306
19307 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
19308 structure.
19309
7684e57b
JB
193102011-03-14 Juanma Barranquero <lekktu@gmail.com>
19311
19312 * lisp.h (VWindow_system, Qfile_name_history):
19313 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
19314 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
19315 (w32_system_caret_x, w32_system_caret_y): Declare extern.
19316
19317 * w32select.c: Don't #include "keyboard.h".
c96bbc66 19318 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
19319
19320 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
19321 * w32console.c (detect_input_pending, read_input_pending)
19322 (encode_terminal_code):
19323 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
19324 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
19325 (w32_system_caret_y, Qfile_name_history):
19326 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
19327 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
19328 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
19329 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
19330 * w32proc.c (Qlocal, report_file_error):
19331 * w32term.c (Vwindow_system, updating_frame):
19332 * w32uniscribe.c (initialized, uniscribe_font_driver):
19333 Remove unneeded extern declarations.
19334
2aa46d6c
CY
193352011-03-14 Chong Yidong <cyd@stupidchicken.com>
19336
c96bbc66 19337 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 19338
cffc6f3b
CY
193392011-03-13 Chong Yidong <cyd@stupidchicken.com>
19340
19341 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
19342 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
19343 These macros can no longer be used for assignment.
19344
44f230aa
SM
19345 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
19346 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
19347 (record_buffer_markers, fetch_buffer_markers): New functions for
19348 recording and fetching special buffer markers.
19349 (set_buffer_internal_1, set_buffer_temp): Use them.
19350
19351 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
19352
19353 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
19354
19355 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
19356 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
19357
19358 * xdisp.c (hscroll_window_tree):
19359 (reconsider_clip_changes): Use PT instead of BUF_PT.
19360
d251f04b
EZ
193612011-03-13 Eli Zaretskii <eliz@gnu.org>
19362
19363 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
19364 $(EMACS_ROOT)/lib/intprops.h.
19365
f0c77cd1
PE
193662011-03-13 Paul Eggert <eggert@cs.ucla.edu>
19367
3eca4629
PE
19368 Fix more problems found by GCC 4.5.2's static checks.
19369
7c86ee98
PE
19370 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
19371 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
19372 (xg_free_frame_widgets): Make it clear that a local variable is
19373 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
19374 (gdk_window_get_screen): Make it clear that this macro is needed
19375 only if USE_GTK_TOOLTIP.
1e5524e7
PE
19376 (int_gtk_range_get_value): New function, which avoids a diagnostic
19377 from gcc -Wbad-function-cast.
19378 (xg_set_toolkit_scroll_bar_thumb): Use it.
19379 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
19380 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
19381 (get_utf8_string, xg_get_file_with_chooser):
19382 Rename locals to avoid shadowing.
19383 (create_dialog): Move locals to avoid shadowing.
7c86ee98 19384
41729b81
PE
19385 * xgselect.c (xg_select): Remove unused var.
19386
f0c77cd1
PE
19387 * image.c (four_corners_best): Mark locals as initialized.
19388 (gif_load): Initialize transparent_p to zero (Bug#8238).
19389 Mark another local as initialized.
ec6cf4c6 19390 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 19391
ce0ad53d 19392 * image.c (clear_image_cache): Now static.
d5d5a617 19393 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 19394 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
19395 (x_edge_detection): Remove unnecessary cast that
19396 gcc -Wbad-function-cast diagnoses.
2037898d 19397 (gif_load): Fix pointer signedness.
6ae141d6
PE
19398 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
19399 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 19400
33383987 194012011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 19402
d32df629
PE
19403 Improve quality of tests for time stamp overflow.
19404 For example, without this patch (encode-time 0 0 0 1 1
19405 1152921504606846976) returns the obviously-bogus value (-948597
19406 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
19407 reports time overflow. See
19408 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
19409 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
19410 * editfns.c: Include limits.h and intprops.h.
19411 (TIME_T_MIN, TIME_T_MAX): New macros.
19412 (time_overflow): Move earlier, to before first use.
19413 (hi_time, lo_time): New functions, for an accurate test for
19414 out-of-range times.
19415 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
19416 (Fget_internal_run_time): Don't assume time_t fits in int.
19417 (make_time): Use list2 instead of Fcons twice.
19418 (Fdecode_time): More accurate test for out-of-range times.
19419 (check_tm_member): New function.
19420 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
19421 (lisp_time_argument): Don't rely on undefined left-shift and
19422 right-shift behavior when checking for time stamp overflow.
8be6f318 19423
fe31d94c
PE
19424 * editfns.c (time_overflow): New function, refactoring common code.
19425 (Fformat_time_string, Fdecode_time, Fencode_time):
19426 (Fcurrent_time_string): Use it.
19427
8be6f318
PE
19428 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
19429 * dired.c (make_time): Move to ...
19430 * editfns.c (make_time): ... here.
19431 * systime.h: Note the move.
19432
09d9db2c 194332011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 19434
126bc0dc
YM
19435 * fringe.c (update_window_fringes): Remove unused variables.
19436
c47cbdfd
YM
19437 * unexmacosx.c (copy_data_segment): Also copy __got section.
19438 (Bug#8223)
19439
7ac80be9
EZ
194402011-03-12 Eli Zaretskii <eliz@gnu.org>
19441
c96bbc66 19442 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
19443 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
19444 Constify `char *' arguments and their references according to
19445 prototypes in tparam.h.
19446
ecb0f94d 19447 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 19448
7ac80be9
EZ
19449 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
19450 Adapt all references accordingly.
19451
19452 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
19453
ef1fd07e
TT
194542011-03-11 Tom Tromey <tromey@redhat.com>
19455
19456 * buffer.c (syms_of_buffer): Remove obsolete comment.
19457
7ef4b50c
EZ
194582011-03-11 Eli Zaretskii <eliz@gnu.org>
19459
19460 * termhooks.h (encode_terminal_code): Declare prototype.
19461
19462 * msdos.c (encode_terminal_code): Don't declare prototype.
19463
19464 * term.c (encode_terminal_code): Now external again, used by
19465 w32console.c and msdos.c.
19466
44f230aa
SM
19467 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
19468 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 19469
4b1ec863 194702011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 19471
1714f52b 19472 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 19473
4b1ec863
PE
19474 * fringe.c (update_window_fringes): Mark locals as initialized
19475 (Bug#8227).
19476 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 19477
524c7aa6
PE
19478 * alloc.c (mark_fringe_data): Move decl from here ...
19479 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
19480 to check its interface.
19481 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
19482
a5c0af81 19483 * fontset.c (free_realized_fontset): Now static.
7519b8cd 19484 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 19485 (fontset_font): Mark local as initialized.
a9a06e0b 19486 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 19487
b4716021
PE
19488 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
19489
811e9bac 19490 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 19491 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
19492 (x_own_selection, Fx_disown_selection_internal): Rename locals
19493 to avoid shadowing.
19494 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 19495
7e3ab302
PE
19496 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
19497 so that the caller can use some name other than gcpro1.
19498 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
19499 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19500 (Fx_backspace_delete_keys_p):
19501 Use them to avoid shadowing, and rename vars to avoid shadowing.
19502 (x_decode_color, x_set_name, x_window): Now static.
6b437900 19503 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 19504 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
19505 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
19506 Remove unused locals.
7e3ab302
PE
19507 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
19508 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
19509 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
19510 macros.
f78faa98 19511
e2b13473
PE
19512 * xterm.h (x_mouse_leave): New decl.
19513
77f23912
PE
19514 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
19515 Remove unused functions.
cdf4ba58
PE
19516 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
19517 (x_calc_absolute_position): Now static.
7411c686 19518 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 19519 Don't declare local "event" unless it's used.
ed7bf3a5
PE
19520 (x_iconify_frame, x_free_frame_resources): Don't declare locals
19521 unless they are used.
38d0b34a
PE
19522 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
19523 (x_fatal_error_signal): Remove; not used.
a6067996
PE
19524 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
19525 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
19526 (x_error_catcher, x_connection_closed, x_error_handler):
19527 (x_error_quitter, xembed_send_message, x_iconify_frame):
19528 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 19529 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 19530 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 19531
44f230aa
SM
19532 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
19533 Rename or move locals to avoid shadowing.
6b463e58 19534 (tty_defined_color, merge_face_heights): Now static.
5967d051 19535 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
19536 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
19537 does not deduce is never used uninitialized.
73719eba
PE
19538 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
19539 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 19540
426994c3 19541 * terminal.c (store_terminal_param): Now static.
5489860b 19542
032f1620 19543 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 19544 (set_frame_menubar): Remove unused local.
d4323972 19545 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
19546 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
19547 since they might point to immutable storage.
281585b0
PE
19548 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
19549 since it's unused otherwise.
032f1620 19550
367c19e5 19551 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 19552 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
19553 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
19554 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 19555 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
19556 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
19557 does not deduce are never used uninitialized.
70739cbe 19558
07b48fa9
PE
19559 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
19560
8868a238 19561 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
19562 * window.c (window_loop, size_window):
19563 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 19564
7e5cf297 19565 * window.c (display_buffer): Now static.
d6550a9f
PE
19566 (size_window): Mark variables that gcc -Wuninitialized
19567 does not deduce are never used uninitialized.
a586633d
PE
19568 * window.h (check_all_windows): New decl, to forestall
19569 gcc -Wmissing-prototypes diagnostic.
5b555da1 19570 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 19571
f6095868
PE
19572 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
19573 shadowing.
19574 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
19575 Include <limits.h>.
19576 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
19577 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
19578 (load_charset_map): Mark variables that gcc -Wuninitialized
19579 does not deduce are never used uninitialized.
53df7c11 19580 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 19581
f38b440c
PE
19582 * coding.c (coding_set_source, coding_set_destination):
19583 Use "else { /* comment */ }" rather than "else /* comment */;"
19584 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
19585 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
19586 a block, when the outer 'i' will do.
19587 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
19588 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
19589 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
19590 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
19591 (Fdecode_sjis_char, Fdefine_coding_system_internal):
19592 Rename locals to avoid shadowing.
19593 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
19594 * coding.c (emacs_mule_char, encode_invocation_designation):
19595 Now static, since they're not used elsewhere.
413bb2db 19596 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 19597 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
19598 (decode_coding_emacs_mule): Mark variables that gcc
19599 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
19600 (detect_coding_iso_2022): Initialize a local variable that might
19601 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 19602 this initialization is needed. (Bug#8211)
5f58e762
PE
19603 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
19604 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
19605 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
19606 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
19607 Remove unused macros.
f38b440c 19608
232b38b9 19609 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 19610 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 19611 * character.c (string_count_byte8): Likewise.
232b38b9 19612
fb90da1b
PE
19613 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
19614 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
19615
fb93dbc2
PE
19616 * chartab.c (copy_sub_char_table): Now static, since it's not used
19617 elsewhere.
5c156ace
PE
19618 (sub_char_table_ref_and_range, char_table_ref_and_range):
19619 Rename locals to avoid shadowing.
bbcd0949 19620 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 19621
7d3b3862 19622 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 19623 (BIDI_BOB): Remove unused macro.
7d3b3862 19624
6be7d3da
PE
19625 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
19626 deduce are never used uninitialized.
c2ed9c8b 19627 * term.c (encode_terminal_code): Likewise.
6be7d3da 19628
75f8807f 19629 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 19630
50938595
PE
19631 * tparam.h: New file.
19632 * term.c, tparam.h: Include it.
19633 * deps.mk (term.o, tparam.o): Depend on tparam.h.
19634 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
19635 Move these decls to tparam.h, and make them agree with what
19636 is actually in tparam.c. The previous trick of using incompatible
19637 decls in different modules does not conform to the C standard.
19638 All callers of tparam changed to use tparam's actual API.
19639 * tparam.c (tparam1, tparam, tgoto):
19640 Use const pointers where appropriate.
19641
fbceeba2
PE
19642 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
19643 * cm.h (struct cm): Likewise.
19644 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
19645 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
19646 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
19647 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
19648 (turn_on_face, init_tty): Likewise.
19649 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 19650
7f3f1250
PE
19651 * term.c (term_mouse_position): Rename local to avoid shadowing.
19652
e6ca6543
PE
19653 * alloc.c (mark_ttys): Move decl from here ...
19654 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
19655
c40f8d15
AS
196562011-03-11 Andreas Schwab <schwab@linux-m68k.org>
19657
19658 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
19659
cfe0661d
JB
196602011-03-09 Juanma Barranquero <lekktu@gmail.com>
19661
19662 * search.c (compile_pattern_1): Remove argument regp, unused since
19663 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
19664 (compile_pattern): Don't pass it.
19665
0afb4571
J
196662011-03-08 Jan Djärv <jan.h.d@swipnet.se>
19667
19668 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
19669 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
19670 for ! HAVE_GTK3.
19671 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
19672
19673 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
19674
19675 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
19676 gdk_window_get_screen, gdk_window_get_geometry,
19677 gdk_x11_window_lookup_for_display and GDK_KEY_g.
19678 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
19679 (xg_get_pixbuf_from_pixmap): New function.
19680 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
19681 to Pixmap, take frame as parameter, remove GdkColormap parameter.
19682 Call xg_get_pixbuf_from_pixmap instead of
19683 gdk_pixbuf_get_from_drawable.
19684 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
19685 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
19686 (xg_check_special_colors): Use GtkStyleContext and its functions
19687 for HAVE_GTK3.
19688 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
19689 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
19690 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
19691 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
19692 Call gtk_widget_get_preferred_size.
0afb4571
J
19693 (xg_frame_resized): gdk_window_get_geometry only takes 5
19694 parameters.
44f230aa
SM
19695 (xg_win_to_widget, xg_event_is_for_menubar):
19696 Call gdk_x11_window_lookup_for_display.
0afb4571
J
19697 (xg_set_widget_bg): New function.
19698 (delete_cb): New function.
895009e1 19699 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 19700 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
19701 (xg_set_background_color): Call xg_set_widget_bg.
19702 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
19703 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
19704 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
19705 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
19706 if ! HAVE_GTK3.
19707 (update_frame_tool_bar): Call gtk_widget_hide.
19708 (xg_initialize): Use GDK_KEY_g.
19709
19710 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
19711 if ! HAVE_GTK3
19712 (x_session_initialize): Call gdk_x11_set_sm_client_id.
19713
19714 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
19715 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
19716 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
19717
1c2cc4ef
JB
197182011-03-08 Juanma Barranquero <lekktu@gmail.com>
19719
19720 * w32xfns.c (select_palette): Check success of RealizePalette against
19721 GDI_ERROR, not zero.
19722
33383987 19723See ChangeLog.11 for earlier changes.
aac0c6e3
MR
19724
19725;; Local Variables:
19726;; coding: utf-8
aac0c6e3
MR
19727;; End:
19728
ab422c4d 19729 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
19730
19731 This file is part of GNU Emacs.
19732
19733 GNU Emacs is free software: you can redistribute it and/or modify
19734 it under the terms of the GNU General Public License as published by
19735 the Free Software Foundation, either version 3 of the License, or
19736 (at your option) any later version.
19737
19738 GNU Emacs is distributed in the hope that it will be useful,
19739 but WITHOUT ANY WARRANTY; without even the implied warranty of
19740 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19741 GNU General Public License for more details.
19742
19743 You should have received a copy of the GNU General Public License
19744 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.