* doc/emacs/ack.texi (Acknowledgments): Tiny update.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
8edd4a2b
SM
12012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * eval.c (Fapply): Allow calling it with a single argument.
4
f6f62d1b
EZ
52012-06-26 Eli Zaretskii <eliz@gnu.org>
6
7 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
8 _stricmp and _strnicmp.
9 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10
62efea5e
DA
112012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
12
13 * alloc.c (allocate_window): Zero out non-Lisp part of newly
14 allocated window.
15 (allocate_process): Likewise for new process.
8edd4a2b 16 (allocate_terminal): Change to use offsetof.
62efea5e
DA
17 (allocate_frame): Likewise.
18 * frame.c (make_frame): Omit redundant initialization.
19 * window.c (make_parent_window): Use memset.
20 (make_window): Omit redundant initialization.
21 * process.c (make_process): Omit redundant initialization.
22 * terminal.c (create_terminal): Likewise.
23
42997f4d
DA
242012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
25
26 * term.c (delete_tty): Remove redundant call to memset.
27
1130ecfc
DA
282012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
29
30 * alloc.c: Remove build_string.
31 * lisp.h: Define build_string as static inline. This provides
32 a better opportunity to optimize away calls to strlen when the
33 function is called with compile-time constant argument.
34 * image.c (imagemagick_error): Convert to build_string.
35 * w32proc.c (sys_spawnve): Likewise.
36 * xterm.c (x_term_init): Likewise.
37
cf38a720
PE
382012-06-26 Paul Eggert <eggert@cs.ucla.edu>
39
99027bdd
PE
40 Use sprintf return value instead of invoking strlen on result.
41 In the old days this wasn't portable, since some sprintf
42 implementations returned char *. But they died out years ago and
43 Emacs already assumes sprintf returns int.
44 Similarly for float_to_string.
45 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
46 * ccl.c (ccl_driver):
47 * character.c (string_escape_byte8):
48 * data.c (Fnumber_to_string):
49 * doprnt.c (doprnt):
50 * print.c (print_object):
51 * xdisp.c (message_dolog):
52 * xfns.c (syms_of_xfns):
53 Use sprintf or float_to_string result to avoid need to call strlen.
54 * data.c (Fnumber_to_string):
55 Use make_unibyte_string, since the string must be ASCII.
56 * lisp.h, print.c (float_to_string): Now returns int length.
57 * term.c (produce_glyphless_glyph):
58 Use sprintf result rather than recomputing it.
59
cf38a720
PE
60 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
61 * Makefile.in (ALL_CFLAGS):
62 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
63 * gmalloc.c, regex.c: Include <config.h> unconditionally.
64
3511c784
DA
652012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
66
0a08eb21 67 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
68 strcasecmp if available.
69 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
70
fb7da12e
AS
712012-06-25 Andreas Schwab <schwab@linux-m68k.org>
72
73 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
74 Avoid comma operator.
75 * menu.c (push_submenu_start, push_submenu_end)
76 (push_left_right_boundary, push_menu_pane): Likewise.
77 * msdos.c (dos_rawgetc): Likewise.
78
afa2ffd8
DA
792012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
80
81 * xfns.c (xic_create_fontsetname): Remove redundant calls
82 to memset.
83
b3b4476b
PE
842012-06-25 Paul Eggert <eggert@cs.ucla.edu>
85
4495ff38
PE
86 * gtkutil.c (get_utf8_string): Remove redundant assignment.
87 sprintf already null-terminates its output.
88
b3b4476b
PE
89 * xfns.c (x_window): Remove redundant cast.
90
b00876c9
DA
912012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
92
93 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
94 `const char *' to `char *' to avoid compiler warning.
95
d188e26b
PE
962012-06-24 Paul Eggert <eggert@cs.ucla.edu>
97
885d1d74
PE
98 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
99 instead of truncating it to 63 (admittedly a generous limit).
100
d188e26b
PE
101 * process.c: Fix spelling and caps in comments.
102
e2f560b1
DN
1032012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
104
e86db54b 105 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
106 * sysdep.c (setpgrp): Remove definition, not used in this file.
107
7583a3a1
JB
1082012-06-24 Juanma Barranquero <lekktu@gmail.com>
109
110 * makefile.w32-in: Update dependencies.
111
696056c2
EZ
1122012-06-24 Eli Zaretskii <eliz@gnu.org>
113
114 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
115 (SYSTIME_H): Add nt/inc/sys/time.h.
116
117 * systime.h [WINDOWSNT]: Include sys/time.h.
118
119 * s/ms-w32.h (struct timespec): Definition moved from
120 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
121
845ca893
PE
1222012-06-24 Paul Eggert <eggert@cs.ucla.edu>
123
124 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
125 * buffer.h (buffer_slot_type_mismatch):
126 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
127 * eval.c (unwind_to_catch):
128 * image.c (my_png_error, my_error_exit):
129 * keyboard.c (quit_throw_to_read_char, user_error)
130 (Fexit_recursive_edit, Fabort_recursive_edit):
131 * lisp.h (die, args_out_of_range, args_out_of_range_3)
132 (wrong_type_argument, buffer_overflow, __executable_start)
133 (memory_full, buffer_memory_full, string_overflow, Fthrow)
134 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
135 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
136 (fatal):
137 (child_setup) [!DOS_NT]:
138 * lread.c (end_of_file_error, invalid_syntax):
139 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
140 * puresize.h (pure_write_error):
141 * search.c (matcher_overflow):
142 * sound.c (sound_perror, alsa_sound_perror):
143 * sysdep.c, syssignal.h (croak):
144 * term.c (maybe_fatal, vfatal):
145 * textprop.c (text_read_only):
146 * undo.c (user_error):
147 * unexmacosx.c (unexec_error):
148 * xterm.c (x_ins_del_lines, x_delete_glyphs):
149 Use _Noreturn rather than NO_RETURN.
150 No need for separate decl merely because of _Noreturn.
151 * sound.c (sound_warning, parse_sound):
152 Remove unnecessary forward decls.
153
f1dd8073
PE
1542012-06-24 Paul Eggert <eggert@cs.ucla.edu>
155
156 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
157 * lisp.h (WAIT_READING_MAX): New macro.
158 * dispnew.c (Fsleep_for, sit_for):
159 * keyboard.c (kbd_buffer_get_event):
160 * process.c (Faccept_process_output):
161 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
162 This improves on the previous patch, which introduced a bug
163 when time_t is unsigned and as wide as intmax_t.
164 See <http://bugs.gnu.org/9000#51>.
165
b82c1755
EZ
1662012-06-23 Eli Zaretskii <eliz@gnu.org>
167
168 * dispnew.c (sit_for, Fsleep_for):
169 * keyboard.c (kbd_buffer_get_event):
170 * process.c (Faccept_process_output): Avoid compiler warnings when
171 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
172
ca300656
JB
1732012-06-23 Juanma Barranquero <lekktu@gmail.com>
174
049ec95b
JB
175 * makefile.w32-in: Update dependencies.
176
ca300656
JB
177 * w32.c (ltime): Add return type and declare static.
178 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
179
db7b8d06
PE
1802012-06-23 Paul Eggert <eggert@cs.ucla.edu>
181
182 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
183 Privately reported by Herbert J. Skuhra.
184 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
185 All uses changed.
186 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
187 not make_lisp_timeval, when the argument is of type EMACS_TIME.
188
0bd8297f
EZ
1892012-06-23 Eli Zaretskii <eliz@gnu.org>
190
96512555
EZ
191 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
192 last argument of make_unibyte_string.
193
0bd8297f
EZ
194 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
195 language ID in the event parameters.
196
197 * w32term.c (w32_read_socket): Put the new keyboard codepage into
198 event.code, not the obscure "character set ID".
199
63def6b6
CY
2002012-06-23 Chong Yidong <cyd@gnu.org>
201
202 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
203
e8a02204
EZ
2042012-06-23 Eli Zaretskii <eliz@gnu.org>
205
388cdec0
EZ
206 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
207 * w32.c (fdutimens): New function.
208
209 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
210
211 * s/ms-w32.h (pselect): Redirect to sys_select.
212
213 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
214
e8a02204
EZ
215 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
216 in the logic of incrementing and decrementing the value of
217 use_relocatable_buffers.
218
d054f3fb
PE
2192012-06-23 Paul Eggert <eggert@cs.ucla.edu>
220
221 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
222 Privately reported by Herbert J. Skuhra.
223 [__FreeBSD__]: Remove "*/" typo after "#include".
224 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
225 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
226 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
227 Don't assume EMACS_TIME and struct timeval are the same type.
228
d35af63c
PE
2292012-06-22 Paul Eggert <eggert@cs.ucla.edu>
230
231 Support higher-resolution time stamps (Bug#9000).
232 The time stamps are only nanosecond-resolution at the C level,
233 since that's the best that any real-world system supports now.
234 But they are picosecond-resolution at the Lisp level, as that's
235 easy, and leaves room for future OS improvements.
236
237 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
238 (LIBES): Use it.
239
240 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
241 Don't get current time unless it's needed.
242
243 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
244 now provides it if it's absent.
245 (start_atimer): Port to higher-res time stamps.
246 Check for time stamp overflow. Don't get current time more
247 often than is needed.
248
249 * buffer.h (struct buffer): Buffer modtime now has high resolution.
250 Include systime.h, not time.h.
251 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
252
253 * dired.c: Include stat-time.h.
254 (Ffile-attributes): File times now have higher resolution.
255
256 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
257 (struct image): Timestamp now has higher resolution.
258
259 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
260 has at least microseconds now. All uses removed.
261 (update_frame, update_single_window, update_window, update_frame_1)
262 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
263
264 * editfns.c (time_overflow): Now extern.
265 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
266 (float-time, Fformat_time_string, Fcurrent_time_string)
267 (Fcurrent_time_zone): Accept and generate higher-resolution
268 time stamps.
269 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
270 (decode_time_components, lisp_seconds_argument): New functions.
271 (make_time): Now static.
272 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
273 Report an error if the time is invalid, rather than having the caller
274 do that.
275
276 * fileio.c: Include <stat-time.h>
277 (Fcopy_file): Copy higher-resolution time stamps.
278 Prefer to set the time stamp via a file descriptor if that works.
279 (Fset_file_times, Finsert_file_contents, Fwrite_region)
280 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
281 (Fvisited_file_modtime, Fset_visited_file_modtime):
282 Support higher-resolution time stamps.
283
284 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
285
286 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
287
288 * image.c (prepare_image_for_display, clear_image_cache)
289 (lookup_image): Port to higer-resolution time stamps.
290
291 * keyboard.c (start_polling, bind_polling_period):
292 Check for time stamp overflow.
293 (read_char, kbd_buffer_get_event, timer_start_idle)
294 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
295 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
296 Port to higher-resolution time stamps. Do not assume time_t is signed.
297 (decode_timer): New function. Timers are now vectors of length 9,
298 not 8, to accommodate the picosecond component.
299 (timer_check_2): Use it.
300
301 * nsterm.m (select_timeout, timeval_subtract): Remove.
302 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
303 as they're a bit more accurate and handle overflow better.
304 (ns_select): Change prototype to be compatible with pselect.
305 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
306 * nsterm.h (ns_select): Adjust prototype.
307
308 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
309 us-resolution time stamps.
310 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
311
312 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
313
314 * lisp.h (time_overflow): New decl.
315 (wait_reading_process_output): First arg is now intmax_t, not int,
316 to accommodate larger waits.
317
318 * process.h (struct Lisp_Process.read_output_delay):
319 Now counts nanoseconds, not microseconds.
320 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
321 EMACS_HAS_USECS.
322 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
323 (wait_reading_process_output):
324 Port to ns-resolution time stamps.
325 (Faccept_process_output, wait_reading_process_output):
326 Check for time stamp overflow. Do not assume time_t is signed.
327 (select_wrapper): Remove; we now use pselect.
328 (Fprocess_attributes): Now generates ns-resolution time stamps.
329
330 * sysdep.c: Include utimens.h. Don't include utime.h
331 or worry about struct utimbuf; gnulib does that for us now.
332 (gettimeofday): Remove; gnulib provides a substitute.
333 (make_timeval): New function.
334 (set_file_times): Now sets ns-resolution time stamps.
335 New arg FD; all uses changed.
336 (time_from_jiffies, ltime_from_jiffies, get_up_time)
337 (system_process_attributes):
338 Now returns ns-resolution time stamp. All uses changed.
339 Check for time stamp overflow.
340
341 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
342 provides a substitute now.
343
344 * systime.h: Include timespec.h rather than sys/time.h and time.h,
345 since it guarantees struct timespec.
346 (EMACS_TIME): Now struct timespec, so that we can support
347 ns-resolution time stamps.
348 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
349 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
350 (EMACS_USECS): Remove.
351 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
352 so multiply the arg by 1000 before storing it.
353 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
354 New macros.
355 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
356 Port to ns-resolution time stamps.
357 (EMACS_TIME_NEG_P): Remove; replaced by....
358 (EMACS_TIME_SIGN): New macro.
359 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
360 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
361 (set_file_times, make_time, lisp_time_argument): Adjust signature.
362 (make_timeval, make_lisp_time, decode_time_components): New decls.
363 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
364 that it mishandled time_t overflow. You can't compare by subtracting!
365 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
366 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
367
368 * term.c: Include <sys/time.h>.
369 (timeval_to_Time): New function, for proper overflow wraparound.
370 (term_mouse_position, term_mouse_click): Use it.
371
372 * undo.c (record_first_change): Support higher-resolution time stamps
373 in the undo buffer.
374 (Fprimitive_undo): Use them when restoring time stamps.
375
376 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
377 (w32_get_internal_run_time):
378 Port to higher-resolution Emacs time stamps.
379 (ltime): Now accepts single 64-bit integer, as that's more convenient
380 for callers.
381
382 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
383
384 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
385 for compatibility with pselect. Support ns-resolution time stamps.
386
387 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
388
389 * xselect.c (wait_for_property_change, x_get_foreign_selection):
390 Check for time stamp overflow, and support ns-resolution time stamps.
391
392 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
393 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
394 (timeval_subtract): Remove; no longer needed.
395 (XTflash, XTring_bell, x_wait_for_event):
396 Port to ns-resolution time stamps. Don't assume time_t is signed.
397
b6a92dfe
CY
3982012-06-22 Chong Yidong <cyd@gnu.org>
399
400 * xdisp.c (x_consider_frame_title): Revert last change.
401
d251c37c
EZ
4022012-06-22 Eli Zaretskii <eliz@gnu.org>
403
404 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
405 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
406 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
407 staticidx goes up to 1597 out of 1600 = 0x640.)
408
f10deafb
PE
4092012-06-20 Paul Eggert <eggert@cs.ucla.edu>
410
411 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
412 Otherwise, the umask might be mistakenly 0 while handling input signals.
413
ec6de1e2
SM
4142012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
415
416 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
417
28be1ada
DA
4182012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
419
420 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
421 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
422 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
423 access to `contents' member of Lisp_Vector objects with AREF and ASET
424 where appropriate.
425
c6bf3022
CY
4262012-06-19 Chong Yidong <cyd@gnu.org>
427
428 * frame.c (delete_frame): When selecting a frame on a different
429 text terminal, do not alter the terminal's top-frame.
430
431 * xdisp.c (format_mode_line_unwind_data): Record the target
432 frame's selected window and its terminal's top-frame.
433 (unwind_format_mode_line): Restore them.
434 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
435 Callers changed.
436 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
437 since tty frames can be explicitly named.
438 (prepare_menu_bars): Likewise.
439
440 * term.c (Ftty_top_frame): New function.
441
defd4196
PE
4422012-06-18 Paul Eggert <eggert@cs.ucla.edu>
443
444 Port byte-code-meter to modern targets.
445 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
446 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 447 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
448 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
449 (METER_1, METER_2): Simplify.
450
1053a871
SM
4512012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
452
453 * data.c (Fdefalias): Return `symbol' (bug#11686).
454
b7e8d081
MR
4552012-06-18 Martin Rudalics <rudalics@gmx.at>
456
457 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
458 gets killed during executing of this function (Bug#11665).
459 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
460 (Vkill_buffer_query_functions): In doc-string say that functions
461 run by this hook should not change the current buffer.
462
7ea2b339
PE
4632012-06-18 Paul Eggert <eggert@cs.ucla.edu>
464
465 Fix recently-introduced process.c problems found by static checking.
466 * process.c (write_queue_push, write_queue_pop, send_process):
467 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
468 (write_queue_pop): Fix pointer signedness problem.
469 (send_process): Remove unused local.
470
96a313a1
CY
4712012-06-17 Chong Yidong <cyd@gnu.org>
472
473 * xdisp.c (redisplay_internal): No need to redisplay terminal
474 frames that are not on top.
475
20ca2e94
TN
4762012-06-17 Troels Nielsen <bn.troels@gmail.com>
477
478 * process.c (make_process): Initialize write_queue.
479 (write_queue_push, write_queue_pop): New functions.
480 (send_process): Use them to maintain correct ordering of process
481 writes (Bug#10815).
482
9a900ca9
PE
4832012-06-17 Paul Eggert <eggert@cs.ucla.edu>
484
310fbfa8
PE
485 * lisp.h (eassert): Assume C89 or later.
486 This removes the need for CHECK.
487 (CHECK): Remove. Its comments about always evaluating its
488 argument were confusing, as 'eassert' typically does not evaluate
489 its argument.
490
27bb1ca4
PE
491 * coding.c (produce_chars): Use ptrdiff_t, not int.
492
9a900ca9
PE
493 * xterm.c (x_draw_underwave): Check for integer overflow.
494 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
495
41b7f8bc 4962012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
497
498 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
499 referenced (Bug#11583).
500
9b0e3eba
AA
5012012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
502
503 Implement wave-style variant of underlining.
504 * dispextern.h (face_underline_type): New enum.
505 (face): Add field for underline type.
506 * nsterm.m (ns_draw_underwave): New function.
507 (ns_draw_text_decoration): Use it.
508 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
509 New functions.
510 (x_draw_glyph_string): Use them.
511 * xfaces.c (Qline, Qwave): New Lisp objects.
512 (check_lface_attrs, merge_face_ref)
1053a871
SM
513 (Finternal_set_lisp_face_attribute, realize_x_face):
514 Handle wave-style underline face attributes.
9b0e3eba
AA
515 * xterm.c (x_draw_underwave): New function.
516 (x_draw_glyph_string): Use it.
517
0fb52f11
JB
5182012-06-16 Juanma Barranquero <lekktu@gmail.com>
519
520 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
521 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
522 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
523 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
524 ($(BLD)/w32select.$(O)): Update dependencies.
525
e5560ff7
AS
5262012-06-16 Andreas Schwab <schwab@linux-m68k.org>
527
528 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
529 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
530 * character.c (_fetch_multibyte_char_p): Remove.
531 * alloc.c: Include "character.h" before "buffer.h".
532 * bidi.c: Likewise.
533 * buffer.c: Likewise.
534 * bytecode.c: Likewise.
535 * callint.c: Likewise.
536 * callproc.c: Likewise.
537 * casefiddle.c: Likewise.
538 * casetab.c: Likewise.
539 * category.c: Likewise.
540 * cmds.c: Likewise.
541 * coding.c: Likewise.
542 * composite.c: Likewise.
543 * dired.c: Likewise.
544 * dispnew.c: Likewise.
545 * doc.c: Likewise.
546 * dosfns.c: Likewise.
547 * editfns.c: Likewise.
548 * emacs.c: Likewise.
549 * fileio.c: Likewise.
550 * filelock.c: Likewise.
551 * font.c: Likewise.
552 * fontset.c: Likewise.
553 * fringe.c: Likewise.
554 * indent.c: Likewise.
555 * insdel.c: Likewise.
556 * intervals.c: Likewise.
557 * keyboard.c: Likewise.
558 * keymap.c: Likewise.
559 * lread.c: Likewise.
560 * macros.c: Likewise.
561 * marker.c: Likewise.
562 * minibuf.c: Likewise.
563 * nsfns.m: Likewise.
564 * nsmenu.m: Likewise.
565 * print.c: Likewise.
566 * process.c: Likewise.
567 * regex.c: Likewise.
568 * region-cache.c: Likewise.
569 * search.c: Likewise.
570 * syntax.c: Likewise.
571 * term.c: Likewise.
572 * textprop.c: Likewise.
573 * undo.c: Likewise.
574 * unexsol.c: Likewise.
575 * w16select.c: Likewise.
576 * w32fns.c: Likewise.
577 * w32menu.c: Likewise.
578 * window.c: Likewise.
579 * xdisp.c: Likewise.
580 * xfns.c: Likewise.
581 * xmenu.c: Likewise.
582 * xml.c: Likewise.
583 * xselect.c: Likewise.
584
2f07e6af
EZ
5852012-06-16 Eli Zaretskii <eliz@gnu.org>
586
1053a871
SM
587 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
588 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 589 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
590 row.
591 (handle_face_prop): Use chunk-relative overlay string index when
592 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
593 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
594 the rightmost. (Bug#11720)
2f07e6af 595
29b83cec
AS
5962012-06-16 Andreas Schwab <schwab@linux-m68k.org>
597
598 * category.h (CHAR_HAS_CATEGORY): Define as inline.
599 (CATEGORY_MEMBER): Enforce 1/0 value.
600 * category.c (_temp_category_set): Remove.
601
4c5501e9
EZ
6022012-06-16 Eli Zaretskii <eliz@gnu.org>
603
604 * window.c (Fdelete_other_windows_internal)
605 (Fdelete_window_internal): Don't access frame's mouse highlight
606 info of the initial frame. (Bug#11677)
607
2b570124
PE
6082012-06-14 Paul Eggert <eggert@cs.ucla.edu>
609
e93864f9
PE
610 * .gdbinit (xgetint): Fix recently-introduced paren typo.
611 Assume USE_2_TAGS_FOR_INTS.
612 (xreload): Adjust $tagmask width to match recent lisp.h change.
613
2b570124
PE
614 Simplify lisp.h in minor ways that should not affect code.
615 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
616 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
617 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
618 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
619 (INTTYPEBITS): New macro, for clarity.
620 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
621 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
622 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
623 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
624 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
625
81755f69
JB
6262012-06-13 Juanma Barranquero <lekktu@gmail.com>
627
628 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
629
16192a57
GM
6302012-06-13 Glenn Morris <rgm@gnu.org>
631
632 * s/bsd-common.h (BSD4_3):
633 * s/usg5-4-common.h (USG5_4): No longer define; unused.
634
646b5f55
AS
6352012-06-13 Andreas Schwab <schwab@linux-m68k.org>
636
637 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
638 instead of union.
639 (XLI, XIL): Define.
1053a871
SM
640 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
641 Use them.
642 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 643 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 644 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
645 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
646 * frame.c (delete_frame): Remove outdated comment.
647 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
648 USE_LISP_UNION_TYPE.
649 (Fw32_unregister_hot_key): Likewise.
650 (Fw32_toggle_lock_key): Likewise.
651 * w32menu.c (add_menu_item): Likewise.
652 (w32_menu_display_help): Use XIL instead of checking
653 USE_LISP_UNION_TYPE.
654 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
655 (init_heap): Likewise.
656 * w32term.c (w32_read_socket): Update comment.
657
1d3823c9
GM
6582012-06-13 Glenn Morris <rgm@gnu.org>
659
c62ff706
GM
660 * s/usg5-4-common.h, src/s/unixware.h:
661 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
662
1d3823c9
GM
663 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
664
bfe3e0a2
PE
6652012-06-13 Paul Eggert <eggert@cs.ucla.edu>
666
667 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
668 * alloc.c (make_number) [!defined make_number]:
669 Remove, as lisp.h always defines this now.
670 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
671 (roundup_size): Verify that it is a power of 2.
672 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
673 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
674 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
675 -DUSE_LSB_TAG=0, to override the automatically-selected default.
676 USE_LSB_TAG now is always defined to be either 0 or 1.
677 All uses changed.
678 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
679 code works fine either way, and efficiency is not a concern here,
680 as the union type is for debugging, not for production.
681 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
682 Use an inline function on all platforms when using the union type,
683 since this is simpler and 'static inline' can be used portably
684 within Emacs now.
685 (LISP_INITIALLY_ZERO): New macro.
686 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
687 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
688
45fa9c0f
GM
6892012-06-12 Glenn Morris <rgm@gnu.org>
690
b4492cba
GM
691 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
692
693 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 694
45fa9c0f
GM
695 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
696 Move BROKEN_SIGIO to configure.
697
698 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
699 Move NO_TERMIO to configure.
700
0e25d334
CY
7012012-06-12 Chong Yidong <cyd@gnu.org>
702
703 * image.c (imagemagick_load_image): Use MagickFlattenImage if
704 MagickMergeImageLayers is undefined. Use pixel pusher loop if
705 MagickExportImagePixels is undefined.
706
43682bb6
PE
7072012-06-12 Paul Eggert <eggert@cs.ucla.edu>
708
709 * image.c (imagemagick_load_image): Remove unused label.
710
a9be7d2b
GM
7112012-06-11 Glenn Morris <rgm@gnu.org>
712
713 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
714 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
715 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
716 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
717
3017f87f
SM
7182012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
719
720 * alloc.c (make_byte_code): New function.
721 (Fmake_byte_code): Use it. Don't purify here.
722 * lread.c (read1): Use it as well to avoid extra allocation.
723
1b9b4cf4
CY
7242012-06-11 Chong Yidong <cyd@gnu.org>
725
726 * image.c (imagemagick_load_image): Implement transparency.
727
95988fcf
AS
7282012-06-10 Andreas Schwab <schwab@linux-m68k.org>
729
730 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
731 account for preceding backslashes. (Bug#11663)
732
cd4eb164
CY
7332012-06-09 Chong Yidong <cyd@gnu.org>
734
735 * term.c: Support italics in capable terminals (Bug#9652).
736 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
737 (turn_on_face): Output using TS_enter_italic_mode if available.
738 Don't handle unused blinking and alt-charset cases.
739 (turn_off_face): Handle italic case; discard unused tty_blinking_p
740 and tty_alt_charset_p cases.
741 (tty_capable_p, init_tty): Support italics.
742
743 * termchar.h (struct tty_display_info): Add field for italics.
744 Remove unused blink field.
745
746 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
747 Handle slant.
748
749 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
750 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
751 tty_alt_charset_p. Add tty_italic_p.
752
ff88beb8
MA
7532012-06-09 Michael Albinus <michael.albinus@gmx.de>
754
755 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
756 dbus_type_is_basic if available.
757 (xd_extract_signed, xd_extract_unsigned): Rename from
758 extract_signed and extract_unsigned, respectively. Adapt callers.
759
44286096
CY
7602012-06-09 Chong Yidong <cyd@gnu.org>
761
1682701f
CY
762 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
763
44286096
CY
764 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
765 case (Bug#9752).
766
d86feb17
PE
7672012-06-08 Paul Eggert <eggert@cs.ucla.edu>
768
769 * xdisp.c (vmessage): Treat frame message as multibyte.
770 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
771 would generate the diagnostic "Making \302\247 buffer-local while
772 let-bound!".
773
d5c20fe8
EZ
7742012-06-08 Eli Zaretskii <eliz@gnu.org>
775
776 * dispnew.c (showing_window_margins_p): Undo last change, which
777 was done due to an inadvertent commit.
778 (adjust_frame_glyphs_for_frame_redisplay): Do call
779 showing_window_margins_p.
780
513749ee
SM
7812012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
782
783 * eval.c (Fmake_var_non_special): New primitive.
784 (syms_of_eval): Defsubr it.
785 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
786
d4a8f5c1
JB
7872012-06-08 Juanma Barranquero <lekktu@gmail.com>
788
789 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
790 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
791
8bbbc977
EZ
7922012-06-08 Eli Zaretskii <eliz@gnu.org>
793
794 * alloc.c (allocate_vectorlike): Fix last change.
795
f3372c87
DA
7962012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
797
798 Block-based vector allocation of small vectors.
799 * lisp.h (struct vectorlike_header): New field `nbytes',
800 adjust comment accordingly.
801 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
802 to denote vector blocks. Adjust users (live_vector_p,
803 mark_maybe_pointer, valid_lisp_object_p) accordingly.
804 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
805 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
806 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
807 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
808 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
809 (roundup_size): New constant.
810 (struct vector_block): New data type.
811 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 812 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
813 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
814 (sweep_vectors): New functions.
815 (allocate_vectorlike): Return `zero_vector' as the only vector of
816 0 items. Allocate new vector from block if vector size is less than
817 or equal to VBLOCK_BYTES_MAX.
818 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
819 (init_alloc_once): Add call to init_vectors.
820
4f18a4ed
SM
8212012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
822
823 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
824
86f158bc
PE
8252012-06-07 Paul Eggert <eggert@cs.ucla.edu>
826
827 * doprnt.c (doprnt): Truncate multibyte char correctly.
828 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
829 would mishandle a string argument "Xc" if X was a multibyte
830 character of length 2: it would truncate after X's first byte
831 rather than including all of X.
832
c5cfcbe0
CY
8332012-06-06 Chong Yidong <cyd@gnu.org>
834
835 * buffer.c (word_wrap): Doc fix.
836
c05cf390
PE
8372012-06-04 Paul Eggert <eggert@cs.ucla.edu>
838
839 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
840
0c3461de
GM
8412012-06-03 Glenn Morris <rgm@gnu.org>
842
843 * xdisp.c (tool-bar-style): Doc fix.
844
c71232db
UM
8452012-06-03 Ulrich Müller <ulm@gentoo.org>
846
847 * Makefile.in (PAXCTL): Define.
848 (temacs$(EXEEXT)): Disable memory randomization for the temacs
849 binary via PaX flags if the paxctl utility is available.
850 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
851 Restore PaX flags to their default. (Bug#11398)
852
383f7350
CY
8532012-06-03 Chong Yidong <cyd@gnu.org>
854
855 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
856 buffer (Bug#11226).
857
5f2c76c6
CY
8582012-06-03 Chong Yidong <cyd@gnu.org>
859
860 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
861 (note_mode_line_or_margin_highlight): If there is no help echo,
862 use mode-line-default-help-echo. Handle the case where the mouse
863 position is past the end of the mode line string.
864
865 * buffer.c (buffer_local_value_1): New function, split from
866 Fbuffer_local_value; can return Qunbound.
867 (Fbuffer_local_value): Use it.
868 (Vmode_line_format): Docstring tweaks.
869
773d47f6
PE
8702012-06-02 Paul Eggert <eggert@cs.ucla.edu>
871
872 * sysdep.c (system_process_attributes): Improve comment.
873
f2d6a3df
SM
8742012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
875
876 * keyboard.c: Export real-this-command to Elisp.
877 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
878 and DEFVAR it. Update all users.
879
63810350
PE
8802012-06-02 Paul Eggert <eggert@cs.ucla.edu>
881
7bd5c1f4
PE
882 * minibuf.c (Fassoc_string): Remove duplicate declaration.
883
63810350
PE
884 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
885 Convert pctcpu and pctmem to Lisp float properly.
886 Let the compiler fold better, as 100.0/0x8000 is exact.
887
a2821611
AS
8882012-06-02 Andreas Schwab <schwab@linux-m68k.org>
889
890 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
891 cons_block.
892
5fceba1d
PE
8932012-06-01 Paul Eggert <eggert@cs.ucla.edu>
894
895 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
896
c98ff5dd
DA
8972012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
898
899 For a 'struct window', replace some Lisp_Object fields to
900 bitfields where appropriate, remove unused fields.
901 * window.h (struct window): Remove unused 'last_mark_x' and
902 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
903 change it's type from Lisp_Object to bitfield.
904 Change type of 'force_start', 'optional_new_start',
905 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
906 fields from Lisp_Object to bitfield. Adjust users accordingly.
907
ca34e0be
PE
9082012-05-31 Paul Eggert <eggert@cs.ucla.edu>
909
910 Pacify gcc -Wdouble-precision when using Xaw.
911 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
912 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
913 Use 'float' consistently, rather than 'float' in most places
914 and 'double' in a couple of places.
915
efc00ab1 9162012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
917
918 * xdisp.c (handle_stop): Detect whether we have overlay strings
919 loaded by testing it->current.overlay_string_index to be
920 non-negative, instead of checking whether n_overlay_strings is
921 positive. (Bug#11587)
922
efc00ab1 9232012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
924
925 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
926
927 * doc.c (Fsubstitute_command_keys): Doc fix.
928
efc00ab1 9292012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
930
931 * search.c (search_buffer): Remove calls to
932 r_alloc_inhibit_buffer_relocation, as it is now called by
933 maybe_unify_char, which was the cause of relocation of buffer text
934 in bug#11519.
935
efc00ab1 9362012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
937
938 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
939 for the duration of call to load_charset, to avoid problems with
940 callers of maybe_unify_char that access buffer text through C
941 pointers.
942
943 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
944 decrement the inhibition flag, instead of just setting or
945 resetting it.
946
ba93a187
PE
9472012-05-31 Paul Eggert <eggert@cs.ucla.edu>
948
949 Remove obsolete '#define static' cruft.
950 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
951 This #undef was "temporary" in 2000; it is no longer needed
952 now that '#define static' has gone away.
953 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
954 (gray_bitmap_bits): Remove; no longer needed.
955 All uses replaced with definiens.
956 * xterm.c: Include "bitmaps/gray.xbm".
957
9e4bf381
PE
9582012-05-30 Paul Eggert <eggert@cs.ucla.edu>
959
960 Clean up __executable_start, monstartup when --enable-profiling.
961 The following changes affect the code only when profiling.
962 * dispnew.c (__executable_start): Rename from safe_bcopy.
963 Define only on platforms that need it.
964 * emacs.c: Include <sys/gmon.h> when profiling.
965 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
966 (__executable_start): Remove decl, since lisp.h does it now.
967 (safe_bcopy): Remove decl; no longer has that name.
968 (main): Coalesce #if into single bit of code, for simplicity.
969 Cast pointers to uintptr_t, since standard libraries want integers
970 and not pointers.
971 * lisp.h (__executable_start): New decl.
972
32d72c2f
GM
9732012-05-31 Glenn Morris <rgm@gnu.org>
974
975 * image.c (Fimagemagick_types): Doc fix.
976
baac5bc7
JM
9772012-05-30 Jim Meyering <meyering@redhat.com>
978
979 * callproc.c (Fcall_process_region): Include directory component
980 in mkstemp error message (Bug#11586).
981
72cb32cf
PE
9822012-05-30 Paul Eggert <eggert@cs.ucla.edu>
983
984 * alloc.c, lisp.h (make_pure_vector): Now static.
985
61b108cc
SM
9862012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
987
988 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
989 Move to byte-run.el.
990 (Fautoload): Do the hash-doc more carefully.
991 * data.c (Fdefalias): Purify definition, except for keymaps.
992 (Qdefun): Move from eval.c.
993 * lisp.h (Qdefun): Remove.
994 * lread.c (read1): Tiny simplification.
995
471fe23d
TN
9962012-05-29 Troels Nielsen <bn.troels@gmail.com>
997
934f3f58 998 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
999 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
1000 Bug#9642, but explicitly check that the buffer the overlay would
1001 be moved to is live and rearrange lines to make sure that errors
1002 will not put the overlay in an inconsistent state.
1003 (Fdelete_overlay): Cosmetics.
1004
85d0efd1
EZ
10052012-05-28 Eli Zaretskii <eliz@gnu.org>
1006
1007 * w32term.c (my_bring_window_to_top): New function.
1008 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
1009 could be different from the original one.
1010 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
1011 (Bug#11513)
1012
1013 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
1014 by calling BringWindowToTop.
1015
1016 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
1017 (WM_EMACS_END): Increase by one.
1018
da92a98c
PE
10192012-05-28 Paul Eggert <eggert@cs.ucla.edu>
1020
1021 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
1022 This avoids undefined behavior that might cause the eassert
1023 to not catch an out-of-range value.
1024
74d1f848
JB
10252012-05-28 Juanma Barranquero <lekktu@gmail.com>
1026
1027 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
1028 Update dependencies.
1029
9e1a06fc
EZ
10302012-05-27 Eli Zaretskii <eliz@gnu.org>
1031
1032 * bidi.c (bidi_mirror_char): Fix last change.
1033
f3dd7312
AS
10342012-05-27 Andreas Schwab <schwab@linux-m68k.org>
1035
1036 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
1037 when referring to sectname field in printf format.
1038
81899c91
PE
10392012-05-27 Paul Eggert <eggert@cs.ucla.edu>
1040
57b81a9f
PE
1041 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
1042 Only r_alloc_inhibit_buffer_relocation needed to be added;
1043 the others were already declared.
1044
81899c91
PE
1045 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
1046 before checking whether it's out of range. Put the check inside
1047 eassert. See
1048 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
1049
33017faf 10502012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
1051
1052 * callproc.c (Fcall_process): Restore a line that was accidentally
1053 commented out in the 2011-02-13 change (bug#11547).
1054
33017faf 10552012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
1056
1057 * lisp.h [REL_ALLOC]: Add prototypes for external functions
1058 defined on ralloc.c.
1059
1060 * buffer.c [REL_ALLOC]: Remove prototypes of
1061 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
1062 they are now on lisp.h.
1063
1064 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
1065
1066 * search.c (search_buffer): Use it to inhibit relocation of buffer
1067 text while re_search_2 is doing its job, because re_search_2 is
1068 passed C pointers to buffer text. (Bug#11519)
1069
23415acf
EZ
1070 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
1071 Update value to 24.
1072
44e27368
EZ
1073 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
1074 state after an additional call to move_it_in_display_line_to, keep
1075 the values of it->max_ascent and it->max_descent found for the
1076 entire line.
1077 (pos_visible_p): Revert the comparison against bottom_y to what it
1078 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
1079 (Bug#11464)
1080
c1892f11
PE
10812012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1082
1083 Fix coding-related core dumps with gcc -ftrapv.
1084 The code was computing A - B, where A and B are pointers, and B is
1085 random garbage. This can lead to core dumps on platforms that
1086 have special pointer registers, and it also leads to core dumps on
1087 x86-64 when compiled with gcc -ftrapv. The fix is to compute
1088 A - B only when B is initialized properly.
1089 * coding.c (coding_set_source, coding_set_destination): Return void.
1090 (coding_change_source, coding_change_destinations): New functions,
1091 with the old behaviors of coding_set_source and coding_set_destination.
1092 All callers that need an offset changed to use these new functions.
1093
eb7afdad
GM
10942012-05-26 Glenn Morris <rgm@gnu.org>
1095
1096 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
1097
f12fdf02
EZ
10982012-05-26 Eli Zaretskii <eliz@gnu.org>
1099
53a63be6 1100 Extend mouse support on W32 text-mode console.
61b108cc
SM
1101 * xdisp.c (draw_row_with_mouse_face):
1102 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 1103
eb3f6f01 1104 * w32console.c: Include window.h.
61b108cc
SM
1105 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
1106 New functions.
eb3f6f01
EZ
1107 (initialize_w32_display): Initialize mouse-highlight data.
1108
53a63be6
EZ
1109 * w32inevt.c: Include termchar.h and window.h.
1110 (do_mouse_event): Support mouse-autoselect-window. When the mouse
1111 moves, call note_mouse_highlight. If help_echo changed, call
1112 gen_help_event to produce help-echo message in the echo area.
1113 Call clear_mouse_face if mouse_face_hidden is set in the mouse
1114 highlight info.
1115
4cfd81f6
PE
11162012-05-26 Paul Eggert <eggert@cs.ucla.edu>
1117
1118 * lread.c (read1): Simplify slightly to avoid an overflow warning
1119 with GCC 4.7.0 on x86-64.
1120
4446092a
EZ
11212012-05-26 Eli Zaretskii <eliz@gnu.org>
1122
1123 * bidi.c (bidi_mirror_char): Revert last change: an int is
1124 definitely wide enough here.
1125
42b2a986 11262012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 1127
42b2a986 1128 Fix integer width and related bugs (Bug#9874).
eb106a49 1129 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
1130 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
1131 (string_bytes, check_sblock, allocate_string_data):
1132 (compact_small_strings, Fmake_bool_vector, make_string)
1133 (make_unibyte_string, make_multibyte_string)
1134 (make_string_from_bytes, make_specified_string)
1135 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
1136 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
1137 (mark_vectorlike):
1138 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1139 (allocate_pseudovector):
1140 Use int, not EMACS_INT, where int is wide enough.
1141 (inhibit_garbage_collection, Fgarbage_collect):
1142 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1143 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
1144 int might not be wide enough.
1145 (bidi_cache_search, bidi_cache_find, bidi_init_it)
1146 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
1147 (bidi_at_paragraph_end, bidi_find_paragraph_start)
1148 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
1149 (bidi_level_of_next_char, bidi_move_to_visually_next):
1150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1151 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
1152 (Fkill_buffer, Fset_buffer_major_mode)
1153 (advance_to_char_boundary, Fbuffer_swap_text)
1154 (Fset_buffer_multibyte, overlays_at, overlays_in)
1155 (overlay_touches_p, struct sortvec, record_overlay_string)
1156 (overlay_strings, recenter_overlay_lists)
1157 (adjust_overlays_for_insert, adjust_overlays_for_delete)
1158 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
1159 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
1160 (Foverlay_recenter, last_overlay_modification_hooks_used)
1161 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
1162 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
1163 (validate_region): Omit unnecessary test for b <= e,
1164 since that's guaranteed by the previous test.
d311d28c
PE
1165 (adjust_overlays_for_delete): Avoid pos + length overflow.
1166 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
1167 (report_overlay_modification):
1168 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1169 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
1170 Omit pointer cast, which isn't needed anyway, and doesn't work
1171 after the EMACS_INT -> ptrdiff_t change.
02481186 1172 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
1173 * buffer.h: Adjust decls to match defn changes elsewhere.
1174 (struct buffer_text, struct buffer):
1175 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1176 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
1177 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
1178 not int, to avoid needless 32-bit limit on 64-bit hosts.
1179 (exec_byte_code): Use tighter memory-full test, one that checks
1180 for alloca overflow. Don't compute the address of the object just
1181 before an array, as that's not portable. Use EMACS_INT, not
1182 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
1183 * callint.c (Fcall_interactively):
1184 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1185 * callproc.c (call_process_kill, Fcall_process):
1186 Don't assume pid_t fits into an Emacs fixnum.
1187 (call_process_cleanup, Fcall_process, child_setup):
1188 Don't assume pid_t fits into int.
1189 (call_process_cleanup, Fcall_process, delete_temp_file)
1190 (Fcall_process_region):
1191 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1192 (Fcall_process): Simplify handling of volatile integers.
1193 Use int, not EMACS_INT, where int will do.
1194 * casefiddle.c (casify_object, casify_region, operate_on_word)
1195 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
1196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1197 (casify_object): Avoid integer overflow when overallocating buffer.
1198 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 1199 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
1200 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
1201 * category.h (CATEGORYP): Don't assume arg is nonnegative.
1202 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
1203 integers are now checked earlier. All uses replaced with XINT.
1204 (ccl_driver):
1205 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1206 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
1207 (ccl_driver, Fregister_code_conversion_map):
1208 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
1209 (resolve_symbol_ccl_program): Check that vector header is in range.
1210 Always copy the vector, so that we can check its contents reliably
1211 now rather than having to recheck each instruction as it's being
1212 executed. Check that vector words fit in 'int'.
1213 (ccl_get_compiled_code, Fregister_ccl_program)
1214 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
1215 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
1216 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
1217 contents are in range.
1218 (Fccl_execute_on_string): Check that status is in range.
1219 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
1220 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
1221 Accept and return EMACS_INT, not int, because callers can pass values
1222 out of 'int' range.
1223 (c_string_width, strwidth, lisp_string_width, chars_in_text)
1224 (multibyte_chars_in_text, parse_str_as_multibyte)
1225 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
1226 (str_as_unibyte, str_to_unibyte, string_count_byte8)
1227 (string_escape_byte8, Fget_byte):
1228 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 1229 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
1230 avoid mishandling large integers.
1231 * character.h: Adjust decls to match defn changes elsewhere.
1232 * charset.c (load_charset_map_from_file, find_charsets_in_text)
1233 (Ffind_charset_region):
1234 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1235 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
1236 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 1237 Don't assume fixnum fits in int.
d311d28c
PE
1238 (load_charset_map_from_vector, Fmap_charset_chars):
1239 Remove now-unnecessary CHECK_NATNUMs.
1240 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
1241 Don't rely on undefined behavior with signed left shift overflow.
1242 Don't assume unsigned int fits into fixnum, or that fixnum fits
1243 into unsigned int. Don't require max_code to be a valid fixnum;
1244 that's not true for gb10830 4-byte on a 32-bit host. Allow
1245 invalid_code to be a cons, for the same reason. Require code_offset
1246 to be a character. Avoid int overflow if max_char is close
1247 to INT_MAX.
1248 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
1249 this is intended anyway and avoids some undefined behavior.
1250 (load_charset_map): Pass unsigned, not int, as 2nd arg of
1251 INDEX_TO_CODE_POINT, as that's what it expects.
1252 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
1253 * charset.h (DECODE_CHAR): Return int, not unsigned;
1254 this is what was intended anyway, and it avoids undefined behavior.
1255 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
1256 integer-overflow issues.
1257 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
1258 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
1259 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
1260 * chartab.c (Fmake_char_table, Fset_char_table_range)
1261 (uniprop_get_decoder, uniprop_get_encoder):
1262 Don't assume fixnum fits in int.
1263 * cmds.c (move_point): New function, that does the gist of
1264 Fforward_char and Fbackward_char, but does so while checking
1265 for integer overflow more accurately.
c96e5d6a 1266 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
1267 (Fforward_line, Fend_of_line, internal_self_insert)
1268 (internal_self_insert):
1269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1270 Fix a FIXME, by checking for integer overflow when calculating
1271 target_clm and actual_clm.
1272 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 1273 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
1274 (ASSURE_DESTINATION, coding_alloc_by_realloc)
1275 (coding_alloc_by_making_gap, alloc_destination)
1276 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
1277 (encode_coding_utf_16, detect_coding_emacs_mule)
1278 (decode_coding_emacs_mule, encode_coding_emacs_mule)
1279 (detect_coding_iso_2022, decode_coding_iso_2022)
1280 (encode_invocation_designation, encode_designation_at_bol)
1281 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
1282 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
1283 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
1284 (encode_coding_ccl, encode_coding_raw_text)
1285 (detect_coding_charset, decode_coding_charset)
1286 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
1287 (produce_composition, produce_charset, produce_annotation)
1288 (decode_coding, handle_composition_annotation)
1289 (handle_charset_annotation, consume_chars, decode_coding_gap)
1290 (decode_coding_object, encode_coding_object, detect_coding_system)
1291 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
1292 (code_convert_region, code_convert_string)
8f50130c
PE
1293 (Fdefine_coding_system_internal)
1294 (coding_set_source, coding_set_destination):
d311d28c
PE
1295 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1296 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
1297 (Fdefine_coding_system_internal):
1298 Don't assume fixnums fit in int.
1299 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 1300 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
1301 (Funencodable_char_position, Fcheck_coding_systems_region)
1302 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 1303 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 1304 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 1305 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 1306 Don't access memory outside of the args array.
d311d28c 1307 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
1308 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
1309 result of ENCODE_CHAR.
d311d28c
PE
1310 * coding.h: Adjust decls to match defn changes elsewhere.
1311 (struct coding_system):
1312 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1313 * composite.c (get_composition_id, find_composition)
1314 (run_composition_function, update_compositions)
1315 (compose_text, composition_gstring_put_cache)
1316 (composition_gstring_p, composition_gstring_width)
1317 (fill_gstring_header, fill_gstring_body, autocmp_chars)
1318 (composition_compute_stop_pos, composition_reseat_it)
1319 (composition_update_it, struct position_record)
1320 (find_automatic_composition, composition_adjust_point)
1321 (Fcomposition_get_gstring, Ffind_composition_internal):
1322 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1323 (update_compositions):
1324 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1325 * composite.h: Adjust decls to match defn changes elsewhere.
1326 (struct composition):
1327 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1328 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
1329 Do not attempt to compute the address of the object just before a
1330 buffer; this is not portable.
1331 (Faref, Faset):
1332 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1333 (Faset): Use int, not EMACS_INT, where int is wide enough.
1334 (Fstring_to_number): Don't assume fixnums fit in int.
1335 (Frem): Don't assume arg is nonnegative.
1336 * dbusbind.c (xd_append_arg): Check for integers out of range.
1337 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 1338 (extract_signed, extract_unsigned): New functions.
243e0530
PE
1339 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
1340 (xd_get_connection_references): Return ptrdiff_t, not int.
1341 All uses changed.
1342 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
1343 (xd_read_message_1):
1344 Use int, not unsigned, where the dbus API uses int.
1345 (Fdbus_message_internal): Don't overflow mtype.
1346 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
1347 * dired.c (directory_files_internal, file_name_completion, scmp)
1348 (file_name_completion_stat):
1349 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1350 (file_name_completion): Don't overflow matchcount.
1351 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
1352 * dispextern.h: Adjust decls to match defn changes elsewhere.
1353 (struct text_pos, struct glyph, struct bidi_saved_info)
1354 (struct bidi_string_data, struct bidi_it, struct composition_it)
1355 (struct it):
1356 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1357 (struct display_pos, struct composition_it, struct it):
1358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1359 * dispnew.c (increment_matrix_positions)
1360 (increment_row_positions, mode_line_string)
1361 (marginal_area_string):
1362 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 1363 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
1364 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1365 (duration_to_sec_usec): New function, to check for overflow better.
1366 (Fsleep_for, sit_for): Use it.
1367 * doc.c (get_doc_string, store_function_docstring):
1368 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1369 (get_doc_string, Fsnarf_documentation):
1370 Use int, not EMACS_INT, where int is wide enough.
1371 (get_doc_string):
1372 Use SAFE_ALLOCA, not alloca.
1373 Check for overflow when converting EMACS_INT to off_t.
1374 * doprnt.c (doprnt):
1375 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1376 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
1377 Don't assume uid_t fits into fixnum.
1378 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
1379 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
1380 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
1381 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
1382 (general_insert_function)
1383 (Finsert_char, make_buffer_string, make_buffer_string_both)
1384 (update_buffer_properties, Fbuffer_substring)
1385 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
1386 (Fsubst_char_in_region, check_translation)
1387 (Ftranslate_region_internal, save_restriction_restore, Fformat)
1388 (transpose_markers, Ftranspose_regions):
1389 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1390 (clip_to_bounds): Move to lisp.h as an inline function).
1391 (Fconstrain_to_field): Don't assume integers are nonnegative.
1392 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
1393 (Fsubst_char_in_region, Fsave_restriction):
1394 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1395 (Femacs_pid): Don't assume pid_t fits into fixnum.
1396 (lo_time): Use int, not EMACS_INT, when int suffices.
1397 (lisp_time_argument): Check for usec out of range.
1398 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
1399 (Fuser_login_name, Fuser_full_name): Signal an error
1400 if a uid argument is out of range, rather than relying on
1401 undefined behavior.
c8d5c857
PE
1402 (Fformat_time_string): Remove now-unnecessary check.
1403 lisp_time_argument checks for out-of-range usec now.
243e0530 1404 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
1405 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
1406 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
1407 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
1408 (init_cmdargs, Fdump_emacs):
1409 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1410 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
1411 the bottom (typically) 32 bits of the fixnum.
1412 * eval.c (specpdl_size, call_debugger):
1413 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1414 (when_entered_debugger, Fbacktrace_debug):
1415 Don't assume fixnum can fit in int.
1416 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
1417 the object just before a buffer; this is not portable.
1418 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
1419 (grow_specpdl, unbind_to):
1420 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1421 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
1422 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 1423 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
1424 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
1425 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
1426 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1427 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
1428 (a_write, e_write):
1429 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1430 (Fcopy_file, non_regular_nbytes, read_non_regular)
1431 (Finsert_file_contents):
1432 Use int, not EMACS_INT, where int is wide enough.
1433 (READ_BUF_SIZE): Verify that it fits in int.
1434 (Finsert_file_contents): Check that counts are in proper range,
1435 rather than assuming fixnums fit into ptrdiff_t etc.
1436 Don't assume fixnums fit into int.
125b3835 1437 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
1438 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
1439 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
1440 (string_char_to_byte, string_byte_to_char)
1441 (string_make_multibyte, string_to_multibyte)
1442 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
1443 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
1444 (substring_both, Fdelete, internal_equal, Ffillarray)
1445 (Fclear_string, mapcar1)
1446 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
1447 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
1448 (larger_vector, make_hash_table, maybe_resize_hash_table)
1449 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
1450 (Fmaphash, secure_hash):
1451 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1452 (concat): Check for string index and length overflow.
1453 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
1454 (Frequire):
1455 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1456 (larger_vector): New API (vec, incr_min, size_max) replaces old
1457 one (vec, new_size, init). This catches size overflow.
1458 INIT was removed because it was always Qnil.
1459 All callers changed.
1460 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
1461 the upper bound on a hash table index size.
1462 (make_hash_table, maybe_resize_hash_table): Use it.
1463 (secure_hash): Computer start_byte and end_byte only after
1464 they're known to be in ptrdiff_t range.
1465 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
1466 (Ffont_get_glyphs, Ffont_at):
1467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1468 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
1469 (Flist_fonts, Fopen_font):
1470 Don't assume fixnum can fit in int.
1471 (check_gstring): Don't assume index can fit in int.
1472 (font_match_p): Check that fixnum is a character, not a nonnegative
1473 fixnum, since the later code needs to stuff it into an int.
1474 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
1475 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
1476 conversion overflow issues.
1477 (Fopen_font): Check for integer out of range.
1478 (Ffont_get_glyphs): Don't assume index can fit in int.
1479 * font.h: Adjust decls to match defn changes elsewhere.
1480 * fontset.c (reorder_font_vector): Redo score calculation to avoid
1481 integer overflow.
1482 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
1483 printmax_t, where ptrdiff_t is wide enough.
1484 (Finternal_char_font):
1485 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1486 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
1487 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
1488 (Fset_frame_position, x_set_frame_parameters)
1489 (x_set_line_spacing, x_set_border_width)
1490 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
1491 Check that fixnums are in proper range for system types.
1492 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
1493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1494 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
1495 Use SAFE_ALLOCA_LISP, not alloca.
1496 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
1497 intptr_t is wide enough.
1498 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
1499 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
1500 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
1501 Check for fixnum out of range.
1502 * ftfont.c (ftfont_list): Don't assume index fits in int.
1503 Check that fixnums are in proper range for system types.
1504 (ftfont_shape_by_flt):
1505 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
1506 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
1507 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1508 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
1509 Check that fixnums are in proper range for system types.
1510 * gnutls.h: Adjust decls to match defn changes elsewhere.
1511 * gtkutil.c (xg_dialog_run):
1512 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1513 (update_frame_tool_bar):
1514 Check that fixnums are in proper range for system types.
1515 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 1516 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
1517 * indent.c (last_known_column, last_known_column_point):
1518 (current_column_bol_cache):
1519 (skip_invisible, current_column, check_display_width):
1520 (check_display_width, scan_for_column, current_column_1)
1521 (Findent_to, Fcurrent_indentation, position_indentation)
1522 (indented_beyond_p, Fmove_to_column, compute_motion):
1523 (Fcompute_motion, Fvertical_motion):
1524 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1525 (last_known_column_modified): Use EMACS_INT, not int.
1526 (check_display_width):
1527 (Fcompute_motion):
1528 Check that fixnums and floats are in proper range for system types.
1529 (compute_motion): Don't assume index or fixnum fits in int.
1530 (compute_motion, Fcompute_motion):
1531 Use int, not EMACS_INT, when it is wide enough.
1532 (vmotion): Omit local var start_hpos that is always 0; that way
1533 we don't need to worry about overflow in expressions involving it.
1534 * indent.h: Adjust decls to match defn changes elsewhere.
1535 (struct position):
1536 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1537 Use int, not EMACS_INT, where int is wide enough.
1538 Remove unused members ovstring_chars_done and tab_offset;
1539 all uses removed.
1540 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
1541 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
1542 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
1543 (make_gap, copy_text, insert, insert_and_inherit)
1544 (insert_before_markers, insert_before_markers_and_inherit)
1545 (insert_1, count_combining_before, count_combining_after)
1546 (insert_1_both, insert_from_string)
1547 (insert_from_string_before_markers, insert_from_string_1)
1548 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
1549 (adjust_after_replace, adjust_after_insert, replace_range)
1550 (replace_range_2, del_range, del_range_1, del_range_byte)
1551 (del_range_both, del_range_2, modify_region)
1552 (prepare_to_modify_buffer, signal_before_change)
1553 (signal_after_change, Fcombine_after_change_execute):
1554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1555 * intervals.c (traverse_intervals, rotate_right, rotate_left)
1556 (balance_an_interval, split_interval_right, split_interval_left)
1557 (find_interval, next_interval, update_interval)
1558 (adjust_intervals_for_insertion, delete_node, delete_interval)
1559 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1560 (static_offset_intervals, offset_intervals)
1561 (merge_interval_right, merge_interval_left, make_new_interval)
1562 (graft_intervals_into_buffer, temp_set_point_both)
1563 (temp_set_point, set_point, adjust_for_invis_intang)
1564 (set_point_both, move_if_not_intangible, get_property_and_range)
1565 (get_local_map, copy_intervals, copy_intervals_to_string)
1566 (compare_string_intervals, set_intervals_multibyte_1):
1567 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1568 * intervals.h: Adjust decls to match defn changes elsewhere.
1569 (struct interval):
1570 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1571 * keyboard.c (this_command_key_count, this_single_command_key_start)
1572 (before_command_key_count, before_command_echo_length, echo_now)
1573 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
1574 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
1575 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
1576 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
1577 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1578 (last_non_minibuf_size, last_point_position, echo_truncate)
1579 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
1580 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
1581 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
1582 (stuff_buffered_input):
1583 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1584 (last_auto_save, command_loop_1, read_char):
1585 Use EMACS_INT, not int, to avoid integer overflow.
1586 (record_char): Avoid overflow in total_keys computation.
1587 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
1588 * keyboard.h: Adjust decls to match defn changes elsewhere.
1589 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
1590 (Fkey_description, Fdescribe_vector, Flookup_key):
1591 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1592 (click_position): New function, to check that positions are in range.
1593 (Fcurrent_active_maps):
1594 (describe_command):
1595 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1596 (Faccessible_keymaps, Fkey_description):
1597 (preferred_sequence_p):
1598 Don't assume fixnum can fit into int.
1599 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
1600 Check for integer overflow in size calculations.
1601 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
1602 avoid mishandling large integers.
1603 * lisp.h: Adjust decls to match defn changes elsewhere.
1604 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
1605 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
1606 (struct Lisp_Marker):
1607 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1608 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
1609 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
1610 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
1611 All callers changed.
1612 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
1613 Assume the arg has valid form, since it always does.
1614 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
1615 unsigned integer system type.
1616 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
1617 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
1618 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1619 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
1620 (duration_to_sec_usec): New decl.
1621 * lread.c (read_from_string_index, read_from_string_index_byte)
1622 (read_from_string_limit, readchar, unreadchar, openp)
1623 (read_internal_start, read1, oblookup):
1624 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1625 (Fload, readevalloop, Feval_buffer, Feval_region):
1626 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1627 (openp): Check for out-of-range argument to 'access'.
1628 (read1): Use int, not EMACS_INT, where int is wide enough.
1629 Don't assume fixnum fits into int.
6efdadfd 1630 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
1631 (read_filtered_event): Use duration_to_sec_usec
1632 to do proper overflow checking on durations.
d311d28c
PE
1633 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
1634 in size calculation.
1635 (Fexecute_kbd_macro):
1636 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1637 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
1638 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
1639 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
1640 (set_marker_both, set_marker_restricted_both, marker_position)
1641 (marker_byte_position, Fbuffer_has_markers_at):
1642 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1643 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 1644 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
1645 It now merely ensures that the menu is large enough, without
1646 necessarily growing it, as this avoids some integer overflow issues.
1647 All callers changed.
1648 (keymap_panes, parse_single_submenu, Fx_popup_menu):
1649 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1650 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
1651 Use SAFE_ALLOCA_LISP, not alloca.
1652 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
1653 to EMACS_INT. Check that fixnums are in proper range for system types.
1654 * minibuf.c (minibuf_prompt_width, string_to_object)
1655 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
1656 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
1657 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1658 (get_minibuffer, read_minibuf_unwind):
1659 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1660 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
1661 this simplifies overflow checking. All callers changed.
1662 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
1663 (Ftest_completion):
1664 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1665 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
1666 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
1667 Check that fixnums are in proper range for system types.
1668 (Fx_create_frame, Fx_show_tip):
1669 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1670 * nsfont.m (ns_findfonts, nsfont_list_family):
1671 Don't assume fixnum fits in long.
1672 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
1673 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1674 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
1675 wide enough.
17fdb222 1676 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
1677 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1678 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
1679 (PRINTDECLARE, PRINTPREPARE):
1680 (strout, print_string):
1681 (print, print_preprocess, print_check_string_charset_prop)
1682 (print_object):
1683 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1684 (PRINTDECLARE):
1685 (temp_output_buffer_setup, Fprin1_to_string, print_object):
1686 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1687 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 1688 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 1689 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
1690 (print_error_message): Use SAFE_ALLOCA, not alloca.
1691 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
1692 (print_depth, new_backquote_output, print_number_index):
1693 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
1694 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
1695 (Fset_process_window_size, Fformat_network_address)
1696 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 1697 (sigchld_handler):
d311d28c 1698 Check that fixnums are in proper range for system types.
d44287d4 1699 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
1700 Check for process-ids out of pid_t range rather than relying on
1701 undefined behavior.
e4d81efc 1702 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
1703 (Fformat_network_address, read_process_output, send_process)
1704 (Fprocess_send_region, status_notify):
1705 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1706 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
1707 (wait_reading_process_output, read_process_output, exec_sentinel):
1708 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1709 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
1710 (Faccept_process_output): Use duration_to_sec_usec to do proper
1711 overflow checking on durations.
dde14581
PE
1712 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
1713 Don't assume pid_t fits in int.
02481186
PE
1714 * process.h (struct Lisp_Process): Members tick and update_tick
1715 are now of type EMACS_INT, not int.
b62b53e8
PE
1716 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
1717 configured --with-wide-int.
d311d28c
PE
1718 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
1719 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
1720 * search.c (looking_at_1, string_match_1):
1721 (fast_string_match, fast_c_string_match_ignore_case)
1722 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
1723 (scan_newline, find_before_next_newline, search_command)
1724 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
1725 (set_search_regs, wordify):
1726 (Freplace_match):
1727 (Fmatch_data):
1728 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1729 (string_match_1, search_buffer, set_search_regs):
1730 (Fmatch_data):
1731 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1732 (wordify): Check for overflow in size calculation.
1733 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
1734 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
1735 Check that fixnums are in proper range for system types.
1736 * sound.c (struct sound_device)
1737 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
1738 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1739 (Fplay_sound_internal):
1740 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 1741 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
1742 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
1743 (Fparse_partial_sexp):
1744 Don't assume fixnums can fit in int.
1745 (struct lisp_parse_state, find_start_pos, find_start_value)
1746 (find_start_value_byte, find_start_begv)
1747 (update_syntax_table, char_quoted, dec_bytepos)
1748 (find_defun_start, prev_char_comend_first, back_comment):
1749 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
1750 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
1751 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1752 (Finternal_describe_syntax_value): Check that match_lisp is a
1753 character, not an integer, since the code stuffs it into int.
1754 (scan_words, scan_sexps_forward):
1755 Check that fixnums are in proper range for system types.
1756 (Fforward_word):
1757 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1758 (scan_sexps_forward):
1759 Use CHARACTERP, not INTEGERP, since the value must fit into int.
1760 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
1761 * syntax.h: Adjust decls to match defn changes elsewhere.
1762 (struct gl_state_s):
1763 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
1764 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
1765 MOST_POSITIVE_FIXNUM.
d311d28c
PE
1766 * sysdep.c (wait_for_termination_1, wait_for_termination)
1767 (interruptible_wait_for_termination, mkdir):
1768 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
1769 (emacs_read, emacs_write):
1770 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
1771 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
1772 and double all fit in int.
d311d28c
PE
1773 * term.c (set_tty_color_mode):
1774 Check that fixnums are in proper range for system types.
1775 * termhooks.h (struct input_event):
1776 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1777 * textprop.c (validate_interval_range, interval_of)
1778 (Fadd_text_properties, set_text_properties_1)
1779 (Fremove_text_properties, Fremove_list_of_text_properties)
1780 (Ftext_property_any, Ftext_property_not_all)
1781 (copy_text_properties, text_property_list, extend_property_ranges)
1782 (verify_interval_modification):
1783 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1784 (Fnext_single_char_property_change)
1785 (Fprevious_single_char_property_change):
1786 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
1787 (copy_text_properties):
1788 Check for integer overflow in index calculation.
d311d28c
PE
1789 * undo.c (last_boundary_position, record_point, record_insert)
1790 (record_delete, record_marker_adjustment, record_change)
1791 (record_property_change):
1792 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1793 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
1794 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1795 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
1796 (Fx_hide_tip, Fx_file_dialog):
1797 * w32menu.c (set_frame_menubar):
1798 Use ptrdiff_t, not int, for consistency with rest of code.
1799 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
1800 (select_window, Fdelete_other_windows_internal)
1801 (window_scroll_pixel_based, window_scroll_line_based)
1802 (Frecenter, Fset_window_configuration):
1803 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1804 (Fset_window_hscroll, run_window_configuration_change_hook)
1805 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 1806 (Fscroll_other_window, Frecenter):
d311d28c
PE
1807 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1808 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
1809 Don't assume fixnum fits in int.
1810 (Fset_window_scroll_bars):
1811 Check that fixnums are in proper range for system types.
1812 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
1813 (string_pos, c_string_pos, number_of_chars, init_iterator)
1814 (in_ellipses_for_invisible_text_p, init_from_display_pos)
1815 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
1816 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
1817 (face_before_or_after_it_pos, handle_invisible_prop)
1818 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
1819 (display_prop_intangible_p, string_buffer_position_lim)
1820 (string_buffer_position, handle_composition_prop, load_overlay_strings)
1821 (get_overlay_strings_1, get_overlay_strings)
1822 (iterate_out_of_display_property, forward_to_next_line_start)
1823 (back_to_previous_visible_line_start, reseat, reseat_to_string)
1824 (get_next_display_element, set_iterator_to_next)
1825 (get_visually_first_element, compute_stop_pos_backwards)
1826 (handle_stop_backwards, next_element_from_buffer)
1827 (move_it_in_display_line_to, move_it_in_display_line)
1828 (move_it_to, move_it_vertically_backward, move_it_by_lines)
1829 (add_to_log, message_dolog, message_log_check_duplicate)
1830 (message2, message2_nolog, message3, message3_nolog
1831 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
1832 (current_message_1, truncate_echo_area, truncate_message_1)
1833 (set_message, set_message_1, store_mode_line_noprop)
1834 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
1835 (text_outside_line_unchanged_p, check_point_in_composition)
1836 (reconsider_clip_changes)
1837 (redisplay_internal, set_cursor_from_row, try_scrolling)
1838 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
1839 (redisplay_window, find_last_unchanged_at_beg_row)
1840 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
1841 (trailing_whitespace_p, find_row_edges, display_line)
1842 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
1843 (display_mode_element, store_mode_line_string)
1844 (pint2str, pint2hrstr, decode_mode_spec)
1845 (display_count_lines, display_string, draw_glyphs)
1846 (x_produce_glyphs, x_insert_glyphs)
1847 (rows_from_pos_range, mouse_face_from_buffer_pos)
1848 (fast_find_string_pos, mouse_face_from_string_pos)
1849 (note_mode_line_or_margin_highlight, note_mouse_highlight):
1850 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1851 (safe_call, init_from_display_pos, handle_fontified_prop)
1852 (handle_single_display_spec, load_overlay_strings)
1853 (with_echo_area_buffer, setup_echo_area_for_printing)
1854 (display_echo_area, echo_area_display)
1855 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
1856 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
1857 (redisplay_window, dump_glyph_row, display_mode_line)
1858 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 1859 (handle_display_spec, display_prop_string_p):
d311d28c
PE
1860 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1861 (handle_single_display_spec, build_desired_tool_bar_string)
1862 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
1863 (get_specified_cursor_type):
1864 Check that fixnums are in proper range for system types.
1865 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
1866 (Flookup_image_map):
1867 Don't assume fixnums fit in int.
1868 (compare_overlay_entries):
1869 Avoid mishandling comparisons due to subtraction overflow.
1870 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
1871 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
1872 (handle_tool_bar_click):
1873 Use int, not unsigned, since we prefer signed and the signedness
1874 doesn't matter here.
1875 (get_next_display_element, next_element_from_display_vector):
1876 Use int, not EMACS_INT, when int is wide enough.
1877 (start_hourglass): Use duration_to_sec_usec to do proper
1878 overflow checking on durations.
1879 * xfaces.c (Fbitmap_spec_p):
1880 Check that fixnums are in proper range for system types.
1881 (compare_fonts_by_sort_order):
1882 Avoid mishandling comparisons due to subtraction overflow.
1883 (Fx_family_fonts, realize_basic_faces):
1884 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1885 (Fx_family_fonts):
1886 Don't assume fixnum fits in int.
1887 Use SAFE_ALLOCA_LISP, not alloca.
1888 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
1889 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
1890 (face_at_buffer_position, face_for_overlay_string)
1891 (face_at_string_position):
1892 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1893 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
1894 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
1895 (Fx_show_tip):
1896 Check that fixnums are in proper range for system types.
1897 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
1898 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
1899 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1900 (Fx_change_window_property): Don't assume fixnums fit in int.
1901 * xfont.c (xfont_chars_supported):
1902 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1903 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
1904 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
1905 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1906 * xml.c (parse_region):
1907 * xrdb.c (magic_file_p):
1908 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1909 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
1910 (x_get_local_selection, x_reply_selection_request)
1911 (x_handle_selection_request, wait_for_property_change):
1912 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1913 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
1914 short is wide enough.
1915 (x_send_client_event): Don't assume fixnum fits in int.
1916 * xterm.c (x_x_to_emacs_modifiers):
1917 Don't assume EMACS_INT overflows nicely into int.
1918 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
1919 may come from Lisp.
1920 (handle_one_xevent): NATNUMP can eval its arg twice.
1921 (x_connection_closed):
1922 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1923 * xterm.h: Adjust decls to match defn changes elsewhere.
1924 (struct scroll_bar): Use struct vectorlike_header
1925 rather than rolling our own approximation.
1926 (SCROLL_BAR_VEC_SIZE): Remove; not used.
1927
c6574eb5
GM
19282012-05-25 Glenn Morris <rgm@gnu.org>
1929
1930 * lisp.mk (lisp): Update for more files being compiled now.
1931
e8d32c7e
SM
19322012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
1933
48def666
SM
1934 * lread.c: Remove `read_pure' which makes no difference.
1935 (read_pure): Remove var.
1936 (unreadpure): Remove function.
1937 (readevalloop): Don't call read_list with -1 flag.
1938 (read1, read_vector): Don't test read_pure any more.
1939 (read_list): Simplify.
1940
e8d32c7e
SM
1941 * fileio.c, character.h: Minor style tweaks.
1942
4b2addb7
DA
19432012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
1944
1945 * window.h (clip_changed): Remove useless declaration.
1946
584461b2
JB
19472012-05-22 Juanma Barranquero <lekktu@gmail.com>
1948
1949 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
1950 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
1951
34374650
PE
19522012-05-22 Paul Eggert <eggert@cs.ucla.edu>
1953
1954 Remove src/m/*.
1955 This directory predates autoconf and is no longer needed nowadays.
1956 Move its few remaining bits of functionality to where they're needed.
1957 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
1958 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
1959 * m/template.h: Remove.
1960 * Makefile.in (M_FILE): Remove. All uses removed.
1961 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
1962 * lisp.h (USE_LSB_TAG):
1963 * mem-limits.h (EXCEEDS_LISP_PTR):
1964 Use VAL_MAX, not VALBITS, in #if.
1965 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
1966 (EMACS_UINT): Define unconditionally now.
1967 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
1968 (BITS_PER_EMACS_INT): New constants, replacing
1969 what used to be in config.h, but not useful in #if.
1970 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
1971 define them any more.
1972 (VAL_MAX): New macro.
1973 (VALMASK): Use it.
1974 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
1975 BITS_PER_EMACS_INT, in #if.
1976 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
1977 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
1978 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
1979 * s/ms-w32.h (DATA_START):
1980 Move here from removed file m/intel386.h.
1981 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
1982 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
1983
261cb4bb
PE
19842012-05-21 Paul Eggert <eggert@cs.ucla.edu>
1985
1986 Assume C89 or later.
1987 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
1988 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
1989 (xrealloc):
1990 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
1991 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
1992 * textprop.c, tparam.c (NULL): Remove.
1993 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
1994 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
1995 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
1996 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
1997 * xterm.c (input_signal_count): Assume volatile works.
1998
ff23cd9f
KB
19992012-05-21 Ken Brown <kbrown@cornell.edu>
2000
2001 * xgselect.c (xg_select): Fix first argument in call to 'select'
2002 (bug#11508).
2003
1b170bc6
KB
20042012-05-20 Ken Brown <kbrown@cornell.edu>
2005
2006 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 2007 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 2008
b2f4d39f
KB
20092012-05-19 Ken Brown <kbrown@cornell.edu>
2010
2011 * xfns.c (x_in_use): Remove `static' qualifier.
2012 * xterm.h (x_in_use): Declare.
2013 * xgselect.c: Include xterm.h.
2014 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
2015 and `display_arg' (bug#9754).
2016
003fdae2
PE
20172012-05-19 Paul Eggert <eggert@cs.ucla.edu>
2018
9232a6d9
PE
2019 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
2020
003fdae2
PE
2021 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
2022 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
2023
784b56e2
EZ
20242012-05-18 Eli Zaretskii <eliz@gnu.org>
2025
2026 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
2027
2028 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
2029 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
2030
2031 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
2032 reference to image_cache->refcount.
2033 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
2034
a0a79cde
JL
20352012-05-17 Juri Linkov <juri@jurta.org>
2036
2037 * search.c (Fword_search_regexp, Fword_search_backward)
2038 (Fword_search_forward, Fword_search_backward_lax)
2039 (Fword_search_forward_lax): Move functions to isearch.el
2040 (bug#10145, bug#11381).
2041
b0572523
PE
20422012-05-16 Paul Eggert <eggert@cs.ucla.edu>
2043
2044 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
2045
9660f5fc
SM
20462012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2047
2048 * lread.c (init_obarray): Declare Qt and Qnil as special.
2049
4374de83
GM
20502012-05-14 Glenn Morris <rgm@gnu.org>
2051
2052 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 2053 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 2054
dc44c39a
PE
20552012-05-14 Paul Eggert <eggert@cs.ucla.edu>
2056
078c97cb
PE
2057 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
2058
dc44c39a
PE
2059 * unexaix.c: Port to more-recent AIX compilers.
2060 (report_error, report_error_1, make_hdr, copy_sym)
2061 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
2062 Make arguments const char *, not char *, to avoid violations of C
2063 standard and to fix some AIX warnings reported by Gilles Pion.
2064
e18afed7 20652012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
2066
2067 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
2068 already have overlays loaded.
2069 (handle_single_display_spec): Before returning without displaying
2070 fringe bitmap, synchronize the bidi iterator with the main display
2071 iterator, by calling iterate_out_of_display_property.
2072 (iterate_out_of_display_property): Detect buffer iteration by
2073 testing that it->string is a Lisp string.
2074 (get_next_display_element): When the current object is exhausted,
2075 and there's something on it->stack, call set_iterator_to_next to
2076 proceed with what's on the stack, instead of returning zero.
2077 (set_iterator_to_next): If called at the end of a Lisp string,
2078 proceed to consider_string_end without incrementing string
2079 position. Don't increment display vector index past the end of
2080 the display vector. (Bug#11417)
c8fb9dc6
EZ
2081 (pos_visible_p): Don't report a position visible when move_it_to
2082 stopped at the last line of window, which happens to be scanned
2083 backwards by the bidi iteration. (Bug#11464)
ac268e67 2084
e18afed7 20852012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
2086
2087 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
2088 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
2089 are on a TTY, and thus unable to display on the fringes.
2090 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
2091 so we need to signal to the caller that this is a "replacing"
2092 display spec. This fixes display when the spec is invalid or we
2093 are on a TTY.
2094
e18afed7 20952012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
2096
2097 * unexaix.c (make_hdr): Fix typo in prototype.
2098 This bug broke the build on AIX. Problem reported by Gilles Pion.
2099
9d0a235a
MA
21002012-05-14 Michael Albinus <michael.albinus@gmx.de>
2101
2102 * keyboard.c (kbd_buffer_get_event): Read special events also in
2103 batch mode. (Bug#11415)
2104
9e6b06ed
GM
21052012-05-12 Glenn Morris <rgm@gnu.org>
2106
2107 * ns.mk: Update for ns_appbindir no longer having trailing "/".
2108
c1a1d7a3
EZ
21092012-05-12 Eli Zaretskii <eliz@gnu.org>
2110
2111 * lisp.mk (lisp): Add newcomment.elc.
2112
3fe7cdc8
GM
21132012-05-12 Glenn Morris <rgm@gnu.org>
2114
2115 * Makefile.in (MKDIR_P): New, set by configure.
2116 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
2117
53f7d2c0
PE
21182012-05-11 Paul Eggert <eggert@cs.ucla.edu>
2119
2120 Remove unused function hourglass_started.
2121 * dispextern.h (hourglass_started):
2122 * w32fns.c (hourglass_started):
2123 * xdisp.c (hourglass_started): Remove.
2124
75aafb17
JB
21252012-05-10 Juanma Barranquero <lekktu@gmail.com>
2126
2127 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
2128 Update dependencies.
2129
12959e8e
PE
21302012-05-10 Paul Eggert <eggert@cs.ucla.edu>
2131
97107e2e
PE
2132 * xgselect.c (xg_select): Put maxfds+1 into a var.
2133 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
2134
12959e8e
PE
2135 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
2136
836d29b3
DA
21372012-05-10 Dave Abrahams <dave@boostpro.com>
2138
2139 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
2140 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
2141
5cb67954
MA
21422012-05-09 Michael Albinus <michael.albinus@gmx.de>
2143
2144 * dbusbind.c (xd_registered_buses): New internal Lisp object.
2145 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
2146 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
2147 Initialize xd_registered_buses.
2148
3478ec45
PE
21492012-05-09 Paul Eggert <eggert@cs.ucla.edu>
2150
b263a6b0
PE
2151 Untag more efficiently if USE_LSB_TAG.
2152 This is based on a proposal by YAMAMOTO Mitsuharu in
2153 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
2154 For an admittedly artificial (nth 8000 longlist) benchmark on
2155 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
2156 Emacs's overall text size by 1%.
2157 * lisp.h (XUNTAG): New macro.
2158 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
2159 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
2160 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
2161 * eval.c (Fautoload):
2162 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
2163 * frame.h (XFRAME): Use XUNTAG.
2164
3478ec45
PE
2165 Port recent dbusbind.c changes to 32-bit --with-wide-int.
2166 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
2167 Remove unportable assumptions about print widths of types like
2168 dbus_uint32_t.
2169 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
2170 intptr_t when converting between pointer and integer, to avoid GCC
2171 warnings about wrong width.
2172
666b903b 21732012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
2174
2175 * w32proc.c (new_child): Force Windows to reserve only 64KB of
2176 stack for each reader_thread, instead of defaulting to 8MB
2177 determined by the linker. This avoids failures in creating
2178 subprocesses on Windows 7, see the discussion in this thread:
2179 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
2180
b120cc17
JC
21812012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
2182
2183 Fix up display of the *Minibuf-0* buffer in the mini window.
2184 * keyboard.c (read_char): Don't clear the echo area if there's no
2185 message to clear.
2186 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 2187 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 2188
9a4b36f8
MA
21892012-05-07 Michael Albinus <michael.albinus@gmx.de>
2190
2191 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
2192 batch mode.
2193
e5f9458f
CY
21942012-05-06 Chong Yidong <cyd@gnu.org>
2195
2196 * lisp.mk (lisp): Update.
2197
eceeb5fc 21982012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
2199
2200 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
2201
71873e2b
SM
22022012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
2203
2204 * data.c (PUT_ERROR): New macro.
2205 (syms_of_data): Use it. Add new error type `user-error'.
2206 * undo.c (user_error): New function.
2207 (Fprimitive_undo): Use it.
2208 * print.c (print_error_message): Adjust print style for `user-error'.
2209 * keyboard.c (user_error): New function.
2210 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
2211
ab0fa4e4
PE
22122012-05-03 Paul Eggert <eggert@cs.ucla.edu>
2213
2214 Do not limit current-time-string to years 1000..9999.
2215 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
2216 (Fcurrent_time_string): Support any year that is supported by the
2217 underlying localtime representation. Don't use asctime, as it
2218 has undefined behavior for years outside the range -999..9999.
2219
7ed806a7
PE
22202012-05-02 Paul Eggert <eggert@cs.ucla.edu>
2221
2222 Fix race conditions involving setenv, gmtime, localtime, asctime.
2223 Without this fix, interrupts could mess up code that uses these
2224 nonreentrant functions, since setting TZ invalidates existing
2225 tm_zone or tzname values, and since most of these functions return
2226 pointers to static storage.
2227 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
2228 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
2229 Grow the critical sections to include not just invoking
2230 localtime/gmtime, but also accessing these functions' results
2231 including their tm_zone values if any, and any related TZ setting.
2232 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
2233 so that the struct tm is saved in the critical section.
2234 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
2235 motivated by the fact that memory allocation needs to be outside
2236 the critical section.
2237
0c16dfed
DA
22382012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
2239
2240 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
2241 with RESET_INTERVAL.
2242
2243 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2244 Remove duplicated buffer name initialization.
2245
3f83ace8
JM
22462012-05-02 Jim Meyering <jim@meyering.net>
2247
2248 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
2249
c7b8541e
JM
2250 * xfns.c (x_window): Use xstrdup (Bug#11375).
2251
90207a15 22522012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
2253
2254 * xdisp.c (pos_visible_p): If already at a newline from the
2255 display string before the 'while' loop, don't walk back the glyphs
2256 from it3.glyph_row. Solves assertion violation when the display
2257 string begins with a newline (egg.el). (Bug#11367)
2258
b593d6a9
AH
22592012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
2260
2261 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
2262 Move to simple.el.
2263
4737362e
GM
22642012-05-01 Glenn Morris <rgm@gnu.org>
2265
99cf43f9
GM
2266 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
2267 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
2268 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
2269 All were removed before 23.1.
2270
9311dcff
GM
2271 * dispnew.c: Remove HAVE_LIBNCURSES test;
2272 it is always true on relevant platforms.
2273
4d5c6349
GM
2274 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
2275 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
2276
4737362e
GM
2277 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
2278
74dd3a6b
AS
22792012-04-30 Andreas Schwab <schwab@linux-m68k.org>
2280
2281 * .gdbinit (xpr): Remove checks for no longer existing misc types.
2282 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
2283 Remove.
2284
13c379ee
PE
22852012-04-28 Paul Eggert <eggert@cs.ucla.edu>
2286
2287 Do not avoid creating empty evaporating overlays (Bug#9642).
2288 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
2289 That is, do not delete an evaporating overlay if it becomes
2290 empty after its bounds are adjusted to fit within its buffer.
2291 This fix caused other problems, and I'm reverting it until we get
2292 to the bottom of them.
2293
a8e7d6d7 22942012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
2295
2296 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
2297
a8e7d6d7 22982012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
2299
2300 * xdisp.c (pos_visible_p): If the window start position is beyond
2301 ZV, start the display from buffer beginning. Prevents assertion
2302 violation in init_iterator when the minibuffer window is scrolled
2303 via the scroll bar.
2304
2305 * window.c (window_scroll_pixel_based): Likewise.
2306
a8e7d6d7 23072012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
2308
2309 * keymap.c (where_is_internal): Doc fix (Bug#10872).
2310
a8e7d6d7 23112012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
2312
2313 * fileio.c (Fcopy_file, Fset_file_selinux_context):
2314 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
2315
a8e7d6d7 23162012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 2317
b593d6a9
AH
2318 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
2319 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 2320
1c6900d9
EZ
23212012-04-26 Eli Zaretskii <eliz@gnu.org>
2322
4c3fa1d9
EZ
2323 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
2324 display element, check also the underlying string or buffer
2325 character. (Bug#11341)
2326
1c6900d9
EZ
2327 * w32menu.c: Include w32heap.h.
2328 (add_menu_item): If the call to AppendMenuW (via
2329 unicode_append_menu) fails, disable Unicode menus only if we are
2330 running on Windows 9X/Me.
2331
42bf8205
AS
23322012-04-24 Andreas Schwab <schwab@linux-m68k.org>
2333
2334 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
2335 (xgetint): Add missing shift for LSB tags.
2336
b1bac16e
MR
23372012-04-24 Martin Rudalics <rudalics@gmx.at>
2338
2339 * keyboard.c (read_char): Don't wipe echo area for select window
2340 events: These might get delayed via `mouse-autoselect-window'
2341 (Bug#11304).
2342
d69621cc
JB
23432012-04-24 Juanma Barranquero <lekktu@gmail.com>
2344
2345 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
2346 manipulation of :loaded-from data.
2347
02fd101b
JB
23482012-04-23 Juanma Barranquero <lekktu@gmail.com>
2349
2350 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
2351 now a cons (bug#11311).
2352
888bec30
PE
23532012-04-23 Paul Eggert <eggert@cs.ucla.edu>
2354
89a438bd
PE
2355 Do not create empty overlays with the evaporate property (Bug#9642).
2356 * buffer.c (Fmove_overlay): Delete an evaporating overlay
2357 if it becomes empty after its bounds are adjusted to fit within
2358 its buffer. Without this fix, in a nonempty buffer (let ((o
2359 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
2360 yields an empty overlay that has the evaporate property, which is
2361 not supposed to happen.
2362
1068fe4d
PE
2363 Fix minor GTK3 problems found by static checking.
2364 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2365 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2366 (struct _EmacsFixedClass, emacs_fixed_get_type):
2367 Move decls here from emacsgtkfixed.h, since they needn't be public.
2368 (emacs_fixed_get_type): Now static.
2369 (emacs_fixed_class_init): Omit unused local.
2370 (emacs_fixed_child_type): Remove; unused.
2371 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2372 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2373 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
2374 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
2375 (EMACS_FIXED_GET_CLASS): Remove; unused.
2376 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
2377
888bec30
PE
2378 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
2379 Problem reported by Juanma Barranquero for Windows -Wunused-function.
2380
de85e130
PE
23812012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2382
d0baac98 2383 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 2384 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
2385 (__malloc_size_t, __malloc_ptrdiff_t):
2386 Remove. All uses removed, replaced by the definiens if needed,
2387 since we can assume C89 or better now.
2388 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
2389 (protect_malloc_state, align, get_contiguous_space)
2390 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
2391 (malloc_atfork_handler_child, malloc_enable_thread)
2392 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
2393 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
2394 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
2395 (special_realloc, _realloc_internal_nolock, _realloc_internal)
2396 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
2397 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
2398 Define using prototypes, not old style.
2399 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
2400 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
2401 (align): Don't assume that signed integer overflow wraps around.
2402 Omit unused local var.
2403 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
2404 (_free_internal_nolock, memalign, mallochook, reallochook):
2405 Omit no-longer-needed casts.
2406 (valloc): Use getpagesize, not __getpagesize.
2407 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
2408 (struct hdr): The 'magic' member is now size_t, not unsigned long.
2409
de85e130
PE
2410 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
2411
dcbf5805
MA
24122012-04-22 Michael Albinus <michael.albinus@gmx.de>
2413
2414 Move functions from C to Lisp. Make non-blocking method calls
2415 the default. Implement further D-Bus standard interfaces.
2416
2417 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
2418 (QCdbus_request_name_allow_replacement)
2419 (QCdbus_request_name_replace_existing)
2420 (QCdbus_request_name_do_not_queue)
2421 (QCdbus_request_name_reply_primary_owner)
2422 (QCdbus_request_name_reply_in_queue)
2423 (QCdbus_request_name_reply_exists)
2424 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
2425 (QCdbus_registered_serial, QCdbus_registered_method)
2426 (QCdbus_registered_signal): New Lisp objects.
2427 (XD_DEBUG_MESSAGE): Use sizeof.
2428 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
2429 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
2430 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
2431 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
2432 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
2433 (xd_signature, xd_append_arg): Allow float for integer types.
2434 (xd_get_connection_references): New function.
b593d6a9
AH
2435 (xd_get_connection_address): Rename from xd_initialize.
2436 Return cached address.
dcbf5805
MA
2437 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
2438 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
2439 level.
2440 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 2441 Return number of refcounts.
dcbf5805
MA
2442 (Fdbus_get_unique_name): Make stronger parameter check.
2443 (Fdbus_message_internal): New defun.
2444 (Fdbus_call_method, Fdbus_call_method_asynchronously)
2445 (Fdbus_method_return_internal, Fdbus_method_error_internal)
2446 (Fdbus_send_signal, Fdbus_register_service)
2447 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
2448 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
2449 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
2450 (Vdbus_compiled_version, Vdbus_runtime_version)
2451 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
2452 (Vdbus_message_type_method_return, Vdbus_message_type_error)
2453 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
2454 (Vdbus_registered_buses, Vdbus_registered_objects_table):
2455 Adapt docstring.
dcbf5805 2456
52828e02
PE
24572012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2458
da05bc4c
PE
2459 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
2460 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
2461 Do not assume ptrdiff_t is the same width as 'int'.
2462
52828e02
PE
2463 * alloc.c: Handle unusual debugging option combinations.
2464 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
2465 since the two debugging options are incompatible.
2466 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
2467 is defined.
2468 (mem_init, mem_insert, mem_insert_fixup):
2469 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
2470 (NEED_MEM_INSERT): Remove; no longer needed.
2471
f01769f9
LL
24722012-04-22 Leo Liu <sdl.web@gmail.com>
2473
2474 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
2475
5790543d
PE
24762012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2477
2478 * sysdep.c [__FreeBSD__]: Minor cleanups.
2479 (list_system_processes, system_process_attributes) [__FreeBSD__]:
2480 Use Emacs indenting style more consistently. Avoid some casts.
2481 Use 'double' consistently rather than mixing 'float' and 'double'.
2482
b91b7e4d
EW
24832012-04-21 Eduard Wiebe <usenet@pusto.de>
2484
b593d6a9
AH
2485 * sysdep.c (list_system_processes, system_process_attributes):
2486 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 2487
6114eb15
AS
24882012-04-21 Andreas Schwab <schwab@linux-m68k.org>
2489
2490 * lisp.mk (lisp): Update.
2491
2f38dff7
PE
24922012-04-20 Paul Eggert <eggert@cs.ucla.edu>
2493
2494 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
2495 It is never used otherwise.
2496
4ae29f89
SM
24972012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
2498
2499 * print.c (print_preprocess): Only check print_depth if print-circle
2500 is nil.
2501 (print_object): Check for cycles even when print-circle is nil and
2502 print-gensym is t, but only check print_depth if print-circle is nil.
2503
f30d612a
CY
25042012-04-20 Chong Yidong <cyd@gnu.org>
2505
2506 * process.c (wait_reading_process_output): If EIO occurs on a pty,
2507 set the status to "failed" and ensure that sentinel is run.
2508
c07a4c0b 25092012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
2510
2511 * process.c (Fset_process_inherit_coding_system_flag)
2512 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 2513 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 2514
c07a4c0b 25152012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
2516
2517 * xdisp.c (string_buffer_position_lim): Limit starting position to
2518 BEGV.
2519 (set_cursor_from_row): If called for a mode-line or header-line
2520 row, return zero immediately.
2521 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
2522 farther than the first row after the header line, if any.
2523 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
2524 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
2525
c07a4c0b 25262012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 2527
4ae29f89
SM
2528 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
2529 (bug#11238).
ad3a2b41 2530
c07a4c0b 25312012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 25322012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
2533
2534 configure: new option --enable-gcc-warnings (Bug#11207)
2535 * Makefile.in (C_WARNINGS_SWITCH): Remove.
2536 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
2537 (ALL_CFLAGS): Use new macros rather than old.
2538 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
2539 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
2540 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
2541 -Wunused-result, -Wunused-variable. This should go away once
2542 the Emacs and Gnulib regex code is merged.
2543 (xmalloc, xrealloc): Now static.
2544
aba027e8
PE
25452012-04-17 Paul Eggert <eggert@cs.ucla.edu>
2546
2547 * dired.c (Fsystem_groups): Remove unused local.
2548
e5a36063
GM
25492012-04-17 Glenn Morris <rgm@gnu.org>
2550
2551 * dired.c (Fsystem_users): Doc fix.
2552
316411f0
DA
25532012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
2554
2555 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
2556 (syms_of_dired): Add them.
2557
9426aba4
PE
25582012-04-16 Paul Eggert <eggert@cs.ucla.edu>
2559
b62a57be
PE
2560 Fix minor alloc.c problems found by static checking.
2561 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
2562 New extern decls, to avoid calling undeclared functions.
2563 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
2564 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
2565 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
2566 (NEED_MEM_INSERT): New macro.
2567 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 2568 Remove one incorrect comment and fix another.
b62a57be 2569
3539f31f
PE
2570 Fix minor ralloc.c problems found by static checking.
2571 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
2572 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
2573 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
2574 (r_alloc_sbrk): Now static.
2575
a041960a
PE
2576 Improve ralloc.c interface checking.
2577 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
2578 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
2579 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
2580 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
2581 [REL_ALLOC]: ... to here, to check interface.
2582 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
2583 Remove decls. This fixes an "It stinks!".
2584
9426aba4
PE
2585 * alloc.c (which_symbols): Fix alignment issue / type clash.
2586
d55c12ed
AS
25872012-04-15 Andreas Schwab <schwab@linux-m68k.org>
2588
2589 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
2590 (struct Lisp_Misc_Any): Likewise.
2591 (struct Lisp_Free): Likewise.
2592 * alloc.c (union aligned_Lisp_Symbol): Define.
2593 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
2594 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
2595 (union aligned_Lisp_Misc): Define.
2596 (MARKER_BLOCK_SIZE, struct marker_block): Use union
2597 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 2598 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 2599
b948ce8b
PE
26002012-04-14 Paul Eggert <eggert@cs.ucla.edu>
2601
2602 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
2603 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
2604 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
2605 * s/netbsd.h, s/sol2-6.h:
2606 Remove definition of GC_MARK_STACK, since the default now works.
2607 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
2608 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
2609 no longer the default.
2610 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
2611
35dc09a1 26122012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 2613
35dc09a1
GM
2614 * lread.c (lisp_file_lexically_bound_p):
2615 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 2616
35dc09a1
GM
26172012-04-14 Eli Zaretskii <eliz@gnu.org>
2618
2619 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
2620 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
2621
26222012-04-14 Jan Djärv <jan.h.d@swipnet.se>
2623
2624 * nsterm.m (constrainFrameRect): Always constrain when there is only
2625 one screen (Bug#10962).
2626
bcd86815
KB
26272012-04-13 Ken Brown <kbrown@cornell.edu>
2628
2629 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
2630
c25df26e
RT
26312012-04-13 Reuben Thomas <rrt@sc3d.org>
2632
2633 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
2634
0fc59f1e
DC
26352012-04-11 Daniel Colascione <dancol@dancol.org>
2636
2637 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
2638 against is gone. It's better to use vfork now so that when Cygwin
2639 gains a new, working vfork, we use it automatically (bug#10398).
2640
de8c03dc
SM
26412012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2642
2643 * window.c (save_window_save): Obey window-point-insertion-type.
2644
2f097256
GM
26452012-04-11 Glenn Morris <rgm@gnu.org>
2646
2647 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
2648
453b951e
SM
26492012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2650
2651 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
2652
75f1671a 26532012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
2654
2655 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
2656 (force_quit_count): New var.
2657 (handle_interrupt): Use it.
2658
2a8ce227
JB
26592012-04-10 Juanma Barranquero <lekktu@gmail.com>
2660
2661 * w32.c (w32_delayed_load): Record the full path of the library
2662 being loaded (bug#10424).
2663
935396c0
GM
26642012-04-09 Glenn Morris <rgm@gnu.org>
2665
05920a43
GM
2666 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
2667 not just in the obarray, before snarfing them. (Bug#11036)
2668
935396c0
GM
2669 * Makefile.in ($(leimdir)/leim-list.el):
2670 Pass EMACS rather than BUILT_EMACS.
2671
a18ecafa
TZ
26722012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
2673
2674 * process.c (make_process):
2675 * process.h: Add integer `gnutls_handshakes_tried' member to
2676 process struct.
2677
6bbef4e5
JC
2678 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
2679 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
2680
2681 * gnutls.c (gnutls_log_function2i): Convenience log function.
2682 (emacs_gnutls_read): Use new log functions,
2683 `gnutls_handshakes_tried' process member, and
2684 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
2685 attempts per process (connection).
2686
b4d3bc10
CY
26872012-04-09 Chong Yidong <cyd@gnu.org>
2688
2689 * eval.c (Fuser_variable_p, user_variable_p_eh)
2690 (lisp_indirect_variable): Functions deleted.
2691 (Fdefvar): Caller changed.
2692
2693 * callint.c (Finteractive, Fcall_interactively):
2694 * minibuf.c (Fread_variable): Callers changed.
2695
70f4d973
EZ
26962012-04-09 Eli Zaretskii <eliz@gnu.org>
2697
2698 * xdisp.c (set_cursor_from_row): If the display string appears in
2699 the buffer at position that is closer to point than the position
2700 after the display string, display the cursor on the first glyph of
2701 the display string. Fixes cursor display when a 'display' text
2702 property immediately follows invisible text. (Bug#11094)
2703
cb3c2e3e
PE
27042012-04-09 Paul Eggert <eggert@cs.ucla.edu>
2705
2706 composite.c: use 'double' consistently
2707 * composite.c (get_composition_id): Use 'double' consistently
2708 instead of converting 'float' to 'double' and vice versa; this is
2709 easier to understand and avoids a GCC warning.
2710
fd06db5d
GM
27112012-04-09 Glenn Morris <rgm@gnu.org>
2712
50fe702a
GM
2713 * Makefile.in: Generate leim-list with bootstrap-emacs, in
2714 preparation for dumping it with emacs. (Bug#4789)
2715 (leimdir): New variable.
2716 ($(leimdir)/leim-list.el): New rule.
2717 (emacs$(EXEEXT)): Depend on leim-list.el.
2718
fd06db5d
GM
2719 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
2720 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
2721 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
2722
55c131ee
AS
27232012-04-08 Andreas Schwab <schwab@linux-m68k.org>
2724
2725 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
2726 proper alignment.
2727
9209588f
JB
27282012-04-07 Juanma Barranquero <lekktu@gmail.com>
2729
2730 * xml.c (init_libxml2_functions) [WINDOWSNT]:
2731 Remove unused local variable.
2732
e3fb2efb
PE
27332012-04-07 Paul Eggert <eggert@cs.ucla.edu>
2734
2735 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
2736 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
2737 (mark_memory): Mark Lisp_Objects only if pointers might hide in
2738 objects, as mark_maybe_pointer will catch them otherwise.
2739 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
2740 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
2741
b5385551
PE
27422012-04-07 Paul Eggert <eggert@cs.ucla.edu>
2743
2744 Fix typo that broke non-Windows builds.
2745 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
2746
9078ead6
EZ
27472012-04-07 Eli Zaretskii <eliz@gnu.org>
2748
2749 Support building on MS-Windows with libxml2.
2750
2751 * makefile.w32-in (OBJ2): Add xml.$(O).
2752 (GLOBAL_SOURCES): Add xml.c.
2753 ($(BLD)/xml.$(O)): New dependency list.
2754
2755 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
2756 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
2757 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
2758 [!WINDOWSNT]: New macros.
2759 (init_libxml2_functions, libxml2_loaded_p): New functions.
2760 (parse_region): Call fn_xmlCheckVersion instead of using the macro
2761 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
2762 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
2763 Calls xmlCleanupParser only if libxml2 was loaded (or statically
2764 linked in).
6bbef4e5
JC
2765 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
2766 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
2767 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
2768
2769 * emacs.c: Don't include libxml/parser.h.
2770 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
2771 xmlCleanupParser directly.
2772
2773 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
2774
3811fdf3
EZ
27752012-04-07 Eli Zaretskii <eliz@gnu.org>
2776
2777 * indent.c (Fvertical_motion): If there is a display string at
2778 point, use it.vpos to compute how many lines to backtrack after
2779 move_it_to point. (Bug#11133)
2780
2f8e16b2
EZ
27812012-04-06 Eli Zaretskii <eliz@gnu.org>
2782
2783 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
2784 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
2785 about subtle differences between FETCH_CHAR* and STRING_CHAR*
2786 macros related to unification of CJK characters. For the details,
2787 see the discussion following the message here:
2788 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
2789
3d439cd1
CY
27902012-04-04 Chong Yidong <cyd@gnu.org>
2791
2792 * keyboard.c (Vdelayed_warnings_list): Doc fix.
2793
8bc53d00
EZ
27942012-04-01 Eli Zaretskii <eliz@gnu.org>
2795
2796 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
2797 instead of alloca. (Bug#11138)
2798
3b0512a3
AS
27992012-04-01 Andreas Schwab <schwab@linux-m68k.org>
2800
2801 * w32menu.c (is_simple_dialog): Properly check lisp types.
2802 (Bug#11141)
2803
8427ddd2
EZ
28042012-03-31 Eli Zaretskii <eliz@gnu.org>
2805
979022ef
EZ
2806 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
2807 position we get to after a call to move_it_to fails the
2808 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
2809 only if we wind up in a string from display property. (Bug#11063)
2810
a6b1c7cc
EZ
2811 * window.c (Fdelete_other_windows_internal): Invalidate the row
2812 and column information about mouse highlight, so that redisplay
2813 restores it after reallocating the glyph matrices. (Bug#7464)
2814
8427ddd2
EZ
2815 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
2816 string comes from a `display' text property, use the buffer
2817 position of that property as if we actually saw that position in
2818 the row's glyphs.
697ba24b
EZ
2819 (move_it_by_lines): Remove the assertion that
2820 "it->current_x == 0 && it->hpos == 0" which can be legitimately
2821 violated when there's a before-string at the beginning of a line.
2822 (Bug#11063)
8427ddd2 2823
65a0a738
EZ
28242012-03-30 Eli Zaretskii <eliz@gnu.org>
2825
2826 * xdisp.c (append_space_for_newline): If the default face was
2827 remapped, use the remapped face for the appended newline.
2828 (extend_face_to_end_of_line): Use the remapped default face for
2829 extending the face to the end of the line.
2830 (display_line): Call extend_face_to_end_of_line when the default
2831 face was remapped. (Bug#11068)
2832
581355cc
EZ
28332012-03-29 Eli Zaretskii <eliz@gnu.org>
2834
2835 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
2836
e8fc049f
SM
28372012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
2838
2839 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
2840
4fb9a543
GM
28412012-03-27 Glenn Morris <rgm@gnu.org>
2842
2843 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
2844 Doc fixes.
2845
679910f1
KH
28462012-03-26 Kenichi Handa <handa@m17n.org>
2847
2848 * dispextern.h (struct glyph): Fix previous change. Change the
2849 bit length of glyphless.ch to 25 (Bug#11082).
2850
90d49b7f
CY
28512012-03-26 Chong Yidong <cyd@gnu.org>
2852
2853 * keyboard.c (Vselection_inhibit_update_commands): New variable.
2854 (command_loop_1): Use it; inhibit selection update for
2855 handle-select-window too (Bug#8996).
2856
f514f6f0
FP
28572012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
2858
e8fc049f 2859 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 2860
bf43fa51
KH
28612012-03-25 Kenichi Handa <handa@m17n.org>
2862
2863 * dispextern.h (struct glyph): Change the bit length of
2864 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
2865
8a0c01dd
EZ
28662012-03-24 Eli Zaretskii <eliz@gnu.org>
2867
2868 * s/ms-w32.h (tzname): Include time.h before redirecting to
2869 _tzname. Fixes the MSVC build. (Bug#9960)
2870
7d1c3a76
AS
28712012-03-24 Andreas Schwab <schwab@linux-m68k.org>
2872
8ed79523
AS
2873 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
2874 characters.
2875
7d1c3a76
AS
2876 * xterm.c (XTread_socket): Only modify handling_signal if
2877 !SYNC_INPUT. (Bug#11080)
2878
e99a9b8b
EZ
28792012-03-23 Eli Zaretskii <eliz@gnu.org>
2880
2881 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
2882 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
2883 when fetching a multibyte character consumes more bytes than
2884 CHAR_BYTES returns, due to unification of CJK characters in
2885 string_char. (Bug#11073)
2886
5063c0e1
TN
28872012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
2888
2889 * process.c (wait_reading_process_output): Handle pty disconnect
2890 by refraining from sending oneself a SIGCHLD (bug#10933).
2891
9f851fbd
CY
28922012-03-22 Chong Yidong <cyd@gnu.org>
2893
2894 * dispextern.h (struct it): New member string_from_prefix_prop_p.
2895
5063c0e1 2896 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
2897 Mark string as coming from a prefix property.
2898 (handle_face_prop): Use default face for prefix strings (Bug#4281).
2899 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
2900
fb5b8aca
CY
29012012-03-21 Chong Yidong <cyd@gnu.org>
2902
2903 * xfaces.c (Vface_remapping_alist): Doc fix.
2904
62356a1b
EZ
29052012-03-20 Eli Zaretskii <eliz@gnu.org>
2906
2907 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
2908 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
2909 Doc fixes.
62356a1b 2910
025de85b
CY
29112012-03-20 Chong Yidong <cyd@gnu.org>
2912
2913 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
2914 to reflect default non-nil value of redisplay-dont-pause.
2915
4827f94e
KH
29162012-03-19 Kenichi Handa <handa@m17n.org>
2917
2918 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
2919 it fit in a valid range (Bug#11003).
2920
e50a24a2
EZ
29212012-03-18 Eli Zaretskii <eliz@gnu.org>
2922
2923 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
2924 that is not from display property, accept the row as a "cursor
2925 row" if one of the string's character has a non-nil `cursor'
2926 property. Fixes cursor positioning when there are newlines in
2927 overlay strings, e.g. in icomplete.el. (Bug#11035)
2928
9af5ed87
PE
29292012-03-12 Paul Eggert <eggert@cs.ucla.edu>
2930
2931 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
2932
d1f55f16
CY
29332012-03-12 Chong Yidong <cyd@gnu.org>
2934
2935 * eval.c (inhibit_lisp_code): Rename from
2936 inhibit_window_configuration_change_hook; move from window.c.
2937
2938 * xfns.c (unwind_create_frame_1, Fx_create_frame):
2939 * window.c (run_window_configuration_change_hook)
2940 (syms_of_window): Callers changed.
2941
66c5eebd
CY
29422012-03-11 Chong Yidong <cyd@gnu.org>
2943
413df973
CY
2944 * keymap.c (Fkey_description): Doc fix (Bug#9700).
2945
66c5eebd
CY
2946 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
2947
1de11f56
CY
29482012-03-10 Chong Yidong <cyd@gnu.org>
2949
2950 * frame.c (other_visible_frames): Don't assume the selected frame
2951 is visible (Bug#10955).
2952
cae07000
SM
29532012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
2954
2955 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
2956
89c94350
JD
29572012-03-08 Jan Djärv <jan.h.d@swipnet.se>
2958
2959 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
2960 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
2961 zero (Bug#10954).
2962
999dd333
GM
29632012-03-03 Glenn Morris <rgm@gnu.org>
2964
01a6dcc8 2965 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 2966
de0100f2
EZ
29672012-03-02 Eli Zaretskii <eliz@gnu.org>
2968
2969 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
2970 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
2971 (redisplay_window, next_element_from_string): Fix typos in
2972 comments.
3e441275
EZ
2973 (redisplay_window): Pass to move_it_vertically the margin in
2974 pixels, not in screen lines.
de0100f2 2975
96a72ee9
GM
29762012-03-02 Glenn Morris <rgm@gnu.org>
2977
2978 * buffer.c (buffer-list-update-hook): Doc fix.
2979
312508d7
EZ
29802012-02-29 Eli Zaretskii <eliz@gnu.org>
2981
2982 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
2983 push_it before setting up the iterator for the first overlay
2984 string, even if we have an empty string loaded.
2985 (next_overlay_string): If there's an empty string on the iterator
2986 stack, pop the stack. (Bug#10903)
2987
27f3c637
PE
29882012-02-25 Paul Eggert <eggert@cs.ucla.edu>
2989
2990 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
2991 Suggested by Stefan Monnier in
2992 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
2993 * alloc.c (widen_to_Lisp_Object): New static function.
2994 (mark_memory): Also mark Lisp_Objects by fetching pointer words
2995 and widening them to Lisp_Objects. This would work even if
2996 USE_LSB_TAG is defined and wide integers are used, which might
2997 happen in a future version of Emacs.
2998
3c9dfce6
CY
29992012-02-25 Chong Yidong <cyd@gnu.org>
3000
fa74b241
CY
3001 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
3002 Doc fix.
3003
3c9dfce6
CY
3004 * xselect.c (Fx_selection_exists_p): Doc fix.
3005 (x_clipboard_manager_save_all): Print an informative message
3006 before saving to clipboard manager.
3007
9486df08
CY
30082012-02-24 Chong Yidong <cyd@gnu.org>
3009
3010 * keyboard.c (process_special_events): Handle all X selection
3011 requests in kbd_buffer, not just the next one (Bug#8869).
3012
f01d3321
CY
30132012-02-23 Chong Yidong <cyd@gnu.org>
3014
3015 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
3016 call when setting menu-bar-lines and tool-bar-lines parameters.
3017 (unwind_create_frame_1): New helper function.
3018
3019 * window.c (inhibit_window_configuration_change_hook): New var.
3020 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 3021 (syms_of_window): Initialize it.
f01d3321 3022
86b847b6
CY
30232012-02-22 Chong Yidong <cyd@gnu.org>
3024
3025 * xterm.c (x_draw_image_relief): Add missing type check for
3026 Vtool_bar_button_margin (Bug#10743).
3027
a59225b1
CY
30282012-02-21 Chong Yidong <cyd@gnu.org>
3029
3030 * fileio.c (Vfile_name_handler_alist): Doc fix.
3031
3032 * buffer.c (Fget_file_buffer): Protect against invalid file
3033 handler return value.
3034
310f5bd4
PE
30352012-02-20 Paul Eggert <eggert@cs.ucla.edu>
3036
cb3a28cc
PE
3037 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
3038 when computing $valmask.
3039
310f5bd4
PE
3040 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
3041 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
3042 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
3043 It's useless in that case, and it can cause problems on hosts
3044 that allocate halves of EMACS_INT values separately.
3045 Reported by Dan Horák. Diagnosed by Andreas Schwab in
3046 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
3047 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
3048 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
3049 it avoids undefined behavior on hosts where shifting right by more
3050 than the word width has undefined behavior.
3051
2375c96a
CY
30522012-02-19 Chong Yidong <cyd@gnu.org>
3053
3054 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
3055 (Funhandled_file_name_directory, Ffile_name_as_directory)
3056 (Fdirectory_file_name, Fexpand_file_name)
3057 (Fsubstitute_in_file_name): Protect against invalid file handler
3058 return values (Bug#10845).
3059
3eb49e71
EZ
30602012-02-18 Eli Zaretskii <eliz@gnu.org>
3061
3062 * .gdbinit (pitx): Fix incorrect references to fields of the
3063 iterator stack.
3064
7b926f3f
CY
30652012-02-17 Chong Yidong <cyd@gnu.org>
3066
3067 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
3068
11273115
PE
30692012-02-15 Paul Eggert <eggert@cs.ucla.edu>
3070
3071 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
3072 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
3073
c3a70e2b
CY
30742012-02-15 Chong Yidong <cyd@gnu.org>
3075
3076 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
3077 marked as special. Also, starting docstrings with * is obsolete.
3078
0ca43699
AS
30792012-02-13 Andreas Schwab <schwab@linux-m68k.org>
3080
3081 * gnutls.c (emacs_gnutls_write): Fix last change.
3082
2e8f3c56
LI
30832012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
3084
3085 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
3086 send_process.
3087
af70074f
SM
30882012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
3089
3090 * keymap.c (Fsingle_key_description): Handle char ranges.
3091
95986d52
CY
30922012-02-12 Chong Yidong <cyd@gnu.org>
3093
afd83bd1
CY
3094 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
3095 as that creates a dangerous corner case.
3096
95986d52
CY
3097 * window.c (Fdelete_window_internal): Invalidate the mouse
3098 highlight (Bug#9904).
3099
bd7da63e
GM
31002012-02-12 Glenn Morris <rgm@gnu.org>
3101
3102 * xselect.c (Fx_own_selection_internal)
3103 (Fx_get_selection_internal, Fx_disown_selection_internal)
3104 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
3105 * nsselect.m (Fx_own_selection_internal)
3106 (Fx_disown_selection_internal, Fx_selection_exists_p)
3107 (Fx_selection_owner_p, Fx_get_selection_internal):
3108 Sync docs and argument specs with the xselect.c versions.
3109
77abcbc2
LI
31102012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
3111
3112 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
3113
90b671e2
EZ
31142012-02-11 Eli Zaretskii <eliz@gnu.org>
3115
1c0ca0b7
EZ
3116 * w32select.c (Fx_selection_exists_p): Sync doc string and
3117 argument list with xselect.c. (Bug#10783)
3118
3119 * w16select.c (Fx_selection_exists_p): Sync doc string and
3120 argument list with xselect.c. (Bug#10783)
90b671e2 3121
49241268
GM
31222012-02-10 Glenn Morris <rgm@gnu.org>
3123
3124 * fns.c (Fsecure_hash): Doc fix.
3125
f998bbe7 31262012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
3127
3128 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
3129
0992bd9c
CY
31302012-02-07 Chong Yidong <cyd@gnu.org>
3131
3132 * buffer.c (Fbuffer_local_variables)
3133 (buffer_lisp_local_variables): Handle unbound vars correctly;
3134 don't let Qunbound leak into Lisp.
3135
af008560
GM
31362012-02-07 Glenn Morris <rgm@gnu.org>
3137
dd605cc4
GM
3138 * image.c (Fimagemagick_types): Doc fix.
3139
af008560
GM
3140 * image.c (imagemagick-render-type): Change it from a lisp object
3141 to an integer. Move the doc here from the lisp manual.
3142 Treat all values not equal to 0 the same.
3143
1449fa1d
CY
31442012-02-06 Chong Yidong <cyd@gnu.org>
3145
3146 * doc.c (store_function_docstring): Avoid applying docstring of
3147 alias to base function (Bug#2603).
3148
3723ec07
AS
31492012-02-04 Andreas Schwab <schwab@linux-m68k.org>
3150
3151 * .gdbinit (pp1, pv1): Remove redundant defines.
3152 (pr): Use pp.
3153
79c1cc1e
CY
31542012-02-04 Chong Yidong <cyd@gnu.org>
3155
3156 * nsterm.m: Declare a global (Bug#10694).
3157
d7f29f8e
EZ
31582012-02-04 Eli Zaretskii <eliz@gnu.org>
3159
cae07000
SM
3160 * w32.c (get_emacs_configuration_options):
3161 Include --enable-checking, if specified, in the return value.
d7f29f8e 3162
3b95a6f9
MR
31632012-02-04 Martin Rudalics <rudalics@gmx.at>
3164
3165 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
3166 after rounding frame sizes. (Bug#9723)
3167
d6fa96a6
EZ
31682012-02-04 Eli Zaretskii <eliz@gnu.org>
3169
3170 * keyboard.c (adjust_point_for_property): Don't position point
3171 before BEGV. (Bug#10696)
3172
df0b2940
PE
31732012-02-03 Paul Eggert <eggert@cs.ucla.edu>
3174
3175 Handle overflow when computing char display width (Bug#9496).
3176 * character.c (char_width): Return EMACS_INT, not int.
3177 (char_width, c_string_width): Check for overflow when
3178 computing the width; this is possible now that individual
3179 characters can have unbounded width. Problem introduced
3180 by merge from Emacs 23 on 2012-01-19.
3181
6bee44d6
MA
31822012-02-02 Michael Albinus <michael.albinus@gmx.de>
3183
3184 * dbusbind.c (Fdbus_register_method): Mention the return value
3185 :ignore in the docstring.
3186
44f92739
GM
31872012-02-02 Glenn Morris <rgm@gnu.org>
3188
1b9f60cc
GM
3189 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
3190
44f92739
GM
3191 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3192 Unconditionally set to t. (Bug#10673)
3193 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3194 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
3195 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
3196
c5d3843c
KH
31972012-02-02 Kenichi Handa <handa@m17n.org>
3198
3199 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
3200 0, do not call append_composite_glyph.
3201
159462d4 32022012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
3203
3204 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
3205 NULL (Bug#6988).
3206 (x_produce_glyphs): If the component of a composition is a null
3207 string, set it->pixel_width to 1 to avoid zero-width glyph.
3208
78cef877
EZ
32092012-02-01 Eli Zaretskii <eliz@gnu.org>
3210
3211 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
3212 first 2 arguments are identical. This makes inserting large
3213 output from a subprocess an order of magnitude faster on
3214 MS-Windows, where all sbrk'ed memory is always contiguous.
3215
97897668
GM
32162012-01-31 Glenn Morris <rgm@gnu.org>
3217
3218 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 3219 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
3220 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
3221
31fd3586
GM
32222012-01-29 Glenn Morris <rgm@gnu.org>
3223
3224 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
3225
0e24a8b2
CY
32262012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
3227
3228 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
3229
cc0adcb0
CY
32302012-01-28 Chong Yidong <cyd@gnu.org>
3231
3232 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
3233
acc28cb9
CY
32342012-01-26 Chong Yidong <cyd@gnu.org>
3235
9c69cfb7
CY
3236 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
3237
acc28cb9
CY
3238 * search.c (Fsearch_forward, Fsearch_backward): Document negative
3239 repeat counts (Bug#10507).
3240
48da7392
GM
32412012-01-26 Glenn Morris <rgm@gnu.org>
3242
3243 * lread.c (syms_of_lread): Doc fix.
3244
14af5f7f
CY
32452012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
3246
3247 * coding.c (encode_designation_at_bol): Change return value to
3248 EMACS_INT.
3249
0b21c100
CY
32502012-01-25 Chong Yidong <cyd@gnu.org>
3251
3252 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
3253
3c2907f7
CY
32542012-01-21 Chong Yidong <cyd@gnu.org>
3255
3256 * floatfns.c (Fcopysign): Make the second argument non-optional,
3257 since nil is not allowed anyway.
3258
959ad23f
AS
32592012-01-21 Andreas Schwab <schwab@linux-m68k.org>
3260
3261 * process.c (read_process_output): Use p instead of XPROCESS (proc).
3262 (send_process): Likewise.
3263
34a02f46
MR
32642012-01-19 Martin Rudalics <rudalics@gmx.at>
3265
3266 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
3267 (Vwindow_persistent_parameters): Do not use Qstate.
3268 Rewrite doc-strings.
34a02f46 3269
1259009a 32702012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
3271
3272 * character.c (char_width): New function.
70d4fdf6
GM
3273 (Fchar_width, c_string_width, lisp_string_width):
3274 Use char_width (Bug#9496).
25ed9e61 3275
6a6ee00d
MR
32762012-01-16 Martin Rudalics <rudalics@gmx.at>
3277
3278 * window.c (Vwindow_persistent_parameters): New variable.
3279 (Fset_window_configuration, save_window_save): Handle persistent
3280 window parameters.
3281
c85efaf7
EZ
32822012-01-14 Eli Zaretskii <eliz@gnu.org>
3283
3284 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
3285 thrashing the stack of the thread. (Bug#9087)
3286
5944709e
PE
32872012-01-12 Paul Eggert <eggert@cs.ucla.edu>
3288
3289 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
3290
e71f5d99
EZ
32912012-01-11 Eli Zaretskii <eliz@gnu.org>
3292
3293 * xdisp.c (rows_from_pos_range): Handle the case where the
3294 highlight ends on a newline. (Bug#10464)
3295 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
3296 he end column for display of highlight that ends on a newline
3297 before a R2L line.
3298
ce316182
GM
32992012-01-11 Glenn Morris <rgm@gnu.org>
3300
3301 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
3302 from load-path also when installation-directory is nil. (Bug#10208)
3303
5b43da69
GM
33042012-01-10 Glenn Morris <rgm@gnu.org>
3305
74cc8ff9
GM
3306 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
3307
7d8d6e4e
GM
3308 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
3309 Update template values to be closer to their typical values these days.
5b43da69 3310
a0db8d43
EZ
33112012-01-09 Eli Zaretskii <eliz@gnu.org>
3312
3313 * xdisp.c (rows_from_pos_range): Accept additional argument
3314 DISP_STRING, and accept any glyph in a row whose object is that
3315 string as eligible for mouse highlight. Fixes mouse highlight of
3316 display strings from overlays. (Bug#10464)
3317
9a0115ab 33182012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 3319
b9110d6a 3320 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
3321 * fileio.c (auto_saving_dir_umask): New static var.
3322 (Fmake_directory_internal): Use it.
3323 (do_auto_save_make_dir): Set it, instead of invoking chmod after
3324 creating the directory. The old code temporarily assigns
3325 too-generous permissions to the directory.
3326 (do_auto_save_eh): Clear it.
b9110d6a 3327 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
3328 that the var is always cleared.
3329
6c1bd3f3
EZ
33302012-01-07 Eli Zaretskii <eliz@gnu.org>
3331
3332 * search.c (scan_buffer): Pass character positions to
3333 know_region_cache, not byte positions. (Bug#6540)
3334
069d2b50
L
33352012-01-07 LynX <_LynX@bk.ru> (tiny change)
3336
3337 * w32.c (sys_rename): Report EXDEV when rename of a directory
3338 fails because the target is on another logical disk. (Bug#10284)
3339
75bf0d33
DB
33402012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
3341
3342 * xterm.c (x_embed_request_focus): New function.
3343
3344 * xterm.h: Add prototype.
3345
3346 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
3347
1c6e5a32
GM
33482012-01-05 Glenn Morris <rgm@gnu.org>
3349
3350 * emacs.c (emacs_copyright): Update short copyright year to 2012.
3351
651e947e
EZ
33522012-01-01 Eli Zaretskii <eliz@gnu.org>
3353
3354 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
3355 Load gnutls_transport_set_lowat only if GnuTLS version is below
3356 2.11.1.
3357 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
3358 GnuTLS versions below 2.11.1.
3359
3778cdd8
AL
33602011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
3361
3362 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
3363 to the doc string advising against its use for altering the way
3364 windows are scrolled.
3365
0e5317f7
KH
33662011-12-28 Kenichi Handa <handa@m17n.org>
3367
3368 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
3369 coding-system ASCII compatible only when it does not produce BOM
3370 on encoding (Bug#10383).
3371
93d5ca1f
JD
33722011-12-26 Jan Djärv <jan.h.d@swipnet.se>
3373
3374 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
3375 can scroll.
3376 (create_and_show_popup_menu): Always use menu_position_func for
3377 Gtk3 (Bug#10361).
3378
ca22b785
AS
33792011-12-24 Andreas Schwab <schwab@linux-m68k.org>
3380
3381 * callint.c (Fcall_interactively): Don't truncate prompt string.
3382
d048e1e6
EZ
33832011-12-23 Eli Zaretskii <eliz@gnu.org>
3384
3385 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
3386 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 3387 resumed from there (after widening). (Bug#10360)
d048e1e6 3388
5ccaba1f
JD
33892011-12-22 Jan Djärv <jan.h.d@swipnet.se>
3390
3391 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
3392
204ee57f
JD
33932011-12-21 Jan Djärv <jan.h.d@swipnet.se>
3394
b81d40f0
JB
3395 * nsterm.m (x_free_frame_resources):
3396 Release f->output_data.ns->miniimage.
204ee57f
JD
3397 (ns_index_color): Fix indentation. Do not retain
3398 color_table->colors[i].
3399
3400 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
3401 before returning.
3402
3403 * nsfns.m (x_set_background_color): Assign return value from
3404 ns_index_color to face-background instead of NSColor*.
3405 (ns_implicitly_set_icon_type): Fix indentation.
3406 Change assignment in for loop to comparison.
3407
3408 * emacs.c (ns_pool): New variable.
3409 (main): Assign ns_pool.
3410 (Fkill_emacs): Call ns_release_autorelease_pool.
3411
3412 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
3413 autorelease fdesc, release fdAttrs and tdict.
3414 (ns_get_covering_families): Release charset.
3415 (ns_findfonts): Release NSFontDescriptor created with new.
3416 (ns_uni_to_glyphs): Fix indentation.
3417 (setString): Release attrStr before assigning new value.
3418
c803b2b7
JD
34192011-12-18 Jan Djärv <jan.h.d@swipnet.se>
3420
678f4426
JD
3421 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
3422 and NS_IMPL_COCOA.
3423 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
3424 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
3425
cd394be1 34262011-12-18 David Reitter <reitter@cmu.edu>
678f4426 3427
5fecd5fc
JD
3428 * nsterm.m (ns_term_init): Subscribe for notifications
3429 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
3430 to method trackingNotification in EmacsMenu.
3431
3432 * nsmenu.m (trackingMenu): New variable.
3771cb17 3433 (trackingNotification): New method (from Aquamacs).
5fecd5fc 3434 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 3435 from Aquamacs (Bug#7030).
678f4426
JD
3436
34372011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 3438
c803b2b7
JD
3439 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
3440 (symbol_to_nsstring): Fix indentation.
3441 (ns_symbol_to_pb): New function.
cae07000
SM
3442 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
3443 (Fns_rotate_cut_buffers_internal): Remove.
3444 (Fns_store_selection_internal): Rename from
c803b2b7
JD
3445 Fns_store_cut_buffer_internal.
3446 (ns_get_foreign_selection, Fx_own_selection_internal)
3447 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
3448 (Fns_get_selection_internal, Fns_store_selection_internal):
3449 Use ns_symbol_to_pb and check if return value is nil.
3450 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
3451 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
3452 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
3453 renamed to Sns_store_selection_internal.
3454 (ns_handle_selection_request): Move code to Fx_own_selection_internal
3455 and remove this function.
3456 (ns_handle_selection_clear): Remove, never used.
3457 (Fx_own_selection_internal): Move code from ns_handle_selection_request
3458 here.
3459
e1b01a3a
KB
34602011-12-17 Ken Brown <kbrown@cornell.edu>
3461
3462 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
3463 GID is unknown (Bug#10257).
3464
2adb6e85
PE
34652011-12-17 Paul Eggert <eggert@cs.ucla.edu>
3466
3467 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
3468 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
3469 which caused a build failure on GNU/Linux IA-64. This problem was
3470 introduced by my 2011-10-07 patch.
3471
d1d7b339
JL
34722011-12-15 Juri Linkov <juri@jurta.org>
3473
3474 * image.c (imagemagick_error): New function. (Bug#10112)
3475 (imagemagick_load_image): Comment out `MagickSetResolution' call.
3476 Use `imagemagick_error' where ImageMagick functions return
3477 `MagickFalse'.
3478 (Fimagemagick_types): Add `Fnreverse' to return the list in the
3479 proper order.
3480
100d5755
KH
34812011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3482
3483 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
3484 fill background (Bug#8992).
3485
454592a6
MR
34862011-12-13 Martin Rudalics <rudalics@gmx.at>
3487
3488 * window.c (Vwindow_combination_resize)
3489 (Vwindow_combination_limit): Use t instead of non-nil in
3490 doc-strings.
61d4b438
MR
3491 (Vrecenter_redisplay): Add first sentence of doc-string on
3492 separate line.
53524d93 3493 (Frecenter): Fix doc-string typo.
454592a6 3494
3633e3aa
KH
34952011-12-11 Kenichi Handa <handa@m17n.org>
3496
3497 * coding.c (Funencodable_char_position): Pay attention to the
3498 buffer text relocation (Bug#9389).
3499
7b9d523a 35002011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 3501
7b9d523a
JD
3502 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
3503 gtk_init (Bug#10100).
3504
b73189c6
EZ
35052011-12-10 Eli Zaretskii <eliz@gnu.org>
3506
3507 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
3508 IT->string is nil. (Bug#10263)
3509
f7dfe5d6
JD
35102011-12-10 Jan Djärv <jan.h.d@swipnet.se>
3511
83faebb4
JD
3512 * nsterm.h (x_free_frame_resources): Declare.
3513
f7dfe5d6
JD
3514 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
3515 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
3516
3517 * nsterm.h (ns_get_defaults_value): Declare.
3518
3519 * nsterm.m (ns_default): Call ns_get_defaults_value.
3520
7cd4e72c
EZ
35212011-12-09 Eli Zaretskii <eliz@gnu.org>
3522
3523 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
3524 (Bug#10170)
3525
b34d7317
YM
35262011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3527
3528 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
3529 that where the value of an _OBJC_* symbol points to is in the .bss
3530 section (Bug#10240).
3531
76470ad1
KH
35322011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3533
3534 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 3535 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 3536
745fff94
KH
35372011-12-08 Kenichi Handa <handa@m17n.org>
3538
3539 * ftfont.c (get_adstyle_property): Fix previous change
3540 (Bug#10233).
3541
6e44397c
JB
35422011-12-07 Juanma Barranquero <lekktu@gmail.com>
3543
3544 * w32.c (init_environment): If no_site_lisp, remove site-lisp
3545 dirs from the default value of EMACSLOADPATH (bug#10208).
3546
7efa6272
GM
35472011-12-07 Glenn Morris <rgm@gnu.org>
3548
3549 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
3550 installation and source directories as well. (Bug#10208)
3551
f6fc4d87
CY
35522011-12-06 Chong Yidong <cyd@gnu.org>
3553
3554 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
3555
2bf26180
GM
35562011-12-06 Glenn Morris <rgm@gnu.org>
3557
3558 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
3559 as an error, not just -1. (Bug#10217)
3560
3a6ad4f0
CY
35612011-12-05 Chong Yidong <cyd@gnu.org>
3562
3563 * keyboard.c (process_special_events): New function.
3564 (swallow_events, Finput_pending_p): Use it (Bug#10195).
3565
75a3b399
PE
35662011-12-05 Paul Eggert <eggert@cs.ucla.edu>
3567
3568 * coding.c (encode_designation_at_bol): Don't use uninitialized
3569 local variable (Bug#9318).
3570
c3c9e25e
KH
35712011-12-05 Kenichi Handa <handa@m17n.org>
3572
3573 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
3574 return Qnil (Bug#8046, Bug#10193).
3575
5eb05ea3
KH
35762011-12-05 Kenichi Handa <handa@m17n.org>
3577
3578 * coding.c (encode_designation_at_bol): New args charbuf_end and
3579 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
3580 (coding_set_source): Return how many bytes coding->source was
3581 relocated.
3582 (coding_set_destination): Return how many bytes
3583 coding->destination was relocated.
3584 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 3585 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
3586
35872011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3588
3589 * coding.c (CODING_CHAR_CHARSET_P): New macro.
3590 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
3591 macro (Bug#9318).
3592
35932011-12-05 Andreas Schwab <schwab@linux-m68k.org>
3594
3595 The following changes are to fix Bug#9318.
3596
a79703f5 3597 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
3598 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
3599 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 3600 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 3601
7dbda6df
JB
36022011-12-05 Juanma Barranquero <lekktu@gmail.com>
3603
3604 * lisp.h (process_quit_flag): Fix external declaration.
3605
6d5eb5b0
SM
36062011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
3607
3608 Don't macro-inline non-performance-critical code.
3609 * eval.c (process_quit_flag): New function.
3610 * lisp.h (QUIT): Use it.
3611
a0c3fad0
JD
36122011-12-04 Jan Djärv <jan.h.d@swipnet.se>
3613
3614 * nsfns.m (get_geometry_from_preferences): New function.
3615 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
3616
6c07aac2
AS
36172011-12-04 Andreas Schwab <schwab@linux-m68k.org>
3618
3619 * emacs.c (Qkill_emacs): Define.
3620 (syms_of_emacs): Initialize it.
3621 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
3622 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
3623 (quit_throw_to_read_char): Add parameter `from_signal'.
3624 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
3625 * lisp.h (QUIT): Call Fkill_emacs if requested.
3626
c052ead4
JD
36272011-12-03 Jan Djärv <jan.h.d@swipnet.se>
3628
3629 * widget.c (update_wm_hints): Return if wmshell is null.
3630 (widget_update_wm_size_hints): New function.
3631
3632 * widget.h (widget_update_wm_size_hints): Declare.
3633
3634 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
3635 widget_update_wm_size_hints (Bug#10104).
3636
9e49252b
EZ
36372011-12-03 Eli Zaretskii <eliz@gnu.org>
3638
3639 * xdisp.c (handle_invisible_prop): If the invisible text ends just
3640 before a newline, prepare the bidi iterator for consuming the
3641 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 3642 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 3643
02b16839
JL
36442011-12-02 Juri Linkov <juri@jurta.org>
3645
3646 * search.c (Fword_search_regexp): New Lisp function created from
3647 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
3648 (Fword_search_backward, Fword_search_forward)
3649 (Fword_search_backward_lax, Fword_search_forward_lax):
3650 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
3651 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
3652
0068070e
SM
36532011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
3654
3655 * fileio.c (Finsert_file_contents): Move after-change-function call
3656 to before the "handled:" label, since all "goto handled" appear in
3657 cases where the *-change-functions have already been properly called
3658 (bug#10117).
3659
3360a3fc
AS
36602011-12-01 Andreas Schwab <schwab@linux-m68k.org>
3661
3662 * keyboard.c (interrupt_signal): Don't call kill-emacs when
3663 waiting for input. (Bug#10169)
3664
73d6c093
EZ
36652011-11-30 Eli Zaretskii <eliz@gnu.org>
3666
3667 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
3668 verifies glyph row's hash code--we have just reallocated the
3669 glyphs, so their contents can be complete garbage. (Bug#10164)
3670
febe6bea
JB
36712011-11-30 Juanma Barranquero <lekktu@gmail.com>
3672
3673 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
3674
801a4313
EZ
36752011-11-30 Eli Zaretskii <eliz@gnu.org>
3676
3677 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
3678 attributes are tested _before_ calling verify_row_hash, to protect
3679 against GCC re-ordering of the tests. (Bug#10164)
3680
2b56b87e
JD
36812011-11-29 Jan Djärv <jan.h.d@swipnet.se>
3682
3683 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
3684
3685 * xterm.c (handle_one_xevent): Only set async_visible and friends
3686 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 3687 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
3688 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
3689
dbf31225
PE
36902011-11-28 Paul Eggert <eggert@cs.ucla.edu>
3691
3692 Remove GCPRO-related macros that exist only to avoid shadowing locals.
3693 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
3694 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
3695 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
3696 All uses changed to use GCPRO1 etc.
3697 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
3698 Revert to old implementation (i.e., before 2011-03-11).
3699
1305621b
YM
37002011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3701
3702 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
3703 of scroll runs so as to avoid assigning disabled bogus rows and
3704 unnecessary graphics copy operations.
3705
8c9afb46
EZ
37062011-11-27 Eli Zaretskii <eliz@gnu.org>
3707
3708 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
3709 (snprintf) [_MSC_VER]: Redirect to _snprintf.
3710 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
3711 (malloc, free, realloc, calloc): Redirect to e_* only when
3712 compiling Emacs.
3713
3714 * lisp.h (GCTYPEBITS): Move before first use.
3715 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
3716 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
3717 this macro definition.
3718
3719 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
3720 _MSC_VER.
3721
54e9e3bf
JD
37222011-11-27 Jan Djärv <jan.h.d@swipnet.se>
3723
6d5eb5b0
SM
3724 * gtkutil.c (xg_create_frame_widgets):
3725 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
3726 present with Gtk+ 2.0.
3727
83aca1cb
PE
37282011-11-26 Paul Eggert <eggert@cs.ucla.edu>
3729
3730 * fileio.c (Finsert_file_contents): Undo previous change; see
3731 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
3732
5b76caa4
PE
37332011-11-26 Paul Eggert <eggert@cs.ucla.edu>
3734
3735 Rename locals to avoid shadowing.
3736 * fileio.c (Finsert_file_contents):
3737 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
3738 * process.c (wait_reading_process_output):
3739 Rename inner 'proc' to 'p' to avoid shadowing.
3740 Indent for consistency with usual Emacs style.
3741
8c535114
EZ
37422011-11-25 Eli Zaretskii <eliz@gnu.org>
3743
3744 * xdisp.c (redisplay_window): If cursor row is not fully visible
3745 after recentering, and scroll-conservatively is set to a large
3746 number, scroll window by a few more lines to make the cursor fully
3747 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
3748 (start_display): Don't move to the next line if the display should
3749 start at a newline that is part of a display vector or an overlay
3750 string. (Bug#10119)
8c535114 3751
fa4fdb5c
JL
37522011-11-24 Juri Linkov <juri@jurta.org>
3753
3754 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
3755 after the `MagickPingImage' call. (Bug#10112)
3756
90ec88df
CY
37572011-11-23 Chong Yidong <cyd@gnu.org>
3758
3759 * window.c (Fcoordinates_in_window_p): Accept only live windows.
3760
56e2e794
MR
37612011-11-23 Martin Rudalics <rudalics@gmx.at>
3762
3763 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
3764 making another buffer current. (Bug#10114)
3765
b6e64c41
GM
37662011-11-23 Glenn Morris <rgm@gnu.org>
3767
3768 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
3769
6b21de18
CY
37702011-11-23 Chong Yidong <cyd@gnu.org>
3771
3772 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
3773 using it (Bug#5984).
3774
b12cd789
EZ
37752011-11-22 Eli Zaretskii <eliz@gnu.org>
3776
3777 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
3778 and header-lines, as they don't have one computed for them.
3779 (Bug#10098)
3780
3781 * .gdbinit (prow): Make displayed values more self-explaining.
3782 Add row's hash code.
3783
261b6fd4
LMI
37842011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
3785
3786 * process.c (wait_reading_process_output): Fix asynchrounous
3787 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 3788 (wait_reading_process_output): Add comment and URL.
261b6fd4 3789
e7cfd277
JD
37902011-11-21 Jan Djärv <jan.h.d@swipnet.se>
3791
3792 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
3793
a9b9b7f5
CY
37942011-11-21 Chong Yidong <cyd@gnu.org>
3795
3796 * window.c (Fnext_window, Fprevious_window): Doc fix.
3797
b0d15b4f
SM
37982011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3799
3800 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
3801
fe7a3057
JB
38022011-11-20 Juanma Barranquero <lekktu@gmail.com>
3803
3804 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
3805
d2999b1a
MR
38062011-11-20 Martin Rudalics <rudalics@gmx.at>
3807
3808 * window.c (Fset_window_combination_limit): Rename argument
3809 STATUS to LIMIT.
3810 (Vwindow_combination_limit): Remove "status" from doc-string.
3811
d5ff9cd0
AS
38122011-11-20 Andreas Schwab <schwab@linux-m68k.org>
3813
3814 * m/ibms390.h: Remove.
3815 * m/ibms390x.h: Don't include "ibms390.h".
3816
a5bb9bd3
SM
38172011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3818
3819 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
3820 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
3821
cd1181db
JB
38222011-11-20 Juanma Barranquero <lekktu@gmail.com>
3823
3824 * casetab.c (Fset_case_table):
3825 * charset.c (Fcharset_after): Fix typos.
3826
615a3b8d 38272011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 3828
17e845af
PE
3829 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
3830 Otherwise, valgrind does not work on some platforms.
3831 Problem reported by Andreas Schwab in
6a0bf43d
PE
3832 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
3833 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
3834 is set, removing the need for VIRT_ADDRESS_VARIES.
3835 (PURE_P): Use a more-efficient implementation that needs just one
3836 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
3837 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
3838 to 4 (xorl, subq, cmpq, setbe).
3839 * alloc.c (pure): Always extern now, since that's the
3840 VIRT_ADDR_VARIES behavior.
3841 (PURE_POINTER_P): Use a single comparison, not two, for
3842 consistency with the new puresize.h.
3843 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
3844 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
3845 Remove VIRT_ADDR_VARIES no longer needed.
3846
f8fe6f96
EZ
38472011-11-19 Eli Zaretskii <eliz@gnu.org>
3848
3849 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
3850 (erase_phys_cursor, update_window_cursor, show_mouse_face)
3851 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
3852 behave as if the cursor position were at the window margin.
3853
3854 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
3855 and the cursor position is out of bounds, behave as if the cursor
3856 position were at the window margin. (Bug#10075)
3857
df05a53c
CY
38582011-11-18 Chong Yidong <cyd@gnu.org>
3859
3860 * window.c (Fwindow_combination_limit): Make first argument
3861 non-optional, since it is meaningless for live windows like the
3862 selected window.
61ccba97 3863
2071918e
DA
38642011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
3865
3866 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
3867
b50a28de
SM
38682011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
3869
3870 * intervals.c: Fix grafting over the whole buffer (bug#10071).
3871 (graft_intervals_into_buffer): Simplify.
3872
015137db
EZ
38732011-11-18 Eli Zaretskii <eliz@gnu.org>
3874
3875 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
3876 hash values of the two rows.
3877 (copy_row_except_pointers): Preserve the used[] arrays and the
3878 hash values of the two rows. (Bug#10035)
68c95424 3879 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
3880
3881 * xdisp.c (row_hash): New function, body extracted from
3882 compute_line_metrics.
3883 (compute_line_metrics): Call row_hash, instead of computing the
3884 hash code inline.
3885
3886 * dispnew.c (verify_row_hash): Call row_hash for computing the
3887 hash code of a row, instead of duplicating code from xdisp.c.
3888
3889 * dispextern.h (row_hash): Add prototype.
3890
a2addb04
TH
38912011-11-18 Tassilo Horn <tassilo@member.fsf.org>
3892
3893 * frame.c (delete_frame): Don't delete the terminal when the last
3894 X frame is closed if emacs is built with GTK toolkit.
3895
df85d315
JB
38962011-11-17 Juanma Barranquero <lekktu@gmail.com>
3897
3898 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
3899
a0c2d0ae
MR
39002011-11-17 Martin Rudalics <rudalics@gmx.at>
3901
3902 * window.c (Vwindow_splits): Rename to
3903 Vwindow_combination_resize. Suggested by Juri Linkov.
3904 (Fsplit_window_internal): Use Vwindow_combination_resize instead
3905 of Vwindow_splits.
3906
58179cce
JB
39072011-11-16 Juanma Barranquero <lekktu@gmail.com>
3908
7877f373
JB
3909 * nsfns.m (Fns_font_name):
3910 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 3911
b6f67890
MR
39122011-11-16 Martin Rudalics <rudalics@gmx.at>
3913
3914 * window.h (window): Rename slot "nest" to "combination_limit".
3915 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
3916 (Fset_window_nest): Rename to Fset_window_combination_limit.
3917 (Vwindow_nest): Rename to Vwindow_combination_limit.
3918 (recombine_windows, make_parent_window, make_window)
3919 (Fsplit_window_internal, saved_window)
3920 (Fset_window_configuration, save_window_save): Rename all
3921 occurrences of window_nest to window_combination_limit.
3922
c7015153
JB
39232011-11-15 Juanma Barranquero <lekktu@gmail.com>
3924
3925 * image.c (imagemagick_load_image): Fix typo.
3926
322ad6ec
EZ
39272011-11-14 Eli Zaretskii <eliz@gnu.org>
3928
3929 * xdisp.c (display_line): Move the call to
3930 highlight_trailing_whitespace before the call to
3931 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
3932 faces of all the glyphs to compute ROW's hash value.
3933 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 3934
f067b8ec
JB
39352011-11-14 Juanma Barranquero <lekktu@gmail.com>
3936
3937 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
3938 just return (bug#10044).
3939
1e5b2111
EZ
39402011-11-12 Eli Zaretskii <eliz@gnu.org>
3941
7ef3cbd5
EZ
3942 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
3943 with user-defined heap size. Bump the default size of the temacs
3944 heap to 27MB, to avoid memory warning when running temacs.
3945 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
3946
1e5b2111
EZ
3947 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
3948 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
3949 (verify_row_hash) [XASSERTS]: New function.
3950 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
3951 that the hash value of glyph rows is correct.
1e5b2111 3952
89d61221
MR
39532011-11-12 Martin Rudalics <rudalics@gmx.at>
3954
3955 * window.h (window): Remove splits slot.
3956 * window.c (Fwindow_splits, Fset_window_splits): Remove.
3957 (Fdelete_other_windows_internal, make_parent_window)
3958 (make_window, Fsplit_window_internal, Fdelete_window_internal)
3959 (Fset_window_configuration, save_window_save): Don't deal with
3960 split status of windows.
3961 (saved_window): Remove splits slot.
3962 (Vwindow_splits): Rewrite doc-string.
3963
97f18cc8
JD
39642011-11-11 Jan Djärv <jan.h.d@swipnet.se>
3965
3966 * xfns.c (unwind_create_frame):
3967 * nsfns.m (unwind_create_frame):
3968 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
3969 Vframe_list (Bug#9999).
3970
22a648b4
DA
39712011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
3972
0b381c7e 3973 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 3974
659afede
KH
39752011-11-11 Kenichi Handa <handa@m17n.org>
3976
3977 * callproc.c (Fcall_process): Set the member dst_multibyte of
3978 process_coding.
3979
9ac0394b
KH
39802011-11-11 Johan Bockgård <bojohan@gnu.org>
3981
3982 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
3983 avoid a crash (bug#9496).
3984
2fbdc249
CY
39852011-11-09 Chong Yidong <cyd@gnu.org>
3986
3987 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3988 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
3989
ac6b1f81
PE
39902011-11-08 Paul Eggert <eggert@cs.ucla.edu>
3991
3992 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
3993
09db192c
PE
39942011-11-08 Paul Eggert <eggert@cs.ucla.edu>
3995
3996 Avoid some portability problems by eschewing 'extern inline' functions.
3997 The trivial performance wins aren't worth the portability hassles; see
3998 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
3999 et seq.
4000 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4001 (window_box_width, window_box_left, window_box_left_offset)
4002 (window_box_right, window_box_right_offset): Undo previous change,
4003 by removing the "extern"s.
4004 * intervals.c (adjust_intervals_for_insertion)
4005 (adjust_intervals_for_deletion): Undo previous change,
4006 making these static again.
4007 (offset_intervals, temp_set_point_both, temp_set_point)
4008 (copy_intervals_to_string): No longer inline.
4009 * xdisp.c (window_text_bottom_y, window_box_width)
4010 (window_box_height, window_box_left_offset)
4011 (window_box_right_offset, window_box_left, window_box_right)
4012 (window_box): No longer inline.
4013
105216ed
CY
40142011-11-08 Chong Yidong <cyd@gnu.org>
4015
4016 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
4017 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
4018 Signal an error if not a live window.
105216ed
CY
4019 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
4020 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
4021
ae9e237f
JB
40222011-11-07 Juanma Barranquero <lekktu@gmail.com>
4023
4024 * lisp.h (syms_of_abbrev): Remove declaration.
4025 Reported by CHENG Gao <chenggao@royau.me>.
4026
c7aa8333
EZ
40272011-11-07 Eli Zaretskii <eliz@gnu.org>
4028
4029 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
4030 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
4031 of temacs in GUI mode.
4032
be7f5545
MR
40332011-11-07 Martin Rudalics <rudalics@gmx.at>
4034
4035 * window.h: Declare delete_all_child_windows instead of
4036 delete_all_subwindows.
4037 * window.c (Fwindow_nest, Fset_window_nest)
4038 (Fset_window_new_total, Fset_window_new_normal)
4039 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
4040 (delete_all_subwindows): Rename to delete_all_child_windows.
4041 (Fdelete_other_windows_internal, Fset_window_configuration):
4042 Call delete_all_child_windows instead of delete_all_subwindows.
4043 * frame.c (delete_frame): Call delete_all_child_windows instead
4044 of delete_all_subwindows.
4045
ca78dc43
PE
40462011-11-07 Paul Eggert <eggert@cs.ucla.edu>
4047
4048 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
4049 This is also needed for porting to any host where GC_MARK_STACK is
4050 not GC_MAKE_GCPROS_NOOPS.
4051 (which_symbols): Use it.
4052
a0241d01
KH
40532011-11-07 Kenichi Handa <handa@m17n.org>
4054
4055 * coding.c (coding_set_destination): Check coding->src_pos only
4056 when coding->src_object is a buffer (bug#9910).
4057
4058 * process.c (send_process): Set the member src_multibyte of coding
4059 to 0 (bug#9911) when sending a unibyte text.
4060
4061 * callproc.c (Fcall_process): Set the member src_multibyte of
4062 process_coding to 0 (bug#9912).
4063
a64bfdfa 40642011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
4065
4066 * xmenu.c (cleanup_widget_value_tree): New function.
4067 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
4068 calling free_menubar_widget_value_tree directly (Bug#9830).
4069
cb41b32a
PE
40702011-11-06 Paul Eggert <eggert@cs.ucla.edu>
4071
4072 Fix some portability problems with 'inline'.
4073 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
4074 (window_box_width, window_box_left, window_box_left_offset)
4075 (window_box_right, window_box_right_offset): Declare extern.
4076 Otherwise, these inline functions do not conform to C99 and
4077 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
4078 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
4079 * intervals.c (adjust_intervals_for_insertion)
4080 (adjust_intervals_for_deletion): Now extern, because otherwise the
4081 extern inline functions 'offset_intervals' couldn't refer to it.
4082 (static_offset_intervals): Remove.
4083 (offset_intervals): Rewrite using the old contents of
4084 static_offset_intervals. The old version didn't conform to C99
4085 because an extern inline function contained a reference to an
4086 identifier with static linkage.
4087
b7041366
AS
40882011-11-06 Andreas Schwab <schwab@linux-m68k.org>
4089
4090 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
4091 GC.
4092
88a37c4d
EZ
40932011-11-06 Eli Zaretskii <eliz@gnu.org>
4094
4095 * xdisp.c (init_iterator, reseat_to_string): Don't set the
4096 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
4097 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
4098 return Qleft_to_right.
4099
49745b39
CY
41002011-11-06 Chong Yidong <cyd@gnu.org>
4101
4102 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
4103 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
4104 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
4105 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
4106 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
4107 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
4108 (Fwindow_vscroll): Doc fix.
4109 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
4110 argument, since it makes no sense to pass a live window and for
4111 consistency with window-child.
4112
1f05cd82
CS
41132011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
4114
4115 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
4116 support MSVC.
4117
22610910
JR
41182011-11-05 Jason Rumney <jasonr@gnu.org>
4119
4120 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
4121 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
4122 fonts (Bug#6029).
4123 (add_font_entity_to_list): Fix logic errors in mixed boolean and
4124 bitwise arithmetic preventing use of unicode-sip and non-truetype
4125 opentype fonts.
4126
a06776b2
EZ
41272011-11-05 Eli Zaretskii <eliz@gnu.org>
4128
3ad924ba
EZ
4129 * s/ms-w32.h (fstat, stat, utime): Move redirections to
4130 "emacs"-only part.
4131
a06776b2
EZ
4132 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
4133 initialization code to keep similarity to xfns.c after changes
4134 from 2011-11-05.
4135
c9e7db78
JD
41362011-11-05 Jan Djärv <jan.h.d@swipnet.se>
4137
a97f8f3f
JD
4138 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
4139 (unwind_create_frame): New function (Bug#9943).
4140 (Fx_create_frame): Restructure code to be more similar to the one in
4141 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
4142 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
4143 Move terminal->reference_count++ just before making the frame official
4144 (Bug#9943).
4145
4146 * nsterm.m (x_free_frame_resources): New function.
4147 (x_destroy_window): Move code to x_free_frame_resources.
4148
c9e7db78 4149 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
4150 (Fx_create_frame, x_create_tip_frame):
4151 Move terminal->reference_count++ just before making the frame
75f1671a 4152 official. Move initialization of image_cache_refcount and
c9e7db78
JD
4153 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
4154
a6fc3b5c
EZ
41552011-11-05 Eli Zaretskii <eliz@gnu.org>
4156
4157 Support MSVC build with newer versions of Visual Studio.
4158 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
4159 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
4160 nt/gmake.defs.
4161
4162 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
4163 which are not supported by MSVC.
4164 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
4165 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
4166 bitfields.
4167 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
4168 types in bitfields.
4169 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
4170
4171 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
4172
58179cce 41732011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
4174
4175 Support MSVC build with newer versions of Visual Studio.
4176 * w32.c: Don't include w32api.h for MSVC.
4177 (init_environment) [_MSC_VER]: Call sys_access, not _access.
4178
4179 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
4180 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
4181 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
4182 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
4183 e_* cousins.
4184 (alloca) [_MSC_VER]: Define to _alloca.
4185
4186 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
4187
4188 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
4189
a58c13ed
EZ
41902011-11-04 Eli Zaretskii <eliz@gnu.org>
4191
4192 * xdisp.c (note_mouse_highlight): If either of
4193 previous/next-single-property-change returns nil, treat that as
4194 the beginning or the end of the buffer. (Bug#9955)
4195
fe0b6370
JD
41962011-11-04 Jan Djärv <jan.h.d@swipnet.se>
4197
a58c13ed 4198 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
4199 label is not null (Bug#9951).
4200 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
4201 may be NULL.
4202
89bd5ee1
EZ
42032011-11-04 Eli Zaretskii <eliz@gnu.org>
4204
4205 * window.c (Fwindow_body_size): Mention in the doc string that the
4206 return value is in frame's canonical units. (Bug#9949)
4207
84c3edb9
EZ
42082011-11-03 Eli Zaretskii <eliz@gnu.org>
4209
4e2fb5c7
EZ
4210 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
4211
84c3edb9 4212 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 4213 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 4214 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 4215
bc17a887
EZ
42162011-11-01 Eli Zaretskii <eliz@gnu.org>
4217
4218 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
4219 Don't stop backward scan on the continuation glyph, even though
4220 its CHARPOS is positive.
6d5eb5b0
SM
4221 (mouse_face_from_buffer_pos, note_mouse_highlight):
4222 Rename cover_string to disp_string.
bc17a887 4223
4ee88440
MR
42242011-11-01 Martin Rudalics <rudalics@gmx.at>
4225
4226 * window.c (temp_output_buffer_show): Don't use
4227 Vtemp_buffer_show_specifiers.
4228 (Vtemp_buffer_show_specifiers): Remove unused variable.
4229
c2ff3c02
EZ
42302011-10-30 Eli Zaretskii <eliz@gnu.org>
4231
4232 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
4233 past the beginning of the current glyph matrix.
4234
58179cce 42352011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
4236
4237 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
4238 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
4239 HAVE_GTK3 (Bug#9869).
b77a6a7f 4240
3b574623
JD
4241 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
4242 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
4243
b77a6a7f
JD
4244 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
4245
4246 * xterm.c: Declare x_handle_net_wm_state to return int.
4247 (handle_one_xevent): Check if we are iconified but don't have
4248 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
4249 (get_current_wm_state): Return non-zero if not hidden,
4250 check for _NET_WM_STATE_HIDDEN (Bug#9893).
4251 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
4252 (x_handle_net_wm_state): Return what get_current_wm_state returns.
4253 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
4254
196e41e4
PE
42552011-10-29 Paul Eggert <eggert@cs.ucla.edu>
4256
4257 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
4258 so that this new function doesn't get optimized away by a
4259 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
4260
021f2e1a
AS
42612011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4262
4263 * frame.h (MOUSE_HL_INFO): Remove excess parens.
4264
8b058d44
EZ
42652011-10-29 Eli Zaretskii <eliz@gnu.org>
4266
4267 Fix the `xbytecode' command.
4268 * .gdbinit (xprintbytestr): New command.
b50a28de 4269 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
4270 (xbytecode): Print the byte-code string as well.
4271
4452fb80
EZ
42722011-10-29 Kim Storm <storm@cua.dk>
4273
8b058d44
EZ
4274 * alloc.c (which_symbols): New function.
4275
21b72067
AS
42762011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4277
4278 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
4279 line. (Bug#9903)
4280
83ed7b5c
GM
42812011-10-29 Glenn Morris <rgm@gnu.org>
4282
4283 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
4284 Not clear what it was for, and it causes various bugs. (Bug#9839)
4285
5a7a728b
EZ
42862011-10-28 Eli Zaretskii <eliz@gnu.org>
4287
4288 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
4289 possible random value that matches one of those tested as
4290 condition to clear the mouse face.
4291
d3d0842f
CY
42922011-10-28 Chong Yidong <cyd@gnu.org>
4293
4294 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
4295
31b39d13
DN
42962011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
4297
4298 * window.c (make_window): Initialize phys_cursor_on_p.
4299
9aba6043
SM
43002011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4301
4302 * lisp.h (struct Lisp_Symbol): Update comments.
4303
c20992f4
JB
43042011-10-28 Juanma Barranquero <lekktu@gmail.com>
4305
4306 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
4307
db4f02f2
EZ
43082011-10-28 Eli Zaretskii <eliz@gnu.org>
4309
4310 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
4311 <oslsachem@gmail.com> for helping to debug this.
4312
4313 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
4314 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
4315 (g_b_init_get_glyph_outline_w): New static variables.
4316 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
4317 (GetGlyphOutlineW_Proc): New typedefs.
4318 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
4319 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
4320 New functions.
4321 (w32font_open_internal, compute_metrics):
4322 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
4323 instead of calling the "wide" APIs directly.
4324
4325 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
4326
4327 * w32.h (syms_of_w32font): Add prototype.
4328
87e68db4
JB
43292011-10-27 Juanma Barranquero <lekktu@gmail.com>
4330
4331 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
4332 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
4333 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
4334 (Fmove_to_window_line): Doc fix.
4335
435c1d67
CY
43362011-10-27 Chong Yidong <cyd@gnu.org>
4337
4338 * process.c (make_process): Set gnutls_state to NULL.
4339
4340 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
4341 non-NULL, regardless of GNUTLS_INITSTAGE.
4342 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
4343 an error. Set process slots as soon as we allocate them.
4344
4345 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
4346
9c6c6f49
CY
43472011-10-27 Chong Yidong <cyd@gnu.org>
4348
9aba6043
SM
4349 * gnutls.c (emacs_gnutls_deinit): New function.
4350 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
4351 (Fgnutls_deinit, Fgnutls_boot): Use it.
4352
4353 * process.c (make_process): Initialize GnuTLS credentials to NULL.
4354 (deactivate_process): Call emacs_gnutls_deinit.
4355
657d08d3
JB
43562011-10-27 Juanma Barranquero <lekktu@gmail.com>
4357
4358 * image.c (x_create_x_image_and_pixmap):
4359 * w32.c (sys_rename, w32_delayed_load):
4360 * w32font.c (fill_in_logfont):
4361 * w32reg.c (x_get_string_resource): Silence compiler warnings.
4362
5430d399
JB
43632011-10-26 Juanma Barranquero <lekktu@gmail.com>
4364
4365 * w32fns.c (w32_default_color_map): New function,
4366 extracted from Fw32_default_color_map.
a7ef684b 4367 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 4368
fe0055fa
PE
43692011-10-25 Paul Eggert <eggert@cs.ucla.edu>
4370
4371 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
4372
e6346438
SM
43732011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
4374
4375 * keyboard.c (test_undefined): New function (bug#9751).
4376 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
4377
e112cc37
ET
43782011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
4379
4380 * sysdep.c (init_sys_modes): Fix the check for the controlling
4381 terminal (Bug#6649).
4382
7b5d6677
EZ
43832011-10-20 Eli Zaretskii <eliz@gnu.org>
4384
4385 * dispextern.h (struct bidi_it): New member next_en_type.
4386
4387 * bidi.c (bidi_line_init): Initialize the next_en_type member.
4388 (bidi_resolve_explicit_1): When next_en_pos is valid for the
4389 current character, check also for next_en_type being WEAK_EN.
4390 (bidi_resolve_weak): Don't enter the expensive loop if the current
4391 position is before next_en_pos. Record the bidi type of the first
4392 non-ET, non-BN character we find, in addition to its position.
4393 (bidi_level_of_next_char): Invalidate next_en_type when
4394 next_en_pos is over-stepped.
4395
7da0b018
PE
43962011-10-20 Paul Eggert <eggert@cs.ucla.edu>
4397
4398 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
4399 * editfns.c: Rewrite current-time-zone so that it invokes
4400 the equivalent of (format-time-string "%Z") to get the time zone name.
4401 This fixes a bug when the time zone name contains characters that
4402 need converting from the system time locale to Emacs internal format.
4403 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
4404 that patch fixed format-time-string to do the conversion, but
4405 I forgot to fix current-time-zone.
4406 (format_time_string): New function, containing most of
4407 what Fformat_time_string used to contain.
4408 (Fformat_time_string): Rewrite in terms of format_time_string.
4409 This doesn't change this function's behavior.
4410 (current-time-zone): Rewrite to use format_time_string.
4411 This fixes the bug reported by Michael Schierl in
4412 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
4413 Jason Rumney's 2007-06-07 change worked around this bug, but
4414 didn't fix it.
4415 * systime.h (tzname, timezone): Remove no-longer-used declarations.
4416
8547b010
EZ
44172011-10-19 Eli Zaretskii <eliz@gnu.org>
4418
4419 * xdisp.c (start_display): If the character at POS is displayed
4420 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
4421 (try_window_reusing_current_matrix): If a line ends in a display
4422 vector or the next line starts in a display vector, continue
4423 redrawing the window even though the character position of
4424 start_row was reached.
8547b010
EZ
4425 (Bug#9771, part 2)
4426
4e948d15
CY
44272011-10-18 Chong Yidong <cyd@gnu.org>
4428
4429 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
4430 with nobreak-char-display too.
4431
4787455f
EZ
44322011-10-18 Eli Zaretskii <eliz@gnu.org>
4433
4434 Fix part 3 of bug#9771.
4435 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
4436 (bidi_resolve_neutral): Don't enter the expensive loop looking for
4437 non-neutral characters if the current character is a paragraph
4438 separator (a.k.a. Newline). This avoids running the same
4439 expensive loop twice, once when we consume the preceding newline
4440 and the other time when the line actually needs to be displayed.
4441 Avoid the loop when we see neutrals on the base embedding level
4442 following a character whose directionality is the same as the
4443 paragraph's. This avoids running the expensive loop when a line
4444 ends in a long sequence of neutrals, like control characters.
4445 Add assertion against STRONG_AL type. Slightly rearrange code
4446 that determines the type of a neutral given the first non-neutral
4447 that follows it.
4448 (bidi_level_of_next_char): Set next_en_pos to zero when
4449 invalidating its info.
4450
2c91f553
EZ
44512011-10-17 Eli Zaretskii <eliz@gnu.org>
4452
4453 * xdisp.c (push_display_prop): Determine whether to record string
4454 or buffer position by IT->string, not by IT->method. Allow
4455 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
4456 (move_it_vertically_backward): Don't look for character position
4457 immediately after the newline when in a continuation line.
4458 (Bug#9771, part 1)
2c91f553 4459
c7b08b0d
MR
44602011-10-15 Martin Rudalics <rudalics@gmx.at>
4461
4462 * window.c (coordinates_in_window): Rewrite and delabelize
4463 vertical border check. (Bug#5357) (Bug#9618)
4464
6b02f655
SM
44652011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
4466
4467 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
4468 errors in XSetWindowBorder (bug#9310).
4469
81d40c92
DA
44702011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
4471
4472 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
4473 avoid crash when xmalloc overrun checking is enabled.
4474
d4172c3b
EZ
44752011-10-13 Eli Zaretskii <eliz@gnu.org>
4476
4477 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
4478 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
4479 cursor motion with <left> and <right> arrow keys.
4480
4481 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
4482 some callers set that themselves.
4483
b00eea75
EZ
44842011-10-12 Eli Zaretskii <eliz@gnu.org>
4485
4486 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
4487 display string and the previous row comes from the same string and
4488 is empty. (Bug#9739) (Bug#9738)
4489
8fe012c4
SM
44902011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4491
4492 * doc.c (get_doc_string): Encode file name (bug#9735).
4493
0074aef2
EZ
44942011-10-12 Eli Zaretskii <eliz@gnu.org>
4495
79beb178
EZ
4496 * bidi.c (bidi_level_of_next_char):
4497 * xdisp.c (get_visually_first_element): Remove old incorrect
4498 comments regarding the Unicode Line Separator character.
4499
0074aef2
EZ
4500 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
4501
6e4b3fbe
DA
45022011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
4503
4504 * alloc.c (Fgc_status): Do not access beyond zombies array
4505 boundary if nzombies > MAX_ZOMBIES.
4506 * alloc.c (dump_zombies): Add missing format specifier.
4507
0324f3af
PE
45082011-10-12 Paul Eggert <eggert@cs.ucla.edu>
4509
b5525cac
PE
4510 * xdisp.c (set_cursor_from_row): Simplify conditionals,
4511 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
4512
0324f3af
PE
4513 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
4514 Some packages use them to denote characters with modifiers.
4515
e9b5f888
AS
45162011-10-11 Andreas Schwab <schwab@linux-m68k.org>
4517
4518 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
4519 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
4520 matching a pp-number. Rename parameter var to var1.
4521
127827c0
SM
45222011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4523
4524 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
4525
c8fd3bd0
GM
45262011-10-08 Glenn Morris <rgm@gnu.org>
4527
4528 * callint.c (Fcall_interactively): Give a more explicit error for the
4529 'c' case with a non-character input. (Bug#8479)
4530
352ec8ff
EZ
45312011-10-08 Eli Zaretskii <eliz@gnu.org>
4532
03669ccb
EZ
4533 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
4534 lines.
7061c986
EZ
4535 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
4536 lines that are hscrolled on the left.
03669ccb 4537
352ec8ff
EZ
4538 * dispnew.c (buffer_posn_from_coords): Account for a possible
4539 presence of header-line. (Bug#4426)
4540
a66cfb1c
SM
45412011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
4542
6b02f655
SM
4543 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
4544 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 4545
7c5ee88e
PE
45462011-10-07 Paul Eggert <eggert@cs.ucla.edu>
4547
4548 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
4549 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
4550 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
4551 this makes Emacs dump core during garbage collection on rare
4552 occasions. sizeof is obviously inferior to offsetof here, so
4553 stick with offsetof.
4554 (GC_POINTER_ALIGNMENT): New macro.
4555 (mark_memory): Omit 3rd (offset) arg; caller changed.
4556 Don't assume EMACS_INT alignment is the same as pointer alignment.
4557
df1bbe5b
SM
45582011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
4559
4560 * keyboard.c (read_key_sequence_remapped): New var.
4561 (read_key_sequence): Compute remapping in the right buffer.
4562 (command_loop_1): Use read_key_sequence's remapping directly.
4563
51553db6
SM
45642011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4565
32c1fffd
SM
4566 * dired.c (file_name_completion): Don't expand file name.
4567 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
4568 before checking file name handler.
4569
51553db6
SM
4570 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
4571 they've been requested explicitly (bug#9591).
4572
b6bd1599 45732011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
4574
4575 * keymap.c (Fsingle_key_description): Use make_specified_string
4576 instead of build_string to build string from push_key_description.
4577 (Bug#5193)
4578
f701dc2a
PE
45792011-09-30 Paul Eggert <eggert@cs.ucla.edu>
4580
4222c55d
PE
4581 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
4582 This fixes a Y2038 bug on 64-bit hosts.
4583 * buffer.c (reset_buffer):
4584 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
4585 (Fclear_buffer_auto_save_failure):
4586 Use 0, not -1, to represent an unset failure time, since time_t
4587 might not be signed.
4588
f701dc2a
PE
4589 Remove dependency on glibc malloc internals.
4590 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4591 Move back here from lisp.h, but with their new implementations.
4592 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4593 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
4594 * charset.c (charset_table_init): New static var.
4595 (syms_of_charset): Use it instead of xmalloc. This removes a
4596 dependency on glibc malloc internals. See Eli Zaretskii's comment in
4597 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
4598 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4599 Move back to alloc.c.
4600 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4601 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
4602
9ceebf39
JD
46032011-09-30 Jan Djärv <jan.h.d@swipnet.se>
4604
4605 * nsterm.m (windowDidResize): Call x_set_window_size only when
4606 ns_in_resize is true. Otherwise set pixelwidth/height and
4607 call change_frame_size (Bug#9628).
4608
cb993c58
PE
46092011-09-30 Paul Eggert <eggert@cs.ucla.edu>
4610
3930c88b
PE
4611 Port --enable-checking=all to Fedora 14 x86-64.
4612 * charset.c (syms_of_charset): Also account for glibc malloc's
4613 internal overhead when calculating the initial malloc maximum.
4614
cb993c58
PE
4615 Port --enable-checking=all to Fedora 14 x86.
4616 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4617 Move to lisp.h.
4618 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
4619 (overrun_check_realloc, overrun_check_free):
4620 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
4621 That way, xmalloc returns a properly-aligned pointer even if
4622 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
4623 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
4624 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
4625 into account when calculating the initial malloc maximum.
4626 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4627 Move here from alloc.c, so that charset.c can use it too.
4628 Properly align; the old code wasn't right for common 32-bit hosts
4629 when configured with --enable-checking=all.
4630 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4631 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
4632
31bed486
EZ
46332011-09-29 Eli Zaretskii <eliz@gnu.org>
4634
04c70788 4635 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
4636 use EDOM.
4637
fbcaa2f3
EZ
46382011-09-28 Eli Zaretskii <eliz@gnu.org>
4639
4640 * xdisp.c (compute_display_string_end): If there's no display
4641 string at CHARPOS, return -1.
4642
4643 * bidi.c (bidi_fetch_char): When compute_display_string_end
4644 returns a negative value, treat the character as a normal
4645 character not covered by a display string. (Bug#9624)
4646
a239d4e9
JB
46472011-09-28 Juanma Barranquero <lekktu@gmail.com>
4648
4649 * lread.c (Fread_from_string): Fix typo in docstring.
4650
88652fd5
EZ
46512011-09-27 Eli Zaretskii <eliz@gnu.org>
4652
4653 * xdisp.c (handle_invisible_prop): If invisible text ends on a
4654 newline, reseat the iterator instead of bidi-iterating there one
4655 character at a time. (Bug#9610)
32c1fffd
SM
4656 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
4657 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 4658
ed497dd4
AS
46592011-09-27 Andreas Schwab <schwab@linux-m68k.org>
4660
4661 * lread.c (readevalloop): Use correct code for NBSP.
4662 (read1): Likewise. (Bug#9608)
4663
b2bf61aa
MA
46642011-09-25 Michael Albinus <michael.albinus@gmx.de>
4665
4666 * dbusbind.c (Fdbus_register_signal): When service is not
4667 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
4668
32bbb17c
GM
46692011-09-25 Glenn Morris <rgm@gnu.org>
4670
4671 * buffer.c (truncate-lines): Doc fix.
4672
94e0933e
CY
46732011-09-24 Chong Yidong <cyd@stupidchicken.com>
4674
4675 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
4676 (Fset_window_next_buffers): Doc fix.
4677
cddde921
GM
46782011-09-24 Glenn Morris <rgm@gnu.org>
4679
4680 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
4681
1260aef1
PE
46822011-09-24 Paul Eggert <eggert@cs.ucla.edu>
4683
25b4bfa0
PE
4684 Fix minor problems found by static checking.
4685 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
4686 * indent.c (Fvertical_motion): Fix == vs = typo.
4687
e3cbd34b
EZ
46882011-09-24 Eli Zaretskii <eliz@gnu.org>
4689
a66cfb1c
SM
4690 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
4691 Default value is now t. Doc fix.
6bf7006f 4692
e3cbd34b 4693 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 4694 logic when moving up, not only when moving down. Fix the
e3cbd34b 4695 confusing name and values of the it_overshoot_expected variable;
32c1fffd 4696 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
4697
4698 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
4699 CHARPOS is covered by a display string which includes newlines.
4700 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
4701 is covered by a display string with embedded newlines.
4702
a3de0cbd
MA
47032011-09-24 Michael Albinus <michael.albinus@gmx.de>
4704
4705 * dbusbind.c (Fdbus_register_signal): Add match rule to
4706 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
4707 (Fdbus_register_method, Vdbus_registered_objects_table):
4708 Fix docstring.
a3de0cbd 4709
b260039d
JM
47102011-09-24 Jim Meyering <meyering@redhat.com>
4711
32c1fffd 4712 do not ignore write error for any output size
b260039d
JM
4713 The previous change was incomplete.
4714 While it makes emacs --batch detect the vast majority of stdout
4715 write failures, errors were still ignored whenever the output size is
4716 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
4717 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
4718 && echo FAIL: ignored write error
4719 FAIL: ignored write error
4720 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
4721 && echo FAIL: ignored write error
4722 FAIL: ignored write error
4723 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
4724
8eca8a7c
AS
47252011-09-23 Andreas Schwab <schwab@linux-m68k.org>
4726
4727 * emacs.c (Fkill_emacs): In noninteractive mode exit
4728 non-successfully if a write error occurred on stdout. (Bug#9574)
4729
3341db62
EZ
47302011-09-21 Eli Zaretskii <eliz@gnu.org>
4731
4732 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
4733 the xassert test.
4734
4735 * dispextern.h (struct it): Update the comment documenting what
4736 can it->OBJECT be.
4737
8c203dbf
EZ
47382011-09-20 Eli Zaretskii <eliz@gnu.org>
4739
4740 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
4741 a display string, extend search for cursor position to end of row.
4742 (find_row_edges): If the row ends in a newline from a display
4743 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
4744 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
4745 (Fcurrent_bidi_paragraph_direction): Fix search for previous
4746 non-empty line. Fixes confusing cursor motion with arrow keys at
4747 the beginning of a line that starts with whitespace.
8c203dbf 4748
a4824228
LMI
47492011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
4750
4751 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
4752 (bug#9493).
4753
33ed493b
CY
47542011-09-18 Chong Yidong <cyd@stupidchicken.com>
4755
4756 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
4757 boolean (Bug#9154).
4758
56cd55c8
EZ
47592011-09-18 Eli Zaretskii <eliz@gnu.org>
4760
4761 * xdisp.c (display_line): Record maximum and minimum buffer
4762 positions even if no glyphs were produced (e.g., by a zero-width
4763 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
4764 buffer positions that will be removed from the glyph row because
4765 they don't fit.
c02dcedf
EZ
4766 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
4767 column is beyond frame width: don't subtract 1 "pixel" when
4768 computing width of the stretch.
3e62b7e0
EZ
4769 (reseat_at_next_visible_line_start): Undo the change made on
4770 2011-09-17 that saved paragraph information and restored it after
4771 the call to `reseat'. (Bug#9545)
56cd55c8 4772
5ed99d36 47732011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
4774
4775 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
4776 and turn window cursor on if cleared (Bug#9415).
4777
5ed99d36 47782011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
4779
4780 * search.c (boyer_moore): Take unibyte characters from pattern
4781 literally. (Bug#9458)
4782
9bade7b2
EZ
47832011-09-18 Eli Zaretskii <eliz@gnu.org>
4784
4785 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
4786
e5e9d610
PE
47872011-09-18 Paul Eggert <eggert@cs.ucla.edu>
4788
87e4427a
PE
4789 Fix minor problem found by static checking.
4790 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
4791 initialized, to pacify gcc -Wuninitialized.
4792
e5e9d610
PE
4793 * fileio.c: Report proper errno when syscall falls.
4794 (Finsert_file_contents): Save and restore errno,
4795 so that report_file_error outputs the correct diagnostic.
4796 (Fwrite_region) [CLASH_DETECTION]: Likewise.
4797
a1674f0b
EZ
47982011-09-18 Eli Zaretskii <eliz@gnu.org>
4799
4800 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
4801
fbfb6dd4
EZ
48022011-09-17 Eli Zaretskii <eliz@gnu.org>
4803
4804 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
4805 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
4806
bb187662
EZ
48072011-09-17 Eli Zaretskii <eliz@gnu.org>
4808
1137e8b8 4809 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 4810 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
4811
4812 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
4813 (bidi_find_paragraph_start): Search back for paragraph beginning
4814 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
4815 (bidi_move_to_visually_next): Only trigger paragraph-related
4816 computations when the last character is a newline or at EOB, not
4817 just any NEUTRAL_B. (Bug#9470)
4818
bb187662
EZ
4819 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
4820 truncated lines if point is covered by a display string. (Bug#9524)
4821
2e621251
PE
48222011-09-16 Paul Eggert <eggert@cs.ucla.edu>
4823
4824 * xselect.c: Relax test for outgoing X longs (Bug#9498).
4825 (cons_to_x_long): New function.
4826 (lisp_data_to_selection_data): Use it. Correct the test for
4827 short-versus-long data; it was negated. Break out of vector
4828 loop, for efficiency, when a long datum is discovered.
4829
91a15bc6
SM
48302011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
4831
4832 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
4833
b41c3a35
EZ
48342011-09-16 Eli Zaretskii <eliz@gnu.org>
4835
4836 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
4837 GCC PR/17406) by declaring this function with external scope.
4838
7812ba2d
PE
48392011-09-15 Paul Eggert <eggert@cs.ucla.edu>
4840
4841 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
4842 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
4843
cf7edc2a
AS
48442011-09-15 Andreas Schwab <schwab@linux-m68k.org>
4845
4846 * editfns.c (Fformat): Correctly handle text properties on "%%".
4847
bd01620e
EZ
48482011-09-15 Eli Zaretskii <eliz@gnu.org>
4849
4850 * xterm.c (x_draw_composite_glyph_string_foreground):
4851 * w32term.c (x_draw_composite_glyph_string_foreground):
4852 * term.c (encode_terminal_code):
4853 * composite.c (composition_update_it, get_composition_id):
4854 * xdisp.c (get_next_display_element)
4855 (fill_composite_glyph_string): Add comments about special meaning
4856 of TAB characters in a composition.
4857
a02719a3
PE
48582011-09-15 Paul Eggert <eggert@cs.ucla.edu>
4859
4860 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
4861 This occurs when processing a multibyte format.
4862 Problem reported by Wolfgang Jenker.
a02719a3 4863
72589a3c
JB
48642011-09-15 Johan Bockgård <bojohan@gnu.org>
4865
4866 * xdisp.c (try_cursor_movement): Only check for exact match if
4867 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
4868
1c14176c
PE
48692011-09-14 Paul Eggert <eggert@cs.ucla.edu>
4870
4871 Remove unused external symbols.
4872 * dispextern.h (calc_pixel_width_or_height): Remove decl.
4873 * xdisp.c (calc_pixel_width_or_height): Now static.
4874 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
4875 * indent.c (check_display_width):
4876 * w32term.c: Fix comment to match code.
4877 * xterm.c, xterm.h (x_catching_errors): Remove.
4878
d2eea5b5
PE
48792011-09-14 Paul Eggert <eggert@cs.ucla.edu>
4880
4881 * xselect.c: Use signed conversions more consistently (Bug#9498).
4882 (selection_data_to_lisp_data): Assume incoming selection data are
4883 signed integers, not unsigned. This is to be consistent with
4884 outgoing selection data, which was modified to use signed integers
4885 in as part of the fix to Bug#9196 in response to Jan D.'s comment
4886 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
4887 expects long, not unsigned long.
4888
46888499
EZ
48892011-09-14 Eli Zaretskii <eliz@gnu.org>
4890
4891 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
4892 computation of loop end. Reported by Johan Bockgård
4893 <bojohan@gnu.org>.
4894
ef8ef9fb
CY
48952011-09-13 Chong Yidong <cyd@stupidchicken.com>
4896
4897 * frame.c (Fother_visible_frames_p): Function deleted.
4898
fa819fed
EZ
48992011-09-12 Eli Zaretskii <eliz@gnu.org>
4900
4901 * indent.c (compute_motion): Process display vector front to back
4902 rather than the other way around. (Bug#2496)
4903
2ba8e008
SM
49042011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4905
4906 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
4907
20f53c69
CY
49082011-09-11 Chong Yidong <cyd@stupidchicken.com>
4909
4910 * minibuf.c (Fread_from_minibuffer): Doc fix.
4911
d562d7a4
EZ
49122011-09-11 Eli Zaretskii <eliz@gnu.org>
4913
4914 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
4915 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
4916
1c4d7f3d
LMI
49172011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
4918
4919 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
4920 value for non-existent files.
4921
b885bf36
EZ
49222011-09-11 Eli Zaretskii <eliz@gnu.org>
4923
4924 * fileio.c (Finsert_file_contents): If the file cannot be opened,
4925 set its "size" to -1. This will set the modtime_size field of
4926 the corresponding buffer to -1, which is what
4927 verify-visited-file-modtime expects for files that do not exist.
4928 (Bug#9139)
4929
6612f0bf
PE
49302011-09-11 Paul Eggert <eggert@cs.ucla.edu>
4931
4932 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
4933 here ...
4934 * lisp.h: ... from here. push_key_description is no longer
4935 defined in keyboard.c, so its declaration should not be in
4936 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
4937 logically belongs with push_key_description.
4938
dfb3f755
PE
49392011-09-10 Paul Eggert <eggert@cs.ucla.edu>
4940
4941 * buffer.h: Include <sys/types.h> instead of <time.h>.
4942 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
4943 Problem reported by Herbert J. Skuhra.
4944
3134906c
LMI
49452011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
4946
4947 * xml.c (parse_region): Make the parsing work for
4948 non-comment-starting XML files again (bug#9144).
4949
8d903f4e
AS
49502011-09-10 Andreas Schwab <schwab@linux-m68k.org>
4951
4952 * image.c (gif_load): Fix calculation of bottom and right corner.
4953 (Bug#9468)
4954
80ad64f4
EZ
49552011-09-10 Eli Zaretskii <eliz@gnu.org>
4956
4957 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
4958 redisplay in small windows.
4959
208a048d
EZ
49602011-09-09 Eli Zaretskii <eliz@gnu.org>
4961
4962 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
4963
9b1c252e
MR
49642011-09-08 Martin Rudalics <rudalics@gmx.at>
4965
4966 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
4967 Operate on live windows only.
4968
2949f33b
JB
49692011-09-08 Juanma Barranquero <lekktu@gmail.com>
4970
4971 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
4972
e08dcafd
EZ
49732011-09-07 Eli Zaretskii <eliz@gnu.org>
4974
4975 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
4976 only under bidi iteration.
4977
115b96bd
JD
49782011-09-07 Jan Djärv <jan.h.d@swipnet.se>
4979
4980 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
4981
c8199d0f
PE
49822011-09-06 Paul Eggert <eggert@cs.ucla.edu>
4983
4984 isnan: Fix porting problem to Solaris 10 with bundled gcc.
4985 Without this fix, the command to link temacs failed due to an
4986 undefined symbol __builtin_isnan. This is because
4987 /usr/include/iso/math_c99.h #defines isnan(x) to
4988 __builtin_isnan(x), but the bundled gcc, which identifies itself
4989 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
4990 a __builtin_isnan.
4991 * floatfns.c (isnan): #undef, and then #define to a clone of
4992 what's in data.c.
4993 (Fisnan): Always define, since it's always available now.
4994 (syms_of_floatfns): Always define isnan at the Lisp level.
4995
e39b275c 49962011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
4997
4998 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
4999
b2db44d9 50002011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 5001
f4af5137 5002 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
5003 The previous code assumed that file offsets (off_t values) fit in
5004 EMACS_INT variables, which is not true on typical 32-bit hosts.
5005 The code messed up by falsely reporting buffer overflow in cases
5006 such as (insert-file-contents "big" nil 1 2) into an empty buffer
5007 when "big" contains more than 2**29 bytes, even though this
5008 inserts just one byte and does not overflow the buffer.
5009 (Finsert_file_contents): Store file offsets as off_t
5010 values, not as EMACS_INT values. Check for overflow when
5011 converting between EMACS_INT and off_t. When checking for
5012 buffer overflow or for overlap, take the offsets into account.
5013 Don't use EMACS_INT for small values where int suffices.
5014 When checking for overlap, fix a typo: ZV was used where
5015 ZV_BYTE was intended.
5016 (Fwrite_region): Don't assume off_t fits into 'long'.
5017 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
5018
ecfc0a49
MA
50192011-09-05 Michael Albinus <michael.albinus@gmx.de>
5020
5021 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
5022
6511acf2 50232011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 5024
0999621a 5025 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
5026
5027 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 5028 (esprintf, exprintf, evxprintf): New functions.
62f19c19 5029 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 5030 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
5031 (modify_event_symbol): Do not assume that the length of
5032 name_alist_or_stem is safe to alloca and fits in int.
5033 (Fexecute_extended_command): Likewise for function name and binding.
5034 (Frecursion_depth): Wrap around reliably on integer overflow.
5035 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
5036 since some callers pass EMACS_INT values.
5037 (Fsingle_key_description): Don't crash if symbol name contains more
5038 than MAX_ALLOCA bytes.
5039 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
5040 (get_minibuffer): Arg is now EMACS_INT, not int.
5041 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 5042 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
5043 * window.h (command_loop_level, minibuf_level): Reflect API changes.
5044
2be7d702
PE
5045 * dbusbind.c (signature_cat): New function.
5046 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
5047 Do not overrun buffer; instead, report string overflow.
5048
9d1df220
PE
5049 * dispnew.c (add_window_display_history): Don't overrun buffer.
5050 Truncate instead; this is OK since it's just a log.
5051
33ef5c64
PE
5052 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
5053 even if the time zone offset is outlandishly large.
5054 Don't mishandle offset == INT_MIN.
5055
66c6fdd5
PE
5056 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
5057 when creating daemon; the previous buffer-overflow check was incorrect.
5058
d749b01b
PE
5059 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
5060 which has the guts of the old verror function.
5061
b5cd1905
PE
5062 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
5063 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
5064
6e1a67fb
PE
5065 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
5066 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 5067 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 5068 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
5069 length of string rather than counting it via multiple sprintfs;
5070 that's simpler and more reliable.
c21721cc
PE
5071 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
5072 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
5073 sprintf, in case result does not fit in int.
5074
c57b67fc
PE
5075 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
5076 (fontset_from_font): Print it.
5077
8a401434
PE
5078 * frame.c (tty_frame_count): Now printmax_t, not int.
5079 (make_terminal_frame, set_term_frame_name): Print it.
5080 (x_report_frame_params): In X, window IDs are unsigned long,
5081 not signed long, so print them as unsigned.
5082 (validate_x_resource_name): Check for implausibly long names,
5083 and don't assume name length fits in 'int'.
5084 (x_get_resource_string): Don't blindly alloca invocation name;
5085 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
5086 not fit in int.
5087
6e1a67fb
PE
5088 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
5089 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
5090 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
5091
0df02bf3
PE
5092 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
5093 Use esprintf, not sprintf, in case result does not fit in int.
5094
48e30793
PE
5095 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5096 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
5097 it as a large positive number.
5098 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
5099 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
5100
a66ff6d8
PE
5101 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
5102 in case result does not fit in int.
5103
aca216ff
PE
5104 * print.c (float_to_string): Detect width overflow more reliably.
5105 (print_object): Make sprintf buffer a bit bigger, to avoid potential
5106 buffer overrun. Don't assume list length fits in 'int'. Treat
5107 print length of 0 as 0, not as infinity; to be consistent with other
5108 uses of print length in this function. Don't overflow print length
5109 index. Don't assume hash table size fits in 'long', or that
5110 vectorlike size fits in 'unsigned long'.
5111
31c286f7
PE
5112 * process.c (make_process): Use printmax_t, not int, to format
5113 process-name gensyms.
5114
55e5faa1
PE
5115 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
5116
80f2e268
PE
5117 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
5118 to avoid potential buffer overrun.
5119
670741ab
PE
5120 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
5121 if X resource line is longer than 512 bytes.
5122
b7163a50
PE
5123 * xfns.c (x_window): Make sprintf buffer a bit bigger
5124 to avoid potential buffer overrun.
5125
ae58ff1f
PE
5126 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
5127
c43c8a6a
PE
5128 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
5129
3f8236f4
PE
51302011-09-04 Paul Eggert <eggert@cs.ucla.edu>
5131
53e9fe90 5132 Integer overflow fixes for scrolling, etc.
6511acf2
PE
5133 Without these, Emacs silently mishandles large integers sometimes.
5134 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
5135 it were "C-u 1 M-x recenter" on a typical 64-bit host.
5136
6511acf2
PE
5137 * xdisp.c (try_window_id): Check Emacs fixnum range before
5138 converting to 'int'.
806add1d 5139
6511acf2 5140 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
5141 Check that an Emacs fixnum is in range before assigning it to 'int'.
5142 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
5143 values converted from Emacs fixnums.
5144 (Frecenter): Don't wrap around a line count if it is out of 'int'
5145 range; instead, treat it as an extreme value.
5146 (Fset_window_configuration, compare_window_configurations):
5147 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
5148
6511acf2
PE
5149 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
5150 that can exceed INT_MAX. Check that EMACS_INT value is in range
5151 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
5152 (match_limit): Don't assume that a fixnum can fit in 'int'.
5153
6511acf2 5154 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
5155 exceed INT_MAX.
5156
6511acf2 5157 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
5158 (Fvertical_motion): Don't wrap around LINES values that don't fit
5159 in 'int'. Instead, treat them as extreme values. This is good
5160 enough for windows, which can't have more than INT_MAX lines anyway.
5161
fcb901a7
LMI
51622011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
5163
0f2f6b6d
LMI
5164 * Require libxml/parser.h to avoid compilation warning.
5165
fcb901a7
LMI
5166 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
5167
5168 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
5169 since this reportedly can destroy thread storage.
5170
6e20a0d4
CY
51712011-08-30 Chong Yidong <cyd@stupidchicken.com>
5172
5173 * syntax.c (find_defun_start): Update all cache variables if
5174 exiting early (Bug#9401).
5175
148ae00e
EZ
51762011-08-30 Eli Zaretskii <eliz@gnu.org>
5177
f6cfbd8f
EZ
5178 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
5179
148ae00e
EZ
5180 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
5181 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
5182 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
5183
5184 * term.c (tty_append_glyph): New function.
5185 (produce_stretch_glyph): Static function and its prototype deleted.
5186
a66cfb1c
SM
5187 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
5188 Add prototypes.
148ae00e 5189
c4a07a4c
PE
51902011-08-29 Paul Eggert <eggert@cs.ucla.edu>
5191
5192 * image.c (parse_image_spec): Check for nonnegative, not for positive,
5193 when checking :margin (Bug#9390).
5194 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 5195 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
5196 so that the name doesn't mislead. All uses changed.
5197
6bc8cd65
JB
51982011-08-28 Johan Bockgård <bojohan@gnu.org>
5199
5200 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
5201 set_tty_hooks.
5202
dca4927e
EZ
52032011-08-27 Eli Zaretskii <eliz@gnu.org>
5204
5205 * xdisp.c (move_it_to): Don't bail out early when reaching
5206 position beyond to_charpos, if we are scanning backwards.
5207 (move_it_vertically_backward): When DY == 0, make sure we get to
5208 the first character in the line after the newline.
5209
f2cad773
PE
52102011-08-27 Paul Eggert <eggert@cs.ucla.edu>
5211
5212 * ccl.c: Improve and simplify overflow checking (Bug#9196).
5213 (ccl_driver): Do not generate an out-of-range pointer.
5214 (Fccl_execute_on_string): Remove unnecessary check for
5215 integer overflow, noted by Stefan Monnier in
5216 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
5217 Remove a FIXME that didn't need fixing.
5218 Simplify the newly-introduced buffer reallocation code.
5219
0cae2cdb
JB
52202011-08-27 Juanma Barranquero <lekktu@gmail.com>
5221
5222 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
5223
5fc295a4 52242011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 5225
70c60eb2 5226 Integer and memory overflow issues (Bug#9196).
726e0ab1 5227
d31850da
PE
5228 * doc.c (get_doc_string): Rework so that
5229 get_doc_string_buffer_size is the actual buffer size, rather than
5230 being 1 less than the actual buffer size; this makes xpalloc more
5231 convenient.
5232
a69fbedb
PE
5233 * image.c (x_allocate_bitmap_record, cache_image):
5234 * xselect.c (Fx_register_dnd_atom):
5235 Simplify previous changes by using xpalloc.
5236
fe5c5d37
PE
5237 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
5238 since either will do and ptrdiff_t is convenient with xpalloc.
5239
0065d054
PE
5240 * charset.c (charset_table_size)
5241 (struct charset_sort_data.priority): Now ptrdiff_t.
5242 (charset_compare): Don't overflow if priorities differ greatly.
5243 (Fsort_charsets): Don't assume list length fits in int.
5244 Check for size-calculation overflow when allocating sort data.
5245 (syms_of_charset): Allocate an initial charset table that is
5246 just under 64 KiB, to avoid problems with glibc malloc and mmap.
5247
5248 * cmds.c (internal_self_insert): Check for size-calculation overflow.
5249
5250 * composite.h (struct composition.glyph_len): Now int, not unsigned.
5251 The actual value is always <= INT_MAX, and leaving it unsigned made
5252 overflow checking harder.
5253
5254 * dispextern.h (struct glyph_matrix.rows_allocated)
5255 (struct face_cache.size): Now ptrdiff_t, for convenience in use
5256 with xpalloc. The values are still always <= INT_MAX.
5257
5258 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
5259
5260 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
5261 (SAFE_NALLOCA): New macro.
5262
5263 * region-cache.c (struct boundary.pos, find_cache_boundary)
5264 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
5265 (set_cache_region, invalidate_region_cache)
5266 (revalidate_region_cache, know_region_cache, region_cache_forward)
5267 (region_cache_backward, pp_cache):
5268 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
5269 so that ptrdiff_t * can be passed to xpalloc.
5270 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
5271 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
5272 (pp_cache): Don't assume cache_len fits in int.
5273 * region-cache.h: Adjust extern decls to match.
5274
5275 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
5276 EMACS_INT, since either will do, for xpalloc.
5277
5278 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
5279 (xnmalloc, xnrealloc, xpalloc): New functions.
5280
726e0ab1
PE
5281 * bidi.c (bidi_shelve_header_size): New constant.
5282 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
5283 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
5284
51f30bc5 5285 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
5286 * buffer.c (overlays_at, overlays_in, record_overlay_string)
5287 (overlay_strings):
5288 Don't update size of array until after memory allocation succeeds,
5289 because xmalloc/xrealloc may not return.
0065d054
PE
5290 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
5291 now that we have proper integer overflow checking.
5292 (record_overlay_string, overlay_strings): Catch overflows when
5293 calculating size of overlay_str_buf.
726e0ab1 5294
0065d054
PE
5295 * callproc.c (Fcall_process): Check for size overflow when
5296 calculating size of args2.
5297 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
5298 Normally we prefer signed values, but sticking with ptrdiff_t would
5299 require adding more-complicated checks.
726e0ab1
PE
5300
5301 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
5302 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
5303 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 5304 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
5305
5306 * character.c (Fstring): Check for size-calculation overflow.
5307
5308 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
5309 unnecessary integer overflow. Check for size overflow.
5310 (encode_coding_object): Don't update size until xmalloc succeeds.
5311
5312 * composite.c (get_composition_id): Check for overflow in glyph
5313 length calculations.
5314
5315 Integer and memory overflow fixes for display code.
5316 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
5317 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
5318 (scrolling_window): Check for overflow in size calculations.
5319 (line_draw_cost, realloc_glyph_pool, add_row_entry):
5320 Don't assume glyph table len fits in int.
5321 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
5322 (row_table_size): Now ptrdiff_t, not int.
5323 (scrolling_window): Avoid overflow in size calculations.
5324 Don't update size until allocation succeeds.
5325 * fns.c (concat): Check for overflow in size calculations.
5326 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
5327 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5328 (NEXT_ALMOST_PRIME_LIMIT): New constant.
5329
5330 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
5331 (get_doc_string): Check for size calculation overflow.
5332 Don't update size until allocation succeeds.
5333 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
5334 EMACS_INT, where ptrdiff_t will do.
5335 (Fsubstitute_command_keys): Check for string overflow.
5336
5337 * editfns.c (set_time_zone_rule): Don't assume environment length
5338 fits in int.
5339 (message_length): Now ptrdiff_t, not int.
5340 (Fmessage_box): Don't update size until allocation succeeds.
5341 Don't assume message length fits in int.
5342 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
5343
0065d054
PE
5344 * emacs.c (main): Do not reallocate argv, since there is a null at
5345 the end that can be overwritten, and this way there's no need to
5346 worry about size-calculation overflow.
5347 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
5348
5349 * eval.c (init_eval_once, grow_specpdl): Don't update size until
5350 alloc succeeds.
5351 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
5352
5353 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
5354 (x_set_scroll_bar_width, x_figure_window_size):
5355 Check for integer overflow.
5356 (x_set_alpha): Do not assume XINT fits in int.
5357
5358 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
5359 This is for the members text_lines, text_cols, total_lines, total_cols,
5360 where the system imposes an 'int' limit.
5361
5362 * fringe.c (Fdefine_fringe_bitmap):
5363 Don't update size until alloc works.
5364
5365 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
5366 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
5367
5368 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
5369 Check for size-calculation overflow.
5370 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
5371 do, as we prefer signed integers.
5372 (id_to_widget.max_size, id_to_widget.used)
5373 (xg_store_widget_in_map, xg_remove_widget_from_map)
5374 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
5375 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
5376 Use and return ptrdiff_t, not int.
5377 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
5378 * gtkutil.h: Change prototypes to match the above.
5379
5380 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
5381 are duplicate now that they've been promoted to lisp.h.
5382 (x_allocate_bitmap_record, x_alloc_image_color)
5383 (make_image_cache, cache_image, xpm_load):
5384 Don't update size until alloc is done.
5385 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
5386 (x_detect_edges):
3256efce 5387 Check for size calculation overflow.
726e0ab1
PE
5388 (ct_colors_allocated_max): New constant.
5389 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
5390 overflow.
3256efce 5391
726e0ab1
PE
5392 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
5393 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
5394 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
5395 Use ptrdiff_t, not int, to count maps.
5396 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
5397 calculations. Don't update size until allocation succeeds.
5398 Redo calculations to avoid overflow.
726e0ab1
PE
5399 * keyboard.h: Change prototypes to match the above.
5400
5401 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
5402 to count maps.
5403 (current_minor_maps): Check for size calculation overflow.
5404 * keymap.h: Change prototypes to match the above.
5405
5406 * lread.c (read1, init_obarray): Don't update size until alloc done.
5407
5408 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
5409 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
5410
726e0ab1
PE
5411 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
5412 Now ptrdiff_t, not int.
5413 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
5414 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
5415
5416 * process.c (Fnetwork_interface_list): Check for overflow
5417 in size calculation.
5418
5419 * region-cache.c (move_cache_gap): Check for size calculation overflow.
5420
5421 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
5422 overflow. Don't bother calling xmalloc when xrealloc will do.
5423
5424 * search.c (Freplace_match): Check for size calculation overflow.
5425 (Fset_match_data): Don't assume list lengths fit in 'int'.
5426
5427 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
5428 for command line length. Do not attempt to address one before the
5429 beginning of an array, as that's not portable.
5430
5431 * term.c (max_frame_lines): Remove; unused.
5432 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
5433 not int.
5434 (encode_terminal_code, calculate_costs): Check for size
5435 calculation overflow.
5436 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
5437 table lengths and related sizes. Don't update size until alloc
5438 done. Redo calculations to avoid overflow.
5439 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
5440
5441 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
5442 subtracting pointers.
5443 (gobble_line): Check for overflow more carefully. Don't update size
5444 until alloc done.
5445
5446 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
5447 Don't update size until alloc done.
5448 Redo size calculations to avoid overflow.
5449 Check for size calculation overflow.
0065d054 5450 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
5451
5452 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
5453 Use ptrdiff_t, not int, for sizes.
5454 (store_mode_line_noprop_char): Don't update size until alloc done.
5455
0065d054
PE
5456 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
5457 Use ptrdiff_t, not int, for sizes.
5458 (Finternal_make_lisp_face, cache_face):
5459 Check for size calculation overflow.
5460 (cache_face): Treat size calculation overflows as if they were
5461 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
5462
5463 * xfns.c (x_encode_text, x_set_name_internal)
5464 (Fx_change_window_property): Use ptrdiff_t, not int, to count
5465 sizes, since they can exceed INT_MAX in size. Check for size
5466 calculation overflow.
5467
0065d054
PE
5468 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
5469 (xg_select): Check for size calculation overflow.
726e0ab1
PE
5470 Don't update size until alloc done.
5471
0065d054 5472 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 5473 as sprintf is limited to int lengths.
1d526e2f 5474
252c5ee1
PE
5475 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
5476 (X_LONG_MIN): New macros.
864d7ce7
PE
5477 Use them to make the following changes clearer.
5478 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
5479 This change doesn't affect the value now, but it may help remind
5480 future maintainers not to raise the value too much later.
5481 (SELECTION_QUANTUM): Remove, replacing with ...
5482 (selection_quantum): ... new function, which avoids overflow.
5483 All uses changed.
5484 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
5485 assumption that selection length fits in 'int'.
5486 (x_reply_selection_request, x_handle_selection_request)
5487 (x_get_window_property, receive_incremental_selection)
5488 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
5489 (lisp_data_to_selection_data, clean_local_selection_data):
5490 Use ptrdiff_t, not int, to record length of selection.
5491 (x_reply_selection_request, x_get_window_property)
5492 (receive_incremental_selection, x_property_data_to_lisp):
5493 Redo calculations to avoid overflow.
5494 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 5495 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
5496 something.
5497 (x_get_window_property, receive_incremental_selection)
5498 (lisp_data_to_selection_data, x_property_data_to_lisp):
5499 Check for size-calculation overflow.
5500 (x_get_window_property, receive_incremental_selection)
5501 (lisp_data_to_selection_data, Fx_register_dnd_atom):
5502 Don't store size until memory allocation succeeds.
5503 (x_get_window_property): Plug memory leak on memory exhaustion.
5504 Don't double-block input; malloc is safe here. Don't assume 2**34
5505 - 4 fits in unsigned long. Add an xassert to check
5506 XGetWindowProperty overflow. Be more careful about overflow
5507 calculations, and distinguish size from memory overflow better.
5508 (receive_incremental_selection): When tracing, don't assume
5509 unsigned int is less than INT_MAX.
5510 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
5511 harmful) conversions of unsigned short to int.
5512 (lisp_data_to_selection_data): Don't assume that integers
5513 in the range -65535 through -1 fit in an X unsigned short.
5514 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
5515 result parameters unless successful. Rely on cons_to_unsigned
5516 to report problems with elements; the old code wasn't right anyway.
5517 (x_check_property_data): Check for int overflow; we cannot use
5518 a wider type due to X limits.
5519 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
5520
726e0ab1 5521 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 5522
0065d054
PE
5523 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
5524 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
5525 (x_color_cells): Don't store size until memory allocation succeeds.
5526 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 5527 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
5528 (x_term_init): Don't assume length fits in int (sprintf is limited
5529 to int size).
bc18e09d 5530
ebfa62c0
PE
5531 Use ptrdiff_t for composition IDs.
5532 * character.c (lisp_string_width):
5533 * composite.c (composition_table_size, n_compositions)
5534 (get_composition_id, composition_gstring_from_id):
5535 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
5536 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
5537 * window.c (Frecenter):
5538 Use ptrdiff_t, not int, for composition IDs.
5539 * composite.c (get_composition_id): Check for integer overflow.
5540 * composite.h: Adjust prototypes to match the above changes.
5541
d3411f89
PE
5542 Use ptrdiff_t for hash table indexes.
5543 * category.c (hash_get_category_set):
5544 * ccl.c (ccl_driver):
5545 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
5546 * coding.c (coding_system_charset_list, detect_coding_system):
5547 * coding.h (struct coding_system.id):
5548 * composite.c (get_composition_id, gstring_lookup_cache):
5549 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
5550 * image.c (xpm_get_color_table_h):
5551 * lisp.h (hash_lookup, hash_put):
5552 * minibuf.c (Ftest_completion):
5553 Use ptrdiff_t for hash table indexes, not int (which is too
5554 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
5555 32-bit --with-wide-int hosts).
5556
e097a6fa
PE
5557 * charset.c (Fdefine_charset_internal): Check for integer overflow.
5558 Add a FIXME comment about memory leaks.
5559 (syms_of_charset): Don't assume xmalloc returns.
5560
5637687f
PE
5561 Don't assume that stated character widths fit in int.
5562 * character.c (Fchar_width, c_string_width, lisp_string_width):
5563 * character.h (CHAR_WIDTH):
5564 * indent.c (MULTIBYTE_BYTES_WIDTH):
5565 Use sanitize_char_width to avoid undefined and/or bad behavior
5566 with outlandish widths.
a66cfb1c 5567 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
5568 now that we have two such functions. All uses changed.
5569 (sanitize_char_width): New inline function.
5570
a2271ba2
PE
5571 Don't assume that tab-width fits in int.
5572 * character.h (sanitize_width): New inline function.
5573 (SANE_TAB_WIDTH): New macro.
5574 (ASCII_CHAR_WIDTH): Use it.
5575 * indent.c (sane_tab_width): Remove. All uses replaced by
5576 SANE_TAB_WIDTH (current_buffer).
5577 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
5578
18c52557
PE
5579 * fileio.c: Integer overflow issues with file modes.
5580 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
5581
caeeedc1
PE
5582 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
5583 Remove unreachable code.
5584 (read_hex, load_charset_map_from_file): Check for integer overflow.
5585
6df6ae42 5586 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
5587 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
5588 (x_send_scroll_bar_event): Likewise. Check that the size does not
5589 exceed limits imposed by XClientMessageEvent, as well as the usual
5590 ptrdiff_t and size_t limits.
5591
b13995db
PE
5592 * keyboard.c: Overflow, signedness and related fixes.
5593 (make_lispy_movement): Use same integer type in forward decl
5594 that is used in the definition.
5595 (read_key_sequence, keyremap_step):
5596 Change bufsize argument back to int, undoing my 2011-03-30 change.
5597 We prefer signed types, and int is wide enough here.
5598 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
5599 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
5600 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
5601 length, not size_t. Use ptrdiff_t for index, not int.
5602 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
5603 possibility of integer overflow.
5604
13464394
PE
5605 Overflow, signedness and related fixes for images.
5606
5607 * dispextern.h (struct it.stack[0].u.image.image_id)
5608 (struct_it.image_id, struct image.id, struct image_cache.size)
5609 (struct image_cache.used, struct image_cache.ref_count):
5610 * gtkutil.c (update_frame_tool_bar):
5611 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
5612 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
5613 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
5614 * nsmenu.m (update_frame_tool_bar):
5615 * xdisp.c (calc_pixel_width_or_height):
5616 * xfns.c (image_cache_refcount):
5617 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
5618 on typical 64-bit hosts.
5619
5620 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5621 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
5622 Omit unnecessary casts to int.
5623 (parse_image_spec): Check that integers fall into 'int' range
5624 when the callers expect that.
5625 (image_ascent): Redo ascent calculation to avoid int overflow.
5626 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
5627 (lookup_image): Remove unnecessary tests.
5628 (xbm_image_p): Locals are now of int, not EMACS_INT,
5629 since parse_image_check makes sure they fit into int.
5630 (png_load, gif_load, svg_load_image):
5631 Prefer int to unsigned where either will do.
5632 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
5633 old tiff_error_handler and tiff_warning_handler.
5634 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
5635 stack buffer overflows. It uses only the features of vsnprintf
5636 that are common to both POSIX and native Microsoft.
5637 (tiff_error_handler, tiff_warning_handler): Use it.
5638 (tiff_load, gif_load, imagemagick_load_image):
5639 Don't assume :index value fits in 'int'.
5640 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
5641 (imagemagick_load_image): Check that crop parameters fit into
5642 the integer types that MagickCropImage accepts. Don't assume
5643 Vimagemagick_render_type has a nonnegative value. Don't assume
5644 size_t fits in 'long'.
5645 (gs_load): Use printmax_t to print the widest integers possible.
5646 Check for integer overflow when computing image height and width.
5647
c11821d4
EZ
56482011-08-26 Eli Zaretskii <eliz@gnu.org>
5649
5650 * xdisp.c (redisplay_window): Don't force window start if point
5651 will be invisible in the resulting window. (Bug#9324)
5652
0c95fcf7
EZ
56532011-08-25 Eli Zaretskii <eliz@gnu.org>
5654
5655 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
5656 the display spec is of the form `(space ...)'.
5657 (handle_display_spec): Return the value returned by
5658 handle_single_display_spec, not just 1 or zero.
5659 (handle_single_display_spec): If the display spec is of the form
5660 `(space ...)', and specifies display in the text area, return 2
5661 rather than 1.
fee65a97 5662 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
5663 accurately, and prefer exact match for point under bidi.
5664 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
5665
5666 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
5667 into disp_prop; all users changed.
5668
5669 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
5670 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
5671 for the text covered by the display property.
5672
e4ed06f1
CY
56732011-08-25 Chong Yidong <cyd@stupidchicken.com>
5674
5675 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
5676 Change return value to nil.
5677 (Frecord_buffer): Delete unused function.
5678
f67cdd7f
EZ
56792011-08-24 Eli Zaretskii <eliz@gnu.org>
5680
5980d4c6
EZ
5681 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
5682 buffers, return left-to-right.
8610fe8b
EZ
5683 (set_cursor_from_row): Consider candidate row a win if its glyph
5684 represents a newline and point is on that newline. Fixes cursor
5685 positioning on the newline at EOL of R2L text within L2R
5686 paragraph, and vice versa.
5687 (try_cursor_movement): Check continued rows, in addition to
5688 continuation rows. Fixes unwarranted scroll when point enters a
5689 continued line of R2L text within an L2R paragraph, or vice versa.
5690 (cursor_row_p): Consider the case of point being equal to
5691 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
5692 from the end of a short line to the beginning of a continued line
5693 of R2L text within L2R paragraph.
5694 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
5695 composed characters.
5980d4c6 5696
f67cdd7f
EZ
5697 * bidi.c (bidi_check_type): Use xassert.
5698 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
5699 members.
5700
bca633fb
EZ
57012011-08-23 Eli Zaretskii <eliz@gnu.org>
5702
5703 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
5704 a character.
5705
4a5885a7
CY
57062011-08-23 Chong Yidong <cyd@stupidchicken.com>
5707
5708 * nsfont.m (ns_otf_to_script): Fix typo.
5709
0902a04e
KH
57102011-08-22 Kenichi Handa <handa@m17n.org>
5711
5712 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
5713 extra slot even if the purpose is char-code-property-table.
5714
1a2e6670
EZ
57152011-08-23 Eli Zaretskii <eliz@gnu.org>
5716
8ddde651
EZ
5717 * xdisp.c (redisplay_window): When computing centering_position,
5718 account for the height of the header line. (Bug#8874)
5719
425cc014
EZ
5720 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
5721 instead of CHAR_TO_BYTE. Fixes a crash when a completion
5722 candidate is selected by the mouse, and that candidate has a
5723 composed character under the mouse.
5724
1a2e6670
EZ
5725 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
5726 coordinates reported by pos-visible-in-window-p for a composed
5727 character in column zero.
5728
8b76d6f8
SM
57292011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
5730
5731 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
5732
dac347dd
EZ
57332011-08-22 Eli Zaretskii <eliz@gnu.org>
5734
5735 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
5736 consider it a hit if to_charpos is anywhere in the range of the
5737 composed buffer positions.
5738
e013fb34
CY
57392011-08-22 Chong Yidong <cyd@stupidchicken.com>
5740
5741 * image.c (gif_load): Don't assume that each subimage has the same
5742 dimensions as the base image. Handle disposal method that is
5743 "undefined" by the gif spec (Bug#9335).
5744
bd1ba3e8
CY
57452011-08-20 Chong Yidong <cyd@stupidchicken.com>
5746
5747 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 5748 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 5749
54a1215b
EZ
57502011-08-19 Eli Zaretskii <eliz@gnu.org>
5751
823564e5
EZ
5752 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
5753 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
5754 from an Org mode buffer to a Speedbar frame.
5755
54a1215b
EZ
5756 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
5757 a composition, take its buffer position from IT->cmp_it.charpos.
5758 Fixes cursor positioning at the beginning of a line that begins
5759 with a composed character.
5760
9778ebcc
EZ
57612011-08-18 Eli Zaretskii <eliz@gnu.org>
5762
0be6ee06
EZ
5763 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
5764 character bidirectional type, use STRONG_L instead. Fixes crashes
5765 in a buffer produced by `describe-categories'.
5766
9778ebcc
EZ
5767 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
5768 members before the level stack, so they would be saved and
5769 restored when copying iterator state. Fixes incorrect reordering
5770 around TABs covered by display properties.
5771
156bffbe
AS
57722011-08-18 Andreas Schwab <schwab@linux-m68k.org>
5773
6b02f655 5774 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 5775
72ad093b
CY
57762011-08-17 Chong Yidong <cyd@stupidchicken.com>
5777
5778 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
5779 (internal_condition_case_2, internal_condition_case_n):
5780 Remove unnecessary aborts (Bug#9081).
72ad093b 5781
35774242
EZ
57822011-08-17 Eli Zaretskii <eliz@gnu.org>
5783
5784 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
5785 has no `load' handler, try opening the file locally. (Bug#9311)
5786
db76dd85
KB
57872011-08-16 Ken Brown <kbrown@cornell.edu>
5788
5789 * gmalloc.c: Expand comment.
5790
b215eee5
EZ
57912011-08-16 Eli Zaretskii <eliz@gnu.org>
5792
5793 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
5794 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
5795
a4579d33
KB
57962011-08-16 Ken Brown <kbrown@cornell.edu>
5797
5798 Fix memory allocation problems in Cygwin build (Bug#9273).
5799
5800 * unexcw.c ( __malloc_initialized): Declare external variable.
5801 (fixup_executable): Force the dumped emacs to reinitialize malloc.
5802
8b76d6f8
SM
5803 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
5804 New variables.
a4579d33
KB
5805 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
5806 dumped emacs.
5807 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
5808 in the static heap.
5809 [CYGWIN] (special_realloc): New function.
5810 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
5811 requests to realloc storage in the static heap.
5812
3ebec551
PE
58132011-08-15 Paul Eggert <eggert@cs.ucla.edu>
5814
5815 * bidi.c (bidi_initialize): Remove unused local.
5816
9fd8be00
EZ
58172011-08-15 Eli Zaretskii <eliz@gnu.org>
5818
6b02f655
SM
5819 * bidimirror.h:
5820 * biditype.h: Remove file.
5821 * makefile.w32-in ($(BLD)/bidi.$(O)):
5822 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
5823
5824 * dispextern.h: Fix a typo in the comment to bidi_type_t.
5825
5826 * chartab.c: Improve commentary for the uniprop_table API.
5827
32413314
EZ
5828 * bidi.c (bidi_paragraph_init): Support zero value of
5829 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
5830 (bidi_initialize): Use uniprop_table instead of including
5831 biditype.h and bidimirror.h.
32413314 5832
9fd8be00
EZ
5833 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
5834 coordinates of the iterator when restoring from ppos_it.
5835 (Bug#9296)
5836
5cf2b69b
KH
58372011-08-14 Kenichi Handa <handa@m17n.org>
5838
5839 * process.c (create_process): Call setup_process_coding_systems
72ad093b 5840 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 5841
daf17d00
EZ
58422011-08-14 Eli Zaretskii <eliz@gnu.org>
5843
5844 * xdisp.c (move_it_in_display_line_to): Don't invoke
5845 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
5846 ppos_it. Fixes vertical cursor motion when line beginning is
5847 covered by an image. (Bug#9296)
5848
08e3161a
JD
58492011-08-14 Jan Djärv <jan.h.d@swipnet.se>
5850
5851 * nsterm.h (ns_run_ascript): Declare.
5852 (NSAPP_DATA2_RUNASSCRIPT): Define.
5853
5854 * nsfns.m (as_script, as_result, as_status): New static variables.
5855 (ns_run_ascript): New function.
5e617bc2 5856 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
5857 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
5858 the event loop. Get status from as_status (Bug#7276).
5859
5860 * nsterm.m (sendEvent): If event is NSApplicationDefined and
5861 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
5862 the event loop (Bug#7276).
5863
a3720aa2
AS
58642011-08-14 Andreas Schwab <schwab@linux-m68k.org>
5865
5866 * gnutls.c (QCgnutls_bootprop_priority)
5867 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
5868 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
5869 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
5870 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
5871 (QCgnutls_bootprop_verify_hostname_error)
5872 (QCgnutls_bootprop_callbacks_verify): Rename from
5873 Qgnutls_bootprop_..., all uses changed.
5874
5875 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
5876 uses changed.
5877
0a0d27fb
PE
58782011-08-14 Paul Eggert <eggert@cs.ucla.edu>
5879
19d5c50c
PE
5880 * xfaces.c (Qframe_set_background_mode): Now static.
5881 * dispextern.h (Qframe_set_background_mode): Remove decl.
5882
0a0d27fb
PE
5883 * process.c (Fnetwork_interface_info): Declare local only if needed.
5884
377538cb
JD
58852011-08-13 Jan Djärv <jan.h.d@swipnet.se>
5886
5887 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
5888 (Fnetwork_interface_list): Allocate in increments of bytes instead
5889 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
5890 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
5891 sockaddr.
5892 (struct ifflag_def): notrailers is smart on OSX.
5893 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
5894 Get hardware address with getifaddrs if available.
5895
08fff70c
EZ
58962011-08-12 Eli Zaretskii <eliz@gnu.org>
5897
5898 * xdisp.c (iterate_out_of_display_property): xassert that
5899 IT->position is set to within IT->object's boundaries. Break from
5900 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
5901 when IT->position is set up wrongly due to some bug.
5902 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
5903 (push_display_prop): Allow GET_FROM_STRING as IT->method on
5904 entry. Force push_it to save on the stack the current
5905 buffer/string position, to be restored by pop_it. Fix flags in
5906 the iterator structure wrt the object coming from a display
5907 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
5908 properties. (Bug#9284)
5909
7be1c708 59102011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 5911
7be1c708
CY
5912 * fontset.c (fontset_get_font_group): Add proper type checks.
5913 (Bug#9172)
aac0c6e3 5914
7be1c708 59152011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 5916
7be1c708
CY
5917 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
5918 and LC_VERSION_MIN_MACOSX.
5919 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
5920 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 5921
97bb72a6
EZ
59222011-08-08 Eli Zaretskii <eliz@gnu.org>
5923
5924 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
5925 no-display-properties-and-no-overlays under bidi display.
5926 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 5927 properties and overlays.
97bb72a6 5928
d5617611
CY
59292011-08-08 Chong Yidong <cyd@stupidchicken.com>
5930
37e11a63
CY
5931 * editfns.c (Fset_time_zone_rule): Document relationship with the
5932 setenv function.
5933
d5617611
CY
5934 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
5935 the font entity extracted from the cache (Bug#8109).
5936
58872834
CY
59372011-08-07 Chong Yidong <cyd@stupidchicken.com>
5938
5939 * composite.c (autocmp_chars): Don't reset point. That is done by
5940 restore_point_unwind (Bug#5984).
5941
75bfc667
JL
59422011-08-07 Juri Linkov <juri@jurta.org>
5943
5944 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
5945 to show the arg `TIME' instead of `TIMEVAL'.
5946
d1410150
EZ
59472011-08-06 Eli Zaretskii <eliz@gnu.org>
5948
5949 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
5950 display property strides EOL and includes a newline, as in
5951 longlines-mode. (Bug#9254)
75b771e4
EZ
5952 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
5953 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
5954
5955 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
5956 is non-zero, even if the data buffer is NULL. Fixes a crash in
5957 vertical-motion with longlines-mode. (Bug#9254)
5958
35928349
EZ
59592011-08-05 Eli Zaretskii <eliz@gnu.org>
5960
ec7cc85b
EZ
5961 * bidi.c <bidi_cache_total_alloc>: Now static.
5962 (bidi_initialize): Initialize bidi_cache_total_alloc.
5963
8b76d6f8 5964 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
5965 cache. (Bug#9221)
5966
5967 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
5968 amount allocated this far in `bidi_cache_total_alloc'.
5969 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
5970 non-zero, only free the data buffer without restoring the cache
5971 contents. All callers changed.
5972
5973 * dispextern.h (bidi_unshelve_cache): Update prototype.
5974
5975 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
5976 (move_it_in_display_line, move_it_to)
5977 (move_it_vertically_backward, move_it_by_lines): Replace the call
5978 to xfree to an equivalent call to bidi_unshelve_cache.
5979 (move_it_in_display_line_to): Fix logic of returning
412b6358 5980 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 5981
e2e2423b
EZ
59822011-08-05 Eli Zaretskii <eliz@gnu.org>
5983
5984 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
5985 came from a string character with a `cursor' property. (Bug#9229)
5986
ae9e757a
JD
59872011-08-04 Jan Djärv <jan.h.d@swipnet.se>
5988
5989 * Makefile.in (LIB_PTHREAD): New variable.
5990 (LIBES): Add LIB_PTHREAD (Bug#9216).
5991
5992 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
5993 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
5994
213bd7f2
AS
59952011-08-04 Andreas Schwab <schwab@linux-m68k.org>
5996
6b02f655 5997 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 5998
99aaf75f
JD
59992011-08-04 Jan Djärv <jan.h.d@swipnet.se>
6000
6001 * xterm.c (x_find_topmost_parent): New function.
6002 (x_set_frame_alpha): Find topmost parent window with
6003 x_find_topmost_parent and set the property there also (bug#9181).
6004 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
6005
c74e9d86
PE
60062011-08-04 Paul Eggert <eggert@cs.ucla.edu>
6007
6008 * callproc.c (Fcall_process): Avoid vfork clobbering
6009 the local vars buffer, coding_systems, current_dir.
6010
640c8776
SM
60112011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
6012
6013 * keymap.c (Fmake_composed_keymap): Move to subr.el.
6014
f26d0e4c
PE
60152011-08-03 Paul Eggert <eggert@cs.ucla.edu>
6016
8a10d76c
PE
6017 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
6018 so that it is not optimized away.
6019
f26d0e4c
PE
6020 * xdisp.c (compute_display_string_pos): Remove unused local.
6021
55439c61
EZ
60222011-08-02 Eli Zaretskii <eliz@gnu.org>
6023
6024 Fix slow cursor motion and scrolling in large buffers with
6025 selective display, like Org Mode buffers. (Bug#9218)
6026
6027 * dispextern.h (struct bidi_it): New member disp_prop_p.
6028
6029 * xdisp.c: Remove one-slot cache of display string positions.
6030 (compute_display_string_pos): Accept an additional argument
5e617bc2 6031 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
6032 for a display string or property. If found, set DISP_PROP_P
6033 non-zero.
6034
6035 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
6036 DISP_PROP_P, and pass it to compute_display_string_pos.
6037 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
6038 non-zero. All callers of bidi_fetch_char changed.
6039
fb33fa43
SM
60402011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
6041
6042 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
6043
b099e063
DM
60442010-12-03 Don March <don@ohspite.net>
6045
6046 * keymap.c (Fdefine_key): Fix non-prefix key error message when
6047 last character M-[char] is translated to ESC [char] (bug#7541).
6048
5cc7f7af
KH
60492011-08-02 Kenichi Handa <handa@m17n.org>
6050
d0fffa3f 6051 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
6052
6053 * chartab.c (uniprop_table): Make it non-static.
6054
525d5e6e
EZ
60552011-08-01 Eli Zaretskii <eliz@gnu.org>
6056
6057 * xdisp.c (forward_to_next_line_start): Accept additional argument
6058 BIDI_IT_PREV, and store into it the state of the bidi iterator had
6059 on the newline.
6060 (reseat_at_next_visible_line_start): Use the bidi iterator state
6061 returned by forward_to_next_line_start to restore the state of
6062 it->bidi_it after backing up to previous newline. (Bug#9212)
6063
31011111
AS
60642011-07-30 Andreas Schwab <schwab@linux-m68k.org>
6065
6066 * regex.c (re_comp): Protoize.
6067 (re_exec): Fix return type.
6068 (regexec): Fix type of `ret'. (Bug#9203)
6069
476371c4
PE
60702011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6071
e5d76069
PE
6072 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
6073 This is needed if max-image-size is a floating-point number.
6074
9a79b20c
AS
60752011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6076
6077 * print.c (print_object): Print empty symbol as ##.
6078
6079 * lread.c (read1): Read ## as empty symbol.
6080
d8c2fa78
AA
60812011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
6082
6083 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
6084 setting frame foreground color (Bug#9175).
6085 (x_set_background_color): Likewise.
6086
ffe57a7a
AA
6087 * nsmenu.m (-setText): Size tooltip dimensions precisely to
6088 contents (Bug#9176).
6089 (EmacsTooltip -init): Remove bezels and add shadows to
6090 tooltip windows.
6091
bf3492a5
AA
6092 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
6093 or scroll bar (Bug#8470).
6094
d55e9c53
AA
6095 * nsfont.m (nsfont_open): Remove assignment to voffset and
6096 unnecessary vars hshink, expand, hd, full_height, min_height.
6097 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
6098
6099 * nsterm.h (nsfont_info): Remove voffset field.
6100
d8c2fa78 61012011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
6102
6103 Implement strike-through and overline on NextStep (Bug#8863).
6104
6105 * nsfont.m (nsfont_open): Use underline position provided by font,
6106 instead of hard-coded value of 2.
6107 (nsfont_draw): Call ns_draw_text_decoration instead.
6108
6109 * nsterm.h: Add declaration for ns_draw_text_decoration.
6110
6111 * nsterm.m (ns_draw_text_decoration): New function for drawing
6112 underline, overline, and strike-through.
6113 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
6114 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 6115 accommodate underlining, etc.
4843aac3 6116
4cc60b9b
EZ
61172011-07-28 Eli Zaretskii <eliz@gnu.org>
6118
bc7ece87
EZ
6119 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
6120 default.
4cc60b9b 6121
476371c4
PE
61222011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6123
66606eea
PE
6124 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
6125 Without this fix, if a signal arrives just after memory fills up,
6126 'malloc' might be invoked reentrantly.
6127
476371c4
PE
6128 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
6129 In other words, assume that every image size is allowed, on non-X
6130 hosts. This assumption is probably wrong, but it lets Emacs compile.
6131
f3fcc40d
AS
61322011-07-28 Andreas Schwab <schwab@linux-m68k.org>
6133
6134 * regex.c (re_iswctype): Convert return values to boolean.
6135
350c992f
EZ
61362011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
6137
6138 * xdisp.c (compute_display_string_pos): Don't use cached display
6139 string position if the buffer had its restriction changed.
6140 (Bug#9184)
6141
5266b4bb
PE
61422011-07-28 Paul Eggert <eggert@cs.ucla.edu>
6143
6144 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
6145
2573a837 61462011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 6147
41f55ccd 6148 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 6149
39e378da
PE
6150 * bidi.c: Integer size and overflow fixes.
6151 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
6152 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
6153 (bidi_cache_find_level_change, bidi_cache_ensure_space)
6154 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
6155 (bidi_find_other_level_edge):
6156 Use ptrdiff_t instead of EMACS_INT where either will do.
6157 This works better on 32-bit hosts configured --with-wide-int.
6158 (bidi_cache_ensure_space): Check for size-calculation overflow.
6159 Use % rather than repeated addition, for better worst-case speed.
6160 Don't set bidi_cache_size until after xrealloc returns, because it
6161 might not return.
6162 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
6163 (bidi_cache_ensure_space): Also check that the bidi cache size
6164 does not exceed that of the largest Lisp string or buffer. See Eli
6165 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 6166
5e927815
PE
6167 * alloc.c (__malloc_size_t): Remove.
6168 All uses replaced by size_t. See Andreas Schwab's note
6169 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
6170
ca4aa935
PE
6171 * image.c: Improve checking for integer overflow.
6172 (check_image_size): Assume that f is nonnull, since
6173 it is always nonnull in practice. This is one less thing to
6174 worry about when checking for integer overflow later.
6175 (x_check_image_size): New function, which checks for integer
6176 overflow issues inside X.
6177 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
6178 This removes the need for a memory_full check.
6179 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
6180 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
6181 (xbm_read_bitmap_data): Change locals back to 'int', since
6182 their values must fit in 'int'.
6183 (xpm_load_image, png_load, tiff_load):
6184 Invoke x_create_x_image_and_pixmap earlier,
6185 to avoid much needless work if the image is too large.
6186 (tiff_load): Treat overly large images as if
6187 x_create_x_image_and_pixmap failed, not as malloc failures.
6188 (gs_load): Use x_check_image_size.
6189
5f8f9cc2
PE
6190 * gtkutil.c: Omit integer casts.
6191 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
6192 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
6193
5adf60bc
PE
6194 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
6195
c8907a93
PE
6196 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
6197 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
6198 would wrongly return t on a 64-bit host.
6199
e3c25c68
PE
6200 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
6201 The plain *_OVERFLOW macros run afoul of GCC bug 49705
6202 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
6203 and therefore cause GCC to emit a bogus diagnostic in some cases.
6204
3f791afe
PE
6205 * image.c: Integer signedness and overflow and related fixes.
6206 This is not an exhaustive set of fixes, but it's time to
6207 record what I've got.
6208 (lookup_pixel_color, check_image_size): Remove redundant decls.
6209 (check_image_size): Don't assume that arbitrary EMACS_INT values
6210 fit in 'int', or that arbitrary 'double' values fit in 'int'.
6211 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
6212 (tiff_load, imagemagick_load_image):
6213 Check for overflow in size calculations.
6214 (x_create_x_image_and_pixmap): Remove unnecessary test for
6215 xmalloc returning NULL; that can't happen.
6216 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
6217 (xpm_color_bucket): Use better integer hashing function.
6218 (xpm_cache_color): Don't possibly over-allocate memory.
6219 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
6220 (gif_memory_source):
6221 Use ptrdiff_t, not int or size_t, to record sizes.
6222 (png_load): Don't assume values greater than 2**31 fit in 'int'.
6223 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
6224 either works, as we prefer signed integers.
6225 (tiff_read_from_memory, tiff_write_from_memory):
6226 Return tsize_t, not size_t, since that's what the TIFF API wants.
6227 (tiff_read_from_memory): Don't fail simply because the read would
6228 go past EOF; instead, return a short read.
6229 (tiff_load): Omit no-longer-needed casts.
6230 (Fimagemagick_types): Don't assume size fits into 'int'.
6231
3cc5a532
PE
6232 Improve hashing quality when configured --with-wide-int.
6233 * fns.c (hash_string): New function, taken from sxhash_string.
6234 Do not discard information about ASCII character case; this
6235 discarding is no longer needed.
6236 (sxhash-string): Use it. Change sig to match it. Caller changed.
6237 * lisp.h: Declare it.
6238 * lread.c (hash_string): Remove, since we now use fns.c's version.
6239 The fns.c version returns a wider integer if --with-wide-int is
6240 specified, so this should help the quality of the hashing a bit.
6241
b312a492
PE
6242 * emacs.c: Integer overflow minor fix.
6243 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
6244 Define only if GNU_LINUX.
6245 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
6246
dfd153ae
PE
6247 * dispnew.c: Integer signedness and overflow fixes.
6248 Remove unnecessary forward decls, that were a maintenance hassle.
6249 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
6250 All uses changed.
6251 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
6252 (scrolling_window): Use ptrdiff_t, not int, for byte count.
6253 (prepare_desired_row, line_draw_cost):
6254 Use int, not unsigned, where either works.
6255 (save_current_matrix, restore_current_matrix):
6256 Use ptrdiff_t, not size_t, where either works.
6257 (init_display): Check for overflow more accurately, and without
6258 relying on undefined behavior.
6259
a81d11a3
PE
6260 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
6261 Remove, replacing with the new symbols in lisp.h. All uses changed.
6262 * fileio.c (make_temp_name):
6263 * filelock.c (lock_file_1, lock_file):
6264 * xdisp.c (message_dolog):
6265 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
6266 Use pMd etc. instead.
6267 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
6268 replacing the pWIDE etc. symbols removed from editfns.c.
6269
3300e6fd
PE
6270 * keyboard.h (num_input_events): Now uintmax_t.
6271 This is (very slightly) less likely to mess up due to wraparound.
6272 All uses changed.
6273
fd05c7e9
PE
6274 * buffer.c: Integer signedness fixes.
6275 (alloc_buffer_text, enlarge_buffer_text):
6276 Use ptrdiff_t rather than size_t when either will do, as we prefer
6277 signed integers.
6278
903fe15d
PE
6279 * alloc.c: Integer signedness and overflow fixes.
6280 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
6281 (__malloc_size_t): Default to size_t, not to int.
6282 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
6283 (Fgarbage_collect, mark_object_loop_halt, mark_object):
6284 Prefer ptrdiff_t to size_t when either would do, as we prefer
6285 signed integers.
6286 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
6287 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
6288 Now const. Initialize with values that are in range even if char
6289 is signed.
6290 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
6291 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
6292 These functions do the right thing with sizes > 2**32.
6293 (check_depth): Now ptrdiff_t, not int.
6294 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
6295 Adjust to new way of storing sizes. Check for size overflow bugs
6296 in rest of code.
6297 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
6298 slightly wrong anyway, as it missed one instance of
6299 XMALLOC_OVERRUN_CHECK_OVERHEAD.
6300 (refill_memory_reserve): Omit needless cast to size_t.
6301 (mark_object_loop_halt): Mark as externally visible.
6302
ac82cc6a
PE
6303 * xselect.c: Integer signedness and overflow fixes.
6304 (Fx_register_dnd_atom, x_handle_dnd_message):
6305 Use ptrdiff_t, not size_t, since we prefer signed.
6306 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
6307 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
6308 x_dnd_atoms_size and x_dnd_atoms_length.
6309
c2d1e36d
PE
6310 * doprnt.c: Prefer signed to unsigned when either works.
6311 * eval.c (verror):
6312 * doprnt.c (doprnt):
6313 * lisp.h (doprnt):
6314 * xdisp.c (vmessage):
6315 Use ptrdiff_t, not size_t, when using or implementing doprnt,
6316 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
6317 prefer signed arithmetic to avoid comparison confusion.
6318 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
6319 but is a bit tricky.
6320
0e926e56
PE
6321 Assume freestanding C89 headers, string.h, stdlib.h.
6322 * data.c, doprnt.c, floatfns.c, print.c:
6323 Include float.h unconditionally.
6324 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
6325 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
6326 * regex.c: Likewise for stddef.h, string.h.
6327 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
6328 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
6329 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
6330 (STDC_HEADERS): Remove obsolete defines.
6331 * sysdep.c: Include limits.h unconditionally.
6332
9cfdb3ec
PE
6333 Assume support for memcmp, memcpy, memmove, memset.
6334 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
6335 * regex.c (memcmp, memcpy):
6336 Remove; we assume C89 now.
6337
6338 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
6339 (__malloc_safe_bcopy): Remove; no longer needed.
6340
cf950e6b 6341 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
6342 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
6343 well either way, and we prefer signed to unsigned.
6344
dbf38e02
LMI
63452011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
6346
6347 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
6348 closes the connection while we're reading (bug#9182).
6349
d6f0886c 63502011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 6351
d6f0886c
JD
6352 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
6353 are specified (Bug#9168).
24e0f6b1 6354
2eb1f9e6
PE
63552011-07-25 Paul Eggert <eggert@cs.ucla.edu>
6356
6357 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
6358 Found by GCC static checking and --with-wide-int on a 32-bit host.
6359
22381272 63602011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
6361
6362 * xdisp.c (compute_display_string_pos): Fix logic of caching
6363 previous display string position. Initialize cached_prev_pos to
6364 -1. Fixes slow-down at the beginning of a buffer.
6365
f25e39b4
EZ
63662011-07-24 Eli Zaretskii <eliz@gnu.org>
6367
6368 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
6369 for attrs[LFACE_FONTSET_INDEX].
6370
04c4b52e
PE
63712011-07-23 Paul Eggert <eggert@cs.ucla.edu>
6372
6373 * xml.c (parse_region): Remove unused local
6374 that was recently introduced.
6375
c1734fbd
EZ
63762011-07-23 Eli Zaretskii <eliz@gnu.org>
6377
be18c5a5
EZ
6378 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
6379 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
6380
c1734fbd
EZ
6381 * xdisp.c (move_it_in_display_line_to): Record the best matching
6382 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
6383 exit if none of the characters scanned was an exact match.
6384 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
6385 when exact match is impossible due to invisible text, and the
6386 lines are truncated.
6387
a258d627
JD
63882011-07-23 Jan Djärv <jan.h.d@swipnet.se>
6389
6390 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
6391 for OSX >= 10.7.
6392
b6d5a689
EZ
63932011-07-22 Eli Zaretskii <eliz@gnu.org>
6394
0f74f785
EZ
6395 Fix a significant slow-down of cursor motion with C-n, C-p,
6396 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
6397 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 6398 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
6399 (next_element_from_buffer): Call compute_stop_pos_backwards to
6400 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
6401 base_level_stop.
6402 (reseat): Don't look for prev_stop, as that could mean a very long
6403 run.
6404 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
6405 <cached_disp_overlay_modiff>: Cache for last found display string
6406 position.
551918c1 6407 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
6408 about the same buffer in the same area of character positions, and
6409 the buffer wasn't changed since the time the display string
6410 position was cached.
551918c1 6411
b2d0c91a
EZ
64122011-07-22 Eli Zaretskii <eliz@gnu.org>
6413
6414 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
6415 is an integer, which is important for empty lines. (Bug#9149)
6416
043604ee
CY
64172011-07-22 Chong Yidong <cyd@stupidchicken.com>
6418
6419 * frame.c (Fmodify_frame_parameters): In tty case, update the
6420 default face if necessary (Bug#4238).
6421
da4adb04
CY
64222011-07-21 Chong Yidong <cyd@stupidchicken.com>
6423
6424 * editfns.c (Fstring_to_char): No need to explain what a character
6425 is in the docstring (Bug#6576).
6426
9abd0532
LMI
64272011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
6428
6429 * xml.c (parse_region): Make sure we always return a tree.
6430
36881d16
HK
64312011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
6432
6433 * xml.c (parse_region): If a document contains only comments,
6434 return that, too.
6435
1e98674d
LMI
64362011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
6437
6438 * xml.c (make_dom): Return comments, too.
6439
590bd467
PE
64402011-07-19 Paul Eggert <eggert@cs.ucla.edu>
6441
6442 Port to OpenBSD.
6443 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
6444 and the surrounding thread.
6445 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
6446 rather than fgets, and retry after EINTR. Otherwise, 'emacs
6447 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
6448 timer goes off.
6449 * s/openbsd.h (BROKEN_SIGIO): Define.
6450 * unexelf.c (unexec) [__OpenBSD__]:
6451 Don't update the .mdebug section of the Alpha COFF symbol table.
6452
f41628b2
LMI
64532011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6454
6455 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
6456 (bug#8460).
6457
b59b67c5
PE
64582011-07-18 Paul Eggert <eggert@cs.ucla.edu>
6459
15e3a074
PE
6460 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
6461 This fixes some race conditions on the permissions of any newly
6462 created file.
6463
41bed37d
PE
6464 * alloc.c (valid_pointer_p): Use pipe, not open.
6465 This fixes some permissions issues when debugging.
6466
b59b67c5
PE
6467 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
6468 If fchown fails to set both uid and gid, try to set just gid,
6469 as that is sometimes allowed. Adjust the file's mode to eliminate
6470 setuid or setgid bits that are inappropriate if fchown fails.
6471
925a6be7
SM
64722011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6473
6474 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
6475 to compare Lisp_Objects.
6476 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
6477 global_gnutls_log_level, don't mistake it for a Lisp_Object.
6478 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
6479
52968808
AS
64802011-07-17 Andreas Schwab <schwab@linux-m68k.org>
6481
0a6a104b
AS
6482 * lread.c (read_integer): Unread even EOF character.
6483 (read1): Likewise. Properly record start position of symbol.
6484
52968808
AS
6485 * lread.c (read1): Read `#:' as empty uninterned symbol if no
6486 symbol character follows.
6487
9e381cdd
PE
64882011-07-17 Paul Eggert <eggert@cs.ucla.edu>
6489
6490 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
6491 This works around a problem with the previous change to Fcopy_file.
6492 Recent glibc declares fchown with __attribute__((warn_unused_result)),
6493 and without this change, GCC might complain about discarding
6494 fchown's return value.
6495
b5641435
JB
64962011-07-16 Juanma Barranquero <lekktu@gmail.com>
6497
6498 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
6499
a8031457
PE
65002011-07-16 Paul Eggert <eggert@cs.ucla.edu>
6501
6502 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
6503
dd889327
LMI
65042011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
6505
750c33f7
LMI
6506 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
6507 it's used from the C level.
6508
dd889327
LMI
6509 * process.c: Use the same condition for POLL_FOR_INPUT in both
6510 keyboard.c and process.c (bug#1858).
6511
87e86684
LM
65122011-07-09 Lawrence Mitchell <wence@gmx.li>
6513
6514 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
6515 (Fgnutls_boot): Use it.
6516
64348f40
AS
65172011-07-15 Andreas Schwab <schwab@linux-m68k.org>
6518
6519 * doc.c (Fsubstitute_command_keys): Revert last change.
6520
1d698799
LMI
65212011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
6522
f863868c
LMI
6523 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
6524 quotes the next character, and doesn't affect other longer
6525 sequences (bug#8935).
6526
1d698799
LMI
6527 * lread.c (syms_of_lread): Clarify that is isn't only
6528 `eval-buffer' and `eval-defun' that's affected by
6529 `lexical-binding' (bug#8460).
6530
aa4b6df6
EZ
65312011-07-15 Eli Zaretskii <eliz@gnu.org>
6532
6533 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 6534 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 6535
5d856da6
PE
65362011-07-14 Paul Eggert <eggert@cs.ucla.edu>
6537
ad6042bb
PE
6538 Fix minor problems found by static checking.
6539 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
6540 (elsz): Now a signed constant, not a size_t var. We prefer signed
6541 types to unsigned, to avoid integer comparison confusion. Without
6542 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
6543 "cannot optimize loop, the loop counter may overflow", a symptom
6544 of the confusion.
f00bbb22 6545 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
6546 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
6547
6468f31c
LMI
65482011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
6549
49080b10
LMI
6550 * search.c (Fre_search_backward): Mention `case-fold-search' in
6551 all the re_search_* functions (bug#8138).
6552
6468f31c
LMI
6553 * keyboard.c (Fopen_dribble_file): Document when the file is
6554 closed (bug#8056).
6555
c965adc5
EZ
65562011-07-14 Eli Zaretskii <eliz@gnu.org>
6557
df9733bf
EZ
6558 * bidi.c (bidi_dump_cached_states): Fix format of displaying
6559 bidi_cache_idx.
6560
0bb23927
EZ
6561 Support bidi reordering of display and overlay strings.
6562 * xdisp.c (compute_display_string_pos)
6563 (compute_display_string_end): Accept additional argument STRING.
6564 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
6565 (reseat_to_string): Initialize bidi_it->string.s and
6566 bidi_it->string.schars.
6567 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
6568 NULL (avoids a crash in bidi_paragraph_init).
6569 Initialize itb.string.lstring.
0bb23927
EZ
6570 (init_iterator): Call bidi_init_it only of a valid
6571 buffer position was specified. Initialize paragraph_embedding to
6572 L2R.
6573 (reseat_to_string): Initialize the bidi iterator.
6574 (display_string): If we need to ignore text properties of
6575 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
6576 original value of -1 will not work with bidi.)
6577 (compute_display_string_pos): First arg is now struct
6578 `text_pos *'; all callers changed. Support display properties on
6579 Lisp strings.
6580 (compute_display_string_end): Support display properties on Lisp
6581 strings.
6582 (init_iterator, reseat_1, reseat_to_string): Initialize the
6583 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
6584 when iterating on a string not from display properties).
640c8776
SM
6585 (compute_display_string_pos, compute_display_string_end):
6586 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
6587 arrow keys.
6588 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
6589 base_level_stop; instead, set base_level_stop to BEGV.
6590 Fixes crashes in vertical-motion.
0bb23927
EZ
6591 (next_element_from_buffer): Improve commentary for when
6592 the iterator is before prev_stop.
6593 (init_iterator): Initialize bidi_p from the default value of
6594 bidi-display-reordering, not from buffer-local value. Use the
6595 buffer-local value only if initializing for buffer iteration.
6596 (handle_invisible_prop): Support invisible properties on strings
6597 that are being bidi-reordered.
6598 (set_iterator_to_next): Support bidi reordering of C strings and
6599 Lisp strings.
6600 (next_element_from_string): Support bidi reordering of Lisp
6601 strings.
6602 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
6603 (display_string): Support display of R2L glyph rows.
6604 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
6605 (init_iterator): Don't initialize it->bidi_p for strings
6606 here.
6607 (reseat_to_string): Initialize it->bidi_p for strings here.
6608 (next_element_from_string, next_element_from_c_string)
6609 (next_element_from_buffer): Add xassert's for correspondence
6610 between IT's object being iterated and it->bidi_it.string
6611 structure.
6612 (face_before_or_after_it_pos): Support bidi iteration.
6613 (next_element_from_c_string): Handle the case of the first string
6614 character that is not the first one in the visual order.
6615 (get_visually_first_element): New function, refactored from common
6616 parts of next_element_from_buffer, next_element_from_string, and
6617 next_element_from_c_string.
6618 (tool_bar_lines_needed, redisplay_tool_bar)
6619 (display_menu_bar): Force left-to-right direction. Add a FIXME
6620 comment for making that be controlled by a user option.
6621 (push_it, pop_it): Save and restore the state of the
6622 bidi iterator. Save and restore the bidi_p flag.
6623 (pop_it): Iterate out of display property for string iteration as
6624 well.
6625 (iterate_out_of_display_property): Support iteration over strings.
6626 (handle_single_display_spec): Set up it->bidi_it for iteration
6627 over a display string, and call bidi_init_it.
6628 (handle_single_display_spec, next_overlay_string)
6629 (get_overlay_strings_1, push_display_prop): Set up the bidi
6630 iterator for displaying display or overlay strings.
6631 (forward_to_next_line_start): Don't use the shortcut if
6632 bidi-iterating.
6633 (back_to_previous_visible_line_start): If handle_display_prop
6634 pushed the iterator stack, restore the internal state of the bidi
6635 iterator by calling bidi_pop_it same number of times.
6636 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
6637 and we are bidi-iterating, don't decrement the iterator position;
6638 instead, set the first_elt flag in the bidi iterator, to produce
6639 the same effect.
6640 (reseat_1): Remove redundant setting of string_from_display_prop_p.
6641 (push_display_prop): xassert that we are iterating a buffer.
6642 (push_it, pop_it): Save and restore paragraph_embedding member.
6643 (handle_single_display_spec, next_overlay_string)
6644 (get_overlay_strings_1, reseat_1, reseat_to_string)
6645 (push_display_prop): Set up the `unibyte' member of bidi_it.string
6646 correctly. Don't assume unibyte strings are not bidi-reordered.
6647 (compute_display_string_pos)
6648 (compute_display_string_end): Fix handling the case of C string.
6649 (push_it, pop_it): Save and restore from_disp_prop_p.
6650 (handle_single_display_spec, push_display_prop): Set the
6651 from_disp_prop_p flag.
6652 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
6653 (pop_it): Call iterate_out_of_display_property only if we are
6654 popping after iteration over a string that came from a display
6655 property. Fix a typo in popping stretch info. Add an assertion
6656 for verifying that the iterator position is in sync with the bidi
6657 iterator.
6658 (handle_single_display_spec, get_overlay_strings_1)
6659 (push_display_prop): Fix initialization of paragraph direction for
6660 string when that of the parent object is not yet determined.
6661 (reseat_1): Call bidi_init_it to resync the bidi
6662 iterator with IT's position. (Bug#7616)
6663 (find_row_edges): If ROW->start.pos gives position
6664 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
6665 (handle_stop, back_to_previous_visible_line_start, reseat_1):
6666 Reset the from_disp_prop_p flag.
6667 (SAVE_IT, RESTORE_IT): New macros.
6668 (pos_visible_p, face_before_or_after_it_pos)
6669 (back_to_previous_visible_line_start)
6670 (move_it_in_display_line_to, move_it_in_display_line)
6671 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6672 (try_scrolling, redisplay_window, display_line): Use them when
6673 saving a temporary copy of the iterator and restoring it back.
6674 (back_to_previous_visible_line_start, reseat_1)
6675 (init_iterator): Empty the bidi cache "stack".
6676 (move_it_in_display_line_to): If iterator ended up at
6677 EOL, but we never saw any buffer positions smaller than
6678 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
6679 motion in bidi-reordered lines.
6680 (move_it_in_display_line_to): Record prev_method and prev_pos
6681 immediately before the call to set_iterator_to_next. Fixes cursor
6682 motion in bidi-reordered lines with stretch glyphs and strings
6683 displayed in margins. (Bug#8133) (Bug#8867)
6684 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
6685 TO_CHARPOS.
640c8776
SM
6686 (pos_visible_p): Support positions in bidi-reordered lines.
6687 Save and restore bidi cache.
0bb23927
EZ
6688
6689 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
6690 (bidi_paragraph_info): Delete unused struct.
6691 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
6692 (bidi_cache_start): New variable.
6693 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
6694 to zero.
6695 (bidi_cache_fetch_state, bidi_cache_search)
6696 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6697 (bidi_cache_find, bidi_peek_at_next_level)
6698 (bidi_level_of_next_char, bidi_find_other_level_edge)
6699 (bidi_move_to_visually_next): Compare cache index with
6700 bidi_cache_start rather than with zero.
6701 (bidi_fetch_char): Accept new argument STRING; all callers
6702 changed. Support iteration over a string. Support strings with
6703 display properties. Support unibyte strings. Fix the type of
6704 `len' according to what STRING_CHAR_AND_LENGTH expects.
6705 (bidi_paragraph_init, bidi_resolve_explicit_1)
6706 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
6707 (bidi_level_of_next_char, bidi_move_to_visually_next):
6708 Support iteration over a string.
0bb23927
EZ
6709 (bidi_set_sor_type, bidi_resolve_explicit_1)
6710 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
6711 can now be zero (for strings); special values 0 and -1 were
6712 changed to -1 and -2, respectively.
6713 (bidi_char_at_pos): New function.
6714 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
6715 Call it instead of FETCH_MULTIBYTE_CHAR.
6716 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
6717 initialized to valid values.
6718 (bidi_init_it): Don't initialize charpos and bytepos with invalid
6719 values.
6720 (bidi_level_of_next_char): Allow the sentinel "position" to pass
6721 the test for valid cached positions. Fix the logic for looking up
6722 the sentinel state in the cache. GCPRO the Lisp string we are
6723 iterating.
6724 (bidi_push_it, bidi_pop_it): New functions.
6725 (bidi_initialize): Initialize the bidi cache start stack pointer.
6726 (bidi_cache_ensure_space): New function, refactored from part of
6727 bidi_cache_iterator_state. Don't assume the required size is just
6728 one BIDI_CACHE_CHUNK away.
6729 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
6730 (bidi_count_bytes, bidi_char_at_pos): New functions.
6731 (bidi_cache_search): Don't assume bidi_cache_last_idx is
6732 always valid if bidi_cache_idx is valid.
6733 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
6734 is valid if it's going to be used.
6735 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
6736 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
6737 (bidi_cache_find_level_change, bidi_cache_ensure_space)
6738 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
6739 (bidi_find_other_level_edge, bidi_cache_start_stack):
6740 All variables related to cache indices are now EMACS_INT.
c965adc5 6741
0bb23927
EZ
6742 * dispextern.h (struct bidi_string_data): New structure.
6743 (struct bidi_it): New member `string'. Make flag members be 1-bit
6744 fields, and put them last in the struct.
640c8776
SM
6745 (compute_display_string_pos, compute_display_string_end):
6746 Update prototypes.
0bb23927
EZ
6747 (bidi_push_it, bidi_pop_it): Add prototypes.
6748 (struct iterator_stack_entry): New members bidi_p,
6749 paragraph_embedding, and from_disp_prop_p.
6750 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
6751 (bidi_shelve_cache, bidi_unshelve_cache):
6752 Declare prototypes.
0bb23927
EZ
6753
6754 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
6755 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
6756 and vector-like objects.
6757
6758 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
6759 cache around display iteration.
6760
6761 * window.c (Fwindow_end, window_scroll_pixel_based)
6762 (displayed_window_lines, Frecenter): Save and restore the bidi
6763 cache around display iteration.
6764
3bbd2265
LMI
67652011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
6766
6767 * editfns.c (Fdelete_region): Clarify the use of the named
6768 parameters (bug#6788).
6769
adc47434
MR
67702011-07-14 Martin Rudalics <rudalics@gmx.at>
6771
6772 * indent.c (Fvertical_motion): Set and restore w->pointm when
6773 saving and restoring the window's buffer (Bug#9006).
6774
837c31f8
LMI
67752011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
6776
6777 * editfns.c (Fstring_to_char): Clarify just what is returned
6778 (bug#6576). Text by Eli Zaretskii.
6779
ac389d0c
JB
67802011-07-13 Juanma Barranquero <lekktu@gmail.com>
6781
6782 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
6783
0be0ce47
EZ
67842011-07-13 Eli Zaretskii <eliz@gnu.org>
6785
6786 * buffer.c (mmap_find): Fix a typo.
6787
cd18e7e3
JB
67882011-07-13 Johan Bockgård <bojohan@gnu.org>
6789
6790 Fix execution of x selection hooks.
6791 * xselect.c (Qx_lost_selection_functions)
6792 (Qx_sent_selection_functions): New vars.
6793 (syms_of_xselect): DEFSYM them.
6794 (x_handle_selection_request): Pass Qx_sent_selection_functions
6795 rather than Vx_sent_selection_functions to Frun_hook_with_args.
6796 (x_handle_selection_clear,x_clear_frame_selections):
6797 Pass Qx_lost_selection_functions rather than
6798 Vx_lost_selection_functions to Frun_hook_with_args.
6799
47ea7f44
PE
68002011-07-13 Paul Eggert <eggert@cs.ucla.edu>
6801
ac389d0c 6802 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
6803 The old code sometimes used this field without initializing it.
6804
47ea7f44
PE
6805 * alloc.c (gc_sweep): Don't read past end of array.
6806 In theory, the old code could also have corrupted Emacs internals,
6807 though it'd be very unlikely.
6808
bc985c87
AS
68092011-07-12 Andreas Schwab <schwab@linux-m68k.org>
6810
6811 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 6812 argument. (Bug#4026)
bc985c87 6813
0cf34688
LMI
68142011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
6815
b3dadd76
LMI
6816 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
6817 key" (bug#4257).
6818
0cf34688
LMI
6819 * window.c (Fset_window_start): Doc fix (bug#4199).
6820 (Fset_window_hscroll): Ditto.
6821
270768cd
PE
68222011-07-12 Paul Eggert <eggert@cs.ucla.edu>
6823
077e3dda 6824 Fix minor new problems caught by GCC 4.6.1.
270768cd 6825 * term.c (init_tty): Remove unused local.
490011a6 6826 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 6827 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 6828 not used otherwise.
270768cd 6829
b1f58454
CY
68302011-07-12 Chong Yidong <cyd@stupidchicken.com>
6831
6832 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
6833
22b9578d
LMI
68342011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6835
6e70ab07
LMI
6836 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
6837 are the mini-buffer and the echo area (bug#3320).
6838
22b9578d
LMI
6839 * term.c (init_tty): Remove support for supdup, c10 and perq
6840 terminals, which are no longer supported (bug#1482).
6841
8974cc9f
JB
68422011-07-10 Johan Bockgård <bojohan@gnu.org>
6843
6844 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
6845
a560d974
JD
68462011-07-10 Jan Djärv <jan.h.d@swipnet.se>
6847
6848 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
6849 for non-popups (Bug#3642).
6850
1dae0f0a
AS
68512011-07-10 Andreas Schwab <schwab@linux-m68k.org>
6852
268c2c36 6853 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 6854 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
6855 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
6856 * cm.c (losecursor): Likewise.
1dae0f0a
AS
6857 * data.c (fmod): Likewise.
6858 * dispnew.c (swap_glyphs_in_rows): Likewise.
6859 * emacs.c (memory_warning_signal): Likewise.
6860 * floatfns.c (float_error): Likewise.
6861 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
6862 (otf_open, font_otf_capability, generate_otf_features)
6863 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
6864 Likewise.
6865 * image.c (pbm_read_file): Likewise.
6866 * indent.c (string_display_width): Likewise.
6867 * intervals.c (check_for_interval, search_for_interval)
6868 (inc_interval_count, count_intervals, root_interval)
6869 (adjust_intervals_for_insertion, make_new_interval): Likewise.
6870 * lread.c (defalias): Likewise.
268c2c36 6871 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
6872 * regex.c (set_image_of_range_1, set_image_of_range)
6873 (regex_grow_registers): Likewise.
6874 * sysdep.c (strerror): Likewise.
6875 * termcap.c (valid_filename_p, tprint, main): Likewise.
6876 * tparam.c (main): Likewise.
6877 * unexhp9k800.c (run_time_remap, save_data_space)
6878 (update_file_ptrs, read_header, write_header, calculate_checksum)
6879 (copy_file, copy_rest, display_header): Likewise.
6880 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
6881 Likewise.
6882 * xdisp.c (check_it): Likewise.
6883 * xfaces.c (register_color, unregister_color, unregister_colors):
6884 Likewise.
6885 * xfns.c (print_fontset_result): Likewise.
6886 * xrdb.c (member, fatal, main): Likewise.
6887
99033785
PE
68882011-07-10 Paul Eggert <eggert@cs.ucla.edu>
6889
6890 Fix minor problems found by static checking (Bug#9031).
6891 * chartab.c (char_table_set_range, map_sub_char_table):
6892 Remove unused locals.
6893 (uniprop_table): Now static.
6894 * composite.c (_work_char): Remove unused static var.
6895
9cb2ac56
JB
68962011-07-09 Juanma Barranquero <lekktu@gmail.com>
6897
6898 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
6899
f25661f0
JD
69002011-07-09 Jan Djärv <jan.h.d@swipnet.se>
6901
6902 * gtkutil.c (qttip_cb): Remove code without function.
6903
8278c4fe
EZ
69042011-07-09 Eli Zaretskii <eliz@gnu.org>
6905
6906 * w32.c (pthread_sigmask): New stub.
6907
1692ae2d 69082011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 6909
8a6ebd58 6910 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
6911 sigprocmask is portable only for single-threaded applications, and
6912 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
6913 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
6914 (LIBES): Use it.
6915 * callproc.c (Fcall_process):
6916 * process.c (create_process):
6917 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
6918 Use pthread_sigmask, not sigprocmask.
123403e4 6919
1b854618
JD
69202011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6921
6922 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
6923 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
6924 wrong (Bug#8591).
6925
3fe4b549
JD
69262011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6927
0ce7e563
JD
6928 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
6929 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
6930 (xg_hide_tooltip): Fix comment.
6931
3fe4b549
JD
6932 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
6933 in registerServicesMenuSendTypes.
6934 (validRequestorForSendType): Don't check ns_return_types.
6935
6936 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
6937 ns_return_type.
6938
5df75e47
JR
69392011-07-08 Jason Rumney <jasonr@gnu.org>
6940
22610910
JR
6941 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
6942 SH_SHOW for hidden windows (Bug#5482).
6943
5df75e47
JR
6944 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
6945 frame struct members of non-existent frames (Bug#6284).
6946
699c10bd
JD
69472011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6948
4393663b
JD
6949 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
6950 variable firstTime not needed on OSX >= 10.6.
6951 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
6952 >= 10.5. Use setKnobProportion, setDoubleValue.
6953
6954 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
6955 (MAC_OS_X_VERSION_10_5): Define if not defined.
6956 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
6957 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
6958 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
6959
6960 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
6961 cString and lossyCString on OSX >= 10.4
6962
58179cce 6963 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
6964 sizeToFit on OSX >= 10.2.
6965
6966 * nsimage.m (allocInitFromFile): Don't use deprecated method
6967 bestRepresentationForDevice on OSX >= 10.6.
6968
6969 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
6970 to avoid warning.
6971
6972 * emacs.c: Declare unexec_init_emacs_zone.
6973
a63e0781
JD
6974 * nsgui.h: Fix compiler warning about gnulib redefining verify.
6975
699c10bd
JD
6976 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
6977
6978 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
6979 on svcsMenu (Bug#8842).
6980
6981 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
6982 ns_return_types.
6983 (Fns_list_services): Just return Qnil on 10.6, code not working there.
6984
6985 * nsterm.m (QUTF8_STRING): Declare.
6986 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
6987 (validRequestorForSendType): Return type is (id).
6988 Change indexOfObjectIdenticalTo to indexOfObject.
6989 Check if we have local selection before returning self (Bug#8842).
6990 (writeSelectionToPasteboard): Put local selection into paste board
6991 if we have a local selection (Bug#8842).
6992 (syms_of_nsterm): DEFSYM QUTF8_STRING.
6993
6994 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
6995 (ns_get_local_selection): Declare.
6996
54e10184
LMI
69972011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
6998
9888ff71
LMI
6999 * keymap.c (describe_map_tree): Don't insert a double newline at
7000 the end of the buffer (bug#1169) and return whether we inserted
7001 something.
7002
54e10184
LMI
7003 * callint.c (Fcall_interactively): Change "reading args" to
7004 "providing args" to try to clarify what it does (bug#1010).
7005
15fa4783
KH
70062011-07-07 Kenichi Handa <handa@m17n.org>
7007
7008 * composite.c (composition_compute_stop_pos): Ignore a static
7009 composition starting before CHARPOS (Bug#8915).
7010
7011 * xdisp.c (handle_composition_prop): Likewise.
7012
a8815b00
EZ
70132011-07-07 Eli Zaretskii <eliz@gnu.org>
7014
7015 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
7016 (Bug#9015)
7017
ef7b981d 70182011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
7019
7020 * character.h (unicode_category_t): New enum type.
7021
7022 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
7023 (Qchar_code_property_table): New variable.
7024 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
7025 (UNIPROP_COMPRESSED_FORM_P): New macros.
7026 (char_table_ascii): Uncompress the compressed values.
7027 (sub_char_table_ref): New arg is_uniprop. Callers changed.
7028 Uncompress the compressed values.
ac389d0c 7029 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
7030 (char_table_ref_and_range): Uncompress the compressed values.
7031 (sub_char_table_set): New arg is_uniprop. Callers changed.
7032 Uncompress the compressed values.
7033 (sub_char_table_set_range): Args changed. Callers changed.
7034 (char_table_set_range): Adjuted for the above change.
7035 (map_sub_char_table): Delete args default_val and parent. Add arg
7036 top. Give decoded values to a Lisp function.
640c8776 7037 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
7038 values to a Lisp function. Gcpro more variables.
7039 (uniprop_table_uncompress)
7040 (uniprop_decode_value_run_length): New functions.
7041 (uniprop_decoder, uniprop_decoder_count): New variables.
7042 (uniprop_get_decoder, uniprop_encode_value_character)
7043 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
7044 New functions.
7045 (uniprop_encoder, uniprop_encoder_count): New variables.
7046 (uniprop_get_encoder, uniprop_table)
7047 (Funicode_property_table_internal, Fget_unicode_property_internal)
7048 (Fput_unicode_property_internal): New functions.
7049 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
7050 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 7051 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
7052 char-code-property-alist.
7053
640c8776 7054 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
7055 Vunicode_category_table.
7056
640c8776 7057 * font.c (font_range): Adjust for the change of
c805dec0
KH
7058 Vunicode_category_table.
7059
76b397fb
DN
70602011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
7061
7062 * m/iris4d.h: Remove file, move contents ...
7063 * s/irix6-5.h: ... here.
7064
22b4128e
PE
70652011-07-06 Paul Eggert <eggert@cs.ucla.edu>
7066
7067 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
7068 * alloc.c (mark_buffer):
7069 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
7070 (clone_per_buffer_values): Don't assume that
22b4128e
PE
7071 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
7072 This isn't true in general, and it's particularly not true
7073 if Emacs is configured with --with-wide-int.
7074 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
7075 New macros, used in the buffer.c change.
7076
869795d6
JD
70772011-07-05 Jan Djärv <jan.h.d@swipnet.se>
7078
7079 * xsettings.c: Use both GConf and GSettings if both are available.
7080 (store_config_changed_event): Add comment.
7081 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
7082 (store_tool_bar_style_changed): New functions.
5e617bc2 7083 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
7084 (struct xsettings): Move font inside HAVE_XFT.
7085 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 7086 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 7087 Move inside HAVE_XFT.
640c8776 7088 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
7089 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
7090 also.
7091 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 7092 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 7093 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
7094 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
7095 (parse_settings): Move check for font inside HAVE_XFT.
7096 (read_settings, apply_xft_settings): Add comment.
7097 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
7098 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
7099 call store_font_name_changed.
7100 (xft_settings_event): Add comment.
7101 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
7102 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
7103 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
7104 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
7105 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
7106 (xsettings_get_system_font, xsettings_get_system_normal_font):
7107 Add comment.
869795d6 7108
d8ed26bd
PE
71092011-07-05 Paul Eggert <eggert@cs.ucla.edu>
7110
7111 Random fixes. E.g., (random) never returned negative values.
7112 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
7113 subseconds part to the entropy, as that's a bit more random.
7114 Prefer signed to unsigned, since the signedness doesn't matter and
7115 in general we prefer signed. When given a limit, use a
7116 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
7117 latter isn't right if USE_2_TAGS_FOR_INTS.
7118 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
7119 not 0..VALMASK. Don't discard "excess" bits that random () returns.
7120
cabf1cac
SM
71212011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
7122
7123 * textprop.c (text_property_stickiness):
7124 Obey Vtext_property_default_nonsticky.
7125 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
7126 * w32fns.c (syms_of_w32fns):
7127 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
7128
6e9b2be9
PE
71292011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7130
7131 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
7132 This is more efficient than Ffile_directory_p and avoids a minor race.
7133
90186c68
LMI
71342011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
7135
7c301272
LMI
7136 * buffer.c (Foverlay_put): Say what the return value is
7137 (bug#7835).
7138
c4f2d8d4
LMI
7139 * fileio.c (barf_or_query_if_file_exists): Check first if the file
7140 is a directory before asking whether to use the file name
7141 (bug#7564).
ad637907
LMI
7142 (barf_or_query_if_file_exists): Make the "File is a directory"
7143 error be more correct.
c4f2d8d4 7144
90186c68
LMI
7145 * fns.c (Frequire): Remove the mention of the .gz files, since
7146 that's installation-specific, but keep the mention of
7147 `get-load-suffixes'.
7148
da64016e
PE
71492011-07-04 Paul Eggert <eggert@cs.ucla.edu>
7150
7151 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
7152 Report string overflow if the output is too long.
7153
7d47b580
JB
71542011-07-04 Juanma Barranquero <lekktu@gmail.com>
7155
a555cb87
JB
7156 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
7157 (syms_of_gnutls): Remove duplicate DEFSYM for
7158 Qgnutls_bootprop_verify_hostname_error, an error for
7159 Qgnutls_bootprop_verify_error (which is no longer used).
7160
7d47b580
JB
7161 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
7162 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
7163 Also (re)move comments that are misplaced or no longer relevant.
7164
1e49bfab
LMI
71652011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7166
7167 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
7168
1485f4c0
CY
71692011-07-03 Chong Yidong <cyd@stupidchicken.com>
7170
7171 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
7172 and background color parameters if they have been changed.
7173
a9ab721e
LMI
71742011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7175
7176 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
7177
cf7cff57
PE
71782011-07-03 Paul Eggert <eggert@cs.ucla.edu>
7179
2e13213d
PE
7180 * xsettings.c (SYSTEM_FONT): Define only when used.
7181 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
7182
cf7cff57
PE
7183 * keymap.c (access_keymap_1): Now static.
7184
7a8e04f7
CY
71852011-07-02 Chong Yidong <cyd@stupidchicken.com>
7186
7187 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
7188 leave any prefix arg for the up event (Bug#1586).
7189
61352f62
LMI
71902011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
7191
69bb1ef7
LMI
7192 * lread.c (syms_of_lread): Mention single symbols defined by
7193 `defvar' or `defconst' (bug#7154).
7194
61352f62 7195 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 7196 (Frequire): Mention get-load-suffixes.
61352f62 7197
28545e04
MR
71982011-07-02 Martin Rudalics <rudalics@gmx.at>
7199
7200 * window.h (window): Remove clone_number slot.
7201 * window.c (Fwindow_clone_number, Fset_window_clone_number):
7202 Remove.
7203 (make_parent_window, make_window, saved_window)
7204 (Fset_window_configuration, save_window_save): Don't deal with
7205 clone numbers.
7206 * buffer.c (Qclone_number): Remove declaration.
7207 (sort_overlays, overlay_strings): Don't deal with clone numbers.
7208
3349e122
SM
72092011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
7210
7211 Add multiple inheritance to keymaps.
7212 * keymap.c (Fmake_composed_keymap): New function.
7213 (Fset_keymap_parent): Simplify.
7214 (fix_submap_inheritance): Remove.
7215 (access_keymap_1): New function extracted from access_keymap to handle
7216 embedded parents and handle lists of maps.
7217 (access_keymap): Use it.
7218 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
7219 (Fcopy_keymap): Handle embedded parents.
7220 (Fcommand_remapping, define_as_prefix): Simplify.
7221 (Fkey_binding): Simplify.
7222 (syms_of_keymap): Move minibuffer-local-completion-map,
7223 minibuffer-local-filename-completion-map,
7224 minibuffer-local-must-match-map, and
7225 minibuffer-local-filename-must-match-map to Elisp.
7226 (syms_of_keymap): Defsubr make-composed-keymap.
7227 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
7228 (parse_menu_item): Trivial simplification.
7229
3279eb87
GM
72302011-07-01 Glenn Morris <rgm@gnu.org>
7231
7232 * Makefile.in (SETTINGS_LIBS): Fix typo.
7233
4550efdf
KI
72342011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
7235
7236 * coding.c (Fencode_coding_string): Record the last coding system
7237 used, as the function doc string says (bug#8738).
7238
0949d2b6
JD
72392011-07-01 Jan Djärv <jan.h.d@swipnet.se>
7240
7241 * xsettings.c (store_monospaced_changed): Take new font as arg and
7242 check for change against current_mono_font.
7243 (EMACS_TYPE_SETTINGS): Remove this and related defines.
7244 (emacs_settings_constructor, emacs_settings_get_property)
7245 (emacs_settings_set_property, emacs_settings_class_init)
7246 (emacs_settings_init, gsettings_obj): Remove.
7247 (something_changedCB): New function for HAVE_GSETTINGS.
7248 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
7249 with value as argument.
7250 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
7251 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 7252 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
7253 "changed".
7254
7255 * xgselect.c: Add defined (HAVE_GSETTINGS).
7256 (xgselect_initialize): Ditto.
7257
7258 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
7259 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
7260 xg_select.
7261
bbc6b304
PE
72622011-07-01 Paul Eggert <eggert@cs.ucla.edu>
7263
7264 * eval.c (struct backtrace): Simplify and port the data structure.
7265 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
7266 signed bit field, as this assumption is not portable and it makes
7267 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
7268 "char debug_on_exit : 1" as this is not portable either; instead,
7269 use the portable "unsigned int debug_on_exit : 1". Remove unused
7270 member evalargs. Remove obsolete comments about cc bombing out.
7271
9851bfc5
JD
72722011-06-30 Jan Djärv <jan.h.d@swipnet.se>
7273
51bb811f 7274 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
7275 Let HAVE_GSETTINGS override HAVE_GCONF.
7276 (store_monospaced_changed): New function.
7277 (EMACS_SETTINGS): A new type derived from GObject to handle
7278 GSettings notifications.
7279 (emacs_settings_constructor, emacs_settings_get_property)
7280 (emacs_settings_set_property, emacs_settings_class_init):
7281 New functions.
7282 (gsettings_client, gsettings_obj): New variables.
7283 (GSETTINGS_SCHEMA): New define.
7284 (something_changedCB): Call store_monospaced_changed.
7285 (init_gsettings): New function.
7286 (xsettings_initialize): Call init_gsettings.
7287 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
7288 to NULL.
7289
640c8776 7290 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
7291 GCONF_CFLAGS/LIBS.
7292
5386012d
MR
72932011-06-29 Martin Rudalics <rudalics@gmx.at>
7294
7295 * window.c (resize_root_window, grow_mini_window)
7296 (shrink_mini_window): Rename Qresize_root_window to
7297 Qwindow_resize_root_window and Qresize_root_window_vertically to
7298 Qwindow_resize_root_window_vertically.
7299
f13e0b08
PE
73002011-06-28 Paul Eggert <eggert@cs.ucla.edu>
7301
7302 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
7303
94515237
JB
73042011-06-27 Juanma Barranquero <lekktu@gmail.com>
7305
7306 * makefile.w32-in: Redesign dependencies so they reflect more
7307 clearly which files are directly included by each source file,
7308 and not through other includes.
7309
e43b6e43
MR
73102011-06-27 Martin Rudalics <rudalics@gmx.at>
7311
7312 * buffer.c (Qclone_number): Declare static and DEFSYM it.
7313 (sort_overlays, overlay_strings): When an overlay's clone number
7314 matches the window's clone number process the overlay even if
7315 the overlay's window property doesn't match the current window.
7316
d68443dc
MR
7317 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
7318 (Fwindow_hchild): Rename to Fwindow_left_child.
7319 (Fwindow_next): Rename to Fwindow_next_sibling.
7320 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
7321 (resize_window_check): Rename to window_resize_check.
7322 (resize_window_apply): Rename to window_resize_apply.
7323 (Fresize_window_apply): Rename to Fwindow_resize_apply.
7324 (Fdelete_other_windows_internal, resize_frame_windows)
7325 (Fsplit_window_internal, Fdelete_window_internal)
7326 (grow_mini_window, shrink_mini_window)
7327 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 7328
c7e73be5
JD
73292011-06-26 Jan Djärv <jan.h.d@swipnet.se>
7330
7331 * emacsgtkfixed.h: State that this is only used with Gtk+3.
7332 (emacs_fixed_set_min_size): Remove.
7333 (emacs_fixed_new): Take frame as argument.
7334
7335 * emacsgtkfixed.c: State that this is only used with Gtk+3.
7336 (_EmacsFixedPrivate): Remove minwidth/height.
7337 Add struct frame *f.
7338 (emacs_fixed_init): Initialize priv->f.
7339 (get_parent_class, emacs_fixed_set_min_size): Remove.
7340 (emacs_fixed_new): Set priv->f to argument.
7341 (emacs_fixed_get_preferred_width)
7342 (emacs_fixed_get_preferred_height): Use min_width/height from
7343 frames size_hint to set minimum and natural (Bug#8919).
7344 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
7345 and use min_width/height from frames size_hint to set
7346 min_width/height (Bug#8919).
7347
7348 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
7349 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
7350 Fix indentation.
c7e73be5 7351
cf99dcf8
EZ
73522011-06-26 Eli Zaretskii <eliz@gnu.org>
7353
7354 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
7355 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
7356 called at ZV.
7357
029529ac
CY
73582011-06-26 Chong Yidong <cyd@stupidchicken.com>
7359
7360 * process.c (wait_reading_process_output): Bypass select if
7361 waiting for a cell while ignoring keyboard input, and input is
7362 pending. Suggested by Jan Djärv (Bug#8869).
7363
7a7ef429
PE
73642011-06-25 Paul Eggert <eggert@cs.ucla.edu>
7365
7366 Use gnulib's dup2 module instead of rolling our own.
7367 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
7368
11fdef7d 73692011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
7370
7371 * dispnew.c (scrolling_window): Before scrolling, turn off a
7372 mouse-highlight in the window being scrolled.
7373
cd3520a4
JB
73742011-06-24 Juanma Barranquero <lekktu@gmail.com>
7375
7376 Move DEFSYM to lisp.h and use everywhere.
7377
7378 * character.h (DEFSYM): Move declaration...
7379 * lisp.h (DEFSYM): ...here.
7380
7381 * gnutls.c:
7382 * minibuf.c:
7383 * w32menu.c:
7384 * w32proc.c:
7385 * w32select.c: Don't include character.h.
7386
7387 * alloc.c (syms_of_alloc):
7388 * buffer.c (syms_of_buffer):
7389 * bytecode.c (syms_of_bytecode):
7390 * callint.c (syms_of_callint):
7391 * casefiddle.c (syms_of_casefiddle):
7392 * casetab.c (init_casetab_once):
7393 * category.c (init_category_once, syms_of_category):
7394 * ccl.c (syms_of_ccl):
7395 * cmds.c (syms_of_cmds):
7396 * composite.c (syms_of_composite):
7397 * dbusbind.c (syms_of_dbusbind):
7398 * dired.c (syms_of_dired):
7399 * dispnew.c (syms_of_display):
7400 * doc.c (syms_of_doc):
7401 * editfns.c (syms_of_editfns):
7402 * emacs.c (syms_of_emacs):
7403 * eval.c (syms_of_eval):
7404 * fileio.c (syms_of_fileio):
7405 * fns.c (syms_of_fns):
7406 * frame.c (syms_of_frame):
7407 * fringe.c (syms_of_fringe):
7408 * insdel.c (syms_of_insdel):
7409 * keymap.c (syms_of_keymap):
7410 * lread.c (init_obarray, syms_of_lread):
7411 * macros.c (syms_of_macros):
7412 * msdos.c (syms_of_msdos):
7413 * print.c (syms_of_print):
7414 * process.c (syms_of_process):
7415 * search.c (syms_of_search):
7416 * sound.c (syms_of_sound):
7417 * syntax.c (init_syntax_once, syms_of_syntax):
7418 * terminal.c (syms_of_terminal):
7419 * textprop.c (syms_of_textprop):
7420 * undo.c (syms_of_undo):
7421 * w32.c (globals_of_w32):
7422 * window.c (syms_of_window):
7423 * xdisp.c (syms_of_xdisp):
7424 * xfaces.c (syms_of_xfaces):
7425 * xfns.c (syms_of_xfns):
7426 * xmenu.c (syms_of_xmenu):
7427 * xsettings.c (syms_of_xsettings):
7428 * xterm.c (syms_of_xterm): Use DEFSYM.
7429
4228cf16
TZ
74302011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
7431
cd3520a4 7432 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 7433
7fcccf1e
PE
74342011-06-23 Paul Eggert <eggert@cs.ucla.edu>
7435
7efb4e0e
PE
7436 Integer and buffer overflow fixes (Bug#8873).
7437
ff5844ad
PE
7438 * print.c (printchar, strout): Check for string overflow.
7439 (PRINTPREPARE, printchar, strout):
7440 Don't set size unless allocation succeeds.
7441
90532f02
PE
7442 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
7443 for sizes. Check for string overflow more accurately.
7444 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
7445
6d84508d
PE
7446 * macros.c: Integer and buffer overflow fixes.
7447 * keyboard.h (struct keyboard.kbd_macro_bufsize):
7448 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
7449 Use ptrdiff_t, not int, for sizes.
7450 Don't increment bufsize until after realloc succeeds.
7451 Check for size-calculation overflow.
7452 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
7453
437b2cb4
PE
7454 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
7455
8b9ac8b4
PE
7456 * lread.c: Integer overflow fixes.
7457 (read_integer): Radix is now EMACS_INT, not int,
7458 to improve quality of diagnostics for out-of-range radices.
7459 Calculate buffer size correctly for out-of-range radices.
7460 (read1): Check for integer overflow in radices, and in
7461 read-circle numbers.
82cb60d3
PE
7462 (read_escape): Avoid int overflow.
7463 (Fload, openp, read_buffer_size, read1)
7464 (substitute_object_recurse, read_vector, read_list, map_obarray):
7465 Use ptrdiff_t, not int, for sizes.
7466 (read1): Use EMACS_INT, not int, for sizes.
20270765 7467 Check for size overflow.
8b9ac8b4 7468
7fcccf1e
PE
7469 * image.c (cache_image): Check for size arithmetic overflow.
7470
bfbbd7e7
PE
7471 * lread.c: Integer overflow issues.
7472 (saved_doc_string_size, saved_doc_string_length)
7473 (prev_saved_doc_string_size, prev_saved_doc_string_length):
7474 Now ptrdiff_t, not int.
7475 (read1): Don't assume doc string length fits in int. Check for
7476 out-of-range doc string lengths.
7477 (read_list): Don't assume file position fits in int.
39019e54 7478 (read_escape): Check for hex character overflow.
bfbbd7e7 7479
4e323265
LL
74802011-06-22 Leo Liu <sdl.web@gmail.com>
7481
7482 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
7483 Move to minibuffer.el.
7484
85fece3e
PE
74852011-06-22 Paul Eggert <eggert@cs.ucla.edu>
7486
20b84ce9 7487 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
7488 The following patches are for when GLYPH_DEBUG && !XASSERT.
7489 * dispextern.h (trace_redisplay_p, dump_glyph_string):
7490 * dispnew.c (flush_stdout):
7491 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
7492 Mark as externally visible.
7493 * dispnew.c (check_window_matrix_pointers): Now static.
7494 * dispnew.c (window_to_frame_vpos):
7495 * xfns.c (unwind_create_frame):
7496 * xterm.c (x_check_font): Remove unused local.
7497 * scroll.c (CHECK_BOUNDS):
7498 * xfaces.c (cache_fache): Rename local to avoid shadowing.
7499 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
7500 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
7501 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
7502 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
7503 Now static.
7504 (debug_method_add): Use va_list and vsprintf rather than relying
7505 on undefined behavior with wrong number of arguments.
7506 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
7507 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
7508 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
7509 since we're not interested in debugging glyphs with old libraries.
7510 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
7511 GCC 4.6.0's static checking.
7512
0766b489
PE
75132011-06-22 Paul Eggert <eggert@cs.ucla.edu>
7514
31fd4b32
PE
7515 Integer overflow and signedness fixes (Bug#8873).
7516 A few related buffer overrun fixes, too.
7517
b79e8648
PE
7518 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
7519
0766b489
PE
7520 * dispextern.h (struct face.stipple):
7521 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
7522 (x_bitmap_mask, x_allocate_bitmap_record)
7523 (x_create_bitmap_from_data, x_create_bitmap_from_file)
7524 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
7525 (x_create_bitmap_from_xpm_data):
7526 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
7527 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
7528 (.bitmaps_last):
7529 * xfaces.c (load_pixmap):
7530 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
7531 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
7532 (.bitmaps_last, struct x_output.icon_bitmap):
7533 Use ptrdiff_t, not int, for bitmap indexes.
7534 (x_allocate_bitmap_record): Check for size overflow.
7535 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
7536
b081724f
PE
7537 Use ptrdiff_t, not int, for overlay counts.
7538 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
7539 * editfns.c (overlays_around, get_pos_property):
7540 * textprop.c (get_char_property_and_overlay):
7541 * xdisp.c (next_overlay_change, note_mouse_highlight):
7542 * xfaces.c (face_at_buffer_position):
21514da7
PE
7543 * buffer.c (OVERLAY_COUNT_MAX): New macro.
7544 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
7545 (Fnext_overlay_change, Fprevious_overlay_change)
7546 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 7547 Use ptrdiff_t, not int, for sizes.
21514da7 7548 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 7549
3de73e5e
PE
7550 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
7551
2606c57b
PE
7552 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
7553 (x_session_initialize): Do not assume string length fits in int.
7554
aaafe47a
PE
7555 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
7556 This is unlikely, but can occur if DPI is outlandish.
7557
2674ddc8 7558 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
7559 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
7560
28154962
PE
7561 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
7562 * xrdb.c (magic_file_p, search_magic_path):
7563 Omit last arg SUFFIX; it was always 0. All callers changed.
7564 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
7565
7de51af5
PE
7566 * xfont.c (xfont_match): Avoid need for strlen.
7567
25ed6cc3
PE
7568 * xfns.c: Don't assume strlen fits in int.
7569 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
7570
4eab31dd
PE
7571 * xdisp.c (message_log_check_duplicate): Return intmax_t,
7572 not unsigned long, as we prefer signed integers. All callers changed.
7573 Detect integer overflow in repeat count.
7574 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 7575 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 7576
171e2a58
PE
7577 * termcap.c: Don't assume sizes fit in int and never overflow.
7578 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
7579 (gobble_line): Check for size-calculation overflow.
7580
ad39faca 7581 * minibuf.c (Fread_buffer):
6e5bb2dc 7582 * lread.c (intern, intern_c_string):
74ca2eb3
PE
7583 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
7584 Don't assume string length fits in int.
7585
52c61c22 7586 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
7587 * gtkutil.c (style_changed_cb): Avoid need for strlen.
7588
b5b8c9e5
PE
7589 * font.c: Don't assume string length fits in int.
7590 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
7591 Use ptrdiff_t, not int.
ccd6111c
PE
7592 (font_intern_prop): Don't assume string length fits in int.
7593 Don't assume integer property fits in fixnum.
7594 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 7595
882f0d81 7596 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 7597 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
7598 Reformulate so as not to need the command string.
7599 Invoke gzip -cd rather than gunzip, as it's more portable.
7600 (lock_info_type, lock_file_1, lock_file):
7601 Don't assume pid_t and time_t fit in unsigned long.
7602 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
7603 (current_lock_owner): Prefer signed type for sizes.
7604 Use memcpy, not strncpy, where memcpy is what is really wanted.
7605 Don't assume (via atoi) that time_t and pid_t fit in int.
7606 Check for time_t and/or pid_t out of range, e.g., via a network share.
7607 Don't alloca where an auto var works fine.
7608
93f4cf88
PE
7609 * fileio.c: Fix some integer overflow issues.
7610 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
7611 Don't assume string length fits in int.
7612 (directory_file_name): Don't assume string length fits in long.
7613 (make_temp_name): Don't assume pid fits in int, or that its print
7614 length is less than 20.
7615
f3e92b69
PE
7616 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
7617
1bfdaf10
PE
7618 * coding.c (make_subsidiaries): Don't assume string length fits in int.
7619
35016e9a
PE
7620 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
7621
3d1e65a1
PE
7622 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
7623 We prefer signed integers, even for size calculations.
7624
0b963a93
PE
7625 * emacs.c: Don't assume string length fits in 'int'.
7626 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
7627 (main): Don't invoke strlen when not needed.
7628
573f4b54
PE
7629 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
7630 (XD_DEBUG_MESSAGE): Don't waste a byte.
7631
989f33ba
PE
7632 * callproc.c (getenv_internal_1, getenv_internal)
7633 (Fgetenv_internal):
965d34eb
PE
7634 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
7635
e4d29b33
PE
7636 * lread.c (invalid_syntax): Omit length argument.
7637 All uses changed. This doesn't fix a bug, but it simplifies the
7638 code away from its former Hollerith-constant appearance, and it's
7639 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 7640 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 7641
eb49b136
PE
7642 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
7643 This didn't break anything, but it didn't help either.
7644 It's confusing to put a bogus integer in a place where the actual
7645 value does not matter.
9f62aeb1 7646 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 7647 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 7648
15375a22
PE
7649 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
7650 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
7651 implementation.
b61cc01c
PE
7652 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
7653 We prefer signed types, and the value cannot exceed the EMACS_INT
7654 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
7655 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
7656 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
7657 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 7658
53b2623d
PE
7659 * indent.c (sane_tab_width): New function.
7660 (current_column, scan_for_column, Findent_to, position_indentation)
7661 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 7662 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 7663
51cab52b 7664 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 7665
f2ed8a70
PE
7666 * lisp.h (lint_assume): New macro.
7667 * composite.c (composition_gstring_put_cache):
7668 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
7669
abe80cc6
PE
7670 * editfns.c, insdel.c:
7671 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 7672
b02c740e
PE
7673 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
7674
ebc96716
PE
7675 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
7676
b4e50fa0 7677 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 7678 Use much-faster test for byte-length change.
311d5d7c 7679 Don't assume string byte-length fits in 'int'.
a4cf38e4 7680 Check that character arg fits in 'int'.
85461888 7681 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 7682
c0c1ee9f
PE
7683 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
7684
a498d7f4
PE
7685 * fns.c (concat): Catch string overflow earlier.
7686 Do not rely on integer wraparound.
7687
51cab52b
PE
7688 * dispextern.h (struct it.overlay_strings_charpos)
7689 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
7690 * xdisp.c (forward_to_next_line_start)
7691 (back_to_previous_visible_line_start)
7692 (reseat_at_next_visible_line_start, next_element_from_buffer):
7693 Don't arbitrarily truncate the value of 'selective' to int.
7694
76031fad
PE
7695 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
7696
5eb55db9
PE
7697 * composite.c: Don't truncate sizes to 'int'.
7698 (composition_gstring_p, composition_reseat_it)
7699 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
7700 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
7701 not EMACS_UINT, for indexes.
5eb55db9 7702
0703a717
PE
7703 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
7704
d6202519
PE
7705 * buffer.c: Include <verify.h>.
7706 (struct sortvec.priority, struct sortstr.priority):
8961a454 7707 Now EMACS_INT, not int.
c20998a7 7708 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
7709 (struct sortstr.size, record_overlay_string)
7710 (struct sortstrlist.size, struct sortlist.used):
7711 Don't truncate size to int.
7712 (record_overlay_string): Check for size-calculation overflow.
d6202519 7713 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 7714
d5a19415
JM
77152011-06-22 Jim Meyering <meyering@redhat.com>
7716
029529ac 7717 Don't leak an XBM-image-sized buffer
d5a19415
JM
7718 * image.c (xbm_load): Free the image buffer after using it.
7719
a9041e6c
PE
77202011-06-21 Paul Eggert <eggert@cs.ucla.edu>
7721
7722 Port to Sun C.
7723 * composite.c (find_automatic_composition): Omit needless 'return 0;'
7724 that Sun C diagnosed.
7725 * fns.c (secure_hash): Fix pointer signedness issue.
7726 * intervals.c (static_offset_intervals): New function.
7727 (offset_intervals): Use it.
7728
7f3f739f
LL
77292011-06-21 Leo Liu <sdl.web@gmail.com>
7730
7731 * deps.mk (fns.o):
7732 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
7733 sha512.h.
7734
7735 * fns.c (secure_hash): Rename from crypto_hash_function and change
7736 the first arg to accept symbols.
5b66d427 7737 (Fsecure_hash): New primitive.
7f3f739f
LL
7738 (syms_of_fns): New symbols.
7739
76147d94
DD
77402011-06-20 Deniz Dogan <deniz@dogan.se>
7741
7742 * process.c (Fset_process_buffer): Clarify return value in
7743 docstring.
7744
7d7d0045
CY
77452011-06-18 Chong Yidong <cyd@stupidchicken.com>
7746
7747 * dispnew.c (add_window_display_history): Use BVAR.
7748
7749 * xdisp.c (debug_method_add): Use BVAR.
7750 (check_window_end, dump_glyph_matrix, dump_glyph)
7751 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
7752
7753 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
7754 Likewise.
7755
7756 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
7757 check till after the cache is created in init_frame_faces.
7758
ff2bc410
SM
77592011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
7760
7761 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
7762
28177add
PE
77632011-06-16 Paul Eggert <eggert@cs.ucla.edu>
7764
dd3482fe
PE
7765 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
7766 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
7767 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
7768
393d71f3 7769 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
7770 * fileio.c (Finsert_file_contents):
7771 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
7772 Remove the old (too-loose) buffer overflow checks.
7773 They weren't needed, since make_gap checks for buffer overflow.
7774 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
7775 The old code merely checked for Emacs fixnum overflow, and relied
7776 on undefined (wraparound) behavior. The new code avoids undefined
7777 behavior, and also checks for ptrdiff_t and/or size_t overflow.
7778
2e6813b0 7779 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
7780 Tune. Don't use wider integers than needed. Don't use alloca.
7781 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 7782
599a9e4f
PE
7783 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
7784
99561444
PE
7785 * insdel.c, lisp.h (buffer_overflow): New function.
7786 (insert_from_buffer_1, replace_range, replace_range_2):
7787 * insdel.c (make_gap_larger):
7788 * editfns.c (Finsert_char):
7789 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
7790
28177add
PE
7791 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
7792
e69dafad
PE
77932011-06-15 Paul Eggert <eggert@cs.ucla.edu>
7794
4baa020d 7795 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 7796
b1c46f02
PE
7797 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
7798 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
7799
e69dafad
PE
7800 * fileio.c: Don't assume EMACS_INT fits in off_t.
7801 (emacs_lseek): New static function.
7802 (Finsert_file_contents, Fwrite_region): Use it.
7803 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
7804
566684ea
PE
7805 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
7806
e6966cd6
PE
7807 * fns.c: Don't overflow int when computing a list length.
7808 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
7809 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
7810 truncation on 64-bit hosts. Check for QUIT every
7811 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
7812 faster and is responsive enough.
7813 (Flength): Report an error instead of overflowing an integer.
7814 (Fsafe_length): Return a float if the value is not representable
7815 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 7816 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 7817 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 7818
dd0b0efb
PE
7819 * alloc.c: Check that resized vectors' lengths fit in fixnums.
7820 (header_size, word_size): New constants.
7821 (allocate_vectorlike): Don't check size overflow here.
7822 (allocate_vector): Check it here instead, since this is the only
7823 caller of allocate_vectorlike that could cause overflow.
7824 Check that the new vector's length is representable as a fixnum.
7825
86fe5cfe
PE
7826 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
7827 The previous code was bogus. For example, next_almost_prime (32)
7828 returned 39, which is undesirable as it is a multiple of 3; and
7829 next_almost_prime (24) returned 25, which is a multiple of 5 so
7830 why was the code bothering to check for multiples of 7?
7831
80e88859
PE
7832 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
7833
4a2f0ad6
PE
7834 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
7835
f66c7cf8
PE
7836 Variadic C functions now count arguments with ptrdiff_t.
7837 This partly undoes my 2011-03-30 change, which replaced int with size_t.
7838 Back then I didn't know that the Emacs coding style prefers signed int.
7839 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
7840 were being counted with int, which may truncate counts on 64-bit
7841 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
7842 * lisp.h (struct Lisp_Subr.function.aMANY)
7843 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
7844 Arg counts are now ptrdiff_t, not size_t.
7845 All variadic functions and their callers changed accordingly.
7846 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
7847 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
7848 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
7849 * callint.c (Fcall_interactively): Check arg count for overflow,
7850 to avoid potential buffer overrun. Use signed char, not 'int',
7851 for 'varies' array, so that we needn't bother to check its size
7852 calculation for overflow.
7853 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
7854 * eval.c (apply_lambda):
7855 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
7856 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
7857 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
7858
a1759b76
PE
7859 * callint.c (Fcall_interactively): Don't use index var as event count.
7860
d96be9fc
PE
7861 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
7862 * mem-limits.h (SIZE): Remove; no longer used.
7863
a690a978 7864 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 7865
578c21e6
PE
7866 Remove unnecessary casts.
7867 * xterm.c (x_term_init):
7868 * xfns.c (x_set_border_pixel):
7869 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
7870 These aren't needed now that we assume ANSI C.
7871
96f53c6c
PE
7872 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
7873 It's more likely to cause problems (due to unsigned overflow)
7874 than to cure them.
7875
83c77d31
PE
7876 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
7877
ee2079f1
PE
7878 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
7879
6da65536
PE
7880 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
7881
7147c4a4
PE
7882 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
7883
193e32d9
PE
7884 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
7885
e5533da6
PE
7886 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
7887
9910e595
PE
7888 GLYPH_CODE_FACE returns EMACS_INT, not int.
7889 * dispextern.h (merge_faces):
7890 * xfaces.c (merge_faces):
01103c44
PE
7891 * xdisp.c (get_next_display_element, next_element_from_display_vector):
7892 Don't assume EMACS_INT fits in int.
9910e595 7893
2638320e
PE
7894 * character.h (CHAR_VALID_P): Remove unused parameter.
7895 * fontset.c, lisp.h, xdisp.c: All uses changed.
7896
045eb8d9
PE
7897 * editfns.c (Ftranslate_region_internal): Omit redundant test.
7898
c1f134b5
PE
7899 * fns.c (concat): Minor tuning based on overflow analysis.
7900 This doesn't fix any bugs. Use int to hold character, instead
7901 of constantly refetching from Emacs object. Use XFASTINT, not
7902 XINT, for value known to be a character. Don't bother comparing
7903 a single byte to 0400, as it's always less.
7904
395fcb93 7905 * floatfns.c (Fexpt):
327eeec8
PE
7906 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
7907
abbd3d23
PE
7908 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
7909 for characters.
7910
684a03ef
PE
7911 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
7912
0fed43f3
PE
7913 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
7914 Without this fix, on a 64-bit host (aset S 0 4294967386) would
7915 incorrectly succeed when S was a string, because 4294967386 was
7916 truncated before it was used.
7917
8fd02eb7
PE
7918 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
7919 Otherwise, an out-of-range integer could cause undefined behavior
7920 on a 64-bit host.
7921
f8c86b69
PE
7922 * composite.c: Use int, not EMACS_INT, for characters.
7923 (fill_gstring_body, composition_compute_stop_pos): Use int, not
7924 EMACS_INT, for values that are known to be in character range.
7925 This doesn't fix any bugs but is the usual style inside Emacs and
7926 may generate better code on 32-bit machines.
7927
34206dd2
PE
7928 Make sure a 64-bit char is never passed to ENCODE_CHAR.
7929 This is for reasons similar to the recent CHAR_STRING fix.
7930 * charset.c (Fencode_char): Check that character arg is actually
7931 a character. Pass an int to ENCODE_CHAR.
7932 * charset.h (ENCODE_CHAR): Verify that the character argument is no
7933 wider than 'int', as a compile-time check to prevent future regressions
7934 in this area.
7935
c5958d4c 7936 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
7937
7938 Make sure a 64-bit char is never passed to CHAR_STRING.
7939 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
7940 by silently ignoring the top 32 bits, allowing some values
7941 that were far too large to be valid characters.
7942 * character.h: Include <verify.h>.
7943 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
7944 arguments are no wider than unsigned, as a compile-time check
7945 to prevent future regressions in this area.
7946 * data.c (Faset):
01103c44 7947 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
7948 (Fsubst_char_in_region):
7949 * fns.c (concat):
7950 * xdisp.c (decode_mode_spec_coding):
7951 Adjust to CHAR_STRING's new requirement.
7952 * editfns.c (Finsert_char, Fsubst_char_in_region):
7953 * fns.c (concat): Check that character args are actually
7954 characters. Without this test, these functions did the wrong
7955 thing with wildly out-of-range values on 64-bit hosts.
7956
d37ca623
PE
7957 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
7958 These casts should not be needed on 32-bit hosts, either.
7959 * keyboard.c (read_char):
7960 * lread.c (Fload): Remove casts to unsigned.
7961
ea204efb
PE
7962 * lisp.h (UNSIGNED_CMP): New macro.
7963 This fixes comparison bugs on 64-bit hosts.
7964 (ASCII_CHAR_P): Use it.
7965 * casefiddle.c (casify_object):
01103c44 7966 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
7967 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
7968 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
7969 * dispextern.h (FACE_FROM_ID):
7970 * keyboard.c (read_char): Use UNSIGNED_CMP.
7971
41cb286c
PE
7972 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
7973 not to EMACS_INT, to avoid GCC warning.
7974
4a1b9832
PE
7975 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
7976
55daad71
PE
7977 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
7978 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
7979 isn't needed on 32-bit machines.
8f95c75c 7980
01103c44
PE
7981 * buffer.c (Fgenerate_new_buffer_name):
7982 Use EMACS_INT for count, not int.
0ceccced 7983 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
7984
7985 * data.c (Qcompiled_function): Now static.
7986
c6f072e7
PE
7987 * window.c (window_body_lines): Now static.
7988
20ce5912
PE
7989 * image.c (gif_load): Rename local to avoid shadowing.
7990
9c4c5f81
PE
7991 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
7992 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
7993 * alloc.c (make_save_value): Integer argument is now of type
7994 ptrdiff_t, not int.
7995 (mark_object): Use ptrdiff_t, not int.
7996 * lisp.h (pD): New macro.
7997 * print.c (print_object): Use it.
7998
c0c5c8ae
PE
7999 * alloc.c: Use EMACS_INT, not int, to count objects.
8000 (total_conses, total_markers, total_symbols, total_vector_size)
8001 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
8002 (total_free_floats, total_floats, total_free_intervals)
8003 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
8004 Now EMACS_INT, not int. All uses changed.
8005 (Fgarbage_collect): Compute overall total using a double, so that
8006 integer overflow is less likely to be a problem. Check for overflow
8007 when converting back to an integer.
5a25e253
PE
8008 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
8009 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
8010 These were 'int' variables that could overflow on 64-bit hosts;
8011 they were never used, so remove them instead of repairing them.
211a0b2a 8012 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
8013 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
8014 Previously, this ceilinged at INT_MAX, but that doesn't work on
8015 64-bit machines.
e46bb31a 8016 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 8017
c78baabf 8018 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 8019 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
8020 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
8021 when a (possibly-narrower) signed value would do just as well.
8022 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 8023
c9d624c6
PE
8024 * alloc.c: Catch some string size overflows that we were missing.
8025 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
8026 for convenience in STRING_BYTES_MAX.
8027 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
8028 The definition here is exact; the one in lisp.h was approximate.
8029 (allocate_string_data): Check for string overflow. This catches
8030 some instances we weren't catching before. Also, it catches
8031 size_t overflow on (unusual) hosts where SIZE_MAX <= min
8032 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
8033 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 8034
c9d624c6
PE
8035 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
8036 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 8037 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 8038
353032ce
PE
8039 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
8040
2bccce07
PE
8041 * alloc.c (Fmake_string): Check for out-of-range init.
8042
0ac30604
SM
80432011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
8044
8045 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
8046
c195f2de
JD
80472011-06-14 Jan Djärv <jan.h.d@swipnet.se>
8048
8049 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
8050 xg_get_default_scrollbar_width.
8051
8052 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
8053 (int_gtk_range_get_value): Move to the scroll bar part of the file.
8054 (style_changed_cb): Call update_theme_scrollbar_width and call
8055 x_set_scroll_bar_default_width and xg_frame_set_char_size for
8056 all frames (Bug#8505).
8057 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
8058 Call gtk_window_set_resizable if HAVE_GTK3.
8059 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
8060 and height if HAVE_GTK3 (Bug#8505).
8061 (scroll_bar_width_for_theme): New variable.
8062 (update_theme_scrollbar_width): New function.
8063 (xg_get_default_scrollbar_width): Move code to
8064 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
8065 (xg_initialize): Call update_theme_scrollbar_width.
8066
8067 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
8068
8069 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
8070
e10ac9f1
MR
80712011-06-12 Martin Rudalics <rudalics@gmx.at>
8072
8073 * frame.c (make_frame): Call other_buffer_safely instead of
8074 other_buffer.
8075
8076 * window.c (temp_output_buffer_show): Call display_buffer with
8077 second argument Vtemp_buffer_show_specifiers and reset latter
8078 immediately after the call.
8079 (Vtemp_buffer_show_specifiers): New variable.
8080 (auto_window_vscroll_p, next_screen_context_lines)
8081 (Vscroll_preserve_screen_position): Remove leading asterisks from
8082 doc-strings.
8083
2d3c217e 80842011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 8085
7b7f97e8 8086 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
8087 * buffer.c (Qclone_number): Remove for now, as it's unused.
8088 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
8089 (record_buffer): Remove unused local.
8090 * frame.c (other_visible_frames, frame_buffer_list): Now static.
8091 (set_frame_buffer_list): Remove; unused.
8092 * frame.h (other_visible_frames): Remove decl.
8093 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
8094 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
8095 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
8096 if HAVE_GPM.
8097 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
8098 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
8099 Define only if HAVE_GPM.
8100 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
8101 (update_hints_inhibit): Remove; never set. All uses removed.
8102 * widgetprv.h (emacsFrameClassRec): Remove decl.
8103 * window.c (delete_deletable_window): Now returns void, since it
8104 wasn't returning anything.
8105 (compare_window_configurations): Remove unused locals.
8106 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
8107 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
8108 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
8109 the same widths as pointers. This follows up on the 2011-05-06 patch.
8110 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
8111 * xterm.h: Likewise.
8112 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
8113
1384b89e
JB
81142011-06-12 Juanma Barranquero <lekktu@gmail.com>
8115
8116 * makefile.w32-in: Update dependencies.
8117 (LISP_H): Add lib/intprops.h.
8118
1100a63c
CY
81192011-06-11 Chong Yidong <cyd@stupidchicken.com>
8120
8121 * image.c (gif_load): Add animation frame delay to the metadata.
8122 (syms_of_image): Use DEFSYM. New symbol `delay'.
8123
6198ccd0
MR
81242011-06-11 Martin Rudalics <rudalics@gmx.at>
8125
8126 * window.c (delete_deletable_window): Re-add.
8127 (Fset_window_configuration): Rewrite to handle dead buffers and
8128 consequently deletable windows.
8129 (window_tree, Fwindow_tree): Remove. Supply functionality in
8130 window.el.
8131 (compare_window_configurations): Simplify code.
8132
b6e3633c
AS
81332011-06-11 Andreas Schwab <schwab@linux-m68k.org>
8134
1ab0dee5
AS
8135 * image.c (imagemagick_load_image): Fix type mismatch.
8136 (Fimagemagick_types): Likewise.
8137
b6e3633c
AS
8138 * window.h (replace_buffer_in_windows): Declare.
8139
9397e56f
MR
81402011-06-11 Martin Rudalics <rudalics@gmx.at>
8141
8142 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
8143 Qclone_number. Remove external declaration of Qdelete_window.
8144 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
8145 code.
640c8776
SM
8146 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
8147 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
8148 (Fother_buffer): Rewrite doc-string. Major rewrite for new
8149 buffer list implementation.
8150 (other_buffer_safely): New function.
8151 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
8152 calls to replace_buffer_in_windows and
8153 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
8154 if allowed.
8155 (record_buffer): Inhibit quitting and rewrite using quittable
8156 functions. Run Qbuffer_list_update_hook if allowed.
8157 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
8158 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
8159 Move switch-to-buffer to window.el.
9397e56f
MR
8160 (bury-buffer): Move to window.el.
8161 (Vbuffer_list_update_hook): New variable.
8162
8163 * lisp.h (other_buffer_safely): Add prototype in buffer.c
8164 section.
8165
8166 * window.h (resize_frame_windows): Move up in code.
8167 (Fwindow_frame): Remove EXFUN.
8168 (replace_buffer_in_all_windows): Remove prototype.
8169 (replace_buffer_in_windows_safely): Add prototype.
8170
8171 * window.c: Declare Qdelete_window static again. Move down
8172 declaration of select_count.
8173 (Fnext_window, Fprevious_window): Rewrite doc-strings.
8174 (Fother_window): Move to window.el.
8175 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
8176 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
8177 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
8178 window.el.
8179 (replace_buffer_in_windows): Implement by calling
8180 Qreplace_buffer_in_windows.
8181 (replace_buffer_in_all_windows): Remove with some functionality
8182 moved into replace_buffer_in_windows_safely.
8183 (replace_buffer_in_windows_safely): New function.
8184 (select_window_norecord, select_frame_norecord): Move in front
8185 of run_window_configuration_change_hook. Remove now obsolete
8186 declarations.
640c8776
SM
8187 (Fset_window_buffer): Rewrite doc-string.
8188 Call Qrecord_window_buffer.
9397e56f
MR
8189 (keys_of_window): Move binding for other-window to window.el.
8190
b50691aa
CY
81912011-06-11 Chong Yidong <cyd@stupidchicken.com>
8192
8193 * dispextern.h (struct image): Replace data member, whose int_val
8194 and ptr_val fields were not used by anything, with a single
8195 lisp_val object.
8196
8197 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
8198 (gif_clear_image, gif_load, imagemagick_load_image)
8199 (gs_clear_image, gs_load): Callers changed.
8200
3f754b86
PE
82012011-06-10 Paul Eggert <eggert@cs.ucla.edu>
8202
cca69397
PE
8203 * buffer.h: Include <time.h>, for time_t.
8204 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
8205
109e28d0
PE
8206 Fix minor problems found by static checking.
8207
60737f02
PE
8208 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
8209
4b66faf3
PE
8210 Make identifiers static if they are not used in other modules.
8211 * data.c (Qcompiled_function, Qframe, Qvector):
8212 * image.c (QimageMagick, Qsvg):
8213 * minibuf.c (Qmetadata):
8214 * window.c (resize_window_check, resize_root_window): Now static.
8215 * window.h (resize_window_check, resize_root_window): Remove decls.
8216
109e28d0
PE
8217 * window.c (window_deletion_count, delete_deletable_window):
8218 Remove; unused.
46a4ce9e
PE
8219 (window_body_lines): Now static.
8220 (Fdelete_other_windows_internal): Mark vars as initialized.
8221 Make sure 'resize_failed' is initialized.
8222 (run_window_configuration_change_hook): Rename local to avoid shadowing.
8223 (resize_window_apply): Remove unused local.
8224 * window.h (delete_deletable_window): Remove decl.
8225
109e28d0 8226 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
8227 (imagemagick_load_image): Fix pointer signedness problem by changing
8228 last arg from unsigned char * to char *. All uses changed.
8229 Also, fix a local for similar reasons.
8230 Remove unused locals. Remove locals to avoid shadowing.
8231 (fn_rsvg_handle_free): Remove; unused.
8232 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 8233 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 8234
3f754b86
PE
8235 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
8236
2547adb1
CY
82372011-06-10 Chong Yidong <cyd@stupidchicken.com>
8238
8239 * image.c (gif_load): Fix omitted cast error introduced by
8240 2011-06-06 change.
8241
2c8e37d4
MR
82422011-06-10 Martin Rudalics <rudalics@gmx.at>
8243
8244 * window.h (resize_proportionally, orig_total_lines)
8245 (orig_top_line): Remove from window structure.
8246 (set_window_height, set_window_width, change_window_heights)
8247 (Fdelete_window): Remove prototypes.
8248 (resize_frame_windows): Remove duplicate declaration.
8249
440a42e3
EZ
82502011-06-10 Eli Zaretskii <eliz@gnu.org>
8251
8252 * window.h (resize_frame_windows, resize_window_check)
8253 (delete_deletable_window, resize_root_window)
8254 (resize_frame_windows): Declare prototypes.
8255
8256 * window.c (resize_window_apply): Make definition be "static" to
8257 match the prototype.
8258
562dd5e9
MR
82592011-06-10 Martin Rudalics <rudalics@gmx.at>
8260
8261 * window.c: Remove declarations of Qwindow_size_fixed,
8262 window_min_size_1, window_min_size_2, window_min_size,
8263 size_window, window_fixed_size_p, enlarge_window, delete_window.
8264 Remove static from declaration of Qdelete_window, it's
8265 temporarily needed by Fbury_buffer.
8266 (replace_window): Don't assign orig_top_line and
8267 orig_total_lines.
8268 (Fdelete_window, delete_window): Remove. Window deletion is
8269 handled by window.el.
640c8776
SM
8270 (window_loop): Remove DELETE_OTHER_WINDOWS case.
8271 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
8272 (Fdelete_other_windows): Remove. Deleting other windows is
8273 handled by window.el.
8274 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
8275 handled in window.el.
8276 (window_min_size_2, window_min_size_1, window_min_size): Remove.
8277 Window minimum sizes are handled in window.el.
8278 (shrink_windows, size_window, set_window_height)
8279 (set_window_width, change_window_heights, window_height)
8280 (window_width, CURBEG, CURSIZE, enlarge_window)
8281 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
8282 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
8283 handled in window.el.
8284 (make_dummy_parent): Rename to make_parent_window and give it a
8285 second argument horflag.
8286 (make_window): Don't set resize_proportionally any more.
8287 (Fsplit_window): Remove. Windows are split in window.el.
8288 (save_restore_action, save_restore_orig_size)
8289 (shrink_window_lowest_first, save_restore_orig_size): Remove.
8290 Resize mini windows in window.el.
8291 (grow_mini_window, shrink_mini_window): Implement by calling
8292 Qresize_root_window_vertically, resize_window_check and
8293 resize_window_apply.
640c8776
SM
8294 (saved_window, Fset_window_configuration, save_window_save):
8295 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
8296 resize_proportionally.
8297 (window_min_height, window_min_width): Move to window.el.
8298 (keys_of_window): Move bindings for delete-other-windows,
8299 split-window, delete-window and enlarge-window to window.el.
8300
8301 * buffer.c: Temporarily extern Qdelete_window.
8302 (Fbury_buffer): Temporarily call Qdelete_window instead of
8303 Fdelete_window (Fbury_buffer will move to window.el soon).
8304
8305 * frame.c (set_menu_bar_lines_1): Remove code handling
8306 orig_top_line and orig_total_lines.
8307
8308 * dispnew.c (adjust_frame_glyphs_initially): Don't use
8309 set_window_height but set heights directly.
8310 (change_frame_size_1): Use resize_frame_windows.
8311
8312 * xdisp.c (init_xdisp): Don't use set_window_height but set
8313 heights directly.
8314
640c8776
SM
8315 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
8316 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
8317 run_window_configuration_change_hook.
8318
8319 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
8320 instead of change_window_heights and run
8321 run_window_configuration_change_hook.
8322
1a13852e
MR
83232011-06-09 Martin Rudalics <rudalics@gmx.at>
8324
8325 * window.c (replace_window): Rename second argument REPLACEMENT to
8326 NEW. New third argument SETFLAG. Rewrite.
8327 (delete_window, make_dummy_parent): Call replace_window with
8328 third argument 1.
8329 (window_list_1): Move down in code.
8330 (run_window_configuration_change_hook): Move set_buffer part
8331 before select_frame_norecord part in order to unwind correctly.
8332 Rename count1 to count.
8333 (recombine_windows, delete_deletable_window, resize_root_window)
8334 (Fdelete_other_windows_internal)
8335 (Frun_window_configuration_change_hook, make_parent_window)
8336 (resize_window_check, resize_window_apply, Fresize_window_apply)
8337 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
8338 (Fdelete_window_internal, Fresize_mini_window_internal):
8339 New functions.
1a13852e
MR
8340 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
8341
f3d1777e
MR
83422011-06-08 Martin Rudalics <rudalics@gmx.at>
8343
496e208e
MR
8344 * window.h (window): Add some new members to window structure -
8345 normal_lines, normal_cols, new_total, new_normal, clone_number,
8346 splits, nest, prev_buffers, next_buffers.
8347 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 8348 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 8349
f3d1777e
MR
8350 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
8351 Remove.
496e208e
MR
8352 (make_dummy_parent): Set new members of windows structure.
8353 (make_window): Move down in code. Handle new members of window
8354 structure.
8355 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
8356 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
8357 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
8358 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
8359 (Fset_window_next_buffers, Fset_window_clone_number):
8360 New functions.
496e208e
MR
8361 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
8362 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
8363 Doc-string fixes.
8364 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
8365 Argument WINDOW can be now internal window too.
8366 (Fwindow_use_time): Move up in code.
8367 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
8368 Rewrite doc-string.
8369 (Fset_window_configuration, saved_window)
8370 (Fcurrent_window_configuration, save_window_save): Handle new
8371 members of window structure.
b9e809c2
MR
8372 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
8373 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
8374 (syms_of_window): New Lisp objects Qrecord_window_buffer,
8375 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
8376 Qget_mru_window, Qresize_root_window,
8377 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
8378 Qauto_buffer_name; staticpro them.
f3d1777e 8379
abde8f8c
MR
83802011-06-07 Martin Rudalics <rudalics@gmx.at>
8381
8382 * window.c (Fwindow_total_size, Fwindow_left_column)
8383 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
8384 (Fwindow_list_1): New functions.
8385 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
8386 (Fwindow_width, Fscroll_left, Fscroll_right):
8387 Use window_body_cols instead of window_box_text_cols.
8388 (delete_window, Fset_window_configuration):
8389 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
8390 (delete_all_subwindows): Take a window as argument and not a
8391 structure. Rewrite.
190b47e6
MR
8392 (window_loop): Remove handling of GET_LRU_WINDOW and
8393 GET_LARGEST_WINDOW.
8394 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
8395
8396 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
8397 window_box_text_cols. delete_all_subwindows now takes a
8398 Lisp_Object as argument.
abde8f8c 8399
640c8776
SM
8400 * indent.c (compute_motion, Fcompute_motion):
8401 Use window_body_cols instead of window_box_text_cols.
abde8f8c 8402
fa8a67e6
MR
8403 * frame.c (delete_frame): Call delete_all_subwindows with root
8404 window as argument.
8405
a54e3482
DC
84062011-06-07 Daniel Colascione <dan.colascione@gmail.com>
8407
8408 * fns.c (Fputhash): Document return value.
8409
60002bf5
CY
84102011-06-06 Chong Yidong <cyd@stupidchicken.com>
8411
8412 * image.c (gif_load): Implement gif89a spec "no disposal" method.
8413
0c671da6 84142011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 8415
b862a52a 8416 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 8417
be44ca6c
PE
8418 Check for overflow when converting integer to cons and back.
8419 * charset.c (Fdefine_charset_internal, Fdecode_char):
8420 Use cons_to_unsigned to catch overflow.
8421 (Fencode_char): Use INTEGER_TO_CONS.
8422 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
8423 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
8424 * data.c (long_to_cons, cons_to_long): Remove.
8425 (cons_to_unsigned, cons_to_signed): New functions.
8426 These signal an error for invalid or out-of-range values.
8427 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
8428 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
8429 * font.c (Ffont_variation_glyphs):
8430 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
8431 * lisp.h: Include <intprops.h>.
8432 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
8433 (cons_to_signed, cons_to_unsigned): New decls.
8434 (long_to_cons, cons_to_long): Remove decls.
8435 * undo.c (record_first_change): Use INTEGER_TO_CONS.
8436 (Fprimitive_undo): Use CONS_TO_INTEGER.
8437 * xfns.c (Fx_window_property): Likewise.
8438 * xselect.c: Include <limits.h>.
8439 (x_own_selection, selection_data_to_lisp_data):
8440 Use INTEGER_TO_CONS.
8441 (x_handle_selection_request, x_handle_selection_clear)
8442 (x_get_foreign_selection, Fx_disown_selection_internal)
8443 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
8444 (lisp_data_to_selection_data): Use cons_to_unsigned.
8445 (x_fill_property_data): Use cons_to_signed.
8446 Report values out of range.
8447
d1f3d2af
PE
8448 Check for buffer and string overflow more precisely.
8449 * buffer.h (BUF_BYTES_MAX): New macro.
8450 * lisp.h (STRING_BYTES_MAX): New macro.
8451 * alloc.c (Fmake_string):
8452 * character.c (string_escape_byte8):
8453 * coding.c (coding_alloc_by_realloc):
8454 * doprnt.c (doprnt):
8455 * editfns.c (Fformat):
8456 * eval.c (verror):
8457 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
8458 since they may not be the same number.
8459 * editfns.c (Finsert_char):
8460 * fileio.c (Finsert_file_contents):
8461 Likewise for BUF_BYTES_MAX.
8462
dd52fcea
PE
8463 * image.c: Use ptrdiff_t, not int, for sizes.
8464 (slurp_file): Switch from int to ptrdiff_t.
8465 All uses changed.
8466 (slurp_file): Check that file size fits in both size_t (for
8467 malloc) and ptrdiff_t (for sanity and safety).
8468
7f9bbdbb
PE
8469 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
8470 if b->modtime has its maximal value.
8471
dfe18f82
PE
8472 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
8473
84acfcf0
PE
8474 Don't assume time_t can fit into int.
8475 * buffer.h (struct buffer.modtime): Now time_t, not int.
8476 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
8477 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
8478
ccd9a01a
PE
8479 Minor fixes for signed vs unsigned integers.
8480 * character.h (MAYBE_UNIFY_CHAR):
8481 * charset.c (maybe_unify_char):
8482 * keyboard.c (read_char, reorder_modifiers):
8483 XINT -> XFASTINT, since the integer must be nonnegative.
8484 * ftfont.c (ftfont_spec_pattern):
8485 * keymap.c (access_keymap, silly_event_symbol_error):
8486 XUINT -> XFASTINT, since the integer must be nonnegative.
8487 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
8488 since it makes no difference and we prefer signed.
8489 * keyboard.c (record_char): Use XUINT when all the neighbors do.
8490 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
8491 nonnegative.
8492
d6d100dd
SM
84932011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
8494
8495 * window.h (Fwindow_frame): Declare.
8496
2b6148e4
PE
84972011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8498
8499 * alloc.c: Simplify handling of large-request failures (Bug#8800).
8500 (SPARE_MEMORY): Always define.
8501 (LARGE_REQUEST): Remove.
8502 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
8503
f230ecc9
MR
85042011-06-06 Martin Rudalics <rudalics@gmx.at>
8505
727e958e
MR
8506 * lisp.h: Move EXFUNS for Fframe_root_window,
8507 Fframe_first_window and Fset_frame_selected_window to window.h.
8508
8509 * window.h: Move EXFUNS for Fframe_root_window,
8510 Fframe_first_window and Fset_frame_selected_window here from
8511 lisp.h.
8512
8513 * frame.c (Fwindow_frame, Fframe_first_window)
8514 (Fframe_root_window, Fframe_selected_window)
8515 (Fset_frame_selected_window): Move to window.c.
8516 (Factive_minibuffer_window): Move to minibuf.c.
8517 (Fother_visible_frames_p): New function.
8518
8519 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
8520
f230ecc9
MR
8521 * window.c (decode_window, decode_any_window): Move up in code.
8522 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
8523 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
8524 (Fwindow_buffer): Move up and rewrite doc-string.
8525 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
8526 (Fwindow_prev): New functions.
727e958e
MR
8527 (Fwindow_frame): Move here from frame.c. Accept any window as
8528 argument.
8529 (Fframe_root_window, Fframe_first_window)
8530 (Fframe_selected_window): Move here from frame.c. Accept frame
8531 or arbitrary window as argument. Update doc-strings.
8532 (Fminibuffer_window): Move up in code.
8533 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
8534 (Fset_frame_selected_window): Move here from frame.c.
8535 Marginal rewrite.
727e958e
MR
8536 (Fselected_window, select_window, Fselect_window): Move up in
8537 code. Minor doc-string fixes.
f230ecc9 8538
4d09bcf6
PE
85392011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8540
8541 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
8542 Do not assume that spare memory exists; that assumption is valid
8543 only if SYSTEM_MALLOC.
8544 (LARGE_REQUEST): New macro, so that the issue of large requests
8545 is separated from the issue of spare memory.
8546
810928a2
AS
85472011-06-05 Andreas Schwab <schwab@linux-m68k.org>
8548
172418ad
AS
8549 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
8550 format. (Bug#8806)
8551
43f862f7
AS
8552 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
8553
810928a2
AS
8554 * xfns.c (x_set_scroll_bar_default_width): Move declarations
8555 before statements.
8556
a059fe24
JD
85572011-06-05 Jan Djärv <jan.h.d@swipnet.se>
8558
8559 * gtkutil.c (xg_get_default_scrollbar_width): New function.
8560
8561 * gtkutil.h: Declare xg_get_default_scrollbar_width.
8562
8563 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
8564 min width by calling x_set_scroll_bar_default_width (Bug#8505).
8565
989bf368
JB
85662011-06-05 Juanma Barranquero <lekktu@gmail.com>
8567
8568 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
8569
4b80f674
CY
85702011-06-04 Chong Yidong <cyd@stupidchicken.com>
8571
8572 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
8573 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
8574 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
8575 New error handlers.
4b80f674
CY
8576 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
8577 Obey Vx_select_enable_clipboard_manager. Catch errors in
8578 x_clipboard_manager_save (Bug#8779).
8579 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 8580 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 8581
99a33b77 85822011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
8583
8584 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
8585
99a33b77 85862011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
8587
8588 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
8589 in the current matrix if keep_current_p is non-zero.
8590
8264569d
EZ
85912011-06-04 Eli Zaretskii <eliz@gnu.org>
8592
8593 * bidi.c (bidi_level_of_next_char): Fix last change.
8594
57f97249
EZ
85952011-06-03 Eli Zaretskii <eliz@gnu.org>
8596
fec2107c 8597 Support bidi reordering of text covered by display properties.
57f97249 8598
fec2107c
EZ
8599 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
8600 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
8601 (bidi_cache_search, bidi_cache_iterator_state)
8602 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
8603 (bidi_level_of_next_char, bidi_move_to_visually_next):
8604 Support character positions inside a run of characters covered by a
fec2107c
EZ
8605 display string.
8606 (bidi_paragraph_init, bidi_resolve_explicit_1)
8607 (bidi_level_of_next_char): Call bidi_fetch_char and
8608 bidi_fetch_char_advance instead of FETCH_CHAR and
8609 FETCH_CHAR_ADVANCE.
8610 (bidi_init_it): Initialize new members.
8611 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
8612 definitions.
8613 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
8614 instead of using explicit *_CHAR codes.
d6d100dd
SM
8615 (bidi_resolve_explicit, bidi_resolve_weak):
8616 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
8617 bidirectional text is supported only in multibyte buffers.
8618 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
8619 it to initialize the frame_window_p member of struct bidi_it.
8620 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
8621 (bidi_resolve_explicit, bidi_resolve_weak)
8622 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
8623 bidi_it->nchars is non-positive.
8624 (bidi_level_of_next_char): Don't try to lookup the cache for the
8625 next/previous character if nothing is cached there yet, or if we
8626 were just reseat()'ed to a new position.
c40e2fb2 8627
0e14fe90
EZ
8628 * xdisp.c (set_cursor_from_row): Set start and stop points
8629 according to the row's direction when priming the loop that looks
8630 for the glyph on which to display cursor.
8631 (single_display_spec_intangible_p): Function deleted.
8632 (display_prop_intangible_p): Reimplement to call
8633 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
8634 Accept 3 additional arguments needed by handle_display_spec.
8635 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
8636 values: lists, `(when COND...)' forms, etc.
8637 (single_display_spec_string_p): Support property values that are
8638 lists with the argument STRING its top-level element.
8639 (display_prop_string_p): Fix the condition for processing a
8640 property that is a list to be consistent with handle_display_spec.
fec2107c 8641 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
8642 last portion of handle_display_prop.
8643 (compute_display_string_pos): Accept additional argument
8644 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
8645 value of a `display' property is a "replacing spec".
8646 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
8647 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
8648 the display property, but just return a value indicating whether
8649 the display property will replace the characters it covers.
8650 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
8651 frame_window_p members of struct bidi_it.
d6d100dd
SM
8652 (compute_display_string_pos, compute_display_string_end):
8653 New functions.
fec2107c
EZ
8654 (push_it): Accept second argument POSITION, where pop_it should
8655 jump to continue iteration.
8656 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 8657
fec2107c
EZ
8658 * keyboard.c (adjust_point_for_property): Adjust the call to
8659 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
8660
8661 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
8662 (bidi_init_it): Update prototypes.
8663 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
8664 (compute_display_string_pos, compute_display_string_end):
8665 Declare prototypes.
fec2107c
EZ
8666 (struct bidi_it): New members nchars and disp_pos. ch_len is now
8667 EMACS_INT.
fc6f18ce 8668
40087514 86692011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 8670
57f53182
PE
8671 Malloc failure behavior now depends on size of allocation.
8672 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
8673 * lisp.h: Change signatures accordingly.
8674 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
8675 All callers changed. (Bug#8762)
8676
8677 * gnutls.c: Use Emacs's memory allocators.
8678 Without this change, the gnutls library would invoke malloc etc.
8679 directly, which causes problems on non-SYNC_INPUT hosts, and which
8680 runs afoul of improving memory_full behavior. (Bug#8761)
8681 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
8682 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
8683 xfree instead of the default malloc, realloc, free.
8684 (Fgnutls_boot): No need to check for memory allocation failure,
8685 since xmalloc does that for us.
8686
ac32cd99 8687 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
8688 * category.c (hash_get_category_set):
8689 * ccl.c (ccl_driver):
8690 * charset.c (Fdefine_charset_internal):
8691 * charset.h (struct charset.hash_index):
8692 * composite.c (get_composition_id, gstring_lookup_cache)
8693 (composition_gstring_put_cache):
8694 * composite.h (struct composition.hash_index):
8695 * dispextern.h (struct image.hash):
8696 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
8697 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
8698 (hashfn_equal, hashfn_user_defined, make_hash_table)
8699 (maybe_resize_hash_table, hash_lookup, hash_put)
8700 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
8701 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
8702 (Fsxhash, Fgethash, Fputhash, Fmaphash):
8703 * image.c (make_image, search_image_cache, lookup_image)
8704 (xpm_put_color_table_h):
8705 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 8706 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 8707 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 8708 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
8709 * alloc.c (allocate_vectorlike):
8710 Check for overflow in vector size calculations.
8711 * ccl.c (ccl_driver):
8712 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
8713 * fns.c, image.c: Remove unnecessary static decls that would otherwise
8714 need to be updated by these changes.
40087514
PE
8715 * fns.c (make_hash_table, maybe_resize_hash_table):
8716 Check for integer overflow with large hash tables.
0de4bb68
PE
8717 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
8718 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
8719 (SXHASH_REDUCE): New macro.
8720 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
8721 Use it instead of discarding useful hash info with large hash values.
8722 (sxhash_float): New function.
8723 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
8724 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
8725 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
8726 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
8727 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
8728 Adjust signatures to match updated version of code.
8729 (consing_since_gc): Now EMACS_INT, since a single hash table can
8730 use more than INT_MAX bytes.
8731
698d32e2
DN
87322011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
8733
8734 Make it possible to build with GCC-4.6+ -O2 -flto.
8735
8736 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
8737
fd6fa53f
SM
87382011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
8739
8740 * minibuf.c (get_minibuffer, read_minibuf_unwind):
8741 Call minibuffer-inactive-mode.
8742
864db017
JB
87432011-05-31 Juanma Barranquero <lekktu@gmail.com>
8744
8745 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
8746 Update dependencies.
8747
2ad0baf4
DN
87482011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8749
8750 * data.c (init_data): Remove code for UTS, this system is not
8751 supported anymore.
8752
4fcc2638
DN
87532011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8754
8755 Don't force ./temacs to start in terminal mode.
8756
8757 * frame.c (make_initial_frame): Initialize faces in all cases, not
8758 only when CANNOT_DUMP is defined.
8759 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
8760
c56e0fd5
DN
87612011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8762
8763 * dispnew.c (add_window_display_history): Use const for the string
8764 pointer. Remove declaration, not needed.
8765
333d54da 87662011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 8767
55d4c1b2 8768 Use 'inline', not 'INLINE'.
333d54da 8769 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
8770 * alloc.c, fontset.c (INLINE): Remove.
8771 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
8772 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
8773 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
8774 * gmalloc.c (register_heapinfo): Use inline unconditionally.
8775 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
8776
738db178
DN
87772011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8778
8779 Make it possible to run ./temacs.
8780
8781 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
8782 syms_of_callproc does the same thing. Remove test for
8783 "initialized", do it in the caller.
8784 * emacs.c (main): Avoid calling set_initial_environment when dumping.
8785
620c53a6
SM
87862011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
8787
8788 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
8789 (read_minibuf): Use get_minibuffer.
8790 (syms_of_minibuf): Use DEFSYM.
8791 (Qmetadata): New var.
8792 * data.c (Qbuffer): Don't make it static.
8793 (syms_of_data): Use DEFSYM.
8794
e003a292
PE
87952011-05-31 Paul Eggert <eggert@cs.ucla.edu>
8796
8797 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
8798 (CCL_CODE_MIN): New macro.
8799
ed008a6d
PE
88002011-05-30 Paul Eggert <eggert@cs.ucla.edu>
8801
3687c2ef
PE
8802 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
8803
ed008a6d
PE
8804 * eval.c (Qdebug): Now static.
8805 * lisp.h (Qdebug): Remove decl. This reverts a part of the
8806 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
8807 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
8808
d66c4c7c
CY
88092011-05-29 Chong Yidong <cyd@stupidchicken.com>
8810
8811 * image.c: Various fixes to ImageMagick code comments.
8812 (Fimagemagick_types): Doc fix.
8813
5fbc2025
PE
88142011-05-29 Paul Eggert <eggert@cs.ucla.edu>
8815
0196f88a
PE
8816 Minor fixes prompted by GCC 4.6.0 warnings.
8817
8818 * xselect.c (converted_selections, conversion_fail_tag): Now static.
8819
5fbc2025
PE
8820 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
8821 (x_clipboard_manager_save_all): Move extern decl to ...
8822 * xterm.h: ... here, so that it can be checked for consistency.
8823
1dd3c2d9
CY
88242011-05-29 Chong Yidong <cyd@stupidchicken.com>
8825
8826 * xselect.c (x_clipboard_manager_save_frame)
8827 (x_clipboard_manager_save_all): New functions.
8828 (Fx_clipboard_manager_save): Lisp function deleted.
8829
8830 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
8831 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
8832
8833 * xterm.h: Update prototype.
8834
5ba6571d
WX
88352011-05-28 William Xu <william.xwl@gmail.com>
8836
8837 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
8838 exiting (Bug#8239).
8839
3eaff834
JM
88402011-05-28 Jim Meyering <meyering@redhat.com>
8841
e1900994 8842 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
8843 * fns.c (to_uchar): Define.
8844 (crypto_hash_function): Use it to convert some newly-signed
8845 variables to unsigned, to avoid sign-extension bugs. For example,
8846 without this change, (md5 "truc") would evaluate to
8847 45723a2aff78ff4fff7fff1114760e62 rather than the expected
8848 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 8849 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 8850
0f6990a7
PE
88512011-05-27 Paul Eggert <eggert@cs.ucla.edu>
8852
8853 Integer overflow fixes.
c8a9ca5a 8854
08686060
PE
8855 * dbusbind.c: Serial number integer overflow fixes.
8856 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
8857 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
8858 to hold a serial number that is too large for a fixnum.
8859 (Fdbus_method_return_internal, Fdbus_method_error_internal):
8860 Check for serial numbers out of range. Decode any serial number
59568bf0 8861 that was so large that it became a float. (Bug#8722)
08686060 8862
2d1fc3c7
PE
8863 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
8864 (Fdbus_call_method, Fdbus_call_method_asynchronously):
8865 Use XFASTINT rather than XUINT when numbers are nonnegative.
8866 (xd_append_arg, Fdbus_method_return_internal):
8867 (Fdbus_method_error_internal): Likewise. Also, for unsigned
8868 arguments, check that Lisp number is nonnegative, rather than
59568bf0 8869 silently wrapping negative numbers around. (Bug#8722)
30217ff0 8870 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 8871 (Bug#8722)
2d1fc3c7 8872
c8a9ca5a
PE
8873 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
8874
519e1d69
PE
8875 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
8876
6df6ae42 8877 ccl: Add integer overflow checks.
30569699
PE
8878 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
8879 (IN_INT_RANGE): New macros.
8880 (ccl_driver): Use them to check for integer overflow when
8881 decoding a CCL program. Many of the new checks are whether XINT (x)
8882 fits in int; it doesn't always, on 64-bit hosts. The new version
8883 doesn't catch all possible integer overflows, but it's an
847044ea 8884 improvement. (Bug#8719)
30569699 8885
c11285dc
PE
8886 * alloc.c (make_event_array): Use XINT, not XUINT.
8887 There's no need for unsigned here.
8888
fdccd48e
PE
8889 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
8890 This follows up to the 2011-05-06 change that substituted uintptr_t
8891 for EMACS_INT. This case wasn't caught back then.
8892
37910ab2
PE
8893 Rework Fformat to avoid integer overflow issues.
8894 * editfns.c: Include <float.h> unconditionally, as it's everywhere
8895 now (part of C89). Include <verify.h>.
8896 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
8897 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
8898 (Fformat): Avoid the prepass trying to compute sizes; it was only
8899 approximate and thus did not catch overflow reliably. Instead, walk
8900 through the format just once, formatting and computing sizes as we go,
8901 checking for integer overflow at every step, and allocating a larger
8902 buffer as needed. Keep track separately whether the format is
8903 multibyte. Keep only the most-recently calculated precision, rather
8904 than them all. Record whether each argument has been converted to
8905 string. Use EMACS_INT, not int, for byte and char and arg counts.
8906 Support field widths and precisions larger than INT_MAX. Avoid
8907 sprintf's undefined behavior with conversion specifications such as %#d
8908 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
8909 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
8910 formatting out-of-range floating point numbers with int
9173deec 8911 formats. (Bug#8668)
37910ab2 8912
2e6578fb
PE
8913 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
8914
0ae6bdee
PE
8915 * data.c: Avoid integer truncation in expressions involving floats.
8916 * data.c: Include <intprops.h>.
8917 (arith_driver): When there's an integer overflow in an expression
8918 involving floating point, convert the integers to floating point
8919 so that the resulting value does not suffer from catastrophic
8920 integer truncation. For example, on a 64-bit host (* 4
8921 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
8922 Do not rely on undefined behavior after integer overflow.
8923
de883a70
PE
8924 merge count_size_as_multibyte, parse_str_to_multibyte
8925 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 8926 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
8927 Check for integer overflow.
8928 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
8929 since it's now a duplicate of the other. This is more of
8930 a character than a buffer op, so better that it's in character.c.
8931 * fns.c, print.c: Adjust to above changes.
8932
2ff916cb
PE
89332011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
8934
8935 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
8936
f1b54466
PE
89372011-05-27 Paul Eggert <eggert@cs.ucla.edu>
8938
fb1ac845
PE
8939 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
8940 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
8941 (x_clipboard_manager_save): Now static.
8942 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
8943
f1b54466
PE
8944 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
8945 (crypto_hash_function): Now static.
8946 Fix pointer signedness problems. Avoid unnecessary initializations.
8947
a9f737ee
CY
89482011-05-27 Chong Yidong <cyd@stupidchicken.com>
8949
8950 * termhooks.h (Vselection_alist): Make it terminal-local.
8951
8952 * terminal.c (create_terminal): Initialize it.
8953
8954 * xselect.c: Support for clipboard managers.
8955 (Vselection_alist): Move to termhooks.h as terminal-local var.
8956 (LOCAL_SELECTION): New macro.
8957 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
8958 (symbol_to_x_atom): Remove gratuitous arg.
8959 (x_handle_selection_request, lisp_data_to_selection_data)
8960 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
8961 (x_own_selection, x_get_local_selection, x_convert_selection):
8962 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
8963 (some_frame_on_display): Delete unused function.
8964 (Fx_own_selection_internal, Fx_get_selection_internal)
8965 (Fx_disown_selection_internal, Fx_selection_owner_p)
8966 (Fx_selection_exists_p): New optional frame arg.
8967 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
8968 (x_handle_selection_clear): Don't treat other terminals with the
8969 same keyboard specially. Use the terminal-local Vselection_alist.
8970 (x_clear_frame_selections): Use Frun_hook_with_args.
8971
8972 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
8973
8974 * xterm.h: Add support for those atoms.
8975
e067f0c1
CY
89762011-05-26 Chong Yidong <cyd@stupidchicken.com>
8977
8978 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
8979 (converted_selections, conversion_fail_tag): New global variables.
8980 (x_selection_request_lisp_error): Free the above.
8981 (x_get_local_selection): Remove unnecessary code.
8982 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
8983 of converted selections stored in converted_selections.
8984 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
8985 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
8986 (x_convert_selection): New function.
8987 (x_handle_selection_event): Simplify.
8988 (x_get_foreign_selection): Don't ignore incoming requests while
8989 waiting for an answer; this will fail when we implement
8990 SAVE_TARGETS, and seems unnecessary anyway.
8991 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
8992 (Vx_sent_selection_functions): Doc fix.
8993
0f4aebc0
LL
89942011-05-26 Leo Liu <sdl.web@gmail.com>
8995
8996 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
8997
e61124cd
YM
89982011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8999
9000 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
9001
9002 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
9003 for fringe update if it has periodic bitmap.
ac389d0c 9004 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
9005 and fringe_bitmap_periodic_p.
9006
9007 * fringe.c (get_fringe_bitmap_data): New function.
9008 (draw_fringe_bitmap_1, update_window_fringes): Use it.
9009 (update_window_fringes): Record periodicity of fringe bitmap in glyph
9010 row. Mark glyph row for fringe update if periodicity changed.
9011
9012 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
9013 for fringe update unless it has periodic bitmap.
9014
f16d9837
KH
90152011-05-25 Kenichi Handa <handa@m17n.org>
9016
9017 * xdisp.c (get_next_display_element): Set correct it->face_id for
9018 a static composition.
9019
e1b90ef6
LL
90202011-05-24 Leo Liu <sdl.web@gmail.com>
9021
9022 * deps.mk (fns.o):
9023 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
9024
9025 * fns.c (crypto_hash_function, Fsha1): New function.
9026 (Fmd5): Use crypto_hash_function.
9027 (syms_of_fns): Add Ssha1.
9028
7400048f
PE
90292011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9030
9031 * gnutls.c: Remove unused macros.
9032 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
9033 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
9034 Remove macros that are defined and never used.
9035 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
9036
abb71cf4
CY
90372011-05-22 Chong Yidong <cyd@stupidchicken.com>
9038
9039 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
9040 (Fx_get_selection_internal): Minor cleanup.
9041 (Fx_own_selection_internal): Rename arguments for consistency with
9042 select.el.
9043
6307db39
PE
90442011-05-22 Paul Eggert <eggert@cs.ucla.edu>
9045
9046 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
9047
f3d4e0a4
CY
90482011-05-22 Chong Yidong <cyd@stupidchicken.com>
9049
9050 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
9051
4d8ade89
YM
90522011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9053
9054 * dispnew.c (scrolling_window): Don't exclude the case that the
9055 last enabled row in the desired matrix touches the bottom boundary.
9056
32078c8d
GM
90572011-05-21 Glenn Morris <rgm@gnu.org>
9058
9059 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
9060 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
9061 and add some more files.
32078c8d 9062
7285dc67
EZ
90632011-05-20 Eli Zaretskii <eliz@gnu.org>
9064
9065 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
9066 report_file_error introduced by the change from 2011-05-07.
9067
89d1bd22
PE
90682011-05-20 Paul Eggert <eggert@cs.ucla.edu>
9069
9070 * systime.h (Time): Define only if emacs is defined.
9071 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
9072 where the include path doesn't have X11/X.h by default. See
9073 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
9074
cd394be1 90752011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
9076
9077 * composite.c (find_automatic_composition): Fix previous change.
9078
b9704ad9
GM
90792011-05-20 Glenn Morris <rgm@gnu.org>
9080
9081 * lisp.mk: New file, split from Makefile.in.
9082 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
9083 (shortlisp): Remove.
9084 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
9085
4a720484
GM
90862011-05-19 Glenn Morris <rgm@gnu.org>
9087
9088 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
9089 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
9090 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
9091 (lisp): Set the order to that of loadup.el.
9092 (shortlisp): Make it a copy of $lisp.
9093 (SOME_MACHINE_LISP): Remove.
9094 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
9095 Use just $shortlisp, not $SOME_MACHINE_LISP too.
9096
a28d4396
KH
90972011-05-18 Kenichi Handa <handa@m17n.org>
9098
9099 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
9100 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
9101 (find_automatic_composition): Mostly rewrite for efficiency.
9102
a2b1fa8e
JB
91032011-05-18 Juanma Barranquero <lekktu@gmail.com>
9104
9105 * makefile.w32-in: Update dependencies.
9106
8e1f5610
CS
91072011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
9108
9109 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 9110 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 9111
7025ee00 91122011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 9113
cdfa6eab
PE
9114 Fix some integer overflow issues, such as string length overflow.
9115
06d6db33
PE
9116 * insdel.c (count_size_as_multibyte): Check for string overflow.
9117
2b4560a8
PE
9118 * character.c (lisp_string_width): Check for string overflow.
9119 Use EMACS_INT, not int, for string indexes and lengths; in
9120 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
9121 the resulting string length overflows an EMACS_INT; instead,
9122 report a string overflow if no precision given. When checking for
9123 precision exhaustion, use a check that cannot possibly have
9124 integer overflow. (Bug#8675)
9125 * character.h (lisp_string_width): Adjust to new signature.
9126
cb93f9be
PE
9127 * alloc.c (string_overflow): New function.
9128 (Fmake_string): Use it. This doesn't change behavior, but saves
9129 a few bytes and will simplify future changes.
9130 * character.c (string_escape_byte8): Likewise.
9131 * lisp.h (string_overflow): New decl.
9132
1a1f3366
PE
9133 Fixups, following up to the user-interface timestamp change.
9134 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
9135 for UI timestamps, instead of unsigned long.
9fbd6841
PE
9136 * msdos.c (mouse_get_pos): Likewise.
9137 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
9138 * w32gui.h (Time): Define by including "systime.h" rather than by
9139 declaring it ourselves. (Bug#8664)
9140
d4e3e4d3
PE
9141 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
9142 * image.c (clear_image_cache): Likewise.
9143
f6a24d19
PE
9144 * term.c (term_mouse_position): Don't assume time_t wraparound.
9145
08dc5ae6
PE
9146 Be more systematic about user-interface timestamps.
9147 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
9148 and sometimes 'EMACS_UINT', to represent these timestamps.
9149 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
9150 This makes the code easier to follow, and makes it easier to catch
9151 integer overflow bugs such as Bug#8664.
9152 * frame.c (Fmouse_position, Fmouse_pixel_position):
9153 Use Time, not unsigned long, for user-interface timestamps.
9154 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
9155 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
9156 * keyboard.h (last_event_timestamp): Likewise.
9157 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
9158 * menu.h (xmenu_show): Likewise.
9159 * term.c (term_mouse_position): Likewise.
9160 * termhooks.h (struct input_event.timestamp): Likewise.
9161 (struct terminal.mouse_position_hook): Likewise.
9162 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
9163 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
9164 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
9165 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
9166 what it was before.
9167 * menu.h, termhooks.h: Include "systime.h", for Time.
9168
8e55734a
PE
9169 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
9170 Don't assume that the difference between two unsigned long values
9171 can fit into an integer. At this point, we know button_down_time
9172 <= event->timestamp, so the difference must be nonnegative, so
9173 there's no need to cast the result if double-click-time is
9174 nonnegative, as it should be; check that it's nonnegative, just in
9175 case. This bug is triggered when events are more than 2**31 ms
86db42d2 9176 apart (about 25 days). (Bug#8664)
8e55734a 9177
841f1b75 9178 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 9179 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 9180
3e26f69c
PE
9181 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
9182 that always fit in int. Use a sentinel instead of a counter, to
9183 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
9184 * frame.h (struct frame): Use int for menu_bar_items_used
9185 instead of EMACS_INT, since it always fits in int.
3e26f69c 9186
5cc152c0
PE
9187 * menu.c (grow_menu_items): Check for int overflow.
9188
d89eb65e
PE
9189 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
9190
5235bd3e
PE
9191 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
9192 Before, the code was not consistent. These values cannot exceed
9193 2**31 - 1 so there's no need to make them unsigned.
9194 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
9195 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
9196 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
9197 as modifiers.
9198 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
9199
bc827e23
PE
9200 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
9201 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
9202 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
9203 presumably because the widths might not match.
9204
78eb494e
PE
9205 * window.c (size_window): Avoid needless test at loop start.
9206
04f2d78b
CB
92072011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
9208
9209 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
9210
d2fc7e3d 92112011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
9212
9213 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
9214
d2fc7e3d 92152011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
9216
9217 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
9218 `width' to `bar_area_x' and `bar_area_width', respectively.
9219 (x_scroll_run): Take account of fringe background extension.
9220
04f2d78b
CB
9221 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
9222 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
9223 `bar_area_width', respectively.
9224 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
9225 background extension.
9226
79b70037
GM
92272011-05-10 Jim Meyering <meyering@redhat.com>
9228
9229 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
9230
2f142cc5
JB
92312011-05-10 Juanma Barranquero <lekktu@gmail.com>
9232
9233 * image.c (Finit_image_library): Return t for built-in image types,
9234 like pbm and xbm. (Bug#8640)
9235
57679c86
AS
92362011-05-09 Andreas Schwab <schwab@linux-m68k.org>
9237
9238 * w32menu.c (set_frame_menubar): Fix submenu allocation.
9239
888c9e86
EZ
92402011-05-07 Eli Zaretskii <eliz@gnu.org>
9241
b0512a1d
EZ
9242 * w32console.c (Fset_screen_color): Doc fix.
9243 (Fget_screen_color): New function.
9244 (syms_of_ntterm): Defsubr it.
9245
7285dc67
EZ
9246 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
9247 unlink the temporary file if Fcall_process didn't create it in the
9248 first place.
9249 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
9250 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
9251 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
9252 cue to call_process_cleanup not to close that handle.
9253
4d3fcc8e
BK
92542011-05-07 Ben Key <bkey76@gmail.com>
9255
9256 * makefile.w32-in: The bootstrap-temacs rule now makes use of
9257 one of two shell specific rules, either bootstrap-temacs-CMD or
9258 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
9259 to the previous implementation of the bootstrap-temacs rule.
9260 The bootstrap-temacs-CMD rule is similar to the previous
9261 implementation of the bootstrap-temacs rule except that it
9262 makes use of the ESC_CFLAGS variable instead of the CFLAGS
9263 variable.
9264
9265 These changes, along with some changes to nt/configure.bat,
9266 nt/gmake.defs, and nt/nmake.defs, are required to extend my
9267 earlier fix to add support for --cflags and --ldflags options
9268 that include quotes so that it works whether make uses cmd or
9269 sh as the shell.
9270
b4289b64
MA
92712011-05-06 Michael Albinus <michael.albinus@gmx.de>
9272
9273 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
9274 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
9275 is a constant.
9276 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
9277 a string. Handle both cases.
9278 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
9279 (Fdbus_register_method): Use Qinvalid_function.
9280
af4c0e28
JB
92812011-05-06 Juanma Barranquero <lekktu@gmail.com>
9282
9283 * makefile.w32-in: Update dependencies.
9284 (LISP_H): Add inttypes.h and stdin.h.
9285 (PROCESS_H): Add unistd.h.
9286
c51453d9
EZ
92872011-05-06 Eli Zaretskii <eliz@gnu.org>
9288
9289 * lread.c: Include limits.h (fixes the MS-Windows build broken by
9290 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
9291
8ff0ac3c 92922011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 9293
4c4b566b
PE
9294 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
9295
aab2b9b5
PE
9296 * term.c (vfatal): Remove stray call to va_end.
9297 It's not needed and the C Standard doesn't allow it here anyway.
9298
c378da0b
PE
9299 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
9300 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
9301
288b08c7
PE
9302 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
9303 bytes.
9304
e3601888
PE
9305 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
9306
db6c0e74
PE
9307 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9308
dd5963ea
PE
9309 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
9310
88c9450f
PE
9311 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
9312
2f9442b8
PE
9313 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
9314
c032b5f8
PE
9315 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
9316 * charset.c (Fdefine_charset_internal): Don't initialize
9317 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 9318 32-bit int (Bug#8600).
a108c10b
PE
9319
9320 * lread.c (read_integer): Be more consistent with string-to-number.
9321 Use string_to_number to do the actual conversion; this avoids
9322 rounding errors and fixes some other screwups. Without this fix,
9323 for example, #x1fffffffffffffff was misread as -2305843009213693952.
9324 (digit_to_number): Move earlier, for benefit of read_integer.
9325 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 9326 not a digit in any supported base. (Bug#8602)
a108c10b 9327
ad5f9eea
PE
9328 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
9329
aec1708a
PE
9330 * dispnew.c (scrolling_window): Return 1 if we scrolled,
9331 to match comment at start of function. This also removes a
9332 GCC warning about overflow in a 32+64-bit port.
9333
47be4ab5
PE
9334 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
9335
371cac43
PE
9336 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
9337 Reported by Stefan Monnier in
9338 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
9339 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9340 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 9341
d01a7826
PE
9342 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
9343 (EMACS_UINTPTR): Likewise, with uintptr_t.
9344
7fd47d5c
PE
9345 * lisp.h: Prefer 64-bit EMACS_INT if available.
9346 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
9347 on 32-bit hosts that have 64-bit int, so that they can access
9348 large files.
122b0c86
PE
9349 However, temporarily disable this change unless the temporary
9350 symbol WIDE_EMACS_INT is defined.
7fd47d5c 9351
8727937b
PE
9352 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
9353
8ac068ac
PE
9354 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
9355 This removes an assumption that EMACS_INT and long are the same
9356 width as pointers. The assumption is true for Emacs porting targets
9357 now, but we want to make other targets possible.
9358 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
9359 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
9360 In the rest of the code, change types of integers that hold casted
9361 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
9362 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
9363 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
9364 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
9365 No need to cast type when ORing.
9366 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
9367 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
9368 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
9369 assume EMACS_INT is the same width as char *.
9370 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
9371 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
9372 Remove no-longer-needed casts.
9373 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
9374 (xg_tool_bar_help_callback, xg_make_tool_item):
9375 Use EMACS_INTPTR to hold an integer
9376 that will be cast to void *; this can avoid a GCC warning
9377 if EMACS_INT is not the same width as void *.
9378 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
9379 * xdisp.c (display_echo_area_1, resize_mini_window_1):
9380 (current_message_1, set_message_1):
9381 Use a local to convert to proper width without a cast.
9382 * xmenu.c (dialog_selection_callback): Likewise.
9383
ede49d71
PE
9384 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
9385 Also, don't assume VALBITS / RAND_BITS is less than 5,
9386 and don't rely on undefined behavior when shifting a 1 left into
9387 the sign bit.
9388 * lisp.h (get_random): Change signature to match.
9389
2f30ecd0
PE
9390 * lread.c (hash_string): Use size_t, not int, for hash computation.
9391 Normally we prefer signed values; but hashing is special, because
9392 it's better to use unsigned division on hash table sizes so that
9393 the remainder is nonnegative. Also, size_t is the natural width
9394 for hashing into memory. The previous code used 'int', which doesn't
9395 retain enough info to hash well into very large tables.
9396 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
9397
2a866e7b
PE
9398 * dbusbind.c: Don't possibly lose pointer info when converting.
9399 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9400 Use XPNTR rather than XHASH, so that the high-order bits of
9401 the pointer aren't lost when converting through void *.
9402
51639eac
PE
9403 * eval.c (Fautoload): Don't double-shift a pointer.
9404
92394119
PE
9405 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
9406
dbdb9a7c
JB
94072011-05-06 Juanma Barranquero <lekktu@gmail.com>
9408
9409 * gnutls.c (DEF_GNUTLS_FN):
9410 * image.c (DEF_IMGLIB_FN): Make function pointers static.
9411
db7a0b4f
AS
94122011-05-05 Andreas Schwab <schwab@linux-m68k.org>
9413
9414 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
9415 marker. (Bug#8610)
9416
cd394be1 94172011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
9418
9419 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
9420 New version that can reserve upto 2GB of heap space.
9421
f7ff1b0f 94222011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
9423
9424 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
9425
639c109b
TZ
94262011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
9427
9428 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
9429 `gnutls_certificate_set_x509_key_file'.
9430
d2127135
JB
94312011-05-05 Juanma Barranquero <lekktu@gmail.com>
9432
9433 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
9434 Update dependencies.
9435
e968f4f3
JB
94362011-05-04 Juanma Barranquero <lekktu@gmail.com>
9437
9438 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
9439 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9440 Remove unused parameter `fildes'.
9441 * process.c (read_process_output, send_process): Don't pass it.
9442
84d358f0
JB
94432011-05-04 Juanma Barranquero <lekktu@gmail.com>
9444
9445 Fix previous change: the library cache is defined in w32.c.
9446 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
9447 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
9448
0898ca10
JB
94492011-05-04 Juanma Barranquero <lekktu@gmail.com>
9450
9451 Implement dynamic loading of GnuTLS on Windows.
9452
9453 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
9454 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
9455 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
9456 Declare.
9457
9458 * gnutls.c (Qgnutls_dll): Define.
9459 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
9460 (gnutls_*): Declare function pointers.
9461 (init_gnutls_functions): New function to initialize function pointers.
9462 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
9463 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
9464 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
9465 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
9466 (emacs_gnutls_write, emacs_gnutls_read)
9467 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
9468 (Fgnutls_available_p): New function.
9469 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
9470 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
9471 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
9472
9473 * image.c: Include w32.h.
9474 (Vimage_type_cache): Delete.
9475 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
9476 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
9477 (w32_delayed_load): Move to w32.c.
9478
9479 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
9480
9481 * w32.c (QCloaded_from, Vlibrary_cache): Define.
9482 (w32_delayed_load): Move from image.c. When loading a library, record
9483 its filename in the :loaded-from property of the library id.
9484 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
9485 Initialize and staticpro them.
9486 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
9487
9488 * process.c: Include lisp.h before w32.h, not after.
9489 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
9490 instead of gnutls_record_check_pending.
9491
9492 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
9493
ff4de4aa
TZ
94942011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
9495
9496 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
9497 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
9498 as passed in.
9499
abe95abb
JD
95002011-05-03 Jan Djärv <jan.h.d@swipnet.se>
9501
9502 * xterm.c (x_set_frame_alpha): Do not set property on anything
9503 else than FRAME_X_OUTER_WINDOW (Bug#8608).
9504
e16e55d4
JB
95052011-05-02 Juanma Barranquero <lekktu@gmail.com>
9506
9507 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
9508
bafcf6a5
JB
95092011-05-02 Juanma Barranquero <lekktu@gmail.com>
9510
9511 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
9512 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
9513 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
9514 (gnutls_global_initialized, Qgnutls_bootprop_priority)
9515 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
9516 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
9517 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
9518 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
9519 (Qgnutls_bootprop_callbacks_verify): Make static.
9520
e7a6747f
AS
95212011-05-01 Andreas Schwab <schwab@linux-m68k.org>
9522
19ed11ba
AS
9523 * callproc.c: Indentation fixup.
9524
e7a6747f 9525 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
9526 (wait_for_termination, interruptible_wait_for_termination):
9527 Move after wait_for_termination_1.
e7a6747f 9528
1ef14cb4
LMI
95292011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
9530
9531 * sysdep.c (interruptible_wait_for_termination): New function
9532 which is like wait_for_termination, but allows keyboard
9533 interruptions.
9534
9535 * callproc.c (Fcall_process): Add (:file "file") as an option for
9536 the STDOUT buffer.
9537 (Fcall_process_region): Ditto.
9538
330d880c
EZ
95392011-04-30 Eli Zaretskii <eliz@gnu.org>
9540
8db90b73
EZ
9541 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
9542 rather than `XVECTOR (FOO)->size'.
9543
330d880c
EZ
9544 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
9545 inttypes.h, as a gnulib replacement is used if it not available in
9546 system headers.
9547
15cbd324
EZ
95482011-04-21 Eli Zaretskii <eliz@gnu.org>
9549
9550 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
9551 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
9552 of MOST_POSITIVE_FIXNUM. (Bug#8528)
9553
9554 * coding.c (coding_alloc_by_realloc): Error out if destination
9555 will grow beyond MOST_POSITIVE_FIXNUM.
9556 (decode_coding_emacs_mule): Abort if there isn't enough place in
9557 charbuf for the composition carryover bytes. Reserve an extra
9558 space for up to 2 characters produced in a loop.
9559 (decode_coding_iso_2022): Abort if there isn't enough place in
9560 charbuf for the composition carryover bytes.
9561
95622011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 9563
ae940cca
EZ
9564 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
9565 aborting when %lld or %lll format is passed.
9566 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
9567 %llo or %llx format is passed. (Bug#8545)
9568
03ab8921
EZ
9569 * window.c (window_scroll_line_based): Use a marker instead of
9570 simple variables to record original value of point. (Bug#7952)
9571
afda1437
EZ
9572 * doprnt.c (doprnt): Fix the case where a multibyte sequence
9573 produced by %s or %c overflows available buffer space. (Bug#8545)
9574
f76dee0c
PE
95752011-04-28 Paul Eggert <eggert@cs.ucla.edu>
9576
9577 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 9578 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 9579
fdc5744d
JB
95802011-04-28 Juanma Barranquero <lekktu@gmail.com>
9581
9582 * w32.c (init_environment): Warn about defaulting HOME to C:\.
9583
638f053a
JB
95842011-04-28 Juanma Barranquero <lekktu@gmail.com>
9585
9586 * keyboard.c (Qdelayed_warnings_hook): Define.
9587 (command_loop_1): Run `delayed-warnings-hook'
9588 if Vdelayed_warnings_list is non-nil.
9589 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
9590 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
9591
d178f871
EZ
95922011-04-28 Eli Zaretskii <eliz@gnu.org>
9593
9594 * doprnt.c (doprnt): Don't return value smaller than the buffer
9595 size if the message was truncated. (Bug#8545).
9596
b124fd93
JB
95972011-04-28 Juanma Barranquero <lekktu@gmail.com>
9598
9599 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
9600 (Fx_window_property): #if-0 the whole functions, not just the bodies.
9601
e810457d
PE
96022011-04-27 Paul Eggert <eggert@cs.ucla.edu>
9603
9604 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
9605
ea51cceb
JB
96062011-04-27 Juanma Barranquero <lekktu@gmail.com>
9607
9608 * makefile.w32-in: Update dependencies.
9609
94dcfacf
EZ
96102011-04-27 Eli Zaretskii <eliz@gnu.org>
9611
9612 Improve `doprnt' and its usage. (Bug#8545)
9613 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
9614 `format_end'. Remove support for %l as a conversion specifier.
9615 Don't use xrealloc. Improve diagnostics when the %l size modifier
9616 is used. Update the commentary.
9617
9618 * eval.c (verror): Simplify calculation of size_t.
9619
9620 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
9621 messages.
9622
f61f41d7
PE
96232011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
9624
9625 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
9626 change.
9627
96fb4434
PE
96282011-04-27 Paul Eggert <eggert@cs.ucla.edu>
9629
9630 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
9631 This makes this file independent of the recent pseudovector change.
9632
671875da 96332011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 9634
69e9b5a3
PE
9635 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
9636
b5f869a7 9637 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 9638 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 9639 Remove unused local.
c8926152 9640 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 9641
841a1577 9642 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
9643 GCC 4.6.0 optimizes based on type-based alias analysis.
9644 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
9645 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
9646 != &v->size, and therefore "v->size = 1; b->size = 2; return
9647 v->size;" must therefore return 1. This assumption is incorrect
9648 for Emacs, since it type-puns struct Lisp_Vector * with many other
9649 types. To fix this problem, this patch adds a new type struct
f904488f 9650 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
9651 and pseudovectors, and helps optimizing compilers not get fooled
9652 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
9653 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
9654 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
9655 the size member.
eab3844f
PE
9656 (XSETPVECTYPE): Rewrite in terms of new macro.
9657 (XSETPVECTYPESIZE): New macro, specifying both type and size.
9658 This is a bit clearer, and further avoids the possibility of
9659 undesirable aliasing.
9660 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 9661 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
9662 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
9663 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
9664 (ASIZE): Now uses header.size rather than size.
9665 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
9666 to avoid the hassle of writing XVECTOR (foo)->header.size.
9667 (struct vectorlike_header): New type.
eab3844f
PE
9668 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
9669 object, to help avoid aliasing.
9670 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
9671 (SUBRP): Likewise, since Lisp_Subr is a special case.
9672 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
9673 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
9674 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 9675 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
9676 changed to be "header.size" and "header.next".
9677 * buffer.h (struct buffer): Likewise.
9678 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
9679 * frame.h (struct frame): Likewise.
9680 * process.h (struct Lisp_Process): Likewise.
9681 * termhooks.h (struct terminal): Likewise.
9682 * window.c (struct save_window_data, struct saved_window): Likewise.
9683 * window.h (struct window): Likewise.
9684 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
9685 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
9686 * buffer.c (init_buffer_once): Likewise.
9687 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
9688 special case.
9689 * process.c (Fformat_network_address): Use local var for size,
9690 for brevity.
9691
0df1eac5
PE
9692 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
9693
847ab9d1 9694 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
9695 * data.c (atof): Remove decl; no longer used or needed.
9696 (digit_to_number): Move to lread.c.
9697 (Fstring_to_number): Use new string_to_number function, to be
9698 consistent with how the Lisp reader treats infinities and NaNs.
9699 Do not assume that floating-point numbers represent EMACS_INT
9700 without losing information; this is not true on most 64-bit hosts.
9701 Avoid double-rounding errors, by insisting on integers when
9702 parsing non-base-10 numbers, as the documentation specifies.
9703 * lisp.h (string_to_number): New decl, replacing ...
9704 (isfloat_string): Remove.
bc0a5c13 9705 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 9706 (read1): Do not accept +. and -. as integers; this
452f4150
PE
9707 appears to have been a coding error. Similarly, do not accept
9708 strings like +-1e0 as floating point numbers. Do not report
9709 overflow for integer overflows unless the base is not 10 which
9710 means we have no simple and reliable way to continue.
9711 Break out the floating-point parsing into a new
9712 function string_to_number, so that Fstring_to_number parses
9713 floating point numbers consistently with the Lisp reader.
04f2d78b 9714 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
9715 (E_CHAR, EXP_INT): Remove, replacing with ...
9716 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
9717 (string_to_number): New function, replacing isfloat_string.
9718 This function checks for valid syntax and produces the resulting
9719 Lisp float number too. Rework it so that string-to-number
bc0a5c13 9720 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
9721 so that overflow for non-base-10 numbers is reported only when
9722 there's no portable and simple way to convert to floating point.
452f4150 9723
67769ffc
PE
9724 * textprop.c (set_text_properties_1): Rewrite for clarity,
9725 and to avoid GCC warning about integer overflow.
9726
c20db43f
PE
9727 * intervals.h (struct interval): Use EMACS_INT for members
9728 where EMACS_UINT might cause problems. See
9729 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
9730 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
9731 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
9732 All uses changed.
37aa2f85
PE
9733 (offset_intervals): Tell GCC not to worry about length overflow
9734 when negating a negative length.
c20db43f 9735
2538aa2f
PE
9736 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
9737 (overrun_check_free): Likewise.
9738
f2d3008d
PE
9739 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
9740 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
9741 word size.
9742
ec8df744
PE
9743 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
9744 (gnutls_make_error): Rename local to avoid shadowing.
9745 (gnutls_emacs_global_deinit): ifdef out; not used.
9746 (Fgnutls_boot): Use const for pointer to readonly storage.
9747 Comment out unused local. Fix pointer signedness problems.
9748
640ee02d
PE
9749 * lread.c (openp): Don't stuff size_t into an 'int'.
9750 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
9751 about possible signed overflow.
9752
6048fb2a
PE
9753 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
9754 (GDK_KEY_g): Don't define if already defined.
9755 (xg_prepare_tooltip): Avoid pointer signedness problem.
9756 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
9757
fa3c87e1
PE
9758 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
9759 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
9760
2172544b
PE
9761 * xfns.c (Fx_window_property): Simplify a bit,
9762 to make a bit faster and to avoid GCC 4.6.0 warning.
9763 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
9764
9b821a21
PE
9765 * fns.c (internal_equal): Don't assume size_t fits in int.
9766
3c616cfa
PE
9767 * alloc.c (compact_small_strings): Tighten assertion a little.
9768
c2982e87
PE
9769 Replace pEd with more-general pI, and fix some printf arg casts.
9770 * lisp.h (pI): New macro, generalizing old pEd macro to other
9771 conversion specifiers. For example, use "...%"pI"d..." rather
9772 than "...%"pEd"...".
9773 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 9774 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
9775 * alloc.c (check_pure_size): Don't overflow by converting size to int.
9776 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
9777 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
9778 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
9779 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
9780 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
9781 64-bit hosts.
9782 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
9783 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
9784 * print.c (safe_debug_print, print_object): Likewise.
9785 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
9786 to int.
6f04d126
PE
9787 Use pI instead of if-then-else-abort. Use %p to avoid casts,
9788 avoiding the 0 flag, which is not portable.
c2982e87
PE
9789 * process.c (Fmake_network_process): Use pI to avoid cast.
9790 * region-cache.c (pp_cache): Likewise.
9791 * xdisp.c (decode_mode_spec): Likewise.
9792 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
9793 behavior on 64-bit hosts with printf arg.
6f04d126 9794 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
9795 (x_stop_queuing_selection_requests): Likewise.
9796 (x_get_window_property): Don't truncate byte count to an 'int'
9797 when tracing.
0b432f21 9798
5e073ec7
PE
9799 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
9800 here, since it parses constructs like leading '-' and spaces,
9801 which are not wanted; and it overflows with large numbers.
9802 Instead, simply match F[0-9]+, which is what is wanted anyway.
9803
36372bf9
PE
9804 * alloc.c: Remove unportable assumptions about struct layout.
9805 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
9806 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
9807 (allocate_vectorlike, make_pure_vector): Use the new macros,
9808 plus offsetof, to remove unportable assumptions about struct layout.
9809 These assumptions hold on all porting targets that I know of, but
9810 they are not guaranteed, they're easy to remove, and removing them
9811 makes further changes easier.
9812
0b432f21
PE
9813 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
9814 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
9815 (string_overrun_cookie): Now const. Use initializers that
9816 don't formally overflow signed char, to avoid warnings.
000098c1
PE
9817 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
9818 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
9819 (allocate_buffer): Don't assume sizeof (struct buffer) is a
9820 multiple of sizeof (EMACS_INT); it need not be, if
9821 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 9822 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 9823
895009e1
JB
98242011-04-26 Juanma Barranquero <lekktu@gmail.com>
9825
9826 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
9827
6a7a1b0b
TZ
98282011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
9829
9830 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 9831 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
9832 Reported by Paul Eggert <eggert@cs.ucla.edu>.
9833
841a1577 98342011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
9835
9836 * lisp.h (Qdebug): List symbol.
895009e1 9837 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
9838 * keyboard.c (debug-on-event): New variable.
9839 (handle_user_signal): Break into debugger when debug-on-event
9840 matches the current signal symbol.
9841
f2d3ba6f
DN
98422011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
9843
9844 * alloc.c (check_sblock, check_string_bytes)
9845 (check_string_free_list): Convert to standard C.
9846
42ce4c63
TZ
98472011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
9848
9849 * w32.c (emacs_gnutls_push): Fix typo.
9850
825cd63c
EZ
98512011-04-25 Eli Zaretskii <eliz@gnu.org>
9852
fb11d64d
EZ
9853 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
9854 "cast to pointer from integer of different size".
9855
825cd63c
EZ
9856 Improve doprnt and its use in verror. (Bug#8545)
9857 * doprnt.c (doprnt): Document the set of format control sequences
9858 supported by the function. Use SAFE_ALLOCA instead of always
9859 using `alloca'.
9860
9861 * eval.c (verror): Don't limit the buffer size at size_max-1, that
9862 is one byte too soon. Don't use xrealloc; instead xfree and
9863 xmalloc anew.
9864
e061a11b
TZ
98652011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
9866
9867 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
9868 callbacks stage.
9869
9870 * gnutls.c: Renamed global_initialized to
9871 gnutls_global_initialized. Added internals for the
9872 :verify-hostname-error, :verify-error, and :verify-flags
9873 parameters of `gnutls-boot' and documented those parameters in the
9874 docstring. Start callback support.
9173deec
JB
9875 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
9876 unless a fatal error occurred. Call gnutls_alert_send_appropriate
9877 on error. Return error code.
e061a11b
TZ
9878 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
9879 (emacs_gnutls_read): Likewise.
9880 (Fgnutls_boot): Return handshake error code.
9881 (emacs_gnutls_handle_error): New function.
9882 (wsaerror_to_errno): Likewise.
9883
9884 * w32.h (emacs_gnutls_pull): Add prototype.
9885 (emacs_gnutls_push): Likewise.
9886
9887 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
9888 (emacs_gnutls_push): Likewise.
9889
98902011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
9891
9892 * process.c (wait_reading_process_output): Check if GnuTLS
9893 buffered some data internally if no FDs are set for TLS
9894 connections.
9895
9896 * makefile.w32-in (OBJ2): Add gnutls.$(O).
9897 (LIBS): Link to USER_LIBS.
9898 ($(BLD)/gnutls.$(0)): New target.
9899
fa6996bc
EZ
99002011-04-24 Eli Zaretskii <eliz@gnu.org>
9901
eb35682e
EZ
9902 * xdisp.c (handle_single_display_spec): Rename the
9903 display_replaced_before_p argument into display_replaced_p, to
9904 make it consistent with the commentary. Fix typos in the
9905 commentary.
9906
e2ad650c
EZ
9907 * textprop.c (syms_of_textprop): Remove dead code.
9908 (copy_text_properties): Delete obsolete commentary about an
9909 interface that was deleted long ago. Fix typos in the description
9910 of arguments.
9911
1b2de274
EZ
9912 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
9913 to changes in oldXMenu/XMenu.h from 2011-04-16.
9914 <menu_help_message, prev_menu_help_message>: Constify.
9915 (IT_menu_make_room): menu->help_text is now `const char **';
9916 adjust.
9917
9918 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
9919 to changes in oldXMenu/XMenu.h from 2011-04-16.
9920 (struct XMenu): Declare `help_text' `const char **'.
9921
9922 * xfaces.c <Qunspecified>: Make extern again.
9923
9924 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 9925 required by POSIX.
1b2de274 9926
762b15be
EZ
9927 * doc.c (get_doc_string): Improve the format passed to `error'.
9928
9929 * doprnt.c (doprnt): Improve commentary.
9930
9931 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
9932
9933 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
9934 them with etags.
9935
f1052e5d
EZ
9936 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
9937 changes in globals.h immediately force recompilation.
762b15be
EZ
9938 (TAGS): Depend on $(CURDIR)/m/intel386.h and
9939 $(CURDIR)/s/ms-w32.h.
9940 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 9941
fa6996bc
EZ
9942 * character.c (Fchar_direction): Function deleted.
9943 (syms_of_character): Don't defsubr it.
9944 <char-direction-table>: Deleted.
9945
e6c3da20
EZ
99462011-04-23 Eli Zaretskii <eliz@gnu.org>
9947
9948 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
9949 * doprnt.c: Include limits.h.
9950 (SIZE_MAX): New macro.
04f2d78b
CB
9951 (doprnt): Return a size_t value. 2nd arg is now size_t.
9952 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
9953 Improve overflow protection. Support `l' modifier for integer
9954 conversions. Support %l conversion. Don't assume an EMACS_INT
9955 argument for integer conversions and for %c.
9956
9957 * lisp.h (doprnt): Restore prototype.
9958
9959 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
9960 $(SRC)/character.h.
9961
9962 * Makefile.in (base_obj): Add back doprnt.o.
9963
9964 * deps.mk (doprnt.o): Add back prerequisites.
9965 (callint.o): Depend on character.h.
9966
9967 * eval.c (internal_lisp_condition_case): Include the handler
9968 representation in the error message.
9969 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
9970 when breaking from the loop.
9971
9972 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
9973
9974 * callint.c (Fcall_interactively): When displaying error message
9975 about invalid control letter, pass the character's codepoint, not
9976 a pointer to its multibyte form. Improve display of the character
9977 in octal and display also its hex code.
9978
9979 * character.c (char_string): Use %x to display the (unsigned)
9980 codepoint of an invalid character, to avoid displaying a bogus
9981 negative value.
9982
9983 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
9984 `error', not SYMBOL_NAME itself.
9985
9986 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
9987 character arguments to `error'.
9988
9989 * charset.c (check_iso_charset_parameter): Fix incorrect argument
9990 to `error' in error message about FINAL_CHAR argument. Make sure
9991 FINAL_CHAR is a character, and use %c when it is passed as
9992 argument to `error'.
9993
4ffd0d6b 99942011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
9995
9996 * s/ms-w32.h (localtime): Redirect to sys_localtime.
9997
9998 * w32.c: Include <time.h>.
9999 (sys_localtime): New function.
10000
4ffd0d6b 100012011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
10002
10003 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
10004
4ffd0d6b 10005 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 10006
4ffd0d6b 100072011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 10008
4ffd0d6b
GM
10009 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
10010 zombies (Bug#8467).
aac0c6e3 10011
04c56954
EZ
100122011-04-19 Eli Zaretskii <eliz@gnu.org>
10013
10014 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
10015 gl_state.e_property when gl_state.object is Qt.
10016
10017 * insdel.c (make_gap_larger): Remove limitation of buffer size
10018 to <= INT_MAX.
10019
16a43933
CY
100202011-04-18 Chong Yidong <cyd@stupidchicken.com>
10021
10022 * xdisp.c (lookup_glyphless_char_display)
10023 (produce_glyphless_glyph): Handle cons cell entry in
10024 glyphless-char-display.
10025 (Vglyphless_char_display): Document it.
10026
10027 * term.c (produce_glyphless_glyph): Handle cons cell entry in
10028 glyphless-char-display.
10029
4581706e
CY
100302011-04-17 Chong Yidong <cyd@stupidchicken.com>
10031
10032 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
10033
10034 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
10035
10036 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
10037 definition for no-X builds.
10038
4887c6e2 100392011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 10040
fd35b6f9
PE
10041 Static checks with GCC 4.6.0 and non-default toolkits.
10042
5c1ccb01
PE
10043 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
10044
006c5daa
PE
10045 * process.c (keyboard_bit_set): Define only if SIGIO.
10046 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
10047 (send_process): Repair possible setjmp clobbering.
10048
efc736d3
PE
10049 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
10050
4e2fe2e6
PE
10051 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
10052
f97334a2
PE
10053 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
10054
4e75f29d
PE
10055 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
10056 Define only if needed.
10057
90efadd1
PE
10058 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
10059 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 10060 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 10061
3c647824
PE
10062 * dispextern.h (struct redisplay_interface): Rename param
10063 to avoid shadowing.
e264f262 10064 * termhooks.h (struct terminal): Likewise.
761383f4 10065 * xterm.c (xembed_send_message): Likewise.
3c647824 10066
b58c5c4a
PE
10067 * insdel.c (make_gap_smaller): Define only if
10068 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
10069
cad59032
PE
10070 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
10071 it.
10072
c339dc2e
PE
10073 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
10074 so that we aren't warned about unused symbols.
10075
91a3e27b
PE
10076 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
10077
399c71d3 10078 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 10079
8ffc96f5
PE
10080 * xfns.c (x_real_positions): Mark locals as initialized.
10081
eef9bc79
PE
10082 * xmenu.c (xmenu_show): Don't use uninitialized vars.
10083
098db9dd
PE
10084 * xterm.c: Fix problems found by static analysis with other toolkits.
10085 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
10086 (x_dispatch_event): Declare static if USE_GTK, and
10087 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 10088 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 10089 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
10090 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
10091 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 10092
eb18f6cc
PE
10093 * xmenu.c (menu_help_callback): Pointer type fixes.
10094 Use const pointers when pointing at readonly data. Avoid pointer
10095 signedness clashes.
10096 (FALSE): Remove unused macro.
10097 (update_frame_menubar): Remove unused decl.
10098
1fe72bf8
PE
10099 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
10100
60d9e1db
PE
10101 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
10102 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
10103 (single_menu_item): Rename local to avoid shadowing.
10104
39261c26
PE
10105 * keyboard.c (make_lispy_event): Remove unused local var.
10106
018c5e19
PE
10107 * frame.c, frame.h (x_get_resource_string): Bring this back, but
10108 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
10109
63d2b86e
PE
10110 * bitmaps: Change bitmaps from unsigned char back to the X11
10111 compatible char. Avoid the old compiler warnings about
10112 out-of-range initializers by using, for example, '\xab' rather
10113 than 0xab.
10114
aefd87e1
PE
10115 * xgselect.c (xgselect_initialize): Check vs interface
10116 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
10117
bf501fb9
PE
10118 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
10119
e9829fdf
PE
10120 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
10121 to read-only memory.
10122
1086c095
PE
10123 * fns.c (vector): Remove; this old hack is no longer needed.
10124
2baccd04 10125 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 10126 Remove unused var.
dde42981 10127 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 10128
72391843 10129 * xrdb.c (x_load_resources): Omit unused local.
3565b346 10130
436c16df 10131 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 10132 (x_window): Rename locals to avoid shadowing.
dc5ddd85 10133 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 10134
92bb796d 10135 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 10136 (x_term_init): Remove local to avoid shadowing.
92bb796d 10137
764430a3 10138 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
10139
10140 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
10141 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
10142
d1dfb56c
EZ
101432011-04-16 Eli Zaretskii <eliz@gnu.org>
10144
c4354cb4
EZ
10145 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
10146
d1dfb56c
EZ
10147 Fix regex.c, syntax.c and friends for buffers > 2GB.
10148 * syntax.h (struct gl_state_s): Declare character position members
10149 EMACS_INT.
10150
10151 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
10152
04f2d78b
CB
10153 * textprop.c (verify_interval_modification, interval_of):
10154 Declare arguments EMACS_INT.
d1dfb56c
EZ
10155
10156 * intervals.c (adjust_intervals_for_insertion): Declare arguments
10157 EMACS_INT.
10158
10159 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
10160
10161 * indent.c (Fvertical_motion): Local variable it_start is now
10162 EMACS_INT.
10163
10164 * regex.c (re_match, re_match_2, re_match_2_internal)
10165 (bcmp_translate, regcomp, regexec, print_double_string)
10166 (group_in_compile_stack, re_search, re_search_2, regex_compile)
10167 (re_compile_pattern, re_exec): Declare arguments and local
10168 variables `size_t' and `ssize_t' and return values `regoff_t', as
10169 appropriate.
10170 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
10171 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
10172 <compile_stack_type>: `size' and `avail' are now `size_t'.
10173
10174 * regex.h <regoff_t>: Use ssize_t, not int.
10175 (re_search, re_search_2, re_match, re_match_2): Arguments that
10176 specify buffer/string position and length are now ssize_t and
10177 size_t. Return type is regoff_t.
10178
613052cd
BK
101792011-04-16 Ben Key <bkey76@gmail.com>
10180
10181 * nsfont.m: Fixed bugs in ns_get_family and
10182 ns_descriptor_to_entity that were caused by using free to
10183 deallocate memory blocks that were allocated by xmalloc (via
10184 xstrdup). This caused Emacs to crash when compiled with
10185 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
10186 --enable-checking=xmallocoverrun). xfree is now used to
10187 deallocate these memory blocks.
10188
4170f62f 101892011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 10190
71b41406
PE
10191 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
10192
9587a89d
PE
10193 emacs_write: Accept and return EMACS_INT for sizes.
10194 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
10195 et seq.
10196 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
10197 Accept and return EMACS_INT.
10198 (emacs_gnutls_write): Return the number of bytes written on
10199 partial writes.
10200 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
10201 (emacs_read, emacs_write): Remove check for negative size, as the
10202 Emacs source code has been audited now.
9587a89d
PE
10203 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
10204 (emacs_read, emacs_write): Use it.
273a5f82
PE
10205 * process.c (send_process): Adjust to the new signatures of
10206 emacs_write and emacs_gnutls_write. Do not attempt to store
10207 a byte offset into an 'int'; it might overflow.
9587a89d 10208 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 10209
3e047f51
PE
10210 * sound.c: Don't assume sizes fit in 'int'.
10211 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 10212 Return EMACS_INT, not int.
3e047f51 10213 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
10214 Accept EMACS_INT, not int.
10215 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
10216 record read return values.
10217
cc39a9db
BK
102182011-04-15 Ben Key <bkey76@gmail.com>
10219
c9d0ec6d
JB
10220 * keyboard.c (Qundefined): Don't declare static since it is used
10221 in nsfns.m.
10222 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
10223 static since they are used in nsfont.m.
cc39a9db 10224
6c60eb9f
SM
102252011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
10226
10227 * process.c (Qprocessp): Don't declare static.
10228 * lisp.h (Qprocessp): Declare again.
10229
7990b61a
JB
102302011-04-15 Juanma Barranquero <lekktu@gmail.com>
10231
10232 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
10233
5d4cb038
PE
102342011-04-14 Paul Eggert <eggert@cs.ucla.edu>
10235
8bd7b830 10236 Improve C-level modularity by making more things 'static'.
cd64ea1d 10237
e3b27b31
PE
10238 Don't publish debugger-only interfaces to other modules.
10239 * lisp.h (safe_debug_print, debug_output_compilation_hack):
10240 (verify_bytepos, count_markers): Move decls to the only modules
10241 that need them.
10242 * region-cache.h (pp_cache): Likewise.
10243 * window.h (check_all_windows): Likewise.
10244 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
10245
5d4cb038
PE
10246 * sysdep.c (croak): Now static, if
10247 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
10248 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
10249
10250 * alloc.c (refill_memory_reserve): Now static if
10251 !defined REL_ALLOC || defined SYSTEM_MALLOC.
10252 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 10253
e87b6180
PE
10254 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
10255 Define only if USE_LUCID.
10256
ac64929e
PE
10257 * xrdb.c (x_customization_string, x_rm_string): Now static.
10258
6f37259d
PE
10259 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
10260 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
10261
1683e3ab
PE
10262 * xdisp.c (draw_row_with_mouse_face): Now static.
10263 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
10264
de9c2632
PE
10265 * window.h (check_all_windows): Mark externally visible.
10266
2b96acb7
PE
10267 * window.c (window_deletion_count): Now static.
10268
10269 * undo.c: Make symbols static if they're not exported.
10270 (last_undo_buffer, last_boundary_position, pending_boundary):
10271 Now static.
10272
50436f33
PE
10273 * textprop.c (interval_insert_behind_hooks): Now static.
10274 (interval_insert_in_front_hooks): Likewise.
10275
64520e5c
PE
10276 * term.c: Make symbols static if they're not exported.
10277 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
10278 (max_frame_lines, tty_set_terminal_modes):
10279 (tty_reset_terminal_modes, tty_turn_off_highlight):
10280 (get_tty_terminal): Now static.
10281 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
10282 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 10283 HAVE_WINDOW_SYSTEM.
64520e5c
PE
10284 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
10285 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
10286
1fa53021
PE
10287 * sysdep.c: Make symbols static if they're not exported.
10288 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
10289 Now static.
10290 (sigprocmask_set, full_mask): Remove; unused.
10291 (wait_debugging): Mark as visible.
10292 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
10293 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
10294
d4b43b22
PE
10295 * syntax.c (syntax_temp): Define only if !__GNUC__.
10296
b7c513d0
PE
10297 * sound.c (current_sound_device, current_sound): Now static.
10298
989b29ad
PE
10299 * search.c (searchbufs, searchbuf_head): Now static.
10300
13a55a78
PE
10301 * scroll.c (scroll_cost): Remove; unused.
10302 * dispextern.h (scroll_cost): Remove decl.
10303
de68a1fc
PE
10304 * region-cache.h (pp_cache): Mark as externally visible.
10305
40ccffa6
PE
10306 * process.c: Make symbols static if they're not exported.
10307 (process_tick, update_tick, create_process, chan_process):
10308 (Vprocess_alist, proc_buffered_char, datagram_access):
10309 (fd_callback_data, send_process_frame, process_sent_to): Now static.
10310 (deactivate_process): Mark defn as static, as well as decl.
10311 * lisp.h (create_process): Remove decl.
10312 * process.h (chan_process, Vprocess_alist): Remove decls.
10313
ad64fc97
PE
10314 * print.c: Make symbols static if they're not exported.
10315 (print_depth, new_backquote_output, being_printed, print_buffer):
10316 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
10317 (print_interval, print_number_index, initial_stderr_stream):
10318 Now static.
10319 * lisp.h (Fprinc): Remove decl.
10320 (debug_output_compilation_hack): Mark as externally visible.
10321
adddb265
PE
10322 * sysdep.c (croak): Move decl from here to syssignal.h.
10323 * syssignal.h (croak): Put it here, so the API can be checked when
10324 'croak' is called from dissociate_if_controlling_tty.
10325
1717ede2
PE
10326 * minibuf.c: Make symbols static if they're not exported.
10327 (minibuf_save_list, choose_minibuf_frame): Now static.
10328 * lisp.h (choose_minibuf_frame): Remove decl.
10329
fa5fb2bc
PE
10330 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
10331
1e3890d1
PE
10332 * lread.c: Make symbols static if they're not exported.
10333 (read_objects, initial_obarray, oblookup_last_bucket_number):
10334 Now static.
10335 (make_symbol): Remove; unused.
10336 * lisp.h (initial_obarray, make_symbol): Remove decls.
10337
8a1414fa
PE
10338 * keyboard.c: Make symbols static if they're not exported.
10339 (single_kboard, recent_keys_index, total_keys, recent_keys):
10340 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
10341 (this_single_command_key_start, echoing, last_auto_save):
10342 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
10343 (command_loop, echo_now, keyboard_init_hook, help_char_p):
10344 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
10345 (Vlispy_mouse_stem, double_click_count):
10346 Now static.
10347 (force_auto_save_soon): Define only if SIGDANGER.
10348 (ignore_mouse_drag_p): Now static if
10349 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
10350 (print_help): Remove; unused.
10351 (stop_character, last_timer_event): Mark as externally visible.
10352 * keyboard.h (ignore_mouse_drag_p): Declare only if
10353 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
10354 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
10355 * lisp.h (echoing): Remove decl.
10356 (force_auto_save_soon): Declare only if SIGDANGER.
10357 * xdisp.c (redisplay_window): Simplify code, to make it more
10358 obvious that ignore_mouse_drag_p is not accessed if !defined
10359 USE_GTK && !defined HAVE_NS.
10360
93ea6e8f
PE
10361 * intervals.c: Make symbols static if they're not exported.
10362 (merge_properties_sticky, merge_interval_right, delete_interval):
10363 Now static.
10364 * intervals.h (merge_interval_right, delete_interval): Remove decls.
10365
77382fcc
PE
10366 * insdel.c: Make symbols static if they're not exported.
10367 However, leave prepare_to_modify_buffer alone. It's never
10368 called from outside this function, but that appears to be a bug.
10369 (combine_after_change_list, combine_after_change_buffer):
4889fc82 10370 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
10371 (adjust_after_replace_noundo): Remove; unused.
10372 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 10373 (signal_before_change): Remove decls.
77382fcc 10374
9306c32e
PE
10375 * indent.c (val_compute_motion, val_vmotion): Now static.
10376
cd44d2eb
PE
10377 * image.c: Make symbols static if they're not exported.
10378 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
10379 if USE_GTK.
10380 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
10381 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
10382
ad9a7a06
PE
10383 * fringe.c (standard_bitmaps): Now static.
10384 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
10385
81626931
PE
10386 * frame.c: Make symbols static if they're not exported.
10387 (x_report_frame_params, make_terminal_frame): Now static.
10388 (get_frame_param): Now static, unless HAVE_NS.
10389 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
10390 (x_get_resource_string): Remove; not used.
10391 * frame.h (make_terminal_frame, x_report_frame_params):
10392 (x_get_resource_string); Remove decls.
10393 (x_fullscreen_adjust): Declare only if WINDOWSNT.
10394 * lisp.h (get_frame_param): Declare only if HAVE_NS.
10395
239f9db9
PE
10396 * font.c, fontset.c: Make symbols static if they're not exported.
10397 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
10398 (FACE_SUITABLE_FOR_CHAR_P): Use it.
10399 * font.c (font_close_object): Now static.
10400 * font.h (font_close_object): Remove.
10401 * fontset.c (FONTSET_OBJLIST): Remove.
10402 (free_realized_fontset) #if-0 the body, which does nothing.
10403 (face_suitable_for_char_p): #if-0, as it's never called.
10404 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
10405 * xfaces.c (face_at_string_position):
10406 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
10407 since 0 is always ASCII.
10408
dfcf3579
PE
10409 * fns.c (weak_hash_tables): Now static.
10410
5045092b
PE
10411 * fileio.c: Make symbols static if they're not exported.
10412 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
10413 (Vwrite_region_annotation_buffers): Now static.
10414
57a96f5c
PE
10415 * eval.c: Make symbols static if they're not exported.
10416 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
10417 * lisp.h (backtrace_list): Remove decl.
10418
35f08c38
PE
10419 * emacs.c: Make symbols static if they're not exported.
10420 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
10421 (fatal_error_code, fatal_error_signal_hook, standard_args):
10422 Now static.
10423 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
10424 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
10425 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
10426 * lisp.h (fatal_error_signal_hook): Remove decl.
10427 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
10428
f44bd759
PE
10429 * editfns.c: Move a (normally-unused) function to its only use.
10430 * editfns.c, lisp.h (get_operating_system_release): Remove.
10431 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
10432 worth the hassle of breaking this out.
10433
b532497d
PE
10434 * xterm.c: Make symbols static if they're not exported.
10435 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
10436 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
10437 (x_destroy_window, x_delete_display):
10438 Now static.
10439 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
10440 (x_mouse_leave): Remove; unused.
10441 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
10442 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
10443 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
10444 Remove decls.
10445 (x_mouse_leave): Declare only if WINDOWSNT.
10446 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
10447 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
10448 USE_X_TOOLKIT.
10449
1675728f
PE
10450 * ftxfont.c: Make symbols static if they're not exported.
10451 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
10452 HAVE_FREETYPE.
10453 * font.h (ftxfont_driver): Likewise.
10454
e4cebfca
PE
10455 * xfns.c: Make symbols static if they're not exported.
10456 (x_last_font_name, x_display_info_for_name):
10457 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
10458 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
10459 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
10460 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
10461 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
10462 (last_show_tip_args): Now static.
10463 (xic_defaut_fontset, xic_create_fontsetname): Define only if
10464 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
10465 (x_screen_planes): Remove; unused.
10466 * dispextern.h (x_screen_planes): Remove decl.
10467
5bf46f05
PE
10468 * dispnew.c: Make symbols static if they're not exported.
10469 * dispextern.h (redraw_garbaged_frames, scrolling):
10470 (increment_row_positions): Remove.
10471 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
10472 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
10473 Now static.
10474 (redraw_garbaged_frames): Remove; unused.
10475
435f4c28
PE
10476 * xfaces.c: Make symbols static if they're not exported.
10477 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
10478 Remove decls.
10479 * xterm.h (defined_color): Remove decls.
10480 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
10481 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
10482 (menu_face_changed_default, defined_color, free_realized_face):
10483 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
10484 (ascii_face_of_lisp_face): Remove; unused.
10485
8524aef3
PE
10486 * xdisp.c: Make symbols static if they're not exported.
10487 * dispextern.h (scratch_glyph_row, window_box_edges):
10488 (glyph_to_pixel_coords, set_cursor_from_row):
10489 (get_next_display_element, set_iterator_to_next):
10490 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
10491 (show_mouse_face): Remove decls
10492 * frame.h (message_buf_print): Likewise.
10493 * lisp.h (pop_message, set_message, check_point_in_composition):
10494 Likewise.
10495 * xterm.h (set_vertical_scroll_bar): Likewise.
10496 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
10497 (message_buf_print, scratch_glyph_row, displayed_buffer):
10498 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
10499 (get_next_display_element, show_mouse_face, window_box_edges):
10500 (frame_to_window_pixel_xy, check_point_in_composition):
10501 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
10502 (glyph_to_pixel_coords): Remove; unused.
10503
16390cd2
PE
10504 * dired.c (file_name_completion): Now static.
10505
10506 * dbusbind.c (xd_in_read_queued_messages): Now static.
10507
a25f4dfa
PE
10508 * lisp.h (circular_list_error, FOREACH): Remove; unused.
10509 * data.c (circular_list_error): Remove.
10510
14a9c8df
PE
10511 * commands.h (last_point_position, last_point_position_buffer):
10512 (last_point_position_window): Remove decls.
10513 * keyboard.c: Make these variables static.
10514
04f2d78b
CB
10515 * coding.h (coding, code_convert_region, encode_coding_gap):
10516 Remove decls.
74ab6df5
PE
10517 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
10518 (iso_code_class, detect_coding, code_convert_region): Now static.
10519 (encode_coding_gap): Remove; unused.
10520
38dfbee1
PE
10521 * chartab.c (chartab_chars, chartab_bits): Now static.
10522
a2cb4e63
PE
10523 * charset.h (charset_iso_8859_1): Remove decl.
10524 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
10525 Now static.
10526
127198fd
PE
10527 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
10528 * ccl.c (Vccl_program_table): Now static.
10529 (check_ccl_update): Remove; unused.
10530
d85b608f
PE
10531 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
10532 * category.h: ... from here.
10533 * category.c (check_category_table, set_category_set): Now static.
10534
31cd66f3
PE
10535 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
10536 * lisp.h: Remove these decls.
10537
c358e587
PE
10538 * buffer.c (buffer_count): Remove unused var.
10539
e78aecca
PE
10540 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
10541 so that it's not optimized away.
10542 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
10543 * dispextern.h (bidi_dump_cached_states): Remove, since it's
10544 exported only to the debugger.
10545
e192d7d3 10546 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 10547 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 10548
92470028
PE
10549 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
10550 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
10551 was inaccessible from Lisp.
10552 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
10553 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
10554
244ed907
PE
10555 alloc.c: Import and export fewer symbols, and remove unused items.
10556 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
10557 is defined.
10558 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
10559 it's not optimized away by whole-program optimization.
10560 (message_enable_multibyte, free_misc): Remove.
10561 (catchlist, handlerlist, mark_backtrace):
10562 Declare only if BYTE_MARK_STACK.
10563 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
10564 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
10565 (message_enable_multibyte): Remove decl.
10566 (free_misc, interval_free_list, float_block, float_block_index):
10567 (n_float_blocks, float_free_list, cons_block, cons_block_index):
10568 (cons_free_list, last_marked_index):
10569 Now static.
10570 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
10571 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
10572 (mark_backtrace): Define only if BYTE_MARK_STACK.
10573 * xdisp.c (message_enable_multibyte): Now static.
10574
61c2b50e 10575 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
10576 This makes it easier for human readers (and static analyzers)
10577 to see whether these variables are used from other modules.
10578 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
10579 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
10580 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
10581 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
10582 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
10583 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
10584 * xmenu.c, xselect.c:
10585 Declare Q* vars static if they are not used in other modules.
10586 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
10587 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
10588 Remove decls of unexported vars.
10589 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
10590
95c82688
PE
10591 * lisp.h (DEFINE_FUNC): Make sname 'static'.
10592
16a97296
PE
10593 Make Emacs functions such as Fatom 'static' by default.
10594 This makes it easier for human readers (and static analyzers)
10595 to see whether these functions can be called from other modules.
10596 DEFUN now defines a static function. To make the function external
10597 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
10598 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
10599 (Finit_image_library):
16a97296
PE
10600 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
10601 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
10602 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
10603 Remove decls, since these functions are now static.
10604 (Funintern, Fget_internal_run_time): New decls, since these functions
10605 were already external.
95c82688 10606
16a97296
PE
10607 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
10608 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
10609 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
10610 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
10611 * keyboard.c, keymap.c, lread.c:
10612 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
10613 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
10614 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
10615 Mark functions with DEFUE instead of DEFUN,
10616 if they are used in other modules.
10617 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
10618 decls for now-static functions.
10619 * buffer.h (Fdelete_overlay): Remove decl.
10620 * callproc.c (Fgetenv_internal): Mark as internal.
10621 * composite.c (Fremove_list_of_text_properties): Remove decl.
10622 (Fcomposition_get_gstring): New forward static decl.
10623 * composite.h (Fcomposite_get_gstring): Remove decl.
10624 * dired.c (Ffile_attributes): New forward static decl.
10625 * doc.c (Fdocumntation_property): New forward static decl.
10626 * eval.c (Ffetch_bytecode): New forward static decl.
10627 (Funintern): Remove extern decl; now in .h file where it belongs.
10628 * fileio.c (Fmake_symbolic_link): New forward static decl.
10629 * image.c (Finit_image_library): New forward static decl.
10630 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
10631 * intervals.h (Fprevious_property_change):
10632 (Fremove_list_of_text_properties): Remove decls.
10633 * keyboard.c (Fthis_command_keys): Remove decl.
10634 (Fcommand_execute): New forward static decl.
10635 * keymap.c (Flookup_key): New forward static decl.
10636 (Fcopy_keymap): Now static.
10637 * keymap.h (Flookup_key): Remove decl.
10638 * process.c (Fget_process): New forward static decl.
10639 (Fprocess_datagram_address): Mark as internal.
10640 * syntax.c (Fsyntax_table_p): New forward static decl.
10641 (skip_chars): Remove duplicate decl.
10642 * textprop.c (Fprevious_property_change): New forward static decl.
10643 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
10644 Now internal.
10645 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
10646 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
10647
785bbd42
PE
10648 * editfns.c (Fformat): Remove unreachable code.
10649
8b913b57
AS
106502011-04-14 Andreas Schwab <schwab@linux-m68k.org>
10651
10652 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
10653 change. (Bug#8496)
10654
a6744a35
EZ
106552011-04-13 Eli Zaretskii <eliz@gnu.org>
10656
10657 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
10658 when at ZV. (Bug#8487)
10659
e7974947
AS
106602011-04-12 Andreas Schwab <schwab@linux-m68k.org>
10661
baad03f0
AS
10662 * charset.c (Fclear_charset_maps): Use xfree instead of free.
10663 (Bug#8437)
10664 * keyboard.c (parse_tool_bar_item): Likewise.
10665 * sound.c (sound_cleanup, alsa_close): Likewise.
10666 * termcap.c (tgetent): Likewise.
10667 * xfns.c (x_default_font_parameter): Likewise.
10668 * xsettings.c (read_and_apply_settings): Likewise.
10669
e7974947
AS
10670 * alloc.c (overrun_check_malloc, overrun_check_realloc)
10671 (overrun_check_free): Protoize.
10672
28272684
PE
106732011-04-12 Paul Eggert <eggert@cs.ucla.edu>
10674
10675 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
10676 since callers should never pass a negative size.
10677 Change the signature to match that of plain 'read' and 'write'; see
10678 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
10679 * lisp.h: Update prototypes of emacs_write and emacs_read.
10680
11997c76
EZ
106812011-04-11 Eli Zaretskii <eliz@gnu.org>
10682
10683 * xdisp.c (redisplay_window): Don't try to determine the character
10684 position of the scroll margin if the window start point w->startp
e896f03c 10685 is outside the buffer's accessible region. (Bug#8468)
11997c76 10686
8a2cbd72
EZ
106872011-04-10 Eli Zaretskii <eliz@gnu.org>
10688
10689 Fix write-region and its subroutines for buffers > 2GB.
10690 * fileio.c (a_write, e_write): Modify declaration of arguments and
10691 local variables to support buffers larger than 2GB.
10692 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
10693
10694 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
10695 argument, local variables, and return value.
10696
10697 * lisp.h: Update prototypes of emacs_write and emacs_read.
10698
10699 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
10700
4073e537 107012011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 10702
1ebfdcb6
PE
10703 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
10704
b2ded58d
PE
10705 Fix more problems found by GCC 4.6.0's static checks.
10706
7d66342c
PE
10707 * xdisp.c (vmessage): Use a better test for character truncation.
10708
bbf47d44
PE
10709 * charset.c (load_charset_map): <, not <=, for optimization,
10710 and to avoid potential problems with integer overflow.
9248994d 10711 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 10712 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 10713 * editfns.c (Fformat): Likewise.
1e69125e 10714 * syntax.c (skip_chars): Likewise.
3befa583 10715
e3019616
PE
10716 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
10717 This also lets GCC 4.6.0 generate slightly better loop code.
10718
becfa255
PE
10719 * callint.c (Fcall_interactively): <, not <=, for optimization.
10720 (Fcall_interactively): Count the number of arguments produced,
10721 not the number of arguments given. This is simpler and lets GCC
10722 4.6.0 generate slightly better code.
10723
dae0cd48
PE
10724 * ftfont.c: Distingish more carefully between FcChar8 and char.
10725 The previous code passed unsigned char * to a functions like
10726 strlen and xstrcasecmp that expect char *, which does not
10727 conform to the C standard.
10728 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
10729 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
10730 char * when the C standard requires it.
10731
76032d70
PE
10732 * keyboard.c (read_char): Remove unused var.
10733
eb3f1cc8
PE
10734 * eval.c: Port to Windows vsnprintf (Bug#8435).
10735 Include <limits.h>.
10736 (SIZE_MAX): Define if the headers do not.
10737 (verror): Do not give up if vsnprintf returns a negative count.
10738 Instead, grow the buffer. This ports to Windows vsnprintf, which
10739 does not conform to C99. Problem reported by Eli Zaretskii.
10740 Also, simplify the allocation scheme, by avoiding the need for
10741 calling realloc, and removing the ALLOCATED variable.
10742
70476b54
PE
10743 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
10744
12020a9e
PE
10745 Remove invocations of doprnt, as Emacs now uses vsnprintf.
10746 But keep the doprint source code for now, as we might revamp it
10747 and use it again (Bug#8435).
ea6c7ae6
PE
10748 * lisp.h (doprnt): Remove.
10749 * Makefile.in (base_obj): Remove doprnt.o.
10750 * deps.mk (doprnt.o): Remove.
10751
5fdb398c
PE
10752 error: Print 32- and 64-bit integers portably (Bug#8435).
10753 Without this change, on typical 64-bit hosts error ("...%d...", N)
10754 was used to print both 32- and 64-bit integers N, which relied on
10755 undefined behavior.
61bdb816 10756 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
10757 * lisp.h (error, verror): Mark as printf-like functions.
10758 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
10759 Report overflow in size calculations when allocating printf buffer.
10760 Do not truncate output string at its first null byte.
10761 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
10762 Truncate the output at a character boundary, since vsnprintf does not
10763 do that.
10764 * charset.c (check_iso_charset_parameter): Convert internal
10765 character to string before calling 'error', since %c now has the
10766 printf meaning.
10767 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
10768 overflow when computing char to be passed to 'error'. Do not
10769 pass Lisp_Object to 'error'; pass the integer instead.
10770 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
10771 formatted with plain %d.
10772
b189fa66
PE
10773 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
10774
bff87ef0
PE
10775 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
10776
7e2cac20
PE
10777 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
10778
ce4d90b5
PE
10779 * xterm.c (x_catch_errors): Remove duplicate declaration.
10780
266c9547
PE
10781 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
10782
79c49ad2
PE
10783 * xdisp.c, lisp.h (message_nolog): Remove; unused.
10784
368f4090
JM
107852011-04-10 Jim Meyering <meyering@redhat.com>
10786
10787 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
10788 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
10789 return ssize_t not "int", and use size_t as the buffer length.
10790 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
10791 * gnutls.h: Update declarations.
10792 * process.c (read_process_output): Use ssize_t, to match.
10793 (send_process): Likewise.
10794
a32d4040
CY
107952011-04-09 Chong Yidong <cyd@stupidchicken.com>
10796
10797 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
10798
8546720e 107992011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 10800
04f2d78b
CB
10801 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
10802 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 10803
8546720e
GM
10804 * xterm.c (handle_one_xevent):
10805 * xmenu.c (create_and_show_popup_menu):
10806 * xselect.c (x_decline_selection_request)
10807 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 10808
0a2f5c1a 108092011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
10810
10811 Fix some uses of `int' instead of EMACS_INT.
10812 * search.c (string_match_1, fast_string_match)
10813 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
10814 (scan_buffer, find_next_newline_no_quit)
10815 (find_before_next_newline, search_command, Freplace_match)
10816 (Fmatch_data): Make some `int' variables be EMACS_INT.
10817
10818 * xdisp.c (display_count_lines): 3rd argument and return value now
10819 EMACS_INT. All callers changed.
10820 (pint2hrstr): Last argument is now EMACS_INT.
10821
10822 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
10823 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
10824 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
10825 (decode_coding_utf_16, decode_coding_emacs_mule)
10826 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
10827 (decode_coding_ccl, decode_coding_charset)
10828 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
10829 (decode_coding_iso_2022, decode_coding_emacs_mule)
10830 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
10831 <char_offset, last_offset>: Declare EMACS_INT.
10832 (encode_coding_utf_8, encode_coding_utf_16)
10833 (encode_coding_emacs_mule, encode_invocation_designation)
10834 (encode_designation_at_bol, encode_coding_iso_2022)
10835 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
10836 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
10837 Declare EMACS_INT.
10838 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
10839 (encode_invocation_designation): Last argument P_NCHARS is now
10840 EMACS_INT.
10841 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
10842 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
10843
10844 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
10845 All users changed.
10846
10847 * ccl.c (Fccl_execute_on_string): Declare some variables
10848 EMACS_INT.
10849
8546720e 108502011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
10851
10852 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
10853
4e19a977
CS
108542011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
10855
10856 * process.c (Fformat_network_address): Doc fix.
10857
87302331
R
108582011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
10859
ee7683eb 10860 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 10861
cbb59342
CY
108622011-04-08 Chong Yidong <cyd@stupidchicken.com>
10863
10864 * keyboard.c (read_char): Call Lisp function help-form-show,
10865 instead of using internal_with_output_to_temp_buffer.
10866 (Qhelp_form_show): New var.
e0d38eeb 10867 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
10868
10869 * print.c (internal_with_output_to_temp_buffer): Function deleted.
10870
10871 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
10872
e67a13ab
CY
108732011-04-06 Chong Yidong <cyd@stupidchicken.com>
10874
04f2d78b
CB
10875 * process.c (Flist_processes): Remove to Lisp.
10876 (list_processes_1): Delete.
e67a13ab 10877
973f782d
EZ
108782011-04-06 Eli Zaretskii <eliz@gnu.org>
10879
7c106b1e
EZ
10880 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
10881
973f782d
EZ
10882 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
10883
41cf7d1a 108842011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 10885
ca23cc88
PE
10886 Fix more problems found by GCC 4.6.0's static checks.
10887
f390e2d5
PE
10888 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
10889
42eea0d0
PE
10890 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
10891
b69769da 10892 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 10893
f9541e84
PE
10894 * xdisp.c (vmessage): Mark as a printf-like function.
10895
13841b55
PE
10896 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
10897
c136c10f
PE
10898 * sound.c (sound_warning): Don't crash if arg contains a printf format.
10899
5e2d4a30
PE
10900 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
10901 printf-like functions.
10902 (tiff_load): Add casts to remove these marks before passing them
10903 to system-supplied API.
10904
583f48b9
PE
10905 * eval.c (Fsignal): Remove excess argument to 'fatal'.
10906
b25d760e
PE
10907 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
10908 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
10909 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
10910 directly, rather than having caller test rule sign. This avoids
10911 some unnecessary tests.
10912 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
10913 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
10914 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 10915
bc7b6697 10916 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 10917 (xfont_open): Avoid unnecessary tests.
bc7b6697 10918
27ccc379
PE
10919 * composite.c (composition_gstring_put_cache): Use unsigned integer.
10920
dcd5c89a
PE
10921 * composite.h, composite.c (composition_gstring_put_cache):
10922 Use EMACS_INT, not int, for length.
10923
b13a45c6
PE
10924 * composite.h (COMPOSITION_DECODE_REFS): New macro,
10925 breaking out part of COMPOSITION_DECODE_RULE.
10926 (COMPOSITION_DECODE_RULE): Use it.
10927 * composite.c (get_composition_id): Remove unused local vars,
10928 by using the new macro.
10929
1e792e4d
PE
10930 * textprop.c (set_text_properties_1): Change while to do-while,
10931 since the condition is always true at first.
10932
dc6c6455 10933 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
10934 (interval_deletion_adjustment): Return unsigned value.
10935 All uses changed.
dc6c6455 10936
aba7731a
PE
10937 * process.c (list_processes_1, create_pty, read_process_output):
10938 (exec_sentinel): Remove vars that were set but not used.
afd4052b 10939 (create_pty): Remove unnecessary "volatile"s.
bc57d757 10940 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 10941 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 10942 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 10943
fdfc4bf3
PE
10944 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
10945
fca8fe46 10946 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 10947 (update_syntax_table): Use unsigned instead of int.
fca8fe46 10948
06a0259a 10949 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 10950 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 10951 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 10952
e7b9e80f
PE
10953 * print.c (print_error_message): Avoid int overflow.
10954
56201685
PE
10955 * font.c (font_list_entities): Redo for clarity,
10956 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
10957
78834453 10958 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 10959 (font_score): Avoid potential overflow in diff calculation.
78834453 10960
0bc0b309 10961 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 10962 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 10963
e610eaca
PE
10964 * eval.c (funcall_lambda): Rename local to avoid shadowing.
10965
b895abce
PE
10966 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
10967 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
10968 can always succeed if overflow has undefined behavior.
10969
1f1d9321 10970 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 10971 (wordify): Omit three unnecessary tests.
1f1d9321 10972
c59478bc
PE
10973 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
10974 All callers changed. This avoids the need for an unused var.
10975
79b73827
PE
10976 * casefiddle.c (casify_region): Remove var that is set but not used.
10977
a4db5dfe
PE
10978 * dired.c (file_name_completion): Remove var that is set but not used.
10979
43aae36e
PE
10980 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
10981
2a47c44d 10982 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 10983 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 10984
a37c69bf
PE
10985 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
10986 Check for integer overflow on size calculations.
10987
328ab8e7
PE
10988 * buffer.c (Fprevious_overlay_change): Remove var that is set
10989 but not used.
10990
e5a2a5cb
PE
10991 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
10992 Remove vars that are set but not used.
8d84a6eb 10993 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 10994 (timer_check_2): Mark vars as initialized.
e5a2a5cb 10995
a60e5f68
PE
10996 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
10997
f661cb61 10998 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 10999 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 11000
f0397f5a
PE
11001 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
11002 that are set but not used.
11003
8664db06 11004 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 11005 if XCreateBitmapFromData fails (Bug#8410).
8664db06 11006
6abdaa4a
PE
11007 * xselect.c (x_get_local_selection, x_handle_property_notify):
11008 Remove vars that are set but not used.
11009
0ce7538d 11010 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 11011 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 11012
9ae848fc
PE
11013 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
11014 Remove var that is set but not used.
0b918413
PE
11015 (scroll_bar_windows_size): Now size_t, not int.
11016 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
11017 Check for overflow.
9ae848fc 11018
a5a62657
PE
11019 * xfaces.c (realize_named_face): Remove vars that are set but not used.
11020 (map_tty_color) [!defined MSDOS]: Likewise.
11021
5c5cdd39
PE
11022 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
11023
66ebf983
PE
11024 * coding.c: Remove vars that are set but not used.
11025 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
11026 All callers changed.
11027 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
11028 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
11029 (decode_coding_charset): Remove vars that are set but not used.
11030
1be4d761
PE
11031 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
11032 that is set but not used.
11033
47553fa8
PE
11034 * print.c (print_object): Remove var that is set but not used.
11035
1f7196bf 11036 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
11037 The gnulib version avoids calling malloc in the usual case,
11038 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
11039 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
11040 * filelock.c (current_lock_owner): Likewise.
11041 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
11042 * sysdep.c: Include allocator.h, careadlinkat.h.
11043 (emacs_no_realloc_allocator): New static constant.
11044 (emacs_readlink): New function.
fdb61804
PE
11045 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
11046 ../lib/careadlinkat.h.
d1fdcab7 11047
f84c17c7
SM
110482011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
11049
11050 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
11051 first non-nil return value).
11052
ef3862ad
JD
110532011-04-03 Jan Djärv <jan.h.d@swipnet.se>
11054
11055 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
11056 if not defined (Bug#8403).
11057
376a7006
JB
110582011-04-02 Juanma Barranquero <lekktu@gmail.com>
11059
11060 * xdisp.c (display_count_lines): Remove parameter `start',
11061 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11062 (get_char_face_and_encoding): Remove parameter `multibyte_p',
11063 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11064 (fill_stretch_glyph_string): Remove parameters `row' and `area',
11065 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
11066 and thereabouts. All callers changed.
11067 (get_per_char_metric): Remove parameter `f', unused since
11068 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
11069
6ca3801d
JM
110702011-04-02 Jim Meyering <meyering@redhat.com>
11071
11072 do not dereference NULL upon failed strdup
11073 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
11074 (ns_get_family): Likewise.
11075
d8e2b5ba
JB
110762011-04-02 Juanma Barranquero <lekktu@gmail.com>
11077
11078 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
11079
8c74fcbd
JD
110802011-04-02 Jan Djärv <jan.h.d@swipnet.se>
11081
11082 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
11083 later (Bug#8403).
11084
7200d79c
SM
110852011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
11086
03408648 11087 Add lexical binding.
7200d79c 11088
03408648
SM
11089 * window.c (Ftemp_output_buffer_show): New fun.
11090 (Fsave_window_excursion):
11091 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
11092
11093 * lread.c (lisp_file_lexically_bound_p): New function.
11094 (Fload): Bind Qlexical_binding.
11095 (readevalloop): Remove `evalfun' arg.
11096 Bind Qinternal_interpreter_environment.
11097 (Feval_buffer): Bind Qlexical_binding.
11098 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
11099 Mark as dynamic.
11100 (syms_of_lread): Declare `lexical-binding'.
11101
11102 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
11103
11104 * keyboard.c (eval_dyn): New fun.
11105 (menu_item_eval_property): Use it.
ca105506
SM
11106
11107 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 11108
03408648
SM
11109 * fns.c (concat, mapcar1): Accept byte-code-functions.
11110
11111 * eval.c (Fsetq): Handle lexical vars.
11112 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
11113 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
11114 (FletX, Flet): Obey lexical binding.
11115 (Fcommandp): Handle closures.
11116 (Feval): New `lexical' arg.
11117 (eval_sub): New function extracted from Feval. Use it almost
11118 everywhere where Feval was used. Look up vars in lexical env.
11119 Handle closures.
11120 (Ffunctionp): Move from subr.el.
11121 (Ffuncall): Handle closures.
11122 (apply_lambda): Remove `eval_flags'.
11123 (funcall_lambda): Handle closures and new byte-code-functions.
11124 (Fspecial_variable_p): New function.
11125 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
11126 but without exporting it to Lisp.
23aba0ea 11127
23aba0ea 11128 * doc.c (Fdocumentation, store_function_docstring):
03408648 11129 * data.c (Finteractive_form): Handle closures.
23aba0ea 11130
03408648
SM
11131 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
11132 interactive spec.
ba83908c 11133
04f2d78b
CB
11134 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
11135 New byte-codes.
03408648
SM
11136 (exec_byte_code): New function extracted from Fbyte_code to handle new
11137 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 11138
03408648 11139 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 11140
03408648 11141 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 11142
e2abce01
JB
111432011-03-31 Juanma Barranquero <lekktu@gmail.com>
11144
11145 * xdisp.c (redisplay_internal): Fix prototype.
11146
63696a73 111472011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 11148
63696a73 11149 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
11150 (try_scrolling): Use it when setting scroll_limit.
11151 Limit scrolling to 100 screen lines.
63696a73
EZ
11152 (redisplay_window): Even when falling back on "recentering",
11153 position point in the window according to scroll-conservatively,
11154 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
11155
11156 (try_scrolling): When point is above the window, allow searching
11157 as far as scroll_max, or one screenful, to compute vertical
11158 distance from PT to the scroll margin position. This prevents
11159 try_scrolling from unnecessarily failing when
11160 scroll-conservatively is set to a value slightly larger than the
11161 window height. Clean up the case of PT below the margin at bottom
11162 of window: scroll_max can no longer be INT_MAX. When aggressive
11163 scrolling is in use, don't let point enter the opposite scroll
11164 margin as result of the scroll.
11165 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
11166 threshold of 100 lines for never-recentering scrolling.
11167
e4cc2dfc
JB
111682011-03-31 Juanma Barranquero <lekktu@gmail.com>
11169
11170 * dispextern.h (move_it_by_lines):
11171 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
11172 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
11173 (message_log_check_duplicate): Remove parameters `prev_bol' and
11174 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11175 (redisplay_internal): Remove parameter `preserve_echo_area',
11176 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
11177
11178 * indent.c (Fvertical_motion):
11179 * window.c (window_scroll_pixel_based, Frecenter):
11180 Don't pass `need_y_p' to `move_it_by_lines'.
11181
1c470562
SM
111822011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
11183
44f230aa
SM
11184 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
11185 steal a few bits to be more compact.
11186 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
11187 Remove unneeded casts.
11188
1c470562
SM
11189 * bytecode.c (Fbyte_code): CAR and CDR can GC.
11190
888adce9
ZK
111912011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
11192
11193 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
11194 binding" message (bug#7967).
11195
f838ed7b
PE
111962011-03-30 Paul Eggert <eggert@cs.ucla.edu>
11197
77861b95
PE
11198 Fix more problems found by GCC 4.6.0's static checks.
11199
de6dbc14
PE
11200 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
11201 Remove unused local var.
11202
f838ed7b
PE
11203 * editfns.c (Fmessage_box): Remove unused local var.
11204
792c7b2b
PE
11205 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
11206 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11207 Omit unused local vars.
c499e557 11208 * window.c (shrink_windows): Omit unused local var.
b01a1c29 11209 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
11210 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
11211 Omit unused local var.
11212
ba0165e1
PE
11213 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
11214 Don't assume string length fits in int.
32ad8845 11215 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 11216 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 11217
3c59b4c9
PE
11218 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
11219 instead of alloca (Bug#8344).
11220
a3eed478 11221 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 11222 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 11223
eb4d412d
PE
11224 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
11225
1658b401
PE
11226 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
11227 concerns.
11228
11229 * term.c (produce_glyphless_glyph): Remove unnecessary test.
11230
11231 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 11232
9a2c6e05
PE
11233 * keyboard.c (syms_of_keyboard): Use the same style as later
11234 in this function when indexing through an array. This also
11235 works around GCC bug 48267.
11236
03d0a109
PE
11237 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
11238
44f730c8
PE
11239 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
11240
fe75f926
PE
11241 * chartab.c (sub_char_table_ref_and_range): Redo for slight
11242 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
11243
ffa8c828
PE
11244 * keyboard.c, keyboard.h (num_input_events): Now size_t.
11245 This avoids undefined behavior on integer overflow, and is a bit
11246 more convenient anyway since it is compared to a size_t variable.
11247
c5101a77
PE
11248 Variadic C functions now count arguments with size_t, not int.
11249 This avoids an unnecessary limitation on 64-bit machines, which
11250 caused (substring ...) to crash on large vectors (Bug#8344).
11251 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
11252 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 11253 All variadic functions and their callers changed accordingly.
c5101a77
PE
11254 (struct gcpro.nvars): Now size_t, not int. All uses changed.
11255 * data.c (arith_driver, float_arith_driver): Likewise.
11256 * editfns.c (general_insert_function): Likewise.
11257 * eval.c (struct backtrace.nargs, interactive_p)
11258 (internal_condition_case_n, run_hook_with_args, apply_lambda)
11259 (funcall_lambda, mark_backtrace): Likewise.
11260 * fns.c (concat): Likewise.
11261 * frame.c (x_set_frame_parameters): Likewise.
11262 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
11263 0 if not found, not -1. All callers changed.
11264
dd3f25f7
PE
11265 * alloc.c (garbage_collect): Don't assume stack size fits in int.
11266 (stack_copy_size): Now size_t, not int.
11267 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
11268
461c2ab9
JB
112692011-03-28 Juanma Barranquero <lekktu@gmail.com>
11270
11271 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
11272 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11273 All callers changed.
11274
11275 * lisp.h (multibyte_char_to_unibyte):
11276 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
11277 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11278 * character.h (CHAR_TO_BYTE8):
11279 * cmds.c (internal_self_insert):
11280 * editfns.c (general_insert_function):
11281 * keymap.c (push_key_description):
11282 * search.c (Freplace_match):
11283 * xdisp.c (message_dolog, set_message_1): All callers changed.
11284
f6d62986
SM
112852011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11286
11287 * keyboard.c (safe_run_hook_funcall): New function.
11288 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
11289 don't set the hook to nil, but remove the offending function instead.
11290 (Qcommand_hook_internal): Remove, unused.
11291 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
11292 Vcommand_hook_internal.
11293
11294 * eval.c (enum run_hooks_condition): Remove.
11295 (funcall_nil, funcall_not): New functions.
11296 (run_hook_with_args): Call each function through a `funcall' argument.
11297 Remove `cond' argument, now redundant.
11298 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
11299 (Frun_hook_with_args_until_failure): Adjust accordingly.
11300 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
11301
1db5b1ad
JB
113022011-03-28 Juanma Barranquero <lekktu@gmail.com>
11303
11304 * dispextern.h (string_buffer_position): Remove declaration.
11305
11306 * print.c (strout): Remove parameter `multibyte', unused since
11307 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
11308
11309 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
11310 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
11311 All callers changed.
11312
11313 * w32.c (_wsa_errlist): Use braces for struct initializers.
11314
11315 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
11316 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
11317 All callers changed.
11318 (string_buffer_position): Likewise. Also, make static (it's never
11319 used outside xdisp.c).
11320 (cursor_row_p): Remove parameter `w', unused since
11321 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
11322 (decode_mode_spec): Remove parameter `precision', introduced during
11323 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
11324 All callers changed.
11325
5ffb62aa
JD
113262011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11327
11328 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
11329
461c2ab9 113302011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
11331
11332 * nsterm.m (ns_menu_bar_is_hidden): New variable.
11333 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
11334 (ns_update_auto_hide_menu_bar): New functions.
11335 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
11336 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
11337 ns_constrain_all_frames.
11338 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
11339 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
11340
5c380ffb
JD
113412011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11342
11343 * nsmenu.m (runDialogAt): Remove argument to timer_check.
11344
9af30bdf
GM
113452011-03-27 Glenn Morris <rgm@gnu.org>
11346
11347 * syssignal.h: Replace RETSIGTYPE with void.
11348 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
11349 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
11350 Replace SIGTYPE with void everywhere.
11351 * s/usg5-4-common.h (SIGTYPE): Remove definition.
11352 * s/template.h (SIGTYPE): Remove commented out definition.
11353
e2abce01
JB
113542011-03-26 Eli Zaretskii <eliz@gnu.org>
11355
11356 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
11357 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
11358
f868cd8a
JB
113592011-03-26 Juanma Barranquero <lekktu@gmail.com>
11360
59eb0929
JB
11361 * w32.c (read_unc_volume): Use parameter `henum', instead of
11362 global variable `wget_enum_handle'.
11363
11364 * keymap.c (describe_vector): Remove parameters `indices' and
11365 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
11366 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
11367
f868cd8a
JB
11368 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
11369
11370 * keyboard.c (timer_check): Remove parameter `do_it_now',
11371 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
11372 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
11373 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
11374
11375 * keyboard.c (read_char):
11376 * w32menu.c (w32_menu_display_help):
11377 * xmenu.c (show_help_event, menu_help_callback):
11378 Adjust calls to `show_help_echo'.
11379
11380 * gtkutil.c (xg_maybe_add_timer):
11381 * keyboard.c (readable_events):
11382 * process.c (wait_reading_process_output):
11383 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
11384
11385 * insdel.c (adjust_markers_gap_motion):
11386 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
11387 (gap_left, gap_right): Don't call it.
11388
2ecf6fdb
CY
113892011-03-25 Chong Yidong <cyd@stupidchicken.com>
11390
11391 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
11392 incurred during fontification.
11393
6b1f9ba4
JB
113942011-03-25 Juanma Barranquero <lekktu@gmail.com>
11395
11396 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
11397 (DEFVAR_PER_BUFFER): Don't pass it.
11398
11399 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
11400 (scrolling_window): Don't pass it.
11401
0f4a96b5
JB
114022011-03-25 Juanma Barranquero <lekktu@gmail.com>
11403
11404 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
11405
11406 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
11407 and `suffix'.
11408 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
11409 of variables specific to SELinux and computation of `encoded_absname'.
11410
11411 * image.c (XPutPixel): Remove unused variable `height'.
11412
11413 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
11414
11415 * unexw32.c (get_section_info): Remove unused variable `section'.
11416
11417 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
11418 (system_process_attributes): Remove unused variable `sess'.
11419 (sys_read): Remove unused variable `err'.
11420
11421 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
11422 (w32_wnd_proc): Remove unused variable `isdead'.
11423 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
11424 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
11425 (x_create_tip_frame): Remove unused variable `tem'.
11426
11427 * w32inevt.c (w32_console_read_socket):
11428 Remove unused variable `no_events'.
11429
11430 * w32term.c (x_draw_composite_glyph_string_foreground):
11431 Remove unused variable `width'.
11432
1149507c
JB
114332011-03-24 Juanma Barranquero <lekktu@gmail.com>
11434
11435 * w32term.c (x_set_glyph_string_clipping):
11436 Don't pass uninitialized region to CombineRgn.
11437
9c88f339
JB
114382011-03-23 Juanma Barranquero <lekktu@gmail.com>
11439
11440 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
11441 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
11442 (Fx_close_connection): Remove unused variable `i'.
11443
11444 * w32font.c (w32font_draw): Return number of glyphs.
11445 (w32font_open_internal): Remove unused variable `i'.
11446 (w32font_driver): Add missing initializer.
11447
11448 * w32menu.c (utf8to16): Remove unused variable `utf16'.
11449 (fill_in_menu): Remove unused variable `items_added'.
11450
11451 * w32term.c (last_mouse_press_frame): Remove static global variable.
11452 (w32_clip_to_row): Remove unused variable `f'.
11453 (x_delete_terminal): Remove unused variable `i'.
11454
11455 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
11456 (NOTHING): Remove unused static global variable.
11457 (uniscribe_check_otf): Remove unused variable `table'.
11458 (uniscribe_font_driver): Add missing initializers.
11459
dee091a3
JD
114602011-03-23 Julien Danjou <julien@danjou.info>
11461
11462 * term.c (Fsuspend_tty, Fresume_tty):
11463 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
11464 * window.c (temp_output_buffer_show):
11465 * insdel.c (signal_before_change):
11466 * frame.c (Fhandle_switch_frame):
11467 * fileio.c (Fdo_auto_save):
11468 * emacs.c (Fkill_emacs):
11469 * editfns.c (save_excursion_restore):
11470 * cmds.c (internal_self_insert):
11471 * callint.c (Fcall_interactively):
11472 * buffer.c (Fkill_all_local_variables):
11473 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
11474 Use Frun_hooks.
0f4a96b5 11475 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 11476 unconditionally since it does the check itself.
dee091a3 11477
2c520ab5 114782011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 11479
c9c49752
PE
11480 Fix more problems found by GCC 4.5.2's static checks.
11481
8abc3f12
PE
11482 * coding.c (encode_coding_raw_text): Avoid unnecessary test
11483 the first time through the loop, since we know p0 < p1 then.
11484 This also avoids a gcc -Wstrict-overflow warning.
11485
a2d26660
PE
11486 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
11487 leading to a memory leak, possible in functions like
11488 load_charset_map_from_file that can allocate an unbounded number
b12ef411 11489 of objects (Bug#8318).
a2d26660 11490
916c72e9
PE
11491 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
11492 that could (at least in theory) be that large.
11493
19ab8a18
PE
11494 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
11495 This is less likely to overflow, and avoids undefined behavior if
11496 overflow does occur. All callers changed. Use strtoul to scan
11497 for the unsigned long integer.
b7cbbd6f
PE
11498 (pint2hrstr): Simplify and tune code slightly.
11499 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 11500
f0641eff
PE
11501 * scroll.c (do_scrolling): Work around GCC bug 48228.
11502 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
11503
7f650bb9
PE
11504 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
11505 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
11506 (validate_x_resource_name): Simplify count usage.
11507 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 11508
37dd57d1
PE
11509 * fileio.c (Fcopy_file): Report error if fchown or fchmod
11510 fail (Bug#8306).
81e56e61 11511
699979fc 11512 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 11513
401bf9b4
PE
11514 * process.c (Fmake_network_process): Use socklen_t, not int,
11515 where POSIX says socklen_t is required in portable programs.
11516 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 11517 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
11518 (Fmake_network_process, server_accept_connection):
11519 (wait_reading_process_output, read_process_output):
11520 Likewise.
11521
b93aacde
PE
11522 * process.c: Rename or move locals to avoid shadowing.
11523 (list_processes_1, Fmake_network_process):
11524 (read_process_output_error_handler, exec_sentinel_error_handler):
11525 Rename or move locals.
4dc343ee 11526 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 11527 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 11528 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 11529 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 11530 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 11531
af8a867c 11532 Make tparam.h and terminfo.c consistent.
44f230aa
SM
11533 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
11534 Include tparam.h instead, since it declares them.
af8a867c
PE
11535 * cm.h (PC): Remove extern decl; tparam.h now does this.
11536 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
11537 * terminfo.c: Include tparam.h, to check interfaces.
11538 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
11539 (tparam): Adjust signature to match interface in tparam.h;
11540 this removes some undefined behavior. Check that outstring and len
11541 are zero, which they always are with Emacs.
11542 * tparam.h (PC, BC, UP): New extern decls.
11543
0248044d 11544 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 11545 (xftfont_open): Rename locals to avoid shadowing.
0248044d 11546
8ff096c1 11547 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
11548 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
11549 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 11550 (ftfont_list): Remove unused local.
49eaafba
PE
11551 (get_adstyle_property, ftfont_pattern_entity):
11552 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
11553 Rename locals to avoid shadowing.
8ff096c1 11554
e2be39f6
PE
11555 * xfont.c (xfont_list_family): Mark var as initialized.
11556
c9735e30
PE
11557 * xml.c (make_dom): Now static.
11558
8f5201ae
PE
11559 * composite.c (composition_compute_stop_pos): Rename local to
11560 avoid shadowing.
b246f932
PE
11561 (composition_reseat_it): Remove unused locals.
11562 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 11563 (composition_update_it): Mark var as initialized.
11b61122
PE
11564 (find_automatic_composition): Mark vars as initialized,
11565 with a FIXME (Bug#8290).
8f5201ae 11566
760fbc2c
PE
11567 character.h: Rename locals to avoid shadowing.
11568 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
11569 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
11570 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
11571 (BUF_DEC_POS): Be more systematic about renaming local temporaries
11572 to avoid shadowing.
11573
ff08eb85
PE
11574 * textprop.c (property_change_between_p): Remove; unused.
11575
fc7bf025
PE
11576 * intervals.c (interval_start_pos): Now static.
11577
235d7abc
PE
11578 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
11579
44f230aa
SM
11580 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
11581 Rename locals to avoid shadowing.
3e7d6594 11582
50060332
PE
11583 * sound.c (wav_play, au_play, Fplay_sound_internal):
11584 Fix pointer signedness.
d01f234b 11585 (alsa_choose_format): Remove unused local var.
c83b8872
PE
11586 (wav_play): Initialize a variable to 0, to prevent undefined
11587 behavior (Bug#8278).
50060332 11588
c4fc4e30
PE
11589 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
11590
918436ed
PE
11591 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
11592
c939f91b
PE
11593 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
11594 clobbering (Bug#8298).
b9c7f648
PE
11595 * sysdep.c (sys_subshell): Likewise.
11596 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 11597
6bd8c144
PE
11598 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
11599 This should get cleaned up, so that child_setup has the
11600 same signature on all platforms.
11601
7710357c 11602 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 11603 (relocate_fd): Rename locals to avoid shadowing.
7710357c 11604
c59da222
CY
116052011-03-22 Chong Yidong <cyd@stupidchicken.com>
11606
11607 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
11608 not to be necessary, and produces flickering.
11609
66b87493
GM
116102011-03-20 Glenn Morris <rgm@gnu.org>
11611
11612 * config.in: Remove file.
11613
45b6f6d5
JB
116142011-03-20 Juanma Barranquero <lekktu@gmail.com>
11615
11616 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
11617 are now in src/globals.h.
11618 (syms_of_minibuf): Remove spurious & from previous change.
11619
cd394be1 116202011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
11621
11622 * minibuf.c (completing-read-function): New variable.
11623 (completing-read-default): Rename from completing-read.
11624 (completing-read): Call completing-read-function.
11625
b14e3e21
CY
116262011-03-19 Juanma Barranquero <lekktu@gmail.com>
11627
11628 * xfaces.c (Fx_load_color_file):
11629 Read color file from absolute filename (bug#8250).
11630
f2b726e6
JB
116312011-03-19 Juanma Barranquero <lekktu@gmail.com>
11632
11633 * makefile.w32-in: Update dependencies.
11634
09f6ff02
EZ
116352011-03-17 Eli Zaretskii <eliz@gnu.org>
11636
11637 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
11638
29a6015a
PE
116392011-03-17 Paul Eggert <eggert@cs.ucla.edu>
11640
a3a6c54e
PE
11641 Fix more problems found by GCC 4.5.2's static checks.
11642
b766f867
PE
11643 * process.c (make_serial_process_unwind, send_process_trap):
11644 (sigchld_handler): Now static.
11645
be02381c
PE
11646 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
11647 That way, the code declares only the vars that it needs.
11648 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
11649 * s/cygwin.h (PTY_ITERATION): Likewise.
11650 * s/darwin.h (PTY_ITERATION): Likewise.
11651 * s/gnu-linux.h (PTY_ITERATION): Likewise.
11652
57048744
PE
11653 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
11654 * process.c (allocate_pty): Don't declare stb unless it's needed.
11655
7914961c 11656 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
11657 (CONSTANTLIM): Remove; unused.
11658 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
11659 Define only if needed.
7914961c 11660
b3967b18
PE
11661 * unexelf.c (unexec): Name an expression,
11662 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
11663 Use a different way to cause a compilation error if anyone uses
11664 n rather than nn, a way that does not involve shadowing.
73366a00 11665 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 11666
29a6015a
PE
11667 * deps.mk (unexalpha.o): Remove; unused.
11668
43cfc33e 11669 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 11670 * unexec.h: New file.
ce701a33
PE
11671 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
11672 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
11673 Depend on unexec.h.
11674 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
11675 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
11676 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 11677 Change as necessary to match prototype in unexec.h.
ce701a33 11678
01f44d5a
PE
11679 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
11680 shadowing.
4f63c6bb 11681 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 11682
a6670b0b
PE
11683 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
11684 Rename locals to avoid shadowing.
11685
cef2010d 11686 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 11687 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 11688
d4d7173a
PE
11689 * print.c (Fredirect_debugging_output): Fix pointer signedess.
11690
f08b802a
PE
11691 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
11692 warning when compiling print.c.
11693
3ddb0639
PE
11694 * font.c (font_unparse_fcname): Abort in an "impossible" situation
11695 instead of using an uninitialized var.
5ad03b97 11696 (font_sort_entities): Mark var as initialized.
3ddb0639 11697
170a2692
PE
11698 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
11699
e663c700
PE
11700 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
11701 pointers to constants.
89bc529a 11702 (font_parse_fcname): Remove unused vars.
7b81e2d0 11703 (font_delete_unmatched): Now static.
ea838e10 11704 (font_get_spec): Remove; unused.
13a547c6
PE
11705 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
11706 (font_update_drivers, Ffont_get_glyphs, font_add_log):
11707 Rename or move locals to avoid shadowing.
e663c700 11708
2a80c887 11709 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 11710 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 11711
1384fa33 11712 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 11713 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 11714
8b2c52e9
PE
11715 * alloc.c (mark_backtrace): Move decl from here ...
11716 * lisp.h: ... to here, so that it can be checked.
11717
475545b5 11718 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 11719 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
11720 (lisp_indirect_variable): Name an expression,
11721 to avoid gcc -Wbad-function-cast warning.
1faed8ae 11722 (Fdefvar): Rename locals to avoid shadowing.
475545b5 11723
b1349114 11724 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 11725 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 11726 Use const pointer when appropriate.
b1349114 11727
a2928364
PE
11728 * lisp.h (get_system_name, get_operating_system_release):
11729 Move decls here, to check interfaces.
11730 * process.c (get_operating_system_release): Move decl to lisp.h.
11731 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
11732 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
11733 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
11734 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
11735 (Fformat_time_string, Fencode_time, Finsert_char):
11736 (Ftranslate_region_internal, Fformat):
11737 Rename or remove local vars to avoid shadowing.
9710023e 11738 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 11739
a415e694
PE
11740 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
11741 avoid shadowing.
11742
8ef4622d
PE
11743 * lisp.h (eassert): Check that the argument compiles, even if
11744 ENABLE_CHECKING is not defined.
11745
946f9a5b
PE
11746 * data.c (Findirect_variable): Name an expression, to avoid
11747 gcc -Wbad-function-cast warning.
112396d6 11748 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 11749 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
11750 (Fmake_variable_buffer_local, Fmake_local_variable):
11751 Mark variables as initialized.
52746918 11752 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 11753
e5aab7e7 11754 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
11755 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
11756 Rename locals to avoid shadowing.
dff45157
PE
11757 (mark_stack): Move local variables into the #ifdef region where
11758 they're used.
7bc26fdb
PE
11759 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
11760 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
11761 needed otherwise.
11762 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
11763 (GC_STRING_CHARS): Remove; not used.
d40d4be1 11764 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 11765
e5aab7e7
PE
11766 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
11767 avoids undefined behavior in theory.
11768
4da60324
PE
11769 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
11770
88043301
PE
11771 Use functions, not macros, for up- and down-casing (Bug#8254).
11772 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
11773 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
11774 to use the following functions instead of these macros.
11775 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
11776 EMACS_INT, since callers assume the returned value fits in int.
11777 (upcase1): Likewise, for UPCASE_TABLE.
11778 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 11779 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 11780 the race-condition problem in the old DOWNCASE.
88043301 11781
19ed5445
PE
11782 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
11783 Rename locals to avoid shadowing.
11784 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
11785 (regex_compile, re_search_2, re_match_2_internal):
11786 Remove unused local vars.
952db0d7
PE
11787 (FREE_VAR): Rewrite so as not to use empty "else",
11788 which gcc can warn about.
da053e48 11789 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
11790 (RETALLOC_IF): Define only if needed.
11791 (WORDCHAR_P): Likewise. This one is never needed, but is used
11792 only in a comment talking about a compiler bug, so put inside
11793 the #if 0 of that comment.
11794 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
11795 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
11796 Remove; unused.
19ed5445 11797
1f3561e4 11798 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
11799 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
11800 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 11801
ded6f8f7
PE
11802 * search.c (simple_search): Remove unused var.
11803
dbd37a95
PE
11804 * dired.c (compile_pattern): Move decl from here ...
11805 * lisp.h: ... to here, so that it can be checked.
11806 (struct re_registers): New forward decl.
11807
7e47afad
PE
11808 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
11809
85f24f61
PE
11810 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
11811 All uses changed.
11812 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
11813 Rename locals to avoid shadowing.
5671df8f 11814 (Fvertical_motion): Mark locals as initialized.
85f24f61 11815
181aa2be 11816 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 11817 (casify_region): Mark local as initialized.
181aa2be 11818
930d429c
PE
11819 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
11820
7082eac6
PE
11821 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
11822 New macros, so that the caller can use some names other than
11823 gcpro1, gcpro2, etc.
11824 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
11825 of the new macros.
11826 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
11827 argument, for consistency with GCPRO2_VAR, etc: it is now the
11828 prefix of the variable, not the variable itself. All uses
11829 changed.
38b2c076
PE
11830 * dired.c (directory_files_internal, file_name_completion):
11831 Rename locals to avoid shadowing.
11832
15206ed9
PE
11833 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
11834 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
11835 dired.c's scmp function, had undefined behavior.
11836 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
11837 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
11838 * buffer.h: ... to here, because these macros use current_buffer,
11839 and the new implementation with inline functions needs to have
11840 current_buffer in scope now, rather than later when the macros
11841 are used.
11842 (downcase, upcase1): New static inline functions.
11843 (DOWNCASE, UPCASE1): Reimplement using these functions.
11844 This avoids undefined behavior in expressions like
11845 DOWNCASE (x) == DOWNCASE (y), which previously suffered
11846 from race conditions in accessing the global variables
11847 case_temp1 and case_temp2.
11848 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
11849 * lisp.h (case_temp1, case_temp2): Remove their decls.
11850 * character.h (ASCII_CHAR_P): Move from here ...
11851 * lisp.h: ... to here, so that the inline functions mentioned
11852 above can use them.
11853
4a6bea26
PE
11854 * dired.c (directory_files_internal_unwind): Now static.
11855
f14b7e14
PE
11856 * fileio.c (file_name_as_directory, directory_file_name):
11857 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
11858 Now static.
2893f146
PE
11859 (file_name_as_directory): Use const pointers when appropriate.
11860 (Fexpand_file_name): Likewise. In particular, newdir might
11861 point at constant storage, so make it a const pointer.
fd4ead52 11862 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
11863 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
11864 signedness issues.
f839df0c
PE
11865 (Fset_file_times, Finsert_file_contents, auto_save_error):
11866 Rename locals to avoid shadowing.
f14b7e14 11867
5716756e 11868 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
11869 (Ftry_completion, Fall_completions): Rename or remove locals
11870 to avoid shadowing.
5716756e 11871
b4c3046a
PE
11872 * marker.c (bytepos_to_charpos): Remove; unused.
11873
b45db522
PE
11874 * lisp.h (verify_bytepos, count_markers): New decls,
11875 so that gcc does not warn that these functions aren't declared.
11876
85876d07
PE
11877 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
11878 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 11879 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 11880 (copy_text): Remove unused local var.
85876d07 11881
03d78a21 11882 * filelock.c (within_one_second): Now static.
b3dd38ab 11883 (lock_file_1): Rename local to avoid shadowing.
03d78a21 11884
5df8f01b
PE
11885 * buffer.c (fix_overlays_before): Mark locals as initialized.
11886 (fix_start_end_in_overlays): Likewise. This function should be
11887 simplified by using pointers-to-pointers, but that's a different
11888 matter.
b1d876f1 11889 (switch_to_buffer_1): Now static.
8f54f30a
PE
11890 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
11891 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 11892
a70072c9 11893 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 11894 Fix pointer signedness issue.
edced198
PE
11895 (sys_subshell): Mark local as volatile if checking for lint,
11896 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 11897 (MAXPATHLEN): Define only if needed.
a70072c9 11898
a0977c44
PE
11899 * process.c (serial_open, serial_configure): Move decls from here ...
11900 * systty.h: ... to here, so that they can be checked.
11901
a884fdcc
PE
11902 * fns.c (get_random, seed_random): Move extern decls from here ...
11903 * lisp.h: ... to here, so that they can be checked.
11904
604efe86 11905 * sysdep.c (reset_io): Now static.
b8950c94 11906 (wait_for_termination_signal): Remove; unused.
604efe86 11907
38fc62d9
PE
11908 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
11909 (copy_keymap_item, append_key, push_text_char_description):
11910 Now static.
1004a21a 11911 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 11912 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
11913 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
11914 (describe_map_tree):
11915 Rename locals to avoid shadowing.
38fc62d9 11916
2f2650da
PE
11917 * keyboard.c: Declare functions static if they are not used elsewhere.
11918 (echo_char, echo_dash, cmd_error, top_level_2):
11919 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
11920 (read_char, kbd_buffer_get_event, make_lispy_position):
11921 (make_lispy_event, make_lispy_movement, apply_modifiers):
11922 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
11923 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
11924 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 11925 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 11926 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 11927
a053e86c 11928 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
11929 (mark_kboards): Move decl here ...
11930 * alloc.c (mark_kboards): ... from here.
a053e86c 11931
4752793e
PE
11932 * lisp.h (force_auto_save_soon): New decl.
11933
74f10ca7 11934 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
11935 (DEFINE_DUMMY_FUNCTION): New macro.
11936 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
11937 Use it.
c03cd23f
PE
11938 (main): Add casts to avoid warnings
11939 if GCC considers string literals to be constants.
74f10ca7 11940
022e70d4
PE
11941 * lisp.h (fatal_error_signal): Add decl, since it's exported.
11942
59d6fe83
PE
11943 * dbusbind.c: Pointer signedness fixes.
11944 (xd_signature, xd_append_arg, xd_initialize):
11945 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11946 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11947 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
11948 (Fdbus_register_signal): Use SSDATA when the context wants char *.
11949
78320123
PE
11950 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
11951 if GCC considers string literals to be constants.
49cebcca 11952 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 11953
35ac2a97
SM
119542011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
11955
fb103ca9
SM
11956 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
11957 (print_preprocess, print_object): New macro to fix last change.
11958
35ac2a97
SM
11959 * print.c (print_preprocess): Don't forget font objects.
11960
62973b41
JB
119612011-03-16 Juanma Barranquero <lekktu@gmail.com>
11962
11963 * emacs.c (USAGE3): Doc fixes.
11964
0e48bb22
AS
119652011-03-15 Andreas Schwab <schwab@linux-m68k.org>
11966
11967 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
11968 structure.
11969
7684e57b
JB
119702011-03-14 Juanma Barranquero <lekktu@gmail.com>
11971
11972 * lisp.h (VWindow_system, Qfile_name_history):
11973 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
11974 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
11975 (w32_system_caret_x, w32_system_caret_y): Declare extern.
11976
11977 * w32select.c: Don't #include "keyboard.h".
c96bbc66 11978 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
11979
11980 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
11981 * w32console.c (detect_input_pending, read_input_pending)
11982 (encode_terminal_code):
11983 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
11984 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
11985 (w32_system_caret_y, Qfile_name_history):
11986 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
11987 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
11988 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
11989 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
11990 * w32proc.c (Qlocal, report_file_error):
11991 * w32term.c (Vwindow_system, updating_frame):
11992 * w32uniscribe.c (initialized, uniscribe_font_driver):
11993 Remove unneeded extern declarations.
11994
2aa46d6c
CY
119952011-03-14 Chong Yidong <cyd@stupidchicken.com>
11996
c96bbc66 11997 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 11998
cffc6f3b
CY
119992011-03-13 Chong Yidong <cyd@stupidchicken.com>
12000
12001 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
12002 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
12003 These macros can no longer be used for assignment.
12004
44f230aa
SM
12005 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
12006 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
12007 (record_buffer_markers, fetch_buffer_markers): New functions for
12008 recording and fetching special buffer markers.
12009 (set_buffer_internal_1, set_buffer_temp): Use them.
12010
12011 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
12012
12013 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
12014
12015 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
12016 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
12017
12018 * xdisp.c (hscroll_window_tree):
12019 (reconsider_clip_changes): Use PT instead of BUF_PT.
12020
d251f04b
EZ
120212011-03-13 Eli Zaretskii <eliz@gnu.org>
12022
12023 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
12024 $(EMACS_ROOT)/lib/intprops.h.
12025
f0c77cd1
PE
120262011-03-13 Paul Eggert <eggert@cs.ucla.edu>
12027
3eca4629
PE
12028 Fix more problems found by GCC 4.5.2's static checks.
12029
7c86ee98
PE
12030 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
12031 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
12032 (xg_free_frame_widgets): Make it clear that a local variable is
12033 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
12034 (gdk_window_get_screen): Make it clear that this macro is needed
12035 only if USE_GTK_TOOLTIP.
1e5524e7
PE
12036 (int_gtk_range_get_value): New function, which avoids a diagnostic
12037 from gcc -Wbad-function-cast.
12038 (xg_set_toolkit_scroll_bar_thumb): Use it.
12039 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
12040 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
12041 (get_utf8_string, xg_get_file_with_chooser):
12042 Rename locals to avoid shadowing.
12043 (create_dialog): Move locals to avoid shadowing.
7c86ee98 12044
41729b81
PE
12045 * xgselect.c (xg_select): Remove unused var.
12046
f0c77cd1
PE
12047 * image.c (four_corners_best): Mark locals as initialized.
12048 (gif_load): Initialize transparent_p to zero (Bug#8238).
12049 Mark another local as initialized.
ec6cf4c6 12050 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 12051
ce0ad53d 12052 * image.c (clear_image_cache): Now static.
d5d5a617 12053 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 12054 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
12055 (x_edge_detection): Remove unnecessary cast that
12056 gcc -Wbad-function-cast diagnoses.
2037898d 12057 (gif_load): Fix pointer signedness.
6ae141d6
PE
12058 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
12059 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 12060
33383987 120612011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 12062
d32df629
PE
12063 Improve quality of tests for time stamp overflow.
12064 For example, without this patch (encode-time 0 0 0 1 1
12065 1152921504606846976) returns the obviously-bogus value (-948597
12066 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
12067 reports time overflow. See
12068 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
12069 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
12070 * editfns.c: Include limits.h and intprops.h.
12071 (TIME_T_MIN, TIME_T_MAX): New macros.
12072 (time_overflow): Move earlier, to before first use.
12073 (hi_time, lo_time): New functions, for an accurate test for
12074 out-of-range times.
12075 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
12076 (Fget_internal_run_time): Don't assume time_t fits in int.
12077 (make_time): Use list2 instead of Fcons twice.
12078 (Fdecode_time): More accurate test for out-of-range times.
12079 (check_tm_member): New function.
12080 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
12081 (lisp_time_argument): Don't rely on undefined left-shift and
12082 right-shift behavior when checking for time stamp overflow.
8be6f318 12083
fe31d94c
PE
12084 * editfns.c (time_overflow): New function, refactoring common code.
12085 (Fformat_time_string, Fdecode_time, Fencode_time):
12086 (Fcurrent_time_string): Use it.
12087
8be6f318
PE
12088 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
12089 * dired.c (make_time): Move to ...
12090 * editfns.c (make_time): ... here.
12091 * systime.h: Note the move.
12092
09d9db2c 120932011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 12094
126bc0dc
YM
12095 * fringe.c (update_window_fringes): Remove unused variables.
12096
c47cbdfd
YM
12097 * unexmacosx.c (copy_data_segment): Also copy __got section.
12098 (Bug#8223)
12099
7ac80be9
EZ
121002011-03-12 Eli Zaretskii <eliz@gnu.org>
12101
c96bbc66 12102 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
12103 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
12104 Constify `char *' arguments and their references according to
12105 prototypes in tparam.h.
12106
ecb0f94d 12107 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 12108
7ac80be9
EZ
12109 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
12110 Adapt all references accordingly.
12111
12112 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
12113
ef1fd07e
TT
121142011-03-11 Tom Tromey <tromey@redhat.com>
12115
12116 * buffer.c (syms_of_buffer): Remove obsolete comment.
12117
7ef4b50c
EZ
121182011-03-11 Eli Zaretskii <eliz@gnu.org>
12119
12120 * termhooks.h (encode_terminal_code): Declare prototype.
12121
12122 * msdos.c (encode_terminal_code): Don't declare prototype.
12123
12124 * term.c (encode_terminal_code): Now external again, used by
12125 w32console.c and msdos.c.
12126
44f230aa
SM
12127 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
12128 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 12129
4b1ec863 121302011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 12131
1714f52b 12132 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 12133
4b1ec863
PE
12134 * fringe.c (update_window_fringes): Mark locals as initialized
12135 (Bug#8227).
12136 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 12137
524c7aa6
PE
12138 * alloc.c (mark_fringe_data): Move decl from here ...
12139 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
12140 to check its interface.
12141 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
12142
a5c0af81 12143 * fontset.c (free_realized_fontset): Now static.
7519b8cd 12144 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 12145 (fontset_font): Mark local as initialized.
a9a06e0b 12146 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 12147
b4716021
PE
12148 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
12149
811e9bac 12150 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 12151 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
12152 (x_own_selection, Fx_disown_selection_internal): Rename locals
12153 to avoid shadowing.
12154 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 12155
7e3ab302
PE
12156 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
12157 so that the caller can use some name other than gcpro1.
12158 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
12159 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12160 (Fx_backspace_delete_keys_p):
12161 Use them to avoid shadowing, and rename vars to avoid shadowing.
12162 (x_decode_color, x_set_name, x_window): Now static.
6b437900 12163 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 12164 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
12165 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
12166 Remove unused locals.
7e3ab302
PE
12167 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
12168 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
12169 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
12170 macros.
f78faa98 12171
e2b13473
PE
12172 * xterm.h (x_mouse_leave): New decl.
12173
77f23912
PE
12174 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
12175 Remove unused functions.
cdf4ba58
PE
12176 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
12177 (x_calc_absolute_position): Now static.
7411c686 12178 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 12179 Don't declare local "event" unless it's used.
ed7bf3a5
PE
12180 (x_iconify_frame, x_free_frame_resources): Don't declare locals
12181 unless they are used.
38d0b34a
PE
12182 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
12183 (x_fatal_error_signal): Remove; not used.
a6067996
PE
12184 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
12185 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
12186 (x_error_catcher, x_connection_closed, x_error_handler):
12187 (x_error_quitter, xembed_send_message, x_iconify_frame):
12188 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 12189 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 12190 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 12191
44f230aa
SM
12192 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
12193 Rename or move locals to avoid shadowing.
6b463e58 12194 (tty_defined_color, merge_face_heights): Now static.
5967d051 12195 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
12196 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
12197 does not deduce is never used uninitialized.
73719eba
PE
12198 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
12199 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 12200
426994c3 12201 * terminal.c (store_terminal_param): Now static.
5489860b 12202
032f1620 12203 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 12204 (set_frame_menubar): Remove unused local.
d4323972 12205 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
12206 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
12207 since they might point to immutable storage.
281585b0
PE
12208 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
12209 since it's unused otherwise.
032f1620 12210
367c19e5 12211 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 12212 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
12213 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
12214 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 12215 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
12216 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
12217 does not deduce are never used uninitialized.
70739cbe 12218
07b48fa9
PE
12219 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
12220
8868a238 12221 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
12222 * window.c (window_loop, size_window):
12223 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 12224
7e5cf297 12225 * window.c (display_buffer): Now static.
d6550a9f
PE
12226 (size_window): Mark variables that gcc -Wuninitialized
12227 does not deduce are never used uninitialized.
a586633d
PE
12228 * window.h (check_all_windows): New decl, to forestall
12229 gcc -Wmissing-prototypes diagnostic.
5b555da1 12230 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 12231
f6095868
PE
12232 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
12233 shadowing.
12234 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
12235 Include <limits.h>.
12236 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
12237 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
12238 (load_charset_map): Mark variables that gcc -Wuninitialized
12239 does not deduce are never used uninitialized.
53df7c11 12240 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 12241
f38b440c
PE
12242 * coding.c (coding_set_source, coding_set_destination):
12243 Use "else { /* comment */ }" rather than "else /* comment */;"
12244 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
12245 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
12246 a block, when the outer 'i' will do.
12247 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
12248 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
12249 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
12250 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
12251 (Fdecode_sjis_char, Fdefine_coding_system_internal):
12252 Rename locals to avoid shadowing.
12253 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
12254 * coding.c (emacs_mule_char, encode_invocation_designation):
12255 Now static, since they're not used elsewhere.
413bb2db 12256 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 12257 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
12258 (decode_coding_emacs_mule): Mark variables that gcc
12259 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
12260 (detect_coding_iso_2022): Initialize a local variable that might
12261 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 12262 this initialization is needed. (Bug#8211)
5f58e762
PE
12263 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
12264 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
12265 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
12266 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
12267 Remove unused macros.
f38b440c 12268
232b38b9 12269 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 12270 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 12271 * character.c (string_count_byte8): Likewise.
232b38b9 12272
fb90da1b
PE
12273 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
12274 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
12275
fb93dbc2
PE
12276 * chartab.c (copy_sub_char_table): Now static, since it's not used
12277 elsewhere.
5c156ace
PE
12278 (sub_char_table_ref_and_range, char_table_ref_and_range):
12279 Rename locals to avoid shadowing.
bbcd0949 12280 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 12281
7d3b3862 12282 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 12283 (BIDI_BOB): Remove unused macro.
7d3b3862 12284
6be7d3da
PE
12285 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
12286 deduce are never used uninitialized.
c2ed9c8b 12287 * term.c (encode_terminal_code): Likewise.
6be7d3da 12288
75f8807f 12289 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 12290
50938595
PE
12291 * tparam.h: New file.
12292 * term.c, tparam.h: Include it.
12293 * deps.mk (term.o, tparam.o): Depend on tparam.h.
12294 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
12295 Move these decls to tparam.h, and make them agree with what
12296 is actually in tparam.c. The previous trick of using incompatible
12297 decls in different modules does not conform to the C standard.
12298 All callers of tparam changed to use tparam's actual API.
12299 * tparam.c (tparam1, tparam, tgoto):
12300 Use const pointers where appropriate.
12301
fbceeba2
PE
12302 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
12303 * cm.h (struct cm): Likewise.
12304 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
12305 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
12306 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
12307 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
12308 (turn_on_face, init_tty): Likewise.
12309 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 12310
7f3f1250
PE
12311 * term.c (term_mouse_position): Rename local to avoid shadowing.
12312
e6ca6543
PE
12313 * alloc.c (mark_ttys): Move decl from here ...
12314 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
12315
c40f8d15
AS
123162011-03-11 Andreas Schwab <schwab@linux-m68k.org>
12317
12318 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
12319
cfe0661d
JB
123202011-03-09 Juanma Barranquero <lekktu@gmail.com>
12321
12322 * search.c (compile_pattern_1): Remove argument regp, unused since
12323 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
12324 (compile_pattern): Don't pass it.
12325
0afb4571
J
123262011-03-08 Jan Djärv <jan.h.d@swipnet.se>
12327
12328 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
12329 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
12330 for ! HAVE_GTK3.
12331 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
12332
12333 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
12334
12335 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
12336 gdk_window_get_screen, gdk_window_get_geometry,
12337 gdk_x11_window_lookup_for_display and GDK_KEY_g.
12338 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
12339 (xg_get_pixbuf_from_pixmap): New function.
12340 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
12341 to Pixmap, take frame as parameter, remove GdkColormap parameter.
12342 Call xg_get_pixbuf_from_pixmap instead of
12343 gdk_pixbuf_get_from_drawable.
12344 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
12345 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
12346 (xg_check_special_colors): Use GtkStyleContext and its functions
12347 for HAVE_GTK3.
12348 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
12349 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
12350 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
12351 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
12352 Call gtk_widget_get_preferred_size.
0afb4571
J
12353 (xg_frame_resized): gdk_window_get_geometry only takes 5
12354 parameters.
44f230aa
SM
12355 (xg_win_to_widget, xg_event_is_for_menubar):
12356 Call gdk_x11_window_lookup_for_display.
0afb4571
J
12357 (xg_set_widget_bg): New function.
12358 (delete_cb): New function.
895009e1 12359 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 12360 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
12361 (xg_set_background_color): Call xg_set_widget_bg.
12362 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
12363 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
12364 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
12365 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
12366 if ! HAVE_GTK3.
12367 (update_frame_tool_bar): Call gtk_widget_hide.
12368 (xg_initialize): Use GDK_KEY_g.
12369
12370 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
12371 if ! HAVE_GTK3
12372 (x_session_initialize): Call gdk_x11_set_sm_client_id.
12373
12374 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
12375 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
12376 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
12377
1c2cc4ef
JB
123782011-03-08 Juanma Barranquero <lekktu@gmail.com>
12379
12380 * w32xfns.c (select_palette): Check success of RealizePalette against
12381 GDI_ERROR, not zero.
12382
33383987 12383See ChangeLog.11 for earlier changes.
aac0c6e3
MR
12384
12385;; Local Variables:
12386;; coding: utf-8
aac0c6e3
MR
12387;; End:
12388
2f097256 12389 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
12390
12391 This file is part of GNU Emacs.
12392
12393 GNU Emacs is free software: you can redistribute it and/or modify
12394 it under the terms of the GNU General Public License as published by
12395 the Free Software Foundation, either version 3 of the License, or
12396 (at your option) any later version.
12397
12398 GNU Emacs is distributed in the hope that it will be useful,
12399 but WITHOUT ANY WARRANTY; without even the implied warranty of
12400 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12401 GNU General Public License for more details.
12402
12403 You should have received a copy of the GNU General Public License
12404 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.