1 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
3 * w32.c (ltime): Add return type and declare static.
4 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
6 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
8 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
9 Privately reported by Herbert J. Skuhra.
10 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
12 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
13 not make_lisp_timeval, when the argument is of type EMACS_TIME.
15 2012-06-23 Eli Zaretskii <eliz@gnu.org>
17 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
18 last argument of make_unibyte_string.
20 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
21 language ID in the event parameters.
23 * w32term.c (w32_read_socket): Put the new keyboard codepage into
24 event.code, not the obscure "character set ID".
26 2012-06-23 Chong Yidong <cyd@gnu.org>
28 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
30 2012-06-23 Eli Zaretskii <eliz@gnu.org>
32 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
33 * w32.c (fdutimens): New function.
35 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
37 * s/ms-w32.h (pselect): Redirect to sys_select.
39 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
41 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
42 in the logic of incrementing and decrementing the value of
43 use_relocatable_buffers.
45 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
47 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
48 Privately reported by Herbert J. Skuhra.
49 [__FreeBSD__]: Remove "*/" typo after "#include".
50 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
51 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
52 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
53 Don't assume EMACS_TIME and struct timeval are the same type.
55 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
57 Support higher-resolution time stamps (Bug#9000).
58 The time stamps are only nanosecond-resolution at the C level,
59 since that's the best that any real-world system supports now.
60 But they are picosecond-resolution at the Lisp level, as that's
61 easy, and leaves room for future OS improvements.
63 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
66 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
67 Don't get current time unless it's needed.
69 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
70 now provides it if it's absent.
71 (start_atimer): Port to higher-res time stamps.
72 Check for time stamp overflow. Don't get current time more
75 * buffer.h (struct buffer): Buffer modtime now has high resolution.
76 Include systime.h, not time.h.
77 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
79 * dired.c: Include stat-time.h.
80 (Ffile-attributes): File times now have higher resolution.
82 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
83 (struct image): Timestamp now has higher resolution.
85 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
86 has at least microseconds now. All uses removed.
87 (update_frame, update_single_window, update_window, update_frame_1)
88 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
90 * editfns.c (time_overflow): Now extern.
91 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
92 (float-time, Fformat_time_string, Fcurrent_time_string)
93 (Fcurrent_time_zone): Accept and generate higher-resolution
95 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
96 (decode_time_components, lisp_seconds_argument): New functions.
97 (make_time): Now static.
98 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
99 Report an error if the time is invalid, rather than having the caller
102 * fileio.c: Include <stat-time.h>
103 (Fcopy_file): Copy higher-resolution time stamps.
104 Prefer to set the time stamp via a file descriptor if that works.
105 (Fset_file_times, Finsert_file_contents, Fwrite_region)
106 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
107 (Fvisited_file_modtime, Fset_visited_file_modtime):
108 Support higher-resolution time stamps.
110 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
112 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
114 * image.c (prepare_image_for_display, clear_image_cache)
115 (lookup_image): Port to higer-resolution time stamps.
117 * keyboard.c (start_polling, bind_polling_period):
118 Check for time stamp overflow.
119 (read_char, kbd_buffer_get_event, timer_start_idle)
120 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
121 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
122 Port to higher-resolution time stamps. Do not assume time_t is signed.
123 (decode_timer): New function. Timers are now vectors of length 9,
124 not 8, to accommodate the picosecond component.
125 (timer_check_2): Use it.
127 * nsterm.m (select_timeout, timeval_subtract): Remove.
128 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
129 as they're a bit more accurate and handle overflow better.
130 (ns_select): Change prototype to be compatible with pselect.
131 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
132 * nsterm.h (ns_select): Adjust prototype.
134 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
135 us-resolution time stamps.
136 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
138 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
140 * lisp.h (time_overflow): New decl.
141 (wait_reading_process_output): First arg is now intmax_t, not int,
142 to accommodate larger waits.
144 * process.h (struct Lisp_Process.read_output_delay):
145 Now counts nanoseconds, not microseconds.
146 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
148 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
149 (wait_reading_process_output):
150 Port to ns-resolution time stamps.
151 (Faccept_process_output, wait_reading_process_output):
152 Check for time stamp overflow. Do not assume time_t is signed.
153 (select_wrapper): Remove; we now use pselect.
154 (Fprocess_attributes): Now generates ns-resolution time stamps.
156 * sysdep.c: Include utimens.h. Don't include utime.h
157 or worry about struct utimbuf; gnulib does that for us now.
158 (gettimeofday): Remove; gnulib provides a substitute.
159 (make_timeval): New function.
160 (set_file_times): Now sets ns-resolution time stamps.
161 New arg FD; all uses changed.
162 (time_from_jiffies, ltime_from_jiffies, get_up_time)
163 (system_process_attributes):
164 Now returns ns-resolution time stamp. All uses changed.
165 Check for time stamp overflow.
167 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
168 provides a substitute now.
170 * systime.h: Include timespec.h rather than sys/time.h and time.h,
171 since it guarantees struct timespec.
172 (EMACS_TIME): Now struct timespec, so that we can support
173 ns-resolution time stamps.
174 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
175 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
176 (EMACS_USECS): Remove.
177 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
178 so multiply the arg by 1000 before storing it.
179 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
181 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
182 Port to ns-resolution time stamps.
183 (EMACS_TIME_NEG_P): Remove; replaced by....
184 (EMACS_TIME_SIGN): New macro.
185 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
186 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
187 (set_file_times, make_time, lisp_time_argument): Adjust signature.
188 (make_timeval, make_lisp_time, decode_time_components): New decls.
189 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
190 that it mishandled time_t overflow. You can't compare by subtracting!
191 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
192 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
194 * term.c: Include <sys/time.h>.
195 (timeval_to_Time): New function, for proper overflow wraparound.
196 (term_mouse_position, term_mouse_click): Use it.
198 * undo.c (record_first_change): Support higher-resolution time stamps
200 (Fprimitive_undo): Use them when restoring time stamps.
202 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
203 (w32_get_internal_run_time):
204 Port to higher-resolution Emacs time stamps.
205 (ltime): Now accepts single 64-bit integer, as that's more convenient
208 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
210 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
211 for compatibility with pselect. Support ns-resolution time stamps.
213 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
215 * xselect.c (wait_for_property_change, x_get_foreign_selection):
216 Check for time stamp overflow, and support ns-resolution time stamps.
218 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
219 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
220 (timeval_subtract): Remove; no longer needed.
221 (XTflash, XTring_bell, x_wait_for_event):
222 Port to ns-resolution time stamps. Don't assume time_t is signed.
224 2012-06-22 Chong Yidong <cyd@gnu.org>
226 * xdisp.c (x_consider_frame_title): Revert last change.
228 2012-06-22 Eli Zaretskii <eliz@gnu.org>
230 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
231 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
232 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
233 staticidx goes up to 1597 out of 1600 = 0x640.)
235 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
237 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
238 Otherwise, the umask might be mistakenly 0 while handling input signals.
240 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
242 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
244 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
246 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
247 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
248 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
249 access to `contents' member of Lisp_Vector objects with AREF and ASET
252 2012-06-19 Chong Yidong <cyd@gnu.org>
254 * frame.c (delete_frame): When selecting a frame on a different
255 text terminal, do not alter the terminal's top-frame.
257 * xdisp.c (format_mode_line_unwind_data): Record the target
258 frame's selected window and its terminal's top-frame.
259 (unwind_format_mode_line): Restore them.
260 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
262 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
263 since tty frames can be explicitly named.
264 (prepare_menu_bars): Likewise.
266 * term.c (Ftty_top_frame): New function.
268 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
270 Port byte-code-meter to modern targets.
271 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
272 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
273 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
274 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
275 (METER_1, METER_2): Simplify.
277 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
279 * data.c (Fdefalias): Return `symbol' (bug#11686).
281 2012-06-18 Martin Rudalics <rudalics@gmx.at>
283 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
284 gets killed during executing of this function (Bug#11665).
285 Try to always return Qt when the buffer has been actually killed.
286 (Vkill_buffer_query_functions): In doc-string say that functions
287 run by this hook should not change the current buffer.
289 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
291 Fix recently-introduced process.c problems found by static checking.
292 * process.c (write_queue_push, write_queue_pop, send_process):
293 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
294 (write_queue_pop): Fix pointer signedness problem.
295 (send_process): Remove unused local.
297 2012-06-17 Chong Yidong <cyd@gnu.org>
299 * xdisp.c (redisplay_internal): No need to redisplay terminal
300 frames that are not on top.
302 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
304 * process.c (make_process): Initialize write_queue.
305 (write_queue_push, write_queue_pop): New functions.
306 (send_process): Use them to maintain correct ordering of process
309 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
311 * lisp.h (eassert): Assume C89 or later.
312 This removes the need for CHECK.
313 (CHECK): Remove. Its comments about always evaluating its
314 argument were confusing, as 'eassert' typically does not evaluate
317 * coding.c (produce_chars): Use ptrdiff_t, not int.
319 * xterm.c (x_draw_underwave): Check for integer overflow.
320 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
322 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
324 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
325 referenced (Bug#11583).
327 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
329 Implement wave-style variant of underlining.
330 * dispextern.h (face_underline_type): New enum.
331 (face): Add field for underline type.
332 * nsterm.m (ns_draw_underwave): New function.
333 (ns_draw_text_decoration): Use it.
334 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
336 (x_draw_glyph_string): Use them.
337 * xfaces.c (Qline, Qwave): New Lisp objects.
338 (check_lface_attrs, merge_face_ref)
339 (Finternal_set_lisp_face_attribute, realize_x_face):
340 Handle wave-style underline face attributes.
341 * xterm.c (x_draw_underwave): New function.
342 (x_draw_glyph_string): Use it.
344 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
346 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
347 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
348 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
349 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
350 ($(BLD)/w32select.$(O)): Update dependencies.
352 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
354 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
355 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
356 * character.c (_fetch_multibyte_char_p): Remove.
357 * alloc.c: Include "character.h" before "buffer.h".
359 * buffer.c: Likewise.
360 * bytecode.c: Likewise.
361 * callint.c: Likewise.
362 * callproc.c: Likewise.
363 * casefiddle.c: Likewise.
364 * casetab.c: Likewise.
365 * category.c: Likewise.
367 * coding.c: Likewise.
368 * composite.c: Likewise.
370 * dispnew.c: Likewise.
372 * dosfns.c: Likewise.
373 * editfns.c: Likewise.
375 * fileio.c: Likewise.
376 * filelock.c: Likewise.
378 * fontset.c: Likewise.
379 * fringe.c: Likewise.
380 * indent.c: Likewise.
381 * insdel.c: Likewise.
382 * intervals.c: Likewise.
383 * keyboard.c: Likewise.
384 * keymap.c: Likewise.
386 * macros.c: Likewise.
387 * marker.c: Likewise.
388 * minibuf.c: Likewise.
390 * nsmenu.m: Likewise.
392 * process.c: Likewise.
394 * region-cache.c: Likewise.
395 * search.c: Likewise.
396 * syntax.c: Likewise.
398 * textprop.c: Likewise.
400 * unexsol.c: Likewise.
401 * w16select.c: Likewise.
402 * w32fns.c: Likewise.
403 * w32menu.c: Likewise.
404 * window.c: Likewise.
409 * xselect.c: Likewise.
411 2012-06-16 Eli Zaretskii <eliz@gnu.org>
413 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
414 If all the glyphs of the glyph row came from strings, and we have no
415 cursor positioning clues, put the cursor on the first glyph of the
417 (handle_face_prop): Use chunk-relative overlay string index when
418 indexing into it->string_overlays array. (Bug#11653)
419 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
420 the rightmost. (Bug#11720)
422 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
424 * category.h (CHAR_HAS_CATEGORY): Define as inline.
425 (CATEGORY_MEMBER): Enforce 1/0 value.
426 * category.c (_temp_category_set): Remove.
428 2012-06-16 Eli Zaretskii <eliz@gnu.org>
430 * window.c (Fdelete_other_windows_internal)
431 (Fdelete_window_internal): Don't access frame's mouse highlight
432 info of the initial frame. (Bug#11677)
434 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
436 * .gdbinit (xgetint): Fix recently-introduced paren typo.
437 Assume USE_2_TAGS_FOR_INTS.
438 (xreload): Adjust $tagmask width to match recent lisp.h change.
440 Simplify lisp.h in minor ways that should not affect code.
441 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
442 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
443 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
444 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
445 (INTTYPEBITS): New macro, for clarity.
446 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
447 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
448 Simplify now that USE_LSB_TAG is always defined.
449 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
450 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
452 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
454 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
456 2012-06-13 Glenn Morris <rgm@gnu.org>
458 * s/bsd-common.h (BSD4_3):
459 * s/usg5-4-common.h (USG5_4): No longer define; unused.
461 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
463 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
466 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
468 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
469 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
470 * alloc.c (widen_to_Lisp_Object): Remove.
471 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
472 * frame.c (delete_frame): Remove outdated comment.
473 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
475 (Fw32_unregister_hot_key): Likewise.
476 (Fw32_toggle_lock_key): Likewise.
477 * w32menu.c (add_menu_item): Likewise.
478 (w32_menu_display_help): Use XIL instead of checking
480 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
481 (init_heap): Likewise.
482 * w32term.c (w32_read_socket): Update comment.
484 2012-06-13 Glenn Morris <rgm@gnu.org>
486 * s/usg5-4-common.h, src/s/unixware.h:
487 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
489 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
491 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
493 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
494 * alloc.c (make_number) [!defined make_number]:
495 Remove, as lisp.h always defines this now.
496 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
497 (roundup_size): Verify that it is a power of 2.
498 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
499 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
500 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
501 -DUSE_LSB_TAG=0, to override the automatically-selected default.
502 USE_LSB_TAG now is always defined to be either 0 or 1.
504 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
505 code works fine either way, and efficiency is not a concern here,
506 as the union type is for debugging, not for production.
507 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
508 Use an inline function on all platforms when using the union type,
509 since this is simpler and 'static inline' can be used portably
511 (LISP_INITIALLY_ZERO): New macro.
512 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
513 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
515 2012-06-12 Glenn Morris <rgm@gnu.org>
517 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
519 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
521 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
522 Move BROKEN_SIGIO to configure.
524 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
525 Move NO_TERMIO to configure.
527 2012-06-12 Chong Yidong <cyd@gnu.org>
529 * image.c (imagemagick_load_image): Use MagickFlattenImage if
530 MagickMergeImageLayers is undefined. Use pixel pusher loop if
531 MagickExportImagePixels is undefined.
533 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
535 * image.c (imagemagick_load_image): Remove unused label.
537 2012-06-11 Glenn Morris <rgm@gnu.org>
539 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
540 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
541 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
542 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
544 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
546 * alloc.c (make_byte_code): New function.
547 (Fmake_byte_code): Use it. Don't purify here.
548 * lread.c (read1): Use it as well to avoid extra allocation.
550 2012-06-11 Chong Yidong <cyd@gnu.org>
552 * image.c (imagemagick_load_image): Implement transparency.
554 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
556 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
557 account for preceding backslashes. (Bug#11663)
559 2012-06-09 Chong Yidong <cyd@gnu.org>
561 * term.c: Support italics in capable terminals (Bug#9652).
562 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
563 (turn_on_face): Output using TS_enter_italic_mode if available.
564 Don't handle unused blinking and alt-charset cases.
565 (turn_off_face): Handle italic case; discard unused tty_blinking_p
566 and tty_alt_charset_p cases.
567 (tty_capable_p, init_tty): Support italics.
569 * termchar.h (struct tty_display_info): Add field for italics.
570 Remove unused blink field.
572 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
575 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
576 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
577 tty_alt_charset_p. Add tty_italic_p.
579 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
581 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
582 dbus_type_is_basic if available.
583 (xd_extract_signed, xd_extract_unsigned): Rename from
584 extract_signed and extract_unsigned, respectively. Adapt callers.
586 2012-06-09 Chong Yidong <cyd@gnu.org>
588 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
590 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
593 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
595 * xdisp.c (vmessage): Treat frame message as multibyte.
596 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
597 would generate the diagnostic "Making \302\247 buffer-local while
600 2012-06-08 Eli Zaretskii <eliz@gnu.org>
602 * dispnew.c (showing_window_margins_p): Undo last change, which
603 was done due to an inadvertent commit.
604 (adjust_frame_glyphs_for_frame_redisplay): Do call
605 showing_window_margins_p.
607 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
609 * eval.c (Fmake_var_non_special): New primitive.
610 (syms_of_eval): Defsubr it.
611 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
613 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
615 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
616 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
618 2012-06-08 Eli Zaretskii <eliz@gnu.org>
620 * alloc.c (allocate_vectorlike): Fix last change.
622 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
624 Block-based vector allocation of small vectors.
625 * lisp.h (struct vectorlike_header): New field `nbytes',
626 adjust comment accordingly.
627 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
628 to denote vector blocks. Adjust users (live_vector_p,
629 mark_maybe_pointer, valid_lisp_object_p) accordingly.
630 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
631 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
632 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
633 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
634 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
635 (roundup_size): New constant.
636 (struct vector_block): New data type.
637 (vector_blocks, vector_free_lists, zero_vector): New variables.
638 (all_vectors): Rename to `large_vectors'.
639 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
640 (sweep_vectors): New functions.
641 (allocate_vectorlike): Return `zero_vector' as the only vector of
642 0 items. Allocate new vector from block if vector size is less than
643 or equal to VBLOCK_BYTES_MAX.
644 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
645 (init_alloc_once): Add call to init_vectors.
647 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
649 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
651 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
653 * doprnt.c (doprnt): Truncate multibyte char correctly.
654 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
655 would mishandle a string argument "Xc" if X was a multibyte
656 character of length 2: it would truncate after X's first byte
657 rather than including all of X.
659 2012-06-06 Chong Yidong <cyd@gnu.org>
661 * buffer.c (word_wrap): Doc fix.
663 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
665 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
667 2012-06-03 Glenn Morris <rgm@gnu.org>
669 * xdisp.c (tool-bar-style): Doc fix.
671 2012-06-03 Ulrich Müller <ulm@gentoo.org>
673 * Makefile.in (PAXCTL): Define.
674 (temacs$(EXEEXT)): Disable memory randomization for the temacs
675 binary via PaX flags if the paxctl utility is available.
676 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
677 Restore PaX flags to their default. (Bug#11398)
679 2012-06-03 Chong Yidong <cyd@gnu.org>
681 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
684 2012-06-03 Chong Yidong <cyd@gnu.org>
686 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
687 (note_mode_line_or_margin_highlight): If there is no help echo,
688 use mode-line-default-help-echo. Handle the case where the mouse
689 position is past the end of the mode line string.
691 * buffer.c (buffer_local_value_1): New function, split from
692 Fbuffer_local_value; can return Qunbound.
693 (Fbuffer_local_value): Use it.
694 (Vmode_line_format): Docstring tweaks.
696 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
698 * sysdep.c (system_process_attributes): Improve comment.
700 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
702 * keyboard.c: Export real-this-command to Elisp.
703 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
704 and DEFVAR it. Update all users.
706 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
708 * minibuf.c (Fassoc_string): Remove duplicate declaration.
710 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
711 Convert pctcpu and pctmem to Lisp float properly.
712 Let the compiler fold better, as 100.0/0x8000 is exact.
714 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
716 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
719 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
721 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
723 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
725 For a 'struct window', replace some Lisp_Object fields to
726 bitfields where appropriate, remove unused fields.
727 * window.h (struct window): Remove unused 'last_mark_x' and
728 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
729 change it's type from Lisp_Object to bitfield.
730 Change type of 'force_start', 'optional_new_start',
731 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
732 fields from Lisp_Object to bitfield. Adjust users accordingly.
734 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
736 Pacify gcc -Wdouble-precision when using Xaw.
737 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
738 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
739 Use 'float' consistently, rather than 'float' in most places
740 and 'double' in a couple of places.
742 2012-05-31 Eli Zaretskii <eliz@gnu.org>
744 * xdisp.c (handle_stop): Detect whether we have overlay strings
745 loaded by testing it->current.overlay_string_index to be
746 non-negative, instead of checking whether n_overlay_strings is
747 positive. (Bug#11587)
749 2012-05-31 Chong Yidong <cyd@gnu.org>
751 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
753 * doc.c (Fsubstitute_command_keys): Doc fix.
755 2012-05-31 Eli Zaretskii <eliz@gnu.org>
757 * search.c (search_buffer): Remove calls to
758 r_alloc_inhibit_buffer_relocation, as it is now called by
759 maybe_unify_char, which was the cause of relocation of buffer text
762 2012-05-31 Eli Zaretskii <eliz@gnu.org>
764 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
765 for the duration of call to load_charset, to avoid problems with
766 callers of maybe_unify_char that access buffer text through C
769 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
770 decrement the inhibition flag, instead of just setting or
773 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
775 Remove obsolete '#define static' cruft.
776 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
777 This #undef was "temporary" in 2000; it is no longer needed
778 now that '#define static' has gone away.
779 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
780 (gray_bitmap_bits): Remove; no longer needed.
781 All uses replaced with definiens.
782 * xterm.c: Include "bitmaps/gray.xbm".
784 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
786 Clean up __executable_start, monstartup when --enable-profiling.
787 The following changes affect the code only when profiling.
788 * dispnew.c (__executable_start): Rename from safe_bcopy.
789 Define only on platforms that need it.
790 * emacs.c: Include <sys/gmon.h> when profiling.
791 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
792 (__executable_start): Remove decl, since lisp.h does it now.
793 (safe_bcopy): Remove decl; no longer has that name.
794 (main): Coalesce #if into single bit of code, for simplicity.
795 Cast pointers to uintptr_t, since standard libraries want integers
797 * lisp.h (__executable_start): New decl.
799 2012-05-31 Glenn Morris <rgm@gnu.org>
801 * image.c (Fimagemagick_types): Doc fix.
803 2012-05-30 Jim Meyering <meyering@redhat.com>
805 * callproc.c (Fcall_process_region): Include directory component
806 in mkstemp error message (Bug#11586).
808 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
810 * alloc.c, lisp.h (make_pure_vector): Now static.
812 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
814 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
816 (Fautoload): Do the hash-doc more carefully.
817 * data.c (Fdefalias): Purify definition, except for keymaps.
818 (Qdefun): Move from eval.c.
819 * lisp.h (Qdefun): Remove.
820 * lread.c (read1): Tiny simplification.
822 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
824 Do not create empty overlays with the evaporate property (Bug#9642).
825 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
826 Bug#9642, but explicitly check that the buffer the overlay would
827 be moved to is live and rearrange lines to make sure that errors
828 will not put the overlay in an inconsistent state.
829 (Fdelete_overlay): Cosmetics.
831 2012-05-28 Eli Zaretskii <eliz@gnu.org>
833 * w32term.c (my_bring_window_to_top): New function.
834 (x_raise_frame): Use handle returned by DeferWindowPos, which
835 could be different from the original one.
836 Call my_bring_window_to_top instead of my_set_foreground_window.
839 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
840 by calling BringWindowToTop.
842 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
843 (WM_EMACS_END): Increase by one.
845 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
847 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
848 This avoids undefined behavior that might cause the eassert
849 to not catch an out-of-range value.
851 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
853 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
856 2012-05-27 Eli Zaretskii <eliz@gnu.org>
858 * bidi.c (bidi_mirror_char): Fix last change.
860 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
862 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
863 when referring to sectname field in printf format.
865 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
867 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
868 Only r_alloc_inhibit_buffer_relocation needed to be added;
869 the others were already declared.
871 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
872 before checking whether it's out of range. Put the check inside
874 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
876 2012-05-27 Ken Brown <kbrown@cornell.edu>
878 * callproc.c (Fcall_process): Restore a line that was accidentally
879 commented out in the 2011-02-13 change (bug#11547).
881 2012-05-27 Eli Zaretskii <eliz@gnu.org>
883 * lisp.h [REL_ALLOC]: Add prototypes for external functions
886 * buffer.c [REL_ALLOC]: Remove prototypes of
887 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
888 they are now on lisp.h.
890 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
892 * search.c (search_buffer): Use it to inhibit relocation of buffer
893 text while re_search_2 is doing its job, because re_search_2 is
894 passed C pointers to buffer text. (Bug#11519)
896 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
899 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
900 state after an additional call to move_it_in_display_line_to, keep
901 the values of it->max_ascent and it->max_descent found for the
903 (pos_visible_p): Revert the comparison against bottom_y to what it
904 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
907 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
909 Fix coding-related core dumps with gcc -ftrapv.
910 The code was computing A - B, where A and B are pointers, and B is
911 random garbage. This can lead to core dumps on platforms that
912 have special pointer registers, and it also leads to core dumps on
913 x86-64 when compiled with gcc -ftrapv. The fix is to compute
914 A - B only when B is initialized properly.
915 * coding.c (coding_set_source, coding_set_destination): Return void.
916 (coding_change_source, coding_change_destinations): New functions,
917 with the old behaviors of coding_set_source and coding_set_destination.
918 All callers that need an offset changed to use these new functions.
920 2012-05-26 Glenn Morris <rgm@gnu.org>
922 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
924 2012-05-26 Eli Zaretskii <eliz@gnu.org>
926 Extend mouse support on W32 text-mode console.
927 * xdisp.c (draw_row_with_mouse_face):
928 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
930 * w32console.c: Include window.h.
931 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
933 (initialize_w32_display): Initialize mouse-highlight data.
935 * w32inevt.c: Include termchar.h and window.h.
936 (do_mouse_event): Support mouse-autoselect-window. When the mouse
937 moves, call note_mouse_highlight. If help_echo changed, call
938 gen_help_event to produce help-echo message in the echo area.
939 Call clear_mouse_face if mouse_face_hidden is set in the mouse
942 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
944 * lread.c (read1): Simplify slightly to avoid an overflow warning
945 with GCC 4.7.0 on x86-64.
947 2012-05-26 Eli Zaretskii <eliz@gnu.org>
949 * bidi.c (bidi_mirror_char): Revert last change: an int is
950 definitely wide enough here.
952 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
954 Fix integer width and related bugs (Bug#9874).
955 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
956 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
957 (string_bytes, check_sblock, allocate_string_data):
958 (compact_small_strings, Fmake_bool_vector, make_string)
959 (make_unibyte_string, make_multibyte_string)
960 (make_string_from_bytes, make_specified_string)
961 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
962 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
964 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
965 (allocate_pseudovector):
966 Use int, not EMACS_INT, where int is wide enough.
967 (inhibit_garbage_collection, Fgarbage_collect):
968 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
969 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
970 int might not be wide enough.
971 (bidi_cache_search, bidi_cache_find, bidi_init_it)
972 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
973 (bidi_at_paragraph_end, bidi_find_paragraph_start)
974 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
975 (bidi_level_of_next_char, bidi_move_to_visually_next):
976 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
978 (Fkill_buffer, Fset_buffer_major_mode)
979 (advance_to_char_boundary, Fbuffer_swap_text)
980 (Fset_buffer_multibyte, overlays_at, overlays_in)
981 (overlay_touches_p, struct sortvec, record_overlay_string)
982 (overlay_strings, recenter_overlay_lists)
983 (adjust_overlays_for_insert, adjust_overlays_for_delete)
984 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
985 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
986 (Foverlay_recenter, last_overlay_modification_hooks_used)
987 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
988 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
989 (validate_region): Omit unnecessary test for b <= e,
990 since that's guaranteed by the previous test.
991 (adjust_overlays_for_delete): Avoid pos + length overflow.
992 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
993 (report_overlay_modification):
994 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
995 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
996 Omit pointer cast, which isn't needed anyway, and doesn't work
997 after the EMACS_INT -> ptrdiff_t change.
998 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
999 * buffer.h: Adjust decls to match defn changes elsewhere.
1000 (struct buffer_text, struct buffer):
1001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1002 Use EMACS_INT, not int, where int might not be wide enough.
1003 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
1004 not int, to avoid needless 32-bit limit on 64-bit hosts.
1005 (exec_byte_code): Use tighter memory-full test, one that checks
1006 for alloca overflow. Don't compute the address of the object just
1007 before an array, as that's not portable. Use EMACS_INT, not
1008 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
1009 * callint.c (Fcall_interactively):
1010 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1011 * callproc.c (call_process_kill, Fcall_process):
1012 Don't assume pid_t fits into an Emacs fixnum.
1013 (call_process_cleanup, Fcall_process, child_setup):
1014 Don't assume pid_t fits into int.
1015 (call_process_cleanup, Fcall_process, delete_temp_file)
1016 (Fcall_process_region):
1017 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1018 (Fcall_process): Simplify handling of volatile integers.
1019 Use int, not EMACS_INT, where int will do.
1020 * casefiddle.c (casify_object, casify_region, operate_on_word)
1021 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
1022 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1023 (casify_object): Avoid integer overflow when overallocating buffer.
1024 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
1025 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
1026 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
1027 * category.h (CATEGORYP): Don't assume arg is nonnegative.
1028 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
1029 integers are now checked earlier. All uses replaced with XINT.
1031 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1032 For CCL_MapSingle, check that content and value are in int range.
1033 (ccl_driver, Fregister_code_conversion_map):
1034 Check that Vcode_version_map_vector is a vector.
1035 (resolve_symbol_ccl_program): Check that vector header is in range.
1036 Always copy the vector, so that we can check its contents reliably
1037 now rather than having to recheck each instruction as it's being
1038 executed. Check that vector words fit in 'int'.
1039 (ccl_get_compiled_code, Fregister_ccl_program)
1040 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
1041 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
1042 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
1043 contents are in range.
1044 (Fccl_execute_on_string): Check that status is in range.
1045 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
1046 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
1047 Accept and return EMACS_INT, not int, because callers can pass values
1049 (c_string_width, strwidth, lisp_string_width, chars_in_text)
1050 (multibyte_chars_in_text, parse_str_as_multibyte)
1051 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
1052 (str_as_unibyte, str_to_unibyte, string_count_byte8)
1053 (string_escape_byte8, Fget_byte):
1054 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1055 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
1056 avoid mishandling large integers.
1057 * character.h: Adjust decls to match defn changes elsewhere.
1058 * charset.c (load_charset_map_from_file, find_charsets_in_text)
1059 (Ffind_charset_region):
1060 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1061 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
1062 (load_charset_map_from_vector, Fdefine_charset_internal):
1063 Don't assume fixnum fits in int.
1064 (load_charset_map_from_vector, Fmap_charset_chars):
1065 Remove now-unnecessary CHECK_NATNUMs.
1066 (Fdefine_charset_internal): Check ranges here, more carefully.
1067 Don't rely on undefined behavior with signed left shift overflow.
1068 Don't assume unsigned int fits into fixnum, or that fixnum fits
1069 into unsigned int. Don't require max_code to be a valid fixnum;
1070 that's not true for gb10830 4-byte on a 32-bit host. Allow
1071 invalid_code to be a cons, for the same reason. Require code_offset
1072 to be a character. Avoid int overflow if max_char is close
1074 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
1075 this is intended anyway and avoids some undefined behavior.
1076 (load_charset_map): Pass unsigned, not int, as 2nd arg of
1077 INDEX_TO_CODE_POINT, as that's what it expects.
1078 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
1079 * charset.h (DECODE_CHAR): Return int, not unsigned;
1080 this is what was intended anyway, and it avoids undefined behavior.
1081 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
1082 integer-overflow issues.
1083 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
1084 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
1085 where the argument is EMACS_INT, and this behavior is not intended.
1086 * chartab.c (Fmake_char_table, Fset_char_table_range)
1087 (uniprop_get_decoder, uniprop_get_encoder):
1088 Don't assume fixnum fits in int.
1089 * cmds.c (move_point): New function, that does the gist of
1090 Fforward_char and Fbackward_char, but does so while checking
1091 for integer overflow more accurately.
1092 (Fforward_char, Fbackward_char): Use it.
1093 (Fforward_line, Fend_of_line, internal_self_insert)
1094 (internal_self_insert):
1095 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1096 Fix a FIXME, by checking for integer overflow when calculating
1097 target_clm and actual_clm.
1098 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
1099 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
1100 (ASSURE_DESTINATION, coding_alloc_by_realloc)
1101 (coding_alloc_by_making_gap, alloc_destination)
1102 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
1103 (encode_coding_utf_16, detect_coding_emacs_mule)
1104 (decode_coding_emacs_mule, encode_coding_emacs_mule)
1105 (detect_coding_iso_2022, decode_coding_iso_2022)
1106 (encode_invocation_designation, encode_designation_at_bol)
1107 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
1108 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
1109 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
1110 (encode_coding_ccl, encode_coding_raw_text)
1111 (detect_coding_charset, decode_coding_charset)
1112 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
1113 (produce_composition, produce_charset, produce_annotation)
1114 (decode_coding, handle_composition_annotation)
1115 (handle_charset_annotation, consume_chars, decode_coding_gap)
1116 (decode_coding_object, encode_coding_object, detect_coding_system)
1117 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
1118 (code_convert_region, code_convert_string)
1119 (Fdefine_coding_system_internal)
1120 (coding_set_source, coding_set_destination):
1121 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1122 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
1123 (Fdefine_coding_system_internal):
1124 Don't assume fixnums fit in int.
1125 (decode_coding_gap, decode_coding_object, encode_coding_object)
1126 (Fread_coding_system, Fdetect_coding_region)
1127 (Funencodable_char_position, Fcheck_coding_systems_region)
1128 (get_translation, handle_composition_annotation, consume_chars):
1129 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1130 (consume_chars): Rewrite to not calculate an address outside buffer.
1131 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
1132 Don't access memory outside of the args array.
1133 (Fdefine_coding_system_internal): Check for charset-id overflow.
1134 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
1135 result of ENCODE_CHAR.
1136 * coding.h: Adjust decls to match defn changes elsewhere.
1137 (struct coding_system):
1138 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1139 * composite.c (get_composition_id, find_composition)
1140 (run_composition_function, update_compositions)
1141 (compose_text, composition_gstring_put_cache)
1142 (composition_gstring_p, composition_gstring_width)
1143 (fill_gstring_header, fill_gstring_body, autocmp_chars)
1144 (composition_compute_stop_pos, composition_reseat_it)
1145 (composition_update_it, struct position_record)
1146 (find_automatic_composition, composition_adjust_point)
1147 (Fcomposition_get_gstring, Ffind_composition_internal):
1148 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1149 (update_compositions):
1150 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1151 * composite.h: Adjust decls to match defn changes elsewhere.
1152 (struct composition):
1153 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1154 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
1155 Do not attempt to compute the address of the object just before a
1156 buffer; this is not portable.
1158 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1159 (Faset): Use int, not EMACS_INT, where int is wide enough.
1160 (Fstring_to_number): Don't assume fixnums fit in int.
1161 (Frem): Don't assume arg is nonnegative.
1162 * dbusbind.c (xd_append_arg): Check for integers out of range.
1163 (Fdbus_call_method): Don't overflow the timeout int.
1164 (extract_signed, extract_unsigned): New functions.
1165 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
1166 (xd_get_connection_references): Return ptrdiff_t, not int.
1168 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
1169 (xd_read_message_1):
1170 Use int, not unsigned, where the dbus API uses int.
1171 (Fdbus_message_internal): Don't overflow mtype.
1172 (syms_of_dbusbind): Allocate right-sized buffer for integers.
1173 * dired.c (directory_files_internal, file_name_completion, scmp)
1174 (file_name_completion_stat):
1175 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1176 (file_name_completion): Don't overflow matchcount.
1177 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
1178 * dispextern.h: Adjust decls to match defn changes elsewhere.
1179 (struct text_pos, struct glyph, struct bidi_saved_info)
1180 (struct bidi_string_data, struct bidi_it, struct composition_it)
1182 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1183 (struct display_pos, struct composition_it, struct it):
1184 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1185 * dispnew.c (increment_matrix_positions)
1186 (increment_row_positions, mode_line_string)
1187 (marginal_area_string):
1188 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1189 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
1190 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1191 (duration_to_sec_usec): New function, to check for overflow better.
1192 (Fsleep_for, sit_for): Use it.
1193 * doc.c (get_doc_string, store_function_docstring):
1194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1195 (get_doc_string, Fsnarf_documentation):
1196 Use int, not EMACS_INT, where int is wide enough.
1198 Use SAFE_ALLOCA, not alloca.
1199 Check for overflow when converting EMACS_INT to off_t.
1200 * doprnt.c (doprnt):
1201 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1202 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
1203 Don't assume uid_t fits into fixnum.
1204 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
1205 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
1206 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
1207 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
1208 (general_insert_function)
1209 (Finsert_char, make_buffer_string, make_buffer_string_both)
1210 (update_buffer_properties, Fbuffer_substring)
1211 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
1212 (Fsubst_char_in_region, check_translation)
1213 (Ftranslate_region_internal, save_restriction_restore, Fformat)
1214 (transpose_markers, Ftranspose_regions):
1215 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1216 (clip_to_bounds): Move to lisp.h as an inline function).
1217 (Fconstrain_to_field): Don't assume integers are nonnegative.
1218 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
1219 (Fsubst_char_in_region, Fsave_restriction):
1220 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1221 (Femacs_pid): Don't assume pid_t fits into fixnum.
1222 (lo_time): Use int, not EMACS_INT, when int suffices.
1223 (lisp_time_argument): Check for usec out of range.
1224 (Fencode_time): Don't assume fixnum fits in int.
1225 (Fuser_login_name, Fuser_full_name): Signal an error
1226 if a uid argument is out of range, rather than relying on
1228 (Fformat_time_string): Remove now-unnecessary check.
1229 lisp_time_argument checks for out-of-range usec now.
1230 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
1231 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
1232 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
1233 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
1234 (init_cmdargs, Fdump_emacs):
1235 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1236 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
1237 the bottom (typically) 32 bits of the fixnum.
1238 * eval.c (specpdl_size, call_debugger):
1239 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1240 (when_entered_debugger, Fbacktrace_debug):
1241 Don't assume fixnum can fit in int.
1242 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
1243 the object just before a buffer; this is not portable.
1244 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
1245 (grow_specpdl, unbind_to):
1246 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1247 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
1248 (grow_specpdl): Simplify allocation by using xpalloc.
1249 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
1250 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
1251 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
1252 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1253 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
1255 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1256 (Fcopy_file, non_regular_nbytes, read_non_regular)
1257 (Finsert_file_contents):
1258 Use int, not EMACS_INT, where int is wide enough.
1259 (READ_BUF_SIZE): Verify that it fits in int.
1260 (Finsert_file_contents): Check that counts are in proper range,
1261 rather than assuming fixnums fit into ptrdiff_t etc.
1262 Don't assume fixnums fit into int.
1263 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
1264 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
1265 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
1266 (string_char_to_byte, string_byte_to_char)
1267 (string_make_multibyte, string_to_multibyte)
1268 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
1269 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
1270 (substring_both, Fdelete, internal_equal, Ffillarray)
1271 (Fclear_string, mapcar1)
1272 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
1273 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
1274 (larger_vector, make_hash_table, maybe_resize_hash_table)
1275 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
1276 (Fmaphash, secure_hash):
1277 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1278 (concat): Check for string index and length overflow.
1279 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
1281 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1282 (larger_vector): New API (vec, incr_min, size_max) replaces old
1283 one (vec, new_size, init). This catches size overflow.
1284 INIT was removed because it was always Qnil.
1285 All callers changed.
1286 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
1287 the upper bound on a hash table index size.
1288 (make_hash_table, maybe_resize_hash_table): Use it.
1289 (secure_hash): Computer start_byte and end_byte only after
1290 they're known to be in ptrdiff_t range.
1291 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
1292 (Ffont_get_glyphs, Ffont_at):
1293 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1294 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
1295 (Flist_fonts, Fopen_font):
1296 Don't assume fixnum can fit in int.
1297 (check_gstring): Don't assume index can fit in int.
1298 (font_match_p): Check that fixnum is a character, not a nonnegative
1299 fixnum, since the later code needs to stuff it into an int.
1300 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
1301 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
1302 conversion overflow issues.
1303 (Fopen_font): Check for integer out of range.
1304 (Ffont_get_glyphs): Don't assume index can fit in int.
1305 * font.h: Adjust decls to match defn changes elsewhere.
1306 * fontset.c (reorder_font_vector): Redo score calculation to avoid
1308 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
1309 printmax_t, where ptrdiff_t is wide enough.
1310 (Finternal_char_font):
1311 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1312 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
1313 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
1314 (Fset_frame_position, x_set_frame_parameters)
1315 (x_set_line_spacing, x_set_border_width)
1316 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
1317 Check that fixnums are in proper range for system types.
1318 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
1319 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1320 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
1321 Use SAFE_ALLOCA_LISP, not alloca.
1322 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
1323 intptr_t is wide enough.
1324 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
1325 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
1326 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
1327 Check for fixnum out of range.
1328 * ftfont.c (ftfont_list): Don't assume index fits in int.
1329 Check that fixnums are in proper range for system types.
1330 (ftfont_shape_by_flt):
1331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1332 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
1333 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1334 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
1335 Check that fixnums are in proper range for system types.
1336 * gnutls.h: Adjust decls to match defn changes elsewhere.
1337 * gtkutil.c (xg_dialog_run):
1338 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1339 (update_frame_tool_bar):
1340 Check that fixnums are in proper range for system types.
1341 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
1342 (lookup_image): Check that fixnums are in range for system types.
1343 * indent.c (last_known_column, last_known_column_point):
1344 (current_column_bol_cache):
1345 (skip_invisible, current_column, check_display_width):
1346 (check_display_width, scan_for_column, current_column_1)
1347 (Findent_to, Fcurrent_indentation, position_indentation)
1348 (indented_beyond_p, Fmove_to_column, compute_motion):
1349 (Fcompute_motion, Fvertical_motion):
1350 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1351 (last_known_column_modified): Use EMACS_INT, not int.
1352 (check_display_width):
1354 Check that fixnums and floats are in proper range for system types.
1355 (compute_motion): Don't assume index or fixnum fits in int.
1356 (compute_motion, Fcompute_motion):
1357 Use int, not EMACS_INT, when it is wide enough.
1358 (vmotion): Omit local var start_hpos that is always 0; that way
1359 we don't need to worry about overflow in expressions involving it.
1360 * indent.h: Adjust decls to match defn changes elsewhere.
1362 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1363 Use int, not EMACS_INT, where int is wide enough.
1364 Remove unused members ovstring_chars_done and tab_offset;
1366 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
1367 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
1368 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
1369 (make_gap, copy_text, insert, insert_and_inherit)
1370 (insert_before_markers, insert_before_markers_and_inherit)
1371 (insert_1, count_combining_before, count_combining_after)
1372 (insert_1_both, insert_from_string)
1373 (insert_from_string_before_markers, insert_from_string_1)
1374 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
1375 (adjust_after_replace, adjust_after_insert, replace_range)
1376 (replace_range_2, del_range, del_range_1, del_range_byte)
1377 (del_range_both, del_range_2, modify_region)
1378 (prepare_to_modify_buffer, signal_before_change)
1379 (signal_after_change, Fcombine_after_change_execute):
1380 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1381 * intervals.c (traverse_intervals, rotate_right, rotate_left)
1382 (balance_an_interval, split_interval_right, split_interval_left)
1383 (find_interval, next_interval, update_interval)
1384 (adjust_intervals_for_insertion, delete_node, delete_interval)
1385 (interval_deletion_adjustment, adjust_intervals_for_deletion)
1386 (static_offset_intervals, offset_intervals)
1387 (merge_interval_right, merge_interval_left, make_new_interval)
1388 (graft_intervals_into_buffer, temp_set_point_both)
1389 (temp_set_point, set_point, adjust_for_invis_intang)
1390 (set_point_both, move_if_not_intangible, get_property_and_range)
1391 (get_local_map, copy_intervals, copy_intervals_to_string)
1392 (compare_string_intervals, set_intervals_multibyte_1):
1393 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1394 * intervals.h: Adjust decls to match defn changes elsewhere.
1396 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1397 * keyboard.c (this_command_key_count, this_single_command_key_start)
1398 (before_command_key_count, before_command_echo_length, echo_now)
1399 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
1400 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
1401 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
1402 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
1403 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1404 (last_non_minibuf_size, last_point_position, echo_truncate)
1405 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
1406 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
1407 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
1408 (stuff_buffered_input):
1409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1410 (last_auto_save, command_loop_1, read_char):
1411 Use EMACS_INT, not int, to avoid integer overflow.
1412 (record_char): Avoid overflow in total_keys computation.
1413 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
1414 * keyboard.h: Adjust decls to match defn changes elsewhere.
1415 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
1416 (Fkey_description, Fdescribe_vector, Flookup_key):
1417 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1418 (click_position): New function, to check that positions are in range.
1419 (Fcurrent_active_maps):
1421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1422 (Faccessible_keymaps, Fkey_description):
1423 (preferred_sequence_p):
1424 Don't assume fixnum can fit into int.
1425 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
1426 Check for integer overflow in size calculations.
1427 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
1428 avoid mishandling large integers.
1429 * lisp.h: Adjust decls to match defn changes elsewhere.
1430 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
1431 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
1432 (struct Lisp_Marker):
1433 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1434 (clip_to_bounds): Now an inline function, moved here from editfns.c.
1435 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
1436 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
1437 All callers changed.
1438 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
1439 Assume the arg has valid form, since it always does.
1440 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
1441 unsigned integer system type.
1442 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
1443 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
1444 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1445 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
1446 (duration_to_sec_usec): New decl.
1447 * lread.c (read_from_string_index, read_from_string_index_byte)
1448 (read_from_string_limit, readchar, unreadchar, openp)
1449 (read_internal_start, read1, oblookup):
1450 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1451 (Fload, readevalloop, Feval_buffer, Feval_region):
1452 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1453 (openp): Check for out-of-range argument to 'access'.
1454 (read1): Use int, not EMACS_INT, where int is wide enough.
1455 Don't assume fixnum fits into int.
1456 Fix off-by-one error that can read outside a buffer.
1457 (read_filtered_event): Use duration_to_sec_usec
1458 to do proper overflow checking on durations.
1459 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
1460 in size calculation.
1461 (Fexecute_kbd_macro):
1462 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1463 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
1464 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
1465 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
1466 (set_marker_both, set_marker_restricted_both, marker_position)
1467 (marker_byte_position, Fbuffer_has_markers_at):
1468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1469 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
1470 * menu.c (ensure_menu_items): Rename from grow_menu_items.
1471 It now merely ensures that the menu is large enough, without
1472 necessarily growing it, as this avoids some integer overflow issues.
1473 All callers changed.
1474 (keymap_panes, parse_single_submenu, Fx_popup_menu):
1475 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1476 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
1477 Use SAFE_ALLOCA_LISP, not alloca.
1478 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
1479 to EMACS_INT. Check that fixnums are in proper range for system types.
1480 * minibuf.c (minibuf_prompt_width, string_to_object)
1481 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
1482 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
1483 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1484 (get_minibuffer, read_minibuf_unwind):
1485 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1486 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
1487 this simplifies overflow checking. All callers changed.
1488 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
1490 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1491 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
1492 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
1493 Check that fixnums are in proper range for system types.
1494 (Fx_create_frame, Fx_show_tip):
1495 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1496 * nsfont.m (ns_findfonts, nsfont_list_family):
1497 Don't assume fixnum fits in long.
1498 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
1499 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1500 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
1502 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
1503 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1504 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
1505 (PRINTDECLARE, PRINTPREPARE):
1506 (strout, print_string):
1507 (print, print_preprocess, print_check_string_charset_prop)
1509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1511 (temp_output_buffer_setup, Fprin1_to_string, print_object):
1512 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1513 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
1514 (printchar, strout): Use xpalloc to catch size calculation overflow.
1515 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
1516 (print_error_message): Use SAFE_ALLOCA, not alloca.
1517 (print_object): Use int, not EMACS_INT, where int is wide enough.
1518 (print_depth, new_backquote_output, print_number_index):
1519 Use ptrdiff_t, not int, where int might not be wide enough.
1520 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
1521 (Fset_process_window_size, Fformat_network_address)
1522 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
1524 Check that fixnums are in proper range for system types.
1525 (Fsignal_process): Simplify by avoiding a goto.
1526 Check for process-ids out of pid_t range rather than relying on
1528 (process_tick, update_tick): Use EMACS_INT, not int.
1529 (Fformat_network_address, read_process_output, send_process)
1530 (Fprocess_send_region, status_notify):
1531 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1532 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
1533 (wait_reading_process_output, read_process_output, exec_sentinel):
1534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1535 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
1536 (Faccept_process_output): Use duration_to_sec_usec to do proper
1537 overflow checking on durations.
1538 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
1539 Don't assume pid_t fits in int.
1540 * process.h (struct Lisp_Process): Members tick and update_tick
1541 are now of type EMACS_INT, not int.
1542 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
1543 configured --with-wide-int.
1544 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
1545 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
1546 * search.c (looking_at_1, string_match_1):
1547 (fast_string_match, fast_c_string_match_ignore_case)
1548 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
1549 (scan_newline, find_before_next_newline, search_command)
1550 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
1551 (set_search_regs, wordify):
1554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1555 (string_match_1, search_buffer, set_search_regs):
1557 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1558 (wordify): Check for overflow in size calculation.
1559 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
1560 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
1561 Check that fixnums are in proper range for system types.
1562 * sound.c (struct sound_device)
1563 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
1564 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1565 (Fplay_sound_internal):
1566 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1567 * syntax.c (struct lisp_parse_state, find_start_modiff)
1568 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
1569 (Fparse_partial_sexp):
1570 Don't assume fixnums can fit in int.
1571 (struct lisp_parse_state, find_start_pos, find_start_value)
1572 (find_start_value_byte, find_start_begv)
1573 (update_syntax_table, char_quoted, dec_bytepos)
1574 (find_defun_start, prev_char_comend_first, back_comment):
1575 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
1576 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
1577 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1578 (Finternal_describe_syntax_value): Check that match_lisp is a
1579 character, not an integer, since the code stuffs it into int.
1580 (scan_words, scan_sexps_forward):
1581 Check that fixnums are in proper range for system types.
1583 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1584 (scan_sexps_forward):
1585 Use CHARACTERP, not INTEGERP, since the value must fit into int.
1586 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
1587 * syntax.h: Adjust decls to match defn changes elsewhere.
1588 (struct gl_state_s):
1589 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1590 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
1591 MOST_POSITIVE_FIXNUM.
1592 * sysdep.c (wait_for_termination_1, wait_for_termination)
1593 (interruptible_wait_for_termination, mkdir):
1594 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
1595 (emacs_read, emacs_write):
1596 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1597 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
1598 and double all fit in int.
1599 * term.c (set_tty_color_mode):
1600 Check that fixnums are in proper range for system types.
1601 * termhooks.h (struct input_event):
1602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1603 * textprop.c (validate_interval_range, interval_of)
1604 (Fadd_text_properties, set_text_properties_1)
1605 (Fremove_text_properties, Fremove_list_of_text_properties)
1606 (Ftext_property_any, Ftext_property_not_all)
1607 (copy_text_properties, text_property_list, extend_property_ranges)
1608 (verify_interval_modification):
1609 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1610 (Fnext_single_char_property_change)
1611 (Fprevious_single_char_property_change):
1612 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1613 (copy_text_properties):
1614 Check for integer overflow in index calculation.
1615 * undo.c (last_boundary_position, record_point, record_insert)
1616 (record_delete, record_marker_adjustment, record_change)
1617 (record_property_change):
1618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1619 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
1620 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1621 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
1622 (Fx_hide_tip, Fx_file_dialog):
1623 * w32menu.c (set_frame_menubar):
1624 Use ptrdiff_t, not int, for consistency with rest of code.
1625 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
1626 (select_window, Fdelete_other_windows_internal)
1627 (window_scroll_pixel_based, window_scroll_line_based)
1628 (Frecenter, Fset_window_configuration):
1629 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1630 (Fset_window_hscroll, run_window_configuration_change_hook)
1631 (set_window_buffer, temp_output_buffer_show, scroll_command)
1632 (Fscroll_other_window, Frecenter):
1633 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1634 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
1635 Don't assume fixnum fits in int.
1636 (Fset_window_scroll_bars):
1637 Check that fixnums are in proper range for system types.
1638 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
1639 (string_pos, c_string_pos, number_of_chars, init_iterator)
1640 (in_ellipses_for_invisible_text_p, init_from_display_pos)
1641 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
1642 (compute_display_string_end, handle_face_prop)
1643 (face_before_or_after_it_pos, handle_invisible_prop)
1644 (handle_display_prop, handle_display_spec, handle_single_display_spec)
1645 (display_prop_intangible_p, string_buffer_position_lim)
1646 (string_buffer_position, handle_composition_prop, load_overlay_strings)
1647 (get_overlay_strings_1, get_overlay_strings)
1648 (iterate_out_of_display_property, forward_to_next_line_start)
1649 (back_to_previous_visible_line_start, reseat, reseat_to_string)
1650 (get_next_display_element, set_iterator_to_next)
1651 (get_visually_first_element, compute_stop_pos_backwards)
1652 (handle_stop_backwards, next_element_from_buffer)
1653 (move_it_in_display_line_to, move_it_in_display_line)
1654 (move_it_to, move_it_vertically_backward, move_it_by_lines)
1655 (add_to_log, message_dolog, message_log_check_duplicate)
1656 (message2, message2_nolog, message3, message3_nolog
1657 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
1658 (current_message_1, truncate_echo_area, truncate_message_1)
1659 (set_message, set_message_1, store_mode_line_noprop)
1660 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
1661 (text_outside_line_unchanged_p, check_point_in_composition)
1662 (reconsider_clip_changes)
1663 (redisplay_internal, set_cursor_from_row, try_scrolling)
1664 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
1665 (redisplay_window, find_last_unchanged_at_beg_row)
1666 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
1667 (trailing_whitespace_p, find_row_edges, display_line)
1668 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
1669 (display_mode_element, store_mode_line_string)
1670 (pint2str, pint2hrstr, decode_mode_spec)
1671 (display_count_lines, display_string, draw_glyphs)
1672 (x_produce_glyphs, x_insert_glyphs)
1673 (rows_from_pos_range, mouse_face_from_buffer_pos)
1674 (fast_find_string_pos, mouse_face_from_string_pos)
1675 (note_mode_line_or_margin_highlight, note_mouse_highlight):
1676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1677 (safe_call, init_from_display_pos, handle_fontified_prop)
1678 (handle_single_display_spec, load_overlay_strings)
1679 (with_echo_area_buffer, setup_echo_area_for_printing)
1680 (display_echo_area, echo_area_display)
1681 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
1682 (update_tool_bar, hscroll_window_tree, redisplay_internal)
1683 (redisplay_window, dump_glyph_row, display_mode_line)
1684 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
1685 (handle_display_spec, display_prop_string_p):
1686 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1687 (handle_single_display_spec, build_desired_tool_bar_string)
1688 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
1689 (get_specified_cursor_type):
1690 Check that fixnums are in proper range for system types.
1691 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
1692 (Flookup_image_map):
1693 Don't assume fixnums fit in int.
1694 (compare_overlay_entries):
1695 Avoid mishandling comparisons due to subtraction overflow.
1696 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
1697 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
1698 (handle_tool_bar_click):
1699 Use int, not unsigned, since we prefer signed and the signedness
1700 doesn't matter here.
1701 (get_next_display_element, next_element_from_display_vector):
1702 Use int, not EMACS_INT, when int is wide enough.
1703 (start_hourglass): Use duration_to_sec_usec to do proper
1704 overflow checking on durations.
1705 * xfaces.c (Fbitmap_spec_p):
1706 Check that fixnums are in proper range for system types.
1707 (compare_fonts_by_sort_order):
1708 Avoid mishandling comparisons due to subtraction overflow.
1709 (Fx_family_fonts, realize_basic_faces):
1710 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1712 Don't assume fixnum fits in int.
1713 Use SAFE_ALLOCA_LISP, not alloca.
1714 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
1715 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
1716 (face_at_buffer_position, face_for_overlay_string)
1717 (face_at_string_position):
1718 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1719 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
1720 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
1722 Check that fixnums are in proper range for system types.
1723 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
1724 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
1725 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1726 (Fx_change_window_property): Don't assume fixnums fit in int.
1727 * xfont.c (xfont_chars_supported):
1728 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1729 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
1730 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
1731 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1732 * xml.c (parse_region):
1733 * xrdb.c (magic_file_p):
1734 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
1735 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
1736 (x_get_local_selection, x_reply_selection_request)
1737 (x_handle_selection_request, wait_for_property_change):
1738 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1739 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
1740 short is wide enough.
1741 (x_send_client_event): Don't assume fixnum fits in int.
1742 * xterm.c (x_x_to_emacs_modifiers):
1743 Don't assume EMACS_INT overflows nicely into int.
1744 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
1746 (handle_one_xevent): NATNUMP can eval its arg twice.
1747 (x_connection_closed):
1748 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
1749 * xterm.h: Adjust decls to match defn changes elsewhere.
1750 (struct scroll_bar): Use struct vectorlike_header
1751 rather than rolling our own approximation.
1752 (SCROLL_BAR_VEC_SIZE): Remove; not used.
1754 2012-05-25 Glenn Morris <rgm@gnu.org>
1756 * lisp.mk (lisp): Update for more files being compiled now.
1758 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
1760 * lread.c: Remove `read_pure' which makes no difference.
1761 (read_pure): Remove var.
1762 (unreadpure): Remove function.
1763 (readevalloop): Don't call read_list with -1 flag.
1764 (read1, read_vector): Don't test read_pure any more.
1765 (read_list): Simplify.
1767 * fileio.c, character.h: Minor style tweaks.
1769 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
1771 * window.h (clip_changed): Remove useless declaration.
1773 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
1775 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
1776 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
1778 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
1781 This directory predates autoconf and is no longer needed nowadays.
1782 Move its few remaining bits of functionality to where they're needed.
1783 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
1784 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
1785 * m/template.h: Remove.
1786 * Makefile.in (M_FILE): Remove. All uses removed.
1787 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
1788 * lisp.h (USE_LSB_TAG):
1789 * mem-limits.h (EXCEEDS_LISP_PTR):
1790 Use VAL_MAX, not VALBITS, in #if.
1791 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
1792 (EMACS_UINT): Define unconditionally now.
1793 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
1794 (BITS_PER_EMACS_INT): New constants, replacing
1795 what used to be in config.h, but not useful in #if.
1796 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
1797 define them any more.
1798 (VAL_MAX): New macro.
1800 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
1801 BITS_PER_EMACS_INT, in #if.
1802 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
1803 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
1804 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
1805 * s/ms-w32.h (DATA_START):
1806 Move here from removed file m/intel386.h.
1807 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
1808 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
1810 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
1812 Assume C89 or later.
1813 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
1814 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
1816 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
1817 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
1818 * textprop.c, tparam.c (NULL): Remove.
1819 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
1820 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
1821 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
1822 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
1823 * xterm.c (input_signal_count): Assume volatile works.
1825 2012-05-21 Ken Brown <kbrown@cornell.edu>
1827 * xgselect.c (xg_select): Fix first argument in call to 'select'
1830 2012-05-20 Ken Brown <kbrown@cornell.edu>
1832 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
1833 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1835 2012-05-19 Ken Brown <kbrown@cornell.edu>
1837 * xfns.c (x_in_use): Remove `static' qualifier.
1838 * xterm.h (x_in_use): Declare.
1839 * xgselect.c: Include xterm.h.
1840 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
1841 and `display_arg' (bug#9754).
1843 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
1845 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
1847 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
1848 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
1850 2012-05-18 Eli Zaretskii <eliz@gnu.org>
1852 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
1854 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
1855 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c
1857 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
1858 reference to image_cache->refcount.
1859 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
1861 2012-05-17 Juri Linkov <juri@jurta.org>
1863 * search.c (Fword_search_regexp, Fword_search_backward)
1864 (Fword_search_forward, Fword_search_backward_lax)
1865 (Fword_search_forward_lax): Move functions to isearch.el
1866 (bug#10145, bug#11381).
1868 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
1870 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
1872 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
1874 * lread.c (init_obarray): Declare Qt and Qnil as special.
1876 2012-05-14 Glenn Morris <rgm@gnu.org>
1878 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
1879 Put "libexec" before "bin", for the sake of init_callproc_1.
1881 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
1883 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
1885 * unexaix.c: Port to more-recent AIX compilers.
1886 (report_error, report_error_1, make_hdr, copy_sym)
1887 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
1888 Make arguments const char *, not char *, to avoid violations of C
1889 standard and to fix some AIX warnings reported by Gilles Pion.
1891 2012-05-14 Eli Zaretskii <eliz@gnu.org>
1893 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
1894 already have overlays loaded.
1895 (handle_single_display_spec): Before returning without displaying
1896 fringe bitmap, synchronize the bidi iterator with the main display
1897 iterator, by calling iterate_out_of_display_property.
1898 (iterate_out_of_display_property): Detect buffer iteration by
1899 testing that it->string is a Lisp string.
1900 (get_next_display_element): When the current object is exhausted,
1901 and there's something on it->stack, call set_iterator_to_next to
1902 proceed with what's on the stack, instead of returning zero.
1903 (set_iterator_to_next): If called at the end of a Lisp string,
1904 proceed to consider_string_end without incrementing string
1905 position. Don't increment display vector index past the end of
1906 the display vector. (Bug#11417)
1907 (pos_visible_p): Don't report a position visible when move_it_to
1908 stopped at the last line of window, which happens to be scanned
1909 backwards by the bidi iteration. (Bug#11464)
1911 2012-05-14 Eli Zaretskii <eliz@gnu.org>
1913 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
1914 and right-margin display specs even if the spec is invalid or we
1915 are on a TTY, and thus unable to display on the fringes.
1916 That's because the text with the property will not be displayed anyway,
1917 so we need to signal to the caller that this is a "replacing"
1918 display spec. This fixes display when the spec is invalid or we
1921 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
1923 * unexaix.c (make_hdr): Fix typo in prototype.
1924 This bug broke the build on AIX. Problem reported by Gilles Pion.
1926 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
1928 * keyboard.c (kbd_buffer_get_event): Read special events also in
1929 batch mode. (Bug#11415)
1931 2012-05-12 Glenn Morris <rgm@gnu.org>
1933 * ns.mk: Update for ns_appbindir no longer having trailing "/".
1935 2012-05-12 Eli Zaretskii <eliz@gnu.org>
1937 * lisp.mk (lisp): Add newcomment.elc.
1939 2012-05-12 Glenn Morris <rgm@gnu.org>
1941 * Makefile.in (MKDIR_P): New, set by configure.
1942 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
1944 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
1946 Remove unused function hourglass_started.
1947 * dispextern.h (hourglass_started):
1948 * w32fns.c (hourglass_started):
1949 * xdisp.c (hourglass_started): Remove.
1951 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
1953 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
1954 Update dependencies.
1956 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
1958 * xgselect.c (xg_select): Put maxfds+1 into a var.
1959 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
1961 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
1963 2012-05-10 Dave Abrahams <dave@boostpro.com>
1965 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
1966 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
1968 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
1970 * dbusbind.c (xd_registered_buses): New internal Lisp object.
1971 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
1972 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
1973 Initialize xd_registered_buses.
1975 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
1977 Untag more efficiently if USE_LSB_TAG.
1978 This is based on a proposal by YAMAMOTO Mitsuharu in
1979 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
1980 For an admittedly artificial (nth 8000 longlist) benchmark on
1981 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
1982 Emacs's overall text size by 1%.
1983 * lisp.h (XUNTAG): New macro.
1984 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
1985 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
1986 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
1987 * eval.c (Fautoload):
1988 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
1989 * frame.h (XFRAME): Use XUNTAG.
1991 Port recent dbusbind.c changes to 32-bit --with-wide-int.
1992 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
1993 Remove unportable assumptions about print widths of types like
1995 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
1996 intptr_t when converting between pointer and integer, to avoid GCC
1997 warnings about wrong width.
1999 2012-05-09 Eli Zaretskii <eliz@gnu.org>
2001 * w32proc.c (new_child): Force Windows to reserve only 64KB of
2002 stack for each reader_thread, instead of defaulting to 8MB
2003 determined by the linker. This avoids failures in creating
2004 subprocesses on Windows 7, see the discussion in this thread:
2005 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
2007 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
2009 Fix up display of the *Minibuf-0* buffer in the mini window.
2010 * keyboard.c (read_char): Don't clear the echo area if there's no
2012 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2013 contents of *Minibuf-0*) if there's no message displayed in its stead.
2015 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
2017 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
2020 2012-05-06 Chong Yidong <cyd@gnu.org>
2022 * lisp.mk (lisp): Update.
2024 2012-05-05 Jim Meyering <meyering@redhat.com>
2026 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
2028 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
2030 * data.c (PUT_ERROR): New macro.
2031 (syms_of_data): Use it. Add new error type `user-error'.
2032 * undo.c (user_error): New function.
2033 (Fprimitive_undo): Use it.
2034 * print.c (print_error_message): Adjust print style for `user-error'.
2035 * keyboard.c (user_error): New function.
2036 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
2038 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
2040 Do not limit current-time-string to years 1000..9999.
2041 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
2042 (Fcurrent_time_string): Support any year that is supported by the
2043 underlying localtime representation. Don't use asctime, as it
2044 has undefined behavior for years outside the range -999..9999.
2046 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
2048 Fix race conditions involving setenv, gmtime, localtime, asctime.
2049 Without this fix, interrupts could mess up code that uses these
2050 nonreentrant functions, since setting TZ invalidates existing
2051 tm_zone or tzname values, and since most of these functions return
2052 pointers to static storage.
2053 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
2054 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
2055 Grow the critical sections to include not just invoking
2056 localtime/gmtime, but also accessing these functions' results
2057 including their tm_zone values if any, and any related TZ setting.
2058 (format_time_string): Last arg is now struct tm *, not struct tm **,
2059 so that the struct tm is saved in the critical section.
2060 All callers changed. Simplify allocation of initial buffer, partly
2061 motivated by the fact that memory allocation needs to be outside
2062 the critical section.
2064 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
2066 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
2067 with RESET_INTERVAL.
2069 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2070 Remove duplicated buffer name initialization.
2072 2012-05-02 Jim Meyering <jim@meyering.net>
2074 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
2076 * xfns.c (x_window): Use xstrdup (Bug#11375).
2078 2012-05-02 Eli Zaretskii <eliz@gnu.org>
2080 * xdisp.c (pos_visible_p): If already at a newline from the
2081 display string before the 'while' loop, don't walk back the glyphs
2082 from it3.glyph_row. Solves assertion violation when the display
2083 string begins with a newline (egg.el). (Bug#11367)
2085 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
2087 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
2090 2012-05-01 Glenn Morris <rgm@gnu.org>
2092 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
2093 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
2094 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
2095 All were removed before 23.1.
2097 * dispnew.c: Remove HAVE_LIBNCURSES test;
2098 it is always true on relevant platforms.
2100 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
2101 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
2103 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
2105 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
2107 * .gdbinit (xpr): Remove checks for no longer existing misc types.
2108 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
2111 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
2113 Do not avoid creating empty evaporating overlays (Bug#9642).
2114 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
2115 That is, do not delete an evaporating overlay if it becomes
2116 empty after its bounds are adjusted to fit within its buffer.
2117 This fix caused other problems, and I'm reverting it until we get
2118 to the bottom of them.
2120 2012-04-27 Chong Yidong <cyd@gnu.org>
2122 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
2124 2012-04-27 Eli Zaretskii <eliz@gnu.org>
2126 * xdisp.c (pos_visible_p): If the window start position is beyond
2127 ZV, start the display from buffer beginning. Prevents assertion
2128 violation in init_iterator when the minibuffer window is scrolled
2131 * window.c (window_scroll_pixel_based): Likewise.
2133 2012-04-27 Chong Yidong <cyd@gnu.org>
2135 * keymap.c (where_is_internal): Doc fix (Bug#10872).
2137 2012-04-27 Glenn Morris <rgm@gnu.org>
2139 * fileio.c (Fcopy_file, Fset_file_selinux_context):
2140 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
2142 2012-04-27 Eli Zaretskii <eliz@gnu.org>
2144 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
2145 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
2147 2012-04-26 Eli Zaretskii <eliz@gnu.org>
2149 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
2150 display element, check also the underlying string or buffer
2151 character. (Bug#11341)
2153 * w32menu.c: Include w32heap.h.
2154 (add_menu_item): If the call to AppendMenuW (via
2155 unicode_append_menu) fails, disable Unicode menus only if we are
2156 running on Windows 9X/Me.
2158 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
2160 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
2161 (xgetint): Add missing shift for LSB tags.
2163 2012-04-24 Martin Rudalics <rudalics@gmx.at>
2165 * keyboard.c (read_char): Don't wipe echo area for select window
2166 events: These might get delayed via `mouse-autoselect-window'
2169 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
2171 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
2172 manipulation of :loaded-from data.
2174 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
2176 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
2177 now a cons (bug#11311).
2179 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
2181 Do not create empty overlays with the evaporate property (Bug#9642).
2182 * buffer.c (Fmove_overlay): Delete an evaporating overlay
2183 if it becomes empty after its bounds are adjusted to fit within
2184 its buffer. Without this fix, in a nonempty buffer (let ((o
2185 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
2186 yields an empty overlay that has the evaporate property, which is
2187 not supposed to happen.
2189 Fix minor GTK3 problems found by static checking.
2190 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2191 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2192 (struct _EmacsFixedClass, emacs_fixed_get_type):
2193 Move decls here from emacsgtkfixed.h, since they needn't be public.
2194 (emacs_fixed_get_type): Now static.
2195 (emacs_fixed_class_init): Omit unused local.
2196 (emacs_fixed_child_type): Remove; unused.
2197 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
2198 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
2199 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
2200 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
2201 (EMACS_FIXED_GET_CLASS): Remove; unused.
2202 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
2204 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
2205 Problem reported by Juanma Barranquero for Windows -Wunused-function.
2207 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2209 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
2210 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
2211 (__malloc_size_t, __malloc_ptrdiff_t):
2212 Remove. All uses removed, replaced by the definiens if needed,
2213 since we can assume C89 or better now.
2214 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
2215 (protect_malloc_state, align, get_contiguous_space)
2216 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
2217 (malloc_atfork_handler_child, malloc_enable_thread)
2218 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
2219 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
2220 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
2221 (special_realloc, _realloc_internal_nolock, _realloc_internal)
2222 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
2223 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
2224 Define using prototypes, not old style.
2225 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
2226 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
2227 (align): Don't assume that signed integer overflow wraps around.
2228 Omit unused local var.
2229 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
2230 (_free_internal_nolock, memalign, mallochook, reallochook):
2231 Omit no-longer-needed casts.
2232 (valloc): Use getpagesize, not __getpagesize.
2233 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
2234 (struct hdr): The 'magic' member is now size_t, not unsigned long.
2236 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
2238 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
2240 Move functions from C to Lisp. Make non-blocking method calls
2241 the default. Implement further D-Bus standard interfaces.
2243 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
2244 (QCdbus_request_name_allow_replacement)
2245 (QCdbus_request_name_replace_existing)
2246 (QCdbus_request_name_do_not_queue)
2247 (QCdbus_request_name_reply_primary_owner)
2248 (QCdbus_request_name_reply_in_queue)
2249 (QCdbus_request_name_reply_exists)
2250 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
2251 (QCdbus_registered_serial, QCdbus_registered_method)
2252 (QCdbus_registered_signal): New Lisp objects.
2253 (XD_DEBUG_MESSAGE): Use sizeof.
2254 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
2255 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
2256 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
2257 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
2258 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
2259 (xd_signature, xd_append_arg): Allow float for integer types.
2260 (xd_get_connection_references): New function.
2261 (xd_get_connection_address): Rename from xd_initialize.
2262 Return cached address.
2263 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
2264 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
2266 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
2267 Return number of refcounts.
2268 (Fdbus_get_unique_name): Make stronger parameter check.
2269 (Fdbus_message_internal): New defun.
2270 (Fdbus_call_method, Fdbus_call_method_asynchronously)
2271 (Fdbus_method_return_internal, Fdbus_method_error_internal)
2272 (Fdbus_send_signal, Fdbus_register_service)
2273 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
2274 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
2275 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
2276 (Vdbus_compiled_version, Vdbus_runtime_version)
2277 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
2278 (Vdbus_message_type_method_return, Vdbus_message_type_error)
2279 (Vdbus_message_type_signal): New defvars.
2280 (Vdbus_registered_buses, Vdbus_registered_objects_table):
2283 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2285 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
2286 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
2287 Do not assume ptrdiff_t is the same width as 'int'.
2289 * alloc.c: Handle unusual debugging option combinations.
2290 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
2291 since the two debugging options are incompatible.
2292 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
2294 (mem_init, mem_insert, mem_insert_fixup):
2295 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
2296 (NEED_MEM_INSERT): Remove; no longer needed.
2298 2012-04-22 Leo Liu <sdl.web@gmail.com>
2300 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
2302 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
2304 * sysdep.c [__FreeBSD__]: Minor cleanups.
2305 (list_system_processes, system_process_attributes) [__FreeBSD__]:
2306 Use Emacs indenting style more consistently. Avoid some casts.
2307 Use 'double' consistently rather than mixing 'float' and 'double'.
2309 2012-04-21 Eduard Wiebe <usenet@pusto.de>
2311 * sysdep.c (list_system_processes, system_process_attributes):
2312 Add implementation for FreeBSD (Bug#5243).
2314 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
2316 * lisp.mk (lisp): Update.
2318 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
2320 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
2321 It is never used otherwise.
2323 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
2325 * print.c (print_preprocess): Only check print_depth if print-circle
2327 (print_object): Check for cycles even when print-circle is nil and
2328 print-gensym is t, but only check print_depth if print-circle is nil.
2330 2012-04-20 Chong Yidong <cyd@gnu.org>
2332 * process.c (wait_reading_process_output): If EIO occurs on a pty,
2333 set the status to "failed" and ensure that sentinel is run.
2335 2012-04-20 Glenn Morris <rgm@gnu.org>
2337 * process.c (Fset_process_inherit_coding_system_flag)
2338 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
2339 (Fmake_network_process, Fmake_serial_process): Doc fix.
2341 2012-04-20 Eli Zaretskii <eliz@gnu.org>
2343 * xdisp.c (string_buffer_position_lim): Limit starting position to
2345 (set_cursor_from_row): If called for a mode-line or header-line
2346 row, return zero immediately.
2347 (try_cursor_movement): If inside continuation line, don't back up
2348 farther than the first row after the header line, if any.
2349 Don't consider the header-line row as "partially visible", even if
2350 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
2352 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
2354 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
2357 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
2358 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
2360 configure: new option --enable-gcc-warnings (Bug#11207)
2361 * Makefile.in (C_WARNINGS_SWITCH): Remove.
2362 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
2363 (ALL_CFLAGS): Use new macros rather than old.
2364 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
2365 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
2366 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
2367 -Wunused-result, -Wunused-variable. This should go away once
2368 the Emacs and Gnulib regex code is merged.
2369 (xmalloc, xrealloc): Now static.
2371 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
2373 * dired.c (Fsystem_groups): Remove unused local.
2375 2012-04-17 Glenn Morris <rgm@gnu.org>
2377 * dired.c (Fsystem_users): Doc fix.
2379 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
2381 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
2382 (syms_of_dired): Add them.
2384 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
2386 Fix minor alloc.c problems found by static checking.
2387 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
2388 New extern decls, to avoid calling undeclared functions.
2389 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
2390 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
2391 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
2392 (NEED_MEM_INSERT): New macro.
2393 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
2394 Remove one incorrect comment and fix another.
2396 Fix minor ralloc.c problems found by static checking.
2397 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
2398 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
2399 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
2400 (r_alloc_sbrk): Now static.
2402 Improve ralloc.c interface checking.
2403 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
2404 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
2405 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
2406 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
2407 [REL_ALLOC]: ... to here, to check interface.
2408 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
2409 Remove decls. This fixes an "It stinks!".
2411 * alloc.c (which_symbols): Fix alignment issue / type clash.
2413 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
2415 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
2416 (struct Lisp_Misc_Any): Likewise.
2417 (struct Lisp_Free): Likewise.
2418 * alloc.c (union aligned_Lisp_Symbol): Define.
2419 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
2420 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
2421 (union aligned_Lisp_Misc): Define.
2422 (MARKER_BLOCK_SIZE, struct marker_block): Use union
2423 aligned_Lisp_Misc instead of union Lisp_Misc.
2424 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
2426 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
2428 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
2429 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
2430 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
2431 * s/netbsd.h, s/sol2-6.h:
2432 Remove definition of GC_MARK_STACK, since the default now works.
2433 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
2434 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
2435 no longer the default.
2436 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
2438 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
2440 * lread.c (lisp_file_lexically_bound_p):
2441 Fix hang at ";-*-\n" (bug#11238).
2443 2012-04-14 Eli Zaretskii <eliz@gnu.org>
2445 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
2446 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
2448 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
2450 * nsterm.m (constrainFrameRect): Always constrain when there is only
2451 one screen (Bug#10962).
2453 2012-04-13 Ken Brown <kbrown@cornell.edu>
2455 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
2457 2012-04-13 Reuben Thomas <rrt@sc3d.org>
2459 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
2461 2012-04-11 Daniel Colascione <dancol@dancol.org>
2463 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
2464 against is gone. It's better to use vfork now so that when Cygwin
2465 gains a new, working vfork, we use it automatically (bug#10398).
2467 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2469 * window.c (save_window_save): Obey window-point-insertion-type.
2471 2012-04-11 Glenn Morris <rgm@gnu.org>
2473 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
2475 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
2477 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
2479 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
2481 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
2482 (force_quit_count): New var.
2483 (handle_interrupt): Use it.
2485 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
2487 * w32.c (w32_delayed_load): Record the full path of the library
2488 being loaded (bug#10424).
2490 2012-04-09 Glenn Morris <rgm@gnu.org>
2492 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
2493 not just in the obarray, before snarfing them. (Bug#11036)
2495 * Makefile.in ($(leimdir)/leim-list.el):
2496 Pass EMACS rather than BUILT_EMACS.
2498 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
2500 * process.c (make_process):
2501 * process.h: Add integer `gnutls_handshakes_tried' member to
2504 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
2505 Add convenience `GNUTLS_LOG2i' macro.
2507 * gnutls.c (gnutls_log_function2i): Convenience log function.
2508 (emacs_gnutls_read): Use new log functions,
2509 `gnutls_handshakes_tried' process member, and
2510 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
2511 attempts per process (connection).
2513 2012-04-09 Chong Yidong <cyd@gnu.org>
2515 * eval.c (Fuser_variable_p, user_variable_p_eh)
2516 (lisp_indirect_variable): Functions deleted.
2517 (Fdefvar): Caller changed.
2519 * callint.c (Finteractive, Fcall_interactively):
2520 * minibuf.c (Fread_variable): Callers changed.
2522 2012-04-09 Eli Zaretskii <eliz@gnu.org>
2524 * xdisp.c (set_cursor_from_row): If the display string appears in
2525 the buffer at position that is closer to point than the position
2526 after the display string, display the cursor on the first glyph of
2527 the display string. Fixes cursor display when a 'display' text
2528 property immediately follows invisible text. (Bug#11094)
2530 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
2532 composite.c: use 'double' consistently
2533 * composite.c (get_composition_id): Use 'double' consistently
2534 instead of converting 'float' to 'double' and vice versa; this is
2535 easier to understand and avoids a GCC warning.
2537 2012-04-09 Glenn Morris <rgm@gnu.org>
2539 * Makefile.in: Generate leim-list with bootstrap-emacs, in
2540 preparation for dumping it with emacs. (Bug#4789)
2541 (leimdir): New variable.
2542 ($(leimdir)/leim-list.el): New rule.
2543 (emacs$(EXEEXT)): Depend on leim-list.el.
2545 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
2546 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
2547 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
2549 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
2551 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
2554 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
2556 * xml.c (init_libxml2_functions) [WINDOWSNT]:
2557 Remove unused local variable.
2559 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
2561 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
2562 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
2563 (mark_memory): Mark Lisp_Objects only if pointers might hide in
2564 objects, as mark_maybe_pointer will catch them otherwise.
2565 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
2566 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
2568 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
2570 Fix typo that broke non-Windows builds.
2571 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
2573 2012-04-07 Eli Zaretskii <eliz@gnu.org>
2575 Support building on MS-Windows with libxml2.
2577 * makefile.w32-in (OBJ2): Add xml.$(O).
2578 (GLOBAL_SOURCES): Add xml.c.
2579 ($(BLD)/xml.$(O)): New dependency list.
2581 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
2582 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
2583 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
2584 [!WINDOWSNT]: New macros.
2585 (init_libxml2_functions, libxml2_loaded_p): New functions.
2586 (parse_region): Call fn_xmlCheckVersion instead of using the macro
2587 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
2588 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
2589 Calls xmlCleanupParser only if libxml2 was loaded (or statically
2591 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
2592 Call init_libxml2_functions before calling libxml2 functions.
2593 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
2595 * emacs.c: Don't include libxml/parser.h.
2596 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
2597 xmlCleanupParser directly.
2599 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
2601 2012-04-07 Eli Zaretskii <eliz@gnu.org>
2603 * indent.c (Fvertical_motion): If there is a display string at
2604 point, use it.vpos to compute how many lines to backtrack after
2605 move_it_to point. (Bug#11133)
2607 2012-04-06 Eli Zaretskii <eliz@gnu.org>
2609 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
2610 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
2611 about subtle differences between FETCH_CHAR* and STRING_CHAR*
2612 macros related to unification of CJK characters. For the details,
2613 see the discussion following the message here:
2614 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
2616 2012-04-04 Chong Yidong <cyd@gnu.org>
2618 * keyboard.c (Vdelayed_warnings_list): Doc fix.
2620 2012-04-01 Eli Zaretskii <eliz@gnu.org>
2622 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
2623 instead of alloca. (Bug#11138)
2625 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
2627 * w32menu.c (is_simple_dialog): Properly check lisp types.
2630 2012-03-31 Eli Zaretskii <eliz@gnu.org>
2632 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
2633 position we get to after a call to move_it_to fails the
2634 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
2635 only if we wind up in a string from display property. (Bug#11063)
2637 * window.c (Fdelete_other_windows_internal): Invalidate the row
2638 and column information about mouse highlight, so that redisplay
2639 restores it after reallocating the glyph matrices. (Bug#7464)
2641 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
2642 string comes from a `display' text property, use the buffer
2643 position of that property as if we actually saw that position in
2645 (move_it_by_lines): Remove the assertion that
2646 "it->current_x == 0 && it->hpos == 0" which can be legitimately
2647 violated when there's a before-string at the beginning of a line.
2650 2012-03-30 Eli Zaretskii <eliz@gnu.org>
2652 * xdisp.c (append_space_for_newline): If the default face was
2653 remapped, use the remapped face for the appended newline.
2654 (extend_face_to_end_of_line): Use the remapped default face for
2655 extending the face to the end of the line.
2656 (display_line): Call extend_face_to_end_of_line when the default
2657 face was remapped. (Bug#11068)
2659 2012-03-29 Eli Zaretskii <eliz@gnu.org>
2661 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
2663 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
2665 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
2667 2012-03-27 Glenn Morris <rgm@gnu.org>
2669 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
2672 2012-03-26 Kenichi Handa <handa@m17n.org>
2674 * dispextern.h (struct glyph): Fix previous change. Change the
2675 bit length of glyphless.ch to 25 (Bug#11082).
2677 2012-03-26 Chong Yidong <cyd@gnu.org>
2679 * keyboard.c (Vselection_inhibit_update_commands): New variable.
2680 (command_loop_1): Use it; inhibit selection update for
2681 handle-select-window too (Bug#8996).
2683 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
2685 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
2687 2012-03-25 Kenichi Handa <handa@m17n.org>
2689 * dispextern.h (struct glyph): Change the bit length of
2690 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
2692 2012-03-24 Eli Zaretskii <eliz@gnu.org>
2694 * s/ms-w32.h (tzname): Include time.h before redirecting to
2695 _tzname. Fixes the MSVC build. (Bug#9960)
2697 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
2699 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
2702 * xterm.c (XTread_socket): Only modify handling_signal if
2703 !SYNC_INPUT. (Bug#11080)
2705 2012-03-23 Eli Zaretskii <eliz@gnu.org>
2707 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
2708 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
2709 when fetching a multibyte character consumes more bytes than
2710 CHAR_BYTES returns, due to unification of CJK characters in
2711 string_char. (Bug#11073)
2713 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
2715 * process.c (wait_reading_process_output): Handle pty disconnect
2716 by refraining from sending oneself a SIGCHLD (bug#10933).
2718 2012-03-22 Chong Yidong <cyd@gnu.org>
2720 * dispextern.h (struct it): New member string_from_prefix_prop_p.
2722 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
2723 Mark string as coming from a prefix property.
2724 (handle_face_prop): Use default face for prefix strings (Bug#4281).
2725 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
2727 2012-03-21 Chong Yidong <cyd@gnu.org>
2729 * xfaces.c (Vface_remapping_alist): Doc fix.
2731 2012-03-20 Eli Zaretskii <eliz@gnu.org>
2733 * w32proc.c (Fw32_set_console_codepage)
2734 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
2737 2012-03-20 Chong Yidong <cyd@gnu.org>
2739 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
2740 to reflect default non-nil value of redisplay-dont-pause.
2742 2012-03-19 Kenichi Handa <handa@m17n.org>
2744 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
2745 it fit in a valid range (Bug#11003).
2747 2012-03-18 Eli Zaretskii <eliz@gnu.org>
2749 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
2750 that is not from display property, accept the row as a "cursor
2751 row" if one of the string's character has a non-nil `cursor'
2752 property. Fixes cursor positioning when there are newlines in
2753 overlay strings, e.g. in icomplete.el. (Bug#11035)
2755 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
2757 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
2759 2012-03-12 Chong Yidong <cyd@gnu.org>
2761 * eval.c (inhibit_lisp_code): Rename from
2762 inhibit_window_configuration_change_hook; move from window.c.
2764 * xfns.c (unwind_create_frame_1, Fx_create_frame):
2765 * window.c (run_window_configuration_change_hook)
2766 (syms_of_window): Callers changed.
2768 2012-03-11 Chong Yidong <cyd@gnu.org>
2770 * keymap.c (Fkey_description): Doc fix (Bug#9700).
2772 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
2774 2012-03-10 Chong Yidong <cyd@gnu.org>
2776 * frame.c (other_visible_frames): Don't assume the selected frame
2777 is visible (Bug#10955).
2779 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
2781 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
2783 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
2785 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
2786 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
2789 2012-03-03 Glenn Morris <rgm@gnu.org>
2791 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
2793 2012-03-02 Eli Zaretskii <eliz@gnu.org>
2795 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
2796 position past the first glyph_row that ends at ZV. (Bug#10902)
2797 (redisplay_window, next_element_from_string): Fix typos in
2799 (redisplay_window): Pass to move_it_vertically the margin in
2800 pixels, not in screen lines.
2802 2012-03-02 Glenn Morris <rgm@gnu.org>
2804 * buffer.c (buffer-list-update-hook): Doc fix.
2806 2012-02-29 Eli Zaretskii <eliz@gnu.org>
2808 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
2809 push_it before setting up the iterator for the first overlay
2810 string, even if we have an empty string loaded.
2811 (next_overlay_string): If there's an empty string on the iterator
2812 stack, pop the stack. (Bug#10903)
2814 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
2816 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
2817 Suggested by Stefan Monnier in
2818 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
2819 * alloc.c (widen_to_Lisp_Object): New static function.
2820 (mark_memory): Also mark Lisp_Objects by fetching pointer words
2821 and widening them to Lisp_Objects. This would work even if
2822 USE_LSB_TAG is defined and wide integers are used, which might
2823 happen in a future version of Emacs.
2825 2012-02-25 Chong Yidong <cyd@gnu.org>
2827 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
2830 * xselect.c (Fx_selection_exists_p): Doc fix.
2831 (x_clipboard_manager_save_all): Print an informative message
2832 before saving to clipboard manager.
2834 2012-02-24 Chong Yidong <cyd@gnu.org>
2836 * keyboard.c (process_special_events): Handle all X selection
2837 requests in kbd_buffer, not just the next one (Bug#8869).
2839 2012-02-23 Chong Yidong <cyd@gnu.org>
2841 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
2842 call when setting menu-bar-lines and tool-bar-lines parameters.
2843 (unwind_create_frame_1): New helper function.
2845 * window.c (inhibit_window_configuration_change_hook): New var.
2846 (run_window_configuration_change_hook): Obey it.
2847 (syms_of_window): Initialize it.
2849 2012-02-22 Chong Yidong <cyd@gnu.org>
2851 * xterm.c (x_draw_image_relief): Add missing type check for
2852 Vtool_bar_button_margin (Bug#10743).
2854 2012-02-21 Chong Yidong <cyd@gnu.org>
2856 * fileio.c (Vfile_name_handler_alist): Doc fix.
2858 * buffer.c (Fget_file_buffer): Protect against invalid file
2859 handler return value.
2861 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
2863 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
2864 when computing $valmask.
2866 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
2867 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
2868 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
2869 It's useless in that case, and it can cause problems on hosts
2870 that allocate halves of EMACS_INT values separately.
2871 Reported by Dan Horák. Diagnosed by Andreas Schwab in
2872 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
2873 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
2874 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
2875 it avoids undefined behavior on hosts where shifting right by more
2876 than the word width has undefined behavior.
2878 2012-02-19 Chong Yidong <cyd@gnu.org>
2880 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
2881 (Funhandled_file_name_directory, Ffile_name_as_directory)
2882 (Fdirectory_file_name, Fexpand_file_name)
2883 (Fsubstitute_in_file_name): Protect against invalid file handler
2884 return values (Bug#10845).
2886 2012-02-18 Eli Zaretskii <eliz@gnu.org>
2888 * .gdbinit (pitx): Fix incorrect references to fields of the
2891 2012-02-17 Chong Yidong <cyd@gnu.org>
2893 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
2895 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
2897 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
2898 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
2900 2012-02-15 Chong Yidong <cyd@gnu.org>
2902 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
2903 marked as special. Also, starting docstrings with * is obsolete.
2905 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
2907 * gnutls.c (emacs_gnutls_write): Fix last change.
2909 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
2911 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
2914 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
2916 * keymap.c (Fsingle_key_description): Handle char ranges.
2918 2012-02-12 Chong Yidong <cyd@gnu.org>
2920 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
2921 as that creates a dangerous corner case.
2923 * window.c (Fdelete_window_internal): Invalidate the mouse
2924 highlight (Bug#9904).
2926 2012-02-12 Glenn Morris <rgm@gnu.org>
2928 * xselect.c (Fx_own_selection_internal)
2929 (Fx_get_selection_internal, Fx_disown_selection_internal)
2930 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
2931 * nsselect.m (Fx_own_selection_internal)
2932 (Fx_disown_selection_internal, Fx_selection_exists_p)
2933 (Fx_selection_owner_p, Fx_get_selection_internal):
2934 Sync docs and argument specs with the xselect.c versions.
2936 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
2938 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
2940 2012-02-11 Eli Zaretskii <eliz@gnu.org>
2942 * w32select.c (Fx_selection_exists_p): Sync doc string and
2943 argument list with xselect.c. (Bug#10783)
2945 * w16select.c (Fx_selection_exists_p): Sync doc string and
2946 argument list with xselect.c. (Bug#10783)
2948 2012-02-10 Glenn Morris <rgm@gnu.org>
2950 * fns.c (Fsecure_hash): Doc fix.
2952 2012-02-09 Kenichi Handa <handa@m17n.org>
2954 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
2956 2012-02-07 Chong Yidong <cyd@gnu.org>
2958 * buffer.c (Fbuffer_local_variables)
2959 (buffer_lisp_local_variables): Handle unbound vars correctly;
2960 don't let Qunbound leak into Lisp.
2962 2012-02-07 Glenn Morris <rgm@gnu.org>
2964 * image.c (Fimagemagick_types): Doc fix.
2966 * image.c (imagemagick-render-type): Change it from a lisp object
2967 to an integer. Move the doc here from the lisp manual.
2968 Treat all values not equal to 0 the same.
2970 2012-02-06 Chong Yidong <cyd@gnu.org>
2972 * doc.c (store_function_docstring): Avoid applying docstring of
2973 alias to base function (Bug#2603).
2975 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
2977 * .gdbinit (pp1, pv1): Remove redundant defines.
2980 2012-02-04 Chong Yidong <cyd@gnu.org>
2982 * nsterm.m: Declare a global (Bug#10694).
2984 2012-02-04 Eli Zaretskii <eliz@gnu.org>
2986 * w32.c (get_emacs_configuration_options):
2987 Include --enable-checking, if specified, in the return value.
2989 2012-02-04 Martin Rudalics <rudalics@gmx.at>
2991 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
2992 after rounding frame sizes. (Bug#9723)
2994 2012-02-04 Eli Zaretskii <eliz@gnu.org>
2996 * keyboard.c (adjust_point_for_property): Don't position point
2997 before BEGV. (Bug#10696)
2999 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
3001 Handle overflow when computing char display width (Bug#9496).
3002 * character.c (char_width): Return EMACS_INT, not int.
3003 (char_width, c_string_width): Check for overflow when
3004 computing the width; this is possible now that individual
3005 characters can have unbounded width. Problem introduced
3006 by merge from Emacs 23 on 2012-01-19.
3008 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
3010 * dbusbind.c (Fdbus_register_method): Mention the return value
3011 :ignore in the docstring.
3013 2012-02-02 Glenn Morris <rgm@gnu.org>
3015 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
3017 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3018 Unconditionally set to t. (Bug#10673)
3019 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3020 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
3021 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
3023 2012-02-02 Kenichi Handa <handa@m17n.org>
3025 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
3026 0, do not call append_composite_glyph.
3028 2012-02-02 Kenichi Handa <handa@m17n.org>
3030 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
3032 (x_produce_glyphs): If the component of a composition is a null
3033 string, set it->pixel_width to 1 to avoid zero-width glyph.
3035 2012-02-01 Eli Zaretskii <eliz@gnu.org>
3037 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
3038 first 2 arguments are identical. This makes inserting large
3039 output from a subprocess an order of magnitude faster on
3040 MS-Windows, where all sbrk'ed memory is always contiguous.
3042 2012-01-31 Glenn Morris <rgm@gnu.org>
3044 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
3045 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
3046 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
3048 2012-01-29 Glenn Morris <rgm@gnu.org>
3050 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
3052 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
3054 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
3056 2012-01-28 Chong Yidong <cyd@gnu.org>
3058 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
3060 2012-01-26 Chong Yidong <cyd@gnu.org>
3062 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
3064 * search.c (Fsearch_forward, Fsearch_backward): Document negative
3065 repeat counts (Bug#10507).
3067 2012-01-26 Glenn Morris <rgm@gnu.org>
3069 * lread.c (syms_of_lread): Doc fix.
3071 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
3073 * coding.c (encode_designation_at_bol): Change return value to
3076 2012-01-25 Chong Yidong <cyd@gnu.org>
3078 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
3080 2012-01-21 Chong Yidong <cyd@gnu.org>
3082 * floatfns.c (Fcopysign): Make the second argument non-optional,
3083 since nil is not allowed anyway.
3085 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
3087 * process.c (read_process_output): Use p instead of XPROCESS (proc).
3088 (send_process): Likewise.
3090 2012-01-19 Martin Rudalics <rudalics@gmx.at>
3092 * window.c (save_window_save, Fcurrent_window_configuration)
3093 (Vwindow_persistent_parameters): Do not use Qstate.
3094 Rewrite doc-strings.
3096 2012-01-19 Kenichi Handa <handa@m17n.org>
3098 * character.c (char_width): New function.
3099 (Fchar_width, c_string_width, lisp_string_width):
3100 Use char_width (Bug#9496).
3102 2012-01-16 Martin Rudalics <rudalics@gmx.at>
3104 * window.c (Vwindow_persistent_parameters): New variable.
3105 (Fset_window_configuration, save_window_save): Handle persistent
3108 2012-01-14 Eli Zaretskii <eliz@gnu.org>
3110 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
3111 thrashing the stack of the thread. (Bug#9087)
3113 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
3115 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
3117 2012-01-11 Eli Zaretskii <eliz@gnu.org>
3119 * xdisp.c (rows_from_pos_range): Handle the case where the
3120 highlight ends on a newline. (Bug#10464)
3121 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
3122 he end column for display of highlight that ends on a newline
3125 2012-01-11 Glenn Morris <rgm@gnu.org>
3127 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
3128 from load-path also when installation-directory is nil. (Bug#10208)
3130 2012-01-10 Glenn Morris <rgm@gnu.org>
3132 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
3134 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
3135 Update template values to be closer to their typical values these days.
3137 2012-01-09 Eli Zaretskii <eliz@gnu.org>
3139 * xdisp.c (rows_from_pos_range): Accept additional argument
3140 DISP_STRING, and accept any glyph in a row whose object is that
3141 string as eligible for mouse highlight. Fixes mouse highlight of
3142 display strings from overlays. (Bug#10464)
3144 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
3146 emacs: fix an auto-save permissions race condition (Bug#10400)
3147 * fileio.c (auto_saving_dir_umask): New static var.
3148 (Fmake_directory_internal): Use it.
3149 (do_auto_save_make_dir): Set it, instead of invoking chmod after
3150 creating the directory. The old code temporarily assigns
3151 too-generous permissions to the directory.
3152 (do_auto_save_eh): Clear it.
3153 (Fdo_auto_save): Catch all errors, not just file errors, so
3154 that the var is always cleared.
3156 2012-01-07 Eli Zaretskii <eliz@gnu.org>
3158 * search.c (scan_buffer): Pass character positions to
3159 know_region_cache, not byte positions. (Bug#6540)
3161 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
3163 * w32.c (sys_rename): Report EXDEV when rename of a directory
3164 fails because the target is on another logical disk. (Bug#10284)
3166 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
3168 * xterm.c (x_embed_request_focus): New function.
3170 * xterm.h: Add prototype.
3172 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
3174 2012-01-05 Glenn Morris <rgm@gnu.org>
3176 * emacs.c (emacs_copyright): Update short copyright year to 2012.
3178 2012-01-01 Eli Zaretskii <eliz@gnu.org>
3180 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
3181 Load gnutls_transport_set_lowat only if GnuTLS version is below
3183 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
3184 GnuTLS versions below 2.11.1.
3186 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
3188 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
3189 to the doc string advising against its use for altering the way
3190 windows are scrolled.
3192 2011-12-28 Kenichi Handa <handa@m17n.org>
3194 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
3195 coding-system ASCII compatible only when it does not produce BOM
3196 on encoding (Bug#10383).
3198 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
3200 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
3202 (create_and_show_popup_menu): Always use menu_position_func for
3205 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
3207 * callint.c (Fcall_interactively): Don't truncate prompt string.
3209 2011-12-23 Eli Zaretskii <eliz@gnu.org>
3211 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
3212 property that ends at ZV, so that the bidi iteration could be
3213 resumed from there (after widening). (Bug#10360)
3215 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
3217 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
3219 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
3221 * nsterm.m (x_free_frame_resources):
3222 Release f->output_data.ns->miniimage.
3223 (ns_index_color): Fix indentation. Do not retain
3224 color_table->colors[i].
3226 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
3229 * nsfns.m (x_set_background_color): Assign return value from
3230 ns_index_color to face-background instead of NSColor*.
3231 (ns_implicitly_set_icon_type): Fix indentation.
3232 Change assignment in for loop to comparison.
3234 * emacs.c (ns_pool): New variable.
3235 (main): Assign ns_pool.
3236 (Fkill_emacs): Call ns_release_autorelease_pool.
3238 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
3239 autorelease fdesc, release fdAttrs and tdict.
3240 (ns_get_covering_families): Release charset.
3241 (ns_findfonts): Release NSFontDescriptor created with new.
3242 (ns_uni_to_glyphs): Fix indentation.
3243 (setString): Release attrStr before assigning new value.
3245 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
3247 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
3249 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
3250 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
3252 2011-12-18 David Reitter <reitter@cmu.edu>
3254 * nsterm.m (ns_term_init): Subscribe for notifications
3255 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
3256 to method trackingNotification in EmacsMenu.
3258 * nsmenu.m (trackingMenu): New variable.
3259 (trackingNotification): New method (from Aquamacs).
3260 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3261 from Aquamacs (Bug#7030).
3263 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
3265 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
3266 (symbol_to_nsstring): Fix indentation.
3267 (ns_symbol_to_pb): New function.
3268 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
3269 (Fns_rotate_cut_buffers_internal): Remove.
3270 (Fns_store_selection_internal): Rename from
3271 Fns_store_cut_buffer_internal.
3272 (ns_get_foreign_selection, Fx_own_selection_internal)
3273 (Fx_disown_selection_internal, Fx_selection_exists_p)
3274 (Fns_get_selection_internal, Fns_store_selection_internal):
3275 Use ns_symbol_to_pb and check if return value is nil.
3276 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
3277 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
3278 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
3279 renamed to Sns_store_selection_internal.
3280 (ns_handle_selection_request): Move code to Fx_own_selection_internal
3281 and remove this function.
3282 (ns_handle_selection_clear): Remove, never used.
3283 (Fx_own_selection_internal): Move code from ns_handle_selection_request
3286 2011-12-17 Ken Brown <kbrown@cornell.edu>
3288 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
3289 GID is unknown (Bug#10257).
3291 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
3293 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
3294 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
3295 which caused a build failure on GNU/Linux IA-64. This problem was
3296 introduced by my 2011-10-07 patch.
3298 2011-12-15 Juri Linkov <juri@jurta.org>
3300 * image.c (imagemagick_error): New function. (Bug#10112)
3301 (imagemagick_load_image): Comment out `MagickSetResolution' call.
3302 Use `imagemagick_error' where ImageMagick functions return
3304 (Fimagemagick_types): Add `Fnreverse' to return the list in the
3307 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3309 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
3310 fill background (Bug#8992).
3312 2011-12-13 Martin Rudalics <rudalics@gmx.at>
3314 * window.c (Vwindow_combination_resize)
3315 (Vwindow_combination_limit): Use t instead of non-nil in
3317 (Vrecenter_redisplay): Add first sentence of doc-string on
3319 (Frecenter): Fix doc-string typo.
3321 2011-12-11 Kenichi Handa <handa@m17n.org>
3323 * coding.c (Funencodable_char_position): Pay attention to the
3324 buffer text relocation (Bug#9389).
3326 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
3328 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
3329 gtk_init (Bug#10100).
3331 2011-12-10 Eli Zaretskii <eliz@gnu.org>
3333 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
3334 IT->string is nil. (Bug#10263)
3336 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
3338 * nsterm.h (x_free_frame_resources): Declare.
3340 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
3341 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
3343 * nsterm.h (ns_get_defaults_value): Declare.
3345 * nsterm.m (ns_default): Call ns_get_defaults_value.
3347 2011-12-09 Eli Zaretskii <eliz@gnu.org>
3349 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
3352 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3354 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
3355 that where the value of an _OBJC_* symbol points to is in the .bss
3356 section (Bug#10240).
3358 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3360 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
3361 after the loop to call ccl_driver at least once (Bug#8619).
3363 2011-12-08 Kenichi Handa <handa@m17n.org>
3365 * ftfont.c (get_adstyle_property): Fix previous change
3368 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
3370 * w32.c (init_environment): If no_site_lisp, remove site-lisp
3371 dirs from the default value of EMACSLOADPATH (bug#10208).
3373 2011-12-07 Glenn Morris <rgm@gnu.org>
3375 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
3376 installation and source directories as well. (Bug#10208)
3378 2011-12-06 Chong Yidong <cyd@gnu.org>
3380 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
3382 2011-12-06 Glenn Morris <rgm@gnu.org>
3384 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
3385 as an error, not just -1. (Bug#10217)
3387 2011-12-05 Chong Yidong <cyd@gnu.org>
3389 * keyboard.c (process_special_events): New function.
3390 (swallow_events, Finput_pending_p): Use it (Bug#10195).
3392 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
3394 * coding.c (encode_designation_at_bol): Don't use uninitialized
3395 local variable (Bug#9318).
3397 2011-12-05 Kenichi Handa <handa@m17n.org>
3399 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
3400 return Qnil (Bug#8046, Bug#10193).
3402 2011-12-05 Kenichi Handa <handa@m17n.org>
3404 * coding.c (encode_designation_at_bol): New args charbuf_end and
3405 dst. Return the number of produced bytes. Callers changed.
3406 (coding_set_source): Return how many bytes coding->source was
3408 (coding_set_destination): Return how many bytes
3409 coding->destination was relocated.
3410 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
3411 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
3413 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
3415 * coding.c (CODING_CHAR_CHARSET_P): New macro.
3416 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
3419 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
3421 The following changes are to fix Bug#9318.
3423 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
3424 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
3425 (encode_coding_iso_2022, encode_coding_sjis)
3426 (encode_coding_big5, encode_coding_charset): Use the above macros.
3428 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
3430 * lisp.h (process_quit_flag): Fix external declaration.
3432 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
3434 Don't macro-inline non-performance-critical code.
3435 * eval.c (process_quit_flag): New function.
3436 * lisp.h (QUIT): Use it.
3438 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
3440 * nsfns.m (get_geometry_from_preferences): New function.
3441 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
3443 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
3445 * emacs.c (Qkill_emacs): Define.
3446 (syms_of_emacs): Initialize it.
3447 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
3448 Qquit_flag to `kill-emacs' instead.
3449 (quit_throw_to_read_char): Add parameter `from_signal'.
3450 All callers changed. Call Fkill_emacs if requested and safe.
3451 * lisp.h (QUIT): Call Fkill_emacs if requested.
3453 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
3455 * widget.c (update_wm_hints): Return if wmshell is null.
3456 (widget_update_wm_size_hints): New function.
3458 * widget.h (widget_update_wm_size_hints): Declare.
3460 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
3461 widget_update_wm_size_hints (Bug#10104).
3463 2011-12-03 Eli Zaretskii <eliz@gnu.org>
3465 * xdisp.c (handle_invisible_prop): If the invisible text ends just
3466 before a newline, prepare the bidi iterator for consuming the
3467 newline, and keep the current paragraph direction. (Bug#10183)
3468 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
3470 2011-12-02 Juri Linkov <juri@jurta.org>
3472 * search.c (Fword_search_regexp): New Lisp function created from
3473 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
3474 (Fword_search_backward, Fword_search_forward)
3475 (Fword_search_backward_lax, Fword_search_forward_lax):
3476 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
3477 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
3479 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
3481 * fileio.c (Finsert_file_contents): Move after-change-function call
3482 to before the "handled:" label, since all "goto handled" appear in
3483 cases where the *-change-functions have already been properly called
3486 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
3488 * keyboard.c (interrupt_signal): Don't call kill-emacs when
3489 waiting for input. (Bug#10169)
3491 2011-11-30 Eli Zaretskii <eliz@gnu.org>
3493 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
3494 verifies glyph row's hash code--we have just reallocated the
3495 glyphs, so their contents can be complete garbage. (Bug#10164)
3497 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
3499 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
3501 2011-11-30 Eli Zaretskii <eliz@gnu.org>
3503 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
3504 attributes are tested _before_ calling verify_row_hash, to protect
3505 against GCC re-ordering of the tests. (Bug#10164)
3507 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
3509 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
3511 * xterm.c (handle_one_xevent): Only set async_visible and friends
3512 if net_wm_state_hidden_seen is non-zero (Bug#10002)
3513 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
3514 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
3516 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
3518 Remove GCPRO-related macros that exist only to avoid shadowing locals.
3519 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
3520 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
3521 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
3522 All uses changed to use GCPRO1 etc.
3523 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
3524 Revert to old implementation (i.e., before 2011-03-11).
3526 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3528 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
3529 of scroll runs so as to avoid assigning disabled bogus rows and
3530 unnecessary graphics copy operations.
3532 2011-11-27 Eli Zaretskii <eliz@gnu.org>
3534 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
3535 (snprintf) [_MSC_VER]: Redirect to _snprintf.
3536 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
3537 (malloc, free, realloc, calloc): Redirect to e_* only when
3540 * lisp.h (GCTYPEBITS): Move before first use.
3541 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
3542 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
3543 this macro definition.
3545 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
3548 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
3550 * gtkutil.c (xg_create_frame_widgets):
3551 Call gtk_window_set_has_resize_grip (FALSE) if that function is
3552 present with Gtk+ 2.0.
3554 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
3556 * fileio.c (Finsert_file_contents): Undo previous change; see
3557 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
3559 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
3561 Rename locals to avoid shadowing.
3562 * fileio.c (Finsert_file_contents):
3563 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
3564 * process.c (wait_reading_process_output):
3565 Rename inner 'proc' to 'p' to avoid shadowing.
3566 Indent for consistency with usual Emacs style.
3568 2011-11-25 Eli Zaretskii <eliz@gnu.org>
3570 * xdisp.c (redisplay_window): If cursor row is not fully visible
3571 after recentering, and scroll-conservatively is set to a large
3572 number, scroll window by a few more lines to make the cursor fully
3573 visible and out of scroll-margin. (Bug#10105)
3574 (start_display): Don't move to the next line if the display should
3575 start at a newline that is part of a display vector or an overlay
3578 2011-11-24 Juri Linkov <juri@jurta.org>
3580 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
3581 after the `MagickPingImage' call. (Bug#10112)
3583 2011-11-23 Chong Yidong <cyd@gnu.org>
3585 * window.c (Fcoordinates_in_window_p): Accept only live windows.
3587 2011-11-23 Martin Rudalics <rudalics@gmx.at>
3589 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
3590 making another buffer current. (Bug#10114)
3592 2011-11-23 Glenn Morris <rgm@gnu.org>
3594 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
3596 2011-11-23 Chong Yidong <cyd@gnu.org>
3598 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
3599 using it (Bug#5984).
3601 2011-11-22 Eli Zaretskii <eliz@gnu.org>
3603 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
3604 and header-lines, as they don't have one computed for them.
3607 * .gdbinit (prow): Make displayed values more self-explaining.
3608 Add row's hash code.
3610 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
3612 * process.c (wait_reading_process_output): Fix asynchrounous
3613 GnuTLS socket handling on some versions of the GnuTLS library.
3614 (wait_reading_process_output): Add comment and URL.
3616 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
3618 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
3620 2011-11-21 Chong Yidong <cyd@gnu.org>
3622 * window.c (Fnext_window, Fprevious_window): Doc fix.
3624 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3626 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
3628 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
3630 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
3632 2011-11-20 Martin Rudalics <rudalics@gmx.at>
3634 * window.c (Fset_window_combination_limit): Rename argument
3636 (Vwindow_combination_limit): Remove "status" from doc-string.
3638 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
3640 * m/ibms390.h: Remove.
3641 * m/ibms390x.h: Don't include "ibms390.h".
3643 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3645 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
3646 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
3648 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
3650 * casetab.c (Fset_case_table):
3651 * charset.c (Fcharset_after): Fix typos.
3653 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
3655 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
3656 Otherwise, valgrind does not work on some platforms.
3657 Problem reported by Andreas Schwab in
3658 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
3659 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
3660 is set, removing the need for VIRT_ADDRESS_VARIES.
3661 (PURE_P): Use a more-efficient implementation that needs just one
3662 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
3663 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
3664 to 4 (xorl, subq, cmpq, setbe).
3665 * alloc.c (pure): Always extern now, since that's the
3666 VIRT_ADDR_VARIES behavior.
3667 (PURE_POINTER_P): Use a single comparison, not two, for
3668 consistency with the new puresize.h.
3669 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
3670 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
3671 Remove VIRT_ADDR_VARIES no longer needed.
3673 2011-11-19 Eli Zaretskii <eliz@gnu.org>
3675 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
3676 (erase_phys_cursor, update_window_cursor, show_mouse_face)
3677 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
3678 behave as if the cursor position were at the window margin.
3680 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
3681 and the cursor position is out of bounds, behave as if the cursor
3682 position were at the window margin. (Bug#10075)
3684 2011-11-18 Chong Yidong <cyd@gnu.org>
3686 * window.c (Fwindow_combination_limit): Make first argument
3687 non-optional, since it is meaningless for live windows like the
3690 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
3692 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
3694 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
3696 * intervals.c: Fix grafting over the whole buffer (bug#10071).
3697 (graft_intervals_into_buffer): Simplify.
3699 2011-11-18 Eli Zaretskii <eliz@gnu.org>
3701 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
3702 hash values of the two rows.
3703 (copy_row_except_pointers): Preserve the used[] arrays and the
3704 hash values of the two rows. (Bug#10035)
3705 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
3707 * xdisp.c (row_hash): New function, body extracted from
3708 compute_line_metrics.
3709 (compute_line_metrics): Call row_hash, instead of computing the
3712 * dispnew.c (verify_row_hash): Call row_hash for computing the
3713 hash code of a row, instead of duplicating code from xdisp.c.
3715 * dispextern.h (row_hash): Add prototype.
3717 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
3719 * frame.c (delete_frame): Don't delete the terminal when the last
3720 X frame is closed if emacs is built with GTK toolkit.
3722 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
3724 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
3726 2011-11-17 Martin Rudalics <rudalics@gmx.at>
3728 * window.c (Vwindow_splits): Rename to
3729 Vwindow_combination_resize. Suggested by Juri Linkov.
3730 (Fsplit_window_internal): Use Vwindow_combination_resize instead
3733 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
3735 * nsfns.m (Fns_font_name):
3736 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
3738 2011-11-16 Martin Rudalics <rudalics@gmx.at>
3740 * window.h (window): Rename slot "nest" to "combination_limit".
3741 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
3742 (Fset_window_nest): Rename to Fset_window_combination_limit.
3743 (Vwindow_nest): Rename to Vwindow_combination_limit.
3744 (recombine_windows, make_parent_window, make_window)
3745 (Fsplit_window_internal, saved_window)
3746 (Fset_window_configuration, save_window_save): Rename all
3747 occurrences of window_nest to window_combination_limit.
3749 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
3751 * image.c (imagemagick_load_image): Fix typo.
3753 2011-11-14 Eli Zaretskii <eliz@gnu.org>
3755 * xdisp.c (display_line): Move the call to
3756 highlight_trailing_whitespace before the call to
3757 compute_line_metrics, since the latter needs to see the final
3758 faces of all the glyphs to compute ROW's hash value.
3759 Fixes assertion violations in row_equal_p. (Bug#10035)
3761 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
3763 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
3764 just return (bug#10044).
3766 2011-11-12 Eli Zaretskii <eliz@gnu.org>
3768 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
3769 with user-defined heap size. Bump the default size of the temacs
3770 heap to 27MB, to avoid memory warning when running temacs.
3771 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
3773 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
3774 current_matrix and desired_matrix. (Bug#9990)
3775 (verify_row_hash) [XASSERTS]: New function.
3776 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
3777 that the hash value of glyph rows is correct.
3779 2011-11-12 Martin Rudalics <rudalics@gmx.at>
3781 * window.h (window): Remove splits slot.
3782 * window.c (Fwindow_splits, Fset_window_splits): Remove.
3783 (Fdelete_other_windows_internal, make_parent_window)
3784 (make_window, Fsplit_window_internal, Fdelete_window_internal)
3785 (Fset_window_configuration, save_window_save): Don't deal with
3786 split status of windows.
3787 (saved_window): Remove splits slot.
3788 (Vwindow_splits): Rewrite doc-string.
3790 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
3792 * xfns.c (unwind_create_frame):
3793 * nsfns.m (unwind_create_frame):
3794 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
3795 Vframe_list (Bug#9999).
3797 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
3799 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
3801 2011-11-11 Kenichi Handa <handa@m17n.org>
3803 * callproc.c (Fcall_process): Set the member dst_multibyte of
3806 2011-11-11 Johan Bockgård <bojohan@gnu.org>
3808 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
3809 avoid a crash (bug#9496).
3811 2011-11-09 Chong Yidong <cyd@gnu.org>
3813 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
3814 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
3816 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
3818 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
3820 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
3822 Avoid some portability problems by eschewing 'extern inline' functions.
3823 The trivial performance wins aren't worth the portability hassles; see
3824 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
3826 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
3827 (window_box_width, window_box_left, window_box_left_offset)
3828 (window_box_right, window_box_right_offset): Undo previous change,
3829 by removing the "extern"s.
3830 * intervals.c (adjust_intervals_for_insertion)
3831 (adjust_intervals_for_deletion): Undo previous change,
3832 making these static again.
3833 (offset_intervals, temp_set_point_both, temp_set_point)
3834 (copy_intervals_to_string): No longer inline.
3835 * xdisp.c (window_text_bottom_y, window_box_width)
3836 (window_box_height, window_box_left_offset)
3837 (window_box_right_offset, window_box_left, window_box_right)
3838 (window_box): No longer inline.
3840 2011-11-08 Chong Yidong <cyd@gnu.org>
3842 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
3843 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
3844 Signal an error if not a live window.
3845 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
3846 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
3848 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
3850 * lisp.h (syms_of_abbrev): Remove declaration.
3851 Reported by CHENG Gao <chenggao@royau.me>.
3853 2011-11-07 Eli Zaretskii <eliz@gnu.org>
3855 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
3856 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
3857 of temacs in GUI mode.
3859 2011-11-07 Martin Rudalics <rudalics@gmx.at>
3861 * window.h: Declare delete_all_child_windows instead of
3862 delete_all_subwindows.
3863 * window.c (Fwindow_nest, Fset_window_nest)
3864 (Fset_window_new_total, Fset_window_new_normal)
3865 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
3866 (delete_all_subwindows): Rename to delete_all_child_windows.
3867 (Fdelete_other_windows_internal, Fset_window_configuration):
3868 Call delete_all_child_windows instead of delete_all_subwindows.
3869 * frame.c (delete_frame): Call delete_all_child_windows instead
3870 of delete_all_subwindows.
3872 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
3874 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
3875 This is also needed for porting to any host where GC_MARK_STACK is
3876 not GC_MAKE_GCPROS_NOOPS.
3877 (which_symbols): Use it.
3879 2011-11-07 Kenichi Handa <handa@m17n.org>
3881 * coding.c (coding_set_destination): Check coding->src_pos only
3882 when coding->src_object is a buffer (bug#9910).
3884 * process.c (send_process): Set the member src_multibyte of coding
3885 to 0 (bug#9911) when sending a unibyte text.
3887 * callproc.c (Fcall_process): Set the member src_multibyte of
3888 process_coding to 0 (bug#9912).
3890 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3892 * xmenu.c (cleanup_widget_value_tree): New function.
3893 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
3894 calling free_menubar_widget_value_tree directly (Bug#9830).
3896 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
3898 Fix some portability problems with 'inline'.
3899 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
3900 (window_box_width, window_box_left, window_box_left_offset)
3901 (window_box_right, window_box_right_offset): Declare extern.
3902 Otherwise, these inline functions do not conform to C99 and
3903 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
3904 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
3905 * intervals.c (adjust_intervals_for_insertion)
3906 (adjust_intervals_for_deletion): Now extern, because otherwise the
3907 extern inline functions 'offset_intervals' couldn't refer to it.
3908 (static_offset_intervals): Remove.
3909 (offset_intervals): Rewrite using the old contents of
3910 static_offset_intervals. The old version didn't conform to C99
3911 because an extern inline function contained a reference to an
3912 identifier with static linkage.
3914 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
3916 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
3919 2011-11-06 Eli Zaretskii <eliz@gnu.org>
3921 * xdisp.c (init_iterator, reseat_to_string): Don't set the
3922 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
3923 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
3924 return Qleft_to_right.
3926 2011-11-06 Chong Yidong <cyd@gnu.org>
3928 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
3929 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
3930 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
3931 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
3932 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
3933 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
3934 (Fwindow_vscroll): Doc fix.
3935 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
3936 argument, since it makes no sense to pass a live window and for
3937 consistency with window-child.
3939 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
3941 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
3944 2011-11-05 Jason Rumney <jasonr@gnu.org>
3946 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
3947 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
3949 (add_font_entity_to_list): Fix logic errors in mixed boolean and
3950 bitwise arithmetic preventing use of unicode-sip and non-truetype
3953 2011-11-05 Eli Zaretskii <eliz@gnu.org>
3955 * s/ms-w32.h (fstat, stat, utime): Move redirections to
3958 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
3959 initialization code to keep similarity to xfns.c after changes
3962 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
3964 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
3965 (unwind_create_frame): New function (Bug#9943).
3966 (Fx_create_frame): Restructure code to be more similar to the one in
3967 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
3968 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
3969 Move terminal->reference_count++ just before making the frame official
3972 * nsterm.m (x_free_frame_resources): New function.
3973 (x_destroy_window): Move code to x_free_frame_resources.
3975 * xfns.c (unwind_create_frame): Fix comment.
3976 (Fx_create_frame, x_create_tip_frame):
3977 Move terminal->reference_count++ just before making the frame
3978 official. Move initialization of image_cache_refcount and
3979 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
3981 2011-11-05 Eli Zaretskii <eliz@gnu.org>
3983 Support MSVC build with newer versions of Visual Studio.
3984 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
3985 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
3988 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
3989 which are not supported by MSVC.
3990 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
3991 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
3993 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
3995 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
3997 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
3999 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
4001 Support MSVC build with newer versions of Visual Studio.
4002 * w32.c: Don't include w32api.h for MSVC.
4003 (init_environment) [_MSC_VER]: Call sys_access, not _access.
4005 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
4006 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
4007 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
4008 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
4010 (alloca) [_MSC_VER]: Define to _alloca.
4012 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
4014 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
4016 2011-11-04 Eli Zaretskii <eliz@gnu.org>
4018 * xdisp.c (note_mouse_highlight): If either of
4019 previous/next-single-property-change returns nil, treat that as
4020 the beginning or the end of the buffer. (Bug#9955)
4022 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
4024 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
4025 label is not null (Bug#9951).
4026 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
4029 2011-11-04 Eli Zaretskii <eliz@gnu.org>
4031 * window.c (Fwindow_body_size): Mention in the doc string that the
4032 return value is in frame's canonical units. (Bug#9949)
4034 2011-11-03 Eli Zaretskii <eliz@gnu.org>
4036 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
4038 * w32fns.c (unwind_create_frame): If needed, free the glyph
4039 matrices of the partially constructed frame. (Bug#9943)
4040 * xfns.c (unwind_create_frame): Likewise.
4042 2011-11-01 Eli Zaretskii <eliz@gnu.org>
4044 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
4045 Don't stop backward scan on the continuation glyph, even though
4046 its CHARPOS is positive.
4047 (mouse_face_from_buffer_pos, note_mouse_highlight):
4048 Rename cover_string to disp_string.
4050 2011-11-01 Martin Rudalics <rudalics@gmx.at>
4052 * window.c (temp_output_buffer_show): Don't use
4053 Vtemp_buffer_show_specifiers.
4054 (Vtemp_buffer_show_specifiers): Remove unused variable.
4056 2011-10-30 Eli Zaretskii <eliz@gnu.org>
4058 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
4059 past the beginning of the current glyph matrix.
4061 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
4063 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
4064 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
4065 HAVE_GTK3 (Bug#9869).
4067 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
4068 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
4070 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
4072 * xterm.c: Declare x_handle_net_wm_state to return int.
4073 (handle_one_xevent): Check if we are iconified but don't have
4074 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
4075 (get_current_wm_state): Return non-zero if not hidden,
4076 check for _NET_WM_STATE_HIDDEN (Bug#9893).
4077 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
4078 (x_handle_net_wm_state): Return what get_current_wm_state returns.
4079 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
4081 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
4083 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
4084 so that this new function doesn't get optimized away by a
4085 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
4087 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4089 * frame.h (MOUSE_HL_INFO): Remove excess parens.
4091 2011-10-29 Eli Zaretskii <eliz@gnu.org>
4093 Fix the `xbytecode' command.
4094 * .gdbinit (xprintbytestr): New command.
4095 (xwhichsymbols): Rename from `which'; all callers changed.
4096 (xbytecode): Print the byte-code string as well.
4098 2011-10-29 Kim Storm <storm@cua.dk>
4100 * alloc.c (which_symbols): New function.
4102 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
4104 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
4107 2011-10-29 Glenn Morris <rgm@gnu.org>
4109 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
4110 Not clear what it was for, and it causes various bugs. (Bug#9839)
4112 2011-10-28 Eli Zaretskii <eliz@gnu.org>
4114 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
4115 possible random value that matches one of those tested as
4116 condition to clear the mouse face.
4118 2011-10-28 Chong Yidong <cyd@gnu.org>
4120 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
4122 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
4124 * window.c (make_window): Initialize phys_cursor_on_p.
4126 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
4128 * lisp.h (struct Lisp_Symbol): Update comments.
4130 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
4132 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
4134 2011-10-28 Eli Zaretskii <eliz@gnu.org>
4136 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
4137 <oslsachem@gmail.com> for helping to debug this.
4139 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
4140 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
4141 (g_b_init_get_glyph_outline_w): New static variables.
4142 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
4143 (GetGlyphOutlineW_Proc): New typedefs.
4144 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
4145 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
4147 (w32font_open_internal, compute_metrics):
4148 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
4149 instead of calling the "wide" APIs directly.
4151 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
4153 * w32.h (syms_of_w32font): Add prototype.
4155 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
4157 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
4158 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
4159 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
4160 (Fmove_to_window_line): Doc fix.
4162 2011-10-27 Chong Yidong <cyd@gnu.org>
4164 * process.c (make_process): Set gnutls_state to NULL.
4166 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
4167 non-NULL, regardless of GNUTLS_INITSTAGE.
4168 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
4169 an error. Set process slots as soon as we allocate them.
4171 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
4173 2011-10-27 Chong Yidong <cyd@gnu.org>
4175 * gnutls.c (emacs_gnutls_deinit): New function.
4176 Deallocate credentials structures as well as calling gnutls_deinit.
4177 (Fgnutls_deinit, Fgnutls_boot): Use it.
4179 * process.c (make_process): Initialize GnuTLS credentials to NULL.
4180 (deactivate_process): Call emacs_gnutls_deinit.
4182 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
4184 * image.c (x_create_x_image_and_pixmap):
4185 * w32.c (sys_rename, w32_delayed_load):
4186 * w32font.c (fill_in_logfont):
4187 * w32reg.c (x_get_string_resource): Silence compiler warnings.
4189 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
4191 * w32fns.c (w32_default_color_map): New function,
4192 extracted from Fw32_default_color_map.
4193 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
4195 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
4197 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
4199 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
4201 * keyboard.c (test_undefined): New function (bug#9751).
4202 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
4204 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
4206 * sysdep.c (init_sys_modes): Fix the check for the controlling
4207 terminal (Bug#6649).
4209 2011-10-20 Eli Zaretskii <eliz@gnu.org>
4211 * dispextern.h (struct bidi_it): New member next_en_type.
4213 * bidi.c (bidi_line_init): Initialize the next_en_type member.
4214 (bidi_resolve_explicit_1): When next_en_pos is valid for the
4215 current character, check also for next_en_type being WEAK_EN.
4216 (bidi_resolve_weak): Don't enter the expensive loop if the current
4217 position is before next_en_pos. Record the bidi type of the first
4218 non-ET, non-BN character we find, in addition to its position.
4219 (bidi_level_of_next_char): Invalidate next_en_type when
4220 next_en_pos is over-stepped.
4222 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
4224 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
4225 * editfns.c: Rewrite current-time-zone so that it invokes
4226 the equivalent of (format-time-string "%Z") to get the time zone name.
4227 This fixes a bug when the time zone name contains characters that
4228 need converting from the system time locale to Emacs internal format.
4229 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
4230 that patch fixed format-time-string to do the conversion, but
4231 I forgot to fix current-time-zone.
4232 (format_time_string): New function, containing most of
4233 what Fformat_time_string used to contain.
4234 (Fformat_time_string): Rewrite in terms of format_time_string.
4235 This doesn't change this function's behavior.
4236 (current-time-zone): Rewrite to use format_time_string.
4237 This fixes the bug reported by Michael Schierl in
4238 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
4239 Jason Rumney's 2007-06-07 change worked around this bug, but
4241 * systime.h (tzname, timezone): Remove no-longer-used declarations.
4243 2011-10-19 Eli Zaretskii <eliz@gnu.org>
4245 * xdisp.c (start_display): If the character at POS is displayed
4246 via a display vector, reset IT->current.dpvec_index to zero.
4247 (try_window_reusing_current_matrix): If a line ends in a display
4248 vector or the next line starts in a display vector, continue
4249 redrawing the window even though the character position of
4250 start_row was reached.
4253 2011-10-18 Chong Yidong <cyd@gnu.org>
4255 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
4256 with nobreak-char-display too.
4258 2011-10-18 Eli Zaretskii <eliz@gnu.org>
4260 Fix part 3 of bug#9771.
4261 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
4262 (bidi_resolve_neutral): Don't enter the expensive loop looking for
4263 non-neutral characters if the current character is a paragraph
4264 separator (a.k.a. Newline). This avoids running the same
4265 expensive loop twice, once when we consume the preceding newline
4266 and the other time when the line actually needs to be displayed.
4267 Avoid the loop when we see neutrals on the base embedding level
4268 following a character whose directionality is the same as the
4269 paragraph's. This avoids running the expensive loop when a line
4270 ends in a long sequence of neutrals, like control characters.
4271 Add assertion against STRONG_AL type. Slightly rearrange code
4272 that determines the type of a neutral given the first non-neutral
4274 (bidi_level_of_next_char): Set next_en_pos to zero when
4275 invalidating its info.
4277 2011-10-17 Eli Zaretskii <eliz@gnu.org>
4279 * xdisp.c (push_display_prop): Determine whether to record string
4280 or buffer position by IT->string, not by IT->method. Allow
4281 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
4282 (move_it_vertically_backward): Don't look for character position
4283 immediately after the newline when in a continuation line.
4286 2011-10-15 Martin Rudalics <rudalics@gmx.at>
4288 * window.c (coordinates_in_window): Rewrite and delabelize
4289 vertical border check. (Bug#5357) (Bug#9618)
4291 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
4293 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
4294 errors in XSetWindowBorder (bug#9310).
4296 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
4298 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
4299 avoid crash when xmalloc overrun checking is enabled.
4301 2011-10-13 Eli Zaretskii <eliz@gnu.org>
4303 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
4304 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
4305 cursor motion with <left> and <right> arrow keys.
4307 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
4308 some callers set that themselves.
4310 2011-10-12 Eli Zaretskii <eliz@gnu.org>
4312 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
4313 display string and the previous row comes from the same string and
4314 is empty. (Bug#9739) (Bug#9738)
4316 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4318 * doc.c (get_doc_string): Encode file name (bug#9735).
4320 2011-10-12 Eli Zaretskii <eliz@gnu.org>
4322 * bidi.c (bidi_level_of_next_char):
4323 * xdisp.c (get_visually_first_element): Remove old incorrect
4324 comments regarding the Unicode Line Separator character.
4326 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
4328 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
4330 * alloc.c (Fgc_status): Do not access beyond zombies array
4331 boundary if nzombies > MAX_ZOMBIES.
4332 * alloc.c (dump_zombies): Add missing format specifier.
4334 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
4336 * xdisp.c (set_cursor_from_row): Simplify conditionals,
4337 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
4339 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
4340 Some packages use them to denote characters with modifiers.
4342 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
4344 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
4345 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
4346 matching a pp-number. Rename parameter var to var1.
4348 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4350 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
4352 2011-10-08 Glenn Morris <rgm@gnu.org>
4354 * callint.c (Fcall_interactively): Give a more explicit error for the
4355 'c' case with a non-character input. (Bug#8479)
4357 2011-10-08 Eli Zaretskii <eliz@gnu.org>
4359 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
4361 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
4362 lines that are hscrolled on the left.
4364 * dispnew.c (buffer_posn_from_coords): Account for a possible
4365 presence of header-line. (Bug#4426)
4367 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
4369 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
4370 Don't advertise functionality which we discourage or doesn't work.
4372 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
4374 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
4375 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
4376 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
4377 this makes Emacs dump core during garbage collection on rare
4378 occasions. sizeof is obviously inferior to offsetof here, so
4379 stick with offsetof.
4380 (GC_POINTER_ALIGNMENT): New macro.
4381 (mark_memory): Omit 3rd (offset) arg; caller changed.
4382 Don't assume EMACS_INT alignment is the same as pointer alignment.
4384 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
4386 * keyboard.c (read_key_sequence_remapped): New var.
4387 (read_key_sequence): Compute remapping in the right buffer.
4388 (command_loop_1): Use read_key_sequence's remapping directly.
4390 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4392 * dired.c (file_name_completion): Don't expand file name.
4393 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
4394 before checking file name handler.
4396 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
4397 they've been requested explicitly (bug#9591).
4399 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
4401 * keymap.c (Fsingle_key_description): Use make_specified_string
4402 instead of build_string to build string from push_key_description.
4405 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
4407 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
4408 This fixes a Y2038 bug on 64-bit hosts.
4409 * buffer.c (reset_buffer):
4410 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
4411 (Fclear_buffer_auto_save_failure):
4412 Use 0, not -1, to represent an unset failure time, since time_t
4413 might not be signed.
4415 Remove dependency on glibc malloc internals.
4416 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4417 Move back here from lisp.h, but with their new implementations.
4418 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4419 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
4420 * charset.c (charset_table_init): New static var.
4421 (syms_of_charset): Use it instead of xmalloc. This removes a
4422 dependency on glibc malloc internals. See Eli Zaretskii's comment in
4423 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
4424 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4425 Move back to alloc.c.
4426 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4427 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
4429 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
4431 * nsterm.m (windowDidResize): Call x_set_window_size only when
4432 ns_in_resize is true. Otherwise set pixelwidth/height and
4433 call change_frame_size (Bug#9628).
4435 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
4437 Port --enable-checking=all to Fedora 14 x86-64.
4438 * charset.c (syms_of_charset): Also account for glibc malloc's
4439 internal overhead when calculating the initial malloc maximum.
4441 Port --enable-checking=all to Fedora 14 x86.
4442 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4444 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
4445 (overrun_check_realloc, overrun_check_free):
4446 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
4447 That way, xmalloc returns a properly-aligned pointer even if
4448 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
4449 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
4450 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
4451 into account when calculating the initial malloc maximum.
4452 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
4453 Move here from alloc.c, so that charset.c can use it too.
4454 Properly align; the old code wasn't right for common 32-bit hosts
4455 when configured with --enable-checking=all.
4456 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
4457 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
4459 2011-09-29 Eli Zaretskii <eliz@gnu.org>
4461 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
4464 2011-09-28 Eli Zaretskii <eliz@gnu.org>
4466 * xdisp.c (compute_display_string_end): If there's no display
4467 string at CHARPOS, return -1.
4469 * bidi.c (bidi_fetch_char): When compute_display_string_end
4470 returns a negative value, treat the character as a normal
4471 character not covered by a display string. (Bug#9624)
4473 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
4475 * lread.c (Fread_from_string): Fix typo in docstring.
4477 2011-09-27 Eli Zaretskii <eliz@gnu.org>
4479 * xdisp.c (handle_invisible_prop): If invisible text ends on a
4480 newline, reseat the iterator instead of bidi-iterating there one
4481 character at a time. (Bug#9610)
4482 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
4483 TO_CHARPOS if the bidi iterator is at base embedding level.
4485 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
4487 * lread.c (readevalloop): Use correct code for NBSP.
4488 (read1): Likewise. (Bug#9608)
4490 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
4492 * dbusbind.c (Fdbus_register_signal): When service is not
4493 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
4495 2011-09-25 Glenn Morris <rgm@gnu.org>
4497 * buffer.c (truncate-lines): Doc fix.
4499 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
4501 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
4502 (Fset_window_next_buffers): Doc fix.
4504 2011-09-24 Glenn Morris <rgm@gnu.org>
4506 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
4508 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
4510 Fix minor problems found by static checking.
4511 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
4512 * indent.c (Fvertical_motion): Fix == vs = typo.
4514 2011-09-24 Eli Zaretskii <eliz@gnu.org>
4516 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
4517 Default value is now t. Doc fix.
4519 * indent.c (Fvertical_motion): Compute and apply the overshoot
4520 logic when moving up, not only when moving down. Fix the
4521 confusing name and values of the it_overshoot_expected variable;
4522 logic changes accordingly. (Bug#9254) (Bug#9549)
4524 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
4525 CHARPOS is covered by a display string which includes newlines.
4526 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
4527 is covered by a display string with embedded newlines.
4529 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
4531 * dbusbind.c (Fdbus_register_signal): Add match rule to
4532 Vdbus_registered_objects_table. (Bug#9581)
4533 (Fdbus_register_method, Vdbus_registered_objects_table):
4536 2011-09-24 Jim Meyering <meyering@redhat.com>
4538 do not ignore write error for any output size
4539 The previous change was incomplete.
4540 While it makes emacs --batch detect the vast majority of stdout
4541 write failures, errors were still ignored whenever the output size is
4542 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
4543 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
4544 && echo FAIL: ignored write error
4545 FAIL: ignored write error
4546 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
4547 && echo FAIL: ignored write error
4548 FAIL: ignored write error
4549 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
4551 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
4553 * emacs.c (Fkill_emacs): In noninteractive mode exit
4554 non-successfully if a write error occurred on stdout. (Bug#9574)
4556 2011-09-21 Eli Zaretskii <eliz@gnu.org>
4558 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
4561 * dispextern.h (struct it): Update the comment documenting what
4564 2011-09-20 Eli Zaretskii <eliz@gnu.org>
4566 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
4567 a display string, extend search for cursor position to end of row.
4568 (find_row_edges): If the row ends in a newline from a display
4569 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
4570 Handle the case of a display string with multiple newlines.
4571 (Fcurrent_bidi_paragraph_direction): Fix search for previous
4572 non-empty line. Fixes confusing cursor motion with arrow keys at
4573 the beginning of a line that starts with whitespace.
4575 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
4577 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
4580 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
4582 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
4585 2011-09-18 Eli Zaretskii <eliz@gnu.org>
4587 * xdisp.c (display_line): Record maximum and minimum buffer
4588 positions even if no glyphs were produced (e.g., by a zero-width
4589 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
4590 buffer positions that will be removed from the glyph row because
4592 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
4593 column is beyond frame width: don't subtract 1 "pixel" when
4594 computing width of the stretch.
4595 (reseat_at_next_visible_line_start): Undo the change made on
4596 2011-09-17 that saved paragraph information and restored it after
4597 the call to `reseat'. (Bug#9545)
4599 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4601 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
4602 and turn window cursor on if cleared (Bug#9415).
4604 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
4606 * search.c (boyer_moore): Take unibyte characters from pattern
4607 literally. (Bug#9458)
4609 2011-09-18 Eli Zaretskii <eliz@gnu.org>
4611 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
4613 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
4615 Fix minor problem found by static checking.
4616 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
4617 initialized, to pacify gcc -Wuninitialized.
4619 * fileio.c: Report proper errno when syscall falls.
4620 (Finsert_file_contents): Save and restore errno,
4621 so that report_file_error outputs the correct diagnostic.
4622 (Fwrite_region) [CLASH_DETECTION]: Likewise.
4624 2011-09-18 Eli Zaretskii <eliz@gnu.org>
4626 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
4628 2011-09-17 Eli Zaretskii <eliz@gnu.org>
4630 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
4631 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
4633 2011-09-17 Eli Zaretskii <eliz@gnu.org>
4635 * xdisp.c (reseat_at_next_visible_line_start): Keep information
4636 about the current paragraph and restore it after the call to reseat.
4638 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
4639 (bidi_find_paragraph_start): Search back for paragraph beginning
4640 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
4641 (bidi_move_to_visually_next): Only trigger paragraph-related
4642 computations when the last character is a newline or at EOB, not
4643 just any NEUTRAL_B. (Bug#9470)
4645 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
4646 truncated lines if point is covered by a display string. (Bug#9524)
4648 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
4650 * xselect.c: Relax test for outgoing X longs (Bug#9498).
4651 (cons_to_x_long): New function.
4652 (lisp_data_to_selection_data): Use it. Correct the test for
4653 short-versus-long data; it was negated. Break out of vector
4654 loop, for efficiency, when a long datum is discovered.
4656 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
4658 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
4660 2011-09-16 Eli Zaretskii <eliz@gnu.org>
4662 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
4663 GCC PR/17406) by declaring this function with external scope.
4665 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
4667 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
4668 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
4670 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
4672 * editfns.c (Fformat): Correctly handle text properties on "%%".
4674 2011-09-15 Eli Zaretskii <eliz@gnu.org>
4676 * xterm.c (x_draw_composite_glyph_string_foreground):
4677 * w32term.c (x_draw_composite_glyph_string_foreground):
4678 * term.c (encode_terminal_code):
4679 * composite.c (composition_update_it, get_composition_id):
4680 * xdisp.c (get_next_display_element)
4681 (fill_composite_glyph_string): Add comments about special meaning
4682 of TAB characters in a composition.
4684 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
4686 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4687 This occurs when processing a multibyte format.
4688 Problem reported by Wolfgang Jenker.
4690 2011-09-15 Johan Bockgård <bojohan@gnu.org>
4692 * xdisp.c (try_cursor_movement): Only check for exact match if
4693 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
4695 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
4697 Remove unused external symbols.
4698 * dispextern.h (calc_pixel_width_or_height): Remove decl.
4699 * xdisp.c (calc_pixel_width_or_height): Now static.
4700 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
4701 * indent.c (check_display_width):
4702 * w32term.c: Fix comment to match code.
4703 * xterm.c, xterm.h (x_catching_errors): Remove.
4705 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
4707 * xselect.c: Use signed conversions more consistently (Bug#9498).
4708 (selection_data_to_lisp_data): Assume incoming selection data are
4709 signed integers, not unsigned. This is to be consistent with
4710 outgoing selection data, which was modified to use signed integers
4711 in as part of the fix to Bug#9196 in response to Jan D.'s comment
4712 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
4713 expects long, not unsigned long.
4715 2011-09-14 Eli Zaretskii <eliz@gnu.org>
4717 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
4718 computation of loop end. Reported by Johan Bockgård
4721 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
4723 * frame.c (Fother_visible_frames_p): Function deleted.
4725 2011-09-12 Eli Zaretskii <eliz@gnu.org>
4727 * indent.c (compute_motion): Process display vector front to back
4728 rather than the other way around. (Bug#2496)
4730 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
4732 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
4734 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
4736 * minibuf.c (Fread_from_minibuffer): Doc fix.
4738 2011-09-11 Eli Zaretskii <eliz@gnu.org>
4740 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
4741 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
4743 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
4745 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
4746 value for non-existent files.
4748 2011-09-11 Eli Zaretskii <eliz@gnu.org>
4750 * fileio.c (Finsert_file_contents): If the file cannot be opened,
4751 set its "size" to -1. This will set the modtime_size field of
4752 the corresponding buffer to -1, which is what
4753 verify-visited-file-modtime expects for files that do not exist.
4756 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
4758 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
4760 * lisp.h: ... from here. push_key_description is no longer
4761 defined in keyboard.c, so its declaration should not be in
4762 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
4763 logically belongs with push_key_description.
4765 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
4767 * buffer.h: Include <sys/types.h> instead of <time.h>.
4768 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
4769 Problem reported by Herbert J. Skuhra.
4771 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
4773 * xml.c (parse_region): Make the parsing work for
4774 non-comment-starting XML files again (bug#9144).
4776 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
4778 * image.c (gif_load): Fix calculation of bottom and right corner.
4781 2011-09-10 Eli Zaretskii <eliz@gnu.org>
4783 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
4784 redisplay in small windows.
4786 2011-09-09 Eli Zaretskii <eliz@gnu.org>
4788 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
4790 2011-09-08 Martin Rudalics <rudalics@gmx.at>
4792 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
4793 Operate on live windows only.
4795 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
4797 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
4799 2011-09-07 Eli Zaretskii <eliz@gnu.org>
4801 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
4802 only under bidi iteration.
4804 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
4806 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
4808 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
4810 isnan: Fix porting problem to Solaris 10 with bundled gcc.
4811 Without this fix, the command to link temacs failed due to an
4812 undefined symbol __builtin_isnan. This is because
4813 /usr/include/iso/math_c99.h #defines isnan(x) to
4814 __builtin_isnan(x), but the bundled gcc, which identifies itself
4815 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
4817 * floatfns.c (isnan): #undef, and then #define to a clone of
4819 (Fisnan): Always define, since it's always available now.
4820 (syms_of_floatfns): Always define isnan at the Lisp level.
4822 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
4824 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
4826 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
4828 * fileio.c: Fix bugs with large file offsets (Bug#9428).
4829 The previous code assumed that file offsets (off_t values) fit in
4830 EMACS_INT variables, which is not true on typical 32-bit hosts.
4831 The code messed up by falsely reporting buffer overflow in cases
4832 such as (insert-file-contents "big" nil 1 2) into an empty buffer
4833 when "big" contains more than 2**29 bytes, even though this
4834 inserts just one byte and does not overflow the buffer.
4835 (Finsert_file_contents): Store file offsets as off_t
4836 values, not as EMACS_INT values. Check for overflow when
4837 converting between EMACS_INT and off_t. When checking for
4838 buffer overflow or for overlap, take the offsets into account.
4839 Don't use EMACS_INT for small values where int suffices.
4840 When checking for overlap, fix a typo: ZV was used where
4841 ZV_BYTE was intended.
4842 (Fwrite_region): Don't assume off_t fits into 'long'.
4843 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
4845 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
4847 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
4849 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
4851 sprintf-related integer and memory overflow issues (Bug#9412).
4853 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
4854 (esprintf, exprintf, evxprintf): New functions.
4855 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
4856 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
4857 (modify_event_symbol): Do not assume that the length of
4858 name_alist_or_stem is safe to alloca and fits in int.
4859 (Fexecute_extended_command): Likewise for function name and binding.
4860 (Frecursion_depth): Wrap around reliably on integer overflow.
4861 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
4862 since some callers pass EMACS_INT values.
4863 (Fsingle_key_description): Don't crash if symbol name contains more
4864 than MAX_ALLOCA bytes.
4865 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
4866 (get_minibuffer): Arg is now EMACS_INT, not int.
4867 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
4868 (esprintf, exprintf, evxprintf): New decls.
4869 * window.h (command_loop_level, minibuf_level): Reflect API changes.
4871 * dbusbind.c (signature_cat): New function.
4872 (xd_signature, Fdbus_register_signal):
4873 Do not overrun buffer; instead, report string overflow.
4875 * dispnew.c (add_window_display_history): Don't overrun buffer.
4876 Truncate instead; this is OK since it's just a log.
4878 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
4879 even if the time zone offset is outlandishly large.
4880 Don't mishandle offset == INT_MIN.
4882 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
4883 when creating daemon; the previous buffer-overflow check was incorrect.
4885 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
4886 which has the guts of the old verror function.
4888 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
4889 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
4891 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
4892 (font_unparse_xlfd): Don't blindly alloca long strings.
4893 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
4894 fits in int, when using sprintf. Use single snprintf to count
4895 length of string rather than counting it via multiple sprintfs;
4896 that's simpler and more reliable.
4897 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
4898 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
4899 sprintf, in case result does not fit in int.
4901 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
4902 (fontset_from_font): Print it.
4904 * frame.c (tty_frame_count): Now printmax_t, not int.
4905 (make_terminal_frame, set_term_frame_name): Print it.
4906 (x_report_frame_params): In X, window IDs are unsigned long,
4907 not signed long, so print them as unsigned.
4908 (validate_x_resource_name): Check for implausibly long names,
4909 and don't assume name length fits in 'int'.
4910 (x_get_resource_string): Don't blindly alloca invocation name;
4911 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
4914 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
4915 (xg_check_special_colors, xg_set_geometry):
4916 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
4918 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
4919 Use esprintf, not sprintf, in case result does not fit in int.
4921 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
4922 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
4923 it as a large positive number.
4924 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
4925 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
4927 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
4928 in case result does not fit in int.
4930 * print.c (float_to_string): Detect width overflow more reliably.
4931 (print_object): Make sprintf buffer a bit bigger, to avoid potential
4932 buffer overrun. Don't assume list length fits in 'int'. Treat
4933 print length of 0 as 0, not as infinity; to be consistent with other
4934 uses of print length in this function. Don't overflow print length
4935 index. Don't assume hash table size fits in 'long', or that
4936 vectorlike size fits in 'unsigned long'.
4938 * process.c (make_process): Use printmax_t, not int, to format
4939 process-name gensyms.
4941 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
4943 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
4944 to avoid potential buffer overrun.
4946 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
4947 if X resource line is longer than 512 bytes.
4949 * xfns.c (x_window): Make sprintf buffer a bit bigger
4950 to avoid potential buffer overrun.
4952 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
4954 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
4956 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
4958 Integer overflow fixes for scrolling, etc.
4959 Without these, Emacs silently mishandles large integers sometimes.
4960 For example, "C-u 4294967297 M-x recenter" was treated as if
4961 it were "C-u 1 M-x recenter" on a typical 64-bit host.
4963 * xdisp.c (try_window_id): Check Emacs fixnum range before
4964 converting to 'int'.
4966 * window.c (window_scroll_line_based, Frecenter):
4967 Check that an Emacs fixnum is in range before assigning it to 'int'.
4968 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
4969 values converted from Emacs fixnums.
4970 (Frecenter): Don't wrap around a line count if it is out of 'int'
4971 range; instead, treat it as an extreme value.
4972 (Fset_window_configuration, compare_window_configurations):
4973 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
4975 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
4976 that can exceed INT_MAX. Check that EMACS_INT value is in range
4977 before assigning it to the (possibly-narrower) index.
4978 (match_limit): Don't assume that a fixnum can fit in 'int'.
4980 * print.c (print_object): Use ptrdiff_t, not int, for index that can
4983 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
4984 (Fvertical_motion): Don't wrap around LINES values that don't fit
4985 in 'int'. Instead, treat them as extreme values. This is good
4986 enough for windows, which can't have more than INT_MAX lines anyway.
4988 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
4990 * Require libxml/parser.h to avoid compilation warning.
4992 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
4994 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
4995 since this reportedly can destroy thread storage.
4997 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
4999 * syntax.c (find_defun_start): Update all cache variables if
5000 exiting early (Bug#9401).
5002 2011-08-30 Eli Zaretskii <eliz@gnu.org>
5004 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
5006 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
5007 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
5008 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
5010 * term.c (tty_append_glyph): New function.
5011 (produce_stretch_glyph): Static function and its prototype deleted.
5013 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
5016 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
5018 * image.c (parse_image_spec): Check for nonnegative, not for positive,
5019 when checking :margin (Bug#9390).
5020 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
5021 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
5022 so that the name doesn't mislead. All uses changed.
5024 2011-08-28 Johan Bockgård <bojohan@gnu.org>
5026 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
5029 2011-08-27 Eli Zaretskii <eliz@gnu.org>
5031 * xdisp.c (move_it_to): Don't bail out early when reaching
5032 position beyond to_charpos, if we are scanning backwards.
5033 (move_it_vertically_backward): When DY == 0, make sure we get to
5034 the first character in the line after the newline.
5036 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
5038 * ccl.c: Improve and simplify overflow checking (Bug#9196).
5039 (ccl_driver): Do not generate an out-of-range pointer.
5040 (Fccl_execute_on_string): Remove unnecessary check for
5041 integer overflow, noted by Stefan Monnier in
5042 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
5043 Remove a FIXME that didn't need fixing.
5044 Simplify the newly-introduced buffer reallocation code.
5046 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
5048 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
5050 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
5052 Integer and memory overflow issues (Bug#9196).
5054 * doc.c (get_doc_string): Rework so that
5055 get_doc_string_buffer_size is the actual buffer size, rather than
5056 being 1 less than the actual buffer size; this makes xpalloc more
5059 * image.c (x_allocate_bitmap_record, cache_image):
5060 * xselect.c (Fx_register_dnd_atom):
5061 Simplify previous changes by using xpalloc.
5063 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
5064 since either will do and ptrdiff_t is convenient with xpalloc.
5066 * charset.c (charset_table_size)
5067 (struct charset_sort_data.priority): Now ptrdiff_t.
5068 (charset_compare): Don't overflow if priorities differ greatly.
5069 (Fsort_charsets): Don't assume list length fits in int.
5070 Check for size-calculation overflow when allocating sort data.
5071 (syms_of_charset): Allocate an initial charset table that is
5072 just under 64 KiB, to avoid problems with glibc malloc and mmap.
5074 * cmds.c (internal_self_insert): Check for size-calculation overflow.
5076 * composite.h (struct composition.glyph_len): Now int, not unsigned.
5077 The actual value is always <= INT_MAX, and leaving it unsigned made
5078 overflow checking harder.
5080 * dispextern.h (struct glyph_matrix.rows_allocated)
5081 (struct face_cache.size): Now ptrdiff_t, for convenience in use
5082 with xpalloc. The values are still always <= INT_MAX.
5084 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
5086 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
5087 (SAFE_NALLOCA): New macro.
5089 * region-cache.c (struct boundary.pos, find_cache_boundary)
5090 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
5091 (set_cache_region, invalidate_region_cache)
5092 (revalidate_region_cache, know_region_cache, region_cache_forward)
5093 (region_cache_backward, pp_cache):
5094 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
5095 so that ptrdiff_t * can be passed to xpalloc.
5096 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
5097 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
5098 (pp_cache): Don't assume cache_len fits in int.
5099 * region-cache.h: Adjust extern decls to match.
5101 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
5102 EMACS_INT, since either will do, for xpalloc.
5104 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
5105 (xnmalloc, xnrealloc, xpalloc): New functions.
5107 * bidi.c (bidi_shelve_header_size): New constant.
5108 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
5109 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
5111 * bidi.c (bidi_cache_shrink):
5112 * buffer.c (overlays_at, overlays_in, record_overlay_string)
5114 Don't update size of array until after memory allocation succeeds,
5115 because xmalloc/xrealloc may not return.
5116 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
5117 now that we have proper integer overflow checking.
5118 (record_overlay_string, overlay_strings): Catch overflows when
5119 calculating size of overlay_str_buf.
5121 * callproc.c (Fcall_process): Check for size overflow when
5122 calculating size of args2.
5123 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
5124 Normally we prefer signed values, but sticking with ptrdiff_t would
5125 require adding more-complicated checks.
5127 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
5128 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
5129 Redo buffer-overflow calculations to avoid integer overflow.
5130 Add a FIXME comment where memory seems to be over-allocated.
5132 * character.c (Fstring): Check for size-calculation overflow.
5134 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
5135 unnecessary integer overflow. Check for size overflow.
5136 (encode_coding_object): Don't update size until xmalloc succeeds.
5138 * composite.c (get_composition_id): Check for overflow in glyph
5139 length calculations.
5141 Integer and memory overflow fixes for display code.
5142 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
5143 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
5144 (scrolling_window): Check for overflow in size calculations.
5145 (line_draw_cost, realloc_glyph_pool, add_row_entry):
5146 Don't assume glyph table len fits in int.
5147 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
5148 (row_table_size): Now ptrdiff_t, not int.
5149 (scrolling_window): Avoid overflow in size calculations.
5150 Don't update size until allocation succeeds.
5151 * fns.c (concat): Check for overflow in size calculations.
5152 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
5153 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5154 (NEXT_ALMOST_PRIME_LIMIT): New constant.
5156 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
5157 (get_doc_string): Check for size calculation overflow.
5158 Don't update size until allocation succeeds.
5159 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
5160 EMACS_INT, where ptrdiff_t will do.
5161 (Fsubstitute_command_keys): Check for string overflow.
5163 * editfns.c (set_time_zone_rule): Don't assume environment length
5165 (message_length): Now ptrdiff_t, not int.
5166 (Fmessage_box): Don't update size until allocation succeeds.
5167 Don't assume message length fits in int.
5168 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
5170 * emacs.c (main): Do not reallocate argv, since there is a null at
5171 the end that can be overwritten, and this way there's no need to
5172 worry about size-calculation overflow.
5173 (sort_args): Check for size-calculation overflow.
5175 * eval.c (init_eval_once, grow_specpdl): Don't update size until
5177 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
5179 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
5180 (x_set_scroll_bar_width, x_figure_window_size):
5181 Check for integer overflow.
5182 (x_set_alpha): Do not assume XINT fits in int.
5184 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
5185 This is for the members text_lines, text_cols, total_lines, total_cols,
5186 where the system imposes an 'int' limit.
5188 * fringe.c (Fdefine_fringe_bitmap):
5189 Don't update size until alloc works.
5191 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
5192 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
5194 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
5195 Check for size-calculation overflow.
5196 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
5197 do, as we prefer signed integers.
5198 (id_to_widget.max_size, id_to_widget.used)
5199 (xg_store_widget_in_map, xg_remove_widget_from_map)
5200 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
5201 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
5202 Use and return ptrdiff_t, not int.
5203 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
5204 * gtkutil.h: Change prototypes to match the above.
5206 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
5207 are duplicate now that they've been promoted to lisp.h.
5208 (x_allocate_bitmap_record, x_alloc_image_color)
5209 (make_image_cache, cache_image, xpm_load):
5210 Don't update size until alloc is done.
5211 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
5213 Check for size calculation overflow.
5214 (ct_colors_allocated_max): New constant.
5215 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
5218 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
5219 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
5220 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
5221 Use ptrdiff_t, not int, to count maps.
5222 (read_char_minibuf_menu_prompt): Check for overflow in size
5223 calculations. Don't update size until allocation succeeds.
5224 Redo calculations to avoid overflow.
5225 * keyboard.h: Change prototypes to match the above.
5227 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
5229 (current_minor_maps): Check for size calculation overflow.
5230 * keymap.h: Change prototypes to match the above.
5232 * lread.c (read1, init_obarray): Don't update size until alloc done.
5234 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
5235 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
5237 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
5238 Now ptrdiff_t, not int.
5239 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
5240 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
5242 * process.c (Fnetwork_interface_list): Check for overflow
5243 in size calculation.
5245 * region-cache.c (move_cache_gap): Check for size calculation overflow.
5247 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
5248 overflow. Don't bother calling xmalloc when xrealloc will do.
5250 * search.c (Freplace_match): Check for size calculation overflow.
5251 (Fset_match_data): Don't assume list lengths fit in 'int'.
5253 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
5254 for command line length. Do not attempt to address one before the
5255 beginning of an array, as that's not portable.
5257 * term.c (max_frame_lines): Remove; unused.
5258 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
5260 (encode_terminal_code, calculate_costs): Check for size
5261 calculation overflow.
5262 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
5263 table lengths and related sizes. Don't update size until alloc
5264 done. Redo calculations to avoid overflow.
5265 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
5267 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
5268 subtracting pointers.
5269 (gobble_line): Check for overflow more carefully. Don't update size
5272 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
5273 Don't update size until alloc done.
5274 Redo size calculations to avoid overflow.
5275 Check for size calculation overflow.
5276 (main) [DEBUG]: Fix typo in invoking tparam1.
5278 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
5279 Use ptrdiff_t, not int, for sizes.
5280 (store_mode_line_noprop_char): Don't update size until alloc done.
5282 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
5283 Use ptrdiff_t, not int, for sizes.
5284 (Finternal_make_lisp_face, cache_face):
5285 Check for size calculation overflow.
5286 (cache_face): Treat size calculation overflows as if they were
5287 memory exhaustion (the usual treatment), rather than aborting.
5289 * xfns.c (x_encode_text, x_set_name_internal)
5290 (Fx_change_window_property): Use ptrdiff_t, not int, to count
5291 sizes, since they can exceed INT_MAX in size. Check for size
5292 calculation overflow.
5294 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
5295 (xg_select): Check for size calculation overflow.
5296 Don't update size until alloc done.
5298 * xrdb.c (get_environ_db): Don't assume path length fits in int,
5299 as sprintf is limited to int lengths.
5301 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
5302 (X_LONG_MIN): New macros.
5303 Use them to make the following changes clearer.
5304 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
5305 This change doesn't affect the value now, but it may help remind
5306 future maintainers not to raise the value too much later.
5307 (SELECTION_QUANTUM): Remove, replacing with ...
5308 (selection_quantum): ... new function, which avoids overflow.
5310 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
5311 assumption that selection length fits in 'int'.
5312 (x_reply_selection_request, x_handle_selection_request)
5313 (x_get_window_property, receive_incremental_selection)
5314 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
5315 (lisp_data_to_selection_data, clean_local_selection_data):
5316 Use ptrdiff_t, not int, to record length of selection.
5317 (x_reply_selection_request, x_get_window_property)
5318 (receive_incremental_selection, x_property_data_to_lisp):
5319 Redo calculations to avoid overflow.
5320 (x_reply_selection_request): When sending hint, ceiling it at
5321 X_LONG_MAX rather than relying on wraparound overflow to send
5323 (x_get_window_property, receive_incremental_selection)
5324 (lisp_data_to_selection_data, x_property_data_to_lisp):
5325 Check for size-calculation overflow.
5326 (x_get_window_property, receive_incremental_selection)
5327 (lisp_data_to_selection_data, Fx_register_dnd_atom):
5328 Don't store size until memory allocation succeeds.
5329 (x_get_window_property): Plug memory leak on memory exhaustion.
5330 Don't double-block input; malloc is safe here. Don't assume 2**34
5331 - 4 fits in unsigned long. Add an xassert to check
5332 XGetWindowProperty overflow. Be more careful about overflow
5333 calculations, and distinguish size from memory overflow better.
5334 (receive_incremental_selection): When tracing, don't assume
5335 unsigned int is less than INT_MAX.
5336 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
5337 harmful) conversions of unsigned short to int.
5338 (lisp_data_to_selection_data): Don't assume that integers
5339 in the range -65535 through -1 fit in an X unsigned short.
5340 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
5341 result parameters unless successful. Rely on cons_to_unsigned
5342 to report problems with elements; the old code wasn't right anyway.
5343 (x_check_property_data): Check for int overflow; we cannot use
5344 a wider type due to X limits.
5345 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
5347 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
5349 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
5350 (x_term_init): Check for size calculation overflow.
5351 (x_color_cells): Don't store size until memory allocation succeeds.
5352 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
5353 Don't assume alloca size is less than MAX_ALLOCA.
5354 (x_term_init): Don't assume length fits in int (sprintf is limited
5357 Use ptrdiff_t for composition IDs.
5358 * character.c (lisp_string_width):
5359 * composite.c (composition_table_size, n_compositions)
5360 (get_composition_id, composition_gstring_from_id):
5361 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
5362 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
5363 * window.c (Frecenter):
5364 Use ptrdiff_t, not int, for composition IDs.
5365 * composite.c (get_composition_id): Check for integer overflow.
5366 * composite.h: Adjust prototypes to match the above changes.
5368 Use ptrdiff_t for hash table indexes.
5369 * category.c (hash_get_category_set):
5370 * ccl.c (ccl_driver):
5371 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
5372 * coding.c (coding_system_charset_list, detect_coding_system):
5373 * coding.h (struct coding_system.id):
5374 * composite.c (get_composition_id, gstring_lookup_cache):
5375 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
5376 * image.c (xpm_get_color_table_h):
5377 * lisp.h (hash_lookup, hash_put):
5378 * minibuf.c (Ftest_completion):
5379 Use ptrdiff_t for hash table indexes, not int (which is too
5380 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
5381 32-bit --with-wide-int hosts).
5383 * charset.c (Fdefine_charset_internal): Check for integer overflow.
5384 Add a FIXME comment about memory leaks.
5385 (syms_of_charset): Don't assume xmalloc returns.
5387 Don't assume that stated character widths fit in int.
5388 * character.c (Fchar_width, c_string_width, lisp_string_width):
5389 * character.h (CHAR_WIDTH):
5390 * indent.c (MULTIBYTE_BYTES_WIDTH):
5391 Use sanitize_char_width to avoid undefined and/or bad behavior
5392 with outlandish widths.
5393 * character.h (sanitize_tab_width): Rename from sanitize_width,
5394 now that we have two such functions. All uses changed.
5395 (sanitize_char_width): New inline function.
5397 Don't assume that tab-width fits in int.
5398 * character.h (sanitize_width): New inline function.
5399 (SANE_TAB_WIDTH): New macro.
5400 (ASCII_CHAR_WIDTH): Use it.
5401 * indent.c (sane_tab_width): Remove. All uses replaced by
5402 SANE_TAB_WIDTH (current_buffer).
5403 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
5405 * fileio.c: Integer overflow issues with file modes.
5406 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
5408 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
5409 Remove unreachable code.
5410 (read_hex, load_charset_map_from_file): Check for integer overflow.
5412 * xterm.c: Don't go over XClientMessageEvent limit.
5413 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
5414 (x_send_scroll_bar_event): Likewise. Check that the size does not
5415 exceed limits imposed by XClientMessageEvent, as well as the usual
5416 ptrdiff_t and size_t limits.
5418 * keyboard.c: Overflow, signedness and related fixes.
5419 (make_lispy_movement): Use same integer type in forward decl
5420 that is used in the definition.
5421 (read_key_sequence, keyremap_step):
5422 Change bufsize argument back to int, undoing my 2011-03-30 change.
5423 We prefer signed types, and int is wide enough here.
5424 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
5425 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
5426 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
5427 length, not size_t. Use ptrdiff_t for index, not int.
5428 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
5429 possibility of integer overflow.
5431 Overflow, signedness and related fixes for images.
5433 * dispextern.h (struct it.stack[0].u.image.image_id)
5434 (struct_it.image_id, struct image.id, struct image_cache.size)
5435 (struct image_cache.used, struct image_cache.ref_count):
5436 * gtkutil.c (update_frame_tool_bar):
5437 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
5438 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
5439 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
5440 * nsmenu.m (update_frame_tool_bar):
5441 * xdisp.c (calc_pixel_width_or_height):
5442 * xfns.c (image_cache_refcount):
5443 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
5444 on typical 64-bit hosts.
5446 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
5447 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
5448 Omit unnecessary casts to int.
5449 (parse_image_spec): Check that integers fall into 'int' range
5450 when the callers expect that.
5451 (image_ascent): Redo ascent calculation to avoid int overflow.
5452 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
5453 (lookup_image): Remove unnecessary tests.
5454 (xbm_image_p): Locals are now of int, not EMACS_INT,
5455 since parse_image_check makes sure they fit into int.
5456 (png_load, gif_load, svg_load_image):
5457 Prefer int to unsigned where either will do.
5458 (tiff_handler): New function, combining the cores of the
5459 old tiff_error_handler and tiff_warning_handler.
5460 This function is rewritten to use vsnprintf and thereby avoid
5461 stack buffer overflows. It uses only the features of vsnprintf
5462 that are common to both POSIX and native Microsoft.
5463 (tiff_error_handler, tiff_warning_handler): Use it.
5464 (tiff_load, gif_load, imagemagick_load_image):
5465 Don't assume :index value fits in 'int'.
5466 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
5467 (imagemagick_load_image): Check that crop parameters fit into
5468 the integer types that MagickCropImage accepts. Don't assume
5469 Vimagemagick_render_type has a nonnegative value. Don't assume
5470 size_t fits in 'long'.
5471 (gs_load): Use printmax_t to print the widest integers possible.
5472 Check for integer overflow when computing image height and width.
5474 2011-08-26 Eli Zaretskii <eliz@gnu.org>
5476 * xdisp.c (redisplay_window): Don't force window start if point
5477 will be invisible in the resulting window. (Bug#9324)
5479 2011-08-25 Eli Zaretskii <eliz@gnu.org>
5481 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
5482 the display spec is of the form `(space ...)'.
5483 (handle_display_spec): Return the value returned by
5484 handle_single_display_spec, not just 1 or zero.
5485 (handle_single_display_spec): If the display spec is of the form
5486 `(space ...)', and specifies display in the text area, return 2
5488 (try_cursor_movement): Check for the need to scroll more
5489 accurately, and prefer exact match for point under bidi.
5490 Don't advance `row' beyond the last row of the window.
5492 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
5493 into disp_prop; all users changed.
5495 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
5496 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
5497 for the text covered by the display property.
5499 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
5501 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
5502 Change return value to nil.
5503 (Frecord_buffer): Delete unused function.
5505 2011-08-24 Eli Zaretskii <eliz@gnu.org>
5507 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
5508 buffers, return left-to-right.
5509 (set_cursor_from_row): Consider candidate row a win if its glyph
5510 represents a newline and point is on that newline. Fixes cursor
5511 positioning on the newline at EOL of R2L text within L2R
5512 paragraph, and vice versa.
5513 (try_cursor_movement): Check continued rows, in addition to
5514 continuation rows. Fixes unwarranted scroll when point enters a
5515 continued line of R2L text within an L2R paragraph, or vice versa.
5516 (cursor_row_p): Consider the case of point being equal to
5517 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
5518 from the end of a short line to the beginning of a continued line
5519 of R2L text within L2R paragraph.
5520 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
5521 composed characters.
5523 * bidi.c (bidi_check_type): Use xassert.
5524 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
5527 2011-08-23 Eli Zaretskii <eliz@gnu.org>
5529 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
5532 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
5534 * nsfont.m (ns_otf_to_script): Fix typo.
5536 2011-08-22 Kenichi Handa <handa@m17n.org>
5538 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
5539 extra slot even if the purpose is char-code-property-table.
5541 2011-08-23 Eli Zaretskii <eliz@gnu.org>
5543 * xdisp.c (redisplay_window): When computing centering_position,
5544 account for the height of the header line. (Bug#8874)
5546 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
5547 instead of CHAR_TO_BYTE. Fixes a crash when a completion
5548 candidate is selected by the mouse, and that candidate has a
5549 composed character under the mouse.
5551 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
5552 coordinates reported by pos-visible-in-window-p for a composed
5553 character in column zero.
5555 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
5557 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
5559 2011-08-22 Eli Zaretskii <eliz@gnu.org>
5561 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
5562 consider it a hit if to_charpos is anywhere in the range of the
5563 composed buffer positions.
5565 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
5567 * image.c (gif_load): Don't assume that each subimage has the same
5568 dimensions as the base image. Handle disposal method that is
5569 "undefined" by the gif spec (Bug#9335).
5571 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
5573 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
5574 (Fcondition_case): Document `debug' symbol in error handler.
5576 2011-08-19 Eli Zaretskii <eliz@gnu.org>
5578 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
5579 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
5580 from an Org mode buffer to a Speedbar frame.
5582 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
5583 a composition, take its buffer position from IT->cmp_it.charpos.
5584 Fixes cursor positioning at the beginning of a line that begins
5585 with a composed character.
5587 2011-08-18 Eli Zaretskii <eliz@gnu.org>
5589 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
5590 character bidirectional type, use STRONG_L instead. Fixes crashes
5591 in a buffer produced by `describe-categories'.
5593 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
5594 members before the level stack, so they would be saved and
5595 restored when copying iterator state. Fixes incorrect reordering
5596 around TABs covered by display properties.
5598 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
5600 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
5602 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
5604 * eval.c (internal_condition_case, internal_condition_case_1)
5605 (internal_condition_case_2, internal_condition_case_n):
5606 Remove unnecessary aborts (Bug#9081).
5608 2011-08-17 Eli Zaretskii <eliz@gnu.org>
5610 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
5611 has no `load' handler, try opening the file locally. (Bug#9311)
5613 2011-08-16 Ken Brown <kbrown@cornell.edu>
5615 * gmalloc.c: Expand comment.
5617 2011-08-16 Eli Zaretskii <eliz@gnu.org>
5619 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
5620 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
5622 2011-08-16 Ken Brown <kbrown@cornell.edu>
5624 Fix memory allocation problems in Cygwin build (Bug#9273).
5626 * unexcw.c ( __malloc_initialized): Declare external variable.
5627 (fixup_executable): Force the dumped emacs to reinitialize malloc.
5629 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
5631 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
5633 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
5635 [CYGWIN] (special_realloc): New function.
5636 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
5637 requests to realloc storage in the static heap.
5639 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
5641 * bidi.c (bidi_initialize): Remove unused local.
5643 2011-08-15 Eli Zaretskii <eliz@gnu.org>
5646 * biditype.h: Remove file.
5647 * makefile.w32-in ($(BLD)/bidi.$(O)):
5648 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
5650 * dispextern.h: Fix a typo in the comment to bidi_type_t.
5652 * chartab.c: Improve commentary for the uniprop_table API.
5654 * bidi.c (bidi_paragraph_init): Support zero value of
5655 bidi_ignore_explicit_marks_for_paragraph_level.
5656 (bidi_initialize): Use uniprop_table instead of including
5657 biditype.h and bidimirror.h.
5659 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
5660 coordinates of the iterator when restoring from ppos_it.
5663 2011-08-14 Kenichi Handa <handa@m17n.org>
5665 * process.c (create_process): Call setup_process_coding_systems
5666 after the pid of the process is set to -1 (Bug#8162).
5668 2011-08-14 Eli Zaretskii <eliz@gnu.org>
5670 * xdisp.c (move_it_in_display_line_to): Don't invoke
5671 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
5672 ppos_it. Fixes vertical cursor motion when line beginning is
5673 covered by an image. (Bug#9296)
5675 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
5677 * nsterm.h (ns_run_ascript): Declare.
5678 (NSAPP_DATA2_RUNASSCRIPT): Define.
5680 * nsfns.m (as_script, as_result, as_status): New static variables.
5681 (ns_run_ascript): New function.
5682 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
5683 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
5684 the event loop. Get status from as_status (Bug#7276).
5686 * nsterm.m (sendEvent): If event is NSApplicationDefined and
5687 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
5688 the event loop (Bug#7276).
5690 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
5692 * gnutls.c (QCgnutls_bootprop_priority)
5693 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
5694 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
5695 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
5696 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
5697 (QCgnutls_bootprop_verify_hostname_error)
5698 (QCgnutls_bootprop_callbacks_verify): Rename from
5699 Qgnutls_bootprop_..., all uses changed.
5701 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
5704 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
5706 * xfaces.c (Qframe_set_background_mode): Now static.
5707 * dispextern.h (Qframe_set_background_mode): Remove decl.
5709 * process.c (Fnetwork_interface_info): Declare local only if needed.
5711 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
5713 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
5714 (Fnetwork_interface_list): Allocate in increments of bytes instead
5715 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
5716 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
5718 (struct ifflag_def): notrailers is smart on OSX.
5719 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
5720 Get hardware address with getifaddrs if available.
5722 2011-08-12 Eli Zaretskii <eliz@gnu.org>
5724 * xdisp.c (iterate_out_of_display_property): xassert that
5725 IT->position is set to within IT->object's boundaries. Break from
5726 the loop as soon as EOB is reached; avoids infloops in redisplay
5727 when IT->position is set up wrongly due to some bug.
5728 Set IT->current to match the bidi iterator unconditionally.
5729 (push_display_prop): Allow GET_FROM_STRING as IT->method on
5730 entry. Force push_it to save on the stack the current
5731 buffer/string position, to be restored by pop_it. Fix flags in
5732 the iterator structure wrt the object coming from a display
5733 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
5734 properties. (Bug#9284)
5736 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
5738 * fontset.c (fontset_get_font_group): Add proper type checks.
5741 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
5743 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
5744 and LC_VERSION_MIN_MACOSX.
5745 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
5746 (dump_it) [LC_FUNCTION_STARTS]: Use it.
5748 2011-08-08 Eli Zaretskii <eliz@gnu.org>
5750 * xdisp.c (forward_to_next_line_start): Allow to use the
5751 no-display-properties-and-no-overlays under bidi display.
5752 Set disp_pos in the bidi iterator to avoid searches for display
5753 properties and overlays.
5755 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
5757 * editfns.c (Fset_time_zone_rule): Document relationship with the
5760 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
5761 the font entity extracted from the cache (Bug#8109).
5763 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
5765 * composite.c (autocmp_chars): Don't reset point. That is done by
5766 restore_point_unwind (Bug#5984).
5768 2011-08-07 Juri Linkov <juri@jurta.org>
5770 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
5771 to show the arg `TIME' instead of `TIMEVAL'.
5773 2011-08-06 Eli Zaretskii <eliz@gnu.org>
5775 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
5776 display property strides EOL and includes a newline, as in
5777 longlines-mode. (Bug#9254)
5778 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
5779 word-wrap under bidirectional display. (Bug#9224)
5781 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
5782 is non-zero, even if the data buffer is NULL. Fixes a crash in
5783 vertical-motion with longlines-mode. (Bug#9254)
5785 2011-08-05 Eli Zaretskii <eliz@gnu.org>
5787 * bidi.c <bidi_cache_total_alloc>: Now static.
5788 (bidi_initialize): Initialize bidi_cache_total_alloc.
5790 * xdisp.c (display_line): Release buffer allocated for shelved bidi
5793 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
5794 amount allocated this far in `bidi_cache_total_alloc'.
5795 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
5796 non-zero, only free the data buffer without restoring the cache
5797 contents. All callers changed.
5799 * dispextern.h (bidi_unshelve_cache): Update prototype.
5801 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
5802 (move_it_in_display_line, move_it_to)
5803 (move_it_vertically_backward, move_it_by_lines): Replace the call
5804 to xfree to an equivalent call to bidi_unshelve_cache.
5805 (move_it_in_display_line_to): Fix logic of returning
5806 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
5808 2011-08-05 Eli Zaretskii <eliz@gnu.org>
5810 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
5811 came from a string character with a `cursor' property. (Bug#9229)
5813 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
5815 * Makefile.in (LIB_PTHREAD): New variable.
5816 (LIBES): Add LIB_PTHREAD (Bug#9216).
5818 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
5819 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
5821 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
5823 * regex.c (re_iswctype): Remove some redundant boolean conversions.
5825 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
5827 * xterm.c (x_find_topmost_parent): New function.
5828 (x_set_frame_alpha): Find topmost parent window with
5829 x_find_topmost_parent and set the property there also (bug#9181).
5830 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
5832 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
5834 * callproc.c (Fcall_process): Avoid vfork clobbering
5835 the local vars buffer, coding_systems, current_dir.
5837 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
5839 * keymap.c (Fmake_composed_keymap): Move to subr.el.
5841 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
5843 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
5844 so that it is not optimized away.
5846 * xdisp.c (compute_display_string_pos): Remove unused local.
5848 2011-08-02 Eli Zaretskii <eliz@gnu.org>
5850 Fix slow cursor motion and scrolling in large buffers with
5851 selective display, like Org Mode buffers. (Bug#9218)
5853 * dispextern.h (struct bidi_it): New member disp_prop_p.
5855 * xdisp.c: Remove one-slot cache of display string positions.
5856 (compute_display_string_pos): Accept an additional argument
5857 DISP_PROP_P; callers changed. Scan at most 5K characters forward
5858 for a display string or property. If found, set DISP_PROP_P
5861 * bidi.c (bidi_fetch_char): Accept an additional argument
5862 DISP_PROP_P, and pass it to compute_display_string_pos.
5863 Only handle text covered by a display string if DISP_PROP_P is returned
5864 non-zero. All callers of bidi_fetch_char changed.
5866 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
5868 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
5870 2010-12-03 Don March <don@ohspite.net>
5872 * keymap.c (Fdefine_key): Fix non-prefix key error message when
5873 last character M-[char] is translated to ESC [char] (bug#7541).
5875 2011-08-02 Kenichi Handa <handa@m17n.org>
5877 * lisp.h (uniprop_table): Extern it.
5879 * chartab.c (uniprop_table): Make it non-static.
5881 2011-08-01 Eli Zaretskii <eliz@gnu.org>
5883 * xdisp.c (forward_to_next_line_start): Accept additional argument
5884 BIDI_IT_PREV, and store into it the state of the bidi iterator had
5886 (reseat_at_next_visible_line_start): Use the bidi iterator state
5887 returned by forward_to_next_line_start to restore the state of
5888 it->bidi_it after backing up to previous newline. (Bug#9212)
5890 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
5892 * regex.c (re_comp): Protoize.
5893 (re_exec): Fix return type.
5894 (regexec): Fix type of `ret'. (Bug#9203)
5896 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5898 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
5899 This is needed if max-image-size is a floating-point number.
5901 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
5903 * print.c (print_object): Print empty symbol as ##.
5905 * lread.c (read1): Read ## as empty symbol.
5907 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
5909 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
5910 setting frame foreground color (Bug#9175).
5911 (x_set_background_color): Likewise.
5913 * nsmenu.m (-setText): Size tooltip dimensions precisely to
5914 contents (Bug#9176).
5915 (EmacsTooltip -init): Remove bezels and add shadows to
5918 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
5919 or scroll bar (Bug#8470).
5921 * nsfont.m (nsfont_open): Remove assignment to voffset and
5922 unnecessary vars hshink, expand, hd, full_height, min_height.
5923 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
5925 * nsterm.h (nsfont_info): Remove voffset field.
5927 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
5929 Implement strike-through and overline on NextStep (Bug#8863).
5931 * nsfont.m (nsfont_open): Use underline position provided by font,
5932 instead of hard-coded value of 2.
5933 (nsfont_draw): Call ns_draw_text_decoration instead.
5935 * nsterm.h: Add declaration for ns_draw_text_decoration.
5937 * nsterm.m (ns_draw_text_decoration): New function for drawing
5938 underline, overline, and strike-through.
5939 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
5940 ns_draw_text_decoration. Change treatment of cursor drawing to
5941 accommodate underlining, etc.
5943 2011-07-28 Eli Zaretskii <eliz@gnu.org>
5945 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
5948 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5950 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
5951 Without this fix, if a signal arrives just after memory fills up,
5952 'malloc' might be invoked reentrantly.
5954 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
5955 In other words, assume that every image size is allowed, on non-X
5956 hosts. This assumption is probably wrong, but it lets Emacs compile.
5958 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
5960 * regex.c (re_iswctype): Convert return values to boolean.
5962 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
5964 * xdisp.c (compute_display_string_pos): Don't use cached display
5965 string position if the buffer had its restriction changed.
5968 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5970 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
5972 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
5974 Integer signedness and overflow and related fixes. (Bug#9079)
5976 * bidi.c: Integer size and overflow fixes.
5977 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
5978 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
5979 (bidi_cache_find_level_change, bidi_cache_ensure_space)
5980 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
5981 (bidi_find_other_level_edge):
5982 Use ptrdiff_t instead of EMACS_INT where either will do.
5983 This works better on 32-bit hosts configured --with-wide-int.
5984 (bidi_cache_ensure_space): Check for size-calculation overflow.
5985 Use % rather than repeated addition, for better worst-case speed.
5986 Don't set bidi_cache_size until after xrealloc returns, because it
5988 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
5989 (bidi_cache_ensure_space): Also check that the bidi cache size
5990 does not exceed that of the largest Lisp string or buffer. See Eli
5991 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
5993 * alloc.c (__malloc_size_t): Remove.
5994 All uses replaced by size_t. See Andreas Schwab's note
5995 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
5997 * image.c: Improve checking for integer overflow.
5998 (check_image_size): Assume that f is nonnull, since
5999 it is always nonnull in practice. This is one less thing to
6000 worry about when checking for integer overflow later.
6001 (x_check_image_size): New function, which checks for integer
6002 overflow issues inside X.
6003 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
6004 This removes the need for a memory_full check.
6005 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
6006 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
6007 (xbm_read_bitmap_data): Change locals back to 'int', since
6008 their values must fit in 'int'.
6009 (xpm_load_image, png_load, tiff_load):
6010 Invoke x_create_x_image_and_pixmap earlier,
6011 to avoid much needless work if the image is too large.
6012 (tiff_load): Treat overly large images as if
6013 x_create_x_image_and_pixmap failed, not as malloc failures.
6014 (gs_load): Use x_check_image_size.
6016 * gtkutil.c: Omit integer casts.
6017 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
6018 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
6020 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
6022 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
6023 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
6024 would wrongly return t on a 64-bit host.
6026 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
6027 The plain *_OVERFLOW macros run afoul of GCC bug 49705
6028 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
6029 and therefore cause GCC to emit a bogus diagnostic in some cases.
6031 * image.c: Integer signedness and overflow and related fixes.
6032 This is not an exhaustive set of fixes, but it's time to
6033 record what I've got.
6034 (lookup_pixel_color, check_image_size): Remove redundant decls.
6035 (check_image_size): Don't assume that arbitrary EMACS_INT values
6036 fit in 'int', or that arbitrary 'double' values fit in 'int'.
6037 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
6038 (tiff_load, imagemagick_load_image):
6039 Check for overflow in size calculations.
6040 (x_create_x_image_and_pixmap): Remove unnecessary test for
6041 xmalloc returning NULL; that can't happen.
6042 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
6043 (xpm_color_bucket): Use better integer hashing function.
6044 (xpm_cache_color): Don't possibly over-allocate memory.
6045 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
6046 (gif_memory_source):
6047 Use ptrdiff_t, not int or size_t, to record sizes.
6048 (png_load): Don't assume values greater than 2**31 fit in 'int'.
6049 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
6050 either works, as we prefer signed integers.
6051 (tiff_read_from_memory, tiff_write_from_memory):
6052 Return tsize_t, not size_t, since that's what the TIFF API wants.
6053 (tiff_read_from_memory): Don't fail simply because the read would
6054 go past EOF; instead, return a short read.
6055 (tiff_load): Omit no-longer-needed casts.
6056 (Fimagemagick_types): Don't assume size fits into 'int'.
6058 Improve hashing quality when configured --with-wide-int.
6059 * fns.c (hash_string): New function, taken from sxhash_string.
6060 Do not discard information about ASCII character case; this
6061 discarding is no longer needed.
6062 (sxhash-string): Use it. Change sig to match it. Caller changed.
6063 * lisp.h: Declare it.
6064 * lread.c (hash_string): Remove, since we now use fns.c's version.
6065 The fns.c version returns a wider integer if --with-wide-int is
6066 specified, so this should help the quality of the hashing a bit.
6068 * emacs.c: Integer overflow minor fix.
6069 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
6070 Define only if GNU_LINUX.
6071 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
6073 * dispnew.c: Integer signedness and overflow fixes.
6074 Remove unnecessary forward decls, that were a maintenance hassle.
6075 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
6077 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
6078 (scrolling_window): Use ptrdiff_t, not int, for byte count.
6079 (prepare_desired_row, line_draw_cost):
6080 Use int, not unsigned, where either works.
6081 (save_current_matrix, restore_current_matrix):
6082 Use ptrdiff_t, not size_t, where either works.
6083 (init_display): Check for overflow more accurately, and without
6084 relying on undefined behavior.
6086 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
6087 Remove, replacing with the new symbols in lisp.h. All uses changed.
6088 * fileio.c (make_temp_name):
6089 * filelock.c (lock_file_1, lock_file):
6090 * xdisp.c (message_dolog):
6091 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
6092 Use pMd etc. instead.
6093 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
6094 replacing the pWIDE etc. symbols removed from editfns.c.
6096 * keyboard.h (num_input_events): Now uintmax_t.
6097 This is (very slightly) less likely to mess up due to wraparound.
6100 * buffer.c: Integer signedness fixes.
6101 (alloc_buffer_text, enlarge_buffer_text):
6102 Use ptrdiff_t rather than size_t when either will do, as we prefer
6105 * alloc.c: Integer signedness and overflow fixes.
6106 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
6107 (__malloc_size_t): Default to size_t, not to int.
6108 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
6109 (Fgarbage_collect, mark_object_loop_halt, mark_object):
6110 Prefer ptrdiff_t to size_t when either would do, as we prefer
6112 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
6113 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
6114 Now const. Initialize with values that are in range even if char
6116 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
6117 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
6118 These functions do the right thing with sizes > 2**32.
6119 (check_depth): Now ptrdiff_t, not int.
6120 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
6121 Adjust to new way of storing sizes. Check for size overflow bugs
6123 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
6124 slightly wrong anyway, as it missed one instance of
6125 XMALLOC_OVERRUN_CHECK_OVERHEAD.
6126 (refill_memory_reserve): Omit needless cast to size_t.
6127 (mark_object_loop_halt): Mark as externally visible.
6129 * xselect.c: Integer signedness and overflow fixes.
6130 (Fx_register_dnd_atom, x_handle_dnd_message):
6131 Use ptrdiff_t, not size_t, since we prefer signed.
6132 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
6133 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
6134 x_dnd_atoms_size and x_dnd_atoms_length.
6136 * doprnt.c: Prefer signed to unsigned when either works.
6138 * doprnt.c (doprnt):
6140 * xdisp.c (vmessage):
6141 Use ptrdiff_t, not size_t, when using or implementing doprnt,
6142 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
6143 prefer signed arithmetic to avoid comparison confusion.
6144 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
6145 but is a bit tricky.
6147 Assume freestanding C89 headers, string.h, stdlib.h.
6148 * data.c, doprnt.c, floatfns.c, print.c:
6149 Include float.h unconditionally.
6150 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
6151 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
6152 * regex.c: Likewise for stddef.h, string.h.
6153 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
6154 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
6155 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
6156 (STDC_HEADERS): Remove obsolete defines.
6157 * sysdep.c: Include limits.h unconditionally.
6159 Assume support for memcmp, memcpy, memmove, memset.
6160 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
6161 * regex.c (memcmp, memcpy):
6162 Remove; we assume C89 now.
6164 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
6165 (__malloc_safe_bcopy): Remove; no longer needed.
6167 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6168 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
6169 well either way, and we prefer signed to unsigned.
6171 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
6173 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
6174 closes the connection while we're reading (bug#9182).
6176 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
6178 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
6179 are specified (Bug#9168).
6181 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
6183 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
6184 Found by GCC static checking and --with-wide-int on a 32-bit host.
6186 2011-07-25 Eli Zaretskii <eliz@gnu.org>
6188 * xdisp.c (compute_display_string_pos): Fix logic of caching
6189 previous display string position. Initialize cached_prev_pos to
6190 -1. Fixes slow-down at the beginning of a buffer.
6192 2011-07-24 Eli Zaretskii <eliz@gnu.org>
6194 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
6195 for attrs[LFACE_FONTSET_INDEX].
6197 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
6199 * xml.c (parse_region): Remove unused local
6200 that was recently introduced.
6202 2011-07-23 Eli Zaretskii <eliz@gnu.org>
6204 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
6205 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
6207 * xdisp.c (move_it_in_display_line_to): Record the best matching
6208 position for TO_CHARPOS while scanning the line, and restore it on
6209 exit if none of the characters scanned was an exact match.
6210 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
6211 when exact match is impossible due to invisible text, and the
6212 lines are truncated.
6214 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
6216 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
6219 2011-07-22 Eli Zaretskii <eliz@gnu.org>
6221 Fix a significant slow-down of cursor motion with C-n, C-p,
6222 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
6223 auto-repeat under bidi redisplay in fontified buffers.
6224 * xdisp.c (compute_stop_pos_backwards): New function.
6225 (next_element_from_buffer): Call compute_stop_pos_backwards to
6226 find a suitable prev_stop when we find ourselves before
6228 (reseat): Don't look for prev_stop, as that could mean a very long
6230 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
6231 <cached_disp_overlay_modiff>: Cache for last found display string
6233 (compute_display_string_pos): Return the cached position if asked
6234 about the same buffer in the same area of character positions, and
6235 the buffer wasn't changed since the time the display string
6236 position was cached.
6238 2011-07-22 Eli Zaretskii <eliz@gnu.org>
6240 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
6241 is an integer, which is important for empty lines. (Bug#9149)
6243 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
6245 * frame.c (Fmodify_frame_parameters): In tty case, update the
6246 default face if necessary (Bug#4238).
6248 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
6250 * editfns.c (Fstring_to_char): No need to explain what a character
6251 is in the docstring (Bug#6576).
6253 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
6255 * xml.c (parse_region): Make sure we always return a tree.
6257 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
6259 * xml.c (parse_region): If a document contains only comments,
6262 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
6264 * xml.c (make_dom): Return comments, too.
6266 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
6269 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
6270 and the surrounding thread.
6271 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
6272 rather than fgets, and retry after EINTR. Otherwise, 'emacs
6273 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
6275 * s/openbsd.h (BROKEN_SIGIO): Define.
6276 * unexelf.c (unexec) [__OpenBSD__]:
6277 Don't update the .mdebug section of the Alpha COFF symbol table.
6279 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
6281 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
6284 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
6286 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
6287 This fixes some race conditions on the permissions of any newly
6290 * alloc.c (valid_pointer_p): Use pipe, not open.
6291 This fixes some permissions issues when debugging.
6293 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
6294 If fchown fails to set both uid and gid, try to set just gid,
6295 as that is sometimes allowed. Adjust the file's mode to eliminate
6296 setuid or setgid bits that are inappropriate if fchown fails.
6298 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
6300 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
6301 to compare Lisp_Objects.
6302 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
6303 global_gnutls_log_level, don't mistake it for a Lisp_Object.
6304 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
6306 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
6308 * lread.c (read_integer): Unread even EOF character.
6309 (read1): Likewise. Properly record start position of symbol.
6311 * lread.c (read1): Read `#:' as empty uninterned symbol if no
6312 symbol character follows.
6314 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
6316 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
6317 This works around a problem with the previous change to Fcopy_file.
6318 Recent glibc declares fchown with __attribute__((warn_unused_result)),
6319 and without this change, GCC might complain about discarding
6320 fchown's return value.
6322 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
6324 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
6326 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
6328 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
6330 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
6332 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
6333 it's used from the C level.
6335 * process.c: Use the same condition for POLL_FOR_INPUT in both
6336 keyboard.c and process.c (bug#1858).
6338 2011-07-09 Lawrence Mitchell <wence@gmx.li>
6340 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
6341 (Fgnutls_boot): Use it.
6343 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
6345 * doc.c (Fsubstitute_command_keys): Revert last change.
6347 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
6349 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
6350 quotes the next character, and doesn't affect other longer
6351 sequences (bug#8935).
6353 * lread.c (syms_of_lread): Clarify that is isn't only
6354 `eval-buffer' and `eval-defun' that's affected by
6355 `lexical-binding' (bug#8460).
6357 2011-07-15 Eli Zaretskii <eliz@gnu.org>
6359 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6360 bidi redisplay when a line includes both an image and is truncated.
6362 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
6364 Fix minor problems found by static checking.
6365 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
6366 (elsz): Now a signed constant, not a size_t var. We prefer signed
6367 types to unsigned, to avoid integer comparison confusion. Without
6368 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
6369 "cannot optimize loop, the loop counter may overflow", a symptom
6371 * indent.c (Fvertical_motion): Mark locals as initialized.
6372 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
6374 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
6376 * search.c (Fre_search_backward): Mention `case-fold-search' in
6377 all the re_search_* functions (bug#8138).
6379 * keyboard.c (Fopen_dribble_file): Document when the file is
6382 2011-07-14 Eli Zaretskii <eliz@gnu.org>
6384 * bidi.c (bidi_dump_cached_states): Fix format of displaying
6387 Support bidi reordering of display and overlay strings.
6388 * xdisp.c (compute_display_string_pos)
6389 (compute_display_string_end): Accept additional argument STRING.
6390 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
6391 (reseat_to_string): Initialize bidi_it->string.s and
6392 bidi_it->string.schars.
6393 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
6394 NULL (avoids a crash in bidi_paragraph_init).
6395 Initialize itb.string.lstring.
6396 (init_iterator): Call bidi_init_it only of a valid
6397 buffer position was specified. Initialize paragraph_embedding to
6399 (reseat_to_string): Initialize the bidi iterator.
6400 (display_string): If we need to ignore text properties of
6401 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
6402 original value of -1 will not work with bidi.)
6403 (compute_display_string_pos): First arg is now struct
6404 `text_pos *'; all callers changed. Support display properties on
6406 (compute_display_string_end): Support display properties on Lisp
6408 (init_iterator, reseat_1, reseat_to_string): Initialize the
6409 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
6410 when iterating on a string not from display properties).
6411 (compute_display_string_pos, compute_display_string_end):
6412 Fix calculation of the object to scan. Fixes an error when using
6414 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
6415 base_level_stop; instead, set base_level_stop to BEGV.
6416 Fixes crashes in vertical-motion.
6417 (next_element_from_buffer): Improve commentary for when
6418 the iterator is before prev_stop.
6419 (init_iterator): Initialize bidi_p from the default value of
6420 bidi-display-reordering, not from buffer-local value. Use the
6421 buffer-local value only if initializing for buffer iteration.
6422 (handle_invisible_prop): Support invisible properties on strings
6423 that are being bidi-reordered.
6424 (set_iterator_to_next): Support bidi reordering of C strings and
6426 (next_element_from_string): Support bidi reordering of Lisp
6428 (handle_stop_backwards): Support Lisp strings as well.
6429 (display_string): Support display of R2L glyph rows.
6430 Use IT_STRING_CHARPOS when displaying from a Lisp string.
6431 (init_iterator): Don't initialize it->bidi_p for strings
6433 (reseat_to_string): Initialize it->bidi_p for strings here.
6434 (next_element_from_string, next_element_from_c_string)
6435 (next_element_from_buffer): Add xassert's for correspondence
6436 between IT's object being iterated and it->bidi_it.string
6438 (face_before_or_after_it_pos): Support bidi iteration.
6439 (next_element_from_c_string): Handle the case of the first string
6440 character that is not the first one in the visual order.
6441 (get_visually_first_element): New function, refactored from common
6442 parts of next_element_from_buffer, next_element_from_string, and
6443 next_element_from_c_string.
6444 (tool_bar_lines_needed, redisplay_tool_bar)
6445 (display_menu_bar): Force left-to-right direction. Add a FIXME
6446 comment for making that be controlled by a user option.
6447 (push_it, pop_it): Save and restore the state of the
6448 bidi iterator. Save and restore the bidi_p flag.
6449 (pop_it): Iterate out of display property for string iteration as
6451 (iterate_out_of_display_property): Support iteration over strings.
6452 (handle_single_display_spec): Set up it->bidi_it for iteration
6453 over a display string, and call bidi_init_it.
6454 (handle_single_display_spec, next_overlay_string)
6455 (get_overlay_strings_1, push_display_prop): Set up the bidi
6456 iterator for displaying display or overlay strings.
6457 (forward_to_next_line_start): Don't use the shortcut if
6459 (back_to_previous_visible_line_start): If handle_display_prop
6460 pushed the iterator stack, restore the internal state of the bidi
6461 iterator by calling bidi_pop_it same number of times.
6462 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
6463 and we are bidi-iterating, don't decrement the iterator position;
6464 instead, set the first_elt flag in the bidi iterator, to produce
6466 (reseat_1): Remove redundant setting of string_from_display_prop_p.
6467 (push_display_prop): xassert that we are iterating a buffer.
6468 (push_it, pop_it): Save and restore paragraph_embedding member.
6469 (handle_single_display_spec, next_overlay_string)
6470 (get_overlay_strings_1, reseat_1, reseat_to_string)
6471 (push_display_prop): Set up the `unibyte' member of bidi_it.string
6472 correctly. Don't assume unibyte strings are not bidi-reordered.
6473 (compute_display_string_pos)
6474 (compute_display_string_end): Fix handling the case of C string.
6475 (push_it, pop_it): Save and restore from_disp_prop_p.
6476 (handle_single_display_spec, push_display_prop): Set the
6477 from_disp_prop_p flag.
6478 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
6479 (pop_it): Call iterate_out_of_display_property only if we are
6480 popping after iteration over a string that came from a display
6481 property. Fix a typo in popping stretch info. Add an assertion
6482 for verifying that the iterator position is in sync with the bidi
6484 (handle_single_display_spec, get_overlay_strings_1)
6485 (push_display_prop): Fix initialization of paragraph direction for
6486 string when that of the parent object is not yet determined.
6487 (reseat_1): Call bidi_init_it to resync the bidi
6488 iterator with IT's position. (Bug#7616)
6489 (find_row_edges): If ROW->start.pos gives position
6490 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
6491 (handle_stop, back_to_previous_visible_line_start, reseat_1):
6492 Reset the from_disp_prop_p flag.
6493 (SAVE_IT, RESTORE_IT): New macros.
6494 (pos_visible_p, face_before_or_after_it_pos)
6495 (back_to_previous_visible_line_start)
6496 (move_it_in_display_line_to, move_it_in_display_line)
6497 (move_it_to, move_it_vertically_backward, move_it_by_lines)
6498 (try_scrolling, redisplay_window, display_line): Use them when
6499 saving a temporary copy of the iterator and restoring it back.
6500 (back_to_previous_visible_line_start, reseat_1)
6501 (init_iterator): Empty the bidi cache "stack".
6502 (move_it_in_display_line_to): If iterator ended up at
6503 EOL, but we never saw any buffer positions smaller than
6504 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
6505 motion in bidi-reordered lines.
6506 (move_it_in_display_line_to): Record prev_method and prev_pos
6507 immediately before the call to set_iterator_to_next. Fixes cursor
6508 motion in bidi-reordered lines with stretch glyphs and strings
6509 displayed in margins. (Bug#8133) (Bug#8867)
6510 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
6512 (pos_visible_p): Support positions in bidi-reordered lines.
6513 Save and restore bidi cache.
6515 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
6516 (bidi_paragraph_info): Delete unused struct.
6517 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
6518 (bidi_cache_start): New variable.
6519 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
6521 (bidi_cache_fetch_state, bidi_cache_search)
6522 (bidi_cache_find_level_change, bidi_cache_iterator_state)
6523 (bidi_cache_find, bidi_peek_at_next_level)
6524 (bidi_level_of_next_char, bidi_find_other_level_edge)
6525 (bidi_move_to_visually_next): Compare cache index with
6526 bidi_cache_start rather than with zero.
6527 (bidi_fetch_char): Accept new argument STRING; all callers
6528 changed. Support iteration over a string. Support strings with
6529 display properties. Support unibyte strings. Fix the type of
6530 `len' according to what STRING_CHAR_AND_LENGTH expects.
6531 (bidi_paragraph_init, bidi_resolve_explicit_1)
6532 (bidi_resolve_explicit, bidi_resolve_weak)
6533 (bidi_level_of_next_char, bidi_move_to_visually_next):
6534 Support iteration over a string.
6535 (bidi_set_sor_type, bidi_resolve_explicit_1)
6536 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
6537 can now be zero (for strings); special values 0 and -1 were
6538 changed to -1 and -2, respectively.
6539 (bidi_char_at_pos): New function.
6540 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
6541 Call it instead of FETCH_MULTIBYTE_CHAR.
6542 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
6543 initialized to valid values.
6544 (bidi_init_it): Don't initialize charpos and bytepos with invalid
6546 (bidi_level_of_next_char): Allow the sentinel "position" to pass
6547 the test for valid cached positions. Fix the logic for looking up
6548 the sentinel state in the cache. GCPRO the Lisp string we are
6550 (bidi_push_it, bidi_pop_it): New functions.
6551 (bidi_initialize): Initialize the bidi cache start stack pointer.
6552 (bidi_cache_ensure_space): New function, refactored from part of
6553 bidi_cache_iterator_state. Don't assume the required size is just
6554 one BIDI_CACHE_CHUNK away.
6555 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
6556 (bidi_count_bytes, bidi_char_at_pos): New functions.
6557 (bidi_cache_search): Don't assume bidi_cache_last_idx is
6558 always valid if bidi_cache_idx is valid.
6559 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
6560 is valid if it's going to be used.
6561 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
6562 (bidi_cache_fetch_state, bidi_cache_search)
6563 (bidi_cache_find_level_change, bidi_cache_ensure_space)
6564 (bidi_cache_iterator_state, bidi_cache_find)
6565 (bidi_find_other_level_edge, bidi_cache_start_stack):
6566 All variables related to cache indices are now EMACS_INT.
6568 * dispextern.h (struct bidi_string_data): New structure.
6569 (struct bidi_it): New member `string'. Make flag members be 1-bit
6570 fields, and put them last in the struct.
6571 (compute_display_string_pos, compute_display_string_end):
6573 (bidi_push_it, bidi_pop_it): Add prototypes.
6574 (struct iterator_stack_entry): New members bidi_p,
6575 paragraph_embedding, and from_disp_prop_p.
6576 (struct it): Member bidi_p is now a bit field 1 bit wide.
6577 (bidi_shelve_cache, bidi_unshelve_cache):
6580 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
6581 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
6582 and vector-like objects.
6584 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
6585 cache around display iteration.
6587 * window.c (Fwindow_end, window_scroll_pixel_based)
6588 (displayed_window_lines, Frecenter): Save and restore the bidi
6589 cache around display iteration.
6591 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
6593 * editfns.c (Fdelete_region): Clarify the use of the named
6594 parameters (bug#6788).
6596 2011-07-14 Martin Rudalics <rudalics@gmx.at>
6598 * indent.c (Fvertical_motion): Set and restore w->pointm when
6599 saving and restoring the window's buffer (Bug#9006).
6601 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
6603 * editfns.c (Fstring_to_char): Clarify just what is returned
6604 (bug#6576). Text by Eli Zaretskii.
6606 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
6608 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
6610 2011-07-13 Eli Zaretskii <eliz@gnu.org>
6612 * buffer.c (mmap_find): Fix a typo.
6614 2011-07-13 Johan Bockgård <bojohan@gnu.org>
6616 Fix execution of x selection hooks.
6617 * xselect.c (Qx_lost_selection_functions)
6618 (Qx_sent_selection_functions): New vars.
6619 (syms_of_xselect): DEFSYM them.
6620 (x_handle_selection_request): Pass Qx_sent_selection_functions
6621 rather than Vx_sent_selection_functions to Frun_hook_with_args.
6622 (x_handle_selection_clear,x_clear_frame_selections):
6623 Pass Qx_lost_selection_functions rather than
6624 Vx_lost_selection_functions to Frun_hook_with_args.
6626 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
6628 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
6629 The old code sometimes used this field without initializing it.
6631 * alloc.c (gc_sweep): Don't read past end of array.
6632 In theory, the old code could also have corrupted Emacs internals,
6633 though it'd be very unlikely.
6635 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
6637 * character.c (Fcharacterp): Don't advertise optional ignored
6638 argument. (Bug#4026)
6640 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
6642 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
6645 * window.c (Fset_window_start): Doc fix (bug#4199).
6646 (Fset_window_hscroll): Ditto.
6648 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
6650 Fix minor new problems caught by GCC 4.6.1.
6651 * term.c (init_tty): Remove unused local.
6652 * xsettings.c (store_monospaced_changed): Define this function only
6653 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
6656 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
6658 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
6660 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
6662 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
6663 are the mini-buffer and the echo area (bug#3320).
6665 * term.c (init_tty): Remove support for supdup, c10 and perq
6666 terminals, which are no longer supported (bug#1482).
6668 2011-07-10 Johan Bockgård <bojohan@gnu.org>
6670 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
6672 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
6674 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
6675 for non-popups (Bug#3642).
6677 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
6679 * alloc.c (reset_malloc_hooks): Protoize.
6680 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
6681 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
6682 * cm.c (losecursor): Likewise.
6683 * data.c (fmod): Likewise.
6684 * dispnew.c (swap_glyphs_in_rows): Likewise.
6685 * emacs.c (memory_warning_signal): Likewise.
6686 * floatfns.c (float_error): Likewise.
6687 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
6688 (otf_open, font_otf_capability, generate_otf_features)
6689 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
6691 * image.c (pbm_read_file): Likewise.
6692 * indent.c (string_display_width): Likewise.
6693 * intervals.c (check_for_interval, search_for_interval)
6694 (inc_interval_count, count_intervals, root_interval)
6695 (adjust_intervals_for_insertion, make_new_interval): Likewise.
6696 * lread.c (defalias): Likewise.
6697 * ralloc.c (r_alloc_check): Likewise.
6698 * regex.c (set_image_of_range_1, set_image_of_range)
6699 (regex_grow_registers): Likewise.
6700 * sysdep.c (strerror): Likewise.
6701 * termcap.c (valid_filename_p, tprint, main): Likewise.
6702 * tparam.c (main): Likewise.
6703 * unexhp9k800.c (run_time_remap, save_data_space)
6704 (update_file_ptrs, read_header, write_header, calculate_checksum)
6705 (copy_file, copy_rest, display_header): Likewise.
6706 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
6708 * xdisp.c (check_it): Likewise.
6709 * xfaces.c (register_color, unregister_color, unregister_colors):
6711 * xfns.c (print_fontset_result): Likewise.
6712 * xrdb.c (member, fatal, main): Likewise.
6714 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
6716 Fix minor problems found by static checking (Bug#9031).
6717 * chartab.c (char_table_set_range, map_sub_char_table):
6718 Remove unused locals.
6719 (uniprop_table): Now static.
6720 * composite.c (_work_char): Remove unused static var.
6722 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
6724 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
6726 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
6728 * gtkutil.c (qttip_cb): Remove code without function.
6730 2011-07-09 Eli Zaretskii <eliz@gnu.org>
6732 * w32.c (pthread_sigmask): New stub.
6734 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
6736 Use pthread_sigmask, not sigprocmask (Bug#9010).
6737 sigprocmask is portable only for single-threaded applications, and
6738 Emacs can be multi-threaded when it uses GTK.
6739 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
6741 * callproc.c (Fcall_process):
6742 * process.c (create_process):
6743 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
6744 Use pthread_sigmask, not sigprocmask.
6746 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6748 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
6749 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
6752 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6754 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
6755 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
6756 (xg_hide_tooltip): Fix comment.
6758 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
6759 in registerServicesMenuSendTypes.
6760 (validRequestorForSendType): Don't check ns_return_types.
6762 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
6765 2011-07-08 Jason Rumney <jasonr@gnu.org>
6767 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
6768 SH_SHOW for hidden windows (Bug#5482).
6770 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
6771 frame struct members of non-existent frames (Bug#6284).
6773 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
6775 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
6776 variable firstTime not needed on OSX >= 10.6.
6777 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
6778 >= 10.5. Use setKnobProportion, setDoubleValue.
6780 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
6781 (MAC_OS_X_VERSION_10_5): Define if not defined.
6782 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
6783 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
6784 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
6786 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
6787 cString and lossyCString on OSX >= 10.4
6789 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
6790 sizeToFit on OSX >= 10.2.
6792 * nsimage.m (allocInitFromFile): Don't use deprecated method
6793 bestRepresentationForDevice on OSX >= 10.6.
6795 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
6798 * emacs.c: Declare unexec_init_emacs_zone.
6800 * nsgui.h: Fix compiler warning about gnulib redefining verify.
6802 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
6804 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
6805 on svcsMenu (Bug#8842).
6807 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
6809 (Fns_list_services): Just return Qnil on 10.6, code not working there.
6811 * nsterm.m (QUTF8_STRING): Declare.
6812 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
6813 (validRequestorForSendType): Return type is (id).
6814 Change indexOfObjectIdenticalTo to indexOfObject.
6815 Check if we have local selection before returning self (Bug#8842).
6816 (writeSelectionToPasteboard): Put local selection into paste board
6817 if we have a local selection (Bug#8842).
6818 (syms_of_nsterm): DEFSYM QUTF8_STRING.
6820 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
6821 (ns_get_local_selection): Declare.
6823 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
6825 * keymap.c (describe_map_tree): Don't insert a double newline at
6826 the end of the buffer (bug#1169) and return whether we inserted
6829 * callint.c (Fcall_interactively): Change "reading args" to
6830 "providing args" to try to clarify what it does (bug#1010).
6832 2011-07-07 Kenichi Handa <handa@m17n.org>
6834 * composite.c (composition_compute_stop_pos): Ignore a static
6835 composition starting before CHARPOS (Bug#8915).
6837 * xdisp.c (handle_composition_prop): Likewise.
6839 2011-07-07 Eli Zaretskii <eliz@gnu.org>
6841 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
6844 2011-07-07 Kenichi Handa <handa@m17n.org>
6846 * character.h (unicode_category_t): New enum type.
6848 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
6849 (Qchar_code_property_table): New variable.
6850 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
6851 (UNIPROP_COMPRESSED_FORM_P): New macros.
6852 (char_table_ascii): Uncompress the compressed values.
6853 (sub_char_table_ref): New arg is_uniprop. Callers changed.
6854 Uncompress the compressed values.
6855 (sub_char_table_ref_and_range): Likewise.
6856 (char_table_ref_and_range): Uncompress the compressed values.
6857 (sub_char_table_set): New arg is_uniprop. Callers changed.
6858 Uncompress the compressed values.
6859 (sub_char_table_set_range): Args changed. Callers changed.
6860 (char_table_set_range): Adjuted for the above change.
6861 (map_sub_char_table): Delete args default_val and parent. Add arg
6862 top. Give decoded values to a Lisp function.
6863 (map_char_table): Adjust for the above change. Give decoded
6864 values to a Lisp function. Gcpro more variables.
6865 (uniprop_table_uncompress)
6866 (uniprop_decode_value_run_length): New functions.
6867 (uniprop_decoder, uniprop_decoder_count): New variables.
6868 (uniprop_get_decoder, uniprop_encode_value_character)
6869 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
6871 (uniprop_encoder, uniprop_encoder_count): New variables.
6872 (uniprop_get_encoder, uniprop_table)
6873 (Funicode_property_table_internal, Fget_unicode_property_internal)
6874 (Fput_unicode_property_internal): New functions.
6875 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
6876 Sunicode_property_table_internal, Sget_unicode_property_internal,
6877 and Sput_unicode_property_internal. Defvar_lisp
6878 char-code-property-alist.
6880 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
6881 Vunicode_category_table.
6883 * font.c (font_range): Adjust for the change of
6884 Vunicode_category_table.
6886 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
6888 * m/iris4d.h: Remove file, move contents ...
6889 * s/irix6-5.h: ... here.
6891 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
6893 Remove unportable assumption about struct layout (Bug#8884).
6894 * alloc.c (mark_buffer):
6895 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
6896 (clone_per_buffer_values): Don't assume that
6897 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
6898 This isn't true in general, and it's particularly not true
6899 if Emacs is configured with --with-wide-int.
6900 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
6901 New macros, used in the buffer.c change.
6903 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
6905 * xsettings.c: Use both GConf and GSettings if both are available.
6906 (store_config_changed_event): Add comment.
6907 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
6908 (store_tool_bar_style_changed): New functions.
6909 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
6910 (struct xsettings): Move font inside HAVE_XFT.
6911 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
6912 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
6913 Move inside HAVE_XFT.
6914 (something_changed_gsettingsCB): Rename from something_changedCB.
6915 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
6917 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
6918 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
6919 (something_changed_gconfCB): Rename from something_changedCB.
6920 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
6921 (parse_settings): Move check for font inside HAVE_XFT.
6922 (read_settings, apply_xft_settings): Add comment.
6923 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
6924 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
6925 call store_font_name_changed.
6926 (xft_settings_event): Add comment.
6927 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
6928 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
6929 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
6930 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
6931 (xsettings_initialize): Call init_gsettings last.
6932 (xsettings_get_system_font, xsettings_get_system_normal_font):
6935 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
6937 Random fixes. E.g., (random) never returned negative values.
6938 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
6939 subseconds part to the entropy, as that's a bit more random.
6940 Prefer signed to unsigned, since the signedness doesn't matter and
6941 in general we prefer signed. When given a limit, use a
6942 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
6943 latter isn't right if USE_2_TAGS_FOR_INTS.
6944 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
6945 not 0..VALMASK. Don't discard "excess" bits that random () returns.
6947 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
6949 * textprop.c (text_property_stickiness):
6950 Obey Vtext_property_default_nonsticky.
6951 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
6952 * w32fns.c (syms_of_w32fns):
6953 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
6955 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
6957 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
6958 This is more efficient than Ffile_directory_p and avoids a minor race.
6960 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
6962 * buffer.c (Foverlay_put): Say what the return value is
6965 * fileio.c (barf_or_query_if_file_exists): Check first if the file
6966 is a directory before asking whether to use the file name
6968 (barf_or_query_if_file_exists): Make the "File is a directory"
6969 error be more correct.
6971 * fns.c (Frequire): Remove the mention of the .gz files, since
6972 that's installation-specific, but keep the mention of
6973 `get-load-suffixes'.
6975 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
6977 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
6978 Report string overflow if the output is too long.
6980 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
6982 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
6983 (syms_of_gnutls): Remove duplicate DEFSYM for
6984 Qgnutls_bootprop_verify_hostname_error, an error for
6985 Qgnutls_bootprop_verify_error (which is no longer used).
6987 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
6988 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
6989 Also (re)move comments that are misplaced or no longer relevant.
6991 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
6993 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
6995 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
6997 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
6998 and background color parameters if they have been changed.
7000 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
7002 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
7004 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
7006 * xsettings.c (SYSTEM_FONT): Define only when used.
7007 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
7009 * keymap.c (access_keymap_1): Now static.
7011 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
7013 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
7014 leave any prefix arg for the up event (Bug#1586).
7016 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
7018 * lread.c (syms_of_lread): Mention single symbols defined by
7019 `defvar' or `defconst' (bug#7154).
7021 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7022 (Frequire): Mention get-load-suffixes.
7024 2011-07-02 Martin Rudalics <rudalics@gmx.at>
7026 * window.h (window): Remove clone_number slot.
7027 * window.c (Fwindow_clone_number, Fset_window_clone_number):
7029 (make_parent_window, make_window, saved_window)
7030 (Fset_window_configuration, save_window_save): Don't deal with
7032 * buffer.c (Qclone_number): Remove declaration.
7033 (sort_overlays, overlay_strings): Don't deal with clone numbers.
7035 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
7037 Add multiple inheritance to keymaps.
7038 * keymap.c (Fmake_composed_keymap): New function.
7039 (Fset_keymap_parent): Simplify.
7040 (fix_submap_inheritance): Remove.
7041 (access_keymap_1): New function extracted from access_keymap to handle
7042 embedded parents and handle lists of maps.
7043 (access_keymap): Use it.
7044 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
7045 (Fcopy_keymap): Handle embedded parents.
7046 (Fcommand_remapping, define_as_prefix): Simplify.
7047 (Fkey_binding): Simplify.
7048 (syms_of_keymap): Move minibuffer-local-completion-map,
7049 minibuffer-local-filename-completion-map,
7050 minibuffer-local-must-match-map, and
7051 minibuffer-local-filename-must-match-map to Elisp.
7052 (syms_of_keymap): Defsubr make-composed-keymap.
7053 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
7054 (parse_menu_item): Trivial simplification.
7056 2011-07-01 Glenn Morris <rgm@gnu.org>
7058 * Makefile.in (SETTINGS_LIBS): Fix typo.
7060 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny patch)
7062 * coding.c (Fencode_coding_string): Record the last coding system
7063 used, as the function doc string says (bug#8738).
7065 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
7067 * xsettings.c (store_monospaced_changed): Take new font as arg and
7068 check for change against current_mono_font.
7069 (EMACS_TYPE_SETTINGS): Remove this and related defines.
7070 (emacs_settings_constructor, emacs_settings_get_property)
7071 (emacs_settings_set_property, emacs_settings_class_init)
7072 (emacs_settings_init, gsettings_obj): Remove.
7073 (something_changedCB): New function for HAVE_GSETTINGS.
7074 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
7075 with value as argument.
7076 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
7077 g_settings_new (Bug#8967). Do not create gsettings_obj.
7078 Remove calls to g_settings_bind. Connect something_changedCB to
7081 * xgselect.c: Add defined (HAVE_GSETTINGS).
7082 (xgselect_initialize): Ditto.
7084 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
7085 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
7088 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
7090 * eval.c (struct backtrace): Simplify and port the data structure.
7091 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
7092 signed bit field, as this assumption is not portable and it makes
7093 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
7094 "char debug_on_exit : 1" as this is not portable either; instead,
7095 use the portable "unsigned int debug_on_exit : 1". Remove unused
7096 member evalargs. Remove obsolete comments about cc bombing out.
7098 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
7100 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
7101 Let HAVE_GSETTINGS override HAVE_GCONF.
7102 (store_monospaced_changed): New function.
7103 (EMACS_SETTINGS): A new type derived from GObject to handle
7104 GSettings notifications.
7105 (emacs_settings_constructor, emacs_settings_get_property)
7106 (emacs_settings_set_property, emacs_settings_class_init):
7108 (gsettings_client, gsettings_obj): New variables.
7109 (GSETTINGS_SCHEMA): New define.
7110 (something_changedCB): Call store_monospaced_changed.
7111 (init_gsettings): New function.
7112 (xsettings_initialize): Call init_gsettings.
7113 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
7116 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
7119 2011-06-29 Martin Rudalics <rudalics@gmx.at>
7121 * window.c (resize_root_window, grow_mini_window)
7122 (shrink_mini_window): Rename Qresize_root_window to
7123 Qwindow_resize_root_window and Qresize_root_window_vertically to
7124 Qwindow_resize_root_window_vertically.
7126 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
7128 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
7130 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
7132 * makefile.w32-in: Redesign dependencies so they reflect more
7133 clearly which files are directly included by each source file,
7134 and not through other includes.
7136 2011-06-27 Martin Rudalics <rudalics@gmx.at>
7138 * buffer.c (Qclone_number): Declare static and DEFSYM it.
7139 (sort_overlays, overlay_strings): When an overlay's clone number
7140 matches the window's clone number process the overlay even if
7141 the overlay's window property doesn't match the current window.
7143 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
7144 (Fwindow_hchild): Rename to Fwindow_left_child.
7145 (Fwindow_next): Rename to Fwindow_next_sibling.
7146 (Fwindow_prev): Rename to Fwindow_prev_sibling.
7147 (resize_window_check): Rename to window_resize_check.
7148 (resize_window_apply): Rename to window_resize_apply.
7149 (Fresize_window_apply): Rename to Fwindow_resize_apply.
7150 (Fdelete_other_windows_internal, resize_frame_windows)
7151 (Fsplit_window_internal, Fdelete_window_internal)
7152 (grow_mini_window, shrink_mini_window)
7153 (Fresize_mini_window_internal): Fix callers accordingly.
7155 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
7157 * emacsgtkfixed.h: State that this is only used with Gtk+3.
7158 (emacs_fixed_set_min_size): Remove.
7159 (emacs_fixed_new): Take frame as argument.
7161 * emacsgtkfixed.c: State that this is only used with Gtk+3.
7162 (_EmacsFixedPrivate): Remove minwidth/height.
7163 Add struct frame *f.
7164 (emacs_fixed_init): Initialize priv->f.
7165 (get_parent_class, emacs_fixed_set_min_size): Remove.
7166 (emacs_fixed_new): Set priv->f to argument.
7167 (emacs_fixed_get_preferred_width)
7168 (emacs_fixed_get_preferred_height): Use min_width/height from
7169 frames size_hint to set minimum and natural (Bug#8919).
7170 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
7171 and use min_width/height from frames size_hint to set
7172 min_width/height (Bug#8919).
7174 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
7175 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
7178 2011-06-26 Eli Zaretskii <eliz@gnu.org>
7180 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
7181 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
7184 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
7186 * process.c (wait_reading_process_output): Bypass select if
7187 waiting for a cell while ignoring keyboard input, and input is
7188 pending. Suggested by Jan Djärv (Bug#8869).
7190 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
7192 Use gnulib's dup2 module instead of rolling our own.
7193 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
7195 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7197 * dispnew.c (scrolling_window): Before scrolling, turn off a
7198 mouse-highlight in the window being scrolled.
7200 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
7202 Move DEFSYM to lisp.h and use everywhere.
7204 * character.h (DEFSYM): Move declaration...
7205 * lisp.h (DEFSYM): ...here.
7211 * w32select.c: Don't include character.h.
7213 * alloc.c (syms_of_alloc):
7214 * buffer.c (syms_of_buffer):
7215 * bytecode.c (syms_of_bytecode):
7216 * callint.c (syms_of_callint):
7217 * casefiddle.c (syms_of_casefiddle):
7218 * casetab.c (init_casetab_once):
7219 * category.c (init_category_once, syms_of_category):
7220 * ccl.c (syms_of_ccl):
7221 * cmds.c (syms_of_cmds):
7222 * composite.c (syms_of_composite):
7223 * dbusbind.c (syms_of_dbusbind):
7224 * dired.c (syms_of_dired):
7225 * dispnew.c (syms_of_display):
7226 * doc.c (syms_of_doc):
7227 * editfns.c (syms_of_editfns):
7228 * emacs.c (syms_of_emacs):
7229 * eval.c (syms_of_eval):
7230 * fileio.c (syms_of_fileio):
7231 * fns.c (syms_of_fns):
7232 * frame.c (syms_of_frame):
7233 * fringe.c (syms_of_fringe):
7234 * insdel.c (syms_of_insdel):
7235 * keymap.c (syms_of_keymap):
7236 * lread.c (init_obarray, syms_of_lread):
7237 * macros.c (syms_of_macros):
7238 * msdos.c (syms_of_msdos):
7239 * print.c (syms_of_print):
7240 * process.c (syms_of_process):
7241 * search.c (syms_of_search):
7242 * sound.c (syms_of_sound):
7243 * syntax.c (init_syntax_once, syms_of_syntax):
7244 * terminal.c (syms_of_terminal):
7245 * textprop.c (syms_of_textprop):
7246 * undo.c (syms_of_undo):
7247 * w32.c (globals_of_w32):
7248 * window.c (syms_of_window):
7249 * xdisp.c (syms_of_xdisp):
7250 * xfaces.c (syms_of_xfaces):
7251 * xfns.c (syms_of_xfns):
7252 * xmenu.c (syms_of_xmenu):
7253 * xsettings.c (syms_of_xsettings):
7254 * xterm.c (syms_of_xterm): Use DEFSYM.
7256 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
7258 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
7260 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
7262 Integer and buffer overflow fixes (Bug#8873).
7264 * print.c (printchar, strout): Check for string overflow.
7265 (PRINTPREPARE, printchar, strout):
7266 Don't set size unless allocation succeeds.
7268 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
7269 for sizes. Check for string overflow more accurately.
7270 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
7272 * macros.c: Integer and buffer overflow fixes.
7273 * keyboard.h (struct keyboard.kbd_macro_bufsize):
7274 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
7275 Use ptrdiff_t, not int, for sizes.
7276 Don't increment bufsize until after realloc succeeds.
7277 Check for size-calculation overflow.
7278 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
7280 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
7282 * lread.c: Integer overflow fixes.
7283 (read_integer): Radix is now EMACS_INT, not int,
7284 to improve quality of diagnostics for out-of-range radices.
7285 Calculate buffer size correctly for out-of-range radices.
7286 (read1): Check for integer overflow in radices, and in
7287 read-circle numbers.
7288 (read_escape): Avoid int overflow.
7289 (Fload, openp, read_buffer_size, read1)
7290 (substitute_object_recurse, read_vector, read_list, map_obarray):
7291 Use ptrdiff_t, not int, for sizes.
7292 (read1): Use EMACS_INT, not int, for sizes.
7293 Check for size overflow.
7295 * image.c (cache_image): Check for size arithmetic overflow.
7297 * lread.c: Integer overflow issues.
7298 (saved_doc_string_size, saved_doc_string_length)
7299 (prev_saved_doc_string_size, prev_saved_doc_string_length):
7300 Now ptrdiff_t, not int.
7301 (read1): Don't assume doc string length fits in int. Check for
7302 out-of-range doc string lengths.
7303 (read_list): Don't assume file position fits in int.
7304 (read_escape): Check for hex character overflow.
7306 2011-06-22 Leo Liu <sdl.web@gmail.com>
7308 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
7309 Move to minibuffer.el.
7311 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
7313 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
7314 The following patches are for when GLYPH_DEBUG && !XASSERT.
7315 * dispextern.h (trace_redisplay_p, dump_glyph_string):
7316 * dispnew.c (flush_stdout):
7317 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
7318 Mark as externally visible.
7319 * dispnew.c (check_window_matrix_pointers): Now static.
7320 * dispnew.c (window_to_frame_vpos):
7321 * xfns.c (unwind_create_frame):
7322 * xterm.c (x_check_font): Remove unused local.
7323 * scroll.c (CHECK_BOUNDS):
7324 * xfaces.c (cache_fache): Rename local to avoid shadowing.
7325 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
7326 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
7327 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
7328 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
7330 (debug_method_add): Use va_list and vsprintf rather than relying
7331 on undefined behavior with wrong number of arguments.
7332 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
7333 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
7334 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
7335 since we're not interested in debugging glyphs with old libraries.
7336 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
7337 GCC 4.6.0's static checking.
7339 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
7341 Integer overflow and signedness fixes (Bug#8873).
7342 A few related buffer overrun fixes, too.
7344 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
7346 * dispextern.h (struct face.stipple):
7347 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
7348 (x_bitmap_mask, x_allocate_bitmap_record)
7349 (x_create_bitmap_from_data, x_create_bitmap_from_file)
7350 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
7351 (x_create_bitmap_from_xpm_data):
7352 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
7353 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
7355 * xfaces.c (load_pixmap):
7356 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
7357 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
7358 (.bitmaps_last, struct x_output.icon_bitmap):
7359 Use ptrdiff_t, not int, for bitmap indexes.
7360 (x_allocate_bitmap_record): Check for size overflow.
7361 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
7363 Use ptrdiff_t, not int, for overlay counts.
7364 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
7365 * editfns.c (overlays_around, get_pos_property):
7366 * textprop.c (get_char_property_and_overlay):
7367 * xdisp.c (next_overlay_change, note_mouse_highlight):
7368 * xfaces.c (face_at_buffer_position):
7369 * buffer.c (OVERLAY_COUNT_MAX): New macro.
7370 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
7371 (Fnext_overlay_change, Fprevious_overlay_change)
7372 (mouse_face_overlay_overlaps, Foverlays_in):
7373 Use ptrdiff_t, not int, for sizes.
7374 (overlays_at, overlays_in): Check for size-calculation overflow.
7376 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
7378 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
7379 (x_session_initialize): Do not assume string length fits in int.
7381 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
7382 This is unlikely, but can occur if DPI is outlandish.
7384 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
7385 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
7387 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
7388 * xrdb.c (magic_file_p, search_magic_path):
7389 Omit last arg SUFFIX; it was always 0. All callers changed.
7390 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
7392 * xfont.c (xfont_match): Avoid need for strlen.
7394 * xfns.c: Don't assume strlen fits in int.
7395 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
7397 * xdisp.c (message_log_check_duplicate): Return intmax_t,
7398 not unsigned long, as we prefer signed integers. All callers changed.
7399 Detect integer overflow in repeat count.
7400 (message_dolog): Don't assume print length fits in 39 bytes.
7401 (display_mode_element): Don't assume strlen fits in int.
7403 * termcap.c: Don't assume sizes fit in int and never overflow.
7404 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
7405 (gobble_line): Check for size-calculation overflow.
7407 * minibuf.c (Fread_buffer):
7408 * lread.c (intern, intern_c_string):
7409 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
7410 Don't assume string length fits in int.
7412 * keyboard.c (parse_tool_bar_item):
7413 * gtkutil.c (style_changed_cb): Avoid need for strlen.
7415 * font.c: Don't assume string length fits in int.
7416 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
7417 Use ptrdiff_t, not int.
7418 (font_intern_prop): Don't assume string length fits in int.
7419 Don't assume integer property fits in fixnum.
7420 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
7422 * filelock.c: Fix some buffer overrun and integer overflow issues.
7423 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
7424 Reformulate so as not to need the command string.
7425 Invoke gzip -cd rather than gunzip, as it's more portable.
7426 (lock_info_type, lock_file_1, lock_file):
7427 Don't assume pid_t and time_t fit in unsigned long.
7428 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
7429 (current_lock_owner): Prefer signed type for sizes.
7430 Use memcpy, not strncpy, where memcpy is what is really wanted.
7431 Don't assume (via atoi) that time_t and pid_t fit in int.
7432 Check for time_t and/or pid_t out of range, e.g., via a network share.
7433 Don't alloca where an auto var works fine.
7435 * fileio.c: Fix some integer overflow issues.
7436 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
7437 Don't assume string length fits in int.
7438 (directory_file_name): Don't assume string length fits in long.
7439 (make_temp_name): Don't assume pid fits in int, or that its print
7440 length is less than 20.
7442 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
7444 * coding.c (make_subsidiaries): Don't assume string length fits in int.
7446 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
7448 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
7449 We prefer signed integers, even for size calculations.
7451 * emacs.c: Don't assume string length fits in 'int'.
7452 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
7453 (main): Don't invoke strlen when not needed.
7455 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
7456 (XD_DEBUG_MESSAGE): Don't waste a byte.
7458 * callproc.c (getenv_internal_1, getenv_internal)
7460 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
7462 * lread.c (invalid_syntax): Omit length argument.
7463 All uses changed. This doesn't fix a bug, but it simplifies the
7464 code away from its former Hollerith-constant appearance, and it's
7465 one less 'int' to worry about when looking at integer-overflow issues.
7466 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
7468 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
7469 This didn't break anything, but it didn't help either.
7470 It's confusing to put a bogus integer in a place where the actual
7471 value does not matter.
7472 (LIST_END_P): Remove unused macro and its bogus comment.
7473 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
7475 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
7476 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
7478 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
7479 We prefer signed types, and the value cannot exceed the EMACS_INT
7480 range anyway (because otherwise the length would not be representable).
7481 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
7482 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
7483 This avoids a GCC warning when WIDE_EMACS_INT.
7485 * indent.c (sane_tab_width): New function.
7486 (current_column, scan_for_column, Findent_to, position_indentation)
7487 (compute_motion): Use it. This is just for clarity.
7488 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
7490 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
7492 * lisp.h (lint_assume): New macro.
7493 * composite.c (composition_gstring_put_cache):
7494 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
7496 * editfns.c, insdel.c:
7497 Omit unnecessary forward decls, to simplify future changes.
7499 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
7501 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
7503 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
7504 Use much-faster test for byte-length change.
7505 Don't assume string byte-length fits in 'int'.
7506 Check that character arg fits in 'int'.
7507 (mapcar1): Declare byte as byte, for clarity.
7509 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
7511 * fns.c (concat): Catch string overflow earlier.
7512 Do not rely on integer wraparound.
7514 * dispextern.h (struct it.overlay_strings_charpos)
7515 (struct it.selective): Now EMACS_INT, not int.
7516 * xdisp.c (forward_to_next_line_start)
7517 (back_to_previous_visible_line_start)
7518 (reseat_at_next_visible_line_start, next_element_from_buffer):
7519 Don't arbitrarily truncate the value of 'selective' to int.
7521 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
7523 * composite.c: Don't truncate sizes to 'int'.
7524 (composition_gstring_p, composition_reseat_it)
7525 (composition_adjust_point): Use EMACS_INT, not int.
7526 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
7527 not EMACS_UINT, for indexes.
7529 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
7531 * buffer.c: Include <verify.h>.
7532 (struct sortvec.priority, struct sortstr.priority):
7533 Now EMACS_INT, not int.
7534 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
7535 (struct sortstr.size, record_overlay_string)
7536 (struct sortstrlist.size, struct sortlist.used):
7537 Don't truncate size to int.
7538 (record_overlay_string): Check for size-calculation overflow.
7539 (init_buffer_once): Check at compile-time, not run-time.
7541 2011-06-22 Jim Meyering <meyering@redhat.com>
7543 Don't leak an XBM-image-sized buffer
7544 * image.c (xbm_load): Free the image buffer after using it.
7546 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
7549 * composite.c (find_automatic_composition): Omit needless 'return 0;'
7550 that Sun C diagnosed.
7551 * fns.c (secure_hash): Fix pointer signedness issue.
7552 * intervals.c (static_offset_intervals): New function.
7553 (offset_intervals): Use it.
7555 2011-06-21 Leo Liu <sdl.web@gmail.com>
7558 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
7561 * fns.c (secure_hash): Rename from crypto_hash_function and change
7562 the first arg to accept symbols.
7563 (Fsecure_hash): New primitive.
7564 (syms_of_fns): New symbols.
7566 2011-06-20 Deniz Dogan <deniz@dogan.se>
7568 * process.c (Fset_process_buffer): Clarify return value in
7571 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
7573 * dispnew.c (add_window_display_history): Use BVAR.
7575 * xdisp.c (debug_method_add): Use BVAR.
7576 (check_window_end, dump_glyph_matrix, dump_glyph)
7577 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
7579 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
7582 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
7583 check till after the cache is created in init_frame_faces.
7585 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
7587 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
7589 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
7591 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
7592 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
7593 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
7595 Improve buffer-overflow checking (Bug#8873).
7596 * fileio.c (Finsert_file_contents):
7597 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
7598 Remove the old (too-loose) buffer overflow checks.
7599 They weren't needed, since make_gap checks for buffer overflow.
7600 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
7601 The old code merely checked for Emacs fixnum overflow, and relied
7602 on undefined (wraparound) behavior. The new code avoids undefined
7603 behavior, and also checks for ptrdiff_t and/or size_t overflow.
7605 * editfns.c (Finsert_char): Don't dump core with very negative counts.
7606 Tune. Don't use wider integers than needed. Don't use alloca.
7607 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
7609 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
7611 * insdel.c, lisp.h (buffer_overflow): New function.
7612 (insert_from_buffer_1, replace_range, replace_range_2):
7613 * insdel.c (make_gap_larger):
7614 * editfns.c (Finsert_char):
7615 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
7617 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
7619 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
7621 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
7623 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
7624 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
7626 * fileio.c: Don't assume EMACS_INT fits in off_t.
7627 (emacs_lseek): New static function.
7628 (Finsert_file_contents, Fwrite_region): Use it.
7629 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
7631 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
7633 * fns.c: Don't overflow int when computing a list length.
7634 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
7635 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
7636 truncation on 64-bit hosts. Check for QUIT every
7637 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
7638 faster and is responsive enough.
7639 (Flength): Report an error instead of overflowing an integer.
7640 (Fsafe_length): Return a float if the value is not representable
7641 as a fixnum. This shouldn't happen except in contrived situations.
7642 (Fnthcdr, Fsort): Don't assume list length fits in int.
7643 (Fcopy_sequence): Don't assume vector length fits in int.
7645 * alloc.c: Check that resized vectors' lengths fit in fixnums.
7646 (header_size, word_size): New constants.
7647 (allocate_vectorlike): Don't check size overflow here.
7648 (allocate_vector): Check it here instead, since this is the only
7649 caller of allocate_vectorlike that could cause overflow.
7650 Check that the new vector's length is representable as a fixnum.
7652 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
7653 The previous code was bogus. For example, next_almost_prime (32)
7654 returned 39, which is undesirable as it is a multiple of 3; and
7655 next_almost_prime (24) returned 25, which is a multiple of 5 so
7656 why was the code bothering to check for multiples of 7?
7658 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
7660 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
7662 Variadic C functions now count arguments with ptrdiff_t.
7663 This partly undoes my 2011-03-30 change, which replaced int with size_t.
7664 Back then I didn't know that the Emacs coding style prefers signed int.
7665 Also, in the meantime I found a few more instances where arguments
7666 were being counted with int, which may truncate counts on 64-bit
7667 machines, or EMACS_INT, which may be unnecessarily wide.
7668 * lisp.h (struct Lisp_Subr.function.aMANY)
7669 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
7670 Arg counts are now ptrdiff_t, not size_t.
7671 All variadic functions and their callers changed accordingly.
7672 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
7673 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
7674 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
7675 * callint.c (Fcall_interactively): Check arg count for overflow,
7676 to avoid potential buffer overrun. Use signed char, not 'int',
7677 for 'varies' array, so that we needn't bother to check its size
7678 calculation for overflow.
7679 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
7680 * eval.c (apply_lambda):
7681 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
7682 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
7683 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
7685 * callint.c (Fcall_interactively): Don't use index var as event count.
7687 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
7688 * mem-limits.h (SIZE): Remove; no longer used.
7690 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
7692 Remove unnecessary casts.
7693 * xterm.c (x_term_init):
7694 * xfns.c (x_set_border_pixel):
7695 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
7696 These aren't needed now that we assume ANSI C.
7698 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
7699 It's more likely to cause problems (due to unsigned overflow)
7702 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
7704 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
7706 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
7708 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
7710 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
7712 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
7714 GLYPH_CODE_FACE returns EMACS_INT, not int.
7715 * dispextern.h (merge_faces):
7716 * xfaces.c (merge_faces):
7717 * xdisp.c (get_next_display_element, next_element_from_display_vector):
7718 Don't assume EMACS_INT fits in int.
7720 * character.h (CHAR_VALID_P): Remove unused parameter.
7721 * fontset.c, lisp.h, xdisp.c: All uses changed.
7723 * editfns.c (Ftranslate_region_internal): Omit redundant test.
7725 * fns.c (concat): Minor tuning based on overflow analysis.
7726 This doesn't fix any bugs. Use int to hold character, instead
7727 of constantly refetching from Emacs object. Use XFASTINT, not
7728 XINT, for value known to be a character. Don't bother comparing
7729 a single byte to 0400, as it's always less.
7731 * floatfns.c (Fexpt):
7732 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
7734 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
7737 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
7739 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
7740 Without this fix, on a 64-bit host (aset S 0 4294967386) would
7741 incorrectly succeed when S was a string, because 4294967386 was
7742 truncated before it was used.
7744 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
7745 Otherwise, an out-of-range integer could cause undefined behavior
7748 * composite.c: Use int, not EMACS_INT, for characters.
7749 (fill_gstring_body, composition_compute_stop_pos): Use int, not
7750 EMACS_INT, for values that are known to be in character range.
7751 This doesn't fix any bugs but is the usual style inside Emacs and
7752 may generate better code on 32-bit machines.
7754 Make sure a 64-bit char is never passed to ENCODE_CHAR.
7755 This is for reasons similar to the recent CHAR_STRING fix.
7756 * charset.c (Fencode_char): Check that character arg is actually
7757 a character. Pass an int to ENCODE_CHAR.
7758 * charset.h (ENCODE_CHAR): Verify that the character argument is no
7759 wider than 'int', as a compile-time check to prevent future regressions
7762 * character.c (char_string): Remove unnecessary casts.
7764 Make sure a 64-bit char is never passed to CHAR_STRING.
7765 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
7766 by silently ignoring the top 32 bits, allowing some values
7767 that were far too large to be valid characters.
7768 * character.h: Include <verify.h>.
7769 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
7770 arguments are no wider than unsigned, as a compile-time check
7771 to prevent future regressions in this area.
7773 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
7774 (Fsubst_char_in_region):
7776 * xdisp.c (decode_mode_spec_coding):
7777 Adjust to CHAR_STRING's new requirement.
7778 * editfns.c (Finsert_char, Fsubst_char_in_region):
7779 * fns.c (concat): Check that character args are actually
7780 characters. Without this test, these functions did the wrong
7781 thing with wildly out-of-range values on 64-bit hosts.
7783 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
7784 These casts should not be needed on 32-bit hosts, either.
7785 * keyboard.c (read_char):
7786 * lread.c (Fload): Remove casts to unsigned.
7788 * lisp.h (UNSIGNED_CMP): New macro.
7789 This fixes comparison bugs on 64-bit hosts.
7790 (ASCII_CHAR_P): Use it.
7791 * casefiddle.c (casify_object):
7792 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
7793 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
7794 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
7795 * dispextern.h (FACE_FROM_ID):
7796 * keyboard.c (read_char): Use UNSIGNED_CMP.
7798 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
7799 not to EMACS_INT, to avoid GCC warning.
7801 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
7803 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
7804 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
7805 isn't needed on 32-bit machines.
7807 * buffer.c (Fgenerate_new_buffer_name):
7808 Use EMACS_INT for count, not int.
7809 (advance_to_char_boundary): Return EMACS_INT, not int.
7811 * data.c (Qcompiled_function): Now static.
7813 * window.c (window_body_lines): Now static.
7815 * image.c (gif_load): Rename local to avoid shadowing.
7817 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
7818 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
7819 * alloc.c (make_save_value): Integer argument is now of type
7821 (mark_object): Use ptrdiff_t, not int.
7822 * lisp.h (pD): New macro.
7823 * print.c (print_object): Use it.
7825 * alloc.c: Use EMACS_INT, not int, to count objects.
7826 (total_conses, total_markers, total_symbols, total_vector_size)
7827 (total_free_conses, total_free_markers, total_free_symbols)
7828 (total_free_floats, total_floats, total_free_intervals)
7829 (total_intervals, total_strings, total_free_strings):
7830 Now EMACS_INT, not int. All uses changed.
7831 (Fgarbage_collect): Compute overall total using a double, so that
7832 integer overflow is less likely to be a problem. Check for overflow
7833 when converting back to an integer.
7834 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
7835 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
7836 These were 'int' variables that could overflow on 64-bit hosts;
7837 they were never used, so remove them instead of repairing them.
7838 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
7839 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
7840 Previously, this ceilinged at INT_MAX, but that doesn't work on
7842 (allocate_pseudovector): Don't use EMACS_INT when int would do.
7844 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
7845 (allocate_vectorlike): Check for ptrdiff_t overflow.
7846 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
7847 when a (possibly-narrower) signed value would do just as well.
7848 We prefer using signed arithmetic, to avoid comparison confusion.
7850 * alloc.c: Catch some string size overflows that we were missing.
7851 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
7852 for convenience in STRING_BYTES_MAX.
7853 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
7854 The definition here is exact; the one in lisp.h was approximate.
7855 (allocate_string_data): Check for string overflow. This catches
7856 some instances we weren't catching before. Also, it catches
7857 size_t overflow on (unusual) hosts where SIZE_MAX <= min
7858 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
7859 and ptrdiff_t and EMACS_INT are both 64 bits.
7861 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
7862 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
7863 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
7865 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
7867 * alloc.c (Fmake_string): Check for out-of-range init.
7869 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
7871 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
7873 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
7875 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
7876 xg_get_default_scrollbar_width.
7878 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
7879 (int_gtk_range_get_value): Move to the scroll bar part of the file.
7880 (style_changed_cb): Call update_theme_scrollbar_width and call
7881 x_set_scroll_bar_default_width and xg_frame_set_char_size for
7882 all frames (Bug#8505).
7883 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
7884 Call gtk_window_set_resizable if HAVE_GTK3.
7885 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
7886 and height if HAVE_GTK3 (Bug#8505).
7887 (scroll_bar_width_for_theme): New variable.
7888 (update_theme_scrollbar_width): New function.
7889 (xg_get_default_scrollbar_width): Move code to
7890 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
7891 (xg_initialize): Call update_theme_scrollbar_width.
7893 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
7895 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
7897 2011-06-12 Martin Rudalics <rudalics@gmx.at>
7899 * frame.c (make_frame): Call other_buffer_safely instead of
7902 * window.c (temp_output_buffer_show): Call display_buffer with
7903 second argument Vtemp_buffer_show_specifiers and reset latter
7904 immediately after the call.
7905 (Vtemp_buffer_show_specifiers): New variable.
7906 (auto_window_vscroll_p, next_screen_context_lines)
7907 (Vscroll_preserve_screen_position): Remove leading asterisks from
7910 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
7912 Fix minor problems found by GCC 4.6.0 static checking.
7913 * buffer.c (Qclone_number): Remove for now, as it's unused.
7914 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
7915 (record_buffer): Remove unused local.
7916 * frame.c (other_visible_frames, frame_buffer_list): Now static.
7917 (set_frame_buffer_list): Remove; unused.
7918 * frame.h (other_visible_frames): Remove decl.
7919 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
7920 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
7921 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
7923 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
7924 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
7925 Define only if HAVE_GPM.
7926 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
7927 (update_hints_inhibit): Remove; never set. All uses removed.
7928 * widgetprv.h (emacsFrameClassRec): Remove decl.
7929 * window.c (delete_deletable_window): Now returns void, since it
7930 wasn't returning anything.
7931 (compare_window_configurations): Remove unused locals.
7932 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
7933 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
7934 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
7935 the same widths as pointers. This follows up on the 2011-05-06 patch.
7936 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
7937 * xterm.h: Likewise.
7938 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
7940 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
7942 * makefile.w32-in: Update dependencies.
7943 (LISP_H): Add lib/intprops.h.
7945 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
7947 * image.c (gif_load): Add animation frame delay to the metadata.
7948 (syms_of_image): Use DEFSYM. New symbol `delay'.
7950 2011-06-11 Martin Rudalics <rudalics@gmx.at>
7952 * window.c (delete_deletable_window): Re-add.
7953 (Fset_window_configuration): Rewrite to handle dead buffers and
7954 consequently deletable windows.
7955 (window_tree, Fwindow_tree): Remove. Supply functionality in
7957 (compare_window_configurations): Simplify code.
7959 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
7961 * image.c (imagemagick_load_image): Fix type mismatch.
7962 (Fimagemagick_types): Likewise.
7964 * window.h (replace_buffer_in_windows): Declare.
7966 2011-06-11 Martin Rudalics <rudalics@gmx.at>
7968 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
7969 Qclone_number. Remove external declaration of Qdelete_window.
7970 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
7972 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
7973 Run Qbuffer_list_update_hook if allowed.
7974 (Fother_buffer): Rewrite doc-string. Major rewrite for new
7975 buffer list implementation.
7976 (other_buffer_safely): New function.
7977 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
7978 calls to replace_buffer_in_windows and
7979 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
7981 (record_buffer): Inhibit quitting and rewrite using quittable
7982 functions. Run Qbuffer_list_update_hook if allowed.
7983 (Frecord_buffer, Funrecord_buffer): New functions.
7984 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
7985 Move switch-to-buffer to window.el.
7986 (bury-buffer): Move to window.el.
7987 (Vbuffer_list_update_hook): New variable.
7989 * lisp.h (other_buffer_safely): Add prototype in buffer.c
7992 * window.h (resize_frame_windows): Move up in code.
7993 (Fwindow_frame): Remove EXFUN.
7994 (replace_buffer_in_all_windows): Remove prototype.
7995 (replace_buffer_in_windows_safely): Add prototype.
7997 * window.c: Declare Qdelete_window static again. Move down
7998 declaration of select_count.
7999 (Fnext_window, Fprevious_window): Rewrite doc-strings.
8000 (Fother_window): Move to window.el.
8001 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
8002 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
8003 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
8005 (replace_buffer_in_windows): Implement by calling
8006 Qreplace_buffer_in_windows.
8007 (replace_buffer_in_all_windows): Remove with some functionality
8008 moved into replace_buffer_in_windows_safely.
8009 (replace_buffer_in_windows_safely): New function.
8010 (select_window_norecord, select_frame_norecord): Move in front
8011 of run_window_configuration_change_hook. Remove now obsolete
8013 (Fset_window_buffer): Rewrite doc-string.
8014 Call Qrecord_window_buffer.
8015 (keys_of_window): Move binding for other-window to window.el.
8017 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
8019 * dispextern.h (struct image): Replace data member, whose int_val
8020 and ptr_val fields were not used by anything, with a single
8023 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
8024 (gif_clear_image, gif_load, imagemagick_load_image)
8025 (gs_clear_image, gs_load): Callers changed.
8027 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
8029 * buffer.h: Include <time.h>, for time_t.
8030 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
8032 Fix minor problems found by static checking.
8034 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
8036 Make identifiers static if they are not used in other modules.
8037 * data.c (Qcompiled_function, Qframe, Qvector):
8038 * image.c (QimageMagick, Qsvg):
8039 * minibuf.c (Qmetadata):
8040 * window.c (resize_window_check, resize_root_window): Now static.
8041 * window.h (resize_window_check, resize_root_window): Remove decls.
8043 * window.c (window_deletion_count, delete_deletable_window):
8045 (window_body_lines): Now static.
8046 (Fdelete_other_windows_internal): Mark vars as initialized.
8047 Make sure 'resize_failed' is initialized.
8048 (run_window_configuration_change_hook): Rename local to avoid shadowing.
8049 (resize_window_apply): Remove unused local.
8050 * window.h (delete_deletable_window): Remove decl.
8052 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
8053 (imagemagick_load_image): Fix pointer signedness problem by changing
8054 last arg from unsigned char * to char *. All uses changed.
8055 Also, fix a local for similar reasons.
8056 Remove unused locals. Remove locals to avoid shadowing.
8057 (fn_rsvg_handle_free): Remove; unused.
8058 (svg_load, svg_load_image): Fix pointer signedness problem.
8059 (imagemagick_load_image): Don't use garbage pointer image_wand.
8061 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
8063 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
8065 * image.c (gif_load): Fix omitted cast error introduced by
8068 2011-06-10 Martin Rudalics <rudalics@gmx.at>
8070 * window.h (resize_proportionally, orig_total_lines)
8071 (orig_top_line): Remove from window structure.
8072 (set_window_height, set_window_width, change_window_heights)
8073 (Fdelete_window): Remove prototypes.
8074 (resize_frame_windows): Remove duplicate declaration.
8076 2011-06-10 Eli Zaretskii <eliz@gnu.org>
8078 * window.h (resize_frame_windows, resize_window_check)
8079 (delete_deletable_window, resize_root_window)
8080 (resize_frame_windows): Declare prototypes.
8082 * window.c (resize_window_apply): Make definition be "static" to
8083 match the prototype.
8085 2011-06-10 Martin Rudalics <rudalics@gmx.at>
8087 * window.c: Remove declarations of Qwindow_size_fixed,
8088 window_min_size_1, window_min_size_2, window_min_size,
8089 size_window, window_fixed_size_p, enlarge_window, delete_window.
8090 Remove static from declaration of Qdelete_window, it's
8091 temporarily needed by Fbury_buffer.
8092 (replace_window): Don't assign orig_top_line and
8094 (Fdelete_window, delete_window): Remove. Window deletion is
8095 handled by window.el.
8096 (window_loop): Remove DELETE_OTHER_WINDOWS case.
8097 Replace Fdelete_window calls with calls to Qdelete_window.
8098 (Fdelete_other_windows): Remove. Deleting other windows is
8099 handled by window.el.
8100 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
8101 handled in window.el.
8102 (window_min_size_2, window_min_size_1, window_min_size): Remove.
8103 Window minimum sizes are handled in window.el.
8104 (shrink_windows, size_window, set_window_height)
8105 (set_window_width, change_window_heights, window_height)
8106 (window_width, CURBEG, CURSIZE, enlarge_window)
8107 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
8108 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
8109 handled in window.el.
8110 (make_dummy_parent): Rename to make_parent_window and give it a
8111 second argument horflag.
8112 (make_window): Don't set resize_proportionally any more.
8113 (Fsplit_window): Remove. Windows are split in window.el.
8114 (save_restore_action, save_restore_orig_size)
8115 (shrink_window_lowest_first, save_restore_orig_size): Remove.
8116 Resize mini windows in window.el.
8117 (grow_mini_window, shrink_mini_window): Implement by calling
8118 Qresize_root_window_vertically, resize_window_check and
8119 resize_window_apply.
8120 (saved_window, Fset_window_configuration, save_window_save):
8121 Do not handle orig_top_line, orig_total_lines, and
8122 resize_proportionally.
8123 (window_min_height, window_min_width): Move to window.el.
8124 (keys_of_window): Move bindings for delete-other-windows,
8125 split-window, delete-window and enlarge-window to window.el.
8127 * buffer.c: Temporarily extern Qdelete_window.
8128 (Fbury_buffer): Temporarily call Qdelete_window instead of
8129 Fdelete_window (Fbury_buffer will move to window.el soon).
8131 * frame.c (set_menu_bar_lines_1): Remove code handling
8132 orig_top_line and orig_total_lines.
8134 * dispnew.c (adjust_frame_glyphs_initially): Don't use
8135 set_window_height but set heights directly.
8136 (change_frame_size_1): Use resize_frame_windows.
8138 * xdisp.c (init_xdisp): Don't use set_window_height but set
8141 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
8142 Use resize_frame_windows instead of change_window_heights and run
8143 run_window_configuration_change_hook.
8145 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
8146 instead of change_window_heights and run
8147 run_window_configuration_change_hook.
8149 2011-06-09 Martin Rudalics <rudalics@gmx.at>
8151 * window.c (replace_window): Rename second argument REPLACEMENT to
8152 NEW. New third argument SETFLAG. Rewrite.
8153 (delete_window, make_dummy_parent): Call replace_window with
8155 (window_list_1): Move down in code.
8156 (run_window_configuration_change_hook): Move set_buffer part
8157 before select_frame_norecord part in order to unwind correctly.
8158 Rename count1 to count.
8159 (recombine_windows, delete_deletable_window, resize_root_window)
8160 (Fdelete_other_windows_internal)
8161 (Frun_window_configuration_change_hook, make_parent_window)
8162 (resize_window_check, resize_window_apply, Fresize_window_apply)
8163 (resize_frame_windows, Fsplit_window_internal)
8164 (Fdelete_window_internal, Fresize_mini_window_internal):
8166 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
8168 2011-06-08 Martin Rudalics <rudalics@gmx.at>
8170 * window.h (window): Add some new members to window structure -
8171 normal_lines, normal_cols, new_total, new_normal, clone_number,
8172 splits, nest, prev_buffers, next_buffers.
8173 (WINDOW_TOTAL_SIZE): Move here from window.c.
8174 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
8176 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
8178 (make_dummy_parent): Set new members of windows structure.
8179 (make_window): Move down in code. Handle new members of window
8181 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
8182 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
8183 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
8184 (Fset_window_prev_buffers, Fwindow_next_buffers)
8185 (Fset_window_next_buffers, Fset_window_clone_number):
8187 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
8188 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
8190 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
8191 Argument WINDOW can be now internal window too.
8192 (Fwindow_use_time): Move up in code.
8193 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
8195 (Fset_window_configuration, saved_window)
8196 (Fcurrent_window_configuration, save_window_save): Handle new
8197 members of window structure.
8198 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
8199 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
8200 (syms_of_window): New Lisp objects Qrecord_window_buffer,
8201 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
8202 Qget_mru_window, Qresize_root_window,
8203 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
8204 Qauto_buffer_name; staticpro them.
8206 2011-06-07 Martin Rudalics <rudalics@gmx.at>
8208 * window.c (Fwindow_total_size, Fwindow_left_column)
8209 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
8210 (Fwindow_list_1): New functions.
8211 (window_box_text_cols): Replace with window_body_cols.
8212 (Fwindow_width, Fscroll_left, Fscroll_right):
8213 Use window_body_cols instead of window_box_text_cols.
8214 (delete_window, Fset_window_configuration):
8215 Call delete_all_subwindows with window as argument.
8216 (delete_all_subwindows): Take a window as argument and not a
8218 (window_loop): Remove handling of GET_LRU_WINDOW and
8220 (Fget_lru_window, Fget_largest_window): Move to window.el.
8222 * window.h: Extern window_body_cols instead of
8223 window_box_text_cols. delete_all_subwindows now takes a
8224 Lisp_Object as argument.
8226 * indent.c (compute_motion, Fcompute_motion):
8227 Use window_body_cols instead of window_box_text_cols.
8229 * frame.c (delete_frame): Call delete_all_subwindows with root
8232 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
8234 * fns.c (Fputhash): Document return value.
8236 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
8238 * image.c (gif_load): Implement gif89a spec "no disposal" method.
8240 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8242 Cons<->int and similar integer overflow fixes (Bug#8794).
8244 Check for overflow when converting integer to cons and back.
8245 * charset.c (Fdefine_charset_internal, Fdecode_char):
8246 Use cons_to_unsigned to catch overflow.
8247 (Fencode_char): Use INTEGER_TO_CONS.
8248 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
8249 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
8250 * data.c (long_to_cons, cons_to_long): Remove.
8251 (cons_to_unsigned, cons_to_signed): New functions.
8252 These signal an error for invalid or out-of-range values.
8253 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
8254 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
8255 * font.c (Ffont_variation_glyphs):
8256 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
8257 * lisp.h: Include <intprops.h>.
8258 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
8259 (cons_to_signed, cons_to_unsigned): New decls.
8260 (long_to_cons, cons_to_long): Remove decls.
8261 * undo.c (record_first_change): Use INTEGER_TO_CONS.
8262 (Fprimitive_undo): Use CONS_TO_INTEGER.
8263 * xfns.c (Fx_window_property): Likewise.
8264 * xselect.c: Include <limits.h>.
8265 (x_own_selection, selection_data_to_lisp_data):
8266 Use INTEGER_TO_CONS.
8267 (x_handle_selection_request, x_handle_selection_clear)
8268 (x_get_foreign_selection, Fx_disown_selection_internal)
8269 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
8270 (lisp_data_to_selection_data): Use cons_to_unsigned.
8271 (x_fill_property_data): Use cons_to_signed.
8272 Report values out of range.
8274 Check for buffer and string overflow more precisely.
8275 * buffer.h (BUF_BYTES_MAX): New macro.
8276 * lisp.h (STRING_BYTES_MAX): New macro.
8277 * alloc.c (Fmake_string):
8278 * character.c (string_escape_byte8):
8279 * coding.c (coding_alloc_by_realloc):
8280 * doprnt.c (doprnt):
8281 * editfns.c (Fformat):
8283 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
8284 since they may not be the same number.
8285 * editfns.c (Finsert_char):
8286 * fileio.c (Finsert_file_contents):
8287 Likewise for BUF_BYTES_MAX.
8289 * image.c: Use ptrdiff_t, not int, for sizes.
8290 (slurp_file): Switch from int to ptrdiff_t.
8292 (slurp_file): Check that file size fits in both size_t (for
8293 malloc) and ptrdiff_t (for sanity and safety).
8295 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
8296 if b->modtime has its maximal value.
8298 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
8300 Don't assume time_t can fit into int.
8301 * buffer.h (struct buffer.modtime): Now time_t, not int.
8302 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
8303 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
8305 Minor fixes for signed vs unsigned integers.
8306 * character.h (MAYBE_UNIFY_CHAR):
8307 * charset.c (maybe_unify_char):
8308 * keyboard.c (read_char, reorder_modifiers):
8309 XINT -> XFASTINT, since the integer must be nonnegative.
8310 * ftfont.c (ftfont_spec_pattern):
8311 * keymap.c (access_keymap, silly_event_symbol_error):
8312 XUINT -> XFASTINT, since the integer must be nonnegative.
8313 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
8314 since it makes no difference and we prefer signed.
8315 * keyboard.c (record_char): Use XUINT when all the neighbors do.
8316 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
8319 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
8321 * window.h (Fwindow_frame): Declare.
8323 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8325 * alloc.c: Simplify handling of large-request failures (Bug#8800).
8326 (SPARE_MEMORY): Always define.
8327 (LARGE_REQUEST): Remove.
8328 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
8330 2011-06-06 Martin Rudalics <rudalics@gmx.at>
8332 * lisp.h: Move EXFUNS for Fframe_root_window,
8333 Fframe_first_window and Fset_frame_selected_window to window.h.
8335 * window.h: Move EXFUNS for Fframe_root_window,
8336 Fframe_first_window and Fset_frame_selected_window here from
8339 * frame.c (Fwindow_frame, Fframe_first_window)
8340 (Fframe_root_window, Fframe_selected_window)
8341 (Fset_frame_selected_window): Move to window.c.
8342 (Factive_minibuffer_window): Move to minibuf.c.
8343 (Fother_visible_frames_p): New function.
8345 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
8347 * window.c (decode_window, decode_any_window): Move up in code.
8348 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
8349 (inhibit_frame_unsplittable): Remove unused variable.
8350 (Fwindow_buffer): Move up and rewrite doc-string.
8351 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
8352 (Fwindow_prev): New functions.
8353 (Fwindow_frame): Move here from frame.c. Accept any window as
8355 (Fframe_root_window, Fframe_first_window)
8356 (Fframe_selected_window): Move here from frame.c. Accept frame
8357 or arbitrary window as argument. Update doc-strings.
8358 (Fminibuffer_window): Move up in code.
8359 (Fwindow_minibuffer_p): Move up in code and simplify.
8360 (Fset_frame_selected_window): Move here from frame.c.
8362 (Fselected_window, select_window, Fselect_window): Move up in
8363 code. Minor doc-string fixes.
8365 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
8367 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
8368 Do not assume that spare memory exists; that assumption is valid
8369 only if SYSTEM_MALLOC.
8370 (LARGE_REQUEST): New macro, so that the issue of large requests
8371 is separated from the issue of spare memory.
8373 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
8375 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
8378 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
8380 * xfns.c (x_set_scroll_bar_default_width): Move declarations
8383 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
8385 * gtkutil.c (xg_get_default_scrollbar_width): New function.
8387 * gtkutil.h: Declare xg_get_default_scrollbar_width.
8389 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
8390 min width by calling x_set_scroll_bar_default_width (Bug#8505).
8392 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
8394 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
8396 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
8398 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
8399 (x_clipboard_manager_save): Add return value.
8400 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
8402 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
8403 Obey Vx_select_enable_clipboard_manager. Catch errors in
8404 x_clipboard_manager_save (Bug#8779).
8405 (Vx_select_enable_clipboard_manager): New variable.
8406 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
8408 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8410 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
8412 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8414 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
8415 in the current matrix if keep_current_p is non-zero.
8417 2011-06-04 Eli Zaretskii <eliz@gnu.org>
8419 * bidi.c (bidi_level_of_next_char): Fix last change.
8421 2011-06-03 Eli Zaretskii <eliz@gnu.org>
8423 Support bidi reordering of text covered by display properties.
8425 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
8426 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
8427 (bidi_cache_search, bidi_cache_iterator_state)
8428 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
8429 (bidi_level_of_next_char, bidi_move_to_visually_next):
8430 Support character positions inside a run of characters covered by a
8432 (bidi_paragraph_init, bidi_resolve_explicit_1)
8433 (bidi_level_of_next_char): Call bidi_fetch_char and
8434 bidi_fetch_char_advance instead of FETCH_CHAR and
8436 (bidi_init_it): Initialize new members.
8437 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
8439 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
8440 instead of using explicit *_CHAR codes.
8441 (bidi_resolve_explicit, bidi_resolve_weak):
8442 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
8443 bidirectional text is supported only in multibyte buffers.
8444 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
8445 it to initialize the frame_window_p member of struct bidi_it.
8446 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
8447 (bidi_resolve_explicit, bidi_resolve_weak)
8448 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
8449 bidi_it->nchars is non-positive.
8450 (bidi_level_of_next_char): Don't try to lookup the cache for the
8451 next/previous character if nothing is cached there yet, or if we
8452 were just reseat()'ed to a new position.
8454 * xdisp.c (set_cursor_from_row): Set start and stop points
8455 according to the row's direction when priming the loop that looks
8456 for the glyph on which to display cursor.
8457 (single_display_spec_intangible_p): Function deleted.
8458 (display_prop_intangible_p): Reimplement to call
8459 handle_display_spec instead of single_display_spec_intangible_p.
8460 Accept 3 additional arguments needed by handle_display_spec.
8461 This fixes incorrect cursor motion across display property with complex
8462 values: lists, `(when COND...)' forms, etc.
8463 (single_display_spec_string_p): Support property values that are
8464 lists with the argument STRING its top-level element.
8465 (display_prop_string_p): Fix the condition for processing a
8466 property that is a list to be consistent with handle_display_spec.
8467 (handle_display_spec): New function, refactored from the
8468 last portion of handle_display_prop.
8469 (compute_display_string_pos): Accept additional argument
8470 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
8471 value of a `display' property is a "replacing spec".
8472 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
8473 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
8474 the display property, but just return a value indicating whether
8475 the display property will replace the characters it covers.
8476 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
8477 frame_window_p members of struct bidi_it.
8478 (compute_display_string_pos, compute_display_string_end):
8480 (push_it): Accept second argument POSITION, where pop_it should
8481 jump to continue iteration.
8482 (reseat_1): Initialize bidi_it.disp_pos.
8484 * keyboard.c (adjust_point_for_property): Adjust the call to
8485 display_prop_intangible_p to its new signature.
8487 * dispextern.h (struct bidi_it): New member frame_window_p.
8488 (bidi_init_it): Update prototypes.
8489 (display_prop_intangible_p): Update prototype.
8490 (compute_display_string_pos, compute_display_string_end):
8492 (struct bidi_it): New members nchars and disp_pos. ch_len is now
8495 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
8497 Malloc failure behavior now depends on size of allocation.
8498 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
8499 * lisp.h: Change signatures accordingly.
8500 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
8501 All callers changed. (Bug#8762)
8503 * gnutls.c: Use Emacs's memory allocators.
8504 Without this change, the gnutls library would invoke malloc etc.
8505 directly, which causes problems on non-SYNC_INPUT hosts, and which
8506 runs afoul of improving memory_full behavior. (Bug#8761)
8507 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
8508 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
8509 xfree instead of the default malloc, realloc, free.
8510 (Fgnutls_boot): No need to check for memory allocation failure,
8511 since xmalloc does that for us.
8513 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
8514 * category.c (hash_get_category_set):
8515 * ccl.c (ccl_driver):
8516 * charset.c (Fdefine_charset_internal):
8517 * charset.h (struct charset.hash_index):
8518 * composite.c (get_composition_id, gstring_lookup_cache)
8519 (composition_gstring_put_cache):
8520 * composite.h (struct composition.hash_index):
8521 * dispextern.h (struct image.hash):
8522 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
8523 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
8524 (hashfn_equal, hashfn_user_defined, make_hash_table)
8525 (maybe_resize_hash_table, hash_lookup, hash_put)
8526 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
8527 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
8528 (Fsxhash, Fgethash, Fputhash, Fmaphash):
8529 * image.c (make_image, search_image_cache, lookup_image)
8530 (xpm_put_color_table_h):
8531 * lisp.h (struct Lisp_Hash_Table):
8532 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
8533 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
8534 for hashes and hash indexes, instead of 'unsigned' and 'int'.
8535 * alloc.c (allocate_vectorlike):
8536 Check for overflow in vector size calculations.
8537 * ccl.c (ccl_driver):
8538 Check for overflow when converting EMACS_INT to int.
8539 * fns.c, image.c: Remove unnecessary static decls that would otherwise
8540 need to be updated by these changes.
8541 * fns.c (make_hash_table, maybe_resize_hash_table):
8542 Check for integer overflow with large hash tables.
8543 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
8544 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
8545 (SXHASH_REDUCE): New macro.
8546 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
8547 Use it instead of discarding useful hash info with large hash values.
8548 (sxhash_float): New function.
8549 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
8550 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
8551 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
8552 Rewrite to use FIXNUM_BITS, as this simplifies things.
8553 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
8554 Adjust signatures to match updated version of code.
8555 (consing_since_gc): Now EMACS_INT, since a single hash table can
8556 use more than INT_MAX bytes.
8558 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
8560 Make it possible to build with GCC-4.6+ -O2 -flto.
8562 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
8564 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
8566 * minibuf.c (get_minibuffer, read_minibuf_unwind):
8567 Call minibuffer-inactive-mode.
8569 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
8571 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
8572 Update dependencies.
8574 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8576 * data.c (init_data): Remove code for UTS, this system is not
8579 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8581 Don't force ./temacs to start in terminal mode.
8583 * frame.c (make_initial_frame): Initialize faces in all cases, not
8584 only when CANNOT_DUMP is defined.
8585 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
8587 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8589 * dispnew.c (add_window_display_history): Use const for the string
8590 pointer. Remove declaration, not needed.
8592 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
8594 Use 'inline', not 'INLINE'.
8595 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
8596 * alloc.c, fontset.c (INLINE): Remove.
8597 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
8598 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
8599 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
8600 * gmalloc.c (register_heapinfo): Use inline unconditionally.
8601 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
8603 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
8605 Make it possible to run ./temacs.
8607 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
8608 syms_of_callproc does the same thing. Remove test for
8609 "initialized", do it in the caller.
8610 * emacs.c (main): Avoid calling set_initial_environment when dumping.
8612 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
8614 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
8615 (read_minibuf): Use get_minibuffer.
8616 (syms_of_minibuf): Use DEFSYM.
8617 (Qmetadata): New var.
8618 * data.c (Qbuffer): Don't make it static.
8619 (syms_of_data): Use DEFSYM.
8621 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
8623 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
8624 (CCL_CODE_MIN): New macro.
8626 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
8628 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
8630 * eval.c (Qdebug): Now static.
8631 * lisp.h (Qdebug): Remove decl. This reverts a part of the
8632 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
8633 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
8635 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
8637 * image.c: Various fixes to ImageMagick code comments.
8638 (Fimagemagick_types): Doc fix.
8640 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
8642 Minor fixes prompted by GCC 4.6.0 warnings.
8644 * xselect.c (converted_selections, conversion_fail_tag): Now static.
8646 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
8647 (x_clipboard_manager_save_all): Move extern decl to ...
8648 * xterm.h: ... here, so that it can be checked for consistency.
8650 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
8652 * xselect.c (x_clipboard_manager_save_frame)
8653 (x_clipboard_manager_save_all): New functions.
8654 (Fx_clipboard_manager_save): Lisp function deleted.
8656 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
8657 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
8659 * xterm.h: Update prototype.
8661 2011-05-28 William Xu <william.xwl@gmail.com>
8663 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
8666 2011-05-28 Jim Meyering <meyering@redhat.com>
8668 Avoid a sign-extension bug in crypto_hash_function.
8669 * fns.c (to_uchar): Define.
8670 (crypto_hash_function): Use it to convert some newly-signed
8671 variables to unsigned, to avoid sign-extension bugs. For example,
8672 without this change, (md5 "truc") would evaluate to
8673 45723a2aff78ff4fff7fff1114760e62 rather than the expected
8674 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
8675 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
8677 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
8679 Integer overflow fixes.
8681 * dbusbind.c: Serial number integer overflow fixes.
8682 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
8683 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
8684 to hold a serial number that is too large for a fixnum.
8685 (Fdbus_method_return_internal, Fdbus_method_error_internal):
8686 Check for serial numbers out of range. Decode any serial number
8687 that was so large that it became a float. (Bug#8722)
8689 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
8690 (Fdbus_call_method, Fdbus_call_method_asynchronously):
8691 Use XFASTINT rather than XUINT when numbers are nonnegative.
8692 (xd_append_arg, Fdbus_method_return_internal):
8693 (Fdbus_method_error_internal): Likewise. Also, for unsigned
8694 arguments, check that Lisp number is nonnegative, rather than
8695 silently wrapping negative numbers around. (Bug#8722)
8696 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
8699 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
8701 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
8703 ccl: Add integer overflow checks.
8704 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
8705 (IN_INT_RANGE): New macros.
8706 (ccl_driver): Use them to check for integer overflow when
8707 decoding a CCL program. Many of the new checks are whether XINT (x)
8708 fits in int; it doesn't always, on 64-bit hosts. The new version
8709 doesn't catch all possible integer overflows, but it's an
8710 improvement. (Bug#8719)
8712 * alloc.c (make_event_array): Use XINT, not XUINT.
8713 There's no need for unsigned here.
8715 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
8716 This follows up to the 2011-05-06 change that substituted uintptr_t
8717 for EMACS_INT. This case wasn't caught back then.
8719 Rework Fformat to avoid integer overflow issues.
8720 * editfns.c: Include <float.h> unconditionally, as it's everywhere
8721 now (part of C89). Include <verify.h>.
8722 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
8723 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
8724 (Fformat): Avoid the prepass trying to compute sizes; it was only
8725 approximate and thus did not catch overflow reliably. Instead, walk
8726 through the format just once, formatting and computing sizes as we go,
8727 checking for integer overflow at every step, and allocating a larger
8728 buffer as needed. Keep track separately whether the format is
8729 multibyte. Keep only the most-recently calculated precision, rather
8730 than them all. Record whether each argument has been converted to
8731 string. Use EMACS_INT, not int, for byte and char and arg counts.
8732 Support field widths and precisions larger than INT_MAX. Avoid
8733 sprintf's undefined behavior with conversion specifications such as %#d
8734 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
8735 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
8736 formatting out-of-range floating point numbers with int
8739 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
8741 * data.c: Avoid integer truncation in expressions involving floats.
8742 * data.c: Include <intprops.h>.
8743 (arith_driver): When there's an integer overflow in an expression
8744 involving floating point, convert the integers to floating point
8745 so that the resulting value does not suffer from catastrophic
8746 integer truncation. For example, on a 64-bit host (* 4
8747 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
8748 Do not rely on undefined behavior after integer overflow.
8750 merge count_size_as_multibyte, parse_str_to_multibyte
8751 * character.c, character.h (count_size_as_multibyte):
8752 Rename from parse_str_to_multibyte; all uses changed.
8753 Check for integer overflow.
8754 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
8755 since it's now a duplicate of the other. This is more of
8756 a character than a buffer op, so better that it's in character.c.
8757 * fns.c, print.c: Adjust to above changes.
8759 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
8761 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
8763 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
8765 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
8766 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
8767 (x_clipboard_manager_save): Now static.
8768 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
8770 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
8771 (crypto_hash_function): Now static.
8772 Fix pointer signedness problems. Avoid unnecessary initializations.
8774 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
8776 * termhooks.h (Vselection_alist): Make it terminal-local.
8778 * terminal.c (create_terminal): Initialize it.
8780 * xselect.c: Support for clipboard managers.
8781 (Vselection_alist): Move to termhooks.h as terminal-local var.
8782 (LOCAL_SELECTION): New macro.
8783 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
8784 (symbol_to_x_atom): Remove gratuitous arg.
8785 (x_handle_selection_request, lisp_data_to_selection_data)
8786 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
8787 (x_own_selection, x_get_local_selection, x_convert_selection):
8788 New arg, specifying work frame. Use terminal-local Vselection_alist.
8789 (some_frame_on_display): Delete unused function.
8790 (Fx_own_selection_internal, Fx_get_selection_internal)
8791 (Fx_disown_selection_internal, Fx_selection_owner_p)
8792 (Fx_selection_exists_p): New optional frame arg.
8793 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
8794 (x_handle_selection_clear): Don't treat other terminals with the
8795 same keyboard specially. Use the terminal-local Vselection_alist.
8796 (x_clear_frame_selections): Use Frun_hook_with_args.
8798 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
8800 * xterm.h: Add support for those atoms.
8802 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
8804 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
8805 (converted_selections, conversion_fail_tag): New global variables.
8806 (x_selection_request_lisp_error): Free the above.
8807 (x_get_local_selection): Remove unnecessary code.
8808 (x_reply_selection_request): Args changed; handle arbitrary array
8809 of converted selections stored in converted_selections.
8810 Separate the XChangeProperty and SelectionNotify steps.
8811 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
8812 (x_convert_selection): New function.
8813 (x_handle_selection_event): Simplify.
8814 (x_get_foreign_selection): Don't ignore incoming requests while
8815 waiting for an answer; this will fail when we implement
8816 SAVE_TARGETS, and seems unnecessary anyway.
8817 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
8818 (Vx_sent_selection_functions): Doc fix.
8820 2011-05-26 Leo Liu <sdl.web@gmail.com>
8822 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
8824 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8826 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
8828 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
8829 for fringe update if it has periodic bitmap.
8830 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
8831 and fringe_bitmap_periodic_p.
8833 * fringe.c (get_fringe_bitmap_data): New function.
8834 (draw_fringe_bitmap_1, update_window_fringes): Use it.
8835 (update_window_fringes): Record periodicity of fringe bitmap in glyph
8836 row. Mark glyph row for fringe update if periodicity changed.
8838 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
8839 for fringe update unless it has periodic bitmap.
8841 2011-05-25 Kenichi Handa <handa@m17n.org>
8843 * xdisp.c (get_next_display_element): Set correct it->face_id for
8844 a static composition.
8846 2011-05-24 Leo Liu <sdl.web@gmail.com>
8849 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
8851 * fns.c (crypto_hash_function, Fsha1): New function.
8852 (Fmd5): Use crypto_hash_function.
8853 (syms_of_fns): Add Ssha1.
8855 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
8857 * gnutls.c: Remove unused macros.
8858 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
8859 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
8860 Remove macros that are defined and never used.
8861 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
8863 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
8865 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
8866 (Fx_get_selection_internal): Minor cleanup.
8867 (Fx_own_selection_internal): Rename arguments for consistency with
8870 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
8872 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
8874 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
8876 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
8878 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8880 * dispnew.c (scrolling_window): Don't exclude the case that the
8881 last enabled row in the desired matrix touches the bottom boundary.
8883 2011-05-21 Glenn Morris <rgm@gnu.org>
8885 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
8886 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
8887 and add some more files.
8889 2011-05-20 Eli Zaretskii <eliz@gnu.org>
8891 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
8892 report_file_error introduced by the change from 2011-05-07.
8894 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
8896 * systime.h (Time): Define only if emacs is defined.
8897 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
8898 where the include path doesn't have X11/X.h by default. See
8899 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
8901 2011-05-20 Kenichi Handa <handa@m17n.org>
8903 * composite.c (find_automatic_composition): Fix previous change.
8905 2011-05-20 Glenn Morris <rgm@gnu.org>
8907 * lisp.mk: New file, split from Makefile.in.
8908 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
8909 (shortlisp): Remove.
8910 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
8912 2011-05-19 Glenn Morris <rgm@gnu.org>
8914 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
8915 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
8916 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
8917 (lisp): Set the order to that of loadup.el.
8918 (shortlisp): Make it a copy of $lisp.
8919 (SOME_MACHINE_LISP): Remove.
8920 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
8921 Use just $shortlisp, not $SOME_MACHINE_LISP too.
8923 2011-05-18 Kenichi Handa <handa@m17n.org>
8925 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
8926 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
8927 (find_automatic_composition): Mostly rewrite for efficiency.
8929 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
8931 * makefile.w32-in: Update dependencies.
8933 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
8935 * menu.c: Include limits.h (fixes the MS-Windows build broken by
8936 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8938 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
8940 Fix some integer overflow issues, such as string length overflow.
8942 * insdel.c (count_size_as_multibyte): Check for string overflow.
8944 * character.c (lisp_string_width): Check for string overflow.
8945 Use EMACS_INT, not int, for string indexes and lengths; in
8946 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
8947 the resulting string length overflows an EMACS_INT; instead,
8948 report a string overflow if no precision given. When checking for
8949 precision exhaustion, use a check that cannot possibly have
8950 integer overflow. (Bug#8675)
8951 * character.h (lisp_string_width): Adjust to new signature.
8953 * alloc.c (string_overflow): New function.
8954 (Fmake_string): Use it. This doesn't change behavior, but saves
8955 a few bytes and will simplify future changes.
8956 * character.c (string_escape_byte8): Likewise.
8957 * lisp.h (string_overflow): New decl.
8959 Fixups, following up to the user-interface timestamp change.
8960 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
8961 for UI timestamps, instead of unsigned long.
8962 * msdos.c (mouse_get_pos): Likewise.
8963 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
8964 * w32gui.h (Time): Define by including "systime.h" rather than by
8965 declaring it ourselves. (Bug#8664)
8967 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
8968 * image.c (clear_image_cache): Likewise.
8970 * term.c (term_mouse_position): Don't assume time_t wraparound.
8972 Be more systematic about user-interface timestamps.
8973 Before, the code sometimes used 'Time', sometimes 'unsigned long',
8974 and sometimes 'EMACS_UINT', to represent these timestamps.
8975 This change causes it to use 'Time' uniformly, as that's what X uses.
8976 This makes the code easier to follow, and makes it easier to catch
8977 integer overflow bugs such as Bug#8664.
8978 * frame.c (Fmouse_position, Fmouse_pixel_position):
8979 Use Time, not unsigned long, for user-interface timestamps.
8980 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
8981 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
8982 * keyboard.h (last_event_timestamp): Likewise.
8983 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
8984 * menu.h (xmenu_show): Likewise.
8985 * term.c (term_mouse_position): Likewise.
8986 * termhooks.h (struct input_event.timestamp): Likewise.
8987 (struct terminal.mouse_position_hook): Likewise.
8988 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
8989 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
8990 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
8991 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
8993 * menu.h, termhooks.h: Include "systime.h", for Time.
8995 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
8996 Don't assume that the difference between two unsigned long values
8997 can fit into an integer. At this point, we know button_down_time
8998 <= event->timestamp, so the difference must be nonnegative, so
8999 there's no need to cast the result if double-click-time is
9000 nonnegative, as it should be; check that it's nonnegative, just in
9001 case. This bug is triggered when events are more than 2**31 ms
9002 apart (about 25 days). (Bug#8664)
9004 * xselect.c (last_event_timestamp): Remove duplicate decl.
9005 (x_own_selection): Remove needless cast to unsigned long.
9007 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
9008 that always fit in int. Use a sentinel instead of a counter, to
9009 avoid a temp and to allay GCC's concerns about possible int overflow.
9010 * frame.h (struct frame): Use int for menu_bar_items_used
9011 instead of EMACS_INT, since it always fits in int.
9013 * menu.c (grow_menu_items): Check for int overflow.
9015 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
9017 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
9018 Before, the code was not consistent. These values cannot exceed
9019 2**31 - 1 so there's no need to make them unsigned.
9020 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
9021 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
9022 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
9024 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
9026 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
9027 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
9028 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
9029 presumably because the widths might not match.
9031 * window.c (size_window): Avoid needless test at loop start.
9033 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
9035 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
9037 2011-05-12 Drew Adams <drew.adams@oracle.com>
9039 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
9041 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9043 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
9044 `width' to `bar_area_x' and `bar_area_width', respectively.
9045 (x_scroll_run): Take account of fringe background extension.
9047 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
9048 Rename local vars `left' and `width' to `bar_area_x' and
9049 `bar_area_width', respectively.
9050 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
9051 background extension.
9053 2011-05-10 Jim Meyering <meyering@redhat.com>
9055 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
9057 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
9059 * image.c (Finit_image_library): Return t for built-in image types,
9060 like pbm and xbm. (Bug#8640)
9062 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
9064 * w32menu.c (set_frame_menubar): Fix submenu allocation.
9066 2011-05-07 Eli Zaretskii <eliz@gnu.org>
9068 * w32console.c (Fset_screen_color): Doc fix.
9069 (Fget_screen_color): New function.
9070 (syms_of_ntterm): Defsubr it.
9072 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
9073 unlink the temporary file if Fcall_process didn't create it in the
9075 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
9076 child process will be redirected to a file specified with `:file'.
9077 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
9078 cue to call_process_cleanup not to close that handle.
9080 2011-05-07 Ben Key <bkey76@gmail.com>
9082 * makefile.w32-in: The bootstrap-temacs rule now makes use of
9083 one of two shell specific rules, either bootstrap-temacs-CMD or
9084 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
9085 to the previous implementation of the bootstrap-temacs rule.
9086 The bootstrap-temacs-CMD rule is similar to the previous
9087 implementation of the bootstrap-temacs rule except that it
9088 makes use of the ESC_CFLAGS variable instead of the CFLAGS
9091 These changes, along with some changes to nt/configure.bat,
9092 nt/gmake.defs, and nt/nmake.defs, are required to extend my
9093 earlier fix to add support for --cflags and --ldflags options
9094 that include quotes so that it works whether make uses cmd or
9097 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
9099 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
9100 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
9102 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
9103 a string. Handle both cases.
9104 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
9105 (Fdbus_register_method): Use Qinvalid_function.
9107 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
9109 * makefile.w32-in: Update dependencies.
9110 (LISP_H): Add inttypes.h and stdin.h.
9111 (PROCESS_H): Add unistd.h.
9113 2011-05-06 Eli Zaretskii <eliz@gnu.org>
9115 * lread.c: Include limits.h (fixes the MS-Windows build broken by
9116 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
9118 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
9120 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
9122 * term.c (vfatal): Remove stray call to va_end.
9123 It's not needed and the C Standard doesn't allow it here anyway.
9125 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
9126 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
9128 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
9131 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
9133 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9135 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
9137 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
9139 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
9141 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
9142 * charset.c (Fdefine_charset_internal): Don't initialize
9143 charset.code_space[15]. The value was garbage, on hosts with
9144 32-bit int (Bug#8600).
9146 * lread.c (read_integer): Be more consistent with string-to-number.
9147 Use string_to_number to do the actual conversion; this avoids
9148 rounding errors and fixes some other screwups. Without this fix,
9149 for example, #x1fffffffffffffff was misread as -2305843009213693952.
9150 (digit_to_number): Move earlier, for benefit of read_integer.
9151 Return -1 if the digit is out of range for the base, -2 if it is
9152 not a digit in any supported base. (Bug#8602)
9154 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
9156 * dispnew.c (scrolling_window): Return 1 if we scrolled,
9157 to match comment at start of function. This also removes a
9158 GCC warning about overflow in a 32+64-bit port.
9160 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
9162 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
9163 Reported by Stefan Monnier in
9164 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
9165 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9166 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
9168 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
9169 (EMACS_UINTPTR): Likewise, with uintptr_t.
9171 * lisp.h: Prefer 64-bit EMACS_INT if available.
9172 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
9173 on 32-bit hosts that have 64-bit int, so that they can access
9175 However, temporarily disable this change unless the temporary
9176 symbol WIDE_EMACS_INT is defined.
9178 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
9180 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
9181 This removes an assumption that EMACS_INT and long are the same
9182 width as pointers. The assumption is true for Emacs porting targets
9183 now, but we want to make other targets possible.
9184 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
9185 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
9186 In the rest of the code, change types of integers that hold casted
9187 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
9188 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
9189 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
9190 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
9191 No need to cast type when ORing.
9192 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
9193 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
9194 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
9195 assume EMACS_INT is the same width as char *.
9196 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
9197 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
9198 Remove no-longer-needed casts.
9199 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
9200 (xg_tool_bar_help_callback, xg_make_tool_item):
9201 Use EMACS_INTPTR to hold an integer
9202 that will be cast to void *; this can avoid a GCC warning
9203 if EMACS_INT is not the same width as void *.
9204 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
9205 * xdisp.c (display_echo_area_1, resize_mini_window_1):
9206 (current_message_1, set_message_1):
9207 Use a local to convert to proper width without a cast.
9208 * xmenu.c (dialog_selection_callback): Likewise.
9210 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
9211 Also, don't assume VALBITS / RAND_BITS is less than 5,
9212 and don't rely on undefined behavior when shifting a 1 left into
9214 * lisp.h (get_random): Change signature to match.
9216 * lread.c (hash_string): Use size_t, not int, for hash computation.
9217 Normally we prefer signed values; but hashing is special, because
9218 it's better to use unsigned division on hash table sizes so that
9219 the remainder is nonnegative. Also, size_t is the natural width
9220 for hashing into memory. The previous code used 'int', which doesn't
9221 retain enough info to hash well into very large tables.
9222 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
9224 * dbusbind.c: Don't possibly lose pointer info when converting.
9225 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
9226 Use XPNTR rather than XHASH, so that the high-order bits of
9227 the pointer aren't lost when converting through void *.
9229 * eval.c (Fautoload): Don't double-shift a pointer.
9231 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
9233 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
9235 * gnutls.c (DEF_GNUTLS_FN):
9236 * image.c (DEF_IMGLIB_FN): Make function pointers static.
9238 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
9240 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
9243 2011-05-05 Eli Zaretskii <eliz@gnu.org>
9245 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
9246 New version that can reserve upto 2GB of heap space.
9248 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
9250 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
9252 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
9254 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
9255 `gnutls_certificate_set_x509_key_file'.
9257 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
9259 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
9260 Update dependencies.
9262 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
9264 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
9265 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
9266 Remove unused parameter `fildes'.
9267 * process.c (read_process_output, send_process): Don't pass it.
9269 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
9271 Fix previous change: the library cache is defined in w32.c.
9272 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
9273 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
9275 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
9277 Implement dynamic loading of GnuTLS on Windows.
9279 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
9280 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
9281 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
9284 * gnutls.c (Qgnutls_dll): Define.
9285 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
9286 (gnutls_*): Declare function pointers.
9287 (init_gnutls_functions): New function to initialize function pointers.
9288 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
9289 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
9290 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
9291 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
9292 (emacs_gnutls_write, emacs_gnutls_read)
9293 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
9294 (Fgnutls_available_p): New function.
9295 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
9296 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
9297 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
9299 * image.c: Include w32.h.
9300 (Vimage_type_cache): Delete.
9301 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
9302 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
9303 (w32_delayed_load): Move to w32.c.
9305 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
9307 * w32.c (QCloaded_from, Vlibrary_cache): Define.
9308 (w32_delayed_load): Move from image.c. When loading a library, record
9309 its filename in the :loaded-from property of the library id.
9310 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
9311 Initialize and staticpro them.
9312 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
9314 * process.c: Include lisp.h before w32.h, not after.
9315 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
9316 instead of gnutls_record_check_pending.
9318 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
9320 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
9322 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
9323 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
9326 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
9328 * xterm.c (x_set_frame_alpha): Do not set property on anything
9329 else than FRAME_X_OUTER_WINDOW (Bug#8608).
9331 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
9333 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
9335 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
9337 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
9338 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
9339 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
9340 (gnutls_global_initialized, Qgnutls_bootprop_priority)
9341 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
9342 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
9343 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
9344 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
9345 (Qgnutls_bootprop_callbacks_verify): Make static.
9347 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
9349 * callproc.c: Indentation fixup.
9351 * sysdep.c (wait_for_termination_1): Make static.
9352 (wait_for_termination, interruptible_wait_for_termination):
9353 Move after wait_for_termination_1.
9355 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
9357 * sysdep.c (interruptible_wait_for_termination): New function
9358 which is like wait_for_termination, but allows keyboard
9361 * callproc.c (Fcall_process): Add (:file "file") as an option for
9363 (Fcall_process_region): Ditto.
9365 2011-04-30 Eli Zaretskii <eliz@gnu.org>
9367 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
9368 rather than `XVECTOR (FOO)->size'.
9370 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
9371 inttypes.h, as a gnulib replacement is used if it not available in
9374 2011-04-21 Eli Zaretskii <eliz@gnu.org>
9376 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
9377 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
9378 of MOST_POSITIVE_FIXNUM. (Bug#8528)
9380 * coding.c (coding_alloc_by_realloc): Error out if destination
9381 will grow beyond MOST_POSITIVE_FIXNUM.
9382 (decode_coding_emacs_mule): Abort if there isn't enough place in
9383 charbuf for the composition carryover bytes. Reserve an extra
9384 space for up to 2 characters produced in a loop.
9385 (decode_coding_iso_2022): Abort if there isn't enough place in
9386 charbuf for the composition carryover bytes.
9388 2011-04-21 Eli Zaretskii <eliz@gnu.org>
9390 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
9391 aborting when %lld or %lll format is passed.
9392 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
9393 %llo or %llx format is passed. (Bug#8545)
9395 * window.c (window_scroll_line_based): Use a marker instead of
9396 simple variables to record original value of point. (Bug#7952)
9398 * doprnt.c (doprnt): Fix the case where a multibyte sequence
9399 produced by %s or %c overflows available buffer space. (Bug#8545)
9401 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
9403 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
9404 (SIZE_MAX): Move defn after all includes, as they might #define it.
9406 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
9408 * w32.c (init_environment): Warn about defaulting HOME to C:\.
9410 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
9412 * keyboard.c (Qdelayed_warnings_hook): Define.
9413 (command_loop_1): Run `delayed-warnings-hook'
9414 if Vdelayed_warnings_list is non-nil.
9415 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
9416 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
9418 2011-04-28 Eli Zaretskii <eliz@gnu.org>
9420 * doprnt.c (doprnt): Don't return value smaller than the buffer
9421 size if the message was truncated. (Bug#8545).
9423 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
9425 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
9426 (Fx_window_property): #if-0 the whole functions, not just the bodies.
9428 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
9430 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
9432 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
9434 * makefile.w32-in: Update dependencies.
9436 2011-04-27 Eli Zaretskii <eliz@gnu.org>
9438 Improve `doprnt' and its usage. (Bug#8545)
9439 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
9440 `format_end'. Remove support for %l as a conversion specifier.
9441 Don't use xrealloc. Improve diagnostics when the %l size modifier
9442 is used. Update the commentary.
9444 * eval.c (verror): Simplify calculation of size_t.
9446 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
9449 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
9451 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
9454 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
9456 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
9457 This makes this file independent of the recent pseudovector change.
9459 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
9461 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
9463 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
9464 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
9465 Remove unused local.
9466 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
9468 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
9469 GCC 4.6.0 optimizes based on type-based alias analysis.
9470 For example, if b is of type struct buffer * and v of type struct
9471 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
9472 != &v->size, and therefore "v->size = 1; b->size = 2; return
9473 v->size;" must therefore return 1. This assumption is incorrect
9474 for Emacs, since it type-puns struct Lisp_Vector * with many other
9475 types. To fix this problem, this patch adds a new type struct
9476 vectorlike_header that documents the constraints on layout of vectors
9477 and pseudovectors, and helps optimizing compilers not get fooled
9478 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
9479 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
9480 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
9482 (XSETPVECTYPE): Rewrite in terms of new macro.
9483 (XSETPVECTYPESIZE): New macro, specifying both type and size.
9484 This is a bit clearer, and further avoids the possibility of
9485 undesirable aliasing.
9486 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
9487 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
9488 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
9489 since Lisp_Subr is a special case (no "next" field).
9490 (ASIZE): Now uses header.size rather than size.
9491 All previous uses of XVECTOR (foo)->size replaced to use this macro,
9492 to avoid the hassle of writing XVECTOR (foo)->header.size.
9493 (struct vectorlike_header): New type.
9494 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
9495 object, to help avoid aliasing.
9496 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
9497 (SUBRP): Likewise, since Lisp_Subr is a special case.
9498 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
9499 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
9500 (struct Lisp_Hash_Table): Combine first two members into a single
9501 struct vectorlike_header member. All uses of "size" and "next" members
9502 changed to be "header.size" and "header.next".
9503 * buffer.h (struct buffer): Likewise.
9504 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
9505 * frame.h (struct frame): Likewise.
9506 * process.h (struct Lisp_Process): Likewise.
9507 * termhooks.h (struct terminal): Likewise.
9508 * window.c (struct save_window_data, struct saved_window): Likewise.
9509 * window.h (struct window): Likewise.
9510 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
9511 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
9512 * buffer.c (init_buffer_once): Likewise.
9513 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
9515 * process.c (Fformat_network_address): Use local var for size,
9518 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
9520 Make the Lisp reader and string-to-float more consistent (Bug#8525)
9521 * data.c (atof): Remove decl; no longer used or needed.
9522 (digit_to_number): Move to lread.c.
9523 (Fstring_to_number): Use new string_to_number function, to be
9524 consistent with how the Lisp reader treats infinities and NaNs.
9525 Do not assume that floating-point numbers represent EMACS_INT
9526 without losing information; this is not true on most 64-bit hosts.
9527 Avoid double-rounding errors, by insisting on integers when
9528 parsing non-base-10 numbers, as the documentation specifies.
9529 * lisp.h (string_to_number): New decl, replacing ...
9530 (isfloat_string): Remove.
9531 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
9532 (read1): Do not accept +. and -. as integers; this
9533 appears to have been a coding error. Similarly, do not accept
9534 strings like +-1e0 as floating point numbers. Do not report
9535 overflow for integer overflows unless the base is not 10 which
9536 means we have no simple and reliable way to continue.
9537 Break out the floating-point parsing into a new
9538 function string_to_number, so that Fstring_to_number parses
9539 floating point numbers consistently with the Lisp reader.
9540 (digit_to_number): Move here from data.c. Make it static inline.
9541 (E_CHAR, EXP_INT): Remove, replacing with ...
9542 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
9543 (string_to_number): New function, replacing isfloat_string.
9544 This function checks for valid syntax and produces the resulting
9545 Lisp float number too. Rework it so that string-to-number
9546 no longer mishandles examples like "1.0e+". Use strtoumax,
9547 so that overflow for non-base-10 numbers is reported only when
9548 there's no portable and simple way to convert to floating point.
9550 * textprop.c (set_text_properties_1): Rewrite for clarity,
9551 and to avoid GCC warning about integer overflow.
9553 * intervals.h (struct interval): Use EMACS_INT for members
9554 where EMACS_UINT might cause problems. See
9555 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
9556 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
9557 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
9559 (offset_intervals): Tell GCC not to worry about length overflow
9560 when negating a negative length.
9562 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
9563 (overrun_check_free): Likewise.
9565 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
9566 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
9569 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
9570 (gnutls_make_error): Rename local to avoid shadowing.
9571 (gnutls_emacs_global_deinit): ifdef out; not used.
9572 (Fgnutls_boot): Use const for pointer to readonly storage.
9573 Comment out unused local. Fix pointer signedness problems.
9575 * lread.c (openp): Don't stuff size_t into an 'int'.
9576 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
9577 about possible signed overflow.
9579 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
9580 (GDK_KEY_g): Don't define if already defined.
9581 (xg_prepare_tooltip): Avoid pointer signedness problem.
9582 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
9584 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
9585 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
9587 * xfns.c (Fx_window_property): Simplify a bit,
9588 to make a bit faster and to avoid GCC 4.6.0 warning.
9589 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
9591 * fns.c (internal_equal): Don't assume size_t fits in int.
9593 * alloc.c (compact_small_strings): Tighten assertion a little.
9595 Replace pEd with more-general pI, and fix some printf arg casts.
9596 * lisp.h (pI): New macro, generalizing old pEd macro to other
9597 conversion specifiers. For example, use "...%"pI"d..." rather
9598 than "...%"pEd"...".
9599 (pEd): Remove. All uses replaced with similar uses of pI.
9600 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
9601 * alloc.c (check_pure_size): Don't overflow by converting size to int.
9602 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
9603 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
9604 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
9605 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
9606 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
9608 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
9609 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
9610 * print.c (safe_debug_print, print_object): Likewise.
9611 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
9613 Use pI instead of if-then-else-abort. Use %p to avoid casts,
9614 avoiding the 0 flag, which is not portable.
9615 * process.c (Fmake_network_process): Use pI to avoid cast.
9616 * region-cache.c (pp_cache): Likewise.
9617 * xdisp.c (decode_mode_spec): Likewise.
9618 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
9619 behavior on 64-bit hosts with printf arg.
9620 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
9621 (x_stop_queuing_selection_requests): Likewise.
9622 (x_get_window_property): Don't truncate byte count to an 'int'
9625 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
9626 here, since it parses constructs like leading '-' and spaces,
9627 which are not wanted; and it overflows with large numbers.
9628 Instead, simply match F[0-9]+, which is what is wanted anyway.
9630 * alloc.c: Remove unportable assumptions about struct layout.
9631 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
9632 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
9633 (allocate_vectorlike, make_pure_vector): Use the new macros,
9634 plus offsetof, to remove unportable assumptions about struct layout.
9635 These assumptions hold on all porting targets that I know of, but
9636 they are not guaranteed, they're easy to remove, and removing them
9637 makes further changes easier.
9639 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
9640 This doesn't fix a bug but makes the code clearer.
9641 (string_overrun_cookie): Now const. Use initializers that
9642 don't formally overflow signed char, to avoid warnings.
9643 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
9644 can cause Emacs to crash when string overrun checking is enabled.
9645 (allocate_buffer): Don't assume sizeof (struct buffer) is a
9646 multiple of sizeof (EMACS_INT); it need not be, if
9647 alignof(EMACS_INT) < sizeof (EMACS_INT).
9648 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
9650 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
9652 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
9654 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
9656 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
9657 supposed to be handshaking. (Bug#8556)
9658 Reported by Paul Eggert <eggert@cs.ucla.edu>.
9660 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
9662 * lisp.h (Qdebug): List symbol.
9663 * eval.c (Qdebug): Restore global linkage.
9664 * keyboard.c (debug-on-event): New variable.
9665 (handle_user_signal): Break into debugger when debug-on-event
9666 matches the current signal symbol.
9668 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
9670 * alloc.c (check_sblock, check_string_bytes)
9671 (check_string_free_list): Convert to standard C.
9673 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
9675 * w32.c (emacs_gnutls_push): Fix typo.
9677 2011-04-25 Eli Zaretskii <eliz@gnu.org>
9679 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
9680 "cast to pointer from integer of different size".
9682 Improve doprnt and its use in verror. (Bug#8545)
9683 * doprnt.c (doprnt): Document the set of format control sequences
9684 supported by the function. Use SAFE_ALLOCA instead of always
9687 * eval.c (verror): Don't limit the buffer size at size_max-1, that
9688 is one byte too soon. Don't use xrealloc; instead xfree and
9691 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
9693 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
9696 * gnutls.c: Renamed global_initialized to
9697 gnutls_global_initialized. Added internals for the
9698 :verify-hostname-error, :verify-error, and :verify-flags
9699 parameters of `gnutls-boot' and documented those parameters in the
9700 docstring. Start callback support.
9701 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
9702 unless a fatal error occurred. Call gnutls_alert_send_appropriate
9703 on error. Return error code.
9704 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
9705 (emacs_gnutls_read): Likewise.
9706 (Fgnutls_boot): Return handshake error code.
9707 (emacs_gnutls_handle_error): New function.
9708 (wsaerror_to_errno): Likewise.
9710 * w32.h (emacs_gnutls_pull): Add prototype.
9711 (emacs_gnutls_push): Likewise.
9713 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
9714 (emacs_gnutls_push): Likewise.
9716 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
9718 * process.c (wait_reading_process_output): Check if GnuTLS
9719 buffered some data internally if no FDs are set for TLS
9722 * makefile.w32-in (OBJ2): Add gnutls.$(O).
9723 (LIBS): Link to USER_LIBS.
9724 ($(BLD)/gnutls.$(0)): New target.
9726 2011-04-24 Eli Zaretskii <eliz@gnu.org>
9728 * xdisp.c (handle_single_display_spec): Rename the
9729 display_replaced_before_p argument into display_replaced_p, to
9730 make it consistent with the commentary. Fix typos in the
9733 * textprop.c (syms_of_textprop): Remove dead code.
9734 (copy_text_properties): Delete obsolete commentary about an
9735 interface that was deleted long ago. Fix typos in the description
9738 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
9739 to changes in oldXMenu/XMenu.h from 2011-04-16.
9740 <menu_help_message, prev_menu_help_message>: Constify.
9741 (IT_menu_make_room): menu->help_text is now `const char **';
9744 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
9745 to changes in oldXMenu/XMenu.h from 2011-04-16.
9746 (struct XMenu): Declare `help_text' `const char **'.
9748 * xfaces.c <Qunspecified>: Make extern again.
9750 * syntax.c: Include sys/types.h before including regex.h, as
9753 * doc.c (get_doc_string): Improve the format passed to `error'.
9755 * doprnt.c (doprnt): Improve commentary.
9757 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
9759 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
9762 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
9763 changes in globals.h immediately force recompilation.
9764 (TAGS): Depend on $(CURDIR)/m/intel386.h and
9765 $(CURDIR)/s/ms-w32.h.
9766 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
9768 * character.c (Fchar_direction): Function deleted.
9769 (syms_of_character): Don't defsubr it.
9770 <char-direction-table>: Deleted.
9772 2011-04-23 Eli Zaretskii <eliz@gnu.org>
9774 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
9775 * doprnt.c: Include limits.h.
9776 (SIZE_MAX): New macro.
9777 (doprnt): Return a size_t value. 2nd arg is now size_t.
9778 Many local variables are now size_t instead of int or unsigned.
9779 Improve overflow protection. Support `l' modifier for integer
9780 conversions. Support %l conversion. Don't assume an EMACS_INT
9781 argument for integer conversions and for %c.
9783 * lisp.h (doprnt): Restore prototype.
9785 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
9788 * Makefile.in (base_obj): Add back doprnt.o.
9790 * deps.mk (doprnt.o): Add back prerequisites.
9791 (callint.o): Depend on character.h.
9793 * eval.c (internal_lisp_condition_case): Include the handler
9794 representation in the error message.
9795 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
9796 when breaking from the loop.
9798 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
9800 * callint.c (Fcall_interactively): When displaying error message
9801 about invalid control letter, pass the character's codepoint, not
9802 a pointer to its multibyte form. Improve display of the character
9803 in octal and display also its hex code.
9805 * character.c (char_string): Use %x to display the (unsigned)
9806 codepoint of an invalid character, to avoid displaying a bogus
9809 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
9810 `error', not SYMBOL_NAME itself.
9812 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
9813 character arguments to `error'.
9815 * charset.c (check_iso_charset_parameter): Fix incorrect argument
9816 to `error' in error message about FINAL_CHAR argument. Make sure
9817 FINAL_CHAR is a character, and use %c when it is passed as
9818 argument to `error'.
9820 2011-04-23 Eli Zaretskii <eliz@gnu.org>
9822 * s/ms-w32.h (localtime): Redirect to sys_localtime.
9824 * w32.c: Include <time.h>.
9825 (sys_localtime): New function.
9827 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
9829 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
9831 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
9833 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
9835 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
9838 2011-04-19 Eli Zaretskii <eliz@gnu.org>
9840 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
9841 gl_state.e_property when gl_state.object is Qt.
9843 * insdel.c (make_gap_larger): Remove limitation of buffer size
9846 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
9848 * xdisp.c (lookup_glyphless_char_display)
9849 (produce_glyphless_glyph): Handle cons cell entry in
9850 glyphless-char-display.
9851 (Vglyphless_char_display): Document it.
9853 * term.c (produce_glyphless_glyph): Handle cons cell entry in
9854 glyphless-char-display.
9856 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
9858 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
9860 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
9862 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
9863 definition for no-X builds.
9865 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
9867 Static checks with GCC 4.6.0 and non-default toolkits.
9869 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
9871 * process.c (keyboard_bit_set): Define only if SIGIO.
9872 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
9873 (send_process): Repair possible setjmp clobbering.
9875 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
9877 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
9879 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
9881 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
9882 Define only if needed.
9884 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
9885 by pacifying GCC about it. Maybe it's time to retire it?
9886 * xfaces.c (USG, __TIMEVAL__): Likewise.
9888 * dispextern.h (struct redisplay_interface): Rename param
9890 * termhooks.h (struct terminal): Likewise.
9891 * xterm.c (xembed_send_message): Likewise.
9893 * insdel.c (make_gap_smaller): Define only if
9894 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
9896 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
9899 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
9900 so that we aren't warned about unused symbols.
9902 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
9904 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
9906 * xfns.c (x_real_positions): Mark locals as initialized.
9908 * xmenu.c (xmenu_show): Don't use uninitialized vars.
9910 * xterm.c: Fix problems found by static analysis with other toolkits.
9911 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
9912 (x_dispatch_event): Declare static if USE_GTK, and
9913 define if USE_GTK || USE_X_TOOLKIT.
9914 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
9915 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
9916 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
9917 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
9919 * xmenu.c (menu_help_callback): Pointer type fixes.
9920 Use const pointers when pointing at readonly data. Avoid pointer
9922 (FALSE): Remove unused macro.
9923 (update_frame_menubar): Remove unused decl.
9925 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
9927 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
9928 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
9929 (single_menu_item): Rename local to avoid shadowing.
9931 * keyboard.c (make_lispy_event): Remove unused local var.
9933 * frame.c, frame.h (x_get_resource_string): Bring this back, but
9934 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
9936 * bitmaps: Change bitmaps from unsigned char back to the X11
9937 compatible char. Avoid the old compiler warnings about
9938 out-of-range initializers by using, for example, '\xab' rather
9941 * xgselect.c (xgselect_initialize): Check vs interface
9942 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
9944 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
9946 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
9947 to read-only memory.
9949 * fns.c (vector): Remove; this old hack is no longer needed.
9951 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
9953 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
9955 * xrdb.c (x_load_resources): Omit unused local.
9957 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
9958 (x_window): Rename locals to avoid shadowing.
9959 (USG): Use the kludged USG macro, to pacify gcc.
9961 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
9962 (x_term_init): Remove local to avoid shadowing.
9964 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
9966 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
9967 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
9969 2011-04-16 Eli Zaretskii <eliz@gnu.org>
9971 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
9973 Fix regex.c, syntax.c and friends for buffers > 2GB.
9974 * syntax.h (struct gl_state_s): Declare character position members
9977 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
9979 * textprop.c (verify_interval_modification, interval_of):
9980 Declare arguments EMACS_INT.
9982 * intervals.c (adjust_intervals_for_insertion): Declare arguments
9985 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
9987 * indent.c (Fvertical_motion): Local variable it_start is now
9990 * regex.c (re_match, re_match_2, re_match_2_internal)
9991 (bcmp_translate, regcomp, regexec, print_double_string)
9992 (group_in_compile_stack, re_search, re_search_2, regex_compile)
9993 (re_compile_pattern, re_exec): Declare arguments and local
9994 variables `size_t' and `ssize_t' and return values `regoff_t', as
9996 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
9997 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
9998 <compile_stack_type>: `size' and `avail' are now `size_t'.
10000 * regex.h <regoff_t>: Use ssize_t, not int.
10001 (re_search, re_search_2, re_match, re_match_2): Arguments that
10002 specify buffer/string position and length are now ssize_t and
10003 size_t. Return type is regoff_t.
10005 2011-04-16 Ben Key <bkey76@gmail.com>
10007 * nsfont.m: Fixed bugs in ns_get_family and
10008 ns_descriptor_to_entity that were caused by using free to
10009 deallocate memory blocks that were allocated by xmalloc (via
10010 xstrdup). This caused Emacs to crash when compiled with
10011 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
10012 --enable-checking=xmallocoverrun). xfree is now used to
10013 deallocate these memory blocks.
10015 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
10017 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
10019 emacs_write: Accept and return EMACS_INT for sizes.
10020 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
10022 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
10023 Accept and return EMACS_INT.
10024 (emacs_gnutls_write): Return the number of bytes written on
10026 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
10027 (emacs_read, emacs_write): Remove check for negative size, as the
10028 Emacs source code has been audited now.
10029 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
10030 (emacs_read, emacs_write): Use it.
10031 * process.c (send_process): Adjust to the new signatures of
10032 emacs_write and emacs_gnutls_write. Do not attempt to store
10033 a byte offset into an 'int'; it might overflow.
10034 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
10036 * sound.c: Don't assume sizes fit in 'int'.
10037 (struct sound_device.period_size, alsa_period_size):
10038 Return EMACS_INT, not int.
10039 (struct sound_device.write, vox_write, alsa_write):
10040 Accept EMACS_INT, not int.
10041 (wav_play, au_play): Use EMACS_INT to store sizes and to
10042 record read return values.
10044 2011-04-15 Ben Key <bkey76@gmail.com>
10046 * keyboard.c (Qundefined): Don't declare static since it is used
10048 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
10049 static since they are used in nsfont.m.
10051 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
10053 * process.c (Qprocessp): Don't declare static.
10054 * lisp.h (Qprocessp): Declare again.
10056 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
10058 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
10060 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
10062 Improve C-level modularity by making more things 'static'.
10064 Don't publish debugger-only interfaces to other modules.
10065 * lisp.h (safe_debug_print, debug_output_compilation_hack):
10066 (verify_bytepos, count_markers): Move decls to the only modules
10068 * region-cache.h (pp_cache): Likewise.
10069 * window.h (check_all_windows): Likewise.
10070 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
10072 * sysdep.c (croak): Now static, if
10073 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
10074 * syssignal.h (croak): Declare only if not static.
10076 * alloc.c (refill_memory_reserve): Now static if
10077 !defined REL_ALLOC || defined SYSTEM_MALLOC.
10078 * lisp.h (refill_memory_reserve): Declare only if not static.
10080 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
10081 Define only if USE_LUCID.
10083 * xrdb.c (x_customization_string, x_rm_string): Now static.
10085 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
10086 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
10088 * xdisp.c (draw_row_with_mouse_face): Now static.
10089 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
10091 * window.h (check_all_windows): Mark externally visible.
10093 * window.c (window_deletion_count): Now static.
10095 * undo.c: Make symbols static if they're not exported.
10096 (last_undo_buffer, last_boundary_position, pending_boundary):
10099 * textprop.c (interval_insert_behind_hooks): Now static.
10100 (interval_insert_in_front_hooks): Likewise.
10102 * term.c: Make symbols static if they're not exported.
10103 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
10104 (max_frame_lines, tty_set_terminal_modes):
10105 (tty_reset_terminal_modes, tty_turn_off_highlight):
10106 (get_tty_terminal): Now static.
10107 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
10108 * termhooks.h (term_mouse_moveto): Do not declare if
10109 HAVE_WINDOW_SYSTEM.
10110 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
10111 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
10113 * sysdep.c: Make symbols static if they're not exported.
10114 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
10116 (sigprocmask_set, full_mask): Remove; unused.
10117 (wait_debugging): Mark as visible.
10118 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
10119 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
10121 * syntax.c (syntax_temp): Define only if !__GNUC__.
10123 * sound.c (current_sound_device, current_sound): Now static.
10125 * search.c (searchbufs, searchbuf_head): Now static.
10127 * scroll.c (scroll_cost): Remove; unused.
10128 * dispextern.h (scroll_cost): Remove decl.
10130 * region-cache.h (pp_cache): Mark as externally visible.
10132 * process.c: Make symbols static if they're not exported.
10133 (process_tick, update_tick, create_process, chan_process):
10134 (Vprocess_alist, proc_buffered_char, datagram_access):
10135 (fd_callback_data, send_process_frame, process_sent_to): Now static.
10136 (deactivate_process): Mark defn as static, as well as decl.
10137 * lisp.h (create_process): Remove decl.
10138 * process.h (chan_process, Vprocess_alist): Remove decls.
10140 * print.c: Make symbols static if they're not exported.
10141 (print_depth, new_backquote_output, being_printed, print_buffer):
10142 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
10143 (print_interval, print_number_index, initial_stderr_stream):
10145 * lisp.h (Fprinc): Remove decl.
10146 (debug_output_compilation_hack): Mark as externally visible.
10148 * sysdep.c (croak): Move decl from here to syssignal.h.
10149 * syssignal.h (croak): Put it here, so the API can be checked when
10150 'croak' is called from dissociate_if_controlling_tty.
10152 * minibuf.c: Make symbols static if they're not exported.
10153 (minibuf_save_list, choose_minibuf_frame): Now static.
10154 * lisp.h (choose_minibuf_frame): Remove decl.
10156 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
10158 * lread.c: Make symbols static if they're not exported.
10159 (read_objects, initial_obarray, oblookup_last_bucket_number):
10161 (make_symbol): Remove; unused.
10162 * lisp.h (initial_obarray, make_symbol): Remove decls.
10164 * keyboard.c: Make symbols static if they're not exported.
10165 (single_kboard, recent_keys_index, total_keys, recent_keys):
10166 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
10167 (this_single_command_key_start, echoing, last_auto_save):
10168 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
10169 (command_loop, echo_now, keyboard_init_hook, help_char_p):
10170 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
10171 (Vlispy_mouse_stem, double_click_count):
10173 (force_auto_save_soon): Define only if SIGDANGER.
10174 (ignore_mouse_drag_p): Now static if
10175 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
10176 (print_help): Remove; unused.
10177 (stop_character, last_timer_event): Mark as externally visible.
10178 * keyboard.h (ignore_mouse_drag_p): Declare only if
10179 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
10180 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
10181 * lisp.h (echoing): Remove decl.
10182 (force_auto_save_soon): Declare only if SIGDANGER.
10183 * xdisp.c (redisplay_window): Simplify code, to make it more
10184 obvious that ignore_mouse_drag_p is not accessed if !defined
10185 USE_GTK && !defined HAVE_NS.
10187 * intervals.c: Make symbols static if they're not exported.
10188 (merge_properties_sticky, merge_interval_right, delete_interval):
10190 * intervals.h (merge_interval_right, delete_interval): Remove decls.
10192 * insdel.c: Make symbols static if they're not exported.
10193 However, leave prepare_to_modify_buffer alone. It's never
10194 called from outside this function, but that appears to be a bug.
10195 (combine_after_change_list, combine_after_change_buffer):
10196 (adjust_after_replace, signal_before_change): Now static.
10197 (adjust_after_replace_noundo): Remove; unused.
10198 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
10199 (signal_before_change): Remove decls.
10201 * indent.c (val_compute_motion, val_vmotion): Now static.
10203 * image.c: Make symbols static if they're not exported.
10204 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
10206 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
10207 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
10209 * fringe.c (standard_bitmaps): Now static.
10210 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
10212 * frame.c: Make symbols static if they're not exported.
10213 (x_report_frame_params, make_terminal_frame): Now static.
10214 (get_frame_param): Now static, unless HAVE_NS.
10215 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
10216 (x_get_resource_string): Remove; not used.
10217 * frame.h (make_terminal_frame, x_report_frame_params):
10218 (x_get_resource_string); Remove decls.
10219 (x_fullscreen_adjust): Declare only if WINDOWSNT.
10220 * lisp.h (get_frame_param): Declare only if HAVE_NS.
10222 * font.c, fontset.c: Make symbols static if they're not exported.
10223 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
10224 (FACE_SUITABLE_FOR_CHAR_P): Use it.
10225 * font.c (font_close_object): Now static.
10226 * font.h (font_close_object): Remove.
10227 * fontset.c (FONTSET_OBJLIST): Remove.
10228 (free_realized_fontset) #if-0 the body, which does nothing.
10229 (face_suitable_for_char_p): #if-0, as it's never called.
10230 * fontset.h (face_suitable_for_char_p): Remove decl.
10231 * xfaces.c (face_at_string_position):
10232 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
10233 since 0 is always ASCII.
10235 * fns.c (weak_hash_tables): Now static.
10237 * fileio.c: Make symbols static if they're not exported.
10238 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
10239 (Vwrite_region_annotation_buffers): Now static.
10241 * eval.c: Make symbols static if they're not exported.
10242 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
10243 * lisp.h (backtrace_list): Remove decl.
10245 * emacs.c: Make symbols static if they're not exported.
10246 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
10247 (fatal_error_code, fatal_error_signal_hook, standard_args):
10249 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
10250 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
10251 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
10252 * lisp.h (fatal_error_signal_hook): Remove decl.
10253 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
10255 * editfns.c: Move a (normally-unused) function to its only use.
10256 * editfns.c, lisp.h (get_operating_system_release): Remove.
10257 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
10258 worth the hassle of breaking this out.
10260 * xterm.c: Make symbols static if they're not exported.
10261 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
10262 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
10263 (x_destroy_window, x_delete_display):
10265 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
10266 (x_mouse_leave): Remove; unused.
10267 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
10268 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
10269 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
10271 (x_mouse_leave): Declare only if WINDOWSNT.
10272 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
10273 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
10276 * ftxfont.c: Make symbols static if they're not exported.
10277 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
10279 * font.h (ftxfont_driver): Likewise.
10281 * xfns.c: Make symbols static if they're not exported.
10282 (x_last_font_name, x_display_info_for_name):
10283 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
10284 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
10285 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
10286 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
10287 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
10288 (last_show_tip_args): Now static.
10289 (xic_defaut_fontset, xic_create_fontsetname): Define only if
10290 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
10291 (x_screen_planes): Remove; unused.
10292 * dispextern.h (x_screen_planes): Remove decl.
10294 * dispnew.c: Make symbols static if they're not exported.
10295 * dispextern.h (redraw_garbaged_frames, scrolling):
10296 (increment_row_positions): Remove.
10297 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
10298 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
10300 (redraw_garbaged_frames): Remove; unused.
10302 * xfaces.c: Make symbols static if they're not exported.
10303 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
10305 * xterm.h (defined_color): Remove decls.
10306 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
10307 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
10308 (menu_face_changed_default, defined_color, free_realized_face):
10309 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
10310 (ascii_face_of_lisp_face): Remove; unused.
10312 * xdisp.c: Make symbols static if they're not exported.
10313 * dispextern.h (scratch_glyph_row, window_box_edges):
10314 (glyph_to_pixel_coords, set_cursor_from_row):
10315 (get_next_display_element, set_iterator_to_next):
10316 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
10317 (show_mouse_face): Remove decls
10318 * frame.h (message_buf_print): Likewise.
10319 * lisp.h (pop_message, set_message, check_point_in_composition):
10321 * xterm.h (set_vertical_scroll_bar): Likewise.
10322 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
10323 (message_buf_print, scratch_glyph_row, displayed_buffer):
10324 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
10325 (get_next_display_element, show_mouse_face, window_box_edges):
10326 (frame_to_window_pixel_xy, check_point_in_composition):
10327 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
10328 (glyph_to_pixel_coords): Remove; unused.
10330 * dired.c (file_name_completion): Now static.
10332 * dbusbind.c (xd_in_read_queued_messages): Now static.
10334 * lisp.h (circular_list_error, FOREACH): Remove; unused.
10335 * data.c (circular_list_error): Remove.
10337 * commands.h (last_point_position, last_point_position_buffer):
10338 (last_point_position_window): Remove decls.
10339 * keyboard.c: Make these variables static.
10341 * coding.h (coding, code_convert_region, encode_coding_gap):
10343 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
10344 (iso_code_class, detect_coding, code_convert_region): Now static.
10345 (encode_coding_gap): Remove; unused.
10347 * chartab.c (chartab_chars, chartab_bits): Now static.
10349 * charset.h (charset_iso_8859_1): Remove decl.
10350 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
10353 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
10354 * ccl.c (Vccl_program_table): Now static.
10355 (check_ccl_update): Remove; unused.
10357 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
10358 * category.h: ... from here.
10359 * category.c (check_category_table, set_category_set): Now static.
10361 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
10362 * lisp.h: Remove these decls.
10364 * buffer.c (buffer_count): Remove unused var.
10366 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
10367 so that it's not optimized away.
10368 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
10369 * dispextern.h (bidi_dump_cached_states): Remove, since it's
10370 exported only to the debugger.
10372 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
10373 * atimer.h (run_all_atimers): Remove; not exported.
10375 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
10376 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
10377 was inaccessible from Lisp.
10378 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
10379 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
10381 alloc.c: Import and export fewer symbols, and remove unused items.
10382 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
10384 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
10385 it's not optimized away by whole-program optimization.
10386 (message_enable_multibyte, free_misc): Remove.
10387 (catchlist, handlerlist, mark_backtrace):
10388 Declare only if BYTE_MARK_STACK.
10389 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
10390 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
10391 (message_enable_multibyte): Remove decl.
10392 (free_misc, interval_free_list, float_block, float_block_index):
10393 (n_float_blocks, float_free_list, cons_block, cons_block_index):
10394 (cons_free_list, last_marked_index):
10396 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
10397 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
10398 (mark_backtrace): Define only if BYTE_MARK_STACK.
10399 * xdisp.c (message_enable_multibyte): Now static.
10401 Declare Lisp_Object Q* variables to be 'static' if not exported.
10402 This makes it easier for human readers (and static analyzers)
10403 to see whether these variables are used from other modules.
10404 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
10405 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
10406 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
10407 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
10408 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
10409 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
10410 * xmenu.c, xselect.c:
10411 Declare Q* vars static if they are not used in other modules.
10412 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
10413 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
10414 Remove decls of unexported vars.
10415 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
10417 * lisp.h (DEFINE_FUNC): Make sname 'static'.
10419 Make Emacs functions such as Fatom 'static' by default.
10420 This makes it easier for human readers (and static analyzers)
10421 to see whether these functions can be called from other modules.
10422 DEFUN now defines a static function. To make the function external
10423 so that it can be used in other C modules, use the new macro DEFUE.
10424 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
10425 (Finit_image_library):
10426 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
10427 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
10428 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
10429 Remove decls, since these functions are now static.
10430 (Funintern, Fget_internal_run_time): New decls, since these functions
10431 were already external.
10433 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
10434 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
10435 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
10436 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
10437 * keyboard.c, keymap.c, lread.c:
10438 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
10439 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
10440 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
10441 Mark functions with DEFUE instead of DEFUN,
10442 if they are used in other modules.
10443 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
10444 decls for now-static functions.
10445 * buffer.h (Fdelete_overlay): Remove decl.
10446 * callproc.c (Fgetenv_internal): Mark as internal.
10447 * composite.c (Fremove_list_of_text_properties): Remove decl.
10448 (Fcomposition_get_gstring): New forward static decl.
10449 * composite.h (Fcomposite_get_gstring): Remove decl.
10450 * dired.c (Ffile_attributes): New forward static decl.
10451 * doc.c (Fdocumntation_property): New forward static decl.
10452 * eval.c (Ffetch_bytecode): New forward static decl.
10453 (Funintern): Remove extern decl; now in .h file where it belongs.
10454 * fileio.c (Fmake_symbolic_link): New forward static decl.
10455 * image.c (Finit_image_library): New forward static decl.
10456 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
10457 * intervals.h (Fprevious_property_change):
10458 (Fremove_list_of_text_properties): Remove decls.
10459 * keyboard.c (Fthis_command_keys): Remove decl.
10460 (Fcommand_execute): New forward static decl.
10461 * keymap.c (Flookup_key): New forward static decl.
10462 (Fcopy_keymap): Now static.
10463 * keymap.h (Flookup_key): Remove decl.
10464 * process.c (Fget_process): New forward static decl.
10465 (Fprocess_datagram_address): Mark as internal.
10466 * syntax.c (Fsyntax_table_p): New forward static decl.
10467 (skip_chars): Remove duplicate decl.
10468 * textprop.c (Fprevious_property_change): New forward static decl.
10469 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
10471 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
10472 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
10474 * editfns.c (Fformat): Remove unreachable code.
10476 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
10478 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
10481 2011-04-13 Eli Zaretskii <eliz@gnu.org>
10483 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
10484 when at ZV. (Bug#8487)
10486 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
10488 * charset.c (Fclear_charset_maps): Use xfree instead of free.
10490 * keyboard.c (parse_tool_bar_item): Likewise.
10491 * sound.c (sound_cleanup, alsa_close): Likewise.
10492 * termcap.c (tgetent): Likewise.
10493 * xfns.c (x_default_font_parameter): Likewise.
10494 * xsettings.c (read_and_apply_settings): Likewise.
10496 * alloc.c (overrun_check_malloc, overrun_check_realloc)
10497 (overrun_check_free): Protoize.
10499 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
10501 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
10502 since callers should never pass a negative size.
10503 Change the signature to match that of plain 'read' and 'write'; see
10504 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
10505 * lisp.h: Update prototypes of emacs_write and emacs_read.
10507 2011-04-11 Eli Zaretskii <eliz@gnu.org>
10509 * xdisp.c (redisplay_window): Don't try to determine the character
10510 position of the scroll margin if the window start point w->startp
10511 is outside the buffer's accessible region. (Bug#8468)
10513 2011-04-10 Eli Zaretskii <eliz@gnu.org>
10515 Fix write-region and its subroutines for buffers > 2GB.
10516 * fileio.c (a_write, e_write): Modify declaration of arguments and
10517 local variables to support buffers larger than 2GB.
10518 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
10520 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
10521 argument, local variables, and return value.
10523 * lisp.h: Update prototypes of emacs_write and emacs_read.
10525 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
10527 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
10529 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
10531 Fix more problems found by GCC 4.6.0's static checks.
10533 * xdisp.c (vmessage): Use a better test for character truncation.
10535 * charset.c (load_charset_map): <, not <=, for optimization,
10536 and to avoid potential problems with integer overflow.
10537 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
10538 * casetab.c (set_identity, shuffle): Likewise.
10539 * editfns.c (Fformat): Likewise.
10540 * syntax.c (skip_chars): Likewise.
10542 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
10543 This also lets GCC 4.6.0 generate slightly better loop code.
10545 * callint.c (Fcall_interactively): <, not <=, for optimization.
10546 (Fcall_interactively): Count the number of arguments produced,
10547 not the number of arguments given. This is simpler and lets GCC
10548 4.6.0 generate slightly better code.
10550 * ftfont.c: Distingish more carefully between FcChar8 and char.
10551 The previous code passed unsigned char * to a functions like
10552 strlen and xstrcasecmp that expect char *, which does not
10553 conform to the C standard.
10554 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
10555 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
10556 char * when the C standard requires it.
10558 * keyboard.c (read_char): Remove unused var.
10560 * eval.c: Port to Windows vsnprintf (Bug#8435).
10561 Include <limits.h>.
10562 (SIZE_MAX): Define if the headers do not.
10563 (verror): Do not give up if vsnprintf returns a negative count.
10564 Instead, grow the buffer. This ports to Windows vsnprintf, which
10565 does not conform to C99. Problem reported by Eli Zaretskii.
10566 Also, simplify the allocation scheme, by avoiding the need for
10567 calling realloc, and removing the ALLOCATED variable.
10569 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
10571 Remove invocations of doprnt, as Emacs now uses vsnprintf.
10572 But keep the doprint source code for now, as we might revamp it
10573 and use it again (Bug#8435).
10574 * lisp.h (doprnt): Remove.
10575 * Makefile.in (base_obj): Remove doprnt.o.
10576 * deps.mk (doprnt.o): Remove.
10578 error: Print 32- and 64-bit integers portably (Bug#8435).
10579 Without this change, on typical 64-bit hosts error ("...%d...", N)
10580 was used to print both 32- and 64-bit integers N, which relied on
10581 undefined behavior.
10582 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
10583 * lisp.h (error, verror): Mark as printf-like functions.
10584 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
10585 Report overflow in size calculations when allocating printf buffer.
10586 Do not truncate output string at its first null byte.
10587 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
10588 Truncate the output at a character boundary, since vsnprintf does not
10590 * charset.c (check_iso_charset_parameter): Convert internal
10591 character to string before calling 'error', since %c now has the
10593 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
10594 overflow when computing char to be passed to 'error'. Do not
10595 pass Lisp_Object to 'error'; pass the integer instead.
10596 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
10597 formatted with plain %d.
10599 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
10601 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
10603 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
10605 * xterm.c (x_catch_errors): Remove duplicate declaration.
10607 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
10609 * xdisp.c, lisp.h (message_nolog): Remove; unused.
10611 2011-04-10 Jim Meyering <meyering@redhat.com>
10613 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
10614 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
10615 return ssize_t not "int", and use size_t as the buffer length.
10616 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
10617 * gnutls.h: Update declarations.
10618 * process.c (read_process_output): Use ssize_t, to match.
10619 (send_process): Likewise.
10621 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
10623 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
10625 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
10627 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
10628 Use unsigned char, to match FcChar8 type definition.
10630 * xterm.c (handle_one_xevent):
10631 * xmenu.c (create_and_show_popup_menu):
10632 * xselect.c (x_decline_selection_request)
10633 (x_reply_selection_request): Avoid type-punned deref of X events.
10635 2011-04-09 Eli Zaretskii <eliz@gnu.org>
10637 Fix some uses of `int' instead of EMACS_INT.
10638 * search.c (string_match_1, fast_string_match)
10639 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
10640 (scan_buffer, find_next_newline_no_quit)
10641 (find_before_next_newline, search_command, Freplace_match)
10642 (Fmatch_data): Make some `int' variables be EMACS_INT.
10644 * xdisp.c (display_count_lines): 3rd argument and return value now
10645 EMACS_INT. All callers changed.
10646 (pint2hrstr): Last argument is now EMACS_INT.
10648 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
10649 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
10650 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
10651 (decode_coding_utf_16, decode_coding_emacs_mule)
10652 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
10653 (decode_coding_ccl, decode_coding_charset)
10654 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
10655 (decode_coding_iso_2022, decode_coding_emacs_mule)
10656 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
10657 <char_offset, last_offset>: Declare EMACS_INT.
10658 (encode_coding_utf_8, encode_coding_utf_16)
10659 (encode_coding_emacs_mule, encode_invocation_designation)
10660 (encode_designation_at_bol, encode_coding_iso_2022)
10661 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
10662 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
10664 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
10665 (encode_invocation_designation): Last argument P_NCHARS is now
10667 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
10668 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
10670 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
10673 * ccl.c (Fccl_execute_on_string): Declare some variables
10676 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
10678 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
10680 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
10682 * process.c (Fformat_network_address): Doc fix.
10684 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
10686 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
10688 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
10690 * keyboard.c (read_char): Call Lisp function help-form-show,
10691 instead of using internal_with_output_to_temp_buffer.
10692 (Qhelp_form_show): New var.
10693 (syms_of_keyboard): Use DEFSYM macro.
10695 * print.c (internal_with_output_to_temp_buffer): Function deleted.
10697 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
10699 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
10701 * process.c (Flist_processes): Remove to Lisp.
10702 (list_processes_1): Delete.
10704 2011-04-06 Eli Zaretskii <eliz@gnu.org>
10706 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
10708 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
10710 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
10712 Fix more problems found by GCC 4.6.0's static checks.
10714 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
10716 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
10718 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
10720 * xdisp.c (vmessage): Mark as a printf-like function.
10722 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
10724 * sound.c (sound_warning): Don't crash if arg contains a printf format.
10726 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
10727 printf-like functions.
10728 (tiff_load): Add casts to remove these marks before passing them
10729 to system-supplied API.
10731 * eval.c (Fsignal): Remove excess argument to 'fatal'.
10733 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
10734 This avoids several warnings with gcc -Wstrict-overflow.
10735 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
10736 directly, rather than having caller test rule sign. This avoids
10737 some unnecessary tests.
10738 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
10739 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
10740 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
10742 * xfont.c (xfont_text_extents): Remove var that was set but not used.
10743 (xfont_open): Avoid unnecessary tests.
10745 * composite.c (composition_gstring_put_cache): Use unsigned integer.
10747 * composite.h, composite.c (composition_gstring_put_cache):
10748 Use EMACS_INT, not int, for length.
10750 * composite.h (COMPOSITION_DECODE_REFS): New macro,
10751 breaking out part of COMPOSITION_DECODE_RULE.
10752 (COMPOSITION_DECODE_RULE): Use it.
10753 * composite.c (get_composition_id): Remove unused local vars,
10754 by using the new macro.
10756 * textprop.c (set_text_properties_1): Change while to do-while,
10757 since the condition is always true at first.
10759 * intervals.c (graft_intervals_into_buffer): Mark var as used.
10760 (interval_deletion_adjustment): Return unsigned value.
10763 * process.c (list_processes_1, create_pty, read_process_output):
10764 (exec_sentinel): Remove vars that were set but not used.
10765 (create_pty): Remove unnecessary "volatile"s.
10766 (Fnetwork_interface_info): Avoid possibility of int overflow.
10767 (read_process_output): Do adaptive read buffering even if carryover.
10768 (read_process_output): Simplify nbytes computation if buffered.
10770 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
10772 * syntax.c (scan_words): Remove var that was set but not used.
10773 (update_syntax_table): Use unsigned instead of int.
10775 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
10776 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
10777 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
10779 * print.c (print_error_message): Avoid int overflow.
10781 * font.c (font_list_entities): Redo for clarity,
10782 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
10784 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
10785 (font_score): Avoid potential overflow in diff calculation.
10787 * fns.c (substring_both): Remove var that is set but not used.
10788 (sxhash): Redo loop for clarity and to avoid wraparound warning.
10790 * eval.c (funcall_lambda): Rename local to avoid shadowing.
10792 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
10793 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
10794 can always succeed if overflow has undefined behavior.
10796 * search.c (boyer_moore, wordify): Remove vars set but not used.
10797 (wordify): Omit three unnecessary tests.
10799 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
10800 All callers changed. This avoids the need for an unused var.
10802 * casefiddle.c (casify_region): Remove var that is set but not used.
10804 * dired.c (file_name_completion): Remove var that is set but not used.
10806 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
10808 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
10809 (Finsert_file_contents): Remove unnecessary code checking fd.
10811 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
10812 Check for integer overflow on size calculations.
10814 * buffer.c (Fprevious_overlay_change): Remove var that is set
10817 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
10818 Remove vars that are set but not used.
10819 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
10820 (timer_check_2): Mark vars as initialized.
10822 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
10824 * image.c (lookup_image): Remove var that is set but not used.
10825 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
10827 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
10828 that are set but not used.
10830 * xfns.c (make_invisible_cursor): Don't return garbage
10831 if XCreateBitmapFromData fails (Bug#8410).
10833 * xselect.c (x_get_local_selection, x_handle_property_notify):
10834 Remove vars that are set but not used.
10836 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
10837 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
10839 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
10840 Remove var that is set but not used.
10841 (scroll_bar_windows_size): Now size_t, not int.
10842 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
10843 Check for overflow.
10845 * xfaces.c (realize_named_face): Remove vars that are set but not used.
10846 (map_tty_color) [!defined MSDOS]: Likewise.
10848 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
10850 * coding.c: Remove vars that are set but not used.
10851 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
10852 All callers changed.
10853 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
10854 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
10855 (decode_coding_charset): Remove vars that are set but not used.
10857 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
10858 that is set but not used.
10860 * print.c (print_object): Remove var that is set but not used.
10862 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
10863 The gnulib version avoids calling malloc in the usual case,
10864 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
10865 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
10866 * filelock.c (current_lock_owner): Likewise.
10867 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
10868 * sysdep.c: Include allocator.h, careadlinkat.h.
10869 (emacs_no_realloc_allocator): New static constant.
10870 (emacs_readlink): New function.
10871 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
10872 ../lib/careadlinkat.h.
10874 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
10876 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
10877 first non-nil return value).
10879 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
10881 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
10882 if not defined (Bug#8403).
10884 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
10886 * xdisp.c (display_count_lines): Remove parameter `start',
10887 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
10888 (get_char_face_and_encoding): Remove parameter `multibyte_p',
10889 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
10890 (fill_stretch_glyph_string): Remove parameters `row' and `area',
10891 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
10892 and thereabouts. All callers changed.
10893 (get_per_char_metric): Remove parameter `f', unused since
10894 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
10896 2011-04-02 Jim Meyering <meyering@redhat.com>
10898 do not dereference NULL upon failed strdup
10899 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
10900 (ns_get_family): Likewise.
10902 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
10904 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
10906 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
10908 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
10911 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
10913 Add lexical binding.
10915 * window.c (Ftemp_output_buffer_show): New fun.
10916 (Fsave_window_excursion):
10917 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
10919 * lread.c (lisp_file_lexically_bound_p): New function.
10920 (Fload): Bind Qlexical_binding.
10921 (readevalloop): Remove `evalfun' arg.
10922 Bind Qinternal_interpreter_environment.
10923 (Feval_buffer): Bind Qlexical_binding.
10924 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
10926 (syms_of_lread): Declare `lexical-binding'.
10928 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
10930 * keyboard.c (eval_dyn): New fun.
10931 (menu_item_eval_property): Use it.
10933 * image.c (parse_image_spec): Use Ffunctionp.
10935 * fns.c (concat, mapcar1): Accept byte-code-functions.
10937 * eval.c (Fsetq): Handle lexical vars.
10938 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
10939 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
10940 (FletX, Flet): Obey lexical binding.
10941 (Fcommandp): Handle closures.
10942 (Feval): New `lexical' arg.
10943 (eval_sub): New function extracted from Feval. Use it almost
10944 everywhere where Feval was used. Look up vars in lexical env.
10946 (Ffunctionp): Move from subr.el.
10947 (Ffuncall): Handle closures.
10948 (apply_lambda): Remove `eval_flags'.
10949 (funcall_lambda): Handle closures and new byte-code-functions.
10950 (Fspecial_variable_p): New function.
10951 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
10952 but without exporting it to Lisp.
10954 * doc.c (Fdocumentation, store_function_docstring):
10955 * data.c (Finteractive_form): Handle closures.
10957 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
10960 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
10962 (exec_byte_code): New function extracted from Fbyte_code to handle new
10963 calling convention for byte-code-functions. Add new byte-codes.
10965 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
10967 * alloc.c (Fmake_symbol): Init new `declared_special' field.
10969 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
10971 * xdisp.c (redisplay_internal): Fix prototype.
10973 2011-03-31 Eli Zaretskii <eliz@gnu.org>
10975 * xdisp.c (SCROLL_LIMIT): New macro.
10976 (try_scrolling): Use it when setting scroll_limit.
10977 Limit scrolling to 100 screen lines.
10978 (redisplay_window): Even when falling back on "recentering",
10979 position point in the window according to scroll-conservatively,
10980 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
10982 (try_scrolling): When point is above the window, allow searching
10983 as far as scroll_max, or one screenful, to compute vertical
10984 distance from PT to the scroll margin position. This prevents
10985 try_scrolling from unnecessarily failing when
10986 scroll-conservatively is set to a value slightly larger than the
10987 window height. Clean up the case of PT below the margin at bottom
10988 of window: scroll_max can no longer be INT_MAX. When aggressive
10989 scrolling is in use, don't let point enter the opposite scroll
10990 margin as result of the scroll.
10991 (syms_of_xdisp) <scroll-conservatively>: Document the
10992 threshold of 100 lines for never-recentering scrolling.
10994 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
10996 * dispextern.h (move_it_by_lines):
10997 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
10998 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
10999 (message_log_check_duplicate): Remove parameters `prev_bol' and
11000 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
11001 (redisplay_internal): Remove parameter `preserve_echo_area',
11002 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
11004 * indent.c (Fvertical_motion):
11005 * window.c (window_scroll_pixel_based, Frecenter):
11006 Don't pass `need_y_p' to `move_it_by_lines'.
11008 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
11010 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
11011 steal a few bits to be more compact.
11012 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
11013 Remove unneeded casts.
11015 * bytecode.c (Fbyte_code): CAR and CDR can GC.
11017 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
11019 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
11020 binding" message (bug#7967).
11022 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
11024 Fix more problems found by GCC 4.6.0's static checks.
11026 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
11027 Remove unused local var.
11029 * editfns.c (Fmessage_box): Remove unused local var.
11031 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
11032 (note_mode_line_or_margin_highlight, note_mouse_highlight):
11033 Omit unused local vars.
11034 * window.c (shrink_windows): Omit unused local var.
11035 * menu.c (digest_single_submenu): Omit unused local var.
11036 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
11037 Omit unused local var.
11039 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
11040 Don't assume string length fits in int.
11041 (keyremap_step, read_key_sequence): Use size_t for sizes.
11042 (read_key_sequence): Don't check last_real_key_start redundantly.
11044 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
11045 instead of alloca (Bug#8344).
11047 * eval.c (Fbacktrace): Don't assume nargs fits in int.
11048 (Fbacktrace_frame): Don't assume nframes fits in int.
11050 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
11052 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
11055 * term.c (produce_glyphless_glyph): Remove unnecessary test.
11057 * cm.c (calccost): Turn while-do into do-while, for clarity.
11059 * keyboard.c (syms_of_keyboard): Use the same style as later
11060 in this function when indexing through an array. This also
11061 works around GCC bug 48267.
11063 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
11065 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
11067 * chartab.c (sub_char_table_ref_and_range): Redo for slight
11068 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
11070 * keyboard.c, keyboard.h (num_input_events): Now size_t.
11071 This avoids undefined behavior on integer overflow, and is a bit
11072 more convenient anyway since it is compared to a size_t variable.
11074 Variadic C functions now count arguments with size_t, not int.
11075 This avoids an unnecessary limitation on 64-bit machines, which
11076 caused (substring ...) to crash on large vectors (Bug#8344).
11077 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
11078 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
11079 All variadic functions and their callers changed accordingly.
11080 (struct gcpro.nvars): Now size_t, not int. All uses changed.
11081 * data.c (arith_driver, float_arith_driver): Likewise.
11082 * editfns.c (general_insert_function): Likewise.
11083 * eval.c (struct backtrace.nargs, interactive_p)
11084 (internal_condition_case_n, run_hook_with_args, apply_lambda)
11085 (funcall_lambda, mark_backtrace): Likewise.
11086 * fns.c (concat): Likewise.
11087 * frame.c (x_set_frame_parameters): Likewise.
11088 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
11089 0 if not found, not -1. All callers changed.
11091 * alloc.c (garbage_collect): Don't assume stack size fits in int.
11092 (stack_copy_size): Now size_t, not int.
11093 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
11095 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
11097 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
11098 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11099 All callers changed.
11101 * lisp.h (multibyte_char_to_unibyte):
11102 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
11103 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
11104 * character.h (CHAR_TO_BYTE8):
11105 * cmds.c (internal_self_insert):
11106 * editfns.c (general_insert_function):
11107 * keymap.c (push_key_description):
11108 * search.c (Freplace_match):
11109 * xdisp.c (message_dolog, set_message_1): All callers changed.
11111 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
11113 * keyboard.c (safe_run_hook_funcall): New function.
11114 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
11115 don't set the hook to nil, but remove the offending function instead.
11116 (Qcommand_hook_internal): Remove, unused.
11117 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
11118 Vcommand_hook_internal.
11120 * eval.c (enum run_hooks_condition): Remove.
11121 (funcall_nil, funcall_not): New functions.
11122 (run_hook_with_args): Call each function through a `funcall' argument.
11123 Remove `cond' argument, now redundant.
11124 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
11125 (Frun_hook_with_args_until_failure): Adjust accordingly.
11126 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
11128 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
11130 * dispextern.h (string_buffer_position): Remove declaration.
11132 * print.c (strout): Remove parameter `multibyte', unused since
11133 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
11135 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
11136 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
11137 All callers changed.
11139 * w32.c (_wsa_errlist): Use braces for struct initializers.
11141 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
11142 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
11143 All callers changed.
11144 (string_buffer_position): Likewise. Also, make static (it's never
11145 used outside xdisp.c).
11146 (cursor_row_p): Remove parameter `w', unused since
11147 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
11148 (decode_mode_spec): Remove parameter `precision', introduced during
11149 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
11150 All callers changed.
11152 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11154 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
11156 2011-03-27 Anders Lindgren <andlind@gmail.com>
11158 * nsterm.m (ns_menu_bar_is_hidden): New variable.
11159 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
11160 (ns_update_auto_hide_menu_bar): New functions.
11161 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
11162 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
11163 ns_constrain_all_frames.
11164 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
11165 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
11167 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
11169 * nsmenu.m (runDialogAt): Remove argument to timer_check.
11171 2011-03-27 Glenn Morris <rgm@gnu.org>
11173 * syssignal.h: Replace RETSIGTYPE with void.
11174 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
11175 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
11176 Replace SIGTYPE with void everywhere.
11177 * s/usg5-4-common.h (SIGTYPE): Remove definition.
11178 * s/template.h (SIGTYPE): Remove commented out definition.
11180 2011-03-26 Eli Zaretskii <eliz@gnu.org>
11182 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
11183 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
11185 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
11187 * w32.c (read_unc_volume): Use parameter `henum', instead of
11188 global variable `wget_enum_handle'.
11190 * keymap.c (describe_vector): Remove parameters `indices' and
11191 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
11192 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
11194 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
11196 * keyboard.c (timer_check): Remove parameter `do_it_now',
11197 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
11198 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
11199 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
11201 * keyboard.c (read_char):
11202 * w32menu.c (w32_menu_display_help):
11203 * xmenu.c (show_help_event, menu_help_callback):
11204 Adjust calls to `show_help_echo'.
11206 * gtkutil.c (xg_maybe_add_timer):
11207 * keyboard.c (readable_events):
11208 * process.c (wait_reading_process_output):
11209 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
11211 * insdel.c (adjust_markers_gap_motion):
11212 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
11213 (gap_left, gap_right): Don't call it.
11215 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
11217 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
11218 incurred during fontification.
11220 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
11222 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
11223 (DEFVAR_PER_BUFFER): Don't pass it.
11225 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
11226 (scrolling_window): Don't pass it.
11228 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
11230 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
11232 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
11234 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
11235 of variables specific to SELinux and computation of `encoded_absname'.
11237 * image.c (XPutPixel): Remove unused variable `height'.
11239 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
11241 * unexw32.c (get_section_info): Remove unused variable `section'.
11243 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
11244 (system_process_attributes): Remove unused variable `sess'.
11245 (sys_read): Remove unused variable `err'.
11247 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
11248 (w32_wnd_proc): Remove unused variable `isdead'.
11249 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
11250 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
11251 (x_create_tip_frame): Remove unused variable `tem'.
11253 * w32inevt.c (w32_console_read_socket):
11254 Remove unused variable `no_events'.
11256 * w32term.c (x_draw_composite_glyph_string_foreground):
11257 Remove unused variable `width'.
11259 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
11261 * w32term.c (x_set_glyph_string_clipping):
11262 Don't pass uninitialized region to CombineRgn.
11264 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
11266 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
11267 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
11268 (Fx_close_connection): Remove unused variable `i'.
11270 * w32font.c (w32font_draw): Return number of glyphs.
11271 (w32font_open_internal): Remove unused variable `i'.
11272 (w32font_driver): Add missing initializer.
11274 * w32menu.c (utf8to16): Remove unused variable `utf16'.
11275 (fill_in_menu): Remove unused variable `items_added'.
11277 * w32term.c (last_mouse_press_frame): Remove static global variable.
11278 (w32_clip_to_row): Remove unused variable `f'.
11279 (x_delete_terminal): Remove unused variable `i'.
11281 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
11282 (NOTHING): Remove unused static global variable.
11283 (uniscribe_check_otf): Remove unused variable `table'.
11284 (uniscribe_font_driver): Add missing initializers.
11286 2011-03-23 Julien Danjou <julien@danjou.info>
11288 * term.c (Fsuspend_tty, Fresume_tty):
11289 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
11290 * window.c (temp_output_buffer_show):
11291 * insdel.c (signal_before_change):
11292 * frame.c (Fhandle_switch_frame):
11293 * fileio.c (Fdo_auto_save):
11294 * emacs.c (Fkill_emacs):
11295 * editfns.c (save_excursion_restore):
11296 * cmds.c (internal_self_insert):
11297 * callint.c (Fcall_interactively):
11298 * buffer.c (Fkill_all_local_variables):
11299 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
11301 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
11302 unconditionally since it does the check itself.
11304 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
11306 Fix more problems found by GCC 4.5.2's static checks.
11308 * coding.c (encode_coding_raw_text): Avoid unnecessary test
11309 the first time through the loop, since we know p0 < p1 then.
11310 This also avoids a gcc -Wstrict-overflow warning.
11312 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
11313 leading to a memory leak, possible in functions like
11314 load_charset_map_from_file that can allocate an unbounded number
11315 of objects (Bug#8318).
11317 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
11318 that could (at least in theory) be that large.
11320 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
11321 This is less likely to overflow, and avoids undefined behavior if
11322 overflow does occur. All callers changed. Use strtoul to scan
11323 for the unsigned long integer.
11324 (pint2hrstr): Simplify and tune code slightly.
11325 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
11327 * scroll.c (do_scrolling): Work around GCC bug 48228.
11328 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
11330 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
11331 This also avoids a warning with gcc -Wstrict-overflow.
11332 (validate_x_resource_name): Simplify count usage.
11333 This also avoids a warning with gcc -Wstrict-overflow.
11335 * fileio.c (Fcopy_file): Report error if fchown or fchmod
11338 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
11340 * process.c (Fmake_network_process): Use socklen_t, not int,
11341 where POSIX says socklen_t is required in portable programs.
11342 This fixes a porting bug on hosts like 64-bit HP-UX, where
11343 socklen_t is wider than int (Bug#8277).
11344 (Fmake_network_process, server_accept_connection):
11345 (wait_reading_process_output, read_process_output):
11348 * process.c: Rename or move locals to avoid shadowing.
11349 (list_processes_1, Fmake_network_process):
11350 (read_process_output_error_handler, exec_sentinel_error_handler):
11351 Rename or move locals.
11352 (Fmake_network_process): Define label "retry_connect" only if needed.
11353 (Fnetwork_interface_info): Fix pointer signedness.
11354 (process_send_signal): Add cast to avoid pointer signedness problem.
11355 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
11356 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
11358 Make tparam.h and terminfo.c consistent.
11359 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
11360 Include tparam.h instead, since it declares them.
11361 * cm.h (PC): Remove extern decl; tparam.h now does this.
11362 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
11363 * terminfo.c: Include tparam.h, to check interfaces.
11364 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
11365 (tparam): Adjust signature to match interface in tparam.h;
11366 this removes some undefined behavior. Check that outstring and len
11367 are zero, which they always are with Emacs.
11368 * tparam.h (PC, BC, UP): New extern decls.
11370 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
11371 (xftfont_open): Rename locals to avoid shadowing.
11373 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
11374 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
11375 (OTF_TAG_SYM): Omit macro if not needed.
11376 (ftfont_list): Remove unused local.
11377 (get_adstyle_property, ftfont_pattern_entity):
11378 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
11379 Rename locals to avoid shadowing.
11381 * xfont.c (xfont_list_family): Mark var as initialized.
11383 * xml.c (make_dom): Now static.
11385 * composite.c (composition_compute_stop_pos): Rename local to
11387 (composition_reseat_it): Remove unused locals.
11388 (find_automatic_composition, composition_adjust_point): Likewise.
11389 (composition_update_it): Mark var as initialized.
11390 (find_automatic_composition): Mark vars as initialized,
11391 with a FIXME (Bug#8290).
11393 character.h: Rename locals to avoid shadowing.
11394 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
11395 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
11396 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
11397 (BUF_DEC_POS): Be more systematic about renaming local temporaries
11398 to avoid shadowing.
11400 * textprop.c (property_change_between_p): Remove; unused.
11402 * intervals.c (interval_start_pos): Now static.
11404 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
11406 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
11407 Rename locals to avoid shadowing.
11409 * sound.c (wav_play, au_play, Fplay_sound_internal):
11410 Fix pointer signedness.
11411 (alsa_choose_format): Remove unused local var.
11412 (wav_play): Initialize a variable to 0, to prevent undefined
11413 behavior (Bug#8278).
11415 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
11417 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
11419 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
11420 clobbering (Bug#8298).
11421 * sysdep.c (sys_subshell): Likewise.
11422 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
11424 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
11425 This should get cleaned up, so that child_setup has the
11426 same signature on all platforms.
11428 * callproc.c (call_process_cleanup): Now static.
11429 (relocate_fd): Rename locals to avoid shadowing.
11431 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
11433 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
11434 not to be necessary, and produces flickering.
11436 2011-03-20 Glenn Morris <rgm@gnu.org>
11438 * config.in: Remove file.
11440 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
11442 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
11443 are now in src/globals.h.
11444 (syms_of_minibuf): Remove spurious & from previous change.
11446 2011-03-20 Leo Liu <sdl.web@gmail.com>
11448 * minibuf.c (completing-read-function): New variable.
11449 (completing-read-default): Rename from completing-read.
11450 (completing-read): Call completing-read-function.
11452 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
11454 * xfaces.c (Fx_load_color_file):
11455 Read color file from absolute filename (bug#8250).
11457 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
11459 * makefile.w32-in: Update dependencies.
11461 2011-03-17 Eli Zaretskii <eliz@gnu.org>
11463 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
11465 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
11467 Fix more problems found by GCC 4.5.2's static checks.
11469 * process.c (make_serial_process_unwind, send_process_trap):
11470 (sigchld_handler): Now static.
11472 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
11473 That way, the code declares only the vars that it needs.
11474 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
11475 * s/cygwin.h (PTY_ITERATION): Likewise.
11476 * s/darwin.h (PTY_ITERATION): Likewise.
11477 * s/gnu-linux.h (PTY_ITERATION): Likewise.
11479 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
11480 * process.c (allocate_pty): Don't declare stb unless it's needed.
11482 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
11483 (CONSTANTLIM): Remove; unused.
11484 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
11485 Define only if needed.
11487 * unexelf.c (unexec): Name an expression,
11488 to avoid gcc -Wbad-function-cast warning.
11489 Use a different way to cause a compilation error if anyone uses
11490 n rather than nn, a way that does not involve shadowing.
11491 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
11493 * deps.mk (unexalpha.o): Remove; unused.
11495 New file unexec.h, the (simple) interface for unexec (Bug#8267).
11496 * unexec.h: New file.
11497 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
11498 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
11499 Depend on unexec.h.
11500 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
11501 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
11502 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
11503 Change as necessary to match prototype in unexec.h.
11505 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
11507 (back_comment, skip_chars): Mark vars as initialized.
11509 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
11510 Rename locals to avoid shadowing.
11512 * lread.c (read1): Rewrite so as not to use empty "else".
11513 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
11515 * print.c (Fredirect_debugging_output): Fix pointer signedess.
11517 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
11518 warning when compiling print.c.
11520 * font.c (font_unparse_fcname): Abort in an "impossible" situation
11521 instead of using an uninitialized var.
11522 (font_sort_entities): Mark var as initialized.
11524 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
11526 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
11527 pointers to constants.
11528 (font_parse_fcname): Remove unused vars.
11529 (font_delete_unmatched): Now static.
11530 (font_get_spec): Remove; unused.
11531 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
11532 (font_update_drivers, Ffont_get_glyphs, font_add_log):
11533 Rename or move locals to avoid shadowing.
11535 * fns.c (require_nesting_list, require_unwind): Now static.
11536 (Ffillarray): Rename locals to avoid shadowing.
11538 * floatfns.c (domain_error2): Define only if needed.
11539 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
11541 * alloc.c (mark_backtrace): Move decl from here ...
11542 * lisp.h: ... to here, so that it can be checked.
11544 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
11545 (Fdefvar): Rewrite so as not to use empty "else".
11546 (lisp_indirect_variable): Name an expression,
11547 to avoid gcc -Wbad-function-cast warning.
11548 (Fdefvar): Rename locals to avoid shadowing.
11550 * callint.c (quotify_arg, quotify_args): Now static.
11551 (Fcall_interactively): Rename locals to avoid shadowing.
11552 Use const pointer when appropriate.
11554 * lisp.h (get_system_name, get_operating_system_release):
11555 Move decls here, to check interfaces.
11556 * process.c (get_operating_system_release): Move decl to lisp.h.
11557 * xrdb.c (get_system_name): Likewise.
11558 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
11559 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
11560 some of which prompt warnings from gcc -Wbad-function-cast.
11561 (Fformat_time_string, Fencode_time, Finsert_char):
11562 (Ftranslate_region_internal, Fformat):
11563 Rename or remove local vars to avoid shadowing.
11564 (Ftranslate_region_internal): Mark var as initialized.
11566 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
11569 * lisp.h (eassert): Check that the argument compiles, even if
11570 ENABLE_CHECKING is not defined.
11572 * data.c (Findirect_variable): Name an expression, to avoid
11573 gcc -Wbad-function-cast warning.
11574 (default_value, arithcompare, arith_driver, arith_error): Now static.
11575 (store_symval_forwarding): Rename local to avoid shadowing.
11576 (Fmake_variable_buffer_local, Fmake_local_variable):
11577 Mark variables as initialized.
11578 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
11580 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
11581 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
11582 Rename locals to avoid shadowing.
11583 (mark_stack): Move local variables into the #ifdef region where
11585 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
11586 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
11588 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
11589 (GC_STRING_CHARS): Remove; not used.
11590 (Fmemory_limit): Cast sbrk's returned value to char *.
11592 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
11593 avoids undefined behavior in theory.
11595 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
11597 Use functions, not macros, for up- and down-casing (Bug#8254).
11598 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
11599 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
11600 to use the following functions instead of these macros.
11601 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
11602 EMACS_INT, since callers assume the returned value fits in int.
11603 (upcase1): Likewise, for UPCASE_TABLE.
11604 (uppercasep, lowercasep, upcase): New static inline functions.
11605 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
11606 the race-condition problem in the old DOWNCASE.
11608 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
11609 Rename locals to avoid shadowing.
11610 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
11611 (regex_compile, re_search_2, re_match_2_internal):
11612 Remove unused local vars.
11613 (FREE_VAR): Rewrite so as not to use empty "else",
11614 which gcc can warn about.
11615 (regex_compile, re_match_2_internal): Mark locals as initialized.
11616 (RETALLOC_IF): Define only if needed.
11617 (WORDCHAR_P): Likewise. This one is never needed, but is used
11618 only in a comment talking about a compiler bug, so put inside
11619 the #if 0 of that comment.
11620 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
11621 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
11624 * search.c (boyer_moore): Rename locals to avoid shadowing.
11625 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
11626 (PREV_CHAR_BOUNDARY): Likewise.
11628 * search.c (simple_search): Remove unused var.
11630 * dired.c (compile_pattern): Move decl from here ...
11631 * lisp.h: ... to here, so that it can be checked.
11632 (struct re_registers): New forward decl.
11634 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
11636 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
11638 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
11639 Rename locals to avoid shadowing.
11640 (Fvertical_motion): Mark locals as initialized.
11642 * casefiddle.c (casify_object, casify_region): Now static.
11643 (casify_region): Mark local as initialized.
11645 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
11647 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
11648 New macros, so that the caller can use some names other than
11649 gcpro1, gcpro2, etc.
11650 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
11652 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
11653 argument, for consistency with GCPRO2_VAR, etc: it is now the
11654 prefix of the variable, not the variable itself. All uses
11656 * dired.c (directory_files_internal, file_name_completion):
11657 Rename locals to avoid shadowing.
11659 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
11660 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
11661 dired.c's scmp function, had undefined behavior.
11662 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
11663 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
11664 * buffer.h: ... to here, because these macros use current_buffer,
11665 and the new implementation with inline functions needs to have
11666 current_buffer in scope now, rather than later when the macros
11668 (downcase, upcase1): New static inline functions.
11669 (DOWNCASE, UPCASE1): Reimplement using these functions.
11670 This avoids undefined behavior in expressions like
11671 DOWNCASE (x) == DOWNCASE (y), which previously suffered
11672 from race conditions in accessing the global variables
11673 case_temp1 and case_temp2.
11674 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
11675 * lisp.h (case_temp1, case_temp2): Remove their decls.
11676 * character.h (ASCII_CHAR_P): Move from here ...
11677 * lisp.h: ... to here, so that the inline functions mentioned
11678 above can use them.
11680 * dired.c (directory_files_internal_unwind): Now static.
11682 * fileio.c (file_name_as_directory, directory_file_name):
11683 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
11685 (file_name_as_directory): Use const pointers when appropriate.
11686 (Fexpand_file_name): Likewise. In particular, newdir might
11687 point at constant storage, so make it a const pointer.
11688 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
11689 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
11691 (Fset_file_times, Finsert_file_contents, auto_save_error):
11692 Rename locals to avoid shadowing.
11694 * minibuf.c (choose_minibuf_frame_1): Now static.
11695 (Ftry_completion, Fall_completions): Rename or remove locals
11696 to avoid shadowing.
11698 * marker.c (bytepos_to_charpos): Remove; unused.
11700 * lisp.h (verify_bytepos, count_markers): New decls,
11701 so that gcc does not warn that these functions aren't declared.
11703 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
11704 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
11705 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
11706 (copy_text): Remove unused local var.
11708 * filelock.c (within_one_second): Now static.
11709 (lock_file_1): Rename local to avoid shadowing.
11711 * buffer.c (fix_overlays_before): Mark locals as initialized.
11712 (fix_start_end_in_overlays): Likewise. This function should be
11713 simplified by using pointers-to-pointers, but that's a different
11715 (switch_to_buffer_1): Now static.
11716 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
11717 (report_overlay_modification): Rename locals to avoid shadowing.
11719 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
11720 Fix pointer signedness issue.
11721 (sys_subshell): Mark local as volatile if checking for lint,
11722 to suppress a gcc -Wclobbered warning that does not seem to be right.
11723 (MAXPATHLEN): Define only if needed.
11725 * process.c (serial_open, serial_configure): Move decls from here ...
11726 * systty.h: ... to here, so that they can be checked.
11728 * fns.c (get_random, seed_random): Move extern decls from here ...
11729 * lisp.h: ... to here, so that they can be checked.
11731 * sysdep.c (reset_io): Now static.
11732 (wait_for_termination_signal): Remove; unused.
11734 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
11735 (copy_keymap_item, append_key, push_text_char_description):
11737 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
11738 (DENSE_TABLE_SIZE): Remove; unused.
11739 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
11740 (describe_map_tree):
11741 Rename locals to avoid shadowing.
11743 * keyboard.c: Declare functions static if they are not used elsewhere.
11744 (echo_char, echo_dash, cmd_error, top_level_2):
11745 (poll_for_input, handle_async_input): Now static.
11746 (read_char, kbd_buffer_get_event, make_lispy_position):
11747 (make_lispy_event, make_lispy_movement, apply_modifiers):
11748 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
11749 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
11750 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
11751 (read_key_sequence, read_char): Mark locals as initialized.
11752 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
11754 * keyboard.h (make_ctrl_char): New decl.
11755 (mark_kboards): Move decl here ...
11756 * alloc.c (mark_kboards): ... from here.
11758 * lisp.h (force_auto_save_soon): New decl.
11760 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
11761 (DEFINE_DUMMY_FUNCTION): New macro.
11762 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
11764 (main): Add casts to avoid warnings
11765 if GCC considers string literals to be constants.
11767 * lisp.h (fatal_error_signal): Add decl, since it's exported.
11769 * dbusbind.c: Pointer signedness fixes.
11770 (xd_signature, xd_append_arg, xd_initialize):
11771 (Fdbus_call_method, Fdbus_call_method_asynchronously):
11772 (Fdbus_method_return_internal, Fdbus_method_error_internal):
11773 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
11774 (Fdbus_register_signal): Use SSDATA when the context wants char *.
11776 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
11777 if GCC considers string literals to be constants.
11778 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
11780 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
11782 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
11783 (print_preprocess, print_object): New macro to fix last change.
11785 * print.c (print_preprocess): Don't forget font objects.
11787 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
11789 * emacs.c (USAGE3): Doc fixes.
11791 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
11793 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
11796 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
11798 * lisp.h (VWindow_system, Qfile_name_history):
11799 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
11800 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
11801 (w32_system_caret_x, w32_system_caret_y): Declare extern.
11803 * w32select.c: Don't #include "keyboard.h".
11804 (run_protected): Add extern declaration for waiting_for_input.
11806 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
11807 * w32console.c (detect_input_pending, read_input_pending)
11808 (encode_terminal_code):
11809 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
11810 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
11811 (w32_system_caret_y, Qfile_name_history):
11812 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
11813 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
11814 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
11815 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
11816 * w32proc.c (Qlocal, report_file_error):
11817 * w32term.c (Vwindow_system, updating_frame):
11818 * w32uniscribe.c (initialized, uniscribe_font_driver):
11819 Remove unneeded extern declarations.
11821 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
11823 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
11825 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
11827 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
11828 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
11829 These macros can no longer be used for assignment.
11831 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
11832 Assign struct members directly, instead of using BUF_BEGV etc.
11833 (record_buffer_markers, fetch_buffer_markers): New functions for
11834 recording and fetching special buffer markers.
11835 (set_buffer_internal_1, set_buffer_temp): Use them.
11837 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
11839 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
11841 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
11842 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
11844 * xdisp.c (hscroll_window_tree):
11845 (reconsider_clip_changes): Use PT instead of BUF_PT.
11847 2011-03-13 Eli Zaretskii <eliz@gnu.org>
11849 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
11850 $(EMACS_ROOT)/lib/intprops.h.
11852 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
11854 Fix more problems found by GCC 4.5.2's static checks.
11856 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
11857 to unsigned char * to avoid compiler diagnostic.
11858 (xg_free_frame_widgets): Make it clear that a local variable is
11859 needed only if USE_GTK_TOOLTIP.
11860 (gdk_window_get_screen): Make it clear that this macro is needed
11861 only if USE_GTK_TOOLTIP.
11862 (int_gtk_range_get_value): New function, which avoids a diagnostic
11863 from gcc -Wbad-function-cast.
11864 (xg_set_toolkit_scroll_bar_thumb): Use it.
11865 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
11866 diagnostic from gcc -Wbad-function-cast.
11867 (get_utf8_string, xg_get_file_with_chooser):
11868 Rename locals to avoid shadowing.
11869 (create_dialog): Move locals to avoid shadowing.
11871 * xgselect.c (xg_select): Remove unused var.
11873 * image.c (four_corners_best): Mark locals as initialized.
11874 (gif_load): Initialize transparent_p to zero (Bug#8238).
11875 Mark another local as initialized.
11876 (my_png_error, my_error_exit): Mark with NO_RETURN.
11878 * image.c (clear_image_cache): Now static.
11879 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
11880 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
11881 (x_edge_detection): Remove unnecessary cast that
11882 gcc -Wbad-function-cast diagnoses.
11883 (gif_load): Fix pointer signedness.
11884 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
11885 (jpeg_load, gif_load): Rename locals to avoid shadowing.
11887 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
11889 Improve quality of tests for time stamp overflow.
11890 For example, without this patch (encode-time 0 0 0 1 1
11891 1152921504606846976) returns the obviously-bogus value (-948597
11892 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
11893 reports time overflow. See
11894 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
11895 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
11896 * editfns.c: Include limits.h and intprops.h.
11897 (TIME_T_MIN, TIME_T_MAX): New macros.
11898 (time_overflow): Move earlier, to before first use.
11899 (hi_time, lo_time): New functions, for an accurate test for
11900 out-of-range times.
11901 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
11902 (Fget_internal_run_time): Don't assume time_t fits in int.
11903 (make_time): Use list2 instead of Fcons twice.
11904 (Fdecode_time): More accurate test for out-of-range times.
11905 (check_tm_member): New function.
11906 (Fencode_time): Use it, to test for out-of-range times.
11907 (lisp_time_argument): Don't rely on undefined left-shift and
11908 right-shift behavior when checking for time stamp overflow.
11910 * editfns.c (time_overflow): New function, refactoring common code.
11911 (Fformat_time_string, Fdecode_time, Fencode_time):
11912 (Fcurrent_time_string): Use it.
11914 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
11915 * dired.c (make_time): Move to ...
11916 * editfns.c (make_time): ... here.
11917 * systime.h: Note the move.
11919 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11921 * fringe.c (update_window_fringes): Remove unused variables.
11923 * unexmacosx.c (copy_data_segment): Also copy __got section.
11926 2011-03-12 Eli Zaretskii <eliz@gnu.org>
11928 * termcap.c [MSDOS]: Include "msdos.h".
11929 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
11930 Constify `char *' arguments and their references according to
11931 prototypes in tparam.h.
11933 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
11935 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
11936 Adapt all references accordingly.
11938 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
11940 2011-03-11 Tom Tromey <tromey@redhat.com>
11942 * buffer.c (syms_of_buffer): Remove obsolete comment.
11944 2011-03-11 Eli Zaretskii <eliz@gnu.org>
11946 * termhooks.h (encode_terminal_code): Declare prototype.
11948 * msdos.c (encode_terminal_code): Don't declare prototype.
11950 * term.c (encode_terminal_code): Now external again, used by
11951 w32console.c and msdos.c.
11953 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
11954 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
11956 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
11958 Fix some minor problems found by GCC 4.5.2's static checks.
11960 * fringe.c (update_window_fringes): Mark locals as initialized
11962 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
11964 * alloc.c (mark_fringe_data): Move decl from here ...
11965 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
11966 to check its interface.
11967 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
11969 * fontset.c (free_realized_fontset): Now static.
11970 (Fset_fontset_font): Rename local to avoid shadowing.
11971 (fontset_font): Mark local as initialized.
11972 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
11974 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
11976 * xselect.c (x_disown_buffer_selections): Remove; not used.
11977 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
11978 (x_own_selection, Fx_disown_selection_internal): Rename locals
11979 to avoid shadowing.
11980 (x_handle_dnd_message): Remove local to avoid shadowing.
11982 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
11983 so that the caller can use some name other than gcpro1.
11984 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
11985 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11986 (Fx_backspace_delete_keys_p):
11987 Use them to avoid shadowing, and rename vars to avoid shadowing.
11988 (x_decode_color, x_set_name, x_window): Now static.
11989 (Fx_create_frame): Add braces to silence GCC warning.
11990 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
11991 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
11992 Remove unused locals.
11993 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
11994 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
11995 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
11998 * xterm.h (x_mouse_leave): New decl.
12000 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
12001 Remove unused functions.
12002 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
12003 (x_calc_absolute_position): Now static.
12004 (XTread_socket): Don't define label "out" unless it's used.
12005 Don't declare local "event" unless it's used.
12006 (x_iconify_frame, x_free_frame_resources): Don't declare locals
12007 unless they are used.
12008 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
12009 (x_fatal_error_signal): Remove; not used.
12010 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
12011 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
12012 (x_error_catcher, x_connection_closed, x_error_handler):
12013 (x_error_quitter, xembed_send_message, x_iconify_frame):
12014 (my_log_handler): Rename locals to avoid shadowing.
12015 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
12016 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
12018 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
12019 Rename or move locals to avoid shadowing.
12020 (tty_defined_color, merge_face_heights): Now static.
12021 (free_realized_faces_for_fontset): Remove; not used.
12022 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
12023 does not deduce is never used uninitialized.
12024 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
12025 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
12027 * terminal.c (store_terminal_param): Now static.
12029 * xmenu.c (menu_highlight_callback): Now static.
12030 (set_frame_menubar): Remove unused local.
12031 (xmenu_show): Rename parameter to avoid shadowing.
12032 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
12033 since they might point to immutable storage.
12034 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
12035 since it's unused otherwise.
12037 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
12038 Add a FIXME, since the code still doesn't look right. (Bug#8215)
12039 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
12040 avoids a gcc -Wuninitialized diagnostic.
12041 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
12042 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
12043 does not deduce are never used uninitialized.
12045 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
12047 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
12048 * window.c (window_loop, size_window):
12049 (run_window_configuration_change_hook, enlarge_window): Likewise.
12051 * window.c (display_buffer): Now static.
12052 (size_window): Mark variables that gcc -Wuninitialized
12053 does not deduce are never used uninitialized.
12054 * window.h (check_all_windows): New decl, to forestall
12055 gcc -Wmissing-prototypes diagnostic.
12056 * dispextern.h (bidi_dump_cached_states): Likewise.
12058 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
12060 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
12061 Include <limits.h>.
12062 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
12063 and to avoid gcc -Wuninitialized warning.
12064 (load_charset_map): Mark variables that gcc -Wuninitialized
12065 does not deduce are never used uninitialized.
12066 (load_charset): Abort instead of using uninitialized var (Bug#8229).
12068 * coding.c (coding_set_source, coding_set_destination):
12069 Use "else { /* comment */ }" rather than "else /* comment */;"
12070 for clarity, and to avoid gcc -Wempty-body warning.
12071 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
12072 a block, when the outer 'i' will do.
12073 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
12074 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
12075 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
12076 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
12077 (Fdecode_sjis_char, Fdefine_coding_system_internal):
12078 Rename locals to avoid shadowing.
12079 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
12080 * coding.c (emacs_mule_char, encode_invocation_designation):
12081 Now static, since they're not used elsewhere.
12082 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
12083 (decode_coding_object, encode_coding_object, detect_coding_system):
12084 (decode_coding_emacs_mule): Mark variables that gcc
12085 -Wuninitialized does not deduce are never used uninitialized.
12086 (detect_coding_iso_2022): Initialize a local variable that might
12087 be used uninitialized. Leave a FIXME because it's not clear that
12088 this initialization is needed. (Bug#8211)
12089 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
12090 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
12091 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
12092 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
12093 Remove unused macros.
12095 * category.c (hash_get_category_set): Remove unused local var.
12096 (copy_category_table): Now static, since it's not used elsewhere.
12097 * character.c (string_count_byte8): Likewise.
12099 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
12100 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
12102 * chartab.c (copy_sub_char_table): Now static, since it's not used
12104 (sub_char_table_ref_and_range, char_table_ref_and_range):
12105 Rename locals to avoid shadowing.
12106 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
12108 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
12109 (BIDI_BOB): Remove unused macro.
12111 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
12112 deduce are never used uninitialized.
12113 * term.c (encode_terminal_code): Likewise.
12115 * term.c (encode_terminal_code): Now static. Remove unused local.
12117 * tparam.h: New file.
12118 * term.c, tparam.h: Include it.
12119 * deps.mk (term.o, tparam.o): Depend on tparam.h.
12120 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
12121 Move these decls to tparam.h, and make them agree with what
12122 is actually in tparam.c. The previous trick of using incompatible
12123 decls in different modules does not conform to the C standard.
12124 All callers of tparam changed to use tparam's actual API.
12125 * tparam.c (tparam1, tparam, tgoto):
12126 Use const pointers where appropriate.
12128 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
12129 * cm.h (struct cm): Likewise.
12130 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
12131 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
12132 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
12133 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
12134 (turn_on_face, init_tty): Likewise.
12135 * termchar.h (struct tty_display_info): Likewise.
12137 * term.c (term_mouse_position): Rename local to avoid shadowing.
12139 * alloc.c (mark_ttys): Move decl from here ...
12140 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
12142 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
12144 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
12146 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
12148 * search.c (compile_pattern_1): Remove argument regp, unused since
12149 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
12150 (compile_pattern): Don't pass it.
12152 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
12154 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
12155 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
12157 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
12159 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
12161 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
12162 gdk_window_get_screen, gdk_window_get_geometry,
12163 gdk_x11_window_lookup_for_display and GDK_KEY_g.
12164 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
12165 (xg_get_pixbuf_from_pixmap): New function.
12166 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
12167 to Pixmap, take frame as parameter, remove GdkColormap parameter.
12168 Call xg_get_pixbuf_from_pixmap instead of
12169 gdk_pixbuf_get_from_drawable.
12170 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
12171 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
12172 (xg_check_special_colors): Use GtkStyleContext and its functions
12174 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
12175 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
12176 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
12177 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
12178 Call gtk_widget_get_preferred_size.
12179 (xg_frame_resized): gdk_window_get_geometry only takes 5
12181 (xg_win_to_widget, xg_event_is_for_menubar):
12182 Call gdk_x11_window_lookup_for_display.
12183 (xg_set_widget_bg): New function.
12184 (delete_cb): New function.
12185 (xg_create_frame_widgets): Connect delete-event to delete_cb.
12186 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
12187 (xg_set_background_color): Call xg_set_widget_bg.
12188 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
12189 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
12190 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
12191 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
12193 (update_frame_tool_bar): Call gtk_widget_hide.
12194 (xg_initialize): Use GDK_KEY_g.
12196 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
12198 (x_session_initialize): Call gdk_x11_set_sm_client_id.
12200 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
12201 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
12202 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
12204 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
12206 * w32xfns.c (select_palette): Check success of RealizePalette against
12207 GDI_ERROR, not zero.
12209 See ChangeLog.11 for earlier changes.
12211 ;; Local Variables:
12215 Copyright (C) 2011-2012 Free Software Foundation, Inc.
12217 This file is part of GNU Emacs.
12219 GNU Emacs is free software: you can redistribute it and/or modify
12220 it under the terms of the GNU General Public License as published by
12221 the Free Software Foundation, either version 3 of the License, or
12222 (at your option) any later version.
12224 GNU Emacs is distributed in the hope that it will be useful,
12225 but WITHOUT ANY WARRANTY; without even the implied warranty of
12226 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12227 GNU General Public License for more details.
12229 You should have received a copy of the GNU General Public License
12230 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.